+2003-11-24 Paolo Bonzini <bonzini@gnu.org>
+
+ * TODO: Remove already done things. Update the part
+ about finding tools for the target.
+
+2003-11-24 Paolo Bonzini <bonzini@gnu.org>
+
+ * lib/autoconf/headers.m4 (AC_USG, AC_MEMORY_H,
+ AC_DIR_HEADER): Make wording more consistent.
+ * lib/autoconf/specific.m4 (AC_CYGWIN, AC_EMXOS2,
+ AC_MINGW32): Explain the transition better.
+ * lib/autoconf/types.m4 (AC_INT_16_BITS,
+ AC_LONG_64_BITS): Explain the transition better.
+
+2003-11-24 Paolo Bonzini <bonzini@gnu.org>
+
+ * doc/autoconf.texi (Obsoleting Macros): Don't
+ document the third parameter of AU_DEFUN.
+ * lib/autoconf/autoupdate.m4 (AU_DEFINE): Remove.
+ (AU_DEFUN): Remove the third parameter, it was not used.
+ Use AC_DEFUN directly, not AU_DEFINE.
+ * lib/autoconf/status.m4 (AC_LINK_FILES): Move the message
+ into the expanded body, consistently with other macros
+ such as AC_USG.
+
2003-11-17 Paul Eggert <eggert@twinsun.com>
* lib/autoconf/general.m4 (_AC_INIT_PREPARE): Put at least 14 bytes
------------------------------------------------------------------------------
-* Support creating both config.h and DEFS in the same configure.
-
-------------------------------------------------------------------------------
-
* Select the right CONFIG_SHELL automatically (for Ultrix, Lynx especially.)
------------------------------------------------------------------------------
------------------------------------------------------------------------------
-on hal.gnu.ai.mit.edu, configure is getting the wrong answer for
-AC_CHECK_FUNCS(select).
-
-The problem here is that there's severe name space pollution: when
-conftest.c includes <ctype.h> to pick up any __stub macro definitions,
-it's getting a prototype declaration for select(), which collides
-with the dummy declaration in conftest.c. (The chain of includes
-is conftest.c -> <ctype.h> -> <sys/localedef.h> -> <sys/lc_core.h>
--> <sys/types.h> -> <sys/select.h>.)
-
- #define $ac_func __dummy_$ac_func
- #include <ctype.h>
- #undef $ac_func
-From: kwzh@gnu.ai.mit.edu (Karl Heuer)
-
-The test for the isascii function was failing because that function is
-also a macro. He proposed that the test file look like this:
-
-/* Remove any macro definition. */
-#undef isascii
-/* Override any gcc2 internal prototype to avoid an error. */
-char isascii(); isascii();
-
-Andreas Schwab
-
-------------------------------------------------------------------------------
-
It would be nice if I could (in the Makefile.in files) set
the path to config.h. You have config.h ../config.h ../../config.h's all
over the place, in the findutils-4.1 directory.
From: "Randall S. Winchester" <rsw@eng.umd.edu>
-------------------------------------------------------------------------------
-
-In a future version (after 2.2), make AC_PROG_{CC,RANLIB,anything else}
-use AC_CHECK_TOOL.
-From Roland McGrath.
-
------------------------------------------------------------------------------
ls -lt configure configure.in | sort
Here is one simple test
if test "x$host" != "x$target"; then
-AC_PROGRAMS_CHECK(AR_FOR_TARGET, $target-ar, $target-ar, ar)
-AC_PROGRAMS_CHECK(RANLIB_FOR_TARGET, $target-ranlib, $target-ranlib, ranlib)
-AC_PROGRAMS_CHECK(GCC_FOR_TARGET, $target-gcc, $target-gcc, gcc)
+AC_CHECK_PROGS(AR_FOR_TARGET,
+ [$target-ar, $prefix/$target/bin/ar], $target-ar)
+AC_CHECK_PROGS(RANLIB_FOR_TARGET, $target-ranlib, $target-ranlib)
+ [$target-ranlib, $prefix/$target/bin/ranlib], $target-ranlib)
+AC_CHECK_PROGS(GCC_FOR_TARGET, $target-gcc, $target-gcc)
+ [$target-gcc, $prefix/$target/bin/gcc], $target-gcc)
fi
-This could be improved to also look for gcc in PATH, but require the
-prefix to contain the target e.g.:
-
-target=m68k-coff -->GCC_FOR_TARGET = /usr/gnu/m68k-coff/bin/gcc
-
From: nennker@cs.tu-berlin.DE (Axel Nennker)
+(also look in the autoconf mailing list archives for the proposed
+CHECK_TARGET_TOOL macro from Natanael Nerode, a gcc configury guru).
+
------------------------------------------------------------------------------
The problem occurs with the following libc functions in SunOS 5.4:
Autoconf provides a simple means to obsolete a macro.
-@defmac AU_DEFUN (@var{old-macro}, @var{implementation}, @ovar{message})
+@defmac AU_DEFUN (@var{old-macro}, @var{implementation})
@acindex{DEFUN}
@acindex{AU_DEFUN}
Define @var{old-macro} as @var{implementation}. The only difference
with @code{AC_DEFUN} is that the user will be warned that
-@var{old-macro} is now obsolete.
+@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}.
-If she then uses @command{autoupdate}, the call to @var{old-macro} will be
-replaced by the modern @var{implementation}. The additional
-@var{message} is then printed.
+Note that you can provide another definition with @code{AC_DEFUN} in
+order to update the way a macro is used without making it completely
+obsolete.
@end defmac
@node Coding Style
# Roland McGrath, Noah Friedman, david d zuhn, and many others.
-## --------------------------------- ##
-## Defining macros in autoupdate::. ##
-## --------------------------------- ##
+## ----------------------------------- ##
+## Defining macros to be autoupdated. ##
+## ----------------------------------- ##
-# AU_DEFINE(NAME, GLUE-CODE, [MESSAGE])
-# -------------------------------------
-#
-# Declare `autoupdate::NAME' to be `GLUE-CODE', with all the needed
-# wrapping actions required by `autoupdate'.
-# We do not define anything in `autoconf::'.
-m4_define([AU_DEFINE],
-[AC_DEFUN([$1], [$2])])
-
-
-# AU_DEFUN(NAME, NEW-CODE, [MESSAGE])
+# AU_DEFUN(NAME, NEW-CODE)
# -----------------------------------
# Declare that the macro NAME is now obsoleted, and should be replaced
# by NEW-CODE. Tell the user she should run autoupdate, and include
# and to update a configure.ac.
# See `acobsolete.m4' for a longer description.
m4_define([AU_DEFUN],
-[AU_DEFINE([$1],
+[AC_DEFUN([$1],
[AC_DIAGNOSE([obsolete], [The macro `$1' is obsolete.
You should run autoupdate.])dnl
-$2],
- [$3])dnl
-])
+$2])])
# AU_ALIAS(OLD-NAME, NEW-NAME)
# 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_WARNING'
+[$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_LINK_IFELSE([AC_LANG_PROGRAM([[@%:@include <strings.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 warning and
+[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_HEADER_DIRENT
AC_FUNC_CLOSEDIR_VOID
AC_DIAGNOSE([obsolete],
-[$0: Remove this warning and the four `AC_DEFINE' when you
+[$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.])
AU_DEFUN([AC_CYGWIN],
[AC_CANONICAL_HOST
AC_DIAGNOSE([obsolete],
- [$0 is obsolete: use AC_CANONICAL_HOST and $host_os])dnl
+ [$0 is obsolete: use AC_CANONICAL_HOST and check if $host_os matches *cygwin*])dnl
case $host_os in
*cygwin* ) CYGWIN=yes;;
* ) CYGWIN=no;;
AU_DEFUN([AC_EMXOS2],
[AC_CANONICAL_HOST
AC_DIAGNOSE([obsolete],
- [$0 is obsolete: use AC_CANONICAL_HOST and $host_os])dnl
+ [$0 is obsolete: use AC_CANONICAL_HOST and check if $host_os matches *emx*])dnl
case $host_os in
*emx* ) EMXOS2=yes;;
* ) EMXOS2=no;;
AU_DEFUN([AC_MINGW32],
[AC_CANONICAL_HOST
AC_DIAGNOSE([obsolete],
- [$0 is obsolete: use AC_CANONICAL_HOST and $host_os])dnl
+ [$0 is obsolete: use AC_CANONICAL_HOST and check if $host_os matches *mingw32*])dnl
case $host_os in
*mingw32* ) MINGW32=yes;;
* ) MINGW32=no;;
#
# _AC_LINK_CNT is used to be robust to multiple calls.
AU_DEFUN([AC_LINK_FILES],
-[m4_if($#, 2, ,
+[AC_DIAGNOSE([obsolete], [
+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 and remove this
+warning.])
+m4_if($#, 2, ,
[m4_fatal([$0: incorrect number of arguments])])dnl
m4_define([_AC_LINK_FILES_CNT], m4_incr(_AC_LINK_FILES_CNT))dnl
ac_sources="$1"
[ac_config_links_]_AC_LINK_FILES_CNT="$[ac_config_links_]_AC_LINK_FILES_CNT $ac_dest:$ac_source"
done
AC_CONFIG_LINKS($[ac_config_links_]_AC_LINK_FILES_CNT)dnl
-],
-[
- 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.
[AC_CHECK_SIZEOF([int])
AC_DIAGNOSE([obsolete], [$0:
your code should no longer depend upon `INT_16_BITS', but upon
- `SIZEOF_INT'. Remove this warning and the `AC_DEFINE' when you
+ `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,
[AC_CHECK_SIZEOF([long int])
AC_DIAGNOSE([obsolete], [$0:
your code should no longer depend upon `LONG_64_BITS', but upon
- `SIZEOF_LONG_INT'. Remove this warning and the `AC_DEFINE' when
+ `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,