build-scripts/fatbuild.sh
author Sam Lantinga <slouken@libsdl.org>
Sat, 04 Feb 2012 10:40:04 -0500
changeset 6276 b696a93d2848
parent 6092 9637b8814116
child 6457 1b32affca783
permissions -rwxr-xr-x
Fixed bug 1410 - fatbuild.sh is broken Martin Gerhardy 2012-02-03 23:04:45 PST after the name change from SDL to SDL2 the fatbuild.sh got broken. The attached patch should fix this.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1636
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
     1
#!/bin/sh
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
     2
#
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
     3
# Build a fat binary on Mac OS X, thanks Ryan!
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
     4
1741
d67622addf51 fatbuild fixes:
Ryan C. Gordon <icculus@icculus.org>
parents: 1739
diff changeset
     5
# Number of CPUs (for make -j)
d67622addf51 fatbuild fixes:
Ryan C. Gordon <icculus@icculus.org>
parents: 1739
diff changeset
     6
NCPU=`sysctl -n hw.ncpu`
3524
5668e43c256b Allow overriding the number of build jobs
Sam Lantinga <slouken@libsdl.org>
parents: 3282
diff changeset
     7
if test x$NJOB = x; then
5668e43c256b Allow overriding the number of build jobs
Sam Lantinga <slouken@libsdl.org>
parents: 3282
diff changeset
     8
    NJOB=$NCPU
5668e43c256b Allow overriding the number of build jobs
Sam Lantinga <slouken@libsdl.org>
parents: 3282
diff changeset
     9
fi
1741
d67622addf51 fatbuild fixes:
Ryan C. Gordon <icculus@icculus.org>
parents: 1739
diff changeset
    10
4924
455c0dad84df Allow the SDK path to be rebased
Sam Lantinga <slouken@libsdl.org>
parents: 3629
diff changeset
    11
# SDK path
455c0dad84df Allow the SDK path to be rebased
Sam Lantinga <slouken@libsdl.org>
parents: 3629
diff changeset
    12
if test x$SDK_PATH = x; then
455c0dad84df Allow the SDK path to be rebased
Sam Lantinga <slouken@libsdl.org>
parents: 3629
diff changeset
    13
    SDK_PATH=/Developer/SDKs
455c0dad84df Allow the SDK path to be rebased
Sam Lantinga <slouken@libsdl.org>
parents: 3629
diff changeset
    14
fi
455c0dad84df Allow the SDK path to be rebased
Sam Lantinga <slouken@libsdl.org>
parents: 3629
diff changeset
    15
1741
d67622addf51 fatbuild fixes:
Ryan C. Gordon <icculus@icculus.org>
parents: 1739
diff changeset
    16
# Generic, cross-platform CFLAGS you always want go here.
d67622addf51 fatbuild fixes:
Ryan C. Gordon <icculus@icculus.org>
parents: 1739
diff changeset
    17
CFLAGS="-O3 -g -pipe"
d67622addf51 fatbuild fixes:
Ryan C. Gordon <icculus@icculus.org>
parents: 1739
diff changeset
    18
1799
50e9cca3fe7b Fixed X11 support on Mac OS X Universal build
Sam Lantinga <slouken@libsdl.org>
parents: 1744
diff changeset
    19
# We dynamically load X11, so using the system X11 headers is fine.
5961
3bd7ed5f3895 Updated fatbuild.sh to match 1.2 version.
Ryan C. Gordon <icculus@icculus.org>
parents: 5611
diff changeset
    20
BASE_CONFIG_FLAGS="--build=`uname -p`-apple-darwin \
1799
50e9cca3fe7b Fixed X11 support on Mac OS X Universal build
Sam Lantinga <slouken@libsdl.org>
parents: 1744
diff changeset
    21
--x-includes=/usr/X11R6/include --x-libraries=/usr/X11R6/lib"
50e9cca3fe7b Fixed X11 support on Mac OS X Universal build
Sam Lantinga <slouken@libsdl.org>
parents: 1744
diff changeset
    22
5961
3bd7ed5f3895 Updated fatbuild.sh to match 1.2 version.
Ryan C. Gordon <icculus@icculus.org>
parents: 5611
diff changeset
    23
# PowerPC 32-bit compiler flags
3bd7ed5f3895 Updated fatbuild.sh to match 1.2 version.
Ryan C. Gordon <icculus@icculus.org>
parents: 5611
diff changeset
    24
CONFIG_PPC="--host=powerpc-apple-darwin"
3bd7ed5f3895 Updated fatbuild.sh to match 1.2 version.
Ryan C. Gordon <icculus@icculus.org>
parents: 5611
diff changeset
    25
