+2006-04-12 Stepan Kasal <kasal@ucw.cz>
+ and Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
+
+ * 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.
+ * tests/torture.at (datarootdir workaround): New test.
+ * NEWS: Advertise this temporary fixup.
+ Based on a patch by Bruno Haible, reported and analyzed by
+ Paul Eggert and Noah Misch.
+
2006-04-12 Eric Blake <ebb9@byu.net>
* tests/autotest.at (Debugging a failed test): Fix comment.
This means that if you use any of `@datadir@', `@infodir@', or
`@mandir@' 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 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
])
_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*) ;;
+*@[]m4_join([@*|*@], _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], m4_defn([_AC_datarootdir_vars]),
+ [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?
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"
AT_CLEANUP
+## ------------------------ ##
+## datarootdir workaround. ##
+## ------------------------ ##
+
+AT_SETUP([datarootdir workaround])
+
+AT_DATA([Foo.in],
+[@datadir@
+@docdir@
+@infodir@
+@localedir@
+@mandir@
+])
+
+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. ##
## -------- ##