]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
New gfortran libraries appear not to have the _gfortran_allocate symbol so keep check...
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 3 Sep 2008 11:38:43 +0000 (11:38 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 3 Sep 2008 11:38:43 +0000 (11:38 +0000)
git-svn-id: https://svn.dealii.org/trunk@16724 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/aclocal.m4
deal.II/configure

index ba009b98064232e70c5ab5d000a68d52cb5ed11b..6a237bdef492c47ff512a05f326e126d516b0330 100644 (file)
@@ -1568,8 +1568,18 @@ AC_DEFUN(DEAL_II_SET_F77_FLAGS, dnl
 
        dnl Make sure we link both possible libraries here. Shame on gfortran!
        AC_CHECK_LIB(g2c, e_wsfe, [ F77LIBS="$F77LIBS -lg2c" ])
-       dnl TODO: Replace _gfortran_allocate by something really needed
-       AC_CHECK_LIB(gfortran, _gfortran_allocate, [ F77LIBS="$F77LIBS -lgfortran" ])
+
+       dnl Check whether libgfortran contains certain symbols. We used
+       dnl to use _gfortran_allocate but that appears to have disappeared
+       dnl at one point in time so if we can't find it check other symbols
+       dnl till we find one we recognize
+       AC_CHECK_LIB(gfortran, _gfortran_allocate, [found=1])
+        AC_CHECK_LIB(gfortran, _gfortran_st_write_done, [found=1])
+
+       dnl libgfortran appears to exist. Link with it.
+        if test "x$found" = "x1" ; then
+          F77LIBS="$F77LIBS -lgfortran"
+        fi
        ;;
 
     AIXF77)
index d86428df0228682d9e9d53fd42b8369c83bd8555..3e61f2f770d6b2f44c0bc7804f2de2286b73c0ee 100755 (executable)
@@ -11154,7 +11154,8 @@ if test $ac_cv_lib_g2c_e_wsfe = yes; then
    F77LIBS="$F77LIBS -lg2c"
 fi
 
-               { echo "$as_me:$LINENO: checking for _gfortran_allocate in -lgfortran" >&5
+
+                                       { echo "$as_me:$LINENO: checking for _gfortran_allocate in -lgfortran" >&5
 echo $ECHO_N "checking for _gfortran_allocate in -lgfortran... $ECHO_C" >&6; }
 if test "${ac_cv_lib_gfortran__gfortran_allocate+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 { echo "$as_me:$LINENO: result: $ac_cv_lib_gfortran__gfortran_allocate" >&5
 echo "${ECHO_T}$ac_cv_lib_gfortran__gfortran_allocate" >&6; }
 if test $ac_cv_lib_gfortran__gfortran_allocate = yes; then
-   F77LIBS="$F77LIBS -lgfortran"
+  found=1
 fi
 
+        { echo "$as_me:$LINENO: checking for _gfortran_st_write_done in -lgfortran" >&5
+echo $ECHO_N "checking for _gfortran_st_write_done in -lgfortran... $ECHO_C" >&6; }
+if test "${ac_cv_lib_gfortran__gfortran_st_write_done+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lgfortran  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char _gfortran_st_write_done ();
+int
+main ()
+{
+return _gfortran_st_write_done ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_cxx_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_gfortran__gfortran_st_write_done=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_lib_gfortran__gfortran_st_write_done=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_gfortran__gfortran_st_write_done" >&5
+echo "${ECHO_T}$ac_cv_lib_gfortran__gfortran_st_write_done" >&6; }
+if test $ac_cv_lib_gfortran__gfortran_st_write_done = yes; then
+  found=1
+fi
+
+
+        if test "x$found" = "x1" ; then
+          F77LIBS="$F77LIBS -lgfortran"
+        fi
        ;;
 
     AIXF77)

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.