Re: [AD] fix for universal mac build on PPC

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


On 1/5/07, Matthew Leverton <meffer@xxxxxxxxxx> wrote:
The following switch is added to the various UB flags:
-isysroot /Developer/SDKs/MacOSX10.4u.sdk

Don't forget to also add
-Wl,-syslibroot,/Developer/SDKs/MacOSX10.4u.sdk to the linking flags,
to make sure we link against the proper libs.

I believe this means that the universal build will require a minimum
of OS X 10.4 for both PPC and Intel. However, I'm not sure if there is
any clean way around that without coming up with a brand new build
system. From my (limited) understanding, in order to target different
versions of OS X for the PPC and Intel builds within a makefile, you'd
have to build the project twice and then use "lipo" to combine both
binaries into one.

Yes, this would be the better way to do things, but it looks difficult
using your build system. There is one kinda hacky way around this:
write a short shell (or perl) script as a wrapper for gcc. Then if we
set CC = $WRAPPER in the Makefile, our wrapper could turn

$CC -arch ppc -arch i386  $FLAGS -o foo.o ...

into

$REAL_CC_PPC -arch ppc $FLAGS $PPC_FLAGS -o foo.o.ppc ...
$REAL_CC_I386 -arch i386 $FLAGS $I386_FLAGS -o foo.o.i386 ...
lipo foo.o.ppc foo.o.i386 -create -output foo.o

Like I said, quite hacky but it ought to work. If we do not do this,
all the 10.3 users will be left out in the cold if we distribute
universal builds.

Dave




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/