annotate test/gcc-fat.sh @ 1697:393092a3ebf6 SDL-1.3

Fixed bug #157 [patch tweaked to handle older nasm, which doesn't support :function syntax] ------- Comment #5 From Mike Frysinger 2006-05-22 01:24 [reply] ------- Created an attachment (id=132) [edit] libsdl-hidden-nasm.patch here's the patch i posted here: http://www.libsdl.org/pipermail/sdl/2006-March/073618.html this will hide the symbols dynamically if the build nasm/yasm supports the hidden stuff ... in other words, this patch should be safe with both older and new versions of nasm/yasm
author Sam Lantinga <slouken@libsdl.org>
date Wed, 21 Jun 2006 07:57:59 +0000
parents 14717b52abc0
children 6cb18cf1777e
rev   line source
1659
14717b52abc0 Merge trunk-1.3-3
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
1 #!/bin/sh
14717b52abc0 Merge trunk-1.3-3
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
2 #
14717b52abc0 Merge trunk-1.3-3
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
3 # Build Universal binaries on Mac OS X, thanks Ryan!
14717b52abc0 Merge trunk-1.3-3
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
4 #
14717b52abc0 Merge trunk-1.3-3
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
5 # Usage: ./configure CC="sh gcc-fat.sh" && make && rm -rf ppc x86
14717b52abc0 Merge trunk-1.3-3
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
6
14717b52abc0 Merge trunk-1.3-3
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
7 # PowerPC compiler flags (10.2 runtime compatibility)
14717b52abc0 Merge trunk-1.3-3
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
8 GCC_COMPILE_PPC="gcc-3.3 -arch ppc \
14717b52abc0 Merge trunk-1.3-3
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
9 -DMAC_OS_X_VERSION_MIN_REQUIRED=1020 \
14717b52abc0 Merge trunk-1.3-3
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
10 -nostdinc \
14717b52abc0 Merge trunk-1.3-3
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
11 -F/Developer/SDKs/MacOSX10.2.8.sdk/System/Library/Frameworks \
14717b52abc0 Merge trunk-1.3-3
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
12 -I/Developer/SDKs/MacOSX10.2.8.sdk/usr/include/gcc/darwin/3.3 \
14717b52abc0 Merge trunk-1.3-3
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
13 -isystem /Developer/SDKs/MacOSX10.2.8.sdk/usr/include"
14717b52abc0 Merge trunk-1.3-3
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
14
14717b52abc0 Merge trunk-1.3-3
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
15 GCC_LINK_PPC="\
14717b52abc0 Merge trunk-1.3-3
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
16 -L/Developer/SDKs/MacOSX10.2.8.sdk/usr/lib/gcc/darwin/3.3 \
14717b52abc0 Merge trunk-1.3-3
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
17 -F/Developer/SDKs/MacOSX10.2.8.sdk/System/Library/Frameworks \
14717b52abc0 Merge trunk-1.3-3
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
18 -Wl,-syslibroot,/Developer/SDKs/MacOSX10.2.8.sdk"
14717b52abc0 Merge trunk-1.3-3
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
19
14717b52abc0 Merge trunk-1.3-3
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
20 # Intel compiler flags (10.4 runtime compatibility)
14717b52abc0 Merge trunk-1.3-3
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
21 GCC_COMPILE_X86="gcc-4.0 -arch i386 -mmacosx-version-min=10.4 \
14717b52abc0 Merge trunk-1.3-3
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
22 -DMAC_OS_X_VERSION_MIN_REQUIRED=1040 \
14717b52abc0 Merge trunk-1.3-3
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
23 -nostdinc \
14717b52abc0 Merge trunk-1.3-3
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
24 -F/Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks \
14717b52abc0 Merge trunk-1.3-3
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
25 -I/Developer/SDKs/MacOSX10.4u.sdk/usr/lib/gcc/i686-apple-darwin8/4.0.1/include \
14717b52abc0 Merge trunk-1.3-3
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
26 -isystem /Developer/SDKs/MacOSX10.4u.sdk/usr/include"
14717b52abc0 Merge trunk-1.3-3
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
27
14717b52abc0 Merge trunk-1.3-3
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
28 GCC_LINK_X86="\
14717b52abc0 Merge trunk-1.3-3
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
29 -L/Developer/SDKs/MacOSX10.4u.sdk/usr/lib/gcc/i686-apple-darwin8/4.0.0 \
14717b52abc0 Merge trunk-1.3-3
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
30 -Wl,-syslibroot,/Developer/SDKs/MacOSX10.4u.sdk"
14717b52abc0 Merge trunk-1.3-3
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
31
14717b52abc0 Merge trunk-1.3-3
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
32 # Output both PowerPC and Intel object files
14717b52abc0 Merge trunk-1.3-3
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
33 args="$*"
14717b52abc0 Merge trunk-1.3-3
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
34 compile=yes
14717b52abc0 Merge trunk-1.3-3
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
35 link=yes
14717b52abc0 Merge trunk-1.3-3
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
36 while test x$1 != x; do
14717b52abc0 Merge trunk-1.3-3
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
37 case $1 in
14717b52abc0 Merge trunk-1.3-3
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
38 --version) exec gcc $1;;
14717b52abc0 Merge trunk-1.3-3
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
39 -v) exec gcc $1;;
14717b52abc0 Merge trunk-1.3-3
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
40 -V) exec gcc $1;;
14717b52abc0 Merge trunk-1.3-3
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
41 -print-prog-name=*) exec gcc $1;;
14717b52abc0 Merge trunk-1.3-3
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
42 -print-search-dirs) exec gcc $1;;
14717b52abc0 Merge trunk-1.3-3
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
43 -E) GCC_COMPILE_PPC="$GCC_COMPILE_PPC -E"
14717b52abc0 Merge trunk-1.3-3
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
44 GCC_COMPILE_X86="$GCC_COMPILE_X86 -E"
14717b52abc0 Merge trunk-1.3-3
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
45 compile=no; link=no;;
14717b52abc0 Merge trunk-1.3-3
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
46 -c) link=no;;
14717b52abc0 Merge trunk-1.3-3
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
47 -o) output=$2;;
14717b52abc0 Merge trunk-1.3-3
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
48 *.c|*.cc|*.cpp|*.S) source=$1;;
14717b52abc0 Merge trunk-1.3-3
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
49 esac
14717b52abc0 Merge trunk-1.3-3
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
50 shift
14717b52abc0 Merge trunk-1.3-3
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
51 done
14717b52abc0 Merge trunk-1.3-3
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
52 if test x$link = xyes; then
14717b52abc0 Merge trunk-1.3-3
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
53 GCC_COMPILE_PPC="$GCC_COMPILE_PPC $GCC_LINK_PPC"
14717b52abc0 Merge trunk-1.3-3
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
54 GCC_COMPILE_X86="$GCC_COMPILE_X86 $GCC_LINK_X86"
14717b52abc0 Merge trunk-1.3-3
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
55 fi
14717b52abc0 Merge trunk-1.3-3
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
56 if test x"$output" = x; then
14717b52abc0 Merge trunk-1.3-3
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
57 if test x$link = xyes; then
14717b52abc0 Merge trunk-1.3-3
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
58 output=a.out
14717b52abc0 Merge trunk-1.3-3
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
59 elif test x$compile = xyes; then
14717b52abc0 Merge trunk-1.3-3
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
60 output=`echo $source | sed -e 's|.*/||' -e 's|\(.*\)\.[^\.]*|\1|'`.o
14717b52abc0 Merge trunk-1.3-3
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
61 fi
14717b52abc0 Merge trunk-1.3-3
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
62 fi
14717b52abc0 Merge trunk-1.3-3
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
63
14717b52abc0 Merge trunk-1.3-3
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
64 if test x"$output" != x; then
14717b52abc0 Merge trunk-1.3-3
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
65 dir=ppc/`dirname $output`
14717b52abc0 Merge trunk-1.3-3
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
66 if test -d $dir; then
14717b52abc0 Merge trunk-1.3-3
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
67 :
14717b52abc0 Merge trunk-1.3-3
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
68 else
14717b52abc0 Merge trunk-1.3-3
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
69 mkdir -p $dir
14717b52abc0 Merge trunk-1.3-3
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
70 fi
14717b52abc0 Merge trunk-1.3-3
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
71 fi
14717b52abc0 Merge trunk-1.3-3
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
72 set -- $args
14717b52abc0 Merge trunk-1.3-3
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
73 while test x$1 != x; do
14717b52abc0 Merge trunk-1.3-3
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
74 if test -f "ppc/$1" && test "$1" != "$output"; then
14717b52abc0 Merge trunk-1.3-3
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
75 ppc_args="$ppc_args ppc/$1"
14717b52abc0 Merge trunk-1.3-3
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
76 else
14717b52abc0 Merge trunk-1.3-3
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
77 ppc_args="$ppc_args $1"
14717b52abc0 Merge trunk-1.3-3
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
78 fi
14717b52abc0 Merge trunk-1.3-3
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
79 shift
14717b52abc0 Merge trunk-1.3-3
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
80 done
14717b52abc0 Merge trunk-1.3-3
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
81 $GCC_COMPILE_PPC $ppc_args || exit $?
14717b52abc0 Merge trunk-1.3-3
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
82 if test x"$output" != x; then
14717b52abc0 Merge trunk-1.3-3
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
83 cp $output ppc/$output
14717b52abc0 Merge trunk-1.3-3
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
84 fi
14717b52abc0 Merge trunk-1.3-3
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
85
14717b52abc0 Merge trunk-1.3-3
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
86 if test x"$output" != x; then
14717b52abc0 Merge trunk-1.3-3
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
87 dir=x86/`dirname $output`
14717b52abc0 Merge trunk-1.3-3
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
88 if test -d $dir; then
14717b52abc0 Merge trunk-1.3-3
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
89 :
14717b52abc0 Merge trunk-1.3-3
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
90 else
14717b52abc0 Merge trunk-1.3-3
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
91 mkdir -p $dir
14717b52abc0 Merge trunk-1.3-3
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
92 fi
14717b52abc0 Merge trunk-1.3-3
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
93 fi
14717b52abc0 Merge trunk-1.3-3
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
94 set -- $args
14717b52abc0 Merge trunk-1.3-3
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
95 while test x$1 != x; do
14717b52abc0 Merge trunk-1.3-3
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
96 if test -f "x86/$1" && test "$1" != "$output"; then
14717b52abc0 Merge trunk-1.3-3
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
97 x86_args="$x86_args x86/$1"
14717b52abc0 Merge trunk-1.3-3
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
98 else
14717b52abc0 Merge trunk-1.3-3
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
99 x86_args="$x86_args $1"
14717b52abc0 Merge trunk-1.3-3
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
100 fi
14717b52abc0 Merge trunk-1.3-3
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
101 shift
14717b52abc0 Merge trunk-1.3-3
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
102 done
14717b52abc0 Merge trunk-1.3-3
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
103 $GCC_COMPILE_X86 $x86_args || exit $?
14717b52abc0 Merge trunk-1.3-3
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
104 if test x"$output" != x; then
14717b52abc0 Merge trunk-1.3-3
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
105 cp $output x86/$output
14717b52abc0 Merge trunk-1.3-3
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
106 fi
14717b52abc0 Merge trunk-1.3-3
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
107
14717b52abc0 Merge trunk-1.3-3
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
108 if test x"$output" != x; then
14717b52abc0 Merge trunk-1.3-3
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
109 lipo -create -o $output ppc/$output x86/$output
14717b52abc0 Merge trunk-1.3-3
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
110 fi