Recompiling UNIX and Linux software for OSX

alexachucarro

I'm 1/4 Basque you know?...
Please can anyone tell me how to recompile UNIX and Linux apps for OS X.

I'd like to know exactly how to do this.

Ta
 
It really depends on the particular program. For very simple programs, or programs which have been designed with platform-independence in mind, the compile path should be unchanged and the makefile should just work -- type "make". For more complicated programs, you need to first compile and install any required libraries. For programs with a graphical interface, if you don't want the user to have to install X-windows you'll need to rewrite the GUI code.
 
If you've never used unix, and never programmed unix, you're best off not even attempting to port a unix app to os x. Best bet is to download fink, and wait for someone else to port it, and let fink handle the installation.

Just because it's a unix app, unless the code has already been ported to work for os x, the odds of it compiling and running correctly is not very good. The older the app, the more likely it is to work as the old school unix programmers knew how to write portable code, where the new school programmers think portable means it compiles on both their computers, one running RedHat 5, the other RedHat 6.

This is not just an OS X issue, but a unix issue in general. So many people write apps that use very os specific calls they become almost unportable, I think they learned to program on Windows ;) Hell, the linux folks have even figured out how to write apps so non-portable they only work on their specific flavor of linux :)

Now, on the other hand, if you're familiar with C coding, shared objects, X, and the misc X toolkits, have at it :)

Now, if you are really hellbent on learning to program and port unix apps to os x, pick up a good unix primer book, a good book on unix systems administration, and a couple good C programming books. After alot of work and reading and trial and error at some point you'll figure it out :)

Brian
 
I'm the maintainer of Hercules, an open source emulator for IBM mainframe systems that currently runs on Linux and Windows, and, with some work, on *BSD. Since I got an iMac, I'd like to make it run on OS X, too. I'm running into lots of little issues having to do with the port. Where do I find out how to do things like printf() formats portably? (OS X uses q to designate a quadword/long long format, while everyone else uses ll; q is explicitly deprecated in C99.)
 
Originally posted by jmaynard
I'm the maintainer of Hercules, an open source emulator for IBM mainframe systems that currently runs on Linux and Windows, and, with some work, on *BSD. Since I got an iMac, I'd like to make it run on OS X, too. I'm running into lots of little issues having to do with the port. Where do I find out how to do things like printf() formats portably? (OS X uses q to designate a quadword/long long format, while everyone else uses ll; q is explicitly deprecated in C99.)

OS X uses whatever FreeBSD libc used around the time of 3.2-RELEASE (cca. early 1999). You guessed it, it was q :) Version 10.2 of OS X should update to FreeBSD 4.4 userland, including libc. This should help.
 
Back
Top