From: Ralf Wildenhues Date: Mon, 19 Jul 2010 17:59:19 +0000 (+0200) Subject: Allow inspecting AC_PREPROC_IFELSE output in true branch. X-Git-Tag: v2.67~15 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2fd37d5d0ac2c4f85ba17ab32e52a855e3d002c4;p=thirdparty%2Fautoconf.git 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. Signed-off-by: Ralf Wildenhues --- diff --git a/ChangeLog b/ChangeLog index 01a854af..43aebcc9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,15 @@ 2010-07-19 Ralf Wildenhues + 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 a0228811..97c5495d 100644 --- 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.*. diff --git a/doc/autoconf.texi b/doc/autoconf.texi index 4202108f..be7e3ef5 100644 --- a/doc/autoconf.texi +++ b/doc/autoconf.texi @@ -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: diff --git a/lib/autoconf/general.m4 b/lib/autoconf/general.m4 index fc4905b7..5706d695 100644 --- a/lib/autoconf/general.m4 +++ b/lib/autoconf/general.m4 @@ -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]) diff --git a/tests/compile.at b/tests/compile.at index b26d8101..e3e4e076 100644 --- a/tests/compile.at +++ b/tests/compile.at @@ -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])],