* 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 <[email protected]> --- > I've run out of time to test this; it will have to wait until after > the weekend on my side of things. > Of course, the final patch should remove some of the uglification > added in the previous round of patches to fortran.m4, and probably > some testsuite exposure. Done like this. Since the testsuite is what already covered the need to uglify the fortran macros in the first place, removing the uglification and rerunning the testsuite with no failures is proof that this is a good fix, without having to add new tests. ChangeLog | 9 +++++++++ lib/autoconf/fortran.m4 | 10 +++++----- lib/autoconf/lang.m4 | 6 +++++- 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index c3cec30..5d3ac87 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,14 @@ 2010-08-30 Eric Blake <[email protected]> + 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 5e48468..e8f7bbc 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 bd4b68b..21cb7a5 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 -- 1.7.2.2
