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