CC_PPC="gcc-4.0"
3bd7ed5f3895 Updated fatbuild.sh to match 1.2 version.
Ryan C. Gordon <icculus@icculus.org>
parents: 5611
diff changeset
    26
CXX_PPC="g++-4.0"
3bd7ed5f3895 Updated fatbuild.sh to match 1.2 version.
Ryan C. Gordon <icculus@icculus.org>
parents: 5611
diff changeset
    27
BUILD_FLAGS_PPC="-arch ppc -mmacosx-version-min=10.4"
3629
102be1cdd2bb Merge r5179:5180 from branches/SDL-1.2: fatbuild.sh Xcode 3.2 fix.
Ryan C. Gordon <icculus@icculus.org>
parents: 3609
diff changeset
    28
3248
cde30895105d Added 64-bit architectures to the fat build script
Sam Lantinga <slouken@libsdl.org>
parents: 3245
diff changeset
    29
# Intel 32-bit compiler flags
5961
3bd7ed5f3895 Updated fatbuild.sh to match 1.2 version.
Ryan C. Gordon <icculus@icculus.org>
parents: 5611
diff changeset
    30
CONFIG_X86="--host=i386-apple-darwin"
3bd7ed5f3895 Updated fatbuild.sh to match 1.2 version.
Ryan C. Gordon <icculus@icculus.org>
parents: 5611
diff changeset
    31
CC_X86="gcc"
3bd7ed5f3895 Updated fatbuild.sh to match 1.2 version.
Ryan C. Gordon <icculus@icculus.org>
parents: 5611
diff changeset
    32
CXX_X86="g++"
3bd7ed5f3895 Updated fatbuild.sh to match 1.2 version.
Ryan C. Gordon <icculus@icculus.org>
parents: 5611
diff changeset
    33
BUILD_FLAGS_X86="-arch i386 -mmacosx-version-min=10.4"
3248
cde30895105d Added 64-bit architectures to the fat build script
Sam Lantinga <slouken@libsdl.org>
parents: 3245
diff changeset
    34
cde30895105d Added 64-bit architectures to the fat build script
Sam Lantinga <slouken@libsdl.org>
parents: 3245
diff changeset
    35
# Intel 64-bit compiler flags
5961
3bd7ed5f3895 Updated fatbuild.sh to match 1.2 version.
Ryan C. Gordon <icculus@icculus.org>
parents: 5611
diff changeset
    36
CONFIG_X64="--host=x86_64-apple-darwin"
3bd7ed5f3895 Updated fatbuild.sh to match 1.2 version.
Ryan C. Gordon <icculus@icculus.org>
parents: 5611
diff changeset
    37
CC_X64="gcc"
3bd7ed5f3895 Updated fatbuild.sh to match 1.2 version.
Ryan C. Gordon <icculus@icculus.org>
parents: 5611
diff changeset
    38
CXX_X64="g++"
3bd7ed5f3895 Updated fatbuild.sh to match 1.2 version.
Ryan C. Gordon <icculus@icculus.org>
parents: 5611
diff changeset
    39
BUILD_FLAGS_X64="-arch x86_64 -mmacosx-version-min=10.6"
3248
cde30895105d Added 64-bit architectures to the fat build script
Sam Lantinga <slouken@libsdl.org>
parents: 3245
diff changeset
    40
1636
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    41
#
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    42
# Find the configure script
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    43
#
1648
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
    44
srcdir=`dirname $0`/..
6016
196ab3642a3f Get the full path for the src directory so auxdir works correctly
Sam Lantinga <slouken@libsdl.org>
parents: 5961
diff changeset
    45
srcdir=`cd $srcdir && pwd`
1648
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
    46
auxdir=$srcdir/build-scripts
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
    47
cd $srcdir
1636
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    48
5961
3bd7ed5f3895 Updated fatbuild.sh to match 1.2 version.
Ryan C. Gordon <icculus@icculus.org>
parents: 5611
diff changeset
    49
allow_ppc="yes"
3bd7ed5f3895 Updated fatbuild.sh to match 1.2 version.
Ryan C. Gordon <icculus@icculus.org>
parents: 5611
diff changeset
    50
which gcc-4.0 >/dev/null 2>/dev/null
3bd7ed5f3895 Updated fatbuild.sh to match 1.2 version.
Ryan C. Gordon <icculus@icculus.org>
parents: 5611
diff changeset
    51
