From: Neil Stevens Date: 2006-01-13T22:27:28+09:00 Subject: Building fat binaries on Mac OS X Hello, I'm not sure if this is the right list for this, but I had some trouble building a PowerPC + Intel binary of ruby 1.8.4 on Mac OS X. Specifically, a define was missing, and the CC I set wasn't used to build extensions. It took a couple of changes to configure for me to fix it (patch below). How to port these changes back from configure, to the sources that generate configure, I don't know, sorry. But, my hope is that someone here is much more familiar with the generation of configure, and can port these changes back for inclusion in the next Ruby version. For the curious, the necessary configure line for me, on OS X 10.4.4 with Xcode 2.2, was: CC="cc -isysroot /Developer/SDKs/MacOSX10.4u.sdk" LD="ld -syslibroot /Developer/SDKs/MacOSX10.4u.sdk" ./configure --enable-fat-binary="ppc,i386" thanks, --- ruby-1.8.4/configure 2005-12-24 04:36:33.000000000 -0800 +++ Development/ruby-1.8.4/configure 2006-01-13 04:43:07.000000000 -0800 @@ -14394,7 +14394,7 @@ rhapsody*) : ${LDSHARED='cc -dynamic -bundle -undefined suppress'} : ${LDFLAGS=""} rb_cv_dlopen=yes ;; - darwin*) : ${LDSHARED='cc -dynamic -bundle -undefined suppress -flat_namespace'} + darwin*) : ${LDSHARED="\$(CC) -dynamic -bundle -undefined suppress -flat_namespace"} : ${LDFLAGS=""} : ${LIBPATHENV=DYLD_LIBRARY_PATH} rb_cv_dlopen=yes ;; @@ -15385,6 +15385,11 @@ arch="fat-${target_os}" cat >>confdefs.h <<_ACEOF +#define __ARCHITECTURE__ "${arch}" +_ACEOF + + + cat >>confdefs.h <<_ACEOF #define RUBY_THIN_ARCHLIB "${RUBY_LIB_PATH}/" __ARCHITECTURE__ "-${target_os}" _ACEOF -- Neil Stevens - neil@hakubi.us 'A republic, if you can keep it.' -- Benjamin Franklin