[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Autoconf-patches] Re: Removing two hacks for Visual C/C++
From: |
Akim Demaille |
Subject: |
[Autoconf-patches] Re: Removing two hacks for Visual C/C++ |
Date: |
19 Sep 2000 12:49:38 +0200 |
User-agent: |
Gnus/5.0807 (Gnus v5.8.7) XEmacs/21.1 (Channel Islands) |
Thanks for the test Pavel. Here is what I checked in (this is the
test suite, so I can, eh eh eh :) based on your proposal. We
certainly can discuss improvements of the atspecific macros interface.
Index: ChangeLog
from Pavel Roskin <address@hidden>
* 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.
Index: tests/atspecific.m4
===================================================================
RCS file: /cvs/autoconf/tests/atspecific.m4,v
retrieving revision 1.9
diff -u -r1.9 atspecific.m4
--- tests/atspecific.m4 2000/07/19 09:03:55 1.9
+++ tests/atspecific.m4 2000/09/19 10:38:12
@@ -71,24 +71,21 @@
## ---------------------------------------- ##
-
-# 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 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 @@
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 @@
# 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: tests/semantics.m4
===================================================================
RCS file: /cvs/autoconf/tests/semantics.m4,v
retrieving revision 1.18
diff -u -r1.18 semantics.m4
--- tests/semantics.m4 2000/07/19 09:03:55 1.18
+++ tests/semantics.m4 2000/09/19 10:38:12
@@ -309,6 +309,69 @@
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
+
+
+
## ------------- ##