2010-07-19 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
+ Allow inspecting AC_PREPROC_IFELSE output in true branch.
+ * lib/autoconf/general.m4 (_AC_PREPROC_IFELSE_BODY): Redirect
+ preprocessor output to conftest.i rather than /dev/null.
+ (_AC_PREPROC_IFELSE): Remove conftest.i in the postprocessing.
+ * tests/compile.at (Order of user actions and cleanup): Extend
+ test in the ACTION-IF-TRUE branch.
+ * doc/autoconf.texi (Running the Preprocessor): Document new
+ feature.
+ * NEWS: Update.
+
Fix AC_FC_LIBRARY_LDFLAGS detection for BlueGene xlf -qipa.
* lib/autoconf/fortran.m4 (_AC_FC_LIBRARY_LDFLAGS): Ignore
'-link', added spuriously when -qipa is used with the XL
** New macro AC_FC_LINE_LENGTH to accept long Fortran source code lines.
+** AC_PREPROC_IFELSE now keeps the preprocessed output in the conftest.i
+ file for inspection by the commands in the ACTION-IF-TRUE argument.
+
* Major changes in Autoconf 2.66 (2010-07-02) [stable]
Released by Eric Blake, based on git versions 2.65.*.
preprocessors.
It is customary to report unexpected failures with
-@code{AC_MSG_FAILURE}.
+@code{AC_MSG_FAILURE}. If needed, @var{action-if-true} can further access
+the preprocessed output in the file @file{conftest.i}.
@end defmac
For instance:
# Shell function body for _AC_PREPROC_IFELSE.
m4_define([_AC_PREPROC_IFELSE_BODY],
[ AS_LINENO_PUSH([$[]1])
- AS_IF([_AC_DO_STDERR([$ac_cpp conftest.$ac_ext]) >/dev/null && {
+ AS_IF([_AC_DO_STDERR([$ac_cpp conftest.$ac_ext]) > conftest.i && {
test -z "$ac_[]_AC_LANG_ABBREV[]_preproc_warn_flag$ac_[]_AC_LANG_ABBREV[]_werror_flag" ||
test ! -s conftest.err
}],
[$0_BODY])]dnl
[m4_ifvaln([$1], [AC_LANG_CONFTEST([$1])])]dnl
[AS_IF([ac_fn_[]_AC_LANG_ABBREV[]_try_cpp "$LINENO"], [$2], [$3])
-rm -f conftest.err[]m4_ifval([$1], [ conftest.$ac_ext])[]dnl
+rm -f conftest.err conftest.i[]m4_ifval([$1], [ conftest.$ac_ext])[]dnl
])# _AC_PREPROC_IFELSE
# AC_PREPROC_IFELSE(PROGRAM, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
[[AC_INIT
AC_PROG_CC
-AC_PREPROC_IFELSE([AC_LANG_PROGRAM([int ok;], [])],
- [test -f conftest.err || AS_EXIT([1])],
+AC_PREPROC_IFELSE([AC_LANG_PROGRAM([int grepme;], [])],
+ [{ test -f conftest.err && grep grepme conftest.i; } || AS_EXIT([1])],
[AS_EXIT([1])])
AC_PREPROC_IFELSE([AC_LANG_PROGRAM([#define 12 34 /*], [])],
[AS_EXIT([1])],