]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
Allow inspecting AC_PREPROC_IFELSE output in true branch.
authorRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Mon, 19 Jul 2010 17:59:19 +0000 (19:59 +0200)
committerRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Mon, 19 Jul 2010 18:03:27 +0000 (20:03 +0200)
* 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.

Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
ChangeLog
NEWS
doc/autoconf.texi
lib/autoconf/general.m4
tests/compile.at

index 01a854af7df086e60604f8b77cbb736d6dfc6e30..43aebcc95237b045d40391d97458a43b540198e9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,15 @@
 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
diff --git a/NEWS b/NEWS
index a02288115f8e095be68fb9c9a9f01370f98fc9cc..97c5495d4e9f2400d99fe0087f01af50dd93f24a 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -10,6 +10,9 @@ GNU Autoconf NEWS - User visible changes.
 
 ** 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.*.
 
index 4202108f9487a4c49b3e5e1e58f517fef2c60a3b..be7e3ef52483bf236056a66e12b99b194baa0cf2 100644 (file)
@@ -8900,7 +8900,8 @@ This macro uses @code{CPPFLAGS}, but not @code{CFLAGS}, because
 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:
index fc4905b71bf748ba28bbfe6abfc921ff5c49027b..5706d6959fd8ce9adc8d48cd10dd0a11d28d751b 100644 (file)
@@ -2461,7 +2461,7 @@ AC_DEFUN([AC_RUN_LOG],
 # 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
        }],
@@ -2486,7 +2486,7 @@ AC_DEFUN([_AC_PREPROC_IFELSE],
   [$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])
index b26d8101f96b30725fffcf383b0f5620dd6883f3..e3e4e0760425e44fae73052fb0bceaed4187d397 100644 (file)
@@ -294,8 +294,8 @@ AT_DATA([configure.ac],
 [[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])],