|
I'm with OSX Lion, compiling for backwards compability with 10.5 (even 10.4 compiles). I don't do any static libs/exes. Here is my script, which compiles for 386/x86_64 and merges them into one fat (universal) exe. I have to switch and compile with gcc-4.2 which is GNU GCC, not LLVM
malkia ~/p/ufo/build/OSX $ gcc-4.2 -v
Using built-in specs.
Target: i686-apple-darwin11
Configured with: /private/var/tmp/gcc/gcc-5666.3~353/src/configure --disable-checking --enable-werror --prefix=/usr --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-transform-name=/^[cg][^.-]*$/s/$/-4.2/ --with-slibdir=/usr/lib --build=i686-apple-darwin11 --program-prefix=i686-apple-darwin11- --host=x86_64-apple-darwin11 --target=i686-apple-darwin11 --with-gxx-include-dir=/include/c++/4.2.1
Thread model: posix
gcc version 4.2.1 (Apple Inc. build 5666) (dot 3)
malkia ~/p/ufo/build/OSX $ which gcc-4.2
/usr/bin/gcc-4.2
here is the compile script:
https://github.com/malkia/ufo/blob/master/build/OSX/luajit.sh
LUAJIT=../luajit
rm *.tmp 1>/dev/null 2>/dev/null
make -C $LUAJIT -j BUILDMODE=dynamic CC="gcc-4.2 -mmacosx-version-min=10.4 -arch i386" LUAJIT_SO=libluajit.dylib TARGET_DYLIBPATH=libluajit.dylib cleaner
make -C $LUAJIT -j BUILDMODE=dynamic CC="gcc-4.2 -mmacosx-version-min=10.4 -arch i386" LUAJIT_SO=libluajit.dylib TARGET_DYLIBPATH=libluajit.dylib amalg
mv $LUAJIT/src/luajit luajit32.tmp
mv $LUAJIT/src/libluajit.dylib libluajit32.dylib.tmp
make -C $LUAJIT -j BUILDMODE=dynamic CC="gcc-4.2 -mmacosx-version-min=10.4 -arch x86_64" LUAJIT_SO=libluajit.dylib TARGET_DYLIBPATH=libluajit.dylib cleaner
make -C $LUAJIT -j BUILDMODE=dynamic CC="gcc-4.2 -mmacosx-version-min=10.4 -arch x86_64" LUAJIT_SO=libluajit.dylib TARGET_DYLIBPATH=libluajit.dylib amalg
mv $LUAJIT/src/luajit luajit64.tmp
mv $LUAJIT/src/libluajit.dylib libluajit64.dylib.tmp
lipo -create ./luajit*.tmp -output luajit
lipo -create ./libluajit*.dylib.tmp -output libluajit.dylib
# rm *.tmp 1>/dev/null 2>/dev/null
install_name_tool -id @rpath/libluajit.dylib libluajit.dylib
install_name_tool -change libluajit.dylib @executable_path/libluajit.dylib luajit
git --git-dir=$LUAJIT/.git log -1 >> luajit
git --git-dir=$LUAJIT/.git log -1 >> libluajit.dylib
mv luajit ../some-place-to-install-luajit
mv libluajit.dylib ../some-place-to-install-luajit
I haven't downloaded yet the latest XCode 4.5 beta, here is what I got currently:
xcodebuild -version
Xcode 4.2
Build version 4D139
As I always do "cleaner" instead of clean, relying on lua installed already (in my case through MacPorts - "port install lua")
On 8/13/11 10:44 PM, Ralph Eastwood wrote:
I am not sure, but the preprocessor check for __llvm__ may need to beHi,
I had a compilation error when compiling on the new OS X lion - it
boiled down to /usr/include/unwind.h being different than the standard
GCC version.
In particular, _Unwind_Exception_Class and _Unwind_Ptr, are not
declared, but where they are referenced previously, uint64_t and
uintptr_t are used instead. I've not done any form of extensive testing,
but the attached patch seems to suffice to make it compile.
stricter, in the sense that maybe llvm-gcc on linux probably uses the
standard GCC unwind.h.
Cheers,
Tai Chi Minh Ralph Eastwood