+2003-11-26 Paolo Bonzini <bonzini@bogus.example.com>
+
+ * bin/autoupdate.in: Trace AU_DEFINE instead of AU_DEFUN.
+ * doc/autoconf.texi: Don't say that the third parameter
+ is broken.
+ * lib/autoconf/autoupdate.m4 (AU_DEFINE): New dummy macro.
+ (AU_DEFUN): Honor the third parameter, create autoupdate
+ macros with AU_DEFINE.
+ * lib/autoconf/headers.m4 (AC_USG, AC_MEMORY_H,
+ AC_DIR_HEADER): Use AU_DEFUN's third parameter.
+ * lib/autoconf/lang.m4 (AC_LANG_SAVE): Likewise.
+ * lib/autoconf/programs.m4 (AC_RSH): Likewise.
+ * lib/autoconf/specific.m4 (AC_HAVE_POUNDBANG,
+ AC_ARG_ARRAY, AC_CYGWIN, AC_EMXOS2, AC_MINGW32,
+ AC_XENIX_DIR): Likewise.
+ * lib/autoconf/types.m4 (AC_INT_16_BITS, AC_LONG_64_BITS,
+ AC_STRUCT_ST_BLKSIZE, AC_STRUCT_ST_RDEV): Likewise.
+ * lib/autoconf/status.m4: Remove FIXME.
+ * tests/local.at (AT_CHECK_AU_MACRO): Ignore stderr, check
+ that the macro is not present anymore in the updated
+ configure.ac.
+ * tests/tools.at (autoupdate AC_LINK_FILES): Ignore stderr
+ of autoupdate.
+
2004-01-28 Paul Eggert <eggert@twinsun.com>
* lib/autoconf/autotest.m4 (AC_CONFIG_TESTDIR): Add 2004 to
#! @PERL@ -w
# -*- perl -*-
# autoupdate - modernize an Autoconf file.
-# Copyright (C) 1994, 1999, 2000, 2001, 2002, 2003
+# Copyright (C) 1994, 1999, 2000, 2001, 2002, 2003, 2004
# Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
sub handle_autoconf_macros ()
{
my $macros = new Autom4te::XFile ("$autoconf"
- . " --trace AU_DEFUN:'AU:\$f:\$1'"
+ . " --trace AU_DEFINE:'AU:\$f:\$1'"
. " --trace define:'AC:\$f:\$1'"
. " --melt /dev/null |");
while ($_ = $macros->getline)
's/\b(' . join ('|', keys %au_macros) . ')\b/_au_changequote([,])$1/g';
# au.m4 -- definitions the AU macros.
-xsystem ("$autoconf --trace AU_DEFUN:'_au_defun(\@<:\@\$1\@:>\@,
+xsystem ("$autoconf --trace AU_DEFINE:'_au_defun(\@<:\@\$1\@:>\@,
\@<:\@\$2\@:>\@)' --melt /dev/null "
. ">$tmp/au.m4");
@var{old-macro} is now obsolete.
If she then uses @command{autoupdate}, the call to @var{old-macro} will be
-replaced by the modern @var{implementation}. In the future,
-@command{autoupdate} will then print the additional @var{message}.
+replaced by the modern @var{implementation}. @command{autoupdate} will
+then print the additional @var{message}.
@end defmac
@node Coding Style
## ---------------------------------- ##
+# AU_DEFINE(NAME, CODE)
+# ---------------------
+# Define the macro NAME so that it expand to CODE only when
+# autoupdate is running. This is achieved with traces in
+# autoupdate itself, so this macro expands to nothing.
+#
+m4_define([AU_DEFINE], [])
+
# AU_DEFUN(NAME, NEW-CODE, [MESSAGE])
# -----------------------------------
# Declare that the macro NAME is now obsoleted, and should be replaced
# by NEW-CODE. Tell the user she should run autoupdate, and include
# the additional MESSAGE.
#
-# FIXME: MESSAGE should be grabbed with autom4te traces, and that's
-# why it is never used in the body of the macro; however, as of 2003-11-25
-# it is never used and it seems that it never was. Also, MESSAGE is
-# used only once in AC_LINK_FILES, it may be the case to remove it from
-# there. See the FIXME in AC_LINK_FILES as well.
-#
# Also define NAME as a macro which code is NEW-CODE.
#
# This allows sharing the same code for both supporting obsoleted macros,
# and to update a configure.ac.
# See `acobsolete.m4' for a longer description.
m4_define([AU_DEFUN],
-[AC_DEFUN([$1],
+[AU_DEFINE([$1],
+[m4_ifval([$3], [_au_warn_$1[]AC_DIAGNOSE([obsolete], [$3])d[]nl
+])dnl
+$2])
+AU_DEFINE([_au_warn_$1],
+[m4_warning([$3])dnl
+m4_define([_au_warn_$1], [])])
+AC_DEFUN([$1],
[AC_DIAGNOSE([obsolete], [The macro `$1' is obsolete.
You should run autoupdate.])dnl
$2])])
# ----------
# Define `USG' if string functions are in strings.h.
AU_DEFUN([AC_USG],
-[AC_DIAGNOSE([obsolete],
-[$0: Remove `AC_MSG_CHECKING', `AC_LINK_IFELSE' and this `AC_DIAGNOSE'
-when you adjust your code to use HAVE_STRING_H.])dnl
-AC_MSG_CHECKING([for BSD string and memory functions])
+[AC_MSG_CHECKING([for BSD string and memory functions])
AC_LINK_IFELSE([AC_LANG_PROGRAM([[@%:@include <strings.h>]],
[[rindex(0, 0); bzero(0, 0);]])],
[AC_MSG_RESULT(yes)],
[Define to 1 if you do not have <strings.h>, index,
bzero, etc... This symbol is obsolete, you should
not depend upon it.])])
-AC_CHECK_HEADERS(string.h)
-])# AU::AC_USG
+AC_CHECK_HEADERS(string.h)],
+[Remove `AC_MSG_CHECKING', `AC_LINK_IFELSE' and this warning
+when you adjust your code to use HAVE_STRING_H.])
# AU::AC_MEMORY_H
# But it is better to check for both headers, and alias NEED_MEMORY_H to
# HAVE_MEMORY_H.
AU_DEFUN([AC_MEMORY_H],
-[AC_DIAGNOSE([obsolete], [$0: Remove this `AC_DIAGNOSE' and
-`AC_CHECK_HEADER(memory.h, AC_DEFINE(...))' when you adjust your code to
-use and HAVE_STRING_H and HAVE_MEMORY_H, not NEED_MEMORY_H.])dnl
-AC_CHECK_HEADER(memory.h,
+[AC_CHECK_HEADER(memory.h,
[AC_DEFINE([NEED_MEMORY_H], 1,
[Same as `HAVE_MEMORY_H', don't depend on me.])])
-AC_CHECK_HEADERS(string.h memory.h)
-])
+AC_CHECK_HEADERS(string.h memory.h)],
+[Remove this warning and
+`AC_CHECK_HEADER(memory.h, AC_DEFINE(...))' when you adjust your code to
+use HAVE_STRING_H and HAVE_MEMORY_H, not NEED_MEMORY_H.])
# AU::AC_DIR_HEADER
AU_DEFUN([AC_DIR_HEADER],
[AC_HEADER_DIRENT
AC_FUNC_CLOSEDIR_VOID
-AC_DIAGNOSE([obsolete],
-[$0: Remove this `AC_DIAGNOSE' and the four `AC_DEFINE' when you
-adjust your code to use `AC_HEADER_DIRENT'.])
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 &&
test ac_cv_header_dirent_sys_dir_h &&
AC_DEFINE([SYSDIR], 1, [Same as `HAVE_SYS_DIR_H', don't depend on me.])
test ac_cv_header_dirent_ndir_h &&
- AC_DEFINE([NDIR], 1, [Same as `HAVE_NDIR_H', don't depend on me.])
-])
+ AC_DEFINE([NDIR], 1, [Same as `HAVE_NDIR_H', don't depend on me.])],
+[Remove this warning and the four `AC_DEFINE' when you
+adjust your code to use `AC_HEADER_DIRENT'.])
# This file is part of Autoconf. -*- Autoconf -*-
# Programming languages support.
-# Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc.
+# Copyright (C) 2000, 2001, 2002, 2004 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
# ------------
# Save the current language, but don't change language.
AU_DEFUN([AC_LANG_SAVE],
-[AC_DIAGNOSE([obsolete],
- [instead of using `AC_LANG', `AC_LANG_SAVE',
-and `AC_LANG_RESTORE', you should use `AC_LANG_PUSH' and `AC_LANG_POP'.])
-m4_pushdef([_AC_LANG], _AC_LANG)])
+[m4_pushdef([_AC_LANG], _AC_LANG)],
+[Instead of using `AC_LANG', `AC_LANG_SAVE', and `AC_LANG_RESTORE',
+you should use `AC_LANG_PUSH' and `AC_LANG_POP'.])
# AC_LANG_RESTORE
# AC_RSH
# ------
# I don't know what it used to do, but it no longer does.
-AU_DEFUN([AC_RSH],
-[AC_DIAGNOSE([obsolete], [$0: is no longer supported.
-Remove this warning when you adjust the code.])])
+AU_DEFUN([AC_RSH], [],
+[$0 is no longer supported. Remove this warning when you
+adjust the code.])
# AC_PROG_SED
AU_DEFUN([AC_HAVE_POUNDBANG],
-[AC_SYS_INTERPRETER
-AC_DIAGNOSE([obsolete],
-[$0: Remove this warning when you adjust your code to use
- `AC_SYS_INTERPRETER'.])])
+[AC_SYS_INTERPRETER],
+[Remove this warning when you adjust your code to use
+`AC_SYS_INTERPRETER'.])
-AU_DEFUN([AC_ARG_ARRAY],
-[AC_DIAGNOSE([obsolete],
-[$0: no longer implemented: don't do unportable things
-with arguments. Remove this warning when you adjust your code.])])
+AU_DEFUN([AC_ARG_ARRAY], [],
+[$0 is no longer implemented: don't do unportable things
+with arguments. Remove this warning when you adjust your code.])
# _AC_SYS_LARGEFILE_TEST_INCLUDES
# EXEEXT.
AU_DEFUN([AC_CYGWIN],
[AC_CANONICAL_HOST
-AC_DIAGNOSE([obsolete],
- [$0 is obsolete: use AC_CANONICAL_HOST and check if $host_os matches *cygwin*])dnl
case $host_os in
*cygwin* ) CYGWIN=yes;;
* ) CYGWIN=no;;
esac
-])# AC_CYGWIN
+], [$0 is obsolete: use AC_CANONICAL_HOST and check if $host_os
+matches *cygwin*])# AC_CYGWIN
# AC_EMXOS2
# for EXEEXT.
AU_DEFUN([AC_EMXOS2],
[AC_CANONICAL_HOST
-AC_DIAGNOSE([obsolete],
- [$0 is obsolete: use AC_CANONICAL_HOST and check if $host_os matches *emx*])dnl
case $host_os in
*emx* ) EMXOS2=yes;;
* ) EMXOS2=no;;
esac
-])# AC_EMXOS2
+], [$0 is obsolete: use AC_CANONICAL_HOST and check if $host_os
+matches *emx*])# AC_EMXOS2
# AC_MINGW32
# EXEEXT.
AU_DEFUN([AC_MINGW32],
[AC_CANONICAL_HOST
-AC_DIAGNOSE([obsolete],
- [$0 is obsolete: use AC_CANONICAL_HOST and check if $host_os matches *mingw32*])dnl
case $host_os in
*mingw32* ) MINGW32=yes;;
* ) MINGW32=no;;
esac
-])# AC_MINGW32
+], [$0 is obsolete: use AC_CANONICAL_HOST and check if $host_os
+matches *mingw32*])# AC_MINGW32
# AC_XENIX_DIR
# ------------
-AU_DEFUN(AC_XENIX_DIR,
-[# You shouldn't need to depend upon XENIX. Remove this test if useless.
-AC_MSG_CHECKING([for Xenix])
+AU_DEFUN([AC_XENIX_DIR],
+[AC_MSG_CHECKING([for Xenix])
AC_EGREP_CPP(yes,
[#if defined(M_XENIX) && !defined(M_UNIX)
yes
[AC_MSG_RESULT([no]); XENIX=])
AC_HEADER_DIRENT[]dnl
-])
+],
+[You shouldn't need to depend upon XENIX. Remove the
+`AC_MSG_CHECKING', `AC_EGREP_CPP', and this warning if this part
+of the test is useless.])
# AC_DYNIX_SEQ
done
AC_CONFIG_LINKS($[ac_config_links_]_AC_LINK_FILES_CNT)dnl
],
-dnl FIXME: Macros such as AC_USG put messages like this into an
-dnl AC_DIAGNOSE macro, in the first parameter of AU_DEFUN. We cannot
-dnl do the same with this one, because it makes no sense to print it
-dnl when running `autoconf -W obsolete' on a configure script that uses
-dnl AC_LINK_FILES. Instead, only `autoupdate' should print it (it may
-dnl be acceptable that autoupdated configure scripts print this message
-dnl when running `autoconf -W obsolete'). As of 2003-11-25, the third
-dnl argument to AU_DEFUN is broken, so this is never seen by the user.
-[
- It is technically impossible to `autoupdate' cleanly from AC_LINK_FILES
- to AC_CONFIG_FILES. `autoupdate' provides a functional but inelegant
- update, you should probably tune the result yourself.])# AC_LINK_FILES
+[It is technically impossible to `autoupdate' cleanly from AC_LINK_FILES
+to AC_CONFIG_FILES. `autoupdate' provides a functional but inelegant
+update, you should probably tune the result yourself.])# AC_LINK_FILES
# Initialize.
# This file is part of Autoconf. -*- Autoconf -*-
# Type related macros: existence, sizeof, and structure members.
-# Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc.
+# Copyright (C) 2000, 2001, 2002, 2004 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
# What a great name :)
AU_DEFUN([AC_INT_16_BITS],
[AC_CHECK_SIZEOF([int])
-AC_DIAGNOSE([obsolete], [$0:
- your code should no longer depend upon `INT_16_BITS', but upon
- `SIZEOF_INT == 2'. Remove this warning and the `AC_DEFINE' when you
- adjust the code.])dnl
test $ac_cv_sizeof_int = 2 &&
AC_DEFINE(INT_16_BITS, 1,
[Define to 1 if `sizeof (int)' = 2. Obsolete, use `SIZEOF_INT'.])
-])
+], [your code should no longer depend upon `INT_16_BITS', but upon
+`SIZEOF_INT == 2'. Remove this warning and the `AC_DEFINE' when you
+adjust the code.])
# AU::AC_LONG_64_BITS
# -------------------
AU_DEFUN([AC_LONG_64_BITS],
[AC_CHECK_SIZEOF([long int])
-AC_DIAGNOSE([obsolete], [$0:
- your code should no longer depend upon `LONG_64_BITS', but upon
- `SIZEOF_LONG_INT == 8'. Remove this warning and the `AC_DEFINE' when
- you adjust the code.])dnl
test $ac_cv_sizeof_long_int = 8 &&
AC_DEFINE(LONG_64_BITS, 1,
[Define to 1 if `sizeof (long int)' = 8. Obsolete, use
`SIZEOF_LONG_INT'.])
-])
+], [your code should no longer depend upon `LONG_64_BITS', but upon
+`SIZEOF_LONG_INT == 8'. Remove this warning and the `AC_DEFINE' when
+you adjust the code.])
# AC_STRUCT_ST_BLKSIZE
# --------------------
AU_DEFUN([AC_STRUCT_ST_BLKSIZE],
-[AC_DIAGNOSE([obsolete], [$0:
- your code should no longer depend upon `HAVE_ST_BLKSIZE', but
- `HAVE_STRUCT_STAT_ST_BLKSIZE'. Remove this warning and
- the `AC_DEFINE' when you adjust the code.])
-AC_CHECK_MEMBERS([struct stat.st_blksize],
+[AC_CHECK_MEMBERS([struct stat.st_blksize],
[AC_DEFINE(HAVE_ST_BLKSIZE, 1,
[Define to 1 if your `struct stat' has
`st_blksize'. Deprecated, use
`HAVE_STRUCT_STAT_ST_BLKSIZE' instead.])])
-])# AC_STRUCT_ST_BLKSIZE
+], [your code should no longer depend upon `HAVE_ST_BLKSIZE', but
+`HAVE_STRUCT_STAT_ST_BLKSIZE'. Remove this warning and
+the `AC_DEFINE' when you adjust the code.])# AC_STRUCT_ST_BLKSIZE
# AC_STRUCT_ST_BLOCKS
# AC_STRUCT_ST_RDEV
# -----------------
AU_DEFUN([AC_STRUCT_ST_RDEV],
-[AC_DIAGNOSE([obsolete], [$0:
- your code should no longer depend upon `HAVE_ST_RDEV', but
- `HAVE_STRUCT_STAT_ST_RDEV'. Remove this warning and
- the `AC_DEFINE' when you adjust the code.])
-AC_CHECK_MEMBERS([struct stat.st_rdev],
+[AC_CHECK_MEMBERS([struct stat.st_rdev],
[AC_DEFINE(HAVE_ST_RDEV, 1,
[Define to 1 if your `struct stat' has `st_rdev'.
Deprecated, use `HAVE_STRUCT_STAT_ST_RDEV'
instead.])])
-])# AC_STRUCT_ST_RDEV
+], [your code should no longer depend upon `HAVE_ST_RDEV', but
+`HAVE_STRUCT_STAT_ST_RDEV'. Remove this warning and
+the `AC_DEFINE' when you adjust the code.])# AC_STRUCT_ST_RDEV
# AC_STRUCT_TM
# M4 macros used in building Autoconf test suites. -*- Autotest -*-
-# Copyright (C) 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+# Copyright (C) 2000, 2001, 2002, 2003, 2004 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
AT_CHECK_ENV
rm config.hin
-AT_CHECK_AUTOUPDATE
+AT_CHECK_AUTOUPDATE([], 0, [], ignore)
+AT_CHECK([grep '^$1$' configure.ac], 1)
AT_CHECK_AUTOCONF
AT_CHECK_AUTOHEADER
AT_BANNER([Executables (autoheader, autoupdate...).])
-# Copyright (C) 2000, 2001, 2003 Free Software Foundation, Inc.
+# Copyright (C) 2000, 2001, 2003, 2004 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
)
# Checking `autoupdate'.
-AT_CHECK_AUTOUPDATE
+AT_CHECK_AUTOUPDATE([], 0, [], ignore)
AT_CHECK_AUTOCONF
AT_CHECK_CONFIGURE
AT_CHECK([cat src1], 0, [dst1