bug-autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problem with AC_CONFIG_FILES targets that contain variables


From: Ralf Wildenhues
Subject: Re: Problem with AC_CONFIG_FILES targets that contain variables
Date: Fri, 22 Aug 2008 09:16:03 +0200
User-agent: Mutt/1.5.18 (2008-05-17)

Hi Sander,

thanks for the report.  Your reports always make for some good thinking.

* Sander Niemeijer wrote on Thu, Aug 21, 2008 at 05:24:08PM CEST:
> AC_INIT(foo, 1.0)
> AC_CONFIG_FILES([foo-$PACKAGE_VERSION:foo.in])
> AC_OUTPUT

> When running configure it correctly creates the file 'foo-1.0'.
>
> However when I then try to run config.status for the file I get:
> ----
> $ config.status foo-1.0
> config.status: error: invalid argument: foo-1.0

Yes, in this case you have to pass the variable to config.status,
as hinted in the manual, but probably not clear enough:
<http://www.gnu.org/software/autoconf/manual/html_node/Configuration-Actions.html>

So this should work:
  AC_CONFIG_FILES([foo-$PACKAGE_VERSION:foo.in], [],
                  [PACKAGE_VERSION='$PACKAGE_VERSION'])

Note that the weird quoting works because the third argument is expanded
inside a here document.  FWIW, I'd recommend using a different variable
than PACKAGE_VERSION to avoid potential clashes.

I don't think we will fix this (because I think fixing it /right/ is
probably hard), but if you have suggestions (or a patch) on how to
improve the manual here so that it is clearer, that would be nice.

Cheers,
Ralf




reply via email to

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