doc: add missing -lm option to command line for compiling tut1
[comedilib.git] / m4 / as-version.m4
1 dnl version.m4 0.0.5
2 dnl autostars m4 macro for versioning
3 dnl thomas@apestaart.org
4 dnl
5 dnl AS_VERSION(PACKAGE, PREFIX, MAJOR, MINOR, MICRO, NANO, ACTION_IF_NO_NANO, ACTION_IF_NANO)
6 dnl example
7 dnl AS_VERSION(gstreamer, GST_VERSION, 0, 3, 2,)
8 dnl for a 0.3.2 release version
9 dnl
10 dnl this macro
11 dnl - defines [$PREFIX]_MAJOR, MINOR and MICRO
12 dnl - if NANO is empty, then we're in release mode, else in cvs/dev mode
13 dnl - defines [$PREFIX], VERSION, and [$PREFIX]_RELEASE
14 dnl - executes the relevant action
15 dnl - AC_SUBST's PACKAGE, VERSION, [$PREFIX] and [$PREFIX]_RELEASE
16 dnl   as well as the little ones
17 dnl - doesn't call AM_INIT_AUTOMAKE anymore because it prevents
18 dnl   maintainer mode from running ok
19 dnl
20 dnl don't forget to put #undef [$2] and [$2]_RELEASE in acconfig.h
21
22 AC_DEFUN([AS_VERSION],
23 [
24   PACKAGE=[$1]
25   [$2]_MAJOR=[$3]
26   [$2]_MINOR=[$4]
27   [$2]_MICRO=[$5]
28   NANO=[$6]
29   if test "x$NANO" = "x" || test "x$NANO" = "x0";
30   then
31       AC_MSG_NOTICE(configuring [$1] for release)
32       VERSION=[$3].[$4].[$5]
33       [$2]_RELEASE=1
34       dnl execute action
35       ifelse([$7], , :, [$7])
36   else
37       AC_MSG_NOTICE(configuring [$1] for development with nano $NANO)
38       VERSION=[$3].[$4].[$5].$NANO
39       [$2]_RELEASE=`date +%Y%m%d_%H%M%S`
40       dnl execute action
41       ifelse([$8], , :, [$8])
42   fi
43
44   [$2]=$VERSION
45   AC_DEFINE_UNQUOTED([$2], "$[$2]", [Define the version])
46   AC_SUBST([$2])
47   AC_DEFINE_UNQUOTED([$2]_RELEASE, "$[$2]_RELEASE", [Define the release version])
48   AC_SUBST([$2]_RELEASE)
49
50   AC_SUBST([$2]_MAJOR)
51   AC_SUBST([$2]_MINOR)
52   AC_SUBST([$2]_MICRO)
53   AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Define the package name])
54   AC_SUBST(PACKAGE)
55   AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Define the version])
56   AC_SUBST(VERSION)
57 ])