autoconf-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Autoconf-patches] Re: Removing two hacks for Visual C/C++


From: Pavel Roskin
Subject: [Autoconf-patches] Re: Removing two hacks for Visual C/C++
Date: Mon, 18 Sep 2000 22:04:49 -0400 (EDT)

Hello, Akim!

> BTW, could you try to write a test for AC_TRY_CPP?  Something we
> include in the test suite that tries something that succeeds for sure,
> and fails for sure too.

Here it is. Look carefully, it's the first time I touch the testsuite.

NOTE: The patch for nested AT_DATA should be applied first. Sorry for
inconvenience.

ChangeLog:
        * tests/semantics.m4 (AC_PROG_CPP_1, AC_PROG_CPP_2): New tests
        for AC_PROG_CPP.

========================
--- tests/semantics.m4  Mon Sep 18 20:34:56 2000
+++ tests/semantics.m4  Mon Sep 18 22:01:21 2000
@@ -71,6 +71,56 @@
 
 
 
+## ------------- ##
+## AC_PROG_CPP.  ##
+## ------------- ##
+
+# AC_PROG_CPP_1
+# -------------
+# It's Ok for strict preprocessors to produce warnings
+AT_TEST_MACRO(AC_PROG_CPP_1,
+[AT_DATA(mycpp,
+[[#! /bin/sh
+${1+"$@"}
+err_code=$?
+echo noise >&2
+exit $err_code
+]])
+chmod +x mycpp
+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
+])])
+
+
+# AC_PROG_CPP_2
+# -------------
+# Non-strict preprocessors work if they produce no warnings
+AT_TEST_MACRO(AC_PROG_CPP_2,
+[AT_DATA(mycpp,
+[[#! /bin/sh
+/lib/cpp ${1+"$@"}
+exit 0
+]])
+# Ignore if /lib/cpp doesn't work
+if /lib/cpp </dev/null >/dev/null 2>&1; then :;else exit 77; fi
+chmod +x mycpp
+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
+])])
+
+
+
 # AC_CHECK_MEMBERS
 # ----------------
 # Check that it performs the correct actions.
========================

Regards,
Pavel Roskin



reply via email to

[Prev in Thread] Current Thread [Next in Thread]