git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] Makefile: fix NO_PERL bug with gitweb

From
Jeff King <peff@peff.net>
Date
Apr 28, 2009, 03:34 UTC
Message-ID
<20090428033423.GA7704@coredump.intra.peff.net>

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

Signed-off-by: Jeff King <peff@peff.net>
---
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(-)
diff --git a/Makefile b/Makefile
index 49f36f5..0292b4f 100644
--- a/Makefile
+++ b/Makefile
@@ -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)|' \
-- 
1.6.3.rc1.226.ga8d61c
Message 1 of 1 in “Makefile: fix NO_PERL bug with gitweb”
  1. Makefile: fix NO_PERL bug with gitwebJeff King, Apr 28, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.