From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7774 invoked by alias); 13 Jun 2013 16:25:20 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 31474 Received: (qmail 27327 invoked from network); 13 Jun 2013 16:25:05 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 Received-SPF: none (ns1.primenet.com.au: domain at closedmail.com does not designate permitted sender hosts) From: Bart Schaefer Message-id: <130613092447.ZM7817@torch.brasslantern.com> Date: Thu, 13 Jun 2013 09:24:47 -0700 X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-workers@zsh.org Subject: [PATCH] patchlevel.h broken when building outside the source tree MIME-version: 1.0 Content-type: text/plain; charset=us-ascii Zsh's build process has for a long time supported compiling the shell in a separate tree parallel to the source. I use this, for example, to build both a static and a dynamic-link version of the shell from the same sources. The change to use git-describe for ZSH_PATCHLEVEL broke such builds. The following is not an ideal patch because make still fails to notice when "cd $(sdir) && git ..." fails, and therefore happily builds a shell with an empty-string $ZSH_PATCHLEVEL, but that can at least be unlikely. diff --git a/Makefile.in b/Makefile.in index a29ab78..197276c 100644 --- a/Makefile.in +++ b/Makefile.in @@ -160,7 +160,7 @@ targz-src: $(DISTNAME).tar.gz $(DISTNAME).tar.gz: FORCE @$(sdir_top)/Util/mkdisttree.sh $(DISTNAME) $(sdir_top) $(dir_top) SRC \ $(MAKE) $(MAKEDEFS) - echo '#define ZSH_PATCHLEVEL "'`git describe --tags --long`'"' >$(DISTNAME)/Src/patchlevel.h.release + echo '#define ZSH_PATCHLEVEL "'`cd $(sdir_top) && git describe --tags --long`'"' >$(DISTNAME)/Src/patchlevel.h.release tar cf - $(DISTNAME) | gzip -9 > $@ rm -rf $(DISTNAME) diff --git a/Src/zsh.mdd b/Src/zsh.mdd index 0fec5c3..4bc884b 100644 --- a/Src/zsh.mdd +++ b/Src/zsh.mdd @@ -43,7 +43,7 @@ patchlevel.h: FORCE @if [ -f $(sdir)/$@.release ]; then \ cp -f $(sdir)/$@.release $@; \ else \ - echo '#define ZSH_PATCHLEVEL "'`git describe --tags --long`'"' > $@.tmp; \ + echo '#define ZSH_PATCHLEVEL "'`cd $(sdir) && git describe --tags --long`'"' > $@.tmp; \ cmp $@ $@.tmp && rm -f $@.tmp || mv $@.tmp $@; \ fi FORCE: -- Barton E. Schaefer