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

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