* Preset Output Variables:: Output variables that are always set
* Installation Directory Variables:: Other preset output variables
+* Changed Directory Variables:: Warnings about @file{datarootdir}
* Build Directories:: Supporting multiple concurrent compiles
* Automatic Remaking:: Makefile rules for configuring
@menu
* Preset Output Variables:: Output variables that are always set
* Installation Directory Variables:: Other preset output variables
+* Changed Directory Variables:: Warnings about @file{datarootdir}
* Build Directories:: Supporting multiple concurrent compiles
* Automatic Remaking:: Makefile rules for configuring
@end menu
@xref{Erlang Libraries}, for details.
+@node Changed Directory Variables
+@subsection Changed Directory Variables
+@cindex @file{datarootdir}
+
+In Autoconf 2.60, the set of directory variables has changed, and the
+defaults of some variables have been adjusted
+(@pxref{Installation Directory Variables}) to changes in the
+@acronym{GNU} Coding Standards. Notably, @file{datadir}, @file{infodir}, and
+@file{mandir} are now expressed in terms of @file{datarootdir}. If you are
+upgrading from an earlier Autoconf version, you may need to adjust your files
+to ensure that the directory variables are substituted correctly
+(@pxref{Defining Directories}), and that a definition of @file{datarootdir} is
+in place. For example, in a @file{Makefile.in}, adding
+
+@example
+datarootdir = @@datarootdir@@
+@end example
+
+@noindent
+is usually sufficient. If you use Automake to create @file{Makefile.in},
+it will add this for you.
+
+To help with the transition, Autoconf warns about files that seem to use
+@code{datarootdir} without defining it. In some cases, it then expands
+the value of @code{$datarootdir} in substitutions of the directory
+variables. The following example shows such a warning:
+
+@example
+$ @kbd{cat configure.ac}
+AC_INIT
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT
+$ @kbd{cat Makefile.in}
+prefix = @@prefix@@
+datadir = @@datadir@@
+$ @kbd{autoconf}
+$ @kbd{configure}
+configure: creating ./config.status
+config.status: creating Makefile
+config.status: WARNING:
+ Makefile.in seems to ignore the --datarootdir setting
+$ @kbd{cat Makefile}
+prefix = /usr/local
+datadir = $@{prefix@}/share
+@end example
+
+Usually one can easily change the file to accommodate both older and newer
+Autoconf releases:
+
+@example
+$ @kbd{cat Makefile.in}
+prefix = @@prefix@@
+datarootdir = @@datarootdir@@
+datadir = @@datadir@@
+$ @kbd{configure}
+configure: creating ./config.status
+config.status: creating Makefile
+$ @kbd{cat Makefile}
+prefix = /usr/local
+datarootdir = $@{prefix@}/share
+datadir = $@{datarootdir@}
+@end example
+
+@acindex{DATAROOTDIR_CHECKED}
+In some cases, however, the checks may not be able to detect that a suitable
+initialization of @code{datarootdir} is in place, or they may fail to detect
+that such an initialization is necessary in the output file. If, after
+auditing your package, there are still spurious @file{configure} warnings about
+@code{datarootdir}, you may add the line
+
+@example
+AC_DEFUN([AC_DATAROOTDIR_CHECKED])
+@end example
+
+@noindent
+to your @file{configure.ac} to disable the warnings. This is an exception
+to the usual rule that you should not define a macro whose name begins with
+@code{AC_} (@pxref{Macro Names}).
+
+
+
@node Build Directories
@subsection Build Directories
@cindex Build directories
])dnl
_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
+m4_ifndef([AC_DATAROOTDIR_CHECKED],
+[cat >>$CONFIG_STATUS <<\_ACEOF
# If the template does not know about datarootdir, expand it.
# FIXME: This hack should be removed a few years after 2.60.
ac_datarootdir_hack=; ac_datarootdir_seen=
s&\\\${datarootdir}&$datarootdir&g' ;;
esac
_ACEOF
+])dnl
# Neutralize VPATH when `$srcdir' = `.'.
# Shell code in configure.ac might set extrasub.
abs_top_builddir]AC_PROVIDE_IFELSE([AC_PROG_INSTALL], [[, INSTALL]])AC_PROVIDE_IFELSE([AC_PROG_MKDIR_P], [[, MKDIR_P]]),
[s&@_AC_Var@&$ac_[]_AC_Var&;t t[]AC_SUBST_TRACE(_AC_Var)
])dnl
-$ac_datarootdir_hack
+m4_ifndef([AC_DATAROOTDIR_CHECKED], [$ac_datarootdir_hack
+])dnl
" $ac_file_inputs m4_defn([_AC_SED_CMDS])>$tmp/out
-test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
+m4_ifndef([AC_DATAROOTDIR_CHECKED],
+[test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
{ ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&
{ ac_out=`sed -n '/^[[ ]]*datarootdir[[ ]]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } &&
AC_MSG_WARN([$ac_file contains a reference to the variable `datarootdir'
which seems to be undefined. Please make sure it is defined.])
+])dnl
rm -f "$tmp/stdin"
case $ac_file in