automake: config.site

1 
1 2.2.5 Overriding Default Configuration Setting with ‘config.site’
1 -----------------------------------------------------------------
1 
1 When installing several packages using the same setup, it can be
1 convenient to create a file to capture common settings.  If a file named
1 ‘PREFIX/share/config.site’ exists, ‘configure’ will source it at the
1 beginning of its execution.
1 
1    Recall the command from the previous section:
1 
1      ~/amhello-1.0 % ./configure --prefix ~/usr CC=gcc-3 \
1      CPPFLAGS=-I$HOME/usr/include LDFLAGS=-L$HOME/usr/lib
1 
1    Assuming we are installing many package in ‘~/usr’, and will always
1 want to use these definitions of ‘CC’, ‘CPPFLAGS’, and ‘LDFLAGS’, we can
1 automate this by creating the following ‘~/usr/share/config.site’ file:
1 
1      test -z "$CC" && CC=gcc-3
1      test -z "$CPPFLAGS" && CPPFLAGS=-I$HOME/usr/include
1      test -z "$LDFLAGS" && LDFLAGS=-L$HOME/usr/lib
1 
1    Now, any time a ‘configure’ script is using the ‘~/usr’ prefix, it
1 will execute the above ‘config.site’ and define these three variables.
1 
1      ~/amhello-1.0 % ./configure --prefix ~/usr
1      configure: loading site script /home/adl/usr/share/config.site
1      ...
1 
1    ⇒Setting Site Defaults (autoconf)Site Defaults, for more
1 information about this feature.
1