From 15da05bca761ef6aade72bae3efa9d251f72146b Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Wed, 4 Nov 2026 22:00:43 -1000 Subject: Let cgit.conf set Git's build options cgit.conf was read only after Git's Makefile, which had already settled NO_REGEX and the other options it tests as it read them, so setting one there changed nothing in Git's part of the build. The second read stays for the defaults Git assigns outright, such as CC and CFLAGS. A "+=" there now appends twice to a variable nothing resets in between, such as CGIT_CFLAGS, which only repeats the flag. --- source/cgit.mk | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'source') diff --git a/source/cgit.mk b/source/cgit.mk index 629c111..a62e4fd 100644 --- a/source/cgit.mk +++ b/source/cgit.mk @@ -5,19 +5,26 @@ # # make -C vendor/git -f ../../source/cgit.mk ../../build/cgit +CGIT_ROOT = ../.. + +# Read again here because a sub make inherits only the variables the top level +# Makefile exports, which leaves out the build options this file and Git's +# Makefile read. It comes ahead of Git's Makefile, which acts on an option such +# as NO_REGEX as soon as it reads it. +-include $(CGIT_ROOT)/cgit.conf + include Makefile # BUILDDIR is named relative to the project root because the version recipe # changes into the root before using it. CGIT_SRC and CGIT_BUILD lead to the # sources and the output from vendor/git, where everything else here runs. -CGIT_ROOT = ../.. SRCDIR = source BUILDDIR = build CGIT_SRC = $(CGIT_ROOT)/$(SRCDIR) CGIT_BUILD = $(CGIT_ROOT)/$(BUILDDIR) -# Read again here because a sub make inherits only the variables the top level -# Makefile exports, which leaves out the build options this file reads. +# And once more, since Git's Makefile and the lines above set CC, CFLAGS, +# BUILDDIR and the like over whatever was read before them. -include $(CGIT_ROOT)/cgit.conf # The CGIT_ values used below are exported by the top level Makefile. git -- cgit 2.12.1