From 32f24c2e56fc442d28fdfedcb935306360e956de Mon Sep 17 00:00:00 2001 From: wolf Date: Tue, 7 Mar 2000 10:09:55 +0000 Subject: [PATCH] Fix test to find doc++. git-svn-id: https://svn.dealii.org/trunk@2561 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/configure | 126 +++++++++++++++++++++++++++++-------------- deal.II/configure.in | 20 ++++--- 2 files changed, 100 insertions(+), 46 deletions(-) diff --git a/deal.II/configure b/deal.II/configure index e27784657f..dec925ee93 100755 --- a/deal.II/configure +++ b/deal.II/configure @@ -536,13 +536,21 @@ OS=`uname` +ac_ext=C +# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cxx_cross + + # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:546: checking for $ac_word" >&5 +echo "configure:554: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -572,7 +580,7 @@ if test -z "$CC"; then # 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:576: checking for $ac_word" >&5 +echo "configure:584: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -623,7 +631,7 @@ fi # Extract the first word of "cl", so it can be a program name with args. set dummy cl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:627: checking for $ac_word" >&5 +echo "configure:635: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -655,7 +663,7 @@ fi fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:659: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:667: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -666,12 +674,12 @@ cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext << EOF -#line 670 "configure" +#line 678 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:675: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:683: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -685,24 +693,24 @@ else ac_cv_prog_cc_works=no fi rm -fr conftest* -ac_ext=c -# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. -ac_cpp='$CPP $CPPFLAGS' -ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -cross_compiling=$ac_cv_prog_cc_cross +ac_ext=C +# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cxx_cross echo "$ac_t""$ac_cv_prog_cc_works" 1>&6 if test $ac_cv_prog_cc_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 ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:701: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:709: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:706: checking whether we are using GNU C" >&5 +echo "configure:714: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -711,7 +719,7 @@ else yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:715: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:723: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no @@ -730,7 +738,7 @@ ac_test_CFLAGS="${CFLAGS+set}" ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:734: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:742: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -769,7 +777,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:773: checking for $ac_word" >&5 +echo "configure:781: 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 @@ -801,7 +809,7 @@ test -n "$CXX" || CXX="gcc" echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:805: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5 +echo "configure:813: 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. @@ -812,12 +820,12 @@ cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext << EOF -#line 816 "configure" +#line 824 "configure" #include "confdefs.h" int main(){return(0);} EOF -if { (eval echo configure:821: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:829: \"$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 @@ -831,24 +839,24 @@ else ac_cv_prog_cxx_works=no fi rm -fr conftest* -ac_ext=c -# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. -ac_cpp='$CPP $CPPFLAGS' -ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -cross_compiling=$ac_cv_prog_cc_cross +ac_ext=C +# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cxx_cross echo "$ac_t""$ac_cv_prog_cxx_works" 1>&6 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:847: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:855: 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:852: checking whether we are using GNU C++" >&5 +echo "configure:860: 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 @@ -857,7 +865,7 @@ else yes; #endif EOF -if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:861: \"$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:869: \"$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 @@ -876,7 +884,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:880: checking whether ${CXX-g++} accepts -g" >&5 +echo "configure:888: 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 @@ -935,7 +943,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:939: checking for $ac_word" >&5 +echo "configure:947: 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 @@ -992,7 +1000,7 @@ fi if test $withmultithreading != no ; then echo $ac_n "checking for ACE""... $ac_c" 1>&6 -echo "configure:996: checking for ACE" >&5 +echo "configure:1004: checking for ACE" >&5 if test -d $withmultithreading ; then echo "$ac_t""found" 1>&6 else @@ -1056,7 +1064,7 @@ else fi echo $ac_n "checking for kdoc""... $ac_c" 1>&6 -echo "configure:1060: checking for kdoc" >&5 +echo "configure:1068: checking for kdoc" >&5 if test -r $kdocdir/kdoc ; then echo "$ac_t""found" 1>&6 else @@ -1078,16 +1086,54 @@ if test "${with_docxx+set}" = set; then withval="$with_docxx" docxx=$withval else - docxx=`which doc++` + docxx=to-be-determined fi -echo $ac_n "checking for doc++""... $ac_c" 1>&6 -echo "configure:1086: checking for doc++" >&5 -if test -x $docxx ; then - echo "$ac_t""found" 1>&6 +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 +if eval "test \"`echo '$''{'ac_cv_path_docxx'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 else - echo "$ac_t""not found" 1>&6 - docxx= + case "$docxx" in + /*) + ac_cv_path_docxx="$docxx" # Let the user override the test with a path. + ;; + ?:/*) + ac_cv_path_docxx="$docxx" # 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_docxx="$ac_dir/$ac_word" + break + fi + done + IFS="$ac_save_ifs" + ;; +esac +fi +docxx="$ac_cv_path_docxx" +if test -n "$docxx"; then + echo "$ac_t""$docxx" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +else + echo $ac_n "checking for doc++""... $ac_c" 1>&6 +echo "configure:1131: checking for doc++" >&5 + if test -x "$docxx" ; then + echo "$ac_t""yes" 1>&6 + else + echo "$ac_t""no" 1>&6 + docxx= + fi fi diff --git a/deal.II/configure.in b/deal.II/configure.in index 8bd3e9a264..de40afed4f 100644 --- a/deal.II/configure.in +++ b/deal.II/configure.in @@ -27,6 +27,10 @@ OS=`uname` AC_SUBST(OS) +dnl Set the language for which subsequent tests shall be +dnl performed to C++ +AC_LANG_CPLUSPLUS + dnl ------------------------------------------------------------- @@ -179,13 +183,17 @@ dnl Find the doc++ program AC_ARG_WITH(docxx, [ --with-docxx=PATH use the doc++ executable pointed to by PATH], docxx=$withval, - docxx=`which doc++`) -AC_MSG_CHECKING(for doc++) -if test -x $docxx ; then - AC_MSG_RESULT(found) + docxx=to-be-determined) +if test "$docxx" = to-be-determined ; then + AC_PATH_PROG(docxx,"doc++") else - AC_MSG_RESULT(not found) - docxx= + AC_MSG_CHECKING(for doc++) + if test -x "$docxx" ; then + AC_MSG_RESULT(yes) + else + AC_MSG_RESULT(no) + docxx= + fi fi AC_SUBST(docxx) -- 2.39.5