autoconf-patches
[Top][All Lists]
Advanced

[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: Wed, 10 Aug 2005 15:42:18 +0200
User-agent: Mutt/1.4.1i

Hi Stepan,

[ skipping libtool-patches as long as it is not concerned ]

* Stepan Kasal wrote on Wed, Aug 10, 2005 at 10:39:54AM CEST:
> Hello Ralf,
>   no, I don't think using ac_config_headers is a good idea.

I knew it.  ;)

> So I still would like to see this:
> > > [...] the first AC_CONFIG_HEADERS could define a macro, say
> > > AH_HEADER which would hold the name.
> > >
> > > You could then do:
> > > m4_ifndef([AH_HEADER], [AC_CONFIG_HEADERS([config.h])])
> > > AC_SUBST([CONFIG_H], ["AH_HEADER"])
> 
> and I don't think ac_config_headers should be published.

Rough draft, with a patch which does not fully work: using
  AC_CONFIG_HEADERS(config.h)
  AC_CONFIG_HEADERS(conf2.h)
AH_HEADER ends up containing both names.  Seems to work if no config
header has been declared.  Plus I'm sure I chose the wrong way to define
it..

What do you think?

Cheers,
Ralf

        * lib/autoconf/status.m4 (_AH_HEADER_DEFINE): 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   10 Aug 2005 13:32:59 -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      10 Aug 2005 13:32:59 -0000
@@ -234,6 +234,7 @@
 m4_define([_AC_SEEN_CONFIG($1)])dnl
 _AC_CONFIG_COMMANDS_INIT([$4])dnl
 ac_config_[]m4_tolower([$1])="$ac_config_[]m4_tolower([$1]) m4_normalize([$2])"
+m4_if([$1], [HEADERS], [_AH_HEADER_DEFINE([$2])])
 ])
 
 
@@ -674,6 +675,13 @@
 ])# _AC_OUTPUT_HEADER
 
 
+# _AH_HEADER_DEFINE(TAGS)
+# -----------------------
+m4_define([_AH_HEADER_DEFINE],
+[m4_ifndef([AH_HEADER],
+[m4_define([AH_HEADER],[m4_bpatsubst(m4_normalize([$1]), [[ :]*])])])])
+
+
 
 ## --------------------- ##
 ## Configuration links.  ##




reply via email to

[Prev in Thread] Current Thread [Next in Thread]