diff options
author | Eric Blake <eblake@redhat.com> | 2010-12-14 15:55:43 -0700 |
---|---|---|
committer | Eric Blake <eblake@redhat.com> | 2010-12-14 17:04:52 -0700 |
commit | 3e464b4c6a6db9ca2e186b47fe2b72780bdd60e7 (patch) | |
tree | 7630bb7abde6216ee176afe656a03ec22785c158 /m4/configmake.m4 | |
parent | 5c84fa529cdf9f76cdc538d9a2113a6bb05afc40 (diff) | |
download | gnulib-3e464b4c6a6db9ca2e186b47fe2b72780bdd60e7.tar.gz |
configmake: provide fallbacks for oldest supported autotools
* m4/configmake.m4: New file.
* modules/configmake (Files): Ship it.
(configure.ac): Use it to guarantee fallbacks.
Signed-off-by: Eric Blake <eblake@redhat.com>
Diffstat (limited to 'm4/configmake.m4')
-rw-r--r-- | m4/configmake.m4 | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/m4/configmake.m4 b/m4/configmake.m4 new file mode 100644 index 0000000000..192fab3634 --- /dev/null +++ b/m4/configmake.m4 @@ -0,0 +1,50 @@ +# configmake.m4 serial 1 +dnl Copyright (C) 2010 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +# gl_CONFIGMAKE_PREP +# ------------------ +# Guarantee all of the standard directory variables, even when used with +# autoconf 2.59 (datarootdir wasn't supported until 2.59c) or automake +# 1.9.6 (pkglibexecdir wasn't supported until 1.10b.). +AC_DEFUN([gl_CONFIGMAKE_PREP], +[ + dnl Technically, datadir should default to datarootdir. But if + dnl autoconf is too old to provide datarootdir, then reversing the + dnl definition is a reasonable compromise. Only AC_SUBST a variable + dnl if it was not already defined earlier by autoconf. + if test "x$datarootdir" = x; then + AC_SUBST([datarootdir], ['${datadir}']) + fi + dnl Copy the approach used in autoconf 2.60. + if test "x$docdir" = x; then + AC_SUBST([docdir], [m4_ifset([AC_PACKAGE_TARNAME], + ['${datarootdir}/doc/${PACKAGE_TARNAME}'], + ['${datarootdir}/doc/${PACKAGE}'])]) + fi + dnl The remaining variables missing from autoconf 2.59 are easier. + if test "x$htmldir" = x; then + AC_SUBST([htmldir], ['${docdir}']) + fi + if test "x$dvidir" = x; then + AC_SUBST([dvidir], ['${docdir}']) + fi + if test "x$pdfdir" = x; then + AC_SUBST([pdfdir], ['${docdir}']) + fi + if test "x$psdir" = x; then + AC_SUBST([psdir], ['${docdir}']) + fi + if test "x$lispdir" = x; then + AC_SUBST([lispdir], ['${datarootdir}/emacs/site-lisp']) + fi + if test "x$localedir" = x; then + AC_SUBST([localedir], ['${datarootdir}/locale']) + fi + + dnl Automake 1.9.6 only lacks pkglibexecdir; and since 1.11 merely + dnl provides it without AC_SUBST, this blind use of AC_SUBST is safe. + AC_SUBST([pkglibexecdir], ['${libexecdir}/${PACKAGE}']) +]) |