]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Make the test for the compiler version simpler.
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 21 Jul 2000 11:14:06 +0000 (11:14 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 21 Jul 2000 11:14:06 +0000 (11:14 +0000)
git-svn-id: https://svn.dealii.org/trunk@3187 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/configure
deal.II/configure.in

index 3f8588f946e600512e07c6ba88f162e6b7f42185..f02135263bd5aece532ed9d291b68158c523d7f7 100755 (executable)
@@ -1164,18 +1164,24 @@ fi
 if test $GXX = yes ; then
   # find out the right version
   GXX_VERSION_STRING=`($CXX -v 2>&1) | grep "gcc version"`
-  if test -n "`echo $GXX_VERSION_STRING | grep egcs-1.1`" ; then
-    echo "$ac_t""Compiler is egcs-1.1" 1>&6
-    GXX_VERSION=egcs1.1
-  else
-    if test -n "`echo $GXX_VERSION_STRING | grep 'gcc version 2.95'`" ; then
-      echo "$ac_t""Compiler is gcc-2.95" 1>&6
-      GXX_VERSION=gcc2.95
-    else
-      echo "$ac_t""Compiler is unknown but accepted" 1>&6
-      GXX_VERSION=other
-    fi
-  fi
+  case "$GXX_VERSION_STRING" in
+    *"egcs-1.1"*)
+       echo "$ac_t""Compiler is egcs-1.1" 1>&6
+       GXX_VERSION=egcs1.1
+       ;;
+    *2.95*)
+       echo "$ac_t""Compiler is gcc-2.95" 1>&6
+       GXX_VERSION=gcc2.95
+       ;;
+    *2.4* | *2.5* | *2.6* | *2.7* | *2.8*)
+                       echo "$ac_t""Compiler is $GXX_VERSION_STRING" 1>&6
+       { echo "configure: error: Compiler is not supported" 1>&2; exit 1; }
+       ;;
+    *)
+       echo "$ac_t""Compiler is unknown but accepted gcc version" 1>&6
+       GXX_VERSION=other
+       ;;
+  esac
 else
   { echo "configure: error: No configuration options for this C++ compiler
                supported at present" 1>&2; exit 1; }
@@ -1188,7 +1194,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:1192: checking for $ac_word" >&5
+echo "configure:1198: 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
@@ -1273,7 +1279,7 @@ fi
 if test $enablemultithreading = yes ; then
   
   echo $ac_n "checking for platform specific thread flags""... $ac_c" 1>&6
-echo "configure:1277: checking for platform specific thread flags" >&5
+echo "configure:1283: checking for platform specific thread flags" >&5
   
   for i in threads mt pthread pthreads mthreads Kthread kthread invalid_last_entry; do
     CXXFLAGS="$CXXFLAGSG -$i"
@@ -1306,14 +1312,15 @@ EOF
        echo "$ac_t"""no flag found!"" 1>&6
        { echo "configure: error: "Could not determine multithreading flag for this platform. Aborting!"" 1>&2; exit 1; }
   fi
+  LDFLAGS = "-$thread_flag $LDFLAGS"
   echo "$ac_t"""-$thread_flag"" 1>&6
 
   
   echo $ac_n "checking for platform specific multi-threading defines""... $ac_c" 1>&6
-echo "configure:1314: checking for platform specific multi-threading defines" >&5
+echo "configure:1321: checking for platform specific multi-threading defines" >&5
   
   cat > conftest.$ac_ext <<EOF
-#line 1317 "configure"
+#line 1324 "configure"
 #include "confdefs.h"
 
 #if !defined (_REENTRANT) && !defined (_THREAD_SAFE)
@@ -1327,7 +1334,7 @@ int main() {
    
 ; return 0; }
 EOF
-if { (eval echo configure:1331: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1338: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   
        echo "$ac_t"""not necessary"" 1>&6
@@ -1365,7 +1372,7 @@ fi
 
 if test $withmultithreading != no ; then
   echo $ac_n "checking for ACE""... $ac_c" 1>&6
-echo "configure:1369: checking for ACE" >&5
+echo "configure:1376: checking for ACE" >&5
   if test -d $withmultithreading ; then
     echo "$ac_t""found" 1>&6
   else
@@ -1385,7 +1392,7 @@ if test "${with_blas+set}" = set; then
   withval="$with_blas"
   if test $withval != no ; then
     echo $ac_n "checking for BLAS""... $ac_c" 1>&6
-echo "configure:1389: checking for BLAS" >&5
+echo "configure:1396: checking for BLAS" >&5
     if test -r $withval ; then
       echo "$ac_t""found" 1>&6
     else
@@ -1401,7 +1408,7 @@ EOF
   
 else
   echo $ac_n "checking for main in -lblas""... $ac_c" 1>&6
-echo "configure:1405: checking for main in -lblas" >&5
+echo "configure:1412: checking for main in -lblas" >&5
 ac_lib_var=`echo blas'_'main | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1409,14 +1416,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lblas  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1413 "configure"
+#line 1420 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:1420: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1427: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -1448,7 +1455,7 @@ if test "${with_lapack+set}" = set; then
   withval="$with_lapack"
   if test $withval != no ; then
     echo $ac_n "checking for LAPACK""... $ac_c" 1>&6
-echo "configure:1452: checking for LAPACK" >&5
+echo "configure:1459: checking for LAPACK" >&5
     if test -r $withval ; then
       echo "$ac_t""found" 1>&6
     else
@@ -1464,7 +1471,7 @@ EOF
   
 else
   echo $ac_n "checking for dgels_ in -llapack""... $ac_c" 1>&6
-echo "configure:1468: checking for dgels_ in -llapack" >&5
+echo "configure:1475: checking for dgels_ in -llapack" >&5
 ac_lib_var=`echo lapack'_'dgels_ | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1472,7 +1479,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-llapack  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1476 "configure"
+#line 1483 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 #ifdef __cplusplus
@@ -1486,7 +1493,7 @@ int main() {
 dgels_()
 ; return 0; }
 EOF
-if { (eval echo configure:1490: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1497: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -1553,7 +1560,7 @@ else
 fi
 
 echo $ac_n "checking for kdoc""... $ac_c" 1>&6
-echo "configure:1557: checking for kdoc" >&5
+echo "configure:1564: checking for kdoc" >&5
 if test $kdocdir != ${DEAL2_DIR}/contrib/kdoc/bin ; then
   if test -r $kdocdir/kdoc ; then
     echo "$ac_t""found" 1>&6
@@ -1589,7 +1596,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:1593: checking for $ac_word" >&5
+echo "configure:1600: 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
@@ -1623,7 +1630,7 @@ fi
 
 else
   echo $ac_n "checking for doc++""... $ac_c" 1>&6
-echo "configure:1627: checking for doc++" >&5
+echo "configure:1634: checking for doc++" >&5
   if test -x "$docxx" ; then
     echo "$ac_t""yes" 1>&6
   else
@@ -1638,7 +1645,7 @@ fi
 
 
   echo $ac_n "checking whether getrusage is properly declared""... $ac_c" 1>&6
-echo "configure:1642: checking whether getrusage is properly declared" >&5
+echo "configure:1649: checking whether getrusage is properly declared" >&5
   ac_ext=C
 # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
 ac_cpp='$CXXCPP $CPPFLAGS'
@@ -1648,7 +1655,7 @@ cross_compiling=$ac_cv_prog_cxx_cross
 
 
   cat > conftest.$ac_ext <<EOF
-#line 1652 "configure"
+#line 1659 "configure"
 #include "confdefs.h"
 
 #include <sys/resource.h>
@@ -1660,7 +1667,7 @@ int main() {
     
 ; return 0; }
 EOF
-if { (eval echo configure:1664: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1671: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   
        echo "$ac_t"""yes"" 1>&6
@@ -1678,11 +1685,11 @@ fi
 rm -f conftest*
 
     echo $ac_n "checking whether isnan is declared with debug flags""... $ac_c" 1>&6
-echo "configure:1682: checking whether isnan is declared with debug flags" >&5
+echo "configure:1689: checking whether isnan is declared with debug flags" >&5
   
   CXXFLAGS=$CXXFLAGSG
   cat > conftest.$ac_ext <<EOF
-#line 1686 "configure"
+#line 1693 "configure"
 #include "confdefs.h"
 
 #include <cmath>
@@ -1694,7 +1701,7 @@ int main() {
     
 ; return 0; }
 EOF
-if { (eval echo configure:1698: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1705: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   
        echo "$ac_t"""yes"" 1>&6
@@ -1710,7 +1717,7 @@ else
        for testflag in -D_ISOC99_SOURCE -D__EXTENSIONS__ ; do 
          CXXFLAGS="$CXXFLAGSG $testflag"
           cat > conftest.$ac_ext <<EOF
-#line 1714 "configure"
+#line 1721 "configure"
 #include "confdefs.h"
 
 #include <cmath>
@@ -1722,7 +1729,7 @@ int main() {
            
 ; return 0; }
 EOF
-if { (eval echo configure:1726: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1733: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   
                deal_II_isnan_flag="-DHAVE_ISNAN $testflag"
@@ -1750,11 +1757,11 @@ fi
 rm -f conftest*
 
     echo $ac_n "checking whether isnan is declared with optimized flags""... $ac_c" 1>&6
-echo "configure:1754: checking whether isnan is declared with optimized flags" >&5
+echo "configure:1761: checking whether isnan is declared with optimized flags" >&5
   
   CXXFLAGS=$CXXFLAGSO
   cat > conftest.$ac_ext <<EOF
-#line 1758 "configure"
+#line 1765 "configure"
 #include "confdefs.h"
 
 #include <cmath>
@@ -1766,7 +1773,7 @@ int main() {
     
 ; return 0; }
 EOF
-if { (eval echo configure:1770: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1777: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   
        echo "$ac_t"""yes"" 1>&6
@@ -1782,7 +1789,7 @@ else
        for testflag in -D_ISOC99_SOURCE -D__EXTENSIONS__ ; do 
          CXXFLAGS="$CXXFLAGSO $testflag"
           cat > conftest.$ac_ext <<EOF
-#line 1786 "configure"
+#line 1793 "configure"
 #include "confdefs.h"
 
 #include <cmath>
@@ -1794,7 +1801,7 @@ int main() {
            
 ; return 0; }
 EOF
-if { (eval echo configure:1798: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1805: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   
                deal_II_isnan_flag="-DHAVE_ISNAN $testflag"
@@ -1840,16 +1847,16 @@ esac
 
 CXXFLAGS="$CXXFLAGSG"
 echo $ac_n "checking for consistency of CXXFLAGSG flags""... $ac_c" 1>&6
-echo "configure:1844: checking for consistency of CXXFLAGSG flags" >&5
+echo "configure:1851: checking for consistency of CXXFLAGSG flags" >&5
 cat > conftest.$ac_ext <<EOF
-#line 1846 "configure"
+#line 1853 "configure"
 #include "confdefs.h"
 
 int main() {
 ;
 ; return 0; }
 EOF
-if { (eval echo configure:1853: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1860: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   
     echo "$ac_t""yes" 1>&6
@@ -1867,16 +1874,16 @@ rm -f conftest*
 
 CXXFLAGS="$CXXFLAGSO"
 echo $ac_n "checking for consistency of CXXFLAGSO flags""... $ac_c" 1>&6
-echo "configure:1871: checking for consistency of CXXFLAGSO flags" >&5
+echo "configure:1878: checking for consistency of CXXFLAGSO flags" >&5
 cat > conftest.$ac_ext <<EOF
-#line 1873 "configure"
+#line 1880 "configure"
 #include "confdefs.h"
 
 int main() {
 ;
 ; return 0; }
 EOF
-if { (eval echo configure:1880: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1887: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   
     echo "$ac_t""yes" 1>&6
index c71461881d0726473017bcad16544de8dcf49695..2e25f3ecf054b8cae6513d49f678f094180f1f3e 100644 (file)
@@ -100,18 +100,26 @@ 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"`
-  if test -n "`echo $GXX_VERSION_STRING | grep egcs-1.1`" ; then
-    AC_MSG_RESULT(Compiler is egcs-1.1)
-    GXX_VERSION=egcs1.1
-  else
-    if test -n "`echo $GXX_VERSION_STRING | grep 'gcc version 2.95'`" ; then
-      AC_MSG_RESULT(Compiler is gcc-2.95)
-      GXX_VERSION=gcc2.95
-    else
-      AC_MSG_RESULT(Compiler is unknown but accepted)
-      GXX_VERSION=other
-    fi
-  fi
+  case "$GXX_VERSION_STRING" in
+    *"egcs-1.1"*)
+       AC_MSG_RESULT(Compiler is egcs-1.1)
+       GXX_VERSION=egcs1.1
+       ;;
+    *2.95*)
+       AC_MSG_RESULT(Compiler is gcc-2.95)
+       GXX_VERSION=gcc2.95
+       ;;
+    *2.4* | *2.5* | *2.6* | *2.7* | *2.8*)
+       dnl These compilers are too old to support a useful subset
+       dnl of modern C++, so we don't support them
+       AC_MSG_RESULT(Compiler is $GXX_VERSION_STRING)
+       AC_MSG_ERROR(Compiler is not supported)
+       ;;
+    *)
+       AC_MSG_RESULT(Compiler is unknown but accepted gcc version)
+       GXX_VERSION=other
+       ;;
+  esac
 else
   AC_MSG_ERROR(No configuration options for this C++ compiler
                supported at present)

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.