From c6d9750cab33ac3fba1788a7382855bdb0757ba8 Mon Sep 17 00:00:00 2001 From: Alexander Bokovoy Date: Jan 11 2012 17:04:17 +0000 Subject: Add configure check for libintl.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 --- diff --git a/ipa-client/Makefile.am b/ipa-client/Makefile.am index d0a3f84..f22a2c3 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 75544ae..880e928 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 ---------------------------------------------------------------------------