forked from gambit/gambit
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build
executable file
·83 lines (63 loc) · 2.15 KB
/
build
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#! /bin/sh
# Copyright (c) 1994-2009 by Marc Feeley, All Rights Reserved.
herefromroot="prebuilt/macosx"
rootfromhere="../.."
if [ "`id -un`" != "root" ] ; then
echo "You must execute this script as root!"
echo "Try executing the command:"
echo " sudo $0"
exit 1
fi
export INSTALL_PREFIX="/Library/Gambit-C"
cd "`dirname $0`"
for VARIANT in intel32 intel64 G3 G4 G5 universal; do
cd "$rootfromhere"
case "$VARIANT" in
intel32) CONFIG_ARCH="-arch i386"
CONFIG_HOST="--host=i386-apple-darwin9"
RUN_TESTS=1
;;
intel64) CONFIG_ARCH="-arch x86_64 -m64"
CONFIG_HOST="--host=i386-apple-darwin9"
RUN_TESTS=0
;;
G3) CONFIG_ARCH="-arch ppc750"
CONFIG_HOST="--host=powerpc-apple-darwin9"
RUN_TESTS=0
;;
G4) CONFIG_ARCH="-arch ppc7400"
CONFIG_HOST="--host=powerpc-apple-darwin9"
RUN_TESTS=0
;;
G5) CONFIG_ARCH="-arch ppc970 -m64"
CONFIG_HOST="--host=powerpc-apple-darwin9"
RUN_TESTS=0
;;
universal) CONFIG_ARCH="-arch i386 -arch ppc750"
CONFIG_HOST=""
RUN_TESTS=1
;;
esac
SYSROOT="/Developer/SDKs/MacOSX10.5.sdk"
CFLAGS="-isysroot $SYSROOT $CONFIG_ARCH" LDFLAGS="-mmacosx-version-min=10.5 -Wl,-syslibroot,$SYSROOT $CONFIG_ARCH" ./configure "$CONFIG_HOST" --prefix="$INSTALL_PREFIX" --enable-multiple-versions --enable-symlinks --enable-single-host # --enable-gcc-opts
cd "$herefromroot"
chmod +x build-phase2
./build-phase2 "$VARIANT" "$RUN_TESTS" > build-phase2.out
cat build-phase2.out
SUCCESS=0
if fgrep "************ TESTS SUCCESSFUL" build-phase2.out > /dev/null; then
SUCCESS=1
else
if fgrep "************ TESTS SKIPPED" build-phase2.out > /dev/null; then
SUCCESS=1
fi
fi
rm -f build-phase2.out
if [ "$SUCCESS" == "1" ] ; then
echo "************ BUILD SUCCESSFUL ($VARIANT variant)"
else
echo "************ BUILD FAILED ($VARIANT variant)"
exit 1
fi
done
echo "************ macosx BUILD SUCCESSFUL"