From f42615bef172252d9a1bf37a65750b134715a0ab Mon Sep 17 00:00:00 2001 From: Ramsay Jones Date: Tue, 5 Feb 2019 02:25:53 +0000 Subject: [PATCH 1/2] config.mak.uname: remove obsolete SPARSE_FLAGS setting An upcoming commit will change the semantics of the SPARSE_FLAGS variable from an internal to a user only customisation variable. The MinGW configuration section contains an obsolete setting for this variable which was used (some years ago) to cater to an error in the Win32 system header files. Since 'sparse' does not currently support the MinGW platform, nobody on that platform can be relying on this setting today. Remove this use of the SPARSE_FLAGS variable. Signed-off-by: Ramsay Jones Acked-by: Johannes Schindelin Signed-off-by: Junio C Hamano --- config.mak.uname | 1 - 1 file changed, 1 deletion(-) diff --git a/config.mak.uname b/config.mak.uname index 3ee7da0e23..d0ebe3c570 100644 --- a/config.mak.uname +++ b/config.mak.uname @@ -536,7 +536,6 @@ ifneq (,$(findstring MINGW,$(uname_S))) RC = windres -O coff NATIVE_CRLF = YesPlease X = .exe - SPARSE_FLAGS = -Wno-one-bit-signed-bitfield ifneq (,$(wildcard ../THIS_IS_MSYSGIT)) htmldir = doc/git/html/ prefix = From 15caca28da0f634200b80b98228a5dc0646afbd6 Mon Sep 17 00:00:00 2001 From: Ramsay Jones Date: Tue, 5 Feb 2019 02:27:48 +0000 Subject: [PATCH 2/2] Makefile: improve SPARSE_FLAGS customisation In order to enable greater user customisation of the SPARSE_FLAGS variable, we introduce a new SP_EXTRA_FLAGS variable to use for target specific settings. Without using the new variable, setting the SPARSE_FLAGS on the 'make' command-line would also override the value set by the target-specific rules in the Makefile (effectively making them useless). Also, this enables the SP_EXTRA_FLAGS to be used in the future for any other internal customisations, such as for some platform specific values. In addition, we initialise the SPARSE_FLAGS to the default (empty) value using a conditional assignment (?=). This allows SPARSE_FLAGS to be set from the environment as well as from the command-line. Signed-off-by: Ramsay Jones Signed-off-by: Junio C Hamano --- Makefile | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 1a44c811aa..fced94cb73 100644 --- a/Makefile +++ b/Makefile @@ -568,7 +568,11 @@ SPATCH = spatch export TCL_PATH TCLTK_PATH -SPARSE_FLAGS = +# user customisation variable for 'sparse' target +SPARSE_FLAGS ?= +# internal/platform customisation variable for 'sparse' +SP_EXTRA_FLAGS = + SPATCH_FLAGS = --all-includes --patch . @@ -2347,10 +2351,10 @@ gettext.sp gettext.s gettext.o: GIT-PREFIX gettext.sp gettext.s gettext.o: EXTRA_CPPFLAGS = \ -DGIT_LOCALE_PATH='"$(localedir_relative_SQ)"' -http-push.sp http.sp http-walker.sp remote-curl.sp imap-send.sp: SPARSE_FLAGS += \ +http-push.sp http.sp http-walker.sp remote-curl.sp imap-send.sp: SP_EXTRA_FLAGS += \ -DCURL_DISABLE_TYPECHECK -pack-revindex.sp: SPARSE_FLAGS += -Wno-memcpy-max-count +pack-revindex.sp: SP_EXTRA_FLAGS += -Wno-memcpy-max-count ifdef NO_EXPAT http-walker.sp http-walker.s http-walker.o: EXTRA_CPPFLAGS = -DNO_EXPAT @@ -2364,7 +2368,7 @@ endif ifdef USE_NED_ALLOCATOR compat/nedmalloc/nedmalloc.sp compat/nedmalloc/nedmalloc.o: EXTRA_CPPFLAGS = \ -DNDEBUG -DREPLACE_SYSTEM_ALLOCATOR -compat/nedmalloc/nedmalloc.sp: SPARSE_FLAGS += -Wno-non-pointer-null +compat/nedmalloc/nedmalloc.sp: SP_EXTRA_FLAGS += -Wno-non-pointer-null endif git-%$X: %.o GIT-LDFLAGS $(GITLIBS) @@ -2688,7 +2692,7 @@ SP_OBJ = $(patsubst %.o,%.sp,$(C_OBJ)) $(SP_OBJ): %.sp: %.c GIT-CFLAGS FORCE $(QUIET_SP)cgcc -no-compile $(ALL_CFLAGS) $(EXTRA_CPPFLAGS) \ - $(SPARSE_FLAGS) $< + $(SPARSE_FLAGS) $(SP_EXTRA_FLAGS) $< .PHONY: sparse $(SP_OBJ) sparse: $(SP_OBJ)