autoconf-patches
[Top][All Lists]
Advanced

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

autoupdate warts


From: Ralf Wildenhues
Subject: autoupdate warts
Date: Sat, 12 Sep 2009 11:00:13 +0200
User-agent: Mutt/1.5.20 (2009-08-09)

The recent removal of many obsolete macro uses from gnulib indicates
that autoupdate has been getting better: Between all of gnulib's 499
macro files, autoupdate failed to correctly update five of them (not
counting white space cleanups, of course) with
  for file in *.m4; do autoupdate $file; done

- exponentd.m4 strsignal.m4:
obsolete macro names being used inside AC_REQUIRE or pushdef/popdef.

- sockets.m4 wctype.m4:
nested obsolete macros.

- printf.m4:
uses a macro within the argument of an obsolete macro.

Below are new xfailures for them, for reference, but at least some might
simply need documenting the autoupdate limitation in the manual.

Thanks,
Ralf

    Four new autoupdate tests, expected failures.
    
    * tests/tools.at (autoupdating macros recursively)
    (autoupdating with m4@&address@hidden, autoupdating with AC_REQUIRE)
    (autoupdating with complex quoting): New tests.

diff --git a/tests/tools.at b/tests/tools.at
index 6034981..20a0f43 100644
--- a/tests/tools.at
+++ b/tests/tools.at
@@ -890,6 +890,31 @@ AT_CHECK([[grep 'NEW(\[0, 0], *\[0])' configure.ac]], 0, 
[ignore], [ignore])
 AT_CLEANUP
 
 
+# autoupdating macros recursively
+# -------------------------------
+
+AT_SETUP([autoupdating macros recursively])
+
+AT_XFAIL_IF([:])
+
+AT_DATA([configure.ac],
+[[AC_INIT
+AC_PROG_CC
+AC_TRY_COMPILE([], [choke me], [echo bogus1],
+              [AC_TRY_COMPILE([], [return 0;], [echo good], [echo bogus2])])
+AC_OUTPUT
+]])
+
+# Checking `autoupdate'.
+AT_CHECK_AUTOUPDATE
+AT_CHECK([grep changequote configure.ac], [1])
+AT_CHECK([grep TRY_COMPILE configure.ac], [1])
+AT_CHECK_AUTOCONF
+AT_CHECK_CONFIGURE
+
+AT_CLEANUP
+
+
 # autoupdating AC_HELP_STRING
 # ---------------------------
 AT_SETUP([autoupdating AC_HELP_STRING])
@@ -944,6 +969,85 @@ AT_CHECK_CONFIGURE([], [], [], [ignore])
 AT_CLEANUP
 
 
+# autoupdating with m4_pushdef
+# ----------------------------
+AT_SETUP([autoupdating with m4@&address@hidden)
+
+AT_XFAIL_IF([:])
+
+touch foo.in
+AT_DATA([configure.ac],
+[[AC_INIT
+AC_PROG_CC
+# temporarily override this macro
+m4@&address@hidden([AC_MSG_RESULT_UNQUOTED], [:])
+AC_C_BIGENDIAN
+m4@&address@hidden([AC_MSG_RESULT_UNQUOTED])
+AC_OUTPUT
+]])
+
+# Checking `autoupdate'.
+AT_CHECK_AUTOUPDATE([], [], [], [ignore])
+AT_CHECK([grep changequote configure.ac], [1])
+AT_CHECK([grep [pushdef.*AC_MSG_RESULT_UNQUOTED] configure.ac], [0], [ignore])
+AT_CHECK_AUTOCONF
+AT_CHECK_CONFIGURE([], [], [], [ignore])
+
+AT_CLEANUP
+
+
+# autoupdating with AC_REQUIRE
+# ----------------------------
+AT_SETUP([autoupdating with AC_REQUIRE])
+
+AT_XFAIL_IF([:])
+
+AT_DATA([configure.ac],
+[[AC_DEFUN([MACRO],
+[AC_REQUIRE([AC_DECL_SYS_SIGLIST])
+AC_CHECK_DECLS([_sys_siglist], [], [], [#include <signal.h>])
+])
+
+AC_INIT
+MACRO
+AC_OUTPUT
+]])
+
+# Checking `autoupdate'.
+AT_CHECK_AUTOUPDATE([], [], [], [ignore])
+AT_CHECK_AUTOCONF
+AT_CHECK_CONFIGURE([], [], [], [ignore])
+
+AT_CLEANUP
+
+
+# autoupdating with complex quoting
+# ---------------------------------
+AT_SETUP([autoupdating with complex quoting])
+
+AT_XFAIL_IF([:])
+
+AT_DATA([configure.ac],
+[[m4_define([MACRO],
+[[#define STRING "hello, world\n"
+]])
+
+AC_INIT
+AC_TRY_COMPILE([#include <stdio.h>
+              ]MACRO[], [printf (STRING);],
+              [], [AS_EXIT([1])])
+AC_OUTPUT
+]])
+
+# Checking `autoupdate'.
+AT_CHECK_AUTOUPDATE([], [], [], [ignore])
+AT_CHECK_AUTOCONF
+AT_CHECK([grep MACRO configure], [1])
+AT_CHECK_CONFIGURE([], [], [], [ignore])
+
+AT_CLEANUP
+
+
 # autoupdating AC_LANG_SAVE
 # -------------------------
 AT_SETUP([autoupdating AC_LANG_SAVE])




reply via email to

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