kwo pushed a commit to branch master.

http://git.enlightenment.org/e16/e16.git/commit/?id=257d8e6117ae976a92c501cc8e284b838f57bd20

commit 257d8e6117ae976a92c501cc8e284b838f57bd20
Author: Kim Woelders <k...@woelders.dk>
Date:   Sat Mar 3 19:25:53 2018 +0100

    Include git stamp in version info (if built from git checkout)
---
 Makefile.am     | 13 ++++++++++++-
 src/Makefile.am |  1 +
 src/main.c      |  3 ++-
 3 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index bab81333..aed4370e 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -5,6 +5,7 @@ ACLOCAL_AMFLAGS = -I m4
 MAINTAINERCLEANFILES = aclocal.m4 config.* compile configure depcomp \
                       install-sh ltmain.sh missing mkinstalldirs \
                       Makefile.in */Makefile.in */*/Makefile.in \
+                      version.h \
                       ABOUT-NLS \
                       po/Makefile.in.in po/Makevars.template po/Rules-quot \
                       po/*.header po/*.sed po/*.sin po/e16.pot \
@@ -12,10 +13,12 @@ MAINTAINERCLEANFILES = aclocal.m4 config.* compile 
configure depcomp \
 
 CLEANFILES = $(PACKAGE).spec
 
+BUILT_SOURCES = version.h
+
 SUBDIRS = dox eesh epp src lib config themes fonts scripts misc docs icons pix 
po
 
 EXTRA_DIST = \
-$(PACKAGE).spec.in \
+$(PACKAGE).spec.in version.h \
 sample-scripts/bouncingball.pl \
 sample-scripts/lcdmover.sh \
 sample-scripts/testroller.pl \
@@ -24,8 +27,16 @@ sample-scripts/place-pagers.pl \
 AUTHORS COMPLIANCE COPYING ChangeLog
 
 if SRC_IS_GIT
+version.h: FORCE
+       @echo '#define E16_VERSION "'`git describe --dirty`'"' > $@.tmp
+       @if cmp -s $@.tmp $@; then rm $@.tmp; else mv $@.tmp $@; fi
+
 RPM_RELEASE=`echo -n "1.%(date '+%y%m%d').git"; git rev-parse --short=8 HEAD`
 else
+version.h:
+       @echo '#define E16_VERSION "@VERSION@"' > $@.tmp
+       @if cmp -s $@.tmp $@; then rm $@.tmp; else mv $@.tmp $@; fi
+
 RPM_RELEASE=1
 endif
 
diff --git a/src/Makefile.am b/src/Makefile.am
index d6bb01ee..a4145e66 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -132,6 +132,7 @@ AM_CPPFLAGS = \
 
 e16_CPPFLAGS = \
        $(AM_CPPFLAGS) \
+       -I$(top_srcdir) \
        -I$(top_builddir) \
        $(MODULE_CFLAGS) \
        $(IMLIB2_CFLAGS) \
diff --git a/src/main.c b/src/main.c
index 58033629..cd27508c 100644
--- a/src/main.c
+++ b/src/main.c
@@ -44,10 +44,11 @@
 #include "session.h"
 #include "snaps.h"
 #include "user.h"
+#include "version.h"
 #include "xwin.h"
 
 const char          e_wm_name[] = "e16";
-const char          e_wm_version[] = VERSION;
+const char          e_wm_version[] = E16_VERSION;
 
 EConf               Conf;
 EMode               Mode;

-- 


Reply via email to