]> git.proxmox.com Git - mirror_spl-debian.git/blame - config/spl-meta.m4
Public Release Prep
[mirror_spl-debian.git] / config / spl-meta.m4
CommitLineData
716154c5
BB
1###############################################################################
2# Written by Chris Dunlap <cdunlap@llnl.gov>.
3# Modified by Brian Behlendorf <behlendorf1@llnl.gov>.
4###############################################################################
5# SPL_AC_META: Read metadata from the META file.
6###############################################################################
7
dd529a30 8AC_DEFUN([SPL_AC_META], [
9 AC_MSG_CHECKING([metadata])
10
11 META="$srcdir/META"
12 _spl_ac_meta_got_file=no
13 if test -f "$META"; then
14 _spl_ac_meta_got_file=yes
15
abc3ca14
BB
16 SPL_META_NAME=_SPL_AC_META_GETVAL([(?:NAME|PROJECT|PACKAGE)]);
17 if test -n "$SPL_META_NAME"; then
18 AC_DEFINE_UNQUOTED([SPL_META_NAME], ["$SPL_META_NAME"],
dd529a30 19 [Define the project name.]
20 )
abc3ca14 21 AC_SUBST([SPL_META_NAME])
dd529a30 22 fi
23
abc3ca14
BB
24 SPL_META_VERSION=_SPL_AC_META_GETVAL([VERSION]);
25 if test -n "$SPL_META_VERSION"; then
26 AC_DEFINE_UNQUOTED([SPL_META_VERSION], ["$SPL_META_VERSION"],
dd529a30 27 [Define the project version.]
28 )
abc3ca14 29 AC_SUBST([SPL_META_VERSION])
dd529a30 30 fi
31
abc3ca14
BB
32 SPL_META_RELEASE=_SPL_AC_META_GETVAL([RELEASE]);
33 if test -n "$SPL_META_RELEASE"; then
34 AC_DEFINE_UNQUOTED([SPL_META_RELEASE], ["$SPL_META_RELEASE"],
dd529a30 35 [Define the project release.]
36 )
abc3ca14 37 AC_SUBST([SPL_META_RELEASE])
dd529a30 38 fi
39
abc3ca14 40 if test -n "$SPL_META_NAME" -a -n "$SPL_META_VERSION"; then
72e7de60 41 SPL_META_ALIAS="$SPL_META_NAME-$SPL_META_VERSION"
abc3ca14 42 test -n "$SPL_META_RELEASE" &&
72e7de60
BB
43 SPL_META_ALIAS="$SPL_META_ALIAS-$SPL_META_RELEASE"
44 AC_DEFINE_UNQUOTED([SPL_META_ALIAS],
45 ["$SPL_META_ALIAS"],
dd529a30 46 [Define the project alias string.]
47 )
72e7de60 48 AC_SUBST([SPL_META_ALIAS])
dd529a30 49 fi
50
abc3ca14
BB
51 SPL_META_DATA=_SPL_AC_META_GETVAL([DATE]);
52 if test -n "$SPL_META_DATA"; then
53 AC_DEFINE_UNQUOTED([SPL_META_DATA], ["$SPL_META_DATA"],
dd529a30 54 [Define the project release date.]
55 )
abc3ca14 56 AC_SUBST([SPL_META_DATA])
dd529a30 57 fi
58
abc3ca14
BB
59 SPL_META_AUTHOR=_SPL_AC_META_GETVAL([AUTHOR]);
60 if test -n "$SPL_META_AUTHOR"; then
61 AC_DEFINE_UNQUOTED([SPL_META_AUTHOR], ["$SPL_META_AUTHOR"],
dd529a30 62 [Define the project author.]
63 )
abc3ca14 64 AC_SUBST([SPL_META_AUTHOR])
dd529a30 65 fi
66
67 m4_pattern_allow([^LT_(CURRENT|REVISION|AGE)$])
abc3ca14
BB
68 SPL_META_LT_CURRENT=_SPL_AC_META_GETVAL([LT_CURRENT]);
69 SPL_META_LT_REVISION=_SPL_AC_META_GETVAL([LT_REVISION]);
70 SPL_META_LT_AGE=_SPL_AC_META_GETVAL([LT_AGE]);
71 if test -n "$SPL_META_LT_CURRENT" \
72 -o -n "$SPL_META_LT_REVISION" \
73 -o -n "$SPL_META_LT_AGE"; then
74 test -n "$SPL_META_LT_CURRENT" || SPL_META_LT_CURRENT="0"
75 test -n "$SPL_META_LT_REVISION" || SPL_META_LT_REVISION="0"
76 test -n "$SPL_META_LT_AGE" || SPL_META_LT_AGE="0"
77 AC_DEFINE_UNQUOTED([SPL_META_LT_CURRENT],
78 ["$SPL_META_LT_CURRENT"],
dd529a30 79 [Define the libtool library 'current'
80 version information.]
81 )
abc3ca14
BB
82 AC_DEFINE_UNQUOTED([SPL_META_LT_REVISION],
83 ["$SPL_META_LT_REVISION"],
dd529a30 84 [Define the libtool library 'revision'
85 version information.]
86 )
abc3ca14 87 AC_DEFINE_UNQUOTED([SPL_META_LT_AGE], ["$SPL_META_LT_AGE"],
dd529a30 88 [Define the libtool library 'age'
89 version information.]
90 )
abc3ca14
BB
91 AC_SUBST([SPL_META_LT_CURRENT])
92 AC_SUBST([SPL_META_LT_REVISION])
93 AC_SUBST([SPL_META_LT_AGE])
dd529a30 94 fi
95 fi
96
97 AC_MSG_RESULT([$_spl_ac_meta_got_file])
98 ]
99)
100
101AC_DEFUN([_SPL_AC_META_GETVAL],
102 [`perl -n\
103 -e "BEGIN { \\$key=shift @ARGV; }"\
104 -e "next unless s/^\s*\\$key@<:@:=@:>@//i;"\
105 -e "s/^((?:@<:@^'\"#@:>@*(?:(@<:@'\"@:>@)@<:@^\2@:>@*\2)*)*)#.*/\\@S|@1/;"\
106 -e "s/^\s+//;"\
107 -e "s/\s+$//;"\
108 -e "s/^(@<:@'\"@:>@)(.*)\1/\\@S|@2/;"\
109 -e "\\$val=\\$_;"\
110 -e "END { print \\$val if defined \\$val; }"\
111 '$1' $META`]dnl
112)