]> git.saurik.com Git - apple/objc4.git/blob - test/headers.sh
objc4-756.2.tar.gz
[apple/objc4.git] / test / headers.sh
1 #!/bin/sh
2
3 # Compile every exported ObjC header as if it were a file in every language.
4 # This script is executed by test headers.c's TEST_BUILD command.
5
6 TESTINCLUDEDIR=$1; shift
7 TESTLOCALINCLUDEDIR=$1; shift
8 COMPILE_C=$1; shift
9 COMPILE_CXX=$1; shift
10 COMPILE_M=$1; shift
11 COMPILE_MM=$1; shift
12 VERBOSE=$1; shift
13
14 # stop after any command error
15 set -e
16
17 # echo commands when verbose
18 if [ "$VERBOSE" != "0" ]; then
19 set -x
20 fi
21
22 FILES="$TESTINCLUDEDIR/objc/*.h $TESTLOCALINCLUDEDIR/objc/*.h"
23 CFLAGS='-fsyntax-only -Wno-unused-function -D_OBJC_PRIVATE_H_'
24
25 $COMPILE_C $CFLAGS $FILES
26 $COMPILE_CXX $CFLAGS $FILES
27 $COMPILE_M $CFLAGS $FILES
28 $COMPILE_MM $CFLAGS $FILES
29 for STDC in '99' '11' ; do
30 $COMPILE_C $CFLAGS $FILES -std=c$STDC
31 $COMPILE_M $CFLAGS $FILES -std=c$STDC
32 done
33 for STDCXX in '98' '03' '11' '14' '17' ; do
34 $COMPILE_CXX $CFLAGS $FILES -std=c++$STDCXX
35 $COMPILE_MM $CFLAGS $FILES -std=c++$STDCXX
36 done
37
38 echo done