]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
* lib/autoconf/status.m4 (_AC_OUTPUT_FILE): If the templates for
authorRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Wed, 12 Apr 2006 20:40:21 +0000 (20:40 +0000)
committerRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Wed, 12 Apr 2006 20:40:21 +0000 (20:40 +0000)
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.

ChangeLog
NEWS
lib/autoconf/status.m4
tests/torture.at

index 0978dc239b5bb70302364b8f4a94cd63f762c435..56697386d6a2743bb6601bcbb415eb282462b972 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+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.
diff --git a/NEWS b/NEWS
index 0f907e287f280736322eec5771ef1a6d5abe82b3..bf64a69f28ffdc580062204069302482c8e7c9a0 100644 (file)
--- a/NEWS
+++ b/NEWS
 
   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
index e28171eec3cf59f15c1bf5f7a0a93b34dcd4db04..8a66304af7a5e1d20b5c3e14ac1318e46aaa38a2 100644 (file)
@@ -496,6 +496,32 @@ AC_PROVIDE_IFELSE([AC_PROG_INSTALL],
 ])
 _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?
@@ -515,6 +541,7 @@ m4_foreach([_AC_Var], [srcdir, abs_srcdir, top_srcdir, abs_top_srcdir,
                        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 2eca9072ee6b94e520d95c1184f68084533e27a5..0b834bd1d987f93112dd5c229f671e15382cdd9c 100644 (file)
@@ -633,6 +633,35 @@ two
 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.  ##
 ## -------- ##