]> git.ipfire.org Git - thirdparty/nqptp.git/commitdiff
Check for the present of .git/index before committing to using git versioning.
authorMike Brady <4265913+mikebrady@users.noreply.github.com>
Tue, 6 Jul 2021 18:57:15 +0000 (19:57 +0100)
committerMike Brady <4265913+mikebrady@users.noreply.github.com>
Tue, 6 Jul 2021 18:57:15 +0000 (19:57 +0100)
configure.ac

index 46ec73d890b038cce4b68139d57bb122a6689b95..a4a97b68ba61a09af7a7d582d3eb1250c0a042b2 100644 (file)
@@ -34,10 +34,10 @@ if test "x$build_freebsd" = "xyes" ; then
 fi
 
 AC_CHECK_PROGS([GIT], [git])
-if test -n "$GIT"; then
+if test -n "$GIT" && test -e ".git/index" ; then
   AC_DEFINE([CONFIG_USE_GIT_VERSION_STRING], 1, [Use the version string produced by running 'git describe --dirty'.])
 fi
-AM_CONDITIONAL([USE_GIT], [test -n "$GIT"])
+AM_CONDITIONAL([USE_GIT_VERSION], [test -n "$GIT" && test -e ".git/index" ])
 
 AC_CONFIG_SRCDIR([nqptp.c])
 AC_CONFIG_HEADERS([config.h])