aclocal.glob, m4/: Split the monster into separate `aclocal'-ish files.
[runlisp] / m4 / mdw-auto-version.m4
CommitLineData
fb2149fc
MW
1dnl -*-autoconf-*-
2
3dnl --- *@-mdw_AUTO_VERSION-@* ---
4dnl
5dnl Author: Mark Wooding
6dnl
7dnl Synopsis: mdw_AUTO_VERSION
8dnl
9dnl Arguments: ---
10dnl
11dnl Use: Defines an m4 macro AUTO_VERSION which contains the current
12dnl version number, worked out in some clever way.
13
14AC_DEFUN([mdw_AUTO_VERSION], [nobody cares...])
15m4_define([mdw_AUTO_VERSION], [m4_define([AUTO_VERSION], m4_esyscmd([
16 ver=UNKNOWN
17 for pre in ./ config/; do
18 for post in "" .in; do
19 try=${pre}auto-version${post}
20 if test -x $try; then ver=$("$try"); break; fi
21 done
22 done
23 echo -n "$ver"
24]))])