{"thread":{"id":"19100","subject":"[PATCH] Makefile: fix NO_PERL bug with gitweb","startedAt":"2009-04-28T03:34:24Z","lastAt":"2009-04-28T03:34:24Z","messageCount":1,"participants":["Jeff King"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"112490","messageId":"20090428033423.GA7704@coredump.intra.peff.net","threadId":"19100","inReplyTo":null,"subject":"[PATCH] Makefile: fix NO_PERL bug with gitweb","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2009-04-28T03:34:24Z","receivedAt":"2009-04-28T03:34:24Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"When the user has defined NO_PERL, we want to skip building\ngitweb entirely.  However, the conditional to add\ngitweb/gitweb.cgi to OTHER_PROGRAMS was evaluated before we\nactually parsed the user's config.mak. This meant that \"make\nNO_PERL=NoThanks\" worked fine, but putting \"NO_PERL=NoThanks\"\ninto your config.mak broke the build (it wanted gitweb.cgi\nto satisfy \"all\", but the rule to build it was conditionally\nignored, so it complained).\n\nSigned-off-by: Jeff King <peff@peff.net>\n---\nRobin, I believe your original patch has this problem, too. I'm assuming\nit never came up because the Gentoo build specifies the options on the\nmake command-line instead of through config.mak (which is also why my\nearlier testing didn't catch it). So you may or may not want to modify\nyour patch.\n\nI moved the offending code close to the gitweb.cgi rule definition (it\nwas originally near the OTHER_PROGRAMS definition). I tried to find a\nspot that would make some sense, rather than just plopping it randomly\nsomewhere after config.mak has been read. But if something else would\nmake more sense, Junio, feel free to tweak the patch.\n\n Makefile |    4 +---\n 1 files changed, 1 insertions(+), 3 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 49f36f5..0292b4f 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -361,9 +361,6 @@ ALL_PROGRAMS = $(PROGRAMS) $(SCRIPTS)\n \n # what 'all' will build but not install in gitexecdir\n OTHER_PROGRAMS = git$X\n-ifndef NO_PERL\n-OTHER_PROGRAMS += gitweb/gitweb.cgi\n-endif\n \n # Set paths to tools early so that they can be used for version tests.\n ifndef SHELL_PATH\n@@ -1271,6 +1268,7 @@ $(patsubst %.perl,%,$(SCRIPT_PERL)): % : %.perl\n \tchmod +x $@+ && \\\n \tmv $@+ $@\n \n+OTHER_PROGRAMS += gitweb/gitweb.cgi\n gitweb/gitweb.cgi: gitweb/gitweb.perl\n \t$(QUIET_GEN)$(RM) $@ $@+ && \\\n \tsed -e '1s|#!.*perl|#!$(PERL_PATH_SQ)|' \\\n-- \n1.6.3.rc1.226.ga8d61c\n"}]}