[AD] OS X universal binaries

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


Currently OS X supports universal binaries (PPC + Intel) via:

---
ifdef UB
CFLAGS+= -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk
LFLAGS+= -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk
endif

...

ifdef UB
DYLINK_FLAGS+=-arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk
endif
---

It works, but you cannot target OS X 10.3 or earlier. I propose that
we change it to work like:

ifdef UB
CC = misc/gcc-uni.sh
endif

gcc-uni.sh is a script I wrote that wraps around gcc to build
universal builds. Because it's a drop-in replacement for gcc, it can
be used on all sorts of UNIXy libraries that have no idea about OS X
or universal builds.

It works by compiling the code separately with gcc-3.3 and gcc-4. This
provides support for OS X 10.3 and OS X 10.2 (untested). I'm pretty
sure this is the same approach used by the XCode IDE.

Any comments?

--
Matthew Leverton




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