universal flags and configuration
Anders F Björklund
afb at macports.org
Thu Feb 7 01:30:15 PST 2008
I've added some configure. flags for +universal variants,
and also to the macports.conf file for providing defaults.
They are:
- universal_target
# for setting macosx_deployment_target and configure target
Default: 10.4
- universal_sysroot
# the SDK "sysroot" to use, normally for the -isysroot flag
Default: /Developer/SDKs/MacOSX10.4u.sdk
- universal_archs
# machine architectures to use, can be more than just one
Default: ppc i386
There are some workarounds for known shortcomings/bugs, such as
setting -mmacosx-version-min instead of macosx_deployment_target
when the variable don't want to take effect, or adding -syslibroot
on PowerPC so that it doesn't forget to use the Intel versions...
The additions means that it will now cross-compile when necessary,
and that +universal target is meant to generate similar binaries*.
By changing the values, it's possible to build for the Leopard SDK
and even the Panther SDK (cross-compiling to a previous OS version)
Currently these do _not_ affect the MacPorts os. variables, though.
These use the currently running operating system, and nothing else
(i.e. they aren't affected by changing these universal variables)
So it would still say "+darwin_9" and "+i386", even for Panther SDK.
However, if you do set the universal_target to a certain version
then it will pass matching configure flags to autoconf/automake.
For instance, when using the default MacOSX10.4u.sdk, it'll use:
configure --host=i686-apple-darwin8 --target=i686-apple-darwin8
It still only works for ports using configure and not hardcoding
architecture into generated files (like endianness for instance),
and there still needs to be an implementation that will build
twice (once for each arch) and then merge the results together.
Also left to do is to wire the above settings into Xcode group,
by using appropriate parameters to the xcodebuild(1) command...
(variables like SYSROOT and ARCHS should be straightforward,
and I think the remaining one is MACOSX_DEPLOYMENT_TARGET ?)
Thoughts?
--anders
* this default is a change from MacPorts 1.6.0, that used 10.5 SDK
on Leopard and 10.4u SDK on Tiger (but is the same as in 1.5/1.4)
More information about the macports-dev
mailing list