[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RFC: AC_REQUIRE_AUX_DIR trace hook
From: |
Alexandre Duret-Lutz |
Subject: |
RFC: AC_REQUIRE_AUX_DIR trace hook |
Date: |
Tue, 03 Aug 2004 00:26:20 +0200 |
User-agent: |
Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3.50 (gnu/linux) |
This patch adds a trace hook to list expected auxiliary scripts.
For instance AC_PROG_INSTALL requires install-sh, and AC_CANONICAL_*
require config.{sub,guess}.
Doing so will allow to simplify Automake by removing some
hard-coded knowledge. It'll also let third-party macro express
their requirements (the benefit is that Automake will
automatically distribute these files, users won't have to
EXTRA_DIST these files by hand).
I've mentioned AM_REQUIRE_AUX_DIR in
http://lists.gnu.org/archive/html/automake/2004-07/msg00128.html
but when I started implementing this in Automake I realized the
macro would be better in Autoconf since it would make it
possible to document Autoconf's own expectations.
OK to commit?
I have yet to finish the Automake couterpart to that patch,
before proceeding; that should be done tomorrow. Then I'd like
to submit a harmless one-liner to libtool to declare the
ltmain.in dependency before they make a release.
2004-08-02 Alexandre Duret-Lutz <address@hidden>
* lib/autoconf/general.m4 (AC_REQUIRE_AUX_FILE): New empty macro.
(AC_CANONICAL_BUILD): Call it to require config.sub and config.guess.
* lib/autoconf/programs.m4 (AC_PROG_INSTALL): Likewise for install-sh.
* doc/autoconf.texi (Input): Document AC_REQUIRE_AUX_FILE.
* lib/autom4te.in (Automake-preselections): Preselect
AC_REQUIRE_AUX_FILE. Automake 1.10 will trace it.
Index: NEWS
===================================================================
RCS file: /cvsroot/autoconf/autoconf/NEWS,v
retrieving revision 1.327
diff -u -r1.327 NEWS
--- NEWS 19 Mar 2004 08:57:51 -0000 1.327
+++ NEWS 2 Aug 2004 22:11:28 -0000
@@ -13,6 +13,9 @@
New macros that detect programs whose name is prefixed with the
target type, if the build type and target type are different.
+** AC_REQUIRE_AUX_FILE
+ New trace macro that declares expected auxiliary files.
+
* Major changes in Autoconf 2.59a
** AC_PROG_GREP
Index: doc/autoconf.texi
===================================================================
RCS file: /cvsroot/autoconf/autoconf/doc/autoconf.texi,v
retrieving revision 1.825
diff -u -r1.825 autoconf.texi
--- doc/autoconf.texi 30 Jul 2004 00:34:27 -0000 1.825
+++ doc/autoconf.texi 2 Aug 2004 22:11:40 -0000
@@ -1765,6 +1765,16 @@
to MS-DOS, because the filename @file{aux} is reserved under MS-DOS.
@end defmac
address@hidden AC_REQUIRE_AUX_FILE (@var{file})
address@hidden
+Declares that @var{file} is expected in the directory defined above. In
+Autoconf proper, this macro does nothing: its sole purpose is to be
+traced by third-party tools to produce a list of expected auxiliary
+files. For instance it is called by macros like @code{AC_PROG_INSTALL}
+(@pxref{Particular Programs}) or @code{AC_CANONICAL_BUILD}
+(@pxref{Canonicalizing}) to register the auxiliary files they need.
address@hidden defmac
+
Similarly, packages that use @command{aclocal} should declare where
local macros can be found using @code{AC_CONFIG_MACRO_DIR}.
Index: lib/autom4te.in
===================================================================
RCS file: /cvsroot/autoconf/autoconf/lib/autom4te.in,v
retrieving revision 1.25
diff -u -r1.25 autom4te.in
--- lib/autom4te.in 1 Aug 2004 22:30:37 -0000 1.25
+++ lib/autom4te.in 2 Aug 2004 22:11:40 -0000
@@ -48,6 +48,7 @@
args: --preselect AC_CONFIG_LINKS
args: --preselect AC_INIT
args: --preselect AC_LIBSOURCE
+args: --preselect AC_REQUIRE_AUX_FILE
args: --preselect AC_SUBST
args: --preselect AM_AUTOMAKE_VERSION
args: --preselect AM_CONDITIONAL
Index: lib/autoconf/general.m4
===================================================================
RCS file: /cvsroot/autoconf/autoconf/lib/autoconf/general.m4,v
retrieving revision 1.830
diff -u -r1.830 general.m4
--- lib/autoconf/general.m4 28 Jan 2004 22:21:16 -0000 1.830
+++ lib/autoconf/general.m4 2 Aug 2004 22:11:41 -0000
@@ -1563,6 +1563,19 @@
+## --------------------- ##
+## Requiring aux files. ##
+## --------------------- ##
+
+# AC_REQUIRE_AUX_FILE(FILE)
+# -------------------------
+# This macro does nothing, it's a hook to be read with `autoconf --trace'.
+# It announces FILE is required in the auxdir.
+m4_define([AC_REQUIRE_AUX_FILE],
+[AS_LITERAL_IF([$1], [],
+ [AC_FATAL([$0: requires a literal argument])])])
+
+
## ----------------------------------- ##
## Getting the canonical system type. ##
@@ -1596,6 +1609,8 @@
# ------------------
AC_DEFUN_ONCE([AC_CANONICAL_BUILD],
[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
+AC_REQUIRE_AUX_FILE([config.sub])dnl
+AC_REQUIRE_AUX_FILE([config.guess])dnl
m4_divert_text([HELP_CANON],
[[
System types:
Index: lib/autoconf/programs.m4
===================================================================
RCS file: /cvsroot/autoconf/autoconf/lib/autoconf/programs.m4,v
retrieving revision 1.30
diff -u -r1.30 programs.m4
--- lib/autoconf/programs.m4 10 May 2004 18:54:37 -0000 1.30
+++ lib/autoconf/programs.m4 2 Aug 2004 22:11:42 -0000
@@ -512,6 +512,7 @@
AN_PROGRAM([install], [AC_PROG_INSTALL])
AC_DEFUN([AC_PROG_INSTALL],
[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
+AC_REQUIRE_AUX_FILE([install-sh])dnl
# Find a good install program. We prefer a C program (faster),
# so one script is as good as another. But avoid the broken or
# incompatible versions:
--
Alexandre Duret-Lutz
- RFC: AC_REQUIRE_AUX_DIR trace hook,
Alexandre Duret-Lutz <=