if [ "x$?" = "x1" ]; then
3bd7ed5f3895 Updated fatbuild.sh to match 1.2 version.
Ryan C. Gordon <icculus@icculus.org>
parents: 5611
diff changeset
    52
    #echo "WARNING: Can't find gcc-4.0, which means you don't have Xcode 3."
3bd7ed5f3895 Updated fatbuild.sh to match 1.2 version.
Ryan C. Gordon <icculus@icculus.org>
parents: 5611
diff changeset
    53
    #echo "WARNING: Therefore, we can't do PowerPC support."
3bd7ed5f3895 Updated fatbuild.sh to match 1.2 version.
Ryan C. Gordon <icculus@icculus.org>
parents: 5611
diff changeset
    54
    allow_ppc="no"
3bd7ed5f3895 Updated fatbuild.sh to match 1.2 version.
Ryan C. Gordon <icculus@icculus.org>
parents: 5611
diff changeset
    55
fi
3bd7ed5f3895 Updated fatbuild.sh to match 1.2 version.
Ryan C. Gordon <icculus@icculus.org>
parents: 5611
diff changeset
    56
1636
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    57
#
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    58
# Figure out which phase to build:
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    59
# all,
5961
3bd7ed5f3895 Updated fatbuild.sh to match 1.2 version.
Ryan C. Gordon <icculus@icculus.org>
parents: 5611
diff changeset
    60
# configure, configure-ppc, configure-x86, configure-x64
3bd7ed5f3895 Updated fatbuild.sh to match 1.2 version.
Ryan C. Gordon <icculus@icculus.org>
parents: 5611
diff changeset
    61
# make, make-ppc, make-x86, make-x64, merge
1636
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    62
# install
1741
d67622addf51 fatbuild fixes:
Ryan C. Gordon <icculus@icculus.org>
parents: 1739
diff changeset
    63
# clean
1636
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    64
if test x"$1" = x; then
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    65
    phase=all
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    66
else
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    67
    phase="$1"
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    68
fi
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    69
case $phase in
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    70
    all)
5961
3bd7ed5f3895 Updated fatbuild.sh to match 1.2 version.
Ryan C. Gordon <icculus@icculus.org>
parents: 5611
diff changeset
    71
        configure_ppc="$allow_ppc"
1636
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    72
        configure_x86="yes"
3248
cde30895105d Added 64-bit architectures to the fat build script
Sam Lantinga <slouken@libsdl.org>
parents: 3245
diff changeset
    73
        configure_x64="yes"
5961
3bd7ed5f3895 Updated fatbuild.sh to match 1.2 version.
Ryan C. Gordon <icculus@icculus.org>
parents: 5611
diff changeset
    74
        make_ppc="$allow_ppc"
1636
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    75
        make_x86="yes"
3248
cde30895105d Added 64-bit architectures to the fat build script
Sam Lantinga <slouken@libsdl.org>
parents: 3245
diff changeset
    76
        make_x64="yes"
1636
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    77
        merge="yes"
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    78
        ;;
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    79
    configure)
5961
3bd7ed5f3895 Updated fatbuild.sh to match 1.2 version.
Ryan C. Gordon <icculus@icculus.org>
parents: 5611
diff changeset
    80
        configure_ppc="$allow_ppc"
1636
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    81
        configure_x86="yes"
3248
cde30895105d Added 64-bit architectures to the fat build script
Sam Lantinga <slouken@libsdl.org>
parents: 3245
diff changeset
    82
        configure_x64="yes"
1636
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    83
        ;;
5961
3bd7ed5f3895 Updated fatbuild.sh to match 1.2 version.
Ryan C. Gordon <icculus@icculus.org>
parents: 5611
diff changeset
    84
    configure-ppc)
3bd7ed5f3895 Updated fatbuild.sh to match 1.2 version.
Ryan C. Gordon <icculus@icculus.org>
parents: 5611
diff changeset
    85
        configure_ppc="$allow_ppc"
3bd7ed5f3895 Updated fatbuild.sh to match 1.2 version.
Ryan C. Gordon <icculus@icculus.org>
parents: 5611
diff changeset
    86
        ;;
1636
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    87
    configure-x86)
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    88
        configure_x86="yes"
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    89
        ;;
3248
cde30895105d Added 64-bit architectures to the fat build script
Sam Lantinga <slouken@libsdl.org>
parents: 3245
diff changeset
    90
    configure-x64)
cde30895105d Added 64-bit architectures to the fat build script
Sam Lantinga <slouken@libsdl.org>
parents: 3245
diff changeset
    91
        configure_x64="yes"
cde30895105d Added 64-bit architectures to the fat build script
Sam Lantinga <slouken@libsdl.org>
parents: 3245
diff changeset
    92
        ;;
