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

[PATCH/RFC] Auto detection in Makefile if msgfmt is not available

From
Torsten Bögershausen <tboegi@web.de>
Date
Feb 12, 2012, 12:42 UTC
Message-ID
<201202121342.25113.tboegi@web.de>

Since commit 5e9637c629702e3d41ad01d95956d1835d7338e0 "i18n: add infrastructure for translating Git with gettext" the Makefile demands the existance of msgfmt, unless NO_GETTEXT is defined.

This breaks the build on systems where msgfmt is not installed.

Added a simple auto-detection and switch to NO_GETTEXT when msgfmt could not be found on the system

Signed-off-by: Torsten Bögershausen <tboegi@web.de>
---
 Makefile |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/Makefile b/Makefile
index 87fb30a..23e1e77 100644
--- a/Makefile
+++ b/Makefile
@@ -353,7 +353,11 @@ RPMBUILD = rpmbuild
 TCL_PATH = tclsh
 TCLTK_PATH = wish
 XGETTEXT = xgettext
-MSGFMT = msgfmt
+ifeq ($(shell msgfmt --help 2>/dev/null && echo y),y)
+	MSGFMT = msgfmt
+else
+	NO_GETTEXT=UnfortunatelyYes
+endif
 PTHREAD_LIBS = -lpthread
 PTHREAD_CFLAGS =
 GCOV = gcov
-- 
1.7.8.3.1.g75d1cf.dirty
Next: Ævar Arnfjörð Bjarmason
Message 1 of 4 in “Auto detection in Makefile if msgfmt is not available”
  1. Auto detection in Makefile if msgfmt is not availableTorsten Bögershausen, Feb 12, 2012
  2. Ævar Arnfjörð BjarmasonFeb 12, 2012
  3. Junio C HamanoFeb 12, 2012
  4. Torsten BögershausenFeb 12, 2012

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.