]> git.ipfire.org Git - thirdparty/dhcp.git/commitdiff
Don't use the which command.
authorTed Lemon <source@isc.org>
Thu, 5 Apr 2001 20:35:52 +0000 (20:35 +0000)
committerTed Lemon <source@isc.org>
Thu, 5 Apr 2001 20:35:52 +0000 (20:35 +0000)
configure

index ab08a3b094da86004ab81700bb381a46d0a0f22a..47e4e786b86f3ca88400d12997818911ee1e1e28 100755 (executable)
--- 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)