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
In the event that you have a whole series of such paths that must be known by your source code, and you want to avoid excessive noise in your compilations (eg -DPATH1=/path/to/something -DPATH2=/path2/to/something2 -DPATH3=/path3/to/something3...ad infinitum), an alternative that may be desirable to some people is to create a new "mynewheader.h.in", with the lines
#define PATH1 "@PATH1@"
#define PATH2 "@PATH2@"
#define PATH3 "@PATH3@"
and add it to your configure.ac's AC_CONFIG_FILES line, eg:
AC_CONFIG_FILES([Makefile mynewheader.h])