3 if [ "$testdir" = "" ]; then
4 echo You must use
make check or
make check-ada
8 # Provide which replacement.
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.
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; }
23 # Set up environment to use the Ada compiler from the object tree
25 host_gnatchop
=`which gnatchop`
26 host_gnatmake
=`which gnatmake`
28 BASE
=`cd $ROOT/../../..; ${PWDCMD-pwd}`
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
35 if [ ! -d $ADA_INCLUDE_PATH ]; then
36 echo gnatlib missing
, exiting.
40 if [ ! -f $BASE/gnatchop
]; then
41 echo gnattools missing
, exiting.
45 if [ ! -f $BASE/gnatmake
]; then
46 echo gnattools missing
, exiting.
50 export PATH ADA_INCLUDE_PATH ADA_OBJECTS_PATH BASE LD_LIBRARY_PATH
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
58 chmod +x host_gnatchop
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
66 chmod +x host_gnatmake
68 # Limit the stack to 16MB for stack checking
71 exec $testdir/run_all.sh
${1+"$@"}