]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
fortran: always avoid AC_LANG_CONFTEST warning
authorEric Blake <eblake@redhat.com>
Mon, 30 Aug 2010 15:51:11 +0000 (09:51 -0600)
committerEric Blake <eblake@redhat.com>
Mon, 30 Aug 2010 16:43:33 +0000 (10:43 -0600)
* 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 <eblake@redhat.com>
ChangeLog
lib/autoconf/fortran.m4
lib/autoconf/lang.m4

index c3cec30e9d7f8043cc75af2f4cba6d44a40956a3..5d3ac87c51dad52caf543c4e3d2464d7093dbf15 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
 2010-08-30  Eric Blake  <eblake@redhat.com>
 
+       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)
index 5e48468db9674abe14180f6b65377928cee849f7..e8f7bbcd95907500151aeada2583b14746b17543 100644 (file)
@@ -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
index bd4b68b7030636bfcdf2157d4e93852de2a83938..d2e98f9edbc6ba378c3e54a43d914eac1096da91 100644 (file)
@@ -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