From 760d01e9c82d5ca37d59906d4390c5047b498e46 Mon Sep 17 00:00:00 2001 From: hartmann Date: Wed, 8 Mar 2000 13:17:45 +0000 Subject: [PATCH] Change `which ...` into AC_PATH_PROG(...). git-svn-id: https://svn.dealii.org/trunk@2566 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/configure | 98 +++++++++++++++++++++++++++++++++++++------- deal.II/configure.in | 4 +- 2 files changed, 85 insertions(+), 17 deletions(-) diff --git a/deal.II/configure b/deal.II/configure index dec925ee93..46eeb1a203 100755 --- a/deal.II/configure +++ b/deal.II/configure @@ -769,7 +769,41 @@ else fi fi -CC=`which $CC` +# Extract the first word of "$CC", so it can be a program name with args. +set dummy $CC; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:776: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_path_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + case "$CC" in + /*) + ac_cv_path_CC="$CC" # Let the user override the test with a path. + ;; + ?:/*) + ac_cv_path_CC="$CC" # Let the user override the test with a dos path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_path_CC="$ac_dir/$ac_word" + break + fi + done + IFS="$ac_save_ifs" + ;; +esac +fi +CC="$ac_cv_path_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + for ac_prog in $CCC c++ g++ gcc CC cxx cc++ cl @@ -777,7 +811,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:781: checking for $ac_word" >&5 +echo "configure:815: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CXX'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -809,7 +843,7 @@ test -n "$CXX" || CXX="gcc" echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:813: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5 +echo "configure:847: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5 ac_ext=C # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -820,12 +854,12 @@ cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext << EOF -#line 824 "configure" +#line 858 "configure" #include "confdefs.h" int main(){return(0);} EOF -if { (eval echo configure:829: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:863: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cxx_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -851,12 +885,12 @@ if test $ac_cv_prog_cxx_works = no; then { echo "configure: error: installation or configuration problem: C++ compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:855: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:889: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cxx_cross" 1>&6 cross_compiling=$ac_cv_prog_cxx_cross echo $ac_n "checking whether we are using GNU C++""... $ac_c" 1>&6 -echo "configure:860: checking whether we are using GNU C++" >&5 +echo "configure:894: checking whether we are using GNU C++" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gxx'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -865,7 +899,7 @@ else yes; #endif EOF -if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:869: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:903: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gxx=yes else ac_cv_prog_gxx=no @@ -884,7 +918,7 @@ ac_test_CXXFLAGS="${CXXFLAGS+set}" ac_save_CXXFLAGS="$CXXFLAGS" CXXFLAGS= echo $ac_n "checking whether ${CXX-g++} accepts -g""... $ac_c" 1>&6 -echo "configure:888: checking whether ${CXX-g++} accepts -g" >&5 +echo "configure:922: checking whether ${CXX-g++} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cxx_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -915,7 +949,41 @@ else fi fi -CXX=`which $CXX` +# Extract the first word of "$CXX", so it can be a program name with args. +set dummy $CXX; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:956: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_path_CXX'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + case "$CXX" in + /*) + ac_cv_path_CXX="$CXX" # Let the user override the test with a path. + ;; + ?:/*) + ac_cv_path_CXX="$CXX" # Let the user override the test with a dos path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_path_CXX="$ac_dir/$ac_word" + break + fi + done + IFS="$ac_save_ifs" + ;; +esac +fi +CXX="$ac_cv_path_CXX" +if test -n "$CXX"; then + echo "$ac_t""$CXX" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + if test $GXX = yes ; then # find out the right version GXX_VERSION_STRING=`($CXX -v 2>&1) | grep "gcc version"` @@ -943,7 +1011,7 @@ fi # Extract the first word of "perl", so it can be a program name with args. set dummy perl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:947: checking for $ac_word" >&5 +echo "configure:1015: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_PERL'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1000,7 +1068,7 @@ fi if test $withmultithreading != no ; then echo $ac_n "checking for ACE""... $ac_c" 1>&6 -echo "configure:1004: checking for ACE" >&5 +echo "configure:1072: checking for ACE" >&5 if test -d $withmultithreading ; then echo "$ac_t""found" 1>&6 else @@ -1064,7 +1132,7 @@ else fi echo $ac_n "checking for kdoc""... $ac_c" 1>&6 -echo "configure:1068: checking for kdoc" >&5 +echo "configure:1136: checking for kdoc" >&5 if test -r $kdocdir/kdoc ; then echo "$ac_t""found" 1>&6 else @@ -1093,7 +1161,7 @@ if test "$docxx" = to-be-determined ; then # Extract the first word of ""doc++"", so it can be a program name with args. set dummy "doc++"; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1097: checking for $ac_word" >&5 +echo "configure:1165: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_docxx'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1127,7 +1195,7 @@ fi else echo $ac_n "checking for doc++""... $ac_c" 1>&6 -echo "configure:1131: checking for doc++" >&5 +echo "configure:1199: checking for doc++" >&5 if test -x "$docxx" ; then echo "$ac_t""yes" 1>&6 else diff --git a/deal.II/configure.in b/deal.II/configure.in index de40afed4f..5a39ddba3b 100644 --- a/deal.II/configure.in +++ b/deal.II/configure.in @@ -42,13 +42,13 @@ dnl shared libaries. This modifies the variable CC. dnl In order to get the absolute path of the compiler, use the dnl second line AC_PROG_CC -CC=`which $CC` +AC_PATH_PROG(CC,$CC) dnl Find the right C++ compiler. This modifies the following dnl variables: CXX, GXX, CXXFLAGS AC_PROG_CXX -CXX=`which $CXX` +AC_PATH_PROG(CXX,$CXX) if test $GXX = yes ; then # find out the right version GXX_VERSION_STRING=`($CXX -v 2>&1) | grep "gcc version"` -- 2.39.5