From 4e89c618137f7d1495e6b18d9fa634dad6ca8956 Mon Sep 17 00:00:00 2001 From: Ludovic Rousseau Date: Tue, 5 Feb 2013 19:39:45 +0100 Subject: [PATCH] Use git(1) only if present The GIT_REVISION is set as the result of 'git describe'. If git is not installed the old code generated an error: $ dh_autoreconf -a sh: 1: git: not found sh: 1: git: not found Thanks to Thomas Hood for the bug report https://groups.google.com/d/msg/nfc-tools-devel/Skd03b1wUcg/xnQThAPXPCYJ --- configure.ac | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index 892b4c9..ca45b0a 100644 --- a/configure.ac +++ b/configure.ac @@ -8,9 +8,10 @@ AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_HEADER(config.h) # GIT revison -define([git_revision], esyscmd([sh -c "git describe"])) -GIT_REVISION=git_revision -AC_DEFINE_UNQUOTED([GIT_REVISION], ["$GIT_REVISION"], [GIT revision]) +GIT_REVISION=`which git > /dev/null && git describe` +if test x"$GIT_REVISION" != x""; then + AC_DEFINE_UNQUOTED([GIT_REVISION], ["$GIT_REVISION"], [GIT revision]) +fi AM_INIT_AUTOMAKE m4_ifdef([AM_PROG_AR], [AM_PROG_AR])