]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
* aclang.m4 (_AC_PROG_PREPROC_WORKS): Use _AC_PREPROC_IFELSE.
authorAkim Demaille <akim@epita.fr>
Fri, 15 Dec 2000 07:48:17 +0000 (07:48 +0000)
committerAkim Demaille <akim@epita.fr>
Fri, 15 Dec 2000 07:48:17 +0000 (07:48 +0000)
* acgeneral.m4 (_AC_TRY_CPP): Its last use was that above, so
inline it into...
(_AC_PREPROC_IFELSE): here.

ChangeLog
acgeneral.m4
aclang.m4
lib/autoconf/c.m4
lib/autoconf/fortran.m4
lib/autoconf/general.m4
lib/autoconf/lang.m4

index 41f998f62d23fe436c776c1fadb970befe381d74..0841e2a0647973e204f73bdf337c43034251b62f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2000-12-15  Akim Demaille  <akim@epita.fr>
+
+       * 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  <akim@epita.fr>
 
        * tests/atgeneral.m4 (AT_INIT): Forget about `-n'.
index 12146c9e3b46aa50e936debd8724c81bd6496746..6910b2336306e48540adb17fde9f32c6cefceddd 100644 (file)
@@ -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],
index 7033ae7679f0c2e694459989b8953f7f7af175b4..535a9f2945643214650660bb9a064329346dfedb 100644 (file)
--- 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 <assert.h>
-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 <assert.h>
+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_nonexistent.h>]])])
-  _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 <ac_nonexistent.h>]])],
+  [# 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
index 7033ae7679f0c2e694459989b8953f7f7af175b4..535a9f2945643214650660bb9a064329346dfedb 100644 (file)
@@ -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 <assert.h>
-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 <assert.h>
+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_nonexistent.h>]])])
-  _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 <ac_nonexistent.h>]])],
+  [# 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
index 7033ae7679f0c2e694459989b8953f7f7af175b4..535a9f2945643214650660bb9a064329346dfedb 100644 (file)
@@ -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 <assert.h>
-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 <assert.h>
+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_nonexistent.h>]])])
-  _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 <ac_nonexistent.h>]])],
+  [# 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
index 12146c9e3b46aa50e936debd8724c81bd6496746..6910b2336306e48540adb17fde9f32c6cefceddd 100644 (file)
@@ -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],
index 7033ae7679f0c2e694459989b8953f7f7af175b4..535a9f2945643214650660bb9a064329346dfedb 100644 (file)
@@ -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 <assert.h>
-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 <assert.h>
+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_nonexistent.h>]])])
-  _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 <ac_nonexistent.h>]])],
+  [# 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