summaryrefslogtreecommitdiffstats
path: root/jemalloc/configure.ac
diff options
context:
space:
mode:
authorJason Evans <je@facebook.com>2010-03-02 21:01:16 (GMT)
committerJason Evans <je@facebook.com>2010-03-02 21:01:16 (GMT)
commita40bc7afe8ae71b05eba81805c87d92e9bf6ce27 (patch)
tree1d4debec1893cc5e69b5c7b4774db1948f46951f /jemalloc/configure.ac
parent22ca855e8fbf4c592f5e46aaec381b68de60c71a (diff)
downloadjemalloc-0.0.0.zip
jemalloc-0.0.0.tar.gz
jemalloc-0.0.0.tar.bz2
Add release versioning support.0.0.0
Base version string on 'git describe --long', and provide cpp macros in jemalloc.h. Add the version mallctl.
Diffstat (limited to 'jemalloc/configure.ac')
-rw-r--r--jemalloc/configure.ac16
1 files changed, 15 insertions, 1 deletions
diff --git a/jemalloc/configure.ac b/jemalloc/configure.ac
index 918be8b..4d2d66a 100644
--- a/jemalloc/configure.ac
+++ b/jemalloc/configure.ac
@@ -563,9 +563,23 @@ AC_RUN_IFELSE([AC_LANG_PROGRAM(
dnl ============================================================================
dnl jemalloc configuration.
dnl
+
+dnl Set VERSION if source directory has an embedded git repository.
+if test -d "${srcroot}../.git" ; then
+ git describe --long > ${srcroot}VERSION
+fi
jemalloc_version=`cat ${srcroot}VERSION`
-AC_DEFINE_UNQUOTED([JEMALLOC_VERSION], ["$jemalloc_version"])
+jemalloc_version_major=`echo ${jemalloc_version} | tr ".g-" " " | awk '{print [$]1}'`
+jemalloc_version_minor=`echo ${jemalloc_version} | tr ".g-" " " | awk '{print [$]2}'`
+jemalloc_version_bugfix=`echo ${jemalloc_version} | tr ".g-" " " | awk '{print [$]3}'`
+jemalloc_version_nrev=`echo ${jemalloc_version} | tr ".g-" " " | awk '{print [$]4}'`
+jemalloc_version_gid=`echo ${jemalloc_version} | tr ".g-" " " | awk '{print [$]5}'`
AC_SUBST([jemalloc_version])
+AC_SUBST([jemalloc_version_major])
+AC_SUBST([jemalloc_version_minor])
+AC_SUBST([jemalloc_version_bugfix])
+AC_SUBST([jemalloc_version_nrev])
+AC_SUBST([jemalloc_version_gid])
dnl ============================================================================
dnl Configure pthreads.