[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: reorganized config.status
From: |
Ralf Wildenhues |
Subject: |
Re: reorganized config.status |
Date: |
Sat, 13 Aug 2005 00:00:13 +0200 |
User-agent: |
Mutt/1.5.9i |
Hi Stepan,
* Stepan Kasal wrote on Wed, Aug 10, 2005 at 05:05:51PM CEST:
> On Wed, Aug 10, 2005 at 03:42:18PM +0200, Ralf Wildenhues wrote:
> > > no, I don't think using ac_config_headers is a good idea.
> >
> > I knew it. ;)
>
> So I passed the test. :-)
Other way round. I tried to make you do the work for me and did not
succeed at first. :)
(Also, I failed to see the first time that you only wanted me to do the
documentation and not the actual implementation..)
> > Rough draft, with a patch which does not fully work:
*snip*
> Weird, I'd say that your patch is correct.
>
> Anyway, I'd hook it differently, see the attached patch.
I knew you would do that. :)
Yours is much nicer, BTW.
> The documentation seems ok, but perhaps it is worth mentioning that
> AH_HEADER should be best used within code registered by
> AC_CONFIG_COMMANDS_PRE.
Hmm. But this:
| AC_CONFIG_COMMANDS_PRE([dnl
| m4_ifndef([AH_HEADER], [AC_CONFIG_HEADERS([config.h])])
| AC_SUBST([CONFIG_H], ["AH_HEADER"])
| ])
would not be correct, right?
Quoting 'info Autoconf Configuration\ Headers:
| The `AC_CONFIG_HEADERS' macro selects this kind of output. It should
| be called right after `AC_INIT'.
AC_CONFIG_HEADERS would be called way too late.
(Please remember that some people try to write their configure.ac in a
way to be compatible with more than just the CVS version of Autoconf.)
But maybe I'm just overcautious here, and you have addressed all these
issues already.
> (Do I guess correctly that this is the case with libtool?)
Nope, ATM it isn't. It's just called from within AC_LIB_LTDL aka
LTDL_INIT. Guess we should change that, too.
> My biggest doubt is whether the name "AH_HEADER", which I coined without
> any thinking, is teh right one. But no one has said anything, yet...
>
> Would you be so kind to combine the things together and test whether it
> works for you?
Works for me. Below is the patch against Autoconf,
attached the one against Libtool (HEAD, branch-2-0).
Cheers,
Ralf
* lib/autoconf/status.m4 (_AC_CONFIG_REGISTER_DEST): New macro
to define AH_HEADER.
(_AC_CONFIG_FOOS): Use it.
* doc/autoconf.texi (Configuration Headers): Document it.
Index: doc/autoconf.texi
===================================================================
RCS file: /cvsroot/autoconf/autoconf/doc/autoconf.texi,v
retrieving revision 1.925
diff -u -r1.925 autoconf.texi
--- doc/autoconf.texi 6 Jul 2005 21:39:31 -0000 1.925
+++ doc/autoconf.texi 12 Aug 2005 21:33:11 -0000
@@ -2697,6 +2697,18 @@
to prepend and/or append boilerplate to the file.
@end defmac
address@hidden AH_HEADER
+This macro is defined as the name of the first declared config header
+and undefined if no config headers have been declared up to this point.
+A third-party macro may, for example, require use of a config header
+without invoking AC_CONFIG_HEADERS twice like this:
+
address@hidden
+m4_ifndef([AH_HEADER], [AC_CONFIG_HEADERS([config.h])])
address@hidden example
+
address@hidden defmac
+
@xref{Configuration Actions}, for more details on @var{header}.
@menu
Index: lib/autoconf/status.m4
===================================================================
RCS file: /cvsroot/autoconf/autoconf/lib/autoconf/status.m4,v
retrieving revision 1.72
diff -u -r1.72 status.m4
--- lib/autoconf/status.m4 26 Jul 2005 10:14:25 -0000 1.72
+++ lib/autoconf/status.m4 12 Aug 2005 21:33:11 -0000
@@ -258,9 +258,14 @@
# With CONFIG_LINKS, reject DEST=., because it is makes it hard for
./config.status
# to guess the links to establish (`./config.status .').
#
+# Save the name of the first config header to AH_HEADER.
+#
m4_define([_AC_CONFIG_REGISTER_DEST],
[_AC_CONFIG_UNIQUE([$1], [$3])dnl
-m4_if([$1 $3], [LINKS .], [AC_FATAL([invalid destination of a config link:
`.'])])dnl
+m4_if([$1 $3], [LINKS .],
+ [AC_FATAL([invalid destination of a config link: `.'])])dnl
+m4_if([$1], [HEADERS],
+ [m4_define_default([AH_HEADER], [$3])])dnl
dnl
dnl Recognize TAG as an argument to config.status:
dnl
ah-header-lt-HEAD
Description: Text document