My program needs to load some files at run time, which will be installed into whatever folder is given to ./configure --datadir=/somewhere
As my program nee
Your solution is the correct one. The reason why Autoconf/Automake don't (easily) support putting the installation paths into config.h
is that you are in theory supposed to be able to override the paths at build time, like make prefix=/else/where
. This possibility is nowadays somewhat arcane, but that's the reason. (Note that this is distinct from make install prefix=/else/where/
, which is still useful, in spite of DESTDIR
.)