Hello Michel,
Michel Briand wrote:
Hi all,
I implemented a new idea for program's version.
In src/bin/Makefile.am:
internal_version.c: ${top_srcdir}/PROGRAM_VERSION
${top_srcdir}/vtempl.pl $(component) $(VERSION) < $(templ) > $@
training_SOURCES = training.c internal_version.c
The vtempl.pl Perl program takes a template as input and filter it to
produce the internal_version.c source file.
Each time the PROGRAM_VERSION file will be changed, the new source file
will be regenerated, then the build system will recompile it, and
relink the program.
The source file will be regenerated only if PROGRAM_VERSION is changed,
though. I would add the template file, the perl script `vtempl.pl', and
`Maskefile' in the list of dependencies.
I don't know what your perl script looks like or what it achieves, but I
could imagine you could achieve something similar with a simple sed
call. See chapter 4.8.2 in autoconf manual for an example
http://www.gnu.org/software/autoconf/manual/autoconf.html#Installation-Directory-Variables
Thereby you could avoid the requirement that users need perl to build
your package.
Also, what is the reason you don't want to use config.h?
Cheers,
Peter
Comments are welcome.
Best regards,
Michel