Commit | Line | Data |
---|---|---|
fb2149fc MW |
1 | dnl -*-autoconf-*- |
2 | ||
0bef29cb MW |
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. | |
fb2149fc | 50 | |
0bef29cb | 51 | # serial 1 |
d663db3a MW |
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], | |
57 | [texmfdir=guess]) | |
237acc79 MW |
58 | case $texmfdir in |
59 | guess) | |
60 | AC_MSG_CHECKING([where to put installed TeX files]) | |
61 | mdw_DEFINE_PATHS([ | |
195ca0c9 MW |
62 | texmfdir='${datadir}/texmf' |
63 | for d in \ | |
64 | '${datadir}/texmf' '${prefix}/lib/texmf' \ | |
d663db3a MW |
65 | '${prefix}/texmf' '${libdir}/lib/texmf' |
66 | do | |
67 | if test -d "mdw_PATH([$d])"; then texmfdir=$d; break; fi | |
195ca0c9 MW |
68 | done]) |
69 | AC_MSG_RESULT([$texmfdir]) | |
237acc79 MW |
70 | ;; |
71 | esac | |
fb2149fc | 72 | AC_SUBST(texmfdir)]) |