comparison gcc/testsuite/ada/acats/run_acats.sh @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children
comparison
equal deleted inserted replaced
68:561a7518be6b 111:04ced10e8804
1 #!/bin/sh
2
3 if [ "$testdir" = "" ]; then
4 echo You must use make check or make check-ada
5 exit 1
6 fi
7
8 # Provide which replacement.
9 #
10 # type -p is missing from Solaris 2 /bin/sh and /bin/ksh (ksh88), but both
11 # ksh93 and bash have it.
12 # type output format differs between ksh88 and ksh93, so avoid it if
13 # type -p is present. Unfortunately, HP-UX /bin/sh ignores -p with type.
14 # Fall back to whence which ksh88 and ksh93 provide, but bash does not.
15
16 which () {
17 path=`type -p $* 2>/dev/null` && { echo $path | awk '{print $NF}'; return 0; }
18 path=`type $* 2>/dev/null` && { echo $path | awk '{print $NF}'; return 0; }
19 path=`whence $* 2>/dev/null` && { echo $path; return 0; }
20 return 1
21 }
22
23 # Set up environment to use the Ada compiler from the object tree
24
25 host_gnatchop=`which gnatchop`
26 host_gnatmake=`which gnatmake`
27 ROOT=`${PWDCMD-pwd}`
28 BASE=`cd $ROOT/../../..; ${PWDCMD-pwd}`
29
30 PATH=$BASE:$ROOT:$PATH
31 ADA_INCLUDE_PATH=$BASE/ada/rts
32 LD_LIBRARY_PATH=$ADA_INCLUDE_PATH:$BASE:$LD_LIBRARY_PATH
33 ADA_OBJECTS_PATH=$ADA_INCLUDE_PATH
34
35 if [ ! -d $ADA_INCLUDE_PATH ]; then
36 echo gnatlib missing, exiting.
37 exit 1
38 fi
39
40 if [ ! -f $BASE/gnatchop ]; then
41 echo gnattools missing, exiting.
42 exit 1
43 fi
44
45 if [ ! -f $BASE/gnatmake ]; then
46 echo gnattools missing, exiting.
47 exit 1
48 fi
49
50 export PATH ADA_INCLUDE_PATH ADA_OBJECTS_PATH BASE LD_LIBRARY_PATH
51
52 echo '#!/bin/sh' > host_gnatchop
53 echo PATH=`dirname $host_gnatchop`:'$PATH' >> host_gnatchop
54 echo unset ADA_INCLUDE_PATH ADA_OBJECTS_PATH GCC_EXEC_PREFIX >> host_gnatchop
55 echo export PATH >> host_gnatchop
56 echo exec gnatchop '"$@"' >> host_gnatchop
57
58 chmod +x host_gnatchop
59
60 echo '#!/bin/sh' > host_gnatmake
61 echo PATH=`dirname $host_gnatmake`:'$PATH' >> host_gnatmake
62 echo unset ADA_INCLUDE_PATH ADA_OBJECTS_PATH GCC_EXEC_PREFIX >> host_gnatmake
63 echo export PATH >> host_gnatmake
64 echo exec gnatmake '"$@"' >> host_gnatmake
65
66 chmod +x host_gnatmake
67
68 # Limit the stack to 16MB for stack checking
69 ulimit -s 16384
70
71 exec $testdir/run_all.sh ${1+"$@"}