Makefile.am: Ship `debian/compat'.
[cfd] / aclocal.glob
CommitLineData
1f79a056 1dnl -*-autoconf-*- *@--GLOB-HEADER--@*
b91e2391 2dnl
3dnl Common library of autoconf macros
4dnl
5dnl (c) 1997 Mark Wooding, except for macros and documentation where noted.
6dnl
7
8dnl----- Licensing notice ---------------------------------------------------
9dnl
10dnl This file is part of the Common Files Distribution (`common')
1f79a056 11dnl
b91e2391 12dnl `Common' is free software; you can redistribute it and/or modify
13dnl it under the terms of the GNU General Public License as published by
14dnl the Free Software Foundation; either version 2 of the License, or
15dnl (at your option) any later version.
1f79a056 16dnl
b91e2391 17dnl `Common' is distributed in the hope that it will be useful,
18dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
19dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20dnl GNU General Public License for more details.
1f79a056 21dnl
b91e2391 22dnl You should have received a copy of the GNU General Public License
23dnl along with `common'; if not, write to the Free Software Foundation,
24dnl Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
25
a7855629 26dnl *@--NOTICE--@* Common File Distribution
b91e2391 27
1f79a056 28dnl --- *@-mdw_AUTO_VERSION-@* ---
aaa99339 29dnl
30dnl Author: Mark Wooding
31dnl
1f79a056 32dnl Synopsis: mdw_AUTO_VERSION
aaa99339 33dnl
34dnl Arguments: ---
35dnl
1f79a056 36dnl Use: Defines an m4 macro AUTO_VERSION which contains the current
ac02f540 37dnl version number, worked out in some clever way.
1f79a056 38
a518f63f 39AC_DEFUN([mdw_AUTO_VERSION], [nobody cares...])
1f79a056 40m4_define([mdw_AUTO_VERSION], [m4_define([AUTO_VERSION], m4_esyscmd([
d9b245f4
MW
41 ver=UNKNOWN
42 for pre in ./ config/; do
43 for post in "" .in; do
44 try=${pre}auto-version${post}
45 if test -x $try; then ver=$("$try"); break; fi
46 done
47 done
48 echo -n "$ver"
1f79a056 49]))])
aaa99339 50
1f79a056 51dnl --- *@-mdw_LIBTOOL_VERSION_INFO-@* ---
aaa99339 52dnl
53dnl Author: Mark Wooding
54dnl
1f79a056 55dnl Synopsis: mdw_LIBTOOL_VERSION
aaa99339 56dnl
57dnl Arguments: ---
58dnl
1f79a056 59dnl Use: Decodes the PACKAGE_VERSION variable as a libtool
ac02f540 60dnl version-info string. Strictly speaking, this is very
1f79a056 61dnl naughty.
aaa99339 62
1f79a056
MW
63AC_DEFUN([mdw_LIBTOOL_VERSION_INFO], [
64 set -- $(echo $PACKAGE_VERSION |
026f4519 65 sed 's:[^\([0-9][0-9]*\)\.\([0-9][0-9]*\)\.\([0-9][0-9]*\).*$]:\1 \2 \3:'
1f79a056
MW
66 )
67 LIBTOOL_VERSION_INFO="$(expr $[]1 + $[]2):$[]3:$[]2"
68 AC_SUBST([LIBTOOL_VERSION_INFO])
69])
aaa99339 70
6888a158
MW
71dnl --- *@-mdw_SILENT_RULES-@* ---
72dnl
73dnl Author: Mark Wooding
74dnl
75dnl Synopsis: mdw_SILENT_RULES
76dnl
77dnl Arguments: ---
78dnl
79dnl Use: Enables the Automake `silent-rules' feature, if available.
80
81AC_DEFUN([mdw_SILENT_RULES], [
82 m4_ifdef([AM_SILENT_RULES], [
83 AM_SILENT_RULES([yes])
84 ], [
85 AC_SUBST([AM_DEFAULT_VERBOSITY], [1])
86 ])
87])
88
6c1c6588 89dnl --- *@-mdw_DECL_ENVIRON-@* ---
b91e2391 90dnl
91dnl Author: Mark Wooding
92dnl
a80cb8cc 93dnl Synopsis: mdw_DECL_ENVIRON
b91e2391 94dnl
a80cb8cc 95dnl Arguments: ---
b91e2391 96dnl
a80cb8cc 97dnl Use: Searches for a declaration of the global `environ' variable.
98dnl If one is found in one of the `usual' places, DECL_ENVIRON
99dnl is defined as a preprocessor symbol.
b91e2391 100
5656743c 101AC_DEFUN([mdw_DECL_ENVIRON],
a80cb8cc 102[AC_CACHE_CHECK([for declaration of \`environ'], mdw_cv_environ,
1f79a056 103[AC_EGREP_CPP([\<environ\>],
a80cb8cc 104[#include <sys/types.h>
105#if HAVE_UNISTD_H
106#include <unistd.h>
107#endif
108#if STDC_HEADERS
109#include <stdlib.h>
110#include <stddef.h>
111#endif], [mdw_cv_environ=yes], [mdw_cv_environ=no])])
112if test $mdw_cv_environ = yes; then
a9b6829a 113 AC_DEFINE([DECL_ENVIRON], [1],
ac02f540 114 [Define if you have the `environ' vector of environment variables.])
a80cb8cc 115fi])
b91e2391 116
5656743c 117dnl --- *@-mdw_DEFINE_PATHS-@*
118dnl
119dnl Author: Mark Wooding
120dnl
a9b6829a 121dnl Synopsis: mdw_DEFINE_PATHS(CODE)
5656743c 122dnl
123dnl Arguments: CODE = shell script code to execute
124dnl
125dnl Use: Fixes up various variables so that pathname defines can be
126dnl defined. Within CODE, you may use the following macros:
127dnl
128dnl mdw_PROG(NAME) Transformed program name
129dnl
130dnl mdw_PATH(PATH) Expanded path (may contain variables)
131dnl
132dnl mdw_DEFINE_PROG(SYMBOL, PROG)
133dnl Define a symbol as a transformed
134dnl program name.
135dnl
136dnl mdw_DEFINE_PATH(SYMBOL, NAME)
137dnl Define a symbol as an expanded path
138
139AC_DEFUN([mdw_DEFINE_PATHS],
140[mdw_prefix=$prefix mdw_exec_prefix=$exec_prefix
141mdw_transform=`echo "$program_transform_name"|sed 's,\\\\\\\\,\\\\,g; s,\\$\\$,$,g'`
142test "$prefix" = "NONE" && prefix=$ac_default_prefix
143test "$exec_prefix" = "NONE" && exec_prefix=$prefix
144$1
145prefix=$mdw_prefix exec_prefix=$mdw_exec_prefix])
146
147AC_DEFUN([mdw_PROG], [`echo "$1"|sed "$mdw_transform"`])
148AC_DEFUN([mdw_PATH], [dnl
149`t="$1"; dnl
150while :; do dnl
151case "$t" in dnl
152*\\$[]*) t=\`eval echo "$t"\`;; dnl
153*) break;; dnl
154esac; done; dnl
155echo "$t"`])
1f79a056 156AC_DEFUN([mdw_DEFINE_PROG],
ac02f540
MW
157 [AC_DEFINE_UNQUOTED([$1], ["mdw_PROG([$2])"],
158 [Program name for $2.])])
050cd7d5 159AC_DEFUN([mdw_DEFINE_PATH], [AC_DEFINE_UNQUOTED([$1], ["mdw_PATH([$2])"],
ac02f540 160 [Pathname for $2.])])
5656743c 161
0494ba14 162dnl --- *@-mdw_MANEXT-@* ---
163dnl
164dnl Author: Mark Wooding
165dnl
166dnl Synopsis: mdw_MANEXT
167dnl
168dnl Arguments: ---
169dnl
170dnl Use: Sets the substitution `manext' for man page extensions.
171
172AC_DEFUN([mdw_MANEXT], [
173AC_ARG_WITH([man-ext],
174[ --with-man-ext=EXT give manpages the EXT extension (e.g., foo.3EXT)],
175[manext=$withval], [manext=mLib])
176AC_SUBST(manext)])
177
407625c7
MW
178dnl --- *@-mdw_DIR_TEXMF-@* ---
179dnl
180dnl Author: Mark Wooding
181dnl
182dnl Synopsis: mdw_DIR_TEXMF
183dnl
184dnl Arguments: ---
185dnl
186dnl Use: Sets the substitution `texmfdir' as a sensible TeX install
187dnl tree.
188
189AC_DEFUN([mdw_DIR_TEXMF], [
190AC_ARG_WITH([texmfdir],
191[ --with-texmfdir=DIR set the TeX install directory to DIR],
192[texmfdir=$withval],
193[AC_MSG_CHECKING([where to put installed TeX files])
194mdw_DEFINE_PATHS([
195texmfdir='${datadir}/texmf'
196for d in \
197 '${datadir}/texmf' '${prefix}/lib/texmf' \
198 '${prefix}/texmf' '${libdir}/lib/texmf'; do
199 if test -d "mdw_PATH([$d])"; then
200 texmfdir=$d
201 break
202 fi
203done
204AC_MSG_RESULT([$texmfdir])])])
205AC_SUBST(texmfdir)])
206
b91e2391 207dnl----- That's all, folks --------------------------------- *@--GLOB-END--@*