]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Fix the value of LIBS during the checking.
authorBruno Haible <bruno@clisp.org>
Thu, 17 May 2001 13:33:37 +0000 (13:33 +0000)
committerBruno Haible <bruno@clisp.org>
Sun, 28 Jun 2009 14:35:48 +0000 (16:35 +0200)
m4/ChangeLog
m4/gettext.m4

index e7cfe78b19507c99f17840d40093236e5c53ac88..e75ebd1b7183812c0ec47a76477585ab66463763 100644 (file)
@@ -1,3 +1,9 @@
+2001-05-17  Bruno Haible  <haible@clisp.cons.org>
+
+       * gettext.m4 (AM_WITH_NLS): Fix dcgettext test. Always add $LIBICONV
+       when using -lintl, because libintl may be a static library depending
+       on a (static or shared) libiconv.
+
 2001-05-12  Paul Eggert  <eggert@twinsun.com>
 
        * gettext.m4 (AM_GNU_GETTEXT): Add check for strtoul.
index 059df7c9f26a4cbab053102c850e0358d0bf7b37..3b2a035e2a40d0f3e610ca9a25d335e337b18dfe 100644 (file)
@@ -47,6 +47,7 @@ AC_DEFUN([AM_WITH_NLS],
 
     BUILD_INCLUDED_LIBINTL=no
     USE_INCLUDED_LIBINTL=no
+    INTLLIBS=
 
     dnl If we use NLS figure out what method
     if test "$USE_NLS" = "yes"; then
@@ -84,7 +85,7 @@ return (int) gettext ("")]ifelse([$2], need-ngettext, [ + (int) ngettext ("", ""
             AC_CACHE_CHECK([for GNU gettext in libintl],
               gt_cv_func_gnugettext_libintl,
               [gt_save_LIBS="$LIBS"
-               LIBS="$LIBS -lintl"
+               LIBS="$LIBS -lintl $LIBICONV"
                AC_TRY_LINK([#include <libintl.h>
 extern int _nl_msg_cat_cntr;],
                  [bindtextdomain ("", "");
@@ -103,18 +104,29 @@ return (int) gettext ("")]ifelse([$2], need-ngettext, [ + (int) ngettext ("", ""
                   && test "$PACKAGE" != gettext; }; then
             AC_DEFINE(HAVE_GETTEXT, 1,
                [Define if the GNU gettext() function is already present or preinstalled.])
+
+            if test "$gt_cv_func_gnugettext_libintl" = "yes"; then
+              dnl If iconv() is in a separate libiconv library, then anyone
+              dnl linking with libintl{.a,.so} also needs to link with
+              dnl libiconv.
+              INTLLIBS="-lintl $LIBICONV"
+            fi
+
+            gt_save_LIBS="$LIBS"
+            LIBS="$LIBS $INTLLIBS"
             AC_CHECK_FUNCS(dcgettext)
+            LIBS="$gt_save_LIBS"
+
             AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
               [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl
             if test "$MSGFMT" != "no"; then
               AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
             fi
+
             AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
               [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
+
             CATOBJEXT=.gmo
-            if test "$gt_cv_func_gnugettext_libintl" = "yes"; then
-              INTLLIBS="-lintl"
-            fi
           fi
        ])
 
@@ -137,16 +149,10 @@ return (int) gettext ("")]ifelse([$2], need-ngettext, [ + (int) ngettext ("", ""
        BUILD_INCLUDED_LIBINTL=yes
        USE_INCLUDED_LIBINTL=yes
         CATOBJEXT=.gmo
-       INTLLIBS='ifelse([$3],[],$(top_builddir)/intl,[$3])/libintl.ifelse([$1], use-libtool, [l], [])a'
+       INTLLIBS="ifelse([$3],[],$(top_builddir)/intl,[$3])/libintl.ifelse([$1], use-libtool, [l], [])a $LIBICONV"
        LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'`
       fi
 
-      dnl If iconv() is in a separate libiconv library, then anyone linking
-      dnl with libintl{.a,.so} also needs to link with libiconv.
-      if test -n "$LIBICONV" && test -n "$INTLLIBS"; then
-        INTLLIBS="$INTLLIBS $LIBICONV"
-      fi
-
       dnl Test whether we really found GNU xgettext.
       if test "$XGETTEXT" != ":"; then
        dnl If it is no GNU xgettext we define it as : so that the