Fat build doesn't support PPC anymore. SDL-1.2
authorSam Lantinga <slouken@libsdl.org>
Sun, 14 Aug 2011 17:17:17 -0400
branchSDL-1.2
changeset 56082bee7f46cb2b
parent 5607 01a3ec16d8d5
child 5610 e55f9d0e117a
Fat build doesn't support PPC anymore.
build-scripts/fatbuild.sh
     1.1 --- a/build-scripts/fatbuild.sh	Thu Aug 11 18:50:45 2011 +0200
     1.2 +++ b/build-scripts/fatbuild.sh	Sun Aug 14 17:17:17 2011 -0400
     1.3 @@ -4,98 +4,72 @@
     1.4  
     1.5  # Number of CPUs (for make -j)
     1.6  NCPU=`sysctl -n hw.ncpu`
     1.7 -NJOB=$NCPU
     1.8 -#NJOB=`expr $NCPU + 1`
     1.9 +if test x$NJOB = x; then
    1.10 +    NJOB=$NCPU
    1.11 +fi
    1.12 +
    1.13 +# SDK path
    1.14 +if test x$SDK_PATH = x; then
    1.15 +    SDK_PATH=/Developer/SDKs
    1.16 +fi
    1.17  
    1.18  # Generic, cross-platform CFLAGS you always want go here.
    1.19  CFLAGS="-O3 -g -pipe"
    1.20  
    1.21 -# Locate Xcode SDK path
    1.22 -SDK_PATH=/Developer/SDKs
    1.23 -if [ ! -d $SDK_PATH ]; then
    1.24 -    echo "Couldn't find SDK path"
    1.25 -    exit 1
    1.26 -fi
    1.27 -
    1.28 -# See if we can use 10.2 or 10.3 runtime compatibility
    1.29 -if [ -d "$SDK_PATH/MacOSX10.2.8.sdk" ]; then
    1.30 -    # PowerPC configure flags (10.2 runtime compatibility)
    1.31 -    # We dynamically load X11, so using the system X11 headers is fine.
    1.32 -    CONFIG_PPC="--build=`uname -p`-apple-darwin --host=powerpc-apple-darwin \
    1.33 ---x-includes=/usr/X11R6/include --x-libraries=/usr/X11R6/lib"
    1.34 -
    1.35 -    # PowerPC compiler flags
    1.36 -    CC_PPC="gcc-3.3 -arch ppc"
    1.37 -    CXX_PPC="g++-3.3 -arch ppc"
    1.38 -    CFLAGS_PPC=""
    1.39 -    CPPFLAGS_PPC="-DMAC_OS_X_VERSION_MIN_REQUIRED=1020 \
    1.40 --nostdinc \
    1.41 --F$SDK_PATH/MacOSX10.2.8.sdk/System/Library/Frameworks \
    1.42 --I$SDK_PATH/MacOSX10.2.8.sdk/usr/include/gcc/darwin/3.3 \
    1.43 --isystem $SDK_PATH/MacOSX10.2.8.sdk/usr/include"
    1.44 -
    1.45 -    # PowerPC linker flags 
    1.46 -    LFLAGS_PPC="-Wl,-headerpad_max_install_names -arch ppc \
    1.47 --L$SDK_PATH/MacOSX10.2.8.sdk/usr/lib/gcc/darwin/3.3 \
    1.48 --F$SDK_PATH/MacOSX10.2.8.sdk/System/Library/Frameworks \
    1.49 --Wl,-syslibroot,$SDK_PATH/MacOSX10.2.8.sdk"
    1.50 -
    1.51 -else # 10.2 or 10.3 SDK
    1.52 -
    1.53 -    # PowerPC configure flags (10.3 runtime compatibility)
    1.54 -    # We dynamically load X11, so using the system X11 headers is fine.
    1.55 -    CONFIG_PPC="--build=`uname -p`-apple-darwin --host=powerpc-apple-darwin \
    1.56 ---x-includes=/usr/X11R6/include --x-libraries=/usr/X11R6/lib"
    1.57 -
    1.58 -    # PowerPC compiler flags
    1.59 -    CC_PPC="gcc-4.0 -arch ppc"
    1.60 -    CXX_PPC="g++-4.0 -arch ppc"
    1.61 -    CFLAGS_PPC=""
    1.62 -    CPPFLAGS_PPC="-DMAC_OS_X_VERSION_MIN_REQUIRED=1030 \
    1.63 --nostdinc \
    1.64 --F$SDK_PATH/MacOSX10.3.9.sdk/System/Library/Frameworks \
    1.65 --I$SDK_PATH/MacOSX10.3.9.sdk/usr/lib/gcc/powerpc-apple-darwin9/4.0.1/include \
    1.66 --isystem $SDK_PATH/MacOSX10.3.9.sdk/usr/include"
    1.67 -
    1.68 -    # PowerPC linker flags
    1.69 -    LFLAGS_PPC="-Wl,-headerpad_max_install_names -arch ppc -mmacosx-version-min=10.3 \
    1.70 --L$SDK_PATH/MacOSX10.3.9.sdk/usr/lib/gcc/powerpc-apple-darwin9/4.0.1 \
    1.71 --F$SDK_PATH/MacOSX10.3.9.sdk/System/Library/Frameworks \
    1.72 --Wl,-syslibroot,$SDK_PATH/MacOSX10.3.9.sdk"
    1.73 -
    1.74 -fi # 10.2 or 10.3 SDK
    1.75 -
    1.76 -# Intel configure flags (10.4 runtime compatibility)
    1.77 +# Intel 32-bit configure flags (10.4 runtime compatibility)
    1.78  # We dynamically load X11, so using the system X11 headers is fine.
    1.79  CONFIG_X86="--build=`uname -p`-apple-darwin --host=i386-apple-darwin \
    1.80  --x-includes=/usr/X11R6/include --x-libraries=/usr/X11R6/lib"
    1.81  
    1.82 -# They changed this to "darwin10" in Xcode 3.2 (Snow Leopard).
    1.83 -GCCUSRPATH="$SDK_PATH/MacOSX10.4u.sdk/usr/lib/gcc/i686-apple-darwin9/4.0.1"
    1.84 -if [ ! -d "$GCCUSRPATH" ]; then
    1.85 -    GCCUSRPATH="$SDK_PATH/MacOSX10.4u.sdk/usr/lib/gcc/i686-apple-darwin10/4.0.1"
    1.86 +# They changed this from "darwin9" to "darwin10" in Xcode 3.2 (Snow Leopard).
    1.87 +GCCUSRPATH_X86=`ls -d $SDK_PATH/MacOSX10.4u.sdk/usr/lib/gcc/i686-apple-darwin*/4.0.1`
    1.88 +if [ ! -d "$GCCUSRPATH_X86" ]; then
    1.89 +    echo "Couldn't find any GCC usr path for 32-bit x86"
    1.90 +    exit 1
    1.91  fi
    1.92 -
    1.93 -if [ ! -d "$GCCUSRPATH" ]; then
    1.94 -    echo "Couldn't find any GCC usr path"
    1.95 +GCCUSRPATH_X64=`ls -d $SDK_PATH/MacOSX10.5.sdk/usr/lib/gcc/i686-apple-darwin*/4.0.1`
    1.96 +if [ ! -d "$GCCUSRPATH_X64" ]; then
    1.97 +    echo "Couldn't find any GCC usr path for 64-bit x86"
    1.98      exit 1
    1.99  fi
   1.100  
   1.101 -# Intel compiler flags
   1.102 +# Intel 32-bit compiler flags
   1.103  CC_X86="gcc-4.0 -arch i386"
   1.104  CXX_X86="g++-4.0 -arch i386"
   1.105  CFLAGS_X86="-mmacosx-version-min=10.4"
   1.106  CPPFLAGS_X86="-DMAC_OS_X_VERSION_MIN_REQUIRED=1040 \
   1.107  -nostdinc \
   1.108  -F$SDK_PATH/MacOSX10.4u.sdk/System/Library/Frameworks \
   1.109 --I$GCCUSRPATH/include \
   1.110 +-I$GCCUSRPATH_X86/include \
   1.111  -isystem $SDK_PATH/MacOSX10.4u.sdk/usr/include"
   1.112  
   1.113 -# Intel linker flags
   1.114 -LFLAGS_X86="-Wl,-headerpad_max_install_names -arch i386 -mmacosx-version-min=10.4 \
   1.115 --L$GCCUSRPATH \
   1.116 +# Intel 32-bit linker flags
   1.117 +LFLAGS_X86="-arch i386 -Wl,-headerpad_max_install_names -mmacosx-version-min=10.4 \
   1.118 +-F$SDK_PATH/MacOSX10.4u.sdk/System/Library/Frameworks \
   1.119 +-L$GCCUSRPATH_X86 \
   1.120  -Wl,-syslibroot,$SDK_PATH/MacOSX10.4u.sdk"
   1.121  
   1.122 +# Intel 64-bit configure flags (10.5 runtime compatibility)
   1.123 +# We dynamically load X11, so using the system X11 headers is fine.
   1.124 +CONFIG_X64="--build=`uname -p`-apple-darwin --host=i386-apple-darwin \
   1.125 +--x-includes=/usr/X11R6/include --x-libraries=/usr/X11R6/lib"
   1.126 +
   1.127 +# Intel 64-bit compiler flags
   1.128 +CC_X64="gcc-4.0 -arch x86_64"
   1.129 +CXX_X64="g++-4.0 -arch x86_64"
   1.130 +CFLAGS_X64="-mmacosx-version-min=10.5"
   1.131 +CPPFLAGS_X64="-DMAC_OS_X_VERSION_MIN_REQUIRED=1050 \
   1.132 +-nostdinc \
   1.133 +-F$SDK_PATH/MacOSX10.5.sdk/System/Library/Frameworks \
   1.134 +-I$GCCUSRPATH_X64/include \
   1.135 +-isystem $SDK_PATH/MacOSX10.5.sdk/usr/include"
   1.136 +
   1.137 +# Intel 64-bit linker flags
   1.138 +LFLAGS_X64="-arch x86_64 -Wl,-headerpad_max_install_names -mmacosx-version-min=10.5 \
   1.139 +-F$SDK_PATH/MacOSX10.5.sdk/System/Library/Frameworks \
   1.140 +-L$GCCUSRPATH_X64/x86_64 \
   1.141 +-Wl,-syslibroot,$SDK_PATH/MacOSX10.5.sdk"
   1.142 +
   1.143  #
   1.144  # Find the configure script
   1.145  #
   1.146 @@ -106,8 +80,8 @@
   1.147  #
   1.148  # Figure out which phase to build:
   1.149  # all,
   1.150 -# configure, configure-ppc, configure-x86,
   1.151 -# make, make-ppc, make-x86, merge
   1.152 +# configure, configure-ppc, configure-ppc64, configure-x86, configure-x64
   1.153 +# make, make-ppc, make-ppc64, make-x86, make-x64, merge
   1.154  # install
   1.155  # clean
   1.156  if test x"$1" = x; then
   1.157 @@ -118,32 +92,52 @@
   1.158  case $phase in
   1.159      all)
   1.160          configure_ppc="yes"
   1.161 +        configure_ppc64="yes"
   1.162          configure_x86="yes"
   1.163 +        configure_x64="yes"
   1.164          make_ppc="yes"
   1.165 +        make_ppc64="yes"
   1.166          make_x86="yes"
   1.167 +        make_x64="yes"
   1.168          merge="yes"
   1.169          ;;
   1.170      configure)
   1.171          configure_ppc="yes"
   1.172 +        configure_ppc64="yes"
   1.173          configure_x86="yes"
   1.174 +        configure_x64="yes"
   1.175          ;;
   1.176      configure-ppc)
   1.177          configure_ppc="yes"
   1.178          ;;
   1.179 +    configure-ppc64)
   1.180 +        configure_ppc64="yes"
   1.181 +        ;;
   1.182      configure-x86)
   1.183          configure_x86="yes"
   1.184          ;;
   1.185 +    configure-x64)
   1.186 +        configure_x64="yes"
   1.187 +        ;;
   1.188      make)
   1.189          make_ppc="yes"
   1.190 +        make_ppc64="yes"
   1.191          make_x86="yes"
   1.192 +        make_x64="yes"
   1.193          merge="yes"
   1.194          ;;
   1.195      make-ppc)
   1.196          make_ppc="yes"
   1.197          ;;
   1.198 +    make-ppc64)
   1.199 +        make_ppc64="yes"
   1.200 +        ;;
   1.201      make-x86)
   1.202          make_x86="yes"
   1.203          ;;
   1.204 +    make-x64)
   1.205 +        make_x64="yes"
   1.206 +        ;;
   1.207      merge)
   1.208          merge="yes"
   1.209          ;;
   1.210 @@ -171,16 +165,24 @@
   1.211          ;;
   1.212      clean)
   1.213          clean_ppc="yes"
   1.214 +        clean_ppc64="yes"
   1.215          clean_x86="yes"
   1.216 +        clean_x64="yes"
   1.217          ;;
   1.218      clean-ppc)
   1.219          clean_ppc="yes"
   1.220          ;;
   1.221 +    clean-ppc64)
   1.222 +        clean_ppc64="yes"
   1.223 +        ;;
   1.224      clean-x86)
   1.225          clean_x86="yes"
   1.226          ;;
   1.227 +    clean-x64)
   1.228 +        clean_x64="yes"
   1.229 +        ;;
   1.230      *)
   1.231 -        echo "Usage: $0 [all|configure[-ppc|-x86]|make[-ppc|-x86]|merge|install|clean]"
   1.232 +        echo "Usage: $0 [all|configure[-ppc|-ppc64|-x86|-x64]|make[-ppc|-ppc64|-x86|-x64]|merge|install|clean[-ppc|-ppc64|-x86|-x64]]"
   1.233          exit 1
   1.234          ;;
   1.235  esac
   1.236 @@ -188,9 +190,15 @@
   1.237      powerpc)
   1.238          native_path=ppc
   1.239          ;;
   1.240 +    powerpc64)
   1.241 +        native_path=ppc64
   1.242 +        ;;
   1.243      *86)
   1.244          native_path=x86
   1.245          ;;
   1.246 +    x86_64)
   1.247 +        native_path=x64
   1.248 +        ;;
   1.249      *)
   1.250          echo "Couldn't figure out native architecture path"
   1.251          exit 1
   1.252 @@ -200,7 +208,7 @@
   1.253  #
   1.254  # Create the build directories
   1.255  #
   1.256 -for dir in build build/ppc build/x86; do
   1.257 +for dir in build build/ppc build/ppc64 build/x86 build/x64; do
   1.258      if test -d $dir; then
   1.259          :
   1.260      else
   1.261 @@ -209,18 +217,7 @@
   1.262  done
   1.263  
   1.264  #
   1.265 -# Build the PowerPC binary
   1.266 -#
   1.267 -if test x$configure_ppc = xyes; then
   1.268 -    (cd build/ppc && \
   1.269 -     sh ../../configure $CONFIG_PPC CC="$CC_PPC" CXX="$CXX_PPC" CFLAGS="$CFLAGS $CFLAGS_PPC" CPPFLAGS="$CPPFLAGS_PPC" LDFLAGS="$LFLAGS_PPC") || exit 2
   1.270 -fi
   1.271 -if test x$make_ppc = xyes; then
   1.272 -    (cd build/ppc && ls include && make -j$NJOB) || exit 3
   1.273 -fi
   1.274 -
   1.275 -#
   1.276 -# Build the Intel binary
   1.277 +# Build the Intel 32-bit binary
   1.278  #
   1.279  if test x$configure_x86 = xyes; then
   1.280      (cd build/x86 && \
   1.281 @@ -231,15 +228,25 @@
   1.282  fi
   1.283  
   1.284  #
   1.285 +# Build the Intel 32-bit binary
   1.286 +#
   1.287 +if test x$configure_x64 = xyes; then
   1.288 +    (cd build/x64 && \
   1.289 +     sh ../../configure $CONFIG_X64 CC="$CC_X64" CXX="$CXX_X64" CFLAGS="$CFLAGS $CFLAGS_X64" CPPFLAGS="$CPPFLAGS_X64" LDFLAGS="$LFLAGS_X64") || exit 2
   1.290 +fi
   1.291 +if test x$make_x64 = xyes; then
   1.292 +    (cd build/x64 && make -j$NJOB) || exit 3
   1.293 +fi
   1.294 +
   1.295 +#
   1.296  # Combine into fat binary
   1.297  #
   1.298  if test x$merge = xyes; then
   1.299      output=.libs
   1.300      sh $auxdir/mkinstalldirs build/$output
   1.301      cd build
   1.302 -    target=`find . -mindepth 3 -type f -name '*.dylib' | head -1 | sed 's|.*/||'`
   1.303 -    (lipo -create -o $output/$target `find . -mindepth 3 -type f -name "*.dylib"` &&
   1.304 -     ln -sf $target $output/libSDL-1.2.0.dylib &&
   1.305 +    target=`find . -mindepth 4 -maxdepth 4 -type f -name '*.dylib' | head -1 | sed 's|.*/||'`
   1.306 +    (lipo -create -o $output/$target `find . -mindepth 4 -maxdepth 4 -type f -name "*.dylib"` &&
   1.307       ln -sf $target $output/libSDL.dylib &&
   1.308       lipo -create -o $output/libSDL.a */build/.libs/libSDL.a &&
   1.309       cp $native_path/build/.libs/libSDL.la $output &&