summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2026-01-21 08:28:57 -0800
committerJunio C Hamano <gitster@pobox.com>2026-01-21 08:28:57 -0800
commit0a5dcc1259fa0c8f5c21352c90b3cd3d43273345 (patch)
tree0b6e2f763b3f33d25f9ce51aa7b95d0d28c3d081 /Makefile
parent79e3055baba32e2952e6e8994cdcd4fc145ba7f0 (diff)
parentd28124151851e42a3bb92963f5b747ad843f33e0 (diff)
downloadgit-0a5dcc1259fa0c8f5c21352c90b3cd3d43273345.tar.xz
Merge branch 'tb/macos-iconv-workarounds'
The iconv library on macOS fails to correctly handle stateful ISO/IEC 2022 encoded strings. Work it around instead of replacing it wholesale from homebrew. * tb/macos-iconv-workarounds: utf8.c: enable workaround for iconv under macOS 14/15 utf8.c: prepare workaround for iconv under macOS 14/15
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile16
1 files changed, 16 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index b7eba509c6..8aa489f3b6 100644
--- a/Makefile
+++ b/Makefile
@@ -1687,11 +1687,21 @@ ifeq ($(uname_S),Darwin)
BASIC_CFLAGS += -I/sw/include
BASIC_LDFLAGS += -L/sw/lib
endif
+ ifeq ($(shell test -d /opt/sw/lib && echo y),y)
+ BASIC_CFLAGS += -I/opt/sw/include
+ BASIC_LDFLAGS += -L/opt/sw/lib
+ ifeq ($(shell test -e /opt/sw/lib/libiconv.dylib && echo y),y)
+ HAS_GOOD_LIBICONV = Yes
+ endif
+ endif
endif
ifndef NO_DARWIN_PORTS
ifeq ($(shell test -d /opt/local/lib && echo y),y)
BASIC_CFLAGS += -I/opt/local/include
BASIC_LDFLAGS += -L/opt/local/lib
+ ifeq ($(shell test -e /opt/local/lib/libiconv.dylib && echo y),y)
+ HAS_GOOD_LIBICONV = Yes
+ endif
endif
endif
ifndef NO_APPLE_COMMON_CRYPTO
@@ -1714,6 +1724,7 @@ endif
ifdef USE_HOMEBREW_LIBICONV
ifeq ($(shell test -d $(HOMEBREW_PREFIX)/opt/libiconv && echo y),y)
ICONVDIR ?= $(HOMEBREW_PREFIX)/opt/libiconv
+ HAS_GOOD_LIBICONV = Yes
endif
endif
endif
@@ -1859,6 +1870,11 @@ ifndef NO_ICONV
endif
EXTLIBS += $(ICONV_LINK) -liconv
endif
+ ifdef NEEDS_GOOD_LIBICONV
+ ifndef HAS_GOOD_LIBICONV
+ BASIC_CFLAGS += -DICONV_RESTART_RESET
+ endif
+ endif
endif
ifdef ICONV_OMITS_BOM
BASIC_CFLAGS += -DICONV_OMITS_BOM