There are still distributions with external libintl for gettext 
support. Thus, extend configure in ipa-client to make sure we don't 
miss these cases.

Instead of using full libintl macro, I opted to a simpler one that 
does not require anything added into the distribution (libintl m4 code 
forces some unpleasant additions like config.rpath).

Marko M. has spotted this on older Ubuntu versions where eglibc has 
probably too deviated from glibc, though I'm yet to find any 
reasonably old distribution based on glibc that doesn't include 
gettext support in their libc.

https://fedorahosted.org/freeipa/ticket/1840

-- 
/ Alexander Bokovoy
>From 456740f0ed5f2085bf64affa59e436ba9724f0d2 Mon Sep 17 00:00:00 2001
From: Alexander Bokovoy <[email protected]>
Date: Thu, 17 Nov 2011 10:38:13 +0200
Subject: [PATCH 2/3] Add configure check for libint.h

There are some distributions which do not provide gettext support within libc.
For these cases checking for libintl is required.

https://fedorahosted.org/freeipa/ticket/1840
---
 ipa-client/Makefile.am  |    3 +++
 ipa-client/configure.ac |   15 +++++++++++++++
 2 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/ipa-client/Makefile.am b/ipa-client/Makefile.am
index 
d0a3f8463a53411286f52dcc552186b9a36b7b88..f22a2c345ff2356c77b7dccc2e8775950202ae5d
 100644
--- a/ipa-client/Makefile.am
+++ b/ipa-client/Makefile.am
@@ -50,6 +50,7 @@ ipa_getkeytab_LDADD =                 \
        $(OPENLDAP_LIBS)        \
        $(SASL_LIBS)            \
        $(POPT_LIBS)            \
+       $(LIBINTL_LIBS)         \
        $(NULL)
 
 ipa_rmkeytab_SOURCES =         \
@@ -60,6 +61,7 @@ ipa_rmkeytab_SOURCES =                \
 ipa_rmkeytab_LDADD =           \
        $(KRB5_LIBS)            \
        $(POPT_LIBS)            \
+       $(LIBINTL_LIBS)         \
        $(NULL)
 
 ipa_join_SOURCES =             \
@@ -75,6 +77,7 @@ ipa_join_LDADD =              \
        $(CURL_LIBS)            \
        $(XMLRPC_LIBS)          \
        $(POPT_LIBS)            \
+       $(LIBINTL_LIBS)         \
        $(NULL)
 
 SUBDIRS =                      \
diff --git a/ipa-client/configure.ac b/ipa-client/configure.ac
index 
75544ae7570c19a1fcbaadc8264b6e94da7fe047..880e9289f3ec92bf195b3330d121567aa27e5a73
 100644
--- a/ipa-client/configure.ac
+++ b/ipa-client/configure.ac
@@ -175,6 +175,21 @@ fi
 AC_SUBST(XMLRPC_LIBS)
 
 dnl ---------------------------------------------------------------------------
+dnl - Check for libintl
+dnl ---------------------------------------------------------------------------
+SAVE_LIBS="$LIBS"
+LIBINTL_LIBS=
+AC_CHECK_HEADER(libintl.h, [], [AC_MSG_ERROR([libintl.h not found, please 
install xgettext])])
+AC_SEARCH_LIBS([bindtextdomain], [libintl],[], [])
+if test "x$ac_cv_search_bindtextdomain" = "xno" ; then
+  AC_MSG_ERROR([libintl is not found and your libc does not support gettext, 
please install xgettext])
+elif test "x$ac_cv_search_bindtextdomain" != "xnone required" ; then
+  LIBINTL_LIBS="$ac_cv_search_bindtextdomain"
+fi
+LIBS="$SAVELIBS"
+AC_SUBST(LIBINTL_LIBS)
+
+dnl ---------------------------------------------------------------------------
 dnl - Set the data install directory since we don't use pkgdatadir
 dnl ---------------------------------------------------------------------------
 
-- 
1.7.7.2

_______________________________________________
Freeipa-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/freeipa-devel

Reply via email to