[Sheepdog] [PATCH 1/2] Add m4 macros in configure.ac
chenbaozi at gmail.com
chenbaozi at gmail.com
Tue Oct 25 13:36:12 CEST 2011
From: CHEN Baozi <chenbaozi.pt at taobao.com>
Support getting version from git repo in redhat.
Signed-off-by: CHEN Baozi <chenbaozi.pt at taobao.com>
---
configure.ac | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)
diff --git a/configure.ac b/configure.ac
index dea219b..8883944 100644
--- a/configure.ac
+++ b/configure.ac
@@ -20,8 +20,15 @@ AC_PREREQ([2.61])
m4_define([sheepdog_version], [0.2.4])
+m4_define([m4_chomp_all],
+[m4_format([[%.*s]], m4_bregexp(m4_translit([[$1]], [
+/], [/ ]), [/*$]), [$1])])
+
+m4_define([m4_esyscmd_s], [m4_chomp_all(m4_esyscmd([$1]))])
+
m4_define([git_version],
- m4_esyscmd_s([git describe --tags --dirty 2> /dev/null | sed 's/^v//']))
+ m4_esyscmd_s([git describe --tags --dirty 2> /dev/null | sed 's/^v//' \
+| cut -d "-" -f 1]))
AC_INIT([sheepdog], m4_default(git_version, sheepdog_version),
[sheepdog at lists.wpkg.org])
--
1.7.6.4
More information about the sheepdog
mailing list