From 25b50ea7e6301e982533b0b4b7b1f4a06c23bb1e Mon Sep 17 00:00:00 2001 From: Samy Al Bahra Date: Thu, 24 Mar 2011 06:34:16 -0400 Subject: [PATCH] Don't use which, it apparently sucks on some platforms. Patch submitted by: Wez Furlong . --- configure | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/configure b/configure index feb3c87..f9cb468 100755 --- a/configure +++ b/configure @@ -287,7 +287,27 @@ PROFILE="${PROFILE:-$PLATFORM}" PLATFORM="__${PLATFORM}__" printf "Finding suitable compiler........" -CC=`which "${CC:-cc}"` + +# `which` on Solaris sucks +pathsearch() +{ + what=$1 + oldFS="$IFS" + IFS=":" + for d in $PATH ; do + if test -x "$d/$what" ; then + echo "$d/$what"; + IFS="$oldFS" + return + fi + done + IFS="$oldFS" +} + +CC=`pathsearch "${CC:-cc}"` +if test -z "$CC" -o ! -x "$CC"; then + CC=`pathsearch "${CC:-gcc}"` +fi assert "$CC" "not found" # Make sure GCC 4.X, the only supported compiler, is being used.