summaryrefslogtreecommitdiff
path: root/config.mak.uname
diff options
context:
space:
mode:
authorJohannes Schindelin <johannes.schindelin@gmx.de>2020-04-26 20:09:32 (GMT)
committerJunio C Hamano <gitster@pobox.com>2020-04-27 18:40:26 (GMT)
commita0b31086182541750367f5625f2abd79e80819b0 (patch)
treec78333faadd90f58f5b726cce895ffa0a1d01668 /config.mak.uname
parentaf6b65d45ef179ed52087e80cb089f6b2349f4ec (diff)
downloadgit-a0b31086182541750367f5625f2abd79e80819b0.zip
git-a0b31086182541750367f5625f2abd79e80819b0.tar.gz
git-a0b31086182541750367f5625f2abd79e80819b0.tar.bz2
macOS/brew: let the build find gettext headers/libraries/msgfmt
Apparently a recent Homebrew update now installs `gettext` into the subdirectory /usr/local/opt/gettext/[lib/include]. Sometimes the ci job succeeds: brew link --force gettext Linking /usr/local/Cellar/gettext/0.20.1... 179 symlinks created And sometimes installing the package "gettext" with force-link fails: brew link --force gettext Warning: Refusing to link macOS provided/shadowed software: gettext If you need to have gettext first in your PATH run: echo 'export PATH="/usr/local/opt/gettext/bin:$PATH"' >> ~/.bash_profile (And the is not the final word either, since macOS itself says: The default interactive shell is now zsh.) Anyway, The latter requires CFLAGS to include /usr/local/opt/gettext/include and LDFLAGS to include /usr/local/opt/gettext/lib. Likewise, the `msgfmt` tool is no longer in the `PATH`. While it is unclear which change is responsible for this breakage (that most notably only occurs on CI build agents that updated very recently), https://github.com/Homebrew/homebrew-core/pull/53489 has fixed it. Nevertheless, let's work around this issue, as there are still quite a few build agents out there that need some help in this regard: we explicitly do not call `brew update` in our CI/PR builds anymore. Helped-by: Carlo Marcelo Arenas Belón <carenas@gmail.com> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Torsten Bögershausen <tboegi@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'config.mak.uname')
-rw-r--r--config.mak.uname13
1 files changed, 11 insertions, 2 deletions
diff --git a/config.mak.uname b/config.mak.uname
index 0ab8e00..1ea16e8 100644
--- a/config.mak.uname
+++ b/config.mak.uname
@@ -133,8 +133,17 @@ ifeq ($(uname_S),Darwin)
HAVE_BSD_SYSCTL = YesPlease
FREAD_READS_DIRECTORIES = UnfortunatelyYes
HAVE_NS_GET_EXECUTABLE_PATH = YesPlease
- BASIC_CFLAGS += -I/usr/local/include
- BASIC_LDFLAGS += -L/usr/local/lib
+
+ # Workaround for `gettext` being keg-only and not even being linked via
+ # `brew link --force gettext`, should be obsolete as of
+ # https://github.com/Homebrew/homebrew-core/pull/53489
+ ifeq ($(shell test -d /usr/local/opt/gettext/ && echo y),y)
+ BASIC_CFLAGS += -I/usr/local/include -I/usr/local/opt/gettext/include
+ BASIC_LDFLAGS += -L/usr/local/lib -L/usr/local/opt/gettext/lib
+ ifeq ($(shell test -x /usr/local/opt/gettext/bin/msgfmt && echo y),y)
+ MSGFMT = /usr/local/opt/gettext/bin/msgfmt
+ endif
+ endif
endif
ifeq ($(uname_S),SunOS)
NEEDS_SOCKET = YesPlease