git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] macos: do not assume brew and gettext are always available/wanted

From
Carlo Marcelo Arenas Belón <carenas@gmail.com>
Date
Apr 25, 2020, 06:15 UTC
Message-ID
<20200425061531.12845-1-carenas@gmail.com>
In-Reply-To
<pull.616.git.1587628367528.gitgitgadget@gmail.com>

since 27a7067308 (macos: do let the build find the gettext headers/libraries/msgfmt, 2020-04-23) a build with `make NO_GETTEXT=1` will throw warnings like :

    LINK git
ld: warning: directory not found for option '-L/usr/local/opt/gettext/lib'

localize the change together with all the other package specific tweaks and make sure it only applies when both gettext was needed and brew was the provider.

Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>
---
 Makefile         | 9 +++++++++
 config.mak.uname | 7 ++-----
 2 files changed, 11 insertions(+), 5 deletions(-)
diff --git a/Makefile b/Makefile
index 9804a0758b..031a231ad6 100644
--- a/Makefile
+++ b/Makefile
@@ -1303,6 +1303,15 @@ ifeq ($(uname_S),Darwin)
 			BASIC_LDFLAGS += -L/opt/local/lib
 		endif
 	endif
+	ifndef NO_GETTEXT
+		ifeq ($(shell test -d /usr/local/opt/gettext/ && echo y),y)
+			BASIC_CFLAGS += -I/usr/local/opt/gettext/include
+			BASIC_LDFLAGS += -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
 	ifndef NO_APPLE_COMMON_CRYPTO
 		NO_OPENSSL = YesPlease
 		APPLE_COMMON_CRYPTO = YesPlease
diff --git a/config.mak.uname b/config.mak.uname
index 540d124d2e..0ab8e00938 100644
--- a/config.mak.uname
+++ b/config.mak.uname
@@ -133,11 +133,8 @@ ifeq ($(uname_S),Darwin)
 	HAVE_BSD_SYSCTL = YesPlease
 	FREAD_READS_DIRECTORIES = UnfortunatelyYes
 	HAVE_NS_GET_EXECUTABLE_PATH = YesPlease
-	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
+	BASIC_CFLAGS += -I/usr/local/include
+	BASIC_LDFLAGS += -L/usr/local/lib
 endif
 ifeq ($(uname_S),SunOS)
 	NEEDS_SOCKET = YesPlease

base-commit: 27a706730868835ec02a21a9ac4c4fcb3e05d330
-- 
2.26.2.569.g1d74ac4d14
Previous: Johannes SchindelinNext: Johannes Schindelin
Message 7 of 12 in “macos: do let the build find the gettext headers/libraries/msgfmt”
  1. macos: do let the build find the gettext headers/libraries/msgfmtJohannes Schindelin via GitGitGadget, Apr 23, 2020
  2. Eric SunshineApr 23, 2020
  3. Eric SunshineApr 23, 2020
  4. Johannes SchindelinApr 25, 2020
  5. Carlo ArenasApr 26, 2020
  6. Johannes SchindelinApr 26, 2020
  7. macos: do not assume brew and gettext are always available/wantedCarlo Marcelo Arenas Belón, Apr 25, 2020
  8. Johannes SchindelinApr 25, 2020
  9. macos: do let the build find the gettext headers/libraries/msgfmtJohannes Schindelin via GitGitGadget, Apr 25, 2020
  10. Torsten BögershausenApr 26, 2020
  11. Carlo Marcelo Arenas BelónApr 26, 2020
  12. 1/1 MacOs/brew: Let the build find gettext headers/libraries/msgfmttboegi@web.de, Apr 26, 2020

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.