Skip to contentSkip to conversation

Makefile: fix NO_PERL bug with gitweb

PATCH New Jeff King 1 participant 1 message Jun 15, 2016 Kbuild

lore
Share & tools
lore

Jeff King

author
#0 lore raw

PATCH 1/1 Makefile: fix NO_PERL bug with gitweb

When the user has defined NO_PERL, we want to skip building gitweb entirely. However, the conditional to add gitweb/gitweb.cgi to OTHER_PROGRAMS was evaluated before we actually parsed the user's config.mak. This meant that "make NO_PERL=NoThanks" worked fine, but putting "NO_PERL=NoThanks" into your config.mak broke the build (it wanted gitweb.cgi to satisfy "all", but the rule to build it was conditionally ignored, so it complained).

---
Robin, I believe your original patch has this problem, too. I'm assuming it never came up because the Gentoo build specifies the options on the make command-line instead of through config.mak (which is also why my earlier testing didn't catch it). So you may or may not want to modify your patch.

I moved the offending code close to the gitweb.cgi rule definition (it was originally near the OTHER_PROGRAMS definition). I tried to find a spot that would make some sense, rather than just plopping it randomly somewhere after config.mak has been read. But if something else would make more sense, Junio, feel free to tweak the patch.

 Makefile |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)
Makefile +1 -3
index 49f36f5..0292b4f 100644
@@ -361,9 +361,6 @@ ALL_PROGRAMS = $(PROGRAMS) $(SCRIPTS)
 
 # what 'all' will build but not install in gitexecdir
 OTHER_PROGRAMS = git$X
-ifndef NO_PERL
-OTHER_PROGRAMS += gitweb/gitweb.cgi
-endif
 
 # Set paths to tools early so that they can be used for version tests.
 ifndef SHELL_PATH
@@ -1271,6 +1268,7 @@ $(patsubst %.perl,%,$(SCRIPT_PERL)): % : %.perl
 	chmod +x $@+ && \
 	mv $@+ $@
 
+OTHER_PROGRAMS += gitweb/gitweb.cgi
 gitweb/gitweb.cgi: gitweb/gitweb.perl
 	$(QUIET_GEN)$(RM) $@ $@+ && \
 	sed -e '1s|#!.*perl|#!$(PERL_PATH_SQ)|' \
Signature · 1 line
1.6.3.rc1.226.ga8d61c