config.mak.uname: set NO_MEMMEM only for functional version

FreeBSD 6 introduced memmem(), but the implementation diverged from what was standard everywhere else (including our "compat" fallback). FreeBSD 10.4 (went EOL in 2018) corrected the functionality bugs but kept a suboptimal implementation until FreeBSD 11.4 (the last version of FreeBSD 11, that went EOL in September 2021). Let's draw the line to require FreeBSD 12 or newer, which allows us to drop the special casing of FreeBSD 4.x and rely on the platform implementation of memmem() unconditionally for all versions that are still being supported. Suggested-by: Brad Smith <brad@comstyle.com> Helped-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Carlo Marcelo Arenas Belón committed Jul 2, 2025 at 02:37 UTC 46a3ab744b9d83e9c21a5b9f6ede29e840f658b4
1 file changed +3 -6
config.mak.uname
+3 -6
@@ -273,16 +273,13 @@ ifeq ($(uname_S),FreeBSD)
273 ifeq ($(firstword $(subst -, ,$(uname_R))),10.1)
274 OLD_ICONV = YesPlease
275 endif
276 - NO_MEMMEM = YesPlease
276 + ifeq ($(shell v=$(uname_R) && test $${v%%.*} -lt 12 && echo 1),1)
277 + NO_MEMMEM = UnfortunatelyYes
278 + endif
279 BASIC_CFLAGS += -I/usr/local/include
280 BASIC_LDFLAGS += -L/usr/local/lib
281 DIR_HAS_BSD_GROUP_SEMANTICS = YesPlease
282 USE_ST_TIMESPEC = YesPlease
281 - ifeq ($(shell expr "$(uname_R)" : '4\.'),2)
282 - PTHREAD_LIBS = -pthread
283 - NO_UINTMAX_T = YesPlease
284 - NO_STRTOUMAX = YesPlease
285 - endif
283 PYTHON_PATH = /usr/local/bin/python
284 PERL_PATH = /usr/local/bin/perl
285 HAVE_PATHS_H = YesPlease