]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
* tests/atspecific.m4 (_AT_CHECK_AC_MACRO): New macro.
authorAkim Demaille <akim@epita.fr>
Tue, 19 Sep 2000 10:37:57 +0000 (10:37 +0000)
committerAkim Demaille <akim@epita.fr>
Tue, 19 Sep 2000 10:37:57 +0000 (10:37 +0000)
(AT_TEST_MACRO): Use it.
* tests/semantics.m4 (AC_PROG_CPP with warnings, AC_PROG_CPP
without warnings): New tests.

ChangeLog
tests/atspecific.m4
tests/semantics.m4

index f5eae4303c22360b2b1dc7d5022cb05a604edab4..5e115f44c8d59acad6dbf96be0d899f9c6936795 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2000-09-19  Pavel Roskin  <proski@gnu.org>
+
+       * tests/atspecific.m4 (_AT_CHECK_AC_MACRO): New macro.
+       (AT_TEST_MACRO): Use it.
+       * tests/semantics.m4 (AC_PROG_CPP with warnings, AC_PROG_CPP
+       without warnings): New tests.
+
 2000-09-18  RĂ¼diger Kuhlmann <autoconf-list@ruediger-kuhlmann.de>
 
        * acgeneral.m4 (_AC_OUTPUT_SUBDIRS): Check for configure.gnu
