Re: m4 macro expansion problem

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

 



Sébastien Hinderer (2021/08/25 15:45 +0200):
> Dear Nick,
>
> Yes, your email was definitely helpful and clear! Many thanks for that!
>
> Now the macro works like a charm.
>
> The only thing that remains osbcure to me is what would be the best way
> to generate our "VERSION" file, the one I am trying to replace.
>
> ONe simple way would be to have a VERSION.in and let configure generate
> VERSION from there.
>
> My preference would be to have VERSION generated at the same time than
> the configure script, i.e. during the autoconf invocation.
>
> Is that possible?
>
> I started to investigate diversions, but it felt like this kkind of
> thing is not their real purpose. Is there another way? Perhaps macros
> are available that let one write some content to a file directly from
> aclocal.m4?

To be more specific, here is what I tried:

# Generate the VERSION file
m4_syscmd([cat > VERSION << END_OF_VERSION_FILE
PKG_VERSION

# Some comments about the format of version numbers
END_OF_VERSION_FILE
])

To some extent it works, i.e. VERSION is indeed generated, but the
PKG_VERSION macro is not replaced by its value.

I tried quoting just the PKG_VERSION macro but then the quotes apeared
in the output.

I also tried adding one level of quotes to the whole argument of syscmd
but that didn't help either -- autoconf tried to execute [cat rather
than just cat and that failed, obviously.

Any help warmly appreciated.

Sébastien.




[Index of Archives]     [GCC Help]     [Kernel Discussion]     [RPM Discussion]     [Red Hat Development]     [Yosemite News]     [Linux USB]     [Samba]

  Powered by Linux