[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: GetText 1.20.1 and libgettextlib.so: undefined reference to `libicon
From: |
Jeffrey Walton |
Subject: |
Re: GetText 1.20.1 and libgettextlib.so: undefined reference to `libiconv' (and friends) |
Date: |
Wed, 5 Feb 2020 07:39:41 -0500 |
On Wed, Feb 5, 2020 at 4:02 AM Jeffrey Walton <address@hidden> wrote:
>
> Hi Everyone,
>
> I'm building GetText 1.20.1 from sources on NetBSD. msgcmp is failing:
>
> /bin/sh ../libtool --tag=CC --mode=link gcc -g2 -O2 -fPIC -pthread
> -L/usr/local/lib -Wl,-R,'$ORIGIN/../lib' -Wl,-R,/usr/local/lib
> -Wl,--enable-new-dtags -o msgcmp msgcmp-msgcmp.o msgcmp-msgl-fsearch.o
> libgettextsrc.la -lm -lpthread
> libtool: link: gcc -g2 -O2 -fPIC -pthread -Wl,-R -Wl,\$ORIGIN/../lib
> -Wl,-R -Wl,/usr/local/lib -Wl,--enable-new-dtags -o .libs/msgcmp
> msgcmp-msgcmp.o msgcmp-msgl-fsearch.o -L/usr/local/lib
> ./.libs/libgettextsrc.so
> /home/jwalton/gettext-0.20.1/gettext-tools/gnulib-lib/.libs/libgettextlib.so
> /home/jwalton/gettext-0.20.1/libtextstyle/lib/.libs/libtextstyle.so
> -lncurses /home/jwalton/gettext-0.20.1/gettext-tools/intl/.libs/libintl.so
> -lc -lm -lpthread -pthread -Wl,-rpath -Wl,/usr/local/lib
> /home/jwalton/gettext-0.20.1/gettext-tools/gnulib-lib/.libs/libgettextlib.so:
> undefined reference to `libiconv'
> /home/jwalton/gettext-0.20.1/gettext-tools/gnulib-lib/.libs/libgettextlib.so:
> undefined reference to `libiconv_open'
> /home/jwalton/gettext-0.20.1/gettext-tools/gnulib-lib/.libs/libgettextlib.so:
> undefined reference to `libiconv_close'
> gmake[5]: *** [Makefile:2909: msgcmp] Error 1
>
> I configured GetText with --with-libiconv-prefix=[DIR], but it looks
> like -liconv and did not make it into the recipe. Adding -liconv to
> LIBS did not help.
It looks like the problems lie in .../gettext-tools/src/Makefile.in
and .../gettext-tools/gnulib-tests/Makefile.in. There were two
problems.
First, LTLIBICONV was empty in the makefiles. I had to manually:
-LTLIBICONV = @LTLIBICONV@
+LTLIBICONV = -liconv
Second, the recipes with the undefined references needed $(LTLIBICONV)
added to *_LDADD. So there were a lot of these:
-test_localcharset_LDADD = $(LDADD)
+test_localcharset_LDADD = $(LTLIBICONV) $(LDADD)
I guess the way to handle it is, if --with-libiconv-prefix then set
LTLIBICONV to -liconv; otherwise leave LTLIBICONV empty (or set it to
-lc).
Attached is the full patch for this problem.
Jeff
gettext-iconv.patch
Description: Text Data