index 0e714f11fb76334e2f0490720c89e7cdb14aa550..81194808d152092f006bd52c984c106da19b8ecd 100644 (file)
@@ -71,24 +71,21 @@ define(_m4_foreach,
 ## ---------------------------------------- ##
 
 
-
-# AT_TEST_MACRO(NAME-OF-THE-MACRO, [MACRO-USE], [ADDITIONAL-CMDS])
-# ----------------------------------------------------------------
+# _AT_CHECK_AC_MACRO(AC-BODY)
+# ---------------------------
 # Create a minimalist configure.in running the macro named
 # NAME-OF-THE-MACRO, check that autoconf runs on that script,
 # and that the shell runs correctly the configure.
 # TOP_SRCDIR is needed to set the auxdir (some macros need `install-sh',
 # `config.guess' etc.).
-AT_DEFINE(AT_TEST_MACRO,
-[AT_SETUP([$1])
-
-dnl Produce the configure.in
-AT_DATA(configure.in,
+AT_DEFINE([_AT_CHECK_AC_MACRO],
+[dnl Produce the configure.in
+AT_DATA([configure.in],
 [AC_INIT
 AC_CONFIG_AUX_DIR($top_srcdir)
 AC_CONFIG_HEADER(config.h:config.hin)
 AC_ENV_SAVE(expout)
-ifelse([$2],,[$1], [$2])
+$1
 AC_ENV_SAVE(env-after)
 AC_OUTPUT
 ])
@@ -97,8 +94,8 @@ dnl FIXME: Here we just don't consider the stderr from Autoconf.
 dnl Maybe some day we could be more precise and filter out warnings.
 dnl The problem is that currently some warnings are spread on several
 dnl lines, so grepping -v warning is not enough.
-AT_CHECK([../autoconf --autoconf-dir .. -l $at_srcdir], 0,, ignore)
-AT_CHECK([../autoheader --autoconf-dir .. -l $at_srcdir], 0,, ignore)
+AT_CHECK([autoconf --autoconf-dir .. -l $at_srcdir], 0,, ignore)
+AT_CHECK([autoheader --autoconf-dir .. -l $at_srcdir], 0,, ignore)
 AT_CHECK([top_srcdir=$top_srcdir ./configure], 0, ignore, ignore)
 test -n "$at_verbose" && echo "--- config.log" && cat config.log
 
@@ -107,9 +104,23 @@ dnl which case `env-after' is probably missing.  Don't check it then.
 if test -f env-after; then
   AT_CHECK([cat env-after], 0, expout)
 fi
+])# _AT_CHECK_AC_MACRO
+
+
+# AT_TEST_MACRO(NAME-OF-THE-MACRO, [MACRO-USE], [ADDITIONAL-CMDS])
+# ----------------------------------------------------------------
+# Create a minimalist configure.in running the macro named
+# NAME-OF-THE-MACRO, check that autoconf runs on that script,
+# and that the shell runs correctly the configure.
+# TOP_SRCDIR is needed to set the auxdir (some macros need `install-sh',
+# `config.guess' etc.).
+AT_DEFINE([AT_TEST_MACRO],
+[AT_SETUP([$1])
+
+_AT_CHECK_AC_MACRO([ifelse([$2],,[$1], [$2])])
 $3
 AT_CLEANUP(configure config.status config.log config.cache config.hin config.h env-after)dnl
-])dnl AT_TEST_MACRO
+])# AT_TEST_MACRO
 
 
 
@@ -121,6 +132,6 @@ AT_CLEANUP(configure config.status config.log config.cache config.hin config.h e
 # but those of automatically checked features (STDC_HEADERS etc.).
 # AT_CHECK_HEADER is a better name, but too close from AC_CHECK_HEADER.
 AT_DEFINE(AT_CHECK_DEFINES,
-[AT_CHECK([fgrep '#' config.h |  grep -v 'STDC_HEADERS'],, [$1])])
+[AT_CHECK([[fgrep '#' config.h | grep -v 'STDC_HEADERS']],, [$1])])
 
 divert(0)dnl
index 497dce6bcc2b5a08a21f797437901fffc0376412..0d783bb786082e74af65d53862e30a738fdb3cb4 100644 (file)
@@ -309,6 +309,69 @@ case "$GCC,$ac_cv_c_const,$ac_cv_c_inline,$ac_cv_c_volatile" in
 esac]])
 
 
+## ------------- ##
+## AC_PROG_CPP.  ##
+## ------------- ##
+
+
+# It's Ok for strict preprocessors to produce warnings.
+
+AT_SETUP([AC_PROG_CPP with warnings])
+
+AT_DATA([mycpp],
+[[#! /bin/sh
+${1+"$@"}
+err_code=$?
+echo noise >&2
+exit $err_code
+]])
+
+chmod +x mycpp
+
+_AT_CHECK_AC_MACRO(
+[AC_PROG_CPP
+# If the preprocessor is not strict, just ignore
+test "x$ac_c_preproc_warn_flag" = xyes && exit 77
+CPP="./mycpp $CPP"
+AC_CHECK_HEADERS(stdio.h autoconf_io.h)])
+
+AT_CHECK_DEFINES(
+[/* #undef HAVE_AUTOCONF_IO_H */
+#define HAVE_STDIO_H 1
+])
+
+AT_CLEANUP(configure config.status config.log config.cache config.hin config.h env-after)dnl
+
+
+# Non-strict preprocessors work if they produce no warnings.
+
+AT_SETUP([AC_PROG_CPP without warnings])
+
+AT_DATA([mycpp],
+[[#! /bin/sh
+/lib/cpp ${1+"$@"}
+exit 0
+]])
+
+chmod +x mycpp
+
+_AT_CHECK_AC_MACRO(
+[# Ignore if /lib/cpp doesn't work
+/lib/cpp </dev/null >/dev/null 2>&1 || exit 77
+CPP=./mycpp
+AC_PROG_CPP
+test "x$ac_c_preproc_warn_flag" != xyes && exit 1
+AC_CHECK_HEADERS(stdio.h autoconf_io.h)])
+
+AT_CHECK_DEFINES(
+[/* #undef HAVE_AUTOCONF_IO_H */
+#define HAVE_STDIO_H 1
+])
+
+AT_CLEANUP(configure config.status config.log config.cache config.hin config.h env-after)dnl
+
+
+
 
 
 ## ------------- ##