Fixed the gcc include path when building on Mac OS X 10.5
authorSam Lantinga <slouken@libsdl.org>
Wed, 01 Dec 2010 12:52:48 -0800
changeset 4926ab02a7242f08
parent 4925 514f811a4887
child 4927 d716dff4b13e
Fixed the gcc include path when building on Mac OS X 10.5
build-scripts/fatbuild.sh
     1.1 --- a/build-scripts/fatbuild.sh	Wed Dec 01 12:23:16 2010 -0800
     1.2 +++ b/build-scripts/fatbuild.sh	Wed Dec 01 12:52:48 2010 -0800
     1.3 @@ -16,6 +16,18 @@
     1.4  # Generic, cross-platform CFLAGS you always want go here.
     1.5  CFLAGS="-O3 -g -pipe"
     1.6  
     1.7 +# They changed this from "darwin9" to "darwin10" in Xcode 3.2 (Snow Leopard).
     1.8 +GCCUSRPATH_PPC=`ls -d $SDK_PATH/MacOSX10.4u.sdk/usr/lib/gcc/powerpc-apple-darwin*/4.0.1`
     1.9 +if [ ! -d "$GCCUSRPATH_PPC" ]; then
    1.10 +    echo "Couldn't find any GCC usr path for 32-bit ppc"
    1.11 +    exit 1
    1.12 +fi
    1.13 +GCCUSRPATH_PPC64=`ls -d $SDK_PATH/MacOSX10.5.sdk/usr/lib/gcc/powerpc-apple-darwin*/4.0.1`
    1.14 +if [ ! -d "$GCCUSRPATH_PPC64" ]; then
    1.15 +    echo "Couldn't find any GCC usr path for 64-bit ppc"
    1.16 +    exit 1
    1.17 +fi
    1.18 +
    1.19  # PowerPC 32-bit configure flags (10.4 runtime compatibility)
    1.20  # We dynamically load X11, so using the system X11 headers is fine.
    1.21  CONFIG_PPC="--build=`uname -p`-apple-darwin --host=powerpc-apple-darwin \
    1.22 @@ -28,13 +40,13 @@
    1.23  CPPFLAGS_PPC="-DMAC_OS_X_VERSION_MIN_REQUIRED=1040 \
    1.24  -nostdinc \
    1.25  -F$SDK_PATH/MacOSX10.4u.sdk/System/Library/Frameworks \
    1.26 --I$SDK_PATH/MacOSX10.4u.sdk/usr/lib/gcc/powerpc-apple-darwin10/4.0.1/include \
    1.27 +-I$GCCUSRPATH_PPC/include \
    1.28  -isystem $SDK_PATH/MacOSX10.4u.sdk/usr/include"
    1.29  
    1.30  # PowerPC 32-bit linker flags
    1.31  LFLAGS_PPC="-arch ppc -Wl,-headerpad_max_install_names -mmacosx-version-min=10.4 \
    1.32  -F$SDK_PATH/MacOSX10.4u.sdk/System/Library/Frameworks \
    1.33 --L$SDK_PATH/MacOSX10.4u.sdk/usr/lib/gcc/powerpc-apple-darwin10/4.0.1 \
    1.34 +-L$GCCUSRPATH_PPC \
    1.35  -Wl,-syslibroot,$SDK_PATH/MacOSX10.4u.sdk"
    1.36  
    1.37  # PowerPC 64-bit configure flags (10.5 runtime compatibility)
    1.38 @@ -49,13 +61,13 @@
    1.39  CPPFLAGS_PPC64="-DMAC_OS_X_VERSION_MIN_REQUIRED=1050 \
    1.40  -nostdinc \
    1.41  -F$SDK_PATH/MacOSX10.5.sdk/System/Library/Frameworks \
    1.42 --I$SDK_PATH/MacOSX10.5.sdk/usr/lib/gcc/powerpc-apple-darwin10/4.0.1/include \
    1.43 +-I$GCCUSRPATH_PPC64/include \
    1.44  -isystem $SDK_PATH/MacOSX10.5.sdk/usr/include"
    1.45  
    1.46  # PowerPC 64-bit linker flags
    1.47  LFLAGS_PPC64="-arch ppc64 -Wl,-headerpad_max_install_names -mmacosx-version-min=10.5 \
    1.48  -F$SDK_PATH/MacOSX10.5.sdk/System/Library/Frameworks \
    1.49 --L$SDK_PATH/MacOSX10.5.sdk/usr/lib/gcc/powerpc-apple-darwin10/4.0.1/ppc64 \
    1.50 +-L$GCCUSRPATH_PPC64/ppc64 \
    1.51  -Wl,-syslibroot,$SDK_PATH/MacOSX10.5.sdk"
    1.52  
    1.53  # Intel 32-bit configure flags (10.4 runtime compatibility)
    1.54 @@ -63,18 +75,15 @@
    1.55  CONFIG_X86="--build=`uname -p`-apple-darwin --host=i386-apple-darwin \
    1.56  --x-includes=/usr/X11R6/include --x-libraries=/usr/X11R6/lib"
    1.57  
    1.58 -# Intel 32-bit configure flags (10.4 runtime compatibility)
    1.59 -# We dynamically load X11, so using the system X11 headers is fine.
    1.60 -CONFIG_X86="--build=`uname -p`-apple-darwin --host=i386-apple-darwin \
    1.61 ---x-includes=/usr/X11R6/include --x-libraries=/usr/X11R6/lib"
    1.62 -
    1.63 -# They changed this to "darwin10" in Xcode 3.2 (Snow Leopard).
    1.64 -GCCUSRPATH_X86="$SDK_PATH/MacOSX10.4u.sdk/usr/lib/gcc/i686-apple-darwin9/4.0.1"
    1.65 +# They changed this from "darwin9" to "darwin10" in Xcode 3.2 (Snow Leopard).
    1.66 +GCCUSRPATH_X86=`ls -d $SDK_PATH/MacOSX10.4u.sdk/usr/lib/gcc/i686-apple-darwin*/4.0.1`
    1.67  if [ ! -d "$GCCUSRPATH_X86" ]; then
    1.68 -    GCCUSRPATH_X86="$SDK_PATH/MacOSX10.4u.sdk/usr/lib/gcc/i686-apple-darwin10/4.0.1"
    1.69 +    echo "Couldn't find any GCC usr path for 32-bit x86"
    1.70 +    exit 1
    1.71  fi
    1.72 -if [ ! -d "$GCCUSRPATH_X86" ]; then
    1.73 -    echo "Couldn't find any GCC usr path for x86"
    1.74 +GCCUSRPATH_X64=`ls -d $SDK_PATH/MacOSX10.5.sdk/usr/lib/gcc/i686-apple-darwin*/4.0.1`
    1.75 +if [ ! -d "$GCCUSRPATH_X64" ]; then
    1.76 +    echo "Couldn't find any GCC usr path for 64-bit x86"
    1.77      exit 1
    1.78  fi
    1.79  
    1.80 @@ -106,13 +115,13 @@
    1.81  CPPFLAGS_X64="-DMAC_OS_X_VERSION_MIN_REQUIRED=1050 \
    1.82  -nostdinc \
    1.83  -F$SDK_PATH/MacOSX10.5.sdk/System/Library/Frameworks \
    1.84 --I$SDK_PATH/MacOSX10.5.sdk/usr/lib/gcc/i686-apple-darwin10/4.0.1/include \
    1.85 +-I$GCCUSRPATH_X64/include \
    1.86  -isystem $SDK_PATH/MacOSX10.5.sdk/usr/include"
    1.87  
    1.88  # Intel 64-bit linker flags
    1.89  LFLAGS_X64="-arch x86_64 -Wl,-headerpad_max_install_names -mmacosx-version-min=10.5 \
    1.90  -F$SDK_PATH/MacOSX10.5.sdk/System/Library/Frameworks \
    1.91 --L$SDK_PATH/MacOSX10.5.sdk/usr/lib/gcc/i686-apple-darwin10/4.0.1/x86_64 \
    1.92 +-L$GCCUSRPATH_X64/x86_64 \
    1.93  -Wl,-syslibroot,$SDK_PATH/MacOSX10.5.sdk"
    1.94  
    1.95  #