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

[PATCH 1/1] Don't append -lintl when there is no gettext support

From
John Szakmeister <john@szakmeister.net>
Date
Feb 18, 2012, 19:38 UTC
Message-ID
<1329593884-9999-2-git-send-email-john@szakmeister.net>
In-Reply-To
<1329593884-9999-1-git-send-email-john@szakmeister.net>

The check for libintl in a C library incorrectly assumes that if it's not builtin then it must exist externally. Instead, let's check for the existence of libintl.h first. If libintl.h exists, and libintl is not in libc, then we append the library.

Signed-off-by: John Szakmeister <john@szakmeister.net>
---
 configure.ac |   20 ++++++++++++--------
 1 files changed, 12 insertions(+), 8 deletions(-)
diff --git a/configure.ac b/configure.ac
index 630dbdd..8471f5c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -640,7 +640,18 @@ AC_CHECK_LIB([c], [gettext],
 [LIBC_CONTAINS_LIBINTL=YesPlease],
 [LIBC_CONTAINS_LIBINTL=])
 AC_SUBST(LIBC_CONTAINS_LIBINTL)
-test -n "$LIBC_CONTAINS_LIBINTL" || LIBS="$LIBS -lintl"
+
+#
+# Define NO_GETTEXT if you don't want Git output to be translated.
+# A translated Git requires GNU libintl or another gettext implementation
+AC_CHECK_HEADER([libintl.h],
+[NO_GETTEXT=],
+[NO_GETTEXT=YesPlease])
+AC_SUBST(NO_GETTEXT)
+
+if test -z "$NO_GETTEXT"; then
+    test -n "$LIBC_CONTAINS_LIBINTL" || LIBS="$LIBS -lintl"
+fi
 
 ## Checks for header files.
 AC_MSG_NOTICE([CHECKS for header files])
@@ -824,13 +835,6 @@ AC_CHECK_HEADER([paths.h],
 [HAVE_PATHS_H=])
 AC_SUBST(HAVE_PATHS_H)
 #
-# Define NO_GETTEXT if you don't want Git output to be translated.
-# A translated Git requires GNU libintl or another gettext implementation
-AC_CHECK_HEADER([libintl.h],
-[NO_GETTEXT=],
-[NO_GETTEXT=YesPlease])
-AC_SUBST(NO_GETTEXT)
-#
 # Define HAVE_LIBCHARSET_H if have libcharset.h
 AC_CHECK_HEADER([libcharset.h],
 [HAVE_LIBCHARSET_H=YesPlease],
-- 
1.7.9.1
Previous: John SzakmeisterNext: Junio C Hamano
Message 2 of 4 in “Make libintl in libc detection more robust”
  1. 0/1 Make libintl in libc detection more robustJohn Szakmeister, Feb 18, 2012
  2. 1/1 Don't append -lintl when there is no gettext supportJohn Szakmeister, Feb 18, 2012
  3. Junio C HamanoFeb 20, 2012
  4. John SzakmeisterFeb 20, 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.