Hi Graeme (and Garib),

> As a general point, this is a problem with Apple, which really started
> with the original Leopard release after Tiger was mainstream - if you
> compile on there it won't work on earlier releases (esp. fink compilers)

Not to be an Apple apologist, but this is generally not true.  If you use a
Leopard-only technology in the form of a framework or similar feature that
doesn't exist on 10.4, then yes, you're stuck running on 10.5+, but for
most scientific and traditional UNIX applications, it's fairly simple to
compile on 10.5 and target an earlier OS X release.

> If however anyone knows how to make backwards compatible binaries e.g.
> from Leopard to Tiger, I'm all ears.

For most compilations, all you need is:

export MACOSX_DEPLOYMENT_TARGET=10.4

If you're using a 3rd party compiler (Intel, Portland), then it's probably
a good idea to manually add:

export LDFLAGS=-macosx_version_min=10.4

If you are going to use an OS X Framework, then you need to target the
version that shipped with the OS you want to run on:

export LDFLAGS="-isysroot /Developer/SDKs/MacOSX10.4u.sdk"
export CFLAGS="-isysroot /Developer/SDKs/MacOSX10.4u.sdk"

And as a general rule for all compilations, I like to use:

export LDFLAGS=-Wl,-headerpad_max_install_names

which increases the max path length for linked library names in Mach-O
binaries.  This lets you use the install_name_tool utility to mangle the
path names and relocate the program easily.

As a side note, we have a network of development/build machines, including
older releases of OS X, that are available to scientific developers:

http://sbgrid.org/wiki/developers:about

So if you don't want to tinker with the environmental settings to target 
an older release, I can give you an account on a 10.4 machine that you can
use.

-ben

--
| Ben Eisenbraun                              | Software Sysadmin      |
| Structural Biology Grid                     | http://sbgrid.org      |
| Harvard Medical School                      | http://hms.harvard.edu |

Reply via email to