@@ -124,6 +124,7 @@ ifeq ($(uname_S),Darwin)
124124 # - MacOS 10.0.* and MacOS 10.1.0 = Darwin 1.*
125125 # - MacOS 10.x.* = Darwin (x+4).* for (1 <= x)
126126 # i.e. "begins with [15678] and a dot" means "10.4.* or older".
127+ DARWIN_MAJOR_VERSION = $(shell expr "$(uname_R)" : '\([0-9]*\)\.')
127128 ifeq ($(shell expr "$(uname_R)" : '[15678]\.'),2)
128129 OLD_ICONV = UnfortunatelyYes
129130 NO_APPLE_COMMON_CRYPTO = YesPlease
@@ -149,28 +150,13 @@ ifeq ($(uname_S),Darwin)
149150 CSPRNG_METHOD = arc4random
150151 USE_ENHANCED_BASIC_REGULAR_EXPRESSIONS = YesPlease
151152
152- # Workaround for `gettext` being keg-only and not even being linked via
153- # `brew link --force gettext`, should be obsolete as of
154- # https://github.com/Homebrew/homebrew-core/pull/53489
155- ifeq ($(shell test -d /usr/local/opt/gettext/ && echo y),y)
156- BASIC_CFLAGS += -I/usr/local/include -I/usr/local/opt/gettext/include
157- BASIC_LDFLAGS += -L/usr/local/lib -L/usr/local/opt/gettext/lib
158- ifeq ($(shell test -x /usr/local/opt/gettext/bin/msgfmt && echo y),y)
159- MSGFMT = /usr/local/opt/gettext/bin/msgfmt
160- endif
161- # On newer ARM-based machines the default installation path has changed to
162- # /opt/homebrew. Include it in our search paths so that the user does not
163- # have to configure this manually.
164- #
165- # Note that we do not employ the same workaround as above where we manually
166- # add gettext. The issue was fixed more than three years ago by now, and at
167- # that point there haven't been any ARM-based Macs yet.
168- else ifeq ($(shell test -d /opt/homebrew/ && echo y),y)
169- BASIC_CFLAGS += -I/opt/homebrew/include
170- BASIC_LDFLAGS += -L/opt/homebrew/lib
171- ifeq ($(shell test -x /opt/homebrew/bin/msgfmt && echo y),y)
172- MSGFMT = /opt/homebrew/bin/msgfmt
173- endif
153+ ifeq ($(uname_M),arm64)
154+ HOMEBREW_PREFIX = /opt/homebrew
155+ else
156+ HOMEBREW_PREFIX = /usr/local
157+ endif
158+ ifeq ($(shell test "$(DARWIN_MAJOR_VERSION)" -ge 24 && echo 1),1)
159+ USE_HOMEBREW_LIBICONV = UnfortunatelyYes
174160 endif
175161
176162 # The builtin FSMonitor on MacOS builds upon Simple-IPC. Both require
0 commit comments