1636
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    93
    make)
5961
3bd7ed5f3895 Updated fatbuild.sh to match 1.2 version.
Ryan C. Gordon <icculus@icculus.org>
parents: 5611
diff changeset
    94
        make_ppc="$allow_ppc"
1636
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    95
        make_x86="yes"
3248
cde30895105d Added 64-bit architectures to the fat build script
Sam Lantinga <slouken@libsdl.org>
parents: 3245
diff changeset
    96
        make_x64="yes"
1636
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    97
        merge="yes"
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    98
        ;;
5961
3bd7ed5f3895 Updated fatbuild.sh to match 1.2 version.
Ryan C. Gordon <icculus@icculus.org>
parents: 5611
diff changeset
    99
    make-ppc)
3bd7ed5f3895 Updated fatbuild.sh to match 1.2 version.
Ryan C. Gordon <icculus@icculus.org>
parents: 5611
diff changeset
   100
        make_ppc="$allow_ppc"
3bd7ed5f3895 Updated fatbuild.sh to match 1.2 version.
Ryan C. Gordon <icculus@icculus.org>
parents: 5611
diff changeset
   101
        ;;
1636
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   102
    make-x86)
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   103
        make_x86="yes"
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   104
        ;;
3248
cde30895105d Added 64-bit architectures to the fat build script
Sam Lantinga <slouken@libsdl.org>
parents: 3245
diff changeset
   105
    make-x64)
cde30895105d Added 64-bit architectures to the fat build script
Sam Lantinga <slouken@libsdl.org>
parents: 3245
diff changeset
   106
        make_x64="yes"
cde30895105d Added 64-bit architectures to the fat build script
Sam Lantinga <slouken@libsdl.org>
parents: 3245
diff changeset
   107
        ;;
1636
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   108
    merge)
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   109
        merge="yes"
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   110
        ;;
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   111
    install)
1648
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
   112
        install_bin="yes"
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
   113
        install_hdrs="yes"
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
   114
        install_lib="yes"
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
   115
        install_data="yes"
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
   116
        ;;
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
   117
    install-bin)
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
   118
        install_bin="yes"
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
   119
        ;;
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
   120
    install-hdrs)
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
   121
        install_hdrs="yes"
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
   122
        ;;
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
   123
    install-lib)
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
   124
        install_lib="yes"
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
   125
        ;;
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
   126
    install-data)
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
   127
        install_data="yes"
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
   128
        ;;
1741
d67622addf51 fatbuild fixes:
Ryan C. Gordon <icculus@icculus.org>
parents: 1739
diff changeset
   129
    clean)
5961
3bd7ed5f3895 Updated fatbuild.sh to match 1.2 version.
Ryan C. Gordon <icculus@icculus.org>
parents: 5611
diff changeset
   130
        clean_ppc="yes"
1741
d67622addf51 fatbuild fixes:
Ryan C. Gordon <icculus@icculus.org>
parents: 1739
diff changeset
   131
        clean_x86="yes"
3248
cde30895105d Added 64-bit architectures to the fat build script
Sam Lantinga <slouken@libsdl.org>
parents: 3245
diff changeset
   132
        clean_x64="yes"
1741
d67622addf51 fatbuild fixes:
Ryan C. Gordon <icculus@icculus.org>
parents: 1739
diff changeset
   133
        ;;
5961
3bd7ed5f3895 Updated fatbuild.sh to match 1.2 version.
Ryan C. Gordon <icculus@icculus.org>
parents: 5611
diff changeset
   134
    clean-ppc)
3bd7ed5f3895 Updated fatbuild.sh to match 1.2 version.
Ryan C. Gordon <icculus@icculus.org>
parents: 5611
diff changeset
   135
        clean_ppc="yes"
3bd7ed5f3895 Updated fatbuild.sh to match 1.2 version.
Ryan C. Gordon <icculus@icculus.org>
parents: 5611
diff changeset
   136
        ;;
1741
d67622addf51 fatbuild fixes:
Ryan C. Gordon <icculus@icculus.org>
parents: 1739
diff changeset
   137
    clean-x86)
d67622addf51 fatbuild fixes:
Ryan C. Gordon <icculus@icculus.org>
parents: 1739
diff changeset
   138
        clean_x86="yes"
d67622addf51 fatbuild fixes:
Ryan C. Gordon <icculus@icculus.org>
parents: 1739
diff changeset
   139
        ;;
3248
cde30895105d Added 64-bit architectures to the fat build script
Sam Lantinga <slouken@libsdl.org>
parents: 3245
diff changeset
   140
    clean-x64)
