2006-04-12 Stepan Kasal and Ralf Wildenhues * lib/autoconf/status.m4 (_AC_OUTPUT_FILE): If the templates for the instantiated file do not contain the string 'datarootdir' but contain @datadir@, @docdir@, @infodir@, @localedir@, or @mandir@, replace the reference '${datarootdir}' by the value. * NEWS: Advertise this temporary fixup. Based on a patch by Bruno Haible. Index: NEWS =================================================================== RCS file: /cvsroot/autoconf/autoconf/NEWS,v retrieving revision 1.359 diff -u -r1.359 NEWS --- NEWS 10 Apr 2006 17:57:17 -0000 1.359 +++ NEWS 12 Apr 2006 19:14:10 -0000 @@ -25,7 +25,10 @@ This means that if you use any of address@hidden@', address@hidden@', or address@hidden@' in a file, you will have to ensure `${datarootdir}' is - defined in this file. + defined in this file. As a temporary measure, if any of those are + found but no mention of `datarootdir', the substitutions will be + replaced with with values that do not contain `${datarootdir}', + and a warning will be issued. ** @top_builddir@ is now a dir name: it is always nonempty and doesn't have a trailing slash. Similar change will be made to ac_top_builddir in a Index: lib/autoconf/status.m4 =================================================================== RCS file: /cvsroot/autoconf/autoconf/lib/autoconf/status.m4,v retrieving revision 1.94 diff -u -r1.94 status.m4 --- lib/autoconf/status.m4 6 Apr 2006 17:38:06 -0000 1.94 +++ lib/autoconf/status.m4 12 Apr 2006 19:14:12 -0000 @@ -496,6 +496,32 @@ ]) _ACEOF +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= +m4_define([_AC_datarootdir_vars], + [datadir, docdir, infodir, localedir, mandir]) +case `sed -n '/datarootdir/ { + p + q +} +m4_foreach([_AC_Var], m4_defn([_AC_datarootdir_vars]), + [/@_AC_Var@/p +])' $ac_file_inputs` in +*datarootdir*) ;; address@hidden(address@hidden|address@hidden, _AC_datarootdir_vars)@*) + AC_MSG_WARN([$ac_file_inputs seems to ignore the --datarootdir setting]) +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF + ac_datarootdir_hack=' + m4_foreach([_AC_Var], [datadir, docdir, infodir, localedir, mandir], + [s&@_AC_Var@&$_AC_Var&g + ])dnl + s&\\\${datarootdir}&$datarootdir&g' ;; +esac +_ACEOF + # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? @@ -515,6 +541,7 @@ abs_top_builddir]AC_PROVIDE_IFELSE([AC_PROG_INSTALL], [[, INSTALL]]), [s&@_AC_Var@&$ac_[]_AC_Var&;t t[]AC_SUBST_TRACE(_AC_Var) ])dnl +$ac_datarootdir_hack " $ac_file_inputs m4_defn([_AC_SED_CMDS])>$tmp/out rm -f "$tmp/stdin" Index: tests/torture.at =================================================================== RCS file: /cvsroot/autoconf/autoconf/tests/torture.at,v retrieving revision 1.58 diff -u -r1.58 torture.at --- tests/torture.at 8 Apr 2006 09:07:05 -0000 1.58 +++ tests/torture.at 12 Apr 2006 19:14:12 -0000 @@ -633,6 +633,35 @@ AT_CLEANUP +## ------------------------ ## +## datarootdir workaround. ## +## ------------------------ ## + +AT_SETUP([datarootdir workaround]) + +AT_DATA([Foo.in], address@hidden@ address@hidden@ address@hidden@ address@hidden@ address@hidden@ +]) + +AT_DATA([configure.ac], +[[AC_INIT +AC_CONFIG_AUX_DIR($top_srcdir/config) +AC_CONFIG_FILES([Foo]) +AC_OUTPUT +]]) + +AT_CHECK_AUTOCONF +AT_CHECK_CONFIGURE([], [], [], + [config.status: WARNING: Foo.in seems to ignore the --datarootdir setting +]) +AT_CHECK([grep datarootdir Foo], 1, []) +AT_CLEANUP + + ## -------- ## ## srcdir. ## ## -------- ##