Toggling cross-compilation
Thu Aug 02, 2007 · 59 words

Many source distribution will compile fine for both i386 and PPC Macs. For those that don't, I keep this function in my .bash_profile:

ub() {
  echo -n "Cross-compiling "
  if [ $1 = "on" ]
  then
    export LDFLAGS="-Wl,-syslibroot,/Developer/SDKs/MacOSX10.4u.sdk -arch ppc -arch i386"
    export CFLAGS="-isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch i386 -arch ppc"
    echo enabled
  else
    unset LDFLAGS CFLAGS
    echo disabled       
  fi
}

back · essays · credits ·