findlinks, mklinks, mdw-setup: Spruce up style.
[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
MW
36dnl Use: Defines an m4 macro AUTO_VERSION which contains the current
37dnl version number, worked out in some clever way.
38
39dnl AC_DEFUN([mdw_AUTO_VERSION], [nobody cares...])
40m4_define([mdw_AUTO_VERSION], [m4_define([AUTO_VERSION], m4_esyscmd([
41 if test -d .git && version=$(git describe --abbrev=4 2>/dev/null); then
42 case "$(git diff-index --name-only HEAD)" in
43 "") ;; *) version="$version+" ;;
44 esac
45 elif cat RELEASE 2>/dev/null; then
46 version=$(cat RELEASE)
47 elif test -f debian/changelog; then
48 version=$(sed -n '/^.*(\(.*\)).*$/ { s::\1:p; q; }' debian/changelog)
49 else
50 echo UNKNOWN
51 fi
52 echo -n $version
53]))])
aaa99339 54
1f79a056 55dnl --- *@-mdw_LIBTOOL_VERSION_INFO-@* ---
aaa99339 56dnl
57dnl Author: Mark Wooding
58dnl
1f79a056 59dnl Synopsis: mdw_LIBTOOL_VERSION
aaa99339 60dnl
61dnl Arguments: ---
62dnl
1f79a056
MW
63dnl Use: Decodes the PACKAGE_VERSION variable as a libtool
64dnl version-info string. Strictly speaking, this is very
65dnl naughty.
aaa99339 66
1f79a056
MW
67AC_DEFUN([mdw_LIBTOOL_VERSION_INFO], [
68 set -- $(echo $PACKAGE_VERSION |
69 sed 's:[^.*\([0-9][0-9]*\)\.\([0-9][0-9]*\)\.\([0-9][0-9]*\).*$]:\1 \2 \3:'
70 )
71 LIBTOOL_VERSION_INFO="$(expr $[]1 + $[]2):$[]3:$[]2"
72 AC_SUBST([LIBTOOL_VERSION_INFO])
73])
aaa99339 74
6c1c6588 75dnl --- *@-mdw_DECL_ENVIRON-@* ---
b91e2391 76dnl
77dnl Author: Mark Wooding
78dnl
a80cb8cc 79dnl Synopsis: mdw_DECL_ENVIRON
b91e2391 80dnl
a80cb8cc 81dnl Arguments: ---
b91e2391 82dnl
a80cb8cc 83dnl Use: Searches for a declaration of the global `environ' variable.
84dnl If one is found in one of the `usual' places, DECL_ENVIRON
85dnl is defined as a preprocessor symbol.
b91e2391 86
5656743c 87AC_DEFUN([mdw_DECL_ENVIRON],
a80cb8cc 88[AC_CACHE_CHECK([for declaration of \`environ'], mdw_cv_environ,
1f79a056 89[AC_EGREP_CPP([\<environ\>],
a80cb8cc 90[#include <sys/types.h>
91#if HAVE_UNISTD_H
92#include <unistd.h>
93#endif
94#if STDC_HEADERS
95#include <stdlib.h>
96#include <stddef.h>
97#endif], [mdw_cv_environ=yes], [mdw_cv_environ=no])])
98if test $mdw_cv_environ = yes; then
a9b6829a 99 AC_DEFINE([DECL_ENVIRON], [1],
100 [Define if you have the `environ' vector of environment variables.])
a80cb8cc 101fi])
b91e2391 102
5656743c 103dnl --- *@-mdw_DEFINE_PATHS-@*
104dnl
105dnl Author: Mark Wooding
106dnl
a9b6829a 107dnl Synopsis: mdw_DEFINE_PATHS(CODE)
5656743c 108dnl
109dnl Arguments: CODE = shell script code to execute
110dnl
111dnl Use: Fixes up various variables so that pathname defines can be
112dnl defined. Within CODE, you may use the following macros:
113dnl
114dnl mdw_PROG(NAME) Transformed program name
115dnl
116dnl mdw_PATH(PATH) Expanded path (may contain variables)
117dnl
118dnl mdw_DEFINE_PROG(SYMBOL, PROG)
119dnl Define a symbol as a transformed
120dnl program name.
121dnl
122dnl mdw_DEFINE_PATH(SYMBOL, NAME)
123dnl Define a symbol as an expanded path
124
125AC_DEFUN([mdw_DEFINE_PATHS],
126[mdw_prefix=$prefix mdw_exec_prefix=$exec_prefix
127mdw_transform=`echo "$program_transform_name"|sed 's,\\\\\\\\,\\\\,g; s,\\$\\$,$,g'`
128test "$prefix" = "NONE" && prefix=$ac_default_prefix
129test "$exec_prefix" = "NONE" && exec_prefix=$prefix
130$1
131prefix=$mdw_prefix exec_prefix=$mdw_exec_prefix])
132
133AC_DEFUN([mdw_PROG], [`echo "$1"|sed "$mdw_transform"`])
134AC_DEFUN([mdw_PATH], [dnl
135`t="$1"; dnl
136while :; do dnl
137case "$t" in dnl
138*\\$[]*) t=\`eval echo "$t"\`;; dnl
139*) break;; dnl
140esac; done; dnl
141echo "$t"`])
1f79a056 142AC_DEFUN([mdw_DEFINE_PROG],
050cd7d5 143 [AC_DEFINE_UNQUOTED([$1], ["mdw_PROG([$2])"],
144 [Program name for $2.])])
145AC_DEFUN([mdw_DEFINE_PATH], [AC_DEFINE_UNQUOTED([$1], ["mdw_PATH([$2])"],
146 [Pathname for $2.])])
5656743c 147
0494ba14 148dnl --- *@-mdw_MANEXT-@* ---
149dnl
150dnl Author: Mark Wooding
151dnl
152dnl Synopsis: mdw_MANEXT
153dnl
154dnl Arguments: ---
155dnl
156dnl Use: Sets the substitution `manext' for man page extensions.
157
158AC_DEFUN([mdw_MANEXT], [
159AC_ARG_WITH([man-ext],
160[ --with-man-ext=EXT give manpages the EXT extension (e.g., foo.3EXT)],
161[manext=$withval], [manext=mLib])
162AC_SUBST(manext)])
163
b91e2391 164dnl----- That's all, folks --------------------------------- *@--GLOB-END--@*