|
|
#1 |
|
Prospect
Join Date: Aug 2011
Posts: 35
|
Compiling and Socat
Hello,
In order to carry out some experiments at work iI have needed to compile a command line utility called 'Socat' http://http://www.dest-unreach.org/socat/ I have compiled it on my laptop running 10.7.3. In the future I will be required to install it on several other machines. If the hardware and OS version differ ie: a Mac Mini running 10.7.2 or other will I need to compile 'Socat' for each machine? Can I make an installer to use with Apple Remote Desktop? If yes, any guidance would be appreciated. Thanks, Dan |
|
|
|
|
|
#2 |
|
MVP
Join Date: May 2004
Posts: 2,012
|
I can't help with the installer, but generally you should match the major OS version (10.5, 10.6, 10.7, ...) and the machine architecture (ppc or i386/x86-64). If the program doesn't link to any system libraries ('otool -L socat') you can probably forget about the OS version.
|
|
|
|
|
|
#3 |
|
All Star
Join Date: Dec 2004
Posts: 677
|
Assuming same CPU, a program compiled on one OS should be portable to any newer one and usually to older within that major version but often not portable back to older major OS version if it links to system-supplied libs (which socat does on my machine...readline and openssl among others). So built in 10.6.2 would be fine on 10.6.3+ and 10.7.x but maybe not to 10.5.x. There are ways to specify more extensive backward compatibility if you want it. There are ways to build a "universal" binary that would work on different CPU, but it's not a default (on the other hand, some intel machines can run ppc binaries thanks to rosetta).
|
|
|
|
|
|
#4 |
|
Prospect
Join Date: Aug 2011
Posts: 35
|
Thanks for your reponses. It looks like I shouldn't have a problem using socat compiled on my machine on others then. The only issue is what is the most efficent way of installing it.
I have found a packagemaker.app from Apple and think that it is the correct thing to use. The issue is I am not 100% percent sure as to what files I need to include in the installation. It looks like I have socat unix executable after my orginal compile. Can I simply copy this to each machine in the /usr/local/bin folder? dmacks, as you have used socat before I'd love you opinion on the following: The machine I plan to install and run socat on will be connect to a display via a USB-serial cable. I plan to use socat as a serial device server. So far my plan is to use Platypus http://sveinbjorn.org/platypus to wrap a socat command into an application. Then, use launchd to ensure it starts up after each reboot and restarts should the app crash. Do you think this is the best method? My doubts are that should the Platypus made app crash, that it doesnt necessarily mean that socat has crashed. Any pointers will be gratfully recieved. Thanks, Dan |
|
|
|
|
|
#5 |
|
All Star
Join Date: Dec 2004
Posts: 677
|
I haven't actually used socat in a loooong time; just quickly built it (via its fink package) to see what libraries it used. However, it seems like maybe overkill/overly-convoluted to roll a command-line program into a clickable app and then use a non-GUI system facility to baby-sit it as a task without any user interaction.
|
|
|
|
|
|
#6 |
|
Prospect
Join Date: Aug 2011
Posts: 35
|
Hello, fair point.
In slight contrast to the threads title, what is the best way for me to distribute socat? I have looked at the packagemaker.app tool created by Aple and am confident on how to use it and how to make it search the target system for min requirments. The issue I am unsure about is whether installing socat is as straighforward as copying the unix executable to the correct folder? Thanks, Dan |
|
|
|
|
|
#7 |
|
Guest
Posts: n/a
|
I've just had to do this.
I copied a compiled version of socat to opt/local/bin and 2 libraries libncurses.5.dylib + libreadline.6.2.dylib to opt/local/lib for it to run on a machine without macports installed. |
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|