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)
[_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()
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 ', &
+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]],
"-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
# 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