Autoconf itself has some bugs where we expand a macro, then later require it, from within the same defun'd body. Since I've just documented that this can lead to out-of-order expansion, and since I will soon be making this issue a syntax warning, we ought to set the proper example. This patch fixes one instance of it, as well as a quoting bug I noticed in m4sh. There are a couple more problems in m4sh itself (for example, _AS_SHELL_SANITIZE expands _AS_PATH_SEPARATOR_PREPARE then requires it via _AS_PATH_WALK), but I'm still trying to come up with the cleanest fixes for those.
From: Eric Blake <e...@byu.net> Date: Tue, 20 Jan 2009 10:08:11 -0700 Subject: [PATCH] Clean up some bugs caught by preliminary dependency validation. * lib/autoconf/headers.m4 (AC_DIR_HEADER): Don't invoke AC_HEADER_DIRENT, since AC_FUNC_CLOSEDIR_VOID requires it. * lib/m4sugar/m4sh.m4 (_AS_DETECT_BETTER_SHELL) (_AS_SHELL_SANITIZE): Fix quoting bugs. Signed-off-by: Eric Blake <e...@byu.net> --- ChangeLog | 8 ++++++++ lib/autoconf/headers.m4 | 15 +++++++-------- lib/m4sugar/m4sh.m4 | 4 ++-- 3 files changed, 17 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7029b84..6023598 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2009-01-20 Eric Blake <e...@byu.net> + + Clean up some bugs caught by preliminary dependency validation. + * lib/autoconf/headers.m4 (AC_DIR_HEADER): Don't invoke + AC_HEADER_DIRENT, since AC_FUNC_CLOSEDIR_VOID requires it. + * lib/m4sugar/m4sh.m4 (_AS_DETECT_BETTER_SHELL) + (_AS_SHELL_SANITIZE): Fix quoting bugs. + 2009-01-19 Eric Blake <e...@byu.net> Improve AC_REQUIRE documentation. diff --git a/lib/autoconf/headers.m4 b/lib/autoconf/headers.m4 index 0bf4f60..47468f0 100644 --- a/lib/autoconf/headers.m4 +++ b/lib/autoconf/headers.m4 @@ -1,8 +1,8 @@ # This file is part of Autoconf. -*- Autoconf -*- # Checking for headers. # -# Copyright (C) 1988, 1999, 2000, 2001, 2002, 2003, 2004, 2006, 2008 -# Free Software Foundation, Inc. +# Copyright (C) 1988, 1999, 2000, 2001, 2002, 2003, 2004, 2006, 2008, +# 2009 Free Software Foundation, Inc. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -887,8 +887,7 @@ use HAVE_STRING_H and HAVE_MEMORY_H, not NEED_MEMORY_H.]) # defines a different set of C preprocessor macros to indicate which # header file is found. AU_DEFUN([AC_DIR_HEADER], -[AC_HEADER_DIRENT -AC_FUNC_CLOSEDIR_VOID +[AC_FUNC_CLOSEDIR_VOID test ac_cv_header_dirent_dirent_h && AC_DEFINE([DIRENT], 1, [Same as `HAVE_DIRENT_H', don't depend on me.]) test ac_cv_header_dirent_sys_ndir_h && diff --git a/lib/m4sugar/m4sh.m4 b/lib/m4sugar/m4sh.m4 index 0c4c37f..2e17a9d 100644 --- a/lib/m4sugar/m4sh.m4 +++ b/lib/m4sugar/m4sh.m4 @@ -217,7 +217,7 @@ m4_define([_AS_DETECT_SUGGESTED_PRUNE], m4_defun([_AS_DETECT_BETTER_SHELL], dnl Remove any tests from suggested that are also required [m4_set_map([_AS_DETECT_SUGGESTED_BODY], [_AS_DETECT_SUGGESTED_PRUNE])]dnl -[m4_pushdef([AS_EXIT], [exit m4_default([$1], 1)])]dnl +[m4_pushdef([AS_EXIT], [exit m4_default(]m4_dquote([$][1])[, 1)])]dnl [if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="AS_ESCAPE(_m4_expand([_AS_BOURNE_COMPATIBLE]))" _AS_DETECT_EXPAND([as_required], [_AS_DETECT_REQUIRED_BODY]) @@ -429,7 +429,7 @@ test x$exitcode = x0[]])# _AS_SHELL_FN_WORK # it is executed prior to shell function definitions, hence the # temporary redefinition of AS_EXIT. m4_defun([_AS_SHELL_SANITIZE], -[m4_pushdef([AS_EXIT], [exit m4_default([$1], 1)])]dnl +[m4_pushdef([AS_EXIT], [exit m4_default(]m4_dquote([$][1])[, 1)])]dnl [m4_text_box([M4sh Initialization.]) AS_BOURNE_COMPATIBLE -- 1.6.0.4