[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
71-ac-preproc-ifelse.patch
From: |
Akim Demaille |
Subject: |
71-ac-preproc-ifelse.patch |
Date: |
Thu, 14 Dec 2000 09:55:22 +0100 |
Index: ChangeLog
from Akim Demaille <address@hidden>
* acgeneral.m4 (_AC_PREPROC_IFELSE, AC_PREPROC_IFELSE): New.
(AC_TRY_CPP): Use AC_PREPROC_IFELSE.
(AC_CHECK_MEMBER, AC_CHECK_DECL, _AC_CHECK_TYPE_NEW): Quote
properly.
* acheaders.m4 (AC_CHECK_HEADER): Quote properly, use
AC_PREPROC_IFELSE.
* acspecific.m4 (_AC_PATH_X_DIRECT): Use AC_PREPROC_IFELSE.
Index: acgeneral.m4
--- acgeneral.m4 Tue, 12 Dec 2000 20:23:51 +0100 akim (ace/27_acgeneral.
1.169.8.102 644)
+++ acgeneral.m4 Wed, 13 Dec 2000 19:48:45 +0100 akim (ace/27_acgeneral.
1.169.8.102 644)
@@ -2344,8 +2344,8 @@ AC_DEFUN([AC_CHECK_MEMBER],
m4_patsubst([$1], [\..*]) foo;
dnl foo.MEMBER;
foo.m4_patsubst([$1], [^[^.]*\.]);])],
- AC_VAR_SET(ac_Member, yes),
- AC_VAR_SET(ac_Member, no))])
+ [AC_VAR_SET(ac_Member, yes)],
+ [AC_VAR_SET(ac_Member, no)])])
AS_IFELSE([test AC_VAR_GET(ac_Member) = yes],
[$2], [$3])dnl
AC_VAR_POPDEF([ac_Member])dnl
@@ -2744,16 +2744,12 @@ AC_DEFUN([_AC_TRY_CPP],
])# _AC_TRY_CPP
-# 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.
-#
-# INCLUDES are not defaulted.
-AC_DEFUN([AC_TRY_CPP],
-[AC_LANG_PREPROC_REQUIRE()dnl
-AC_LANG_CONFTEST([AC_LANG_SOURCE([[$1]])])
+# _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], :)
@@ -2763,8 +2759,29 @@ AC_DEFUN([AC_TRY_CPP],
cat conftest.$ac_ext >&AS_MESSAGE_LOG_FD
$3
fi
-rm -f conftest*
-])# AC_TRY_CPP
+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])
+# --------------------------------------------------------------------
+# 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.
+AC_DEFUN([AC_PREPROC_IFELSE],
+[AC_LANG_PREPROC_REQUIRE()dnl
+_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.
+#
+# INCLUDES are not defaulted and are double quoted.
+AC_DEFUN([AC_TRY_CPP],
+[AC_PREPROC_IFELSE([AC_LANG_SOURCE([[$1]])], [$2], [$3])])
# AC_EGREP_CPP(PATTERN, PROGRAM,
@@ -3005,7 +3022,8 @@ AC_DEFUN([AC_CHECK_DECL],
char *p = (char *) $1;
#endif
])],
-AC_VAR_SET(ac_Symbol, yes), AC_VAR_SET(ac_Symbol, no))])
+ [AC_VAR_SET(ac_Symbol, yes)],
+ [AC_VAR_SET(ac_Symbol, no)])])
AS_IFELSE([test AC_VAR_GET(ac_Symbol) = yes],
[$2], [$3])dnl
AC_VAR_POPDEF([ac_Symbol])dnl
@@ -3236,8 +3254,8 @@ m4_define([_AC_CHECK_TYPE_NEW],
return 0;
if (sizeof ($1))
return 0;])],
- AC_VAR_SET(ac_Type, yes),
- AC_VAR_SET(ac_Type, no))])
+ [AC_VAR_SET(ac_Type, yes)],
+ [AC_VAR_SET(ac_Type, no)])])
AS_IFELSE([test AC_VAR_GET(ac_Type) = yes],
[$2], [$3])dnl
AC_VAR_POPDEF([ac_Type])dnl
Index: acheaders.m4
--- acheaders.m4 Sat, 18 Nov 2000 12:03:30 +0100 akim (ace/b/48_acheaders. 1.3
644)
+++ acheaders.m4 Wed, 13 Dec 2000 19:51:49 +0100 akim (ace/b/48_acheaders. 1.3
644)
@@ -64,11 +64,12 @@
# ----------------------------------------------------------------------
AC_DEFUN([AC_CHECK_HEADER],
[AC_VAR_PUSHDEF([ac_Header], [ac_cv_header_$1])dnl
-AC_ARG_VAR([CPPFLAGS], [C/C++ preprocessor flags, e.g. -I<include dir> if you
have headers in a nonstandard directory <include dir>])
+AC_ARG_VAR([CPPFLAGS],
+ [C/C++ preprocessor flags, e.g. -I<include dir> if you have headers
in a nonstandard directory <include dir>])
AC_CACHE_CHECK([for $1], ac_Header,
-[AC_TRY_CPP([#include <$1>
-],
-AC_VAR_SET(ac_Header, yes), AC_VAR_SET(ac_Header, no))])
+ [AC_PREPROC_IFELSE([AC_LANG_SOURCE(address@hidden:@include
<$1>])],
+ [AC_VAR_SET(ac_Header, yes)],
+ [AC_VAR_SET(ac_Header, no)])])
AS_IFELSE([test AC_VAR_GET(ac_Header) = yes],
[$2], [$3])dnl
AC_VAR_POPDEF([ac_Header])dnl
Index: acspecific.m4
--- acspecific.m4 Wed, 13 Dec 2000 19:17:47 +0100 akim (ace/25_acspecific 1.116
644)
+++ acspecific.m4 Wed, 13 Dec 2000 19:55:10 +0100 akim (ace/25_acspecific 1.116
644)
@@ -909,7 +909,7 @@ m4_define([_AC_PATH_X_DIRECT],
if test "$ac_x_includes" = no; then
# Guess where to find include files, by looking for Intrinsic.h.
# First, try using that file with no special directory specified.
- AC_TRY_CPP(address@hidden:@include <X11/Intrinsic.h>],
+ AC_PREPROC_IFELSE([AC_LANG_SOURCE(address@hidden:@include
<X11/Intrinsic.h>])],
[# We can compile using X headers with no special include directory.
ac_x_includes=],
[for ac_dir in $ac_x_header_dirs; do
- 71-ac-preproc-ifelse.patch,
Akim Demaille <=