annotate build-scripts/fatbuild.sh @ 1739:3a3e847aadb9

Trying to fix fatbuild.sh on intel
author Sam Lantinga <slouken@libsdl.org>
date Thu, 27 Apr 2006 10:21:54 +0000
parents 9f59d4c5aaea
children d67622addf51
rev   line source
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
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
5 # PowerPC compiler flags (10.2 runtime compatibility)
1739
3a3e847aadb9 Trying to fix fatbuild.sh on intel
Sam Lantinga <slouken@libsdl.org>
parents: 1648
diff changeset
6 CC_PPC="gcc-3.3 -arch ppc"
3a3e847aadb9 Trying to fix fatbuild.sh on intel
Sam Lantinga <slouken@libsdl.org>
parents: 1648
diff changeset
7 CFLAGS_PPC=""
1648
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
8 CPPFLAGS_PPC="-DMAC_OS_X_VERSION_MIN_REQUIRED=1020 \
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
9 -nostdinc \
1636
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
10 -F/Developer/SDKs/MacOSX10.2.8.sdk/System/Library/Frameworks \
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
11 -I/Developer/SDKs/MacOSX10.2.8.sdk/usr/include/gcc/darwin/3.3 \
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
12 -isystem /Developer/SDKs/MacOSX10.2.8.sdk/usr/include"
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
13
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
14 # PowerPC linker flags
1648
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
15 LFLAGS_PPC="-arch ppc \
1636
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
16 -L/Developer/SDKs/MacOSX10.2.8.sdk/usr/lib/gcc/darwin/3.3 \
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
17 -F/Developer/SDKs/MacOSX10.2.8.sdk/System/Library/Frameworks \
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
18 -Wl,-syslibroot,/Developer/SDKs/MacOSX10.2.8.sdk"
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
19
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
20 # Intel compiler flags (10.4 runtime compatibility)
1739
3a3e847aadb9 Trying to fix fatbuild.sh on intel
Sam Lantinga <slouken@libsdl.org>
parents: 1648
diff changeset
21 CC_X86="gcc-4.0 -arch i386"
3a3e847aadb9 Trying to fix fatbuild.sh on intel
Sam Lantinga <slouken@libsdl.org>
parents: 1648
diff changeset
22 CFLAGS_X86="-mmacosx-version-min=10.4"
1648
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
23 CPPFLAGS_X86="-DMAC_OS_X_VERSION_MIN_REQUIRED=1040 \
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
24 -nostdinc \
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
25 -F/Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks \
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
26 -I/Developer/SDKs/MacOSX10.4u.sdk/usr/lib/gcc/i686-apple-darwin8/4.0.1/include \
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
27 -isystem /Developer/SDKs/MacOSX10.4u.sdk/usr/include"
1636
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
28
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
29 # Intel linker flags
1639
0f466fb614a9 Whoops, need the actual flags here
Sam Lantinga <slouken@libsdl.org>
parents: 1636
diff changeset
30 LFLAGS_X86="-arch i386 -mmacosx-version-min=10.4 \
1636
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
31 -L/Developer/SDKs/MacOSX10.4u.sdk/usr/lib/gcc/i686-apple-darwin8/4.0.0 \
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
32 -Wl,-syslibroot,/Developer/SDKs/MacOSX10.4u.sdk"
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
33
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
34 #
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
35 # 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
36 #
1648
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
37 srcdir=`dirname $0`/..
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
38 auxdir=$srcdir/build-scripts
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
39 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
40
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 # 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
43 # all,
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
44 # configure, configure-ppc, configure-x86,
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
45 # make, make-ppc, make-x86, merge
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
46 # install
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
47 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
48 phase=all
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
49 else
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
50 phase="$1"
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
51 fi
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
52 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
53 all)
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
54 configure_ppc="yes"
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
55 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
56 make_ppc="yes"
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
57 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
58 merge="yes"
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
59 ;;
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
60 configure)
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
61 configure_ppc="yes"
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
62 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
63 ;;
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
64 configure-ppc)
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
65 configure_ppc="yes"
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
66 ;;
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
67 configure-x86)
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
68 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
69 ;;
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
70 make)
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
71 make_ppc="yes"
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
72 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
73 merge="yes"
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
74 ;;
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
75 make-ppc)
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
76 make_ppc="yes"
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
77 ;;
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
78 make-x86)
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
79 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
80 ;;
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
81 merge)
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
82 merge="yes"
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
83 ;;
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
84 install)
1648
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
85 install_bin="yes"
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
86 install_hdrs="yes"
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
87 install_lib="yes"
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
88 install_data="yes"
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
89 install_man="yes"
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
90 ;;
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
91 install-bin)
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
92 install_bin="yes"
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
93 ;;
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
94 install-hdrs)
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
95 install_hdrs="yes"
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
96 ;;
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
97 install-lib)
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
98 install_lib="yes"
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
99 ;;
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
100 install-data)
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
101 install_data="yes"
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
102 ;;
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
103 install-man)
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
104 install_man="yes"
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
105 ;;
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
106 *)
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
107 echo "Usage: $0 [all|configure[-ppc|-x86]|make[-ppc|-x86]|merge]"
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
108 exit 1
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
109 ;;
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
110 esac
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
111 case `uname -p` in
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
112 powerpc)
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
113 native_path=ppc
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
114 ;;
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
115 *86)
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
116 native_path=x86
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
117 ;;
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
118 *)
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
119 echo "Couldn't figure out native architecture path"
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
120 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
121 ;;
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
122 esac
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
123
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
124 #
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
125 # 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
126 #
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
127 for dir in build build/ppc build/x86; do
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
128 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
129 :
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
130 else
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
131 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
132 fi
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
133 done
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
134
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
135 #
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
136 # Build the PowerPC binary
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
137 #
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
138 if test x$configure_ppc = xyes; then
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
139 (cd build/ppc && \
1648
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
140 sh ../../configure --build=`uname -p`-apple-darwin --host=powerpc-apple-darwin CC="$CC_PPC" CFLAGS="$CFLAGS_PPC" CPPFLAGS="$CPPFLAGS_PPC" LDFLAGS="$LFLAGS_PPC") || 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
141 fi
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
142 if test x$make_ppc = xyes; then
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
143 (cd build/ppc && make) || exit 3
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
144 fi
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
145
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
146 #
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
147 # Build the Intel binary
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
148 #
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
149 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
150 (cd build/x86 && \
1648
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
151 sh ../../configure --build=`uname -p`-apple-darwin --host=i686-apple-darwin CC="$CC_X86" CFLAGS="$CFLAGS_X86" CPPFLAGS="$CPPFLAGS_X86" LDFLAGS="$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
152 fi
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
153 if test x$make_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
154 (cd build/x86 && make) || exit 3
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
155 fi
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
156
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
157 #
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
158 # 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
159 #
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
160 if test x$merge = xyes; then
1648
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
161 output=.libs
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
162 sh $auxdir/mkinstalldirs build/$output
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
163 cd build
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
164 target=`find . -mindepth 3 -type f -name '*.dylib' | head -1 | sed 's|.*/||'`
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
165 (lipo -create -o $output/$target `find . -mindepth 3 -type f -name "*.dylib"` &&
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
166 ln -sf $target $output/libSDL-1.2.0.dylib &&
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
167 ln -sf $target $output/libSDL.dylib &&
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
168 lipo -create -o $output/libSDL.a */build/.libs/libSDL.a &&
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
169 cp $native_path/build/.libs/libSDL.la $output &&
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
170 cp $native_path/build/.libs/libSDL.lai $output &&
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
171 cp $native_path/build/libSDL.la . &&
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
172 lipo -create -o libSDLmain.a */build/libSDLmain.a &&
1636
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
173 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
174 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
175 cd ..
1636
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
176 fi
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
177
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
178 #
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
179 # Install
3d0dec74ad01 A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
180 #
1648
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
181 do_install()
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
182 {
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
183 echo $*
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
184 $* || exit 5
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
185 }
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
186 if test x$prefix = x; then
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
187 prefix=/usr/local
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
188 fi
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
189 if test x$exec_prefix = x; then
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
190 exec_prefix=$prefix
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
191 fi
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
192 if test x$bindir = x; then
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
193 bindir=$exec_prefix/bin
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
194 fi
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
195 if test x$libdir = x; then
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
196 libdir=$exec_prefix/lib
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
197 fi
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
198 if test x$includedir = x; then
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
199 includedir=$prefix/include
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
200 fi
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
201 if test x$datadir = x; then
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
202 datadir=$prefix/share
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
203 fi
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
204 if test x$mandir = x; then
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
205 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
206 fi
1648
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
207 if test x$install_bin = xyes; then
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
208 do_install sh $auxdir/mkinstalldirs $bindir
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
209 do_install /usr/bin/install -c -m 755 build/$native_path/sdl-config $bindir/sdl-config
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
210 fi
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
211 if test x$install_hdrs = xyes; then
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
212 do_install sh $auxdir/mkinstalldirs $includedir/SDL
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
213 for src in $srcdir/include/*.h; do \
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
214 file=`echo $src | sed -e 's|^.*/||'`; \
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
215 do_install /usr/bin/install -c -m 644 $src $includedir/SDL/$file; \
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
216 done
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
217 do_install /usr/bin/install -c -m 644 $srcdir/include/SDL_config_macosx.h $includedir/SDL/SDL_config.h
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
218 fi
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
219 if test x$install_lib = xyes; then
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
220 do_install sh $auxdir/mkinstalldirs $libdir
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
221 do_install sh build/$native_path/libtool --mode=install /usr/bin/install -c build/libSDL.la $libdir/libSDL.la
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
222 do_install /usr/bin/install -c -m 644 build/libSDLmain.a $libdir/libSDLmain.a
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
223 do_install ranlib $libdir/libSDLmain.a
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
224 fi
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
225 if test x$install_data = xyes; then
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
226 do_install sh $auxdir/mkinstalldirs $datadir/aclocal
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
227 do_install /usr/bin/install -c -m 644 $srcdir/sdl.m4 $datadir/aclocal/sdl.m4
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
228 fi
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
229 if test x$install_man = xyes; then
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
230 do_install sh $auxdir/mkinstalldirs $mandir/man3
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
231 for src in $srcdir/docs/man3/*.3; do \
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
232 file=`echo $src | sed -e 's|^.*/||'`; \
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
233 do_install /usr/bin/install -c -m 644 $src $mandir/man3/$file; \
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
234 done
9f59d4c5aaea Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents: 1646
diff changeset
235 fi