dougmencken / HeadOverHeels

The free and open source remake of the game “Head over Heels”
GNU General Public License v3.0
33 stars 10 forks source link

Replace the .in header file by direct setting of variables in CPPFLAGS #59

Closed kiwifb closed 1 year ago

kiwifb commented 1 year ago

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.