From: Eric Blake Date: Mon, 30 Aug 2010 15:51:11 +0000 (-0600) Subject: fortran: always avoid AC_LANG_CONFTEST warning X-Git-Tag: v2.68~36 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=30378453ea71e8a53c3dcc401ffa64b43353a64b;p=thirdparty%2Fautoconf.git fortran: always avoid AC_LANG_CONFTEST warning * lib/autoconf/lang.m4 (AC_LANG_CONFTEST()): Make the default match the fact that the default AC_LANG_SOURCE does not inline confdefs.h in the first place. * lib/autoconf/fortran.m4 (AC_FC_FREEFORM, AC_FC_FIXEDFORM) (AC_FC_LINE_LENGTH, __AC_FC_NAME_MANGLING): Revert previous use of AC_LANG_DEFINES_PROVIDED. Suggested by Ralf Wildenhues. Signed-off-by: Eric Blake --- diff --git a/ChangeLog b/ChangeLog index c3cec30e9..5d3ac87c5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,14 @@ 2010-08-30 Eric Blake + fortran: always avoid AC_LANG_CONFTEST warning + * lib/autoconf/lang.m4 (AC_LANG_CONFTEST()): Make the default + match the fact that the default AC_LANG_SOURCE does not inline + confdefs.h in the first place. + * lib/autoconf/fortran.m4 (AC_FC_FREEFORM, AC_FC_FIXEDFORM) + (AC_FC_LINE_LENGTH, __AC_FC_NAME_MANGLING): Revert previous use of + AC_LANG_DEFINES_PROVIDED. + Suggested by Ralf Wildenhues. + config.status: minimize use of $tmp * lib/autoconf/status.m4 (_AC_OUTPUT_MAIN_LOOP) (_AC_OUTPUT_FILES_PREPARE, _AC_OUTPUT_FILE) diff --git a/lib/autoconf/fortran.m4 b/lib/autoconf/fortran.m4 index 5e48468db..e8f7bbcd9 100644 --- a/lib/autoconf/fortran.m4 +++ b/lib/autoconf/fortran.m4 @@ -897,8 +897,8 @@ AC_DEFUN([__AC_FC_NAME_MANGLING], [_AC_FORTRAN_ASSERT()dnl AC_CACHE_CHECK([for _AC_LANG name-mangling scheme], ac_cv_[]_AC_LANG_ABBREV[]_mangling, -[AC_COMPILE_IFELSE([AC_LANG_DEFINES_PROVIDED -[ subroutine foobar() +[AC_COMPILE_IFELSE( +[[ subroutine foobar() return end subroutine foo_bar() @@ -1186,7 +1186,7 @@ for ac_flag in none -ffree-form -FR -free -qfree -Mfree -Mfreeform \ do test "x$ac_flag" != xnone && FCFLAGS="$ac_fc_freeform_FCFLAGS_save $ac_flag" dnl Use @&t@ below to ensure that editors don't turn 8+ spaces into tab. - AC_COMPILE_IFELSE([AC_LANG_DEFINES_PROVIDED[ + AC_COMPILE_IFELSE([[ program freeform ! FIXME: how to best confuse non-freeform compilers? print *, 'Hello ', & @@ -1241,7 +1241,7 @@ for ac_flag in none -ffixed-form -fixed -qfixed -Mfixed -fixedform "-f fixed" \ +source=fixed -fix do test "x$ac_flag" != xnone && FCFLAGS="$ac_fc_fixedform_FCFLAGS_save $ac_flag" - AC_COMPILE_IFELSE([AC_LANG_DEFINES_PROVIDED[ + AC_COMPILE_IFELSE([[ C This comment should confuse free-form compilers. program main end]], @@ -1324,7 +1324,7 @@ for ac_flag in none \ "-W $ac_fc_line_len" +extend_source -wide -e do test "x$ac_flag" != xnone && FCFLAGS="$ac_fc_line_length_FCFLAGS_save $ac_flag" - AC_COMPILE_IFELSE([AC_LANG_DEFINES_PROVIDED[$ac_fc_line_length_test + AC_COMPILE_IFELSE([[$ac_fc_line_length_test end subroutine]], [ac_cv_fc_line_length=$ac_flag; break]) done diff --git a/lib/autoconf/lang.m4 b/lib/autoconf/lang.m4 index bd4b68b70..d2e98f9ed 100644 --- a/lib/autoconf/lang.m4 +++ b/lib/autoconf/lang.m4 @@ -201,9 +201,13 @@ AC_DEFUN([AC_LANG_CONFTEST], # AC_LANG_CONFTEST()(BODY) # ------------------------ # Default implementation of AC_LANG_CONFTEST. +# This version assumes that you can't inline confdefs.h into your +# language, and as such, it is safe to blindly call +# AC_LANG_DEFINES_PROVIDED. Language-specific overrides should +# remove this call if AC_LANG_SOURCE does inline confdefs.h. m4_define([AC_LANG_CONFTEST()], [cat > conftest.$ac_ext <<_ACEOF -$1 +AC_LANG_DEFINES_PROVIDED[]$1 _ACEOF]) # AC_LANG_DEFINES_PROVIDED