| 1 | # configmake.m4 serial 2 |
| 2 | dnl Copyright (C) 2010-2016 Free Software Foundation, Inc. |
| 3 | dnl This file is free software; the Free Software Foundation |
| 4 | dnl gives unlimited permission to copy and/or distribute it, |
| 5 | dnl with or without modifications, as long as this notice is preserved. |
| 6 | |
| 7 | # gl_CONFIGMAKE_PREP |
| 8 | # ------------------ |
| 9 | # Guarantee all of the standard directory variables, even when used with |
| 10 | # autoconf 2.59 (datarootdir wasn't supported until 2.59c, and runstatedir |
| 11 | # in 2.70) or automake 1.9.6 (pkglibexecdir wasn't supported until 1.10b, |
| 12 | # and runstatedir in 1.14.1). |
| 13 | AC_DEFUN([gl_CONFIGMAKE_PREP], |
| 14 | [ |
| 15 | dnl Technically, datadir should default to datarootdir. But if |
| 16 | dnl autoconf is too old to provide datarootdir, then reversing the |
| 17 | dnl definition is a reasonable compromise. Only AC_SUBST a variable |
| 18 | dnl if it was not already defined earlier by autoconf. |
| 19 | if test "x$datarootdir" = x; then |
| 20 | AC_SUBST([datarootdir], ['${datadir}']) |
| 21 | fi |
| 22 | dnl Copy the approach used in autoconf 2.60. |
| 23 | if test "x$docdir" = x; then |
| 24 | AC_SUBST([docdir], [m4_ifset([AC_PACKAGE_TARNAME], |
| 25 | ['${datarootdir}/doc/${PACKAGE_TARNAME}'], |
| 26 | ['${datarootdir}/doc/${PACKAGE}'])]) |
| 27 | fi |
| 28 | dnl The remaining variables missing from autoconf 2.59 are easier. |
| 29 | if test "x$htmldir" = x; then |
| 30 | AC_SUBST([htmldir], ['${docdir}']) |
| 31 | fi |
| 32 | if test "x$dvidir" = x; then |
| 33 | AC_SUBST([dvidir], ['${docdir}']) |
| 34 | fi |
| 35 | if test "x$pdfdir" = x; then |
| 36 | AC_SUBST([pdfdir], ['${docdir}']) |
| 37 | fi |
| 38 | if test "x$psdir" = x; then |
| 39 | AC_SUBST([psdir], ['${docdir}']) |
| 40 | fi |
| 41 | if test "x$lispdir" = x; then |
| 42 | AC_SUBST([lispdir], ['${datarootdir}/emacs/site-lisp']) |
| 43 | fi |
| 44 | if test "x$localedir" = x; then |
| 45 | AC_SUBST([localedir], ['${datarootdir}/locale']) |
| 46 | fi |
| 47 | dnl Added in autoconf 2.70 |
| 48 | if test "x$runstatedir" = x; then |
| 49 | AC_SUBST([runstatedir], ['${localstatedir}/run']) |
| 50 | fi |
| 51 | |
| 52 | dnl Automake 1.9.6 only lacks pkglibexecdir; and since 1.11 merely |
| 53 | dnl provides it without AC_SUBST, this blind use of AC_SUBST is safe. |
| 54 | AC_SUBST([pkglibexecdir], ['${libexecdir}/${PACKAGE}']) |
| 55 | ]) |