Am 13.4.2012 um 17:45 schrieb Roy Mendelssohn:

>> I have hitherto used a Leopard system to build Mac binary packages for 
>> distribution, but that system has died and we only have Lion systems left 
>> (and the replacement hardware only runs Lion).  I'm only concerned with 
>> building i386/x86_64 packages.
> 

Setting MACOSX_DEPLOYMENT_TARGET to 10.5 is the minimal prerequisite. The next 
one is the compiler: it has to be same that runs on Leopard – and has there its 
libraries installed. GCC 4.2 or LLVM GCC 4.2 are the choices. A final 
requirement is the corresponding SDK – for Leopard it has to be the 10.5 SDK, 
which does not come with Snow Leopard's or Lion's Xcode versions, so you need 
to install some Xcode 3.x/3.2 version, obtained from the Apple developers 
connection. Then two different cases must be handled: that of static and that 
of shared or dynamic libraries. The first case applies for software that uses 
non-Mac OS X libraries (JPEG, PNG, ...). The binaries need to be linked with 
them statically, i.e., they carry these libraries inside them (like an 
application bundle). These libraries need to be built and "installed" 
(somewhere) on the host on which the binaries are being built. When the 
binaries are meant to support both 32- and 64-bit hardware two libraries with 
i386 and x86_64 support need to be combined with lipo. The executable is built 
in one compiler run which produces two objects and then stitches them together 
with the combined static library (or libraries).

The case of software that does not need "external" software is the most simple: 
invoke the compiler and it produces a fat binary with support for i386 and 
x86_64 architectures. It's not the default behaviour a compiler, it has to be 
instructed to build such special objects. The compiler needs CFLAGS like "-arch 
i386 -arch x86_64 -isysroot /Developer5/SDKs/MacOSX10.5.sdk -iwithsysroot 
/Developer5/SDKs/MacOSX10.5.sdk" and LDFLAGS like "-arch i386 -arch x86_64 
-isysroot /Developer5/SDKs/MacOSX10.5.sdk -iwithsysroot 
/Developer5/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5". Additionally you 
can set

        CXX="g++-4.2 -Xarch_i386 -m32 -Xarch_i386 -march=prescott -Xarch_i386 
-msse3 -Xarch_x86_64 -march=nocona -Xarch_x86_64 -m64 -Xarch_x86_64 -msse3 
-Xarch_x86_64 -mssse3"
         CC="gcc-4.2 -Xarch_i386 -m32 -Xarch_i386 -march=prescott -Xarch_i386 
-msse3 -Xarch_x86_64 -march=nocona -Xarch_x86_64 -m64 -Xarch_x86_64 -msse3 
-Xarch_x86_64 -mssse3"
        CPP=cpp-4.2

which name the GCC components to be used and set optimisation subtleties for 
each of the two architectures. To build the static libraries they don't need to 
be used, because you need for each architecture one dedicated run/build (and 
then lipo to combine them), so -Xarch_<arch> is not needed to specify the 
target architecture of the optimisation.

--
Greetings

  Pete

You can learn many things from children.  How much patience you have, for 
instance.
                                – Franklin P. Jones


------------------------------------------------------------------------------
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2
_______________________________________________
Fink-users mailing list
[email protected]
List archive:
http://news.gmane.org/gmane.os.macosx.fink.user
Subscription management:
https://lists.sourceforge.net/lists/listinfo/fink-users

Reply via email to