From: Pavel Roskin Date: Sun, 20 Oct 2002 06:59:38 +0000 (+0000) Subject: Don't rely on which, use an Autoconf-like test instead. X-Git-Tag: Release-1-7-2b~127 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=57972c6718f3ae13aa23aa78ce03ef8997c2f5ed;p=thirdparty%2Fautomake.git Don't rely on which, use an Autoconf-like test instead. Reported by Frédéric L. W. Meunier" <0@pervalidus.net> --- diff --git a/bootstrap b/bootstrap index 3c2f517b6..28d8d3deb 100755 --- a/bootstrap +++ b/bootstrap @@ -23,12 +23,21 @@ # Don't ignore failures set -e -# Find perl. Not as good as autoconf would do, but good enough. +# Find perl. Code based on Autoconf, but without non-POSIX support. if test -z "$PERL"; then - PERL="`which perl 2>/dev/null`" + save_IFS=$IFS + IFS=: + for dir in $PATH; do + IFS=$save_IFS + test -z "$dir" && dir=. + if test -x "$dir/perl"; then + PERL="$dir/perl" + break + fi + done fi -if test -z $PERL; then +if test -z "$PERL"; then echo "Cannot find perl" 2>&1 exit 1 fi