summaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorTed Lemon <source@isc.org>2001-04-05 20:35:52 +0000
committerTed Lemon <source@isc.org>2001-04-05 20:35:52 +0000
commite0dd13b555bfca136d39efedf8321e23364e96dd (patch)
tree304925e7aadca09ee31caf233a9e0e90c42e86d1 /configure
parent6071365896a5bc41067d18a0f764e9b405d1eb84 (diff)
downloadisc-dhcp-e0dd13b555bfca136d39efedf8321e23364e96dd.tar.gz
Don't use the which command.
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure43
1 files changed, 29 insertions, 14 deletions
diff --git a/configure b/configure
index ab08a3b0..47e4e786 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)