aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2025-01-22 12:31:29 +0100
committerJunio C Hamano <gitster@pobox.com>2025-01-22 12:28:27 -0800
commitc5bc9a7f94a41c3e719afebf4a6c3e04cba82e4d (patch)
treea5c714b0b86d264ba488df9fc50b29641e30c0d1 /Makefile
parent2187ce76c57173397ca5262ee6a23d1c3a2fab63 (diff)
downloadgit-c5bc9a7f94a41c3e719afebf4a6c3e04cba82e4d.tar.xz
Makefile: wire up build option for deprecated features
With 57ec9254eb (docs: introduce document to announce breaking changes, 2024-06-14), we have introduced a new document that tracks upcoming breaking changes in the Git project. In 2454970930 (BreakingChanges: early adopter option, 2024-10-11) we have amended the document a bit to mention that any introduced breaking changes must be accompanied by logic that allows us to enable the breaking change at compile-time. While we already have two breaking changes lined up, neither of them has such a switch because they predate those instructions. Introduce the proposed `WITH_BREAKING_CHANGES` preprocessor macro and wire it up with both our Makefiles and Meson. This does not yet wire up the build flag for existing deprecations. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile5
1 files changed, 5 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 06f01149ec..dc3c980aa7 100644
--- a/Makefile
+++ b/Makefile
@@ -2230,6 +2230,10 @@ ifdef FSMONITOR_OS_SETTINGS
COMPAT_OBJS += compat/fsmonitor/fsm-path-utils-$(FSMONITOR_OS_SETTINGS).o
endif
+ifdef WITH_BREAKING_CHANGES
+ BASIC_CFLAGS += -DWITH_BREAKING_CHANGES
+endif
+
ifeq ($(TCLTK_PATH),)
NO_TCLTK = NoThanks
endif
@@ -3187,6 +3191,7 @@ GIT-BUILD-OPTIONS: FORCE
-e "s|@USE_GETTEXT_SCHEME@|\'$(USE_GETTEXT_SCHEME)\'|" \
-e "s|@LOCALEDIR@|\'$(localedir_SQ)\'|" \
-e "s!@BROKEN_PATH_FIX@!\'$(BROKEN_PATH_FIX)\'!" \
+ -e "s|@WITH_BREAKING_CHANGES@|\'$(WITH_BREAKING_CHANGES)\'|" \
GIT-BUILD-OPTIONS.in >$@+
@if grep -q '^[A-Z][A-Z_]*=@.*@$$' $@+; then echo "Unsubstituted build options in $@" >&2 && exit 1; fi
@if cmp $@+ $@ >/dev/null 2>&1; then $(RM) $@+; else mv $@+ $@; fi