The logic here is to use macro definitions in CPP flags at build time rather than setting them in a .h.in file. The reason for this is mainly that prefix, bindir, datadir and other variables are defined in ways where you expect them to be used by scripts rather than directly in source files.
In my first attempt to use bindir rather than prefix in a .h.in file the value was set to
Path=${prefix}/bin
Which was unsuitable and why I switched to using prefix and introducing the bin manually. No such issues when setting it from Makefile.am all the substitution will be done at calling time.
Of course, config.h.in` files do exists but they usually limit themselves to turning on or off some features, they are not usually meant to transmit a configuration directory wholesale.
The logic here is to use macro definitions in CPP flags at build time rather than setting them in a
.h.in
file. The reason for this is mainly thatprefix
,bindir
,datadir
and other variables are defined in ways where you expect them to be used by scripts rather than directly in source files. In my first attempt to usebindir
rather thanprefix
in a.h.in
file the value was set toWhich was unsuitable and why I switched to using
prefix
and introducing thebin
manually. No such issues when setting it fromMakefile.am
all the substitution will be done at calling time.Of course, config.h.in` files do exists but they usually limit themselves to turning on or off some features, they are not usually meant to transmit a configuration directory wholesale.