autoconf: Changed Directory Variables

1 
1 4.8.3 Changed Directory Variables
1 ---------------------------------
1 
1 In Autoconf 2.60, the set of directory variables has changed, and the
11 defaults of some variables have been adjusted (⇒Installation
 Directory Variables) to changes in the GNU Coding Standards.
1 Notably, `datadir', `infodir', and `mandir' are now expressed in terms
1 of `datarootdir'.  If you are upgrading from an earlier Autoconf
1 version, you may need to adjust your files to ensure that the directory
1 variables are substituted correctly (⇒Defining Directories), and
1 that a definition of `datarootdir' is in place.  For example, in a
1 `Makefile.in', adding
1 
1      datarootdir = @datarootdir@
1 
1 is usually sufficient.  If you use Automake to create `Makefile.in', it
1 will add this for you.
1 
1    To help with the transition, Autoconf warns about files that seem to
1 use `datarootdir' without defining it.  In some cases, it then expands
1 the value of `$datarootdir' in substitutions of the directory
1 variables.  The following example shows such a warning:
1 
1      $ cat configure.ac
1      AC_INIT
1      AC_CONFIG_FILES([Makefile])
1      AC_OUTPUT
1      $ cat Makefile.in
1      prefix = @prefix@
1      datadir = @datadir@
1      $ autoconf
1      $ configure
1      configure: creating ./config.status
1      config.status: creating Makefile
1      config.status: WARNING:
1                     Makefile.in seems to ignore the --datarootdir setting
1      $ cat Makefile
1      prefix = /usr/local
1      datadir = ${prefix}/share
1 
1    Usually one can easily change the file to accommodate both older and
1 newer Autoconf releases:
1 
1      $ cat Makefile.in
1      prefix = @prefix@
1      datarootdir = @datarootdir@
1      datadir = @datadir@
1      $ configure
1      configure: creating ./config.status
1      config.status: creating Makefile
1      $ cat Makefile
1      prefix = /usr/local
1      datarootdir = ${prefix}/share
1      datadir = ${datarootdir}
1 
1    In some cases, however, the checks may not be able to detect that a
1 suitable initialization of `datarootdir' is in place, or they may fail
1 to detect that such an initialization is necessary in the output file.
1 If, after auditing your package, there are still spurious `configure'
1 warnings about `datarootdir', you may add the line
1 
1      AC_DEFUN([AC_DATAROOTDIR_CHECKED])
1 
1 to your `configure.ac' to disable the warnings.  This is an exception
1 to the usual rule that you should not define a macro whose name begins
1 with `AC_' (⇒Macro Names).
1