[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
74--ac-try-cpp.patch
From: |
Akim Demaille |
Subject: |
74--ac-try-cpp.patch |
Date: |
Thu, 14 Dec 2000 09:55:37 +0100 |
Index: ChangeLog
from Akim Demaille <address@hidden>
* 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.
Index: acgeneral.m4
--- acgeneral.m4 Wed, 13 Dec 2000 21:03:15 +0100 akim (ace/27_acgeneral.
1.169.8.104 644)
+++ acgeneral.m4 Wed, 13 Dec 2000 21:12:30 +0100 akim (ace/27_acgeneral.
1.169.8.104 644)
@@ -2730,17 +2730,21 @@ m4_define([AH_CHECK_LIB],
## ------------------------ ##
-# _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 @@ AC_DEFUN([_AC_TRY_CPP],
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 @@ AC_DEFUN([_AC_PREPROC_IFELSE],
])# _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_DEFUN([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: aclang.m4
--- aclang.m4 Tue, 12 Dec 2000 21:14:11 +0100 akim (ace/b/32_aclang.m4 1.5.3.55
644)
+++ aclang.m4 Wed, 13 Dec 2000 21:08:47 +0100 akim (ace/b/32_aclang.m4 1.5.3.55
644)
@@ -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(address@hidden:@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(address@hidden:@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(address@hidden:@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
- 74--ac-try-cpp.patch,
Akim Demaille <=