test/gcc-fat.sh
branchSDL-1.2
changeset 4127 6cb18cf1777e
parent 1797 783b9409baa0
equal deleted inserted replaced
4126:19bfebb38b21 4127:6cb18cf1777e
     2 #
     2 #
     3 # Build Universal binaries on Mac OS X, thanks Ryan!
     3 # Build Universal binaries on Mac OS X, thanks Ryan!
     4 #
     4 #
     5 # Usage: ./configure CC="sh gcc-fat.sh" && make && rm -rf ppc x86
     5 # Usage: ./configure CC="sh gcc-fat.sh" && make && rm -rf ppc x86
     6 
     6 
     7 # PowerPC compiler flags (10.2 runtime compatibility)
     7 # Locate Xcode SDK path
     8 GCC_COMPILE_PPC="gcc-3.3 -arch ppc \
     8 SDK_PATH=/Developer/SDKs
       
     9 if [ ! -d $SDK_PATH ]; then
       
    10     echo "Couldn't find SDK path"
       
    11     exit 1
       
    12 fi
       
    13 
       
    14 if [ -d "$SDK_PATH/MacOSX10.2.8.sdk" ]; then
       
    15     # PowerPC compiler flags (10.2 runtime compatibility)
       
    16     GCC_COMPILE_PPC="gcc-3.3 -arch ppc \
     9 -DMAC_OS_X_VERSION_MIN_REQUIRED=1020 \
    17 -DMAC_OS_X_VERSION_MIN_REQUIRED=1020 \
    10 -nostdinc \
    18 -nostdinc \
    11 -F/Developer/SDKs/MacOSX10.2.8.sdk/System/Library/Frameworks \
    19 -F$SDK_PATH/MacOSX10.2.8.sdk/System/Library/Frameworks \
    12 -I/Developer/SDKs/MacOSX10.2.8.sdk/usr/include/gcc/darwin/3.3 \
    20 -I$SDK_PATH/MacOSX10.2.8.sdk/usr/include/gcc/darwin/3.3 \
    13 -isystem /Developer/SDKs/MacOSX10.2.8.sdk/usr/include"
    21 -isystem $SDK_PATH/MacOSX10.2.8.sdk/usr/include"
    14 
    22 
    15 GCC_LINK_PPC="\
    23     GCC_LINK_PPC="\
    16 -L/Developer/SDKs/MacOSX10.2.8.sdk/usr/lib/gcc/darwin/3.3 \
    24 -L$SDK_PATH/MacOSX10.2.8.sdk/usr/lib/gcc/darwin/3.3 \
    17 -F/Developer/SDKs/MacOSX10.2.8.sdk/System/Library/Frameworks \
    25 -F$SDK_PATH/MacOSX10.2.8.sdk/System/Library/Frameworks \
    18 -Wl,-syslibroot,/Developer/SDKs/MacOSX10.2.8.sdk"
    26 -Wl,-syslibroot,$SDK_PATH/MacOSX10.2.8.sdk"
       
    27 
       
    28 else # 10.2 or 10.3 SDK
       
    29     # PowerPC compiler flags (10.3 runtime compatibility)
       
    30     GCC_COMPILE_PPC="gcc-4.0 -arch ppc -mmacosx-version-min=10.3 \
       
    31 -DMAC_OS_X_VERSION_MIN_REQUIRED=1030 \
       
    32 -nostdinc \
       
    33 -F$SDK_PATH/MacOSX10.3.9.sdk/System/Library/Frameworks \
       
    34 -I$SDK_PATH/MacOSX10.3.9.sdk/usr/lib/gcc/powerpc-apple-darwin9/4.0.1/include \
       
    35 -isystem $SDK_PATH/MacOSX10.3.9.sdk/usr/include"
       
    36 
       
    37     GCC_LINK_PPC="\
       
    38 -L$SDK_PATH/MacOSX10.3.9.sdk/usr/lib/gcc/powerpc-apple-darwin9/4.0.1 \
       
    39 -F$SDK_PATH/MacOSX10.3.9.sdk/System/Library/Frameworks \
       
    40 -Wl,-syslibroot,$SDK_PATH/MacOSX10.3.9.sdk"
       
    41 
       
    42 fi # 10.2 or 10.3 SDK
    19 
    43 
    20 # Intel compiler flags (10.4 runtime compatibility)
    44 # Intel compiler flags (10.4 runtime compatibility)
    21 GCC_COMPILE_X86="gcc-4.0 -arch i386 -mmacosx-version-min=10.4 \
    45 GCC_COMPILE_X86="gcc-4.0 -arch i386 -mmacosx-version-min=10.4 \
    22 -DMAC_OS_X_VERSION_MIN_REQUIRED=1040 \
    46 -DMAC_OS_X_VERSION_MIN_REQUIRED=1040 \
    23 -nostdinc \
    47 -nostdinc \
    24 -F/Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks \
    48 -F$SDK_PATH/MacOSX10.4u.sdk/System/Library/Frameworks \
    25 -I/Developer/SDKs/MacOSX10.4u.sdk/usr/lib/gcc/i686-apple-darwin8/4.0.1/include \
    49 -I$SDK_PATH/MacOSX10.4u.sdk/usr/lib/gcc/i686-apple-darwin9/4.0.1/include \
    26 -isystem /Developer/SDKs/MacOSX10.4u.sdk/usr/include"
    50 -isystem $SDK_PATH/MacOSX10.4u.sdk/usr/include"
    27 
    51 
    28 GCC_LINK_X86="\
    52 GCC_LINK_X86="\
    29 -L/Developer/SDKs/MacOSX10.4u.sdk/usr/lib/gcc/i686-apple-darwin8/4.0.0 \
    53 -L$SDK_PATH/MacOSX10.4u.sdk/usr/lib/gcc/i686-apple-darwin9/4.0.1 \
    30 -Wl,-syslibroot,/Developer/SDKs/MacOSX10.4u.sdk"
    54 -Wl,-syslibroot,$SDK_PATH/MacOSX10.4u.sdk"
    31 
    55 
    32 # Output both PowerPC and Intel object files
    56 # Output both PowerPC and Intel object files
    33 args="$*"
    57 args="$*"
    34 compile=yes
    58 compile=yes
    35 link=yes
    59 link=yes