From 3746a765394e452df175ac53944d16ad6b9933fe Mon Sep 17 00:00:00 2001 From: Pavel Roskin Date: Sun, 20 Oct 2002 06:59:38 +0000 Subject: [PATCH] =?utf8?q?Don't=20rely=20on=20which,=20use=20an=20Autoconf?= =?utf8?q?-like=20test=20instead.=20Reported=20by=20Fr=E9d=E9ric=20L.=20W.?= =?utf8?q?=20Meunier"=20<0@pervalidus.net>?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- bootstrap | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/bootstrap b/bootstrap index 3c2f517b..28d8d3de 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 -- 2.43.5