]> git.ipfire.org Git - thirdparty/git.git/commitdiff
config.mak.uname: set NO_MEMMEM only for functional version
authorCarlo Marcelo Arenas Belón <carenas@gmail.com>
Wed, 2 Jul 2025 09:37:35 +0000 (02:37 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 2 Jul 2025 16:10:01 +0000 (09:10 -0700)
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>
config.mak.uname

index b12d4e168ae11905391be45a41420a973ee610a9..2b434df9e53d2ca3669026aa5105ae04f069175c 100644 (file)
@@ -273,16 +273,13 @@ ifeq ($(uname_S),FreeBSD)
         ifeq ($(firstword $(subst -, ,$(uname_R))),10.1)
                OLD_ICONV = YesPlease
         endif
-       NO_MEMMEM = YesPlease
+        ifeq ($(shell v=$(uname_R) && test $${v%%.*} -lt 12 && echo 1),1)
+               NO_MEMMEM = UnfortunatelyYes
+        endif
        BASIC_CFLAGS += -I/usr/local/include
        BASIC_LDFLAGS += -L/usr/local/lib
        DIR_HAS_BSD_GROUP_SEMANTICS = YesPlease
        USE_ST_TIMESPEC = YesPlease
-        ifeq ($(shell expr "$(uname_R)" : '4\.'),2)
-               PTHREAD_LIBS = -pthread
-               NO_UINTMAX_T = YesPlease
-               NO_STRTOUMAX = YesPlease
-        endif
        PYTHON_PATH = /usr/local/bin/python
        PERL_PATH = /usr/local/bin/perl
        HAVE_PATHS_H = YesPlease