5 if test `uname` = "Darwin"; then
6 if test "$1" = "armv6"; then
12 ARCHS
="i386 x86_64 ppc"
19 for ARCH
in $ARCHS; do
20 CFLAGS
="-Os -nodefaultlibs -I../../lib"
21 if test "$ARCH" != '<host>'; then
22 CFLAGS
="-arch $ARCH $CFLAGS"
24 for FILE
in $
(ls *.c
); do
25 # Use -nodefaultlibs to avoid using libgcc.a
26 # Use -lSystem to link with libSystem.dylb.
27 # Note -lSystem is *after* libcompiler_rt.Optimized.a so that linker will
28 # prefer our implementation over the ones in libSystem.dylib
30 if test $FILE = gcc_personality_test.c
32 # the gcc_personality_test.c requires a helper C++ program
33 EXTRA
="-fexceptions gcc_personality_test_helper.cxx -lstdc++ /usr/lib/libgcc_s.1.dylib"
34 # the libgcc_s.1.dylib use at the end is a hack until libSystem contains _Unwind_Resume
36 if test $FILE = trampoline_setup_test.c
38 # this test requires an extra compiler option
39 EXTRA
="-fnested-functions"
41 if test "$REMOTE" = "1"
43 if gcc
$CFLAGS $FILE ..
/..
/darwin_fat
/Release
/libcompiler_rt.a
$LIBS $EXTRA -o .
/remote
/$FILE.exe
45 echo "Built $FILE.exe for $ARCH"
47 echo "$FILE failed to compile"
50 if gcc
$CFLAGS $FILE ..
/..
/darwin_fat
/Release
/libcompiler_rt.a
$LIBS $EXTRA
52 echo "Testing $FILE for $ARCH"
61 echo "$FILE failed to compile"