diff options
author | Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> | 2010-05-03 16:40:54 +0000 |
---|---|---|
committer | Rainer Orth <ro@gcc.gnu.org> | 2010-05-03 16:40:54 +0000 |
commit | d5ece0a1f59fd71e156bc58c8423eb7ea8d16480 (patch) | |
tree | 18c4d20be0718748467fe8219ead9030e05d5a8f /gcc/testsuite/ada | |
parent | e6693cfa844724b9638ba35ebadc295eb8ef1b3c (diff) | |
download | gcc-d5ece0a1f59fd71e156bc58c8423eb7ea8d16480.tar.gz |
run_acats (which): New function.
* ada/acats/run_acats (which): New function.
(host_gnatchop, host_gnatmake): Use it.
From-SVN: r158994
Diffstat (limited to 'gcc/testsuite/ada')
-rwxr-xr-x | gcc/testsuite/ada/acats/run_acats | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/gcc/testsuite/ada/acats/run_acats b/gcc/testsuite/ada/acats/run_acats index 3c3d89908f6..c389e647422 100755 --- a/gcc/testsuite/ada/acats/run_acats +++ b/gcc/testsuite/ada/acats/run_acats @@ -5,10 +5,25 @@ if [ "$testdir" = "" ]; then exit 1 fi +# Provide which replacement. +# +# type -p is missing from Solaris 2 /bin/sh and /bin/ksh (ksh88), but both +# ksh93 and bash have it. +# type output format differs between ksh88 and ksh93, so avoid it if +# type -p is present. +# Fall back to whence which ksh88 and ksh93 provide, but bash does not. + +which () { + type -p $* 2>/dev/null && return 0 + type $* 2>/dev/null | awk '{print $3}' && return 0 + whence $* 2>/dev/null && return 0 + return 1 +} + # Set up environment to use the Ada compiler from the object tree -host_gnatchop=`type gnatchop | awk '{print $3}'` -host_gnatmake=`type gnatmake | awk '{print $3}'` +host_gnatchop=`which gnatchop` +host_gnatmake=`which gnatmake` ROOT=`${PWDCMD-pwd}` BASE=`cd $ROOT/../../..; ${PWDCMD-pwd}` |