[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Making variably-named .in files work with config.status
From: |
Reuben Thomas |
Subject: |
Re: Making variably-named .in files work with config.status |
Date: |
Mon, 24 Dec 2012 18:10:31 +0000 |
On 24 December 2012 15:16, Nick Bowler <address@hidden> wrote:
> On 2012-12-23 21:36 +0000, Reuben Thomas wrote:
> > In my configure.ac, I have:
> >
> > AC_SUBST(PACKAGE) # so that automake can generate dependencies for
> ${PACKAGE}*.rockspec
> > AC_CONFIG_FILES(${PACKAGE}.rockspec)
>
> While this is not related to your problem, note that your macro
> arguments are underquoted. Since the arguments are (presumably) not
> meant to be subject to macro expansion, they should have one level of
> quotation, as in:
>
> AC_SUBST([PACKAGE])
> AC_CONFIG_FILES([...])
>
Done, thanks.
> Furthermore, AC_SUBST([PACKAGE]) is not required (but should not be
> harmful) as Automake does this automatically.
>
Ditto. (I added this on purpose in the past because I thought I found it
was needed, but tests confirm what you and the manual say!)
While I don't know if you can successfully use shell variables in
> AC_CONFIG_FILES, there is another possibility in your case.
> Autoconf defines the macro:
>
> AC_PACKAGE_NAME
>
> which expands to the package name at M4 time. This should be usable in
> the argument to AC_CONFIG_FILES, with something like (untested):
>
> AC_CONFIG_FILES(m4_defn([AC_PACKAGE_NAME])[.rockspec])
>
> Note the (lack of) quoting around the call to m4_defn: this is because
> m4_defn produces an appropriately quoted string and we actually want
> that macro to be expanded before passing the result to AC_CONFIG_FILES.
> But the rest of the argument is quoted because that part should not be
> subject to macro expansion.
>
Thanks very much. I need AC_PACKAGE_TARNAME, in fact, but it works
beautifully!
--
http://rrt.sc3d.org