cde30895105d Added 64-bit architectures to the fat build script
Sam Lantinga <slouken@libsdl.org>
parents: 3245
diff changeset
   141
        clean_x64="yes"
cde30895105d Added 64-bit architectures to the fat build script
Sam Lantinga <slouken@libsdl.org>
parents: 3245
diff changeset
   142
        ;;
1648
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
   143
    *)
5961
3bd7ed5f3895 Updated fatbuild.sh to match 1.2 version.
Ryan C. Gordon <icculus@icculus.org>
parents: 5611
diff changeset
   144
        echo "Usage: $0 [all|configure[-ppc|-x86|-x64]|make[-ppc|-x86|-x64]|merge|install|clean[-ppc|-x86|-x64]]"
1648
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
   145
        exit 1
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
   146
        ;;
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
   147
esac
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
   148
case `uname -p` in
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
   149
    *86)
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
   150
        native_path=x86
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
   151
        ;;
5961
3bd7ed5f3895 Updated fatbuild.sh to match 1.2 version.
Ryan C. Gordon <icculus@icculus.org>
parents: 5611
diff changeset
   152
    *powerpc)
3bd7ed5f3895 Updated fatbuild.sh to match 1.2 version.
Ryan C. Gordon <icculus@icculus.org>
parents: 5611
diff changeset
   153
        native_path=ppc
3bd7ed5f3895 Updated fatbuild.sh to match 1.2 version.
Ryan C. Gordon <icculus@icculus.org>
parents: 5611
diff changeset
   154
        ;;
3249
2befcf0c5ce0 Fix build on native 64-bit architecture
Sam Lantinga <slouken@libsdl.org>
parents: 3248
diff changeset
   155
    x86_64)
2befcf0c5ce0 Fix build on native 64-bit architecture
Sam Lantinga <slouken@libsdl.org>
parents: 3248
diff changeset
   156
        native_path=x64
2befcf0c5ce0 Fix build on native 64-bit architecture
Sam Lantinga <slouken@libsdl.org>
parents: 3248
diff changeset
   157
        ;;
1648
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
   158
    *)
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
   159
        echo "Couldn't figure out native architecture path"
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
   160
        exit 1
1636
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   161
        ;;
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   162
esac
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   163
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   164
#
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   165
# Create the build directories
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   166
#
5961
3bd7ed5f3895 Updated fatbuild.sh to match 1.2 version.
Ryan C. Gordon <icculus@icculus.org>
parents: 5611
diff changeset
   167
for dir in build build/ppc build/x86 build/x64; do
1636
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   168
    if test -d $dir; then
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   169
        :
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   170
    else
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   171
        mkdir $dir || exit 1
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   172
    fi
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   173
done
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   174
5961
3bd7ed5f3895 Updated fatbuild.sh to match 1.2 version.
Ryan C. Gordon <icculus@icculus.org>
parents: 5611
diff changeset
   175
3bd7ed5f3895 Updated fatbuild.sh to match 1.2 version.
Ryan C. Gordon <icculus@icculus.org>
parents: 5611
diff changeset
   176
#
3bd7ed5f3895 Updated fatbuild.sh to match 1.2 version.
Ryan C. Gordon <icculus@icculus.org>
parents: 5611
diff changeset
   177
# Build the PowerPC 32-bit binary
3bd7ed5f3895 Updated fatbuild.sh to match 1.2 version.
Ryan C. Gordon <icculus@icculus.org>
parents: 5611
diff changeset
   178
#
3bd7ed5f3895 Updated fatbuild.sh to match 1.2 version.
Ryan C. Gordon <icculus@icculus.org>
parents: 5611
diff changeset
   179
if test x$configure_ppc = xyes; then
3bd7ed5f3895 Updated fatbuild.sh to match 1.2 version.
Ryan C. Gordon <icculus@icculus.org>
parents: 5611
diff changeset
   180
    (cd build/ppc && \
3bd7ed5f3895 Updated fatbuild.sh to match 1.2 version.
Ryan C. Gordon <icculus@icculus.org>
parents: 5611
diff changeset
   181
     sh ../../configure $BASE_CONFIG_FLAGS $CONFIG_PPC CC="$CC_PPC" CXX="$CXX_PPC" CFLAGS="$CFLAGS $BUILD_FLAGS_PPC $CFLAGS_PPC" LDFLAGS="$BUILD_FLAGS_PPC $LFLAGS_PPC") || exit 2
3bd7ed5f3895 Updated fatbuild.sh to match 1.2 version.
Ryan C. Gordon <icculus@icculus.org>
parents: 5611
diff changeset
   182
