]> www.ginac.de Git - cln.git/blob - m4/getval.m4
Move GETVAL macro from acinclude.m4 to m4/getval.m4.
[cln.git] / m4 / getval.m4
1 dnl CLN_HEADER_GETVAL(NAME,FILE)
2 dnl Expand at autoconf time to the value of a "#define NAME" from the given
3 dnl FILE. The regexps here aren't very robust, but are enough for us.
4 dnl /dev/null as a parameter prevents a hang if $2 is accidentally omitted.
5 dnl (shamelessly ripped from GMP, and changed prefix to CL_).
6
7 define(CL_HEADER_GETVAL,
8 [patsubst(patsubst(
9 esyscmd([grep "^#define $1 " $2 /dev/null 2>/dev/null]),
10 [^.*$1[         ]+],[]),
11 [[
12         ]*$],[])])
13
14
15 dnl CL_GET_VERSION
16 dnl The CLN version number, extracted from #defines at autoconf time.
17
18 AC_DEFUN([CL_GET_VERSION],
19 [CL_HEADER_GETVAL(CL_VERSION_$1,[include/cln/version.h])])
20
21 dnl CL_GET_LTVERSION
22 dnl The CLN library version number, extracted from #defines at autoconf time.
23
24 AC_DEFUN([CL_GET_LTVERSION],
25 [CL_HEADER_GETVAL(CL_LT_$1,[include/cln/version.h])])