From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-workers@zsh.org
Subject: [PATCH] patchlevel.h broken when building outside the source tree
Date: Thu, 13 Jun 2013 09:24:47 -0700 [thread overview]
Message-ID: <130613092447.ZM7817@torch.brasslantern.com> (raw)
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
reply other threads:[~2013-06-13 16:25 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=130613092447.ZM7817@torch.brasslantern.com \
--to=schaefer@brasslantern.com \
--cc=zsh-workers@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).