fi
3bd7ed5f3895 Updated fatbuild.sh to match 1.2 version.
Ryan C. Gordon <icculus@icculus.org>
parents: 5611
diff changeset
   183
if test x$make_ppc = xyes; then
3bd7ed5f3895 Updated fatbuild.sh to match 1.2 version.
Ryan C. Gordon <icculus@icculus.org>
parents: 5611
diff changeset
   184
    (cd build/ppc && make -j$NJOB) || exit 3
3bd7ed5f3895 Updated fatbuild.sh to match 1.2 version.
Ryan C. Gordon <icculus@icculus.org>
parents: 5611
diff changeset
   185
fi
1636
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   186
#
3248
cde30895105d Added 64-bit architectures to the fat build script
Sam Lantinga <slouken@libsdl.org>
parents: 3245
diff changeset
   187
# Build the Intel 32-bit binary
1636
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   188
#
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   189
if test x$configure_x86 = xyes; then
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   190
    (cd build/x86 && \
5961
3bd7ed5f3895 Updated fatbuild.sh to match 1.2 version.
Ryan C. Gordon <icculus@icculus.org>
parents: 5611
diff changeset
   191
     sh ../../configure $BASE_CONFIG_FLAGS $CONFIG_X86 CC="$CC_X86" CXX="$CXX_X86" CFLAGS="$CFLAGS $BUILD_FLAGS_X86 $CFLAGS_X86" LDFLAGS="$BUILD_FLAGS_X86 $LFLAGS_X86") || exit 2
1636
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   192
fi
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   193
if test x$make_x86 = xyes; then
1742
af4352da64d8 Fixed bug #206, fatbuild.sh works flawlessly on Intel Macs
Sam Lantinga <slouken@libsdl.org>
parents: 1741
diff changeset
   194
    (cd build/x86 && make -j$NJOB) || exit 3
1636
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   195
fi
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   196
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   197
#
5961
3bd7ed5f3895 Updated fatbuild.sh to match 1.2 version.
Ryan C. Gordon <icculus@icculus.org>
parents: 5611
diff changeset
   198
# Build the Intel 64-bit binary
3248
cde30895105d Added 64-bit architectures to the fat build script
Sam Lantinga <slouken@libsdl.org>
parents: 3245
diff changeset
   199
#
cde30895105d Added 64-bit architectures to the fat build script
Sam Lantinga <slouken@libsdl.org>
parents: 3245
diff changeset
   200
if test x$configure_x64 = xyes; then
cde30895105d Added 64-bit architectures to the fat build script
Sam Lantinga <slouken@libsdl.org>
parents: 3245
diff changeset
   201
    (cd build/x64 && \
5961
3bd7ed5f3895 Updated fatbuild.sh to match 1.2 version.
Ryan C. Gordon <icculus@icculus.org>
parents: 5611
diff changeset
   202
     sh ../../configure $BASE_CONFIG_FLAGS $CONFIG_X64 CC="$CC_X64" CXX="$CXX_X64" CFLAGS="$CFLAGS $BUILD_FLAGS_X64 $CFLAGS_X64" LDFLAGS="$BUILD_FLAGS_X64 $LFLAGS_X64") || exit 2
3248
cde30895105d Added 64-bit architectures to the fat build script
Sam Lantinga <slouken@libsdl.org>
parents: 3245
diff changeset
   203
fi
cde30895105d Added 64-bit architectures to the fat build script
Sam Lantinga <slouken@libsdl.org>
parents: 3245
diff changeset
   204
if test x$make_x64 = xyes; then
cde30895105d Added 64-bit architectures to the fat build script
Sam Lantinga <slouken@libsdl.org>
parents: 3245
diff changeset
   205
    (cd build/x64 && make -j$NJOB) || exit 3
cde30895105d Added 64-bit architectures to the fat build script
Sam Lantinga <slouken@libsdl.org>
parents: 3245
diff changeset
   206
fi
cde30895105d Added 64-bit architectures to the fat build script
Sam Lantinga <slouken@libsdl.org>
parents: 3245
diff changeset
   207
cde30895105d Added 64-bit architectures to the fat build script
Sam Lantinga <slouken@libsdl.org>
parents: 3245
diff changeset
   208
#
1636
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   209
# Combine into fat binary
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   210
#
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   211
if test x$merge = xyes; then
1648
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
   212
    output=.libs
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
   213
    sh $auxdir/mkinstalldirs build/$output
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
   214
    cd build
