From: Ted Lemon Date: Thu, 5 Apr 2001 20:35:52 +0000 (+0000) Subject: Don't use the which command. X-Git-Tag: V3-BETA-2-PATCH-24~19 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e0dd13b555bfca136d39efedf8321e23364e96dd;p=thirdparty%2Fdhcp.git Don't use the which command. --- diff --git a/configure b/configure index ab08a3b09..47e4e786b 100755 --- a/configure +++ b/configure @@ -62,21 +62,26 @@ if [ "$sysname" = "" ]; then release=`uname -r` minor=`echo $release |sed -e 's/.*[0-9]*\.\([0-9][0-9]*\).*$/\1/'` major=`echo $release |sed -e 's/\([0-9][0-9]*\)\..*$/\1/'` + IFS=":" + for foo in $PATH; do + if [ x$gcc_path = x ] && [ -x $foo/gcc ]; then + gcc_path=$foo/gcc + fi + done + case $major in 4) - set `which gcc` - if [ $# != 1 ]; then + if [ x$gcc_path = x ]; then echo SunOS 4 build will not work without the GNU C Compiler. exit 1 fi sysname=sunos4;; 5) - set `which gcc` - if [ $# = 1 ]; then - sysname=sunos5-gcc + if [ x$gcc_path = x ]; then + sysname=sunos5-cc sysname_print=sunos5 else - sysname=sunos5-cc + sysname=sunos5-gcc sysname_print=sunos5 fi;; esac;; @@ -92,21 +97,31 @@ if [ "$sysname" = "" ]; then FreeBSD) sysname=freebsd;; hpux) - set `which gcc` - if [ $# = 1 ]; then - sysname=hpux-gcc + for foo in $PATH; do + if [ x$gcc_path = x ] && [ -x $foo/gcc ]; then + gcc_path=$foo/gcc + fi + done + + if [ x$gcc_path = x ]; then + sysname=hpux-cc sysname_print=hpux else - sysname=hpux-cc + sysname=hpux-gcc sysname_print=hpux fi;; HP-UX) - set `which gcc` - if [ $# = 1 ]; then - sysname=hpux-gcc + for foo in $PATH; do + if [ x$gcc_path = x ] && [ -x $foo/gcc ]; then + gcc_path=$foo/gcc + fi + done + + if [ x$gcc_path = x ]; then + sysname=hpux-cc sysname_print=hpux else - sysname=hpux-cc + sysname=hpux-gcc sysname_print=hpux fi;; QNX)