[virt-tools-list] [virt-viewer v2 1/2] build-sys: Don't substitute buildid when it was not set
Christophe Fergeau
cfergeau at redhat.com
Tue Jun 2 15:07:33 UTC 2015
Since it defaults to being 0, we'll get a spurious 0 on remote-viewer
--version if we AC_DEFINE/AC_SUBST it when the user did not specify it.
---
This patch is unchanged from v1. One small behaviour difference compared to the
previous version is that before, $buildid == "0" could only happen when --with-buildid was
not specified, while now it can also happen if someone uses --with-buildid=0
Christophe
configure.ac | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/configure.ac b/configure.ac
index c99378b..df9ba12 100644
--- a/configure.ac
+++ b/configure.ac
@@ -233,8 +233,13 @@ fi
AC_ARG_WITH([buildid],
AS_HELP_STRING([--with-buildid=id], [Set additional build version details]),
[buildid="$with_buildid"], [buildid="0"])
-AC_DEFINE_UNQUOTED([BUILDID], "$buildid", [Build version details])
-AC_SUBST([BUILDID], "$buildid")
+
+if test "x$buildid" != "x0"; then
+ AC_DEFINE_UNQUOTED([BUILDID], "$buildid", [Build version details])
+ AC_SUBST([BUILDID], "$buildid")
+else
+ AC_DEFINE_UNQUOTED([BUILDID], "", [Build version details])
+fi
major=`echo $PACKAGE_VERSION | cut -d. -f1`
minor=`echo $PACKAGE_VERSION | cut -d. -f2`
--
2.4.2
More information about the virt-tools-list
mailing list