3245
d984d5bb17e9 Updated fatbuild.sh to build for 10.4u SDK
Sam Lantinga <slouken@libsdl.org>
parents: 2282
diff changeset
   215
    target=`find . -mindepth 4 -maxdepth 4 -type f -name '*.dylib' | head -1 | sed 's|.*/||'`
d984d5bb17e9 Updated fatbuild.sh to build for 10.4u SDK
Sam Lantinga <slouken@libsdl.org>
parents: 2282
diff changeset
   216
    (lipo -create -o $output/$target `find . -mindepth 4 -maxdepth 4 -type f -name "*.dylib"` &&
6276
b696a93d2848 Fixed bug 1410 - fatbuild.sh is broken
Sam Lantinga <slouken@libsdl.org>
parents: 6092
diff changeset
   217
     ln -sf $target $output/libSDL2.dylib &&
b696a93d2848 Fixed bug 1410 - fatbuild.sh is broken
Sam Lantinga <slouken@libsdl.org>
parents: 6092
diff changeset
   218
     lipo -create -o $output/libSDL2.a */build/.libs/libSDL2.a &&
b696a93d2848 Fixed bug 1410 - fatbuild.sh is broken
Sam Lantinga <slouken@libsdl.org>
parents: 6092
diff changeset
   219
     cp $native_path/build/.libs/libSDL2.la $output &&
b696a93d2848 Fixed bug 1410 - fatbuild.sh is broken
Sam Lantinga <slouken@libsdl.org>
parents: 6092
diff changeset
   220
     cp $native_path/build/.libs/libSDL2.lai $output &&
b696a93d2848 Fixed bug 1410 - fatbuild.sh is broken
Sam Lantinga <slouken@libsdl.org>
parents: 6092
diff changeset
   221
     cp $native_path/build/libSDL2.la . &&
b696a93d2848 Fixed bug 1410 - fatbuild.sh is broken
Sam Lantinga <slouken@libsdl.org>
parents: 6092
diff changeset
   222
     lipo -create -o libSDL2main.a */build/libSDL2main.a &&
1636
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   223
     echo "Build complete!" &&
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   224
     echo "Files can be found in the build directory.") || exit 4
1648
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
   225
    cd ..
1636
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   226
fi
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   227
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   228
#
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   229
# Install
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   230
#
1648
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
   231
do_install()
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
   232
{
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
   233
    echo $*
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
   234
    $* || exit 5
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
   235
}
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
   236
if test x$prefix = x; then
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
   237
    prefix=/usr/local
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
   238
fi
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
   239
if test x$exec_prefix = x; then
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
   240
    exec_prefix=$prefix
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
   241
fi
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
   242
if test x$bindir = x; then
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
   243
    bindir=$exec_prefix/bin
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
   244
fi
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
   245
if test x$libdir = x; then
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
   246
    libdir=$exec_prefix/lib
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
   247
fi
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
   248
if test x$includedir = x; then
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
   249
    includedir=$prefix/include
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
   250
fi
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
   251
if test x$datadir = x; then
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
   252
    datadir=$prefix/share
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
   253
fi
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
   254
if test x$mandir = x; then
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
   255
    mandir=$prefix/man
1636
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   256
fi
1648
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
   257
if test x$install_bin = xyes; then
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
   258
    do_install sh $auxdir/mkinstalldirs $bindir
6276
b696a93d2848 Fixed bug 1410 - fatbuild.sh is broken
Sam Lantinga <slouken@libsdl.org>
parents: 6092
diff changeset
   259
    do_install /usr/bin/install -c -m 755 build/$native_path/sdl2-config $bindir/sdl2-config
1648
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
   260
fi
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
   261
if test x$install_hdrs = xyes; then
6276
b696a93d2848 Fixed bug 1410 - fatbuild.sh is broken
Sam Lantinga <slouken@libsdl.org>
parents: 6092
diff changeset
   262
    do_install sh $auxdir/mkinstalldirs $includedir/SDL2
1648
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
   263
    for src in $srcdir/include/*.h; do \
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
   264
        file=`echo $src | sed -e 's|^.*/||'`; \
6276
b696a93d2848 Fixed bug 1410 - fatbuild.sh is broken
Sam Lantinga <slouken@libsdl.org>
parents: 6092
diff changeset
   265
        do_install /usr/bin/install -c -m 644 $src $includedir/SDL2/$file; \
1648
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
   266
    done
6276
b696a93d2848 Fixed bug 1410 - fatbuild.sh is broken
Sam Lantinga <slouken@libsdl.org>
parents: 6092
diff changeset
   267
    do_install /usr/bin/install -c -m 644 $srcdir/include/SDL_config_macosx.h $includedir/SDL2/SDL_config.h
