diff --git a/Makefile.am b/Makefile.am index c72ad4d03..cfcfd7c36 100644 --- a/Makefile.am +++ b/Makefile.am @@ -187,6 +187,9 @@ noinst_HEADERS = $(wsd_headers) $(shared_headers) $(kit_headers) \ test/countloolkits.hpp \ test/helpers.hpp +dist-hook: + git log -1 --format=%h > $(distdir)/dist_git_hash 2> /dev/null || rm $(distdir)/dist_git_hash + EXTRA_DIST = discovery.xml \ favicon.ico \ loolkitconfig.xcu \ diff --git a/configure.ac b/configure.ac index ad4b67573..3f5daff2d 100644 --- a/configure.ac +++ b/configure.ac @@ -24,7 +24,7 @@ AC_DEFINE_UNQUOTED([LOOLWSD_VERSION],[["$LOOLWSD_VERSION"]],[LibreOffice Online # try to add a git hash for a version if we're developing LOOLWSD_VERSION_HASH="$LOOLWSD_VERSION" -git_hash=`cd ${srcdir} && git log -1 --format=%h 2> /dev/null` +git_hash=`cd ${srcdir} && ( cat dist_git_hash 2> /dev/null || git log -1 --format=%h 2> /dev/null )` if test "z$git_hash" != "z"; then LOOLWSD_VERSION_HASH=$git_hash fi