From: bangerth Date: Wed, 3 Sep 2008 11:38:43 +0000 (+0000) Subject: New gfortran libraries appear not to have the _gfortran_allocate symbol so keep check... X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e8ceb0d144dbacd484d43f8dc5f4b5b8b25d9d61;p=dealii-svn.git New gfortran libraries appear not to have the _gfortran_allocate symbol so keep checking till we find something we recognize. git-svn-id: https://svn.dealii.org/trunk@16724 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/aclocal.m4 b/deal.II/aclocal.m4 index ba009b9806..6a237bdef4 100644 --- a/deal.II/aclocal.m4 +++ b/deal.II/aclocal.m4 @@ -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) diff --git a/deal.II/configure b/deal.II/configure index d86428df02..3e61f2f770 100755 --- a/deal.II/configure +++ b/deal.II/configure @@ -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 @@ -11216,9 +11217,78 @@ fi { 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)