From 965fef45d984b2ca0767fe5048e97a065254c3a1 Mon Sep 17 00:00:00 2001 From: James Laird Date: Thu, 3 Mar 2005 14:39:10 -0500 Subject: [svn-r10132] Purpose: Bug fix Description: When C flags are passed in using $CC variable, this can confuse test commands in configure (for instance, CC='pgcc -tp k8-32'). Solution: Previous solution didn't entirely solve problem. Wrote a sed snippit to strip flags from $CC for purposes of test in configure. Platforms tested: mir (just a configure bug) --- configure | 6 ++++-- configure.in | 7 +++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/configure b/configure index 8aee473..a71cb2f 100755 --- a/configure +++ b/configure @@ -47580,12 +47580,14 @@ fi PARALLEL=${PARALLEL:-no} -if `echo $CC | grep / >/dev/null 2>&1`; then +CC_NOFLAGS=`echo $CC | sed 's/ -.*//'` + +if `echo $CC_NOFLAGS | grep ^/ >/dev/null 2>&1`; then CC_VERSION="$CC" else CC_VERSION="$CC"; for x in `echo $PATH | sed -e 's/:/ /g'`; do - if test -x $x/$CC; then + if test -x $x/$CC_NOFLAG; then CC_VERSION="$x/$CC" break fi diff --git a/configure.in b/configure.in index b6f5ba0..87fcd78 100644 --- a/configure.in +++ b/configure.in @@ -2771,12 +2771,15 @@ PARALLEL=${PARALLEL:-no} dnl Compiler with version information. This consists of the full path dnl name of the compiler and the reported version number. AC_SUBST([CC_VERSION]) -if `echo $CC | grep / >/dev/null 2>&1`; then +dnl Strip anything that looks like a flag off of $CC +CC_NOFLAGS=`echo $CC | sed 's/ -.*//'` + +if `echo $CC_NOFLAGS | grep ^/ >/dev/null 2>&1`; then CC_VERSION="$CC" else CC_VERSION="$CC"; for x in `echo $PATH | sed -e 's/:/ /g'`; do - if test -x $x/$CC; then + if test -x $x/$CC_NOFLAG; then CC_VERSION="$x/$CC" break fi -- cgit v0.12