| 1 | dnl -*-autoconf-*- |
| 2 | |
| 3 | ### SYNOPSIS |
| 4 | ### |
| 5 | ### mdw_DIR_TEXMF |
| 6 | ### |
| 7 | ### DESCRIPTION |
| 8 | ### |
| 9 | ### Define the substitution `@texmfdir@' to name a sensible TeX |
| 10 | ### installation root directory. |
| 11 | ### |
| 12 | ### A `--with-texmfdir' command-line option is defined, which allows the |
| 13 | ### end user to select a specific installation root. The default is chosen |
| 14 | ### according to a heuristic, which is currently to use the first of |
| 15 | ### |
| 16 | ### * `DATADIR/texmf', |
| 17 | ### * `PREFIX/lib/texmf', |
| 18 | ### * `PREFIX/texmf', |
| 19 | ### * `LIBDIR/lib/texmf'. |
| 20 | ### |
| 21 | ### LICENSE |
| 22 | ### |
| 23 | ### Copyright (c) 2002 Mark Wooding <mdw@distorted.org.uk> |
| 24 | ### |
| 25 | ### This program is free software: you can redistribute it and/or modify it |
| 26 | ### under the terms of the GNU General Public License as published by the |
| 27 | ### Free Software Foundation, either version 2 of the License, or (at your |
| 28 | ### option) any later version. |
| 29 | ### |
| 30 | ### This program is distributed in the hope that it will be useful, but |
| 31 | ### WITHOUT ANY WARRANTY; without even the implied warranty of |
| 32 | ### MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 33 | ### General Public License for more details. |
| 34 | ### |
| 35 | ### You should have received a copy of the GNU General Public License along |
| 36 | ### with this program. If not, see <http://www.gnu.org/licenses/>. |
| 37 | ### |
| 38 | ### As a special exception, the respective Autoconf Macro's copyright owner |
| 39 | ### gives unlimited permission to copy, distribute and modify the configure |
| 40 | ### scripts that are the output of Autoconf when processing the Macro. You |
| 41 | ### need not follow the terms of the GNU General Public License when using |
| 42 | ### or distributing such scripts, even though portions of the text of the |
| 43 | ### Macro appear in them. The GNU General Public License (GPL) does govern |
| 44 | ### all other use of the material that constitutes the Autoconf Macro. |
| 45 | ### |
| 46 | ### This special exception to the GPL applies to versions of the Autoconf |
| 47 | ### Macro released by the Autoconf Archive. When you make and distribute a |
| 48 | ### modified version of the Autoconf Macro, you may extend this special |
| 49 | ### exception to the GPL to apply to your modified version as well. |
| 50 | |
| 51 | # serial 1 |
| 52 | AC_DEFUN([mdw_DIR_TEXMF],[ |
| 53 | AC_ARG_WITH([texmfdir], |
| 54 | [AS_HELP_STRING([--with-texmfdir=DIR], |
| 55 | [set the TeX install directory to DIR])], |
| 56 | [texmfdir=$withval], [texmfdir=guess]) |
| 57 | case $texmfdir in |
| 58 | guess) |
| 59 | AC_MSG_CHECKING([where to put installed TeX files]) |
| 60 | mdw_DEFINE_PATHS([ |
| 61 | texmfdir='${datadir}/texmf' |
| 62 | for d in \ |
| 63 | '${datadir}/texmf' '${prefix}/lib/texmf' \ |
| 64 | '${prefix}/texmf' '${libdir}/lib/texmf'; do |
| 65 | if test -d "mdw_PATH([$d])"; then |
| 66 | texmfdir=$d |
| 67 | break |
| 68 | fi |
| 69 | done]) |
| 70 | AC_MSG_RESULT([$texmfdir]) |
| 71 | ;; |
| 72 | esac |
| 73 | AC_SUBST(texmfdir)]) |