# Recompiling UNIX and Linux software for OSX



## alexachucarro (Jul 10, 2002)

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


----------



## tie (Jul 10, 2002)

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.


----------



## alexachucarro (Jul 12, 2002)

Completely over my head!?

In idiots terms. Never used UNIX.


----------



## btoneill (Jul 12, 2002)

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


----------



## jmaynard (Jul 13, 2002)

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.)


----------



## ladavacm (Jul 15, 2002)

> _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.


----------

