]> sjero.net Git - wget/blobdiff - aclocal.m4
[svn] Prefer gettext with explicitly linked libintl, so non-standard libintl's
[wget] / aclocal.m4
index f55b502fb511f8c1f851c98454d2aa9f66e9b49a..753ad2ab76554e2514d38ecfaedf563162f28046 100644 (file)
@@ -278,14 +278,19 @@ AC_DEFUN(WGET_WITH_NLS,
 
       AC_CHECK_HEADERS(locale.h libintl.h)
 
-      AC_CHECK_FUNCS(gettext, [], [
-       AC_CHECK_LIB(intl, gettext, [
-          dnl gettext is in libintl; announce the fact manually.
-          LIBS="-lintl $LIBS"
-         AC_DEFINE(HAVE_GETTEXT)
-        ], [
-         AC_MSG_RESULT(
-           [gettext not found; disabling NLS])
+      dnl Prefer gettext found in -lintl to the one in libc.
+      dnl Otherwise it can happen that we include libintl.h from
+      dnl /usr/local/lib, but fail to specify -lintl, which results in
+      dnl link or run-time failures.  (Symptom: libintl_bindtextdomain
+      dnl not found at link-time.)
+
+      AC_CHECK_LIB(intl, gettext, [
+        dnl gettext is in libintl; announce the fact manually.
+        LIBS="-lintl $LIBS"
+       AC_DEFINE(HAVE_GETTEXT)
+      ], [
+        AC_CHECK_FUNCS(gettext, [], [
+          AC_MSG_RESULT([gettext not found; disabling NLS])
           HAVE_NLS=no
         ])
       ])