set deployment target from macports.conf

Ryan Schmidt ryandesign at
Fri Aug 22 01:57:19 PDT 2008

On Aug 22, 2008, at 03:40, Harry van der Wolf wrote:

> I'm currently on Tiger but I'm planning to move to Leopard. I build  
> bundles for 2 open source projects currently by "hand compiling"  
> almost every library as universal. I'm trying to move to MacPorts  
> as that's much simpler and MacPorts has much improved in the  
> Universal section.
> If I build an application bundle on Leopard using macports, it will  
> crash on Tiger with a bus error. Most possibly due to the default  
> deployment target and mmacosx-version-min which are default set to  
> 10.5 on Leopard 10.5 (I assume?)
> So, is it possible to set the macosx_deployment_target and CFLAG/ 
> CXXFLAG setting -mmacosx-version-min to 10.4 also on Leopard as a  
> default in macports.conf or another configuration file?
> Or to make it specific:
> Can I add
> "configure.macosx_deployment_target       10.4"
> "configure.fcflags-append   -mmacosx-version-min=10.4"
> in macports.conf to be able to also build for Tiger on Leopard?
> - Or should I "patch" one of the scripts/files in /opt/local/var/ 
> macports/sources/ to do this.
> - Or should I build macports from source specifying some parameter?
> If you know a much better way how to achieve my goal than please  
> tell me.

Yes, you can set this in macports.conf, if you're running MacPorts  
from trunk. (This feature is not in MacPorts 1.6.0.)

You will need to set a number of settings:

universal_target	10.4
universal_sysroot	/Developer/SDKs/MacOSX10.4u.sdk
x11prefix		/usr/X11R6

You can also set universal_archs, but setting it to anything other  
than "ppc i386" is not guaranteed to work with all ports. Heck,  
universal variants are not guaranteed to work with all ports.

That's all the settings I know of, but even so, it may not work.  
Using these settings, I was unable to build software on Leopard and  
run it on Tiger. (It still used /usr/X11 as the X11 path, which is  
where X11 is on Leopard but not on Tiger.) I gave up at that point so  
I don't know how to solve it. If your software doesn't use X11 then  
it might work for you.

More information about the macports-users mailing list