1648
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
   268
fi
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
   269
if test x$install_lib = xyes; then
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
   270
    do_install sh $auxdir/mkinstalldirs $libdir
6276
b696a93d2848 Fixed bug 1410 - fatbuild.sh is broken
Sam Lantinga <slouken@libsdl.org>
parents: 6092
diff changeset
   271
    do_install sh build/$native_path/libtool --mode=install /usr/bin/install -c  build/libSDL2.la $libdir/libSDL2.la
b696a93d2848 Fixed bug 1410 - fatbuild.sh is broken
Sam Lantinga <slouken@libsdl.org>
parents: 6092
diff changeset
   272
    do_install /usr/bin/install -c -m 644 build/libSDL2main.a $libdir/libSDL2main.a
b696a93d2848 Fixed bug 1410 - fatbuild.sh is broken
Sam Lantinga <slouken@libsdl.org>
parents: 6092
diff changeset
   273
    do_install ranlib $libdir/libSDL2main.a
1648
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
   274
fi
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
   275
if test x$install_data = xyes; then
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
   276
    do_install sh $auxdir/mkinstalldirs $datadir/aclocal
6276
b696a93d2848 Fixed bug 1410 - fatbuild.sh is broken
Sam Lantinga <slouken@libsdl.org>
parents: 6092
diff changeset
   277
    do_install /usr/bin/install -c -m 644 $srcdir/sdl2.m4 $datadir/aclocal/sdl2.m4
1648
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
   278
fi
1741
d67622addf51 fatbuild fixes:
Ryan C. Gordon <icculus@icculus.org>
parents: 1739
diff changeset
   279
d67622addf51 fatbuild fixes:
Ryan C. Gordon <icculus@icculus.org>
parents: 1739
diff changeset
   280
#
d67622addf51 fatbuild fixes:
Ryan C. Gordon <icculus@icculus.org>
parents: 1739
diff changeset
   281
# Clean up
d67622addf51 fatbuild fixes:
Ryan C. Gordon <icculus@icculus.org>
parents: 1739
diff changeset
   282
#
d67622addf51 fatbuild fixes:
Ryan C. Gordon <icculus@icculus.org>
parents: 1739
diff changeset
   283
do_clean()
d67622addf51 fatbuild fixes:
Ryan C. Gordon <icculus@icculus.org>
parents: 1739
diff changeset
   284
{
d67622addf51 fatbuild fixes:
Ryan C. Gordon <icculus@icculus.org>
parents: 1739
diff changeset
   285
    echo $*
d67622addf51 fatbuild fixes:
Ryan C. Gordon <icculus@icculus.org>
parents: 1739
diff changeset
   286
    $* || exit 6
d67622addf51 fatbuild fixes:
Ryan C. Gordon <icculus@icculus.org>
parents: 1739
diff changeset
   287
}
5961
3bd7ed5f3895 Updated fatbuild.sh to match 1.2 version.
Ryan C. Gordon <icculus@icculus.org>
parents: 5611
diff changeset
   288
if test x$clean_ppc = xyes; then
3bd7ed5f3895 Updated fatbuild.sh to match 1.2 version.
Ryan C. Gordon <icculus@icculus.org>
parents: 5611
diff changeset
   289
    do_clean rm -r build/ppc
3bd7ed5f3895 Updated fatbuild.sh to match 1.2 version.
Ryan C. Gordon <icculus@icculus.org>
parents: 5611
diff changeset
   290
fi
1741
d67622addf51 fatbuild fixes:
Ryan C. Gordon <icculus@icculus.org>
parents: 1739
diff changeset
   291
if test x$clean_x86 = xyes; then
d67622addf51 fatbuild fixes:
Ryan C. Gordon <icculus@icculus.org>
parents: 1739
diff changeset
   292
    do_clean rm -r build/x86
d67622addf51 fatbuild fixes:
Ryan C. Gordon <icculus@icculus.org>
parents: 1739
diff changeset
   293
fi
5611
d20007078cd1 Removed some extra ppc scaffolding
Sam Lantinga <slouken@libsdl.org>
parents: 5609
diff changeset
   294
if test x$clean_x64 = xyes; then
d20007078cd1 Removed some extra ppc scaffolding
Sam Lantinga <slouken@libsdl.org>
parents: 5609
diff changeset
   295
    do_clean rm -r build/x64
1741
d67622addf51 fatbuild fixes:
Ryan C. Gordon <icculus@icculus.org>
parents: 1739
diff changeset
   296
fi