Make git-version-gen optional. Add _build-aux variable.
authorSimon Josefsson <simon@josefsson.org>
Thu, 20 Mar 2008 14:50:57 +0000 (15:50 +0100)
committerSimon Josefsson <simon@josefsson.org>
Thu, 20 Mar 2008 14:50:57 +0000 (15:50 +0100)
ChangeLog
build-aux/GNUmakefile

index 85d2587617db31ca63c25f7931ce23fac97bd186..490b40e7542faf1f9d5ee400fdc004855b349e89 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2008-03-20  Simon Josefsson  <simon@josefsson.org>
+
+       * build-aux/GNUmakefile: Make git-version-gen optional.  Add
+       _build-aux variable.  Suggested by Eric Blake <ebb9@byu.net>.
+
 2008-03-20  Eric Blake  <ebb9@byu.net>
 
        Sync GNUmakefile with coreutils.
index fac11d3d02c61c61b1704a63963ad86fbfc62d09..a9d6196dad135569171ad00ad47732e462b1b0ae 100644 (file)
@@ -40,6 +40,9 @@ export TAR_OPTIONS = --owner=0 --group=0 --numeric-owner
 
 include Makefile
 
+# Allow cfg.mk to override this.
+_build-aux ?= build-aux
+
 # Some projects override e.g., _autoreconf here.
 -include $(srcdir)/cfg.mk
 include $(srcdir)/maint.mk
@@ -48,11 +51,12 @@ _autoreconf ?= autoreconf
 
 # Ensure that $(VERSION) is up to date for dist-related targets, but not
 # for others: rerunning autoreconf and recompiling everything isn't cheap.
-ifeq (0,$(MAKELEVEL))
+_have-git-version-gen := $(shell test -f ./$(_build-aux)/git-version-gen && echo yes)
+ifeq ($(_have-git-version-gen)0,yes$(MAKELEVEL))
   _is-dist-target = $(filter-out %clean, \
     $(filter dist% alpha beta major,$(MAKECMDGOALS)))
   ifneq (,$(_is-dist-target))
-    _curr-ver := $(shell cd $(srcdir) && ./build-aux/git-version-gen \
+    _curr-ver := $(shell cd $(srcdir) && ./$(_build-aux)/git-version-gen \
                    $(srcdir)/.tarball-version)
     ifneq ($(_curr-ver),$(VERSION))
       $(info INFO: running autoreconf for new version string: $(_curr-ver))