Item 7: Emulating Autoconf Text Replacement Techniques
Say your project builds a daemon that is configured at startup with values in a configuration text file. How does the daemon know where to find this file on start up? One way is to simply assume it's located in /etc, but a well-written program will allow the user to configure this location when building the software. The system configuration directory has a variable location whose value can be specified on the
make all, or
make install command lines, as shown in the following examples:
./configure sysconfdir=/etc... $
make all sysconfdir=/usr/mypkg/etc... $
sudo make install sysconfdir=/usr/local/mypkg/etc...
All of these examples take advantage of command-line functionality ...