From: Akim Demaille Date: Fri, 15 Dec 2000 07:48:17 +0000 (+0000) Subject: * aclang.m4 (_AC_PROG_PREPROC_WORKS): Use _AC_PREPROC_IFELSE. X-Git-Tag: autoconf-2.50~312 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dfe7f821d1dd1026dfe03a691eec5dfc002c4935;p=thirdparty%2Fautoconf.git * aclang.m4 (_AC_PROG_PREPROC_WORKS): Use _AC_PREPROC_IFELSE. * acgeneral.m4 (_AC_TRY_CPP): Its last use was that above, so inline it into... (_AC_PREPROC_IFELSE): here. --- diff --git a/ChangeLog b/ChangeLog index 41f998f62..0841e2a06 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2000-12-15 Akim Demaille + + * aclang.m4 (_AC_PROG_PREPROC_WORKS): Use _AC_PREPROC_IFELSE. + * acgeneral.m4 (_AC_TRY_CPP): Its last use was that above, so + inline it into... + (_AC_PREPROC_IFELSE): here. + 2000-12-15 Akim Demaille * tests/atgeneral.m4 (AT_INIT): Forget about `-n'. diff --git a/acgeneral.m4 b/acgeneral.m4 index 12146c9e3..6910b2336 100644 --- a/acgeneral.m4 +++ b/acgeneral.m4 @@ -2730,17 +2730,21 @@ m4_popdef([AC_Lib_Name])dnl ## ------------------------ ## -# _AC_TRY_CPP -# ----------- + +# _AC_PREPROC_IFELSE(PROGRAM, [ACTION-IF-TRUE], [ACTION-IF-FALSE]) +# ---------------------------------------------------------------- +# Try to preprocess PROGRAM. +# # Run cpp and set ac_cpp_err to "yes" for an error, to # "$ac_(c,cxx)_preproc_warn_flag" if there are warnings or to "" if # neither warnings nor errors have been detected. eval is necessary # to expand ac_cpp. It may put trace lines to conftest.err when run # under sh -x (e.g. when zsh is used), so we filter them out. # -# Do not require AC_PROG_CPP since this macro is also used by AC_PROG_CPP. -AC_DEFUN([_AC_TRY_CPP], -[ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.err" +# This macro can be used during the selection of a preprocessor. +AC_DEFUN([_AC_PREPROC_IFELSE], +[m4_ifvaln([$1], [AC_LANG_CONFTEST([$1])])dnl +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.err" if AC_TRY_EVAL(ac_try); then if egrep -v '^ *\+' conftest.err | grep . >/dev/null; then ac_cpp_err=$ac_[]_AC_LANG_ABBREV[]_preproc_warn_flag @@ -2750,16 +2754,6 @@ if AC_TRY_EVAL(ac_try); then else ac_cpp_err=yes fi -])# _AC_TRY_CPP - - -# _AC_PREPROC_IFELSE(PROGRAM, [ACTION-IF-TRUE], [ACTION-IF-FALSE]) -# ---------------------------------------------------------------- -# Try to preprocess PROGRAM. -# This macro can be used during the selection of a preprocessor. -AC_DEFUN([_AC_PREPROC_IFELSE], -[m4_ifvaln([$1], [AC_LANG_CONFTEST([$1])])dnl -_AC_TRY_CPP() if test -z "$ac_cpp_err"; then m4_default([$2], :) else @@ -2772,8 +2766,8 @@ rm -f conftest.err m4_ifval([$1], [conftest.$ac_ext])[]dnl ])# _AC_PREPROC_IFELSE -# AC_PREPROC_IFELSE(PROGRAM, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) -# -------------------------------------------------------------------- +# AC_PREPROC_IFELSE(PROGRAM, [ACTION-IF-TRUE], [ACTION-IF-FALSE]) +# --------------------------------------------------------------- # Try to preprocess PROGRAM. Requires that the preprocessor for the # current language was checked for, hence do not use this macro in macros # looking for a preprocessor. @@ -2785,8 +2779,7 @@ _AC_PREPROC_IFELSE($@)]) # AC_TRY_CPP(INCLUDES, [ACTION-IF-TRUE], [ACTION-IF-FALSE]) # --------------------------------------------------------- # AC_TRY_CPP is used to check whether particular header files exist. -# You can check for one at a time, or more than one if you need several -# header files to all exist for some purpose. +# (But it actually tests whether INCLUDES produces no CPP errors.) # # INCLUDES are not defaulted and are double quoted. AC_DEFUN([AC_TRY_CPP], diff --git a/aclang.m4 b/aclang.m4 index 7033ae767..535a9f294 100644 --- a/aclang.m4 +++ b/aclang.m4 @@ -729,29 +729,22 @@ AC_DEFUN([_AC_PROG_PREPROC_WORKS], # with a fresh cross-compiler works. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. -AC_LANG_CONFTEST([AC_LANG_SOURCE([[#include -Syntax error]])]) ac_[]_AC_LANG_ABBREV[]_preproc_warn_flag=maybe -_AC_TRY_CPP() -# Now check whether non-existent headers can be detected and how +_AC_PREPROC_IFELSE([AC_LANG_SOURCE([[@%:@include +Syntax error]])], +[# Now check whether non-existent headers can be detected and how # Skip if ac_cpp_err is not empty - ac_cpp is broken if test -z "$ac_cpp_err"; then - AC_LANG_CONFTEST([AC_LANG_SOURCE([[@%:@include ]])]) - _AC_TRY_CPP() - if test -z "$ac_cpp_err"; then - # cannot detect missing includes at all - ac_cpp_err=yes - else - if test "x$ac_cpp_err" = xmaybe; then + _AC_PREPROC_IFELSE([AC_LANG_SOURCE([[@%:@include ]])], + [# cannot detect missing includes at all +ac_cpp_err=yes], + [if test "x$ac_cpp_err" = xmaybe; then ac_[]_AC_LANG_ABBREV[]_preproc_warn_flag=yes else ac_[]_AC_LANG_ABBREV[]_preproc_warn_flag= fi - ac_cpp_err= - fi -fi -rm -f conftest* -])# _AC_PROG_PREPROC_WORKS + ac_cpp_err=]) +fi])])# _AC_PROG_PREPROC_WORKS # AC_PROG_CPP diff --git a/lib/autoconf/c.m4 b/lib/autoconf/c.m4 index 7033ae767..535a9f294 100644 --- a/lib/autoconf/c.m4 +++ b/lib/autoconf/c.m4 @@ -729,29 +729,22 @@ AC_DEFUN([_AC_PROG_PREPROC_WORKS], # with a fresh cross-compiler works. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. -AC_LANG_CONFTEST([AC_LANG_SOURCE([[#include -Syntax error]])]) ac_[]_AC_LANG_ABBREV[]_preproc_warn_flag=maybe -_AC_TRY_CPP() -# Now check whether non-existent headers can be detected and how +_AC_PREPROC_IFELSE([AC_LANG_SOURCE([[@%:@include +Syntax error]])], +[# Now check whether non-existent headers can be detected and how # Skip if ac_cpp_err is not empty - ac_cpp is broken if test -z "$ac_cpp_err"; then - AC_LANG_CONFTEST([AC_LANG_SOURCE([[@%:@include ]])]) - _AC_TRY_CPP() - if test -z "$ac_cpp_err"; then - # cannot detect missing includes at all - ac_cpp_err=yes - else - if test "x$ac_cpp_err" = xmaybe; then + _AC_PREPROC_IFELSE([AC_LANG_SOURCE([[@%:@include ]])], + [# cannot detect missing includes at all +ac_cpp_err=yes], + [if test "x$ac_cpp_err" = xmaybe; then ac_[]_AC_LANG_ABBREV[]_preproc_warn_flag=yes else ac_[]_AC_LANG_ABBREV[]_preproc_warn_flag= fi - ac_cpp_err= - fi -fi -rm -f conftest* -])# _AC_PROG_PREPROC_WORKS + ac_cpp_err=]) +fi])])# _AC_PROG_PREPROC_WORKS # AC_PROG_CPP diff --git a/lib/autoconf/fortran.m4 b/lib/autoconf/fortran.m4 index 7033ae767..535a9f294 100644 --- a/lib/autoconf/fortran.m4 +++ b/lib/autoconf/fortran.m4 @@ -729,29 +729,22 @@ AC_DEFUN([_AC_PROG_PREPROC_WORKS], # with a fresh cross-compiler works. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. -AC_LANG_CONFTEST([AC_LANG_SOURCE([[#include -Syntax error]])]) ac_[]_AC_LANG_ABBREV[]_preproc_warn_flag=maybe -_AC_TRY_CPP() -# Now check whether non-existent headers can be detected and how +_AC_PREPROC_IFELSE([AC_LANG_SOURCE([[@%:@include +Syntax error]])], +[# Now check whether non-existent headers can be detected and how # Skip if ac_cpp_err is not empty - ac_cpp is broken if test -z "$ac_cpp_err"; then - AC_LANG_CONFTEST([AC_LANG_SOURCE([[@%:@include ]])]) - _AC_TRY_CPP() - if test -z "$ac_cpp_err"; then - # cannot detect missing includes at all - ac_cpp_err=yes - else - if test "x$ac_cpp_err" = xmaybe; then + _AC_PREPROC_IFELSE([AC_LANG_SOURCE([[@%:@include ]])], + [# cannot detect missing includes at all +ac_cpp_err=yes], + [if test "x$ac_cpp_err" = xmaybe; then ac_[]_AC_LANG_ABBREV[]_preproc_warn_flag=yes else ac_[]_AC_LANG_ABBREV[]_preproc_warn_flag= fi - ac_cpp_err= - fi -fi -rm -f conftest* -])# _AC_PROG_PREPROC_WORKS + ac_cpp_err=]) +fi])])# _AC_PROG_PREPROC_WORKS # AC_PROG_CPP diff --git a/lib/autoconf/general.m4 b/lib/autoconf/general.m4 index 12146c9e3..6910b2336 100644 --- a/lib/autoconf/general.m4 +++ b/lib/autoconf/general.m4 @@ -2730,17 +2730,21 @@ m4_popdef([AC_Lib_Name])dnl ## ------------------------ ## -# _AC_TRY_CPP -# ----------- + +# _AC_PREPROC_IFELSE(PROGRAM, [ACTION-IF-TRUE], [ACTION-IF-FALSE]) +# ---------------------------------------------------------------- +# Try to preprocess PROGRAM. +# # Run cpp and set ac_cpp_err to "yes" for an error, to # "$ac_(c,cxx)_preproc_warn_flag" if there are warnings or to "" if # neither warnings nor errors have been detected. eval is necessary # to expand ac_cpp. It may put trace lines to conftest.err when run # under sh -x (e.g. when zsh is used), so we filter them out. # -# Do not require AC_PROG_CPP since this macro is also used by AC_PROG_CPP. -AC_DEFUN([_AC_TRY_CPP], -[ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.err" +# This macro can be used during the selection of a preprocessor. +AC_DEFUN([_AC_PREPROC_IFELSE], +[m4_ifvaln([$1], [AC_LANG_CONFTEST([$1])])dnl +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.err" if AC_TRY_EVAL(ac_try); then if egrep -v '^ *\+' conftest.err | grep . >/dev/null; then ac_cpp_err=$ac_[]_AC_LANG_ABBREV[]_preproc_warn_flag @@ -2750,16 +2754,6 @@ if AC_TRY_EVAL(ac_try); then else ac_cpp_err=yes fi -])# _AC_TRY_CPP - - -# _AC_PREPROC_IFELSE(PROGRAM, [ACTION-IF-TRUE], [ACTION-IF-FALSE]) -# ---------------------------------------------------------------- -# Try to preprocess PROGRAM. -# This macro can be used during the selection of a preprocessor. -AC_DEFUN([_AC_PREPROC_IFELSE], -[m4_ifvaln([$1], [AC_LANG_CONFTEST([$1])])dnl -_AC_TRY_CPP() if test -z "$ac_cpp_err"; then m4_default([$2], :) else @@ -2772,8 +2766,8 @@ rm -f conftest.err m4_ifval([$1], [conftest.$ac_ext])[]dnl ])# _AC_PREPROC_IFELSE -# AC_PREPROC_IFELSE(PROGRAM, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) -# -------------------------------------------------------------------- +# AC_PREPROC_IFELSE(PROGRAM, [ACTION-IF-TRUE], [ACTION-IF-FALSE]) +# --------------------------------------------------------------- # Try to preprocess PROGRAM. Requires that the preprocessor for the # current language was checked for, hence do not use this macro in macros # looking for a preprocessor. @@ -2785,8 +2779,7 @@ _AC_PREPROC_IFELSE($@)]) # AC_TRY_CPP(INCLUDES, [ACTION-IF-TRUE], [ACTION-IF-FALSE]) # --------------------------------------------------------- # AC_TRY_CPP is used to check whether particular header files exist. -# You can check for one at a time, or more than one if you need several -# header files to all exist for some purpose. +# (But it actually tests whether INCLUDES produces no CPP errors.) # # INCLUDES are not defaulted and are double quoted. AC_DEFUN([AC_TRY_CPP], diff --git a/lib/autoconf/lang.m4 b/lib/autoconf/lang.m4 index 7033ae767..535a9f294 100644 --- a/lib/autoconf/lang.m4 +++ b/lib/autoconf/lang.m4 @@ -729,29 +729,22 @@ AC_DEFUN([_AC_PROG_PREPROC_WORKS], # with a fresh cross-compiler works. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. -AC_LANG_CONFTEST([AC_LANG_SOURCE([[#include -Syntax error]])]) ac_[]_AC_LANG_ABBREV[]_preproc_warn_flag=maybe -_AC_TRY_CPP() -# Now check whether non-existent headers can be detected and how +_AC_PREPROC_IFELSE([AC_LANG_SOURCE([[@%:@include +Syntax error]])], +[# Now check whether non-existent headers can be detected and how # Skip if ac_cpp_err is not empty - ac_cpp is broken if test -z "$ac_cpp_err"; then - AC_LANG_CONFTEST([AC_LANG_SOURCE([[@%:@include ]])]) - _AC_TRY_CPP() - if test -z "$ac_cpp_err"; then - # cannot detect missing includes at all - ac_cpp_err=yes - else - if test "x$ac_cpp_err" = xmaybe; then + _AC_PREPROC_IFELSE([AC_LANG_SOURCE([[@%:@include ]])], + [# cannot detect missing includes at all +ac_cpp_err=yes], + [if test "x$ac_cpp_err" = xmaybe; then ac_[]_AC_LANG_ABBREV[]_preproc_warn_flag=yes else ac_[]_AC_LANG_ABBREV[]_preproc_warn_flag= fi - ac_cpp_err= - fi -fi -rm -f conftest* -])# _AC_PROG_PREPROC_WORKS + ac_cpp_err=]) +fi])])# _AC_PROG_PREPROC_WORKS # AC_PROG_CPP