Libintl problems on libc5 - here's the solution



Hello all,

the last few days some people reported problems with with undefined references
to gettext, bindtextdomain etc. in gnome-libs and elsewhere ...

The problem is the following (gettext-0.10.35):

1.) AM_WITH_NLS checks whether the `gettext' function can be found in the
    C library

2.) if that fails it checks whether it can find that function in -lintl
    using AC_CHECK_LIB and defines "gt_cv_func_gettext_libintl" to be
    "yes" on success.

3.) it *only* defines INTLLIBS if the included gettext should be used and
    sets it to `$(top_builddir)/intl/libintl.a' if this is the case.

4.) All over Gnome, all Makefile.am's use $(LIBINTL) to use that intl
    stuff - and due to 3.) you get undefined symbols if it is not in the
    C library.
              
So we need to add -lintl to the INTLLIBS to avoid this problem, but only 
when not using the included gettext.

Here is a short patch for this problem:

======================================================================================
--- gettext.m4.orig     Thu Dec 10 19:20:41 1998
+++ gettext.m4  Thu Dec 10 19:24:36 1998
@@ -73,6 +73,12 @@
                INSTOBJEXT=.mo
              fi
            fi
+
+          if test "$gt_cv_func_gettext_libc" != "yes" \
+             && test "$gt_cv_func_gettext_libintl" = "yes"; then
+             INTLLIBS=-lintl
+             LIBS=`echo $LIBS | sed -e 's/-lintl//'`
+          fi
        ])
 
         if test "$CATOBJEXT" = "NONE"; then
======================================================================================

All you need to do is to apply this patch to your $(prefix)/share/aclocal/gettext.m4
and it should work.

There's also an updated version of this file in the `temp' module in the
Gnome CVS tree:

$ cvs co temp
$ cd temp/gettext
$ cp gettext.m4 /opt/gnome/share/aclocal/gettext.m4 (or whereever you have it)

Martin

-----------------------------------------------------------------
   Martin Baulig - Angewandte Mathematik - Universitaet Trier
   martin@home-of-linux.org, http://www.home-of-linux.org/
------------------------------------------------------------------



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]