aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBertrand Jacquin (Beber) <beber@setibzh.com>2006-02-01 00:47:35 +0100
committerBertrand Jacquin (Beber) <beber@setibzh.com>2006-02-01 00:47:35 +0100
commitb15ed6c73bfe02e9966b2ed8859794c39dc44bfb (patch)
treed3fd48325c8154c65f26f8275d7507cee5914ed4
parentMissing files (diff)
downloadespik-b15ed6c73bfe02e9966b2ed8859794c39dc44bfb.tar.xz
Get commit id when compiling
Could be usefull
-rw-r--r--configure.in4
-rw-r--r--m4/ac_espik_version.m414
2 files changed, 17 insertions, 1 deletions
diff --git a/configure.in b/configure.in
index e9753a2..25fe19c 100644
--- a/configure.in
+++ b/configure.in
@@ -7,7 +7,9 @@ rm -f config.cache
AC_INIT(configure.in)
AC_ISC_POSIX
-AM_INIT_AUTOMAKE(espik, 0.0.1)
+
+AC_ESPIK_VERSION
+AM_INIT_AUTOMAKE(espik, $GITVERSION)
AM_CONFIG_HEADER(config.h)
AC_PROG_CC
diff --git a/m4/ac_espik_version.m4 b/m4/ac_espik_version.m4
new file mode 100644
index 0000000..4f355c4
--- /dev/null
+++ b/m4/ac_espik_version.m4
@@ -0,0 +1,14 @@
+AC_DEFUN([AC_ESPIK_VERSION],
+[
+ AC_MSG_CHECKING(for git commit)
+
+ if test `eval git hash-object .git/HEAD`; then
+ GITVERSION=`git hash-object .git/HEAD`
+ else
+ GITVERSION=`date +%Y%m%d`
+ fi
+
+ AC_MSG_RESULT($GITVERSION)
+
+ AC_SUBST(GITVERSION)
+])