summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlbert Cheng <acheng@hdfgroup.org>2000-04-24 20:34:05 (GMT)
committerAlbert Cheng <acheng@hdfgroup.org>2000-04-24 20:34:05 (GMT)
commit043b7c4ec58fc06cc42cb62aec7741deb807c996 (patch)
tree5880de9993e0a8f7ca2717ebba0067d04fca3e8b
parent4a473d24cd6129222f805bdf86498a3ddff8f830 (diff)
downloadhdf5-043b7c4ec58fc06cc42cb62aec7741deb807c996.zip
hdf5-043b7c4ec58fc06cc42cb62aec7741deb807c996.tar.gz
hdf5-043b7c4ec58fc06cc42cb62aec7741deb807c996.tar.bz2
[svn-r2198] Figure out the whole path of the $CC command if it is in simple
command form (e.g., cc, gcc) and put that in the libhdf5.settings file. This would help show exactly which compiler was used during the configure stage. It may not be 100% "correct" in some cases such as "configure done in one machine but compiling done in another."
-rwxr-xr-xconfigure13
-rw-r--r--configure.in13
2 files changed, 24 insertions, 2 deletions
diff --git a/configure b/configure
index 7efa62d..dad480a 100755
--- a/configure
+++ b/configure
@@ -9177,7 +9177,18 @@ PARALLEL=${PARALLEL:-no}
if test "X-$cc_vendor" != "X-" && test "X-$cc_version" != "X-"; then
CC_VERSION="$CC ($cc_vendor-$cc_version)"
else
- CC_VERSION="$CC"
+ # If $CC contains directory component, take it as is;
+ # else search it among PATH components.
+ if `echo $CC | grep / 2>&1 /dev/null`; then
+ CC_VERSION="$CC"
+ else
+ for x in `echo $PATH | sed -e 's/:/ /g'`; do
+ if test -x $x/$CC; then
+ CC_VERSION="$x/$CC"
+ break
+ fi
+ done
+ fi
fi
diff --git a/configure.in b/configure.in
index 8abbdaf..ecc8d49 100644
--- a/configure.in
+++ b/configure.in
@@ -1223,7 +1223,18 @@ AC_SUBST(CC_VERSION)
if test "X-$cc_vendor" != "X-" && test "X-$cc_version" != "X-"; then
CC_VERSION="$CC ($cc_vendor-$cc_version)"
else
- CC_VERSION="$CC"
+ # If $CC contains directory component, take it as is;
+ # else search it among PATH components.
+ if `echo $CC | grep / 2>&1 /dev/null`; then
+ CC_VERSION="$CC"
+ else
+ for x in `echo $PATH | sed -e 's/:/ /g'`; do
+ if test -x $x/$CC; then
+ CC_VERSION="$x/$CC"
+ break
+ fi
+ done
+ fi
fi