zsh-workers
 help / color / mirror / code / Atom feed
* [PATCH] patchlevel.h broken when building outside the source tree
@ 2013-06-13 16:24 Bart Schaefer
  0 siblings, 0 replies; only message in thread
From: Bart Schaefer @ 2013-06-13 16:24 UTC (permalink / raw)
  To: zsh-workers

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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2013-06-13 16:25 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-13 16:24 [PATCH] patchlevel.h broken when building outside the source tree Bart Schaefer

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).