From f8d5022030a536c38c5edf4b776f0047dbab9b52 Mon Sep 17 00:00:00 2001 From: Samy Al Bahra Date: Fri, 3 Mar 2017 19:23:32 -0500 Subject: [PATCH] configure: do not rely on pathsearch if full executable path provided. This issue was pointed out by Mark Callaghan. Fixes #90. --- configure | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/configure b/configure index e840d41..e933e6c 100755 --- a/configure +++ b/configure @@ -561,9 +561,11 @@ else fi printf "Finding suitable compiler........" -CC=`pathsearch "${CC:-cc}"` -if test -z "$CC" -o ! -x "$CC"; then - CC=`pathsearch "${CC:-gcc}"` +if test ! -x "${CC}"; then + CC=`pathsearch "${CC:-cc}"` + if test -z "$CC" -o ! -x "$CC"; then + CC=`pathsearch "${CC:-gcc}"` + fi fi assert "$CC" "not found" @@ -596,7 +598,7 @@ int main(void) { EOF $CC -o .1 .1.c -COMPILER=`./.1` +COMPILER=`./.1 2> /dev/null` r=$? rm -f .1.c .1