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
14 # Fall back to whence which ksh88 and ksh93 provide, but bash does not.
17 path=`type -p $* 2>/dev/null` && { echo $path; return 0; }
18 path=`type $* 2>/dev/null | awk '{print $NF}'` && { echo $path; 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 GCC_DRIVER="$BASE/xgcc"
51 GCC="$BASE/xgcc -B$BASE/"
52 export PATH ADA_INCLUDE_PATH ADA_OBJECTS_PATH GCC_DRIVER GCC LD_LIBRARY_PATH
54 echo '#!/bin/sh' > host_gnatchop
55 echo PATH=`dirname $host_gnatchop`:'$PATH' >> host_gnatchop
56 echo unset ADA_INCLUDE_PATH ADA_OBJECTS_PATH GCC_EXEC_PREFIX >> host_gnatchop
57 echo export PATH >> host_gnatchop
58 echo exec gnatchop '"$@"' >> host_gnatchop
60 chmod +x host_gnatchop
62 echo '#!/bin/sh' > host_gnatmake
63 echo PATH=`dirname $host_gnatmake`:'$PATH' >> host_gnatmake
64 echo unset ADA_INCLUDE_PATH ADA_OBJECTS_PATH GCC_EXEC_PREFIX >> host_gnatmake
65 echo export PATH >> host_gnatmake
66 echo exec gnatmake '"$@"' >> host_gnatmake
68 chmod +x host_gnatmake
70 # Limit the stack to 16MB for stack checking
73 exec $testdir/run_all.sh ${1+"$@"}