0.60.3 libintl link issue

Tim Mooney <[email protected]>
Newsgroups gmane.comp.gnu.aspell.devel
Message-ID <[email protected]>
[I'm not subscribed to aspell-devel, so please Cc: me on replies]

While building GNU aspell on Tru64 UNIX, or any other platform that
doesn't have gettext in libc, there's a problem with the link step for
libaspell.so.  I initially thought the problem might be with libtool,
but the consensus on the libtool mailing list was that the wrong
libtool-related Makefile variable was being used.

Basically, configure.ac's call to the gettext macros:

 	AM_GNU_GETTEXT([external])
 	AM_GNU_GETTEXT_VERSION(0.14.1)

results in configure finding GNU gettext installed:

checking for GNU gettext in libintl... yes
checking whether to use NLS... yes
checking where the gettext function comes from... external libintl
checking how to link with libintl... /opt/gnu/lib/libintl.so -liconv -lc -rpath /opt/gnu/lib


That much is good.  The problem comes when it's time to create
libaspell.la (sorry about the length):


/bin/ksh ./libtool --tag=CXX --mode=link cxx  -std gnu -model ansi -D__USE_STD_IOSTREAM -O2 -g3 -tune host -arch host -readonly_strings -pthread   -o libaspell.la -rpath /opt/gnu/lib -version-info 16:3:1 -no-undefined common/cache.lo common/string.lo common/getdata.lo common/itemize.lo common/file_util.lo common/string_map.lo common/string_list.lo common/config.lo common/posib_err.lo common/errors.lo common/error.lo common/fstream.lo common/iostream.lo common/info.lo common/can_have_error.lo common/convert.lo common/tokenizer.lo common/speller.lo common/document_checker.lo common/filter.lo common/objstack.lo common/strtonum.lo common/gettext_init.lo common/file_data_util.lo modules/speller/default/readonly_ws.lo modules/speller/default/suggest.lo modules/speller/default/data.lo modules/speller/default/multi_ws.lo modules/speller/default/phonetic.lo modules/speller/default/writable.lo mod
 ules/speller/default/speller_impl.lo modules/speller/default/phonet.lo modules/speller/de!
 fault/typo_editdist.lo modules/speller/default/editdist.lo modules/speller/default/primes.lo modules/speller/default/language.lo modules/speller/default/leditdist.lo modules/speller/default/affix.lo modules/tokenizer/basic.lo lib/filter-c.lo lib/word_list-c.lo lib/info-c.lo lib/mutable_container-c.lo lib/error-c.lo lib/document_checker-c.lo lib/string_map-c.lo lib/new_config.lo lib/config-c.lo lib/string_enumeration-c.lo lib/can_have_error-c.lo lib/dummy.lo lib/new_filter.lo lib/new_fmode.lo lib/string_list-c.lo lib/find_speller.lo lib/speller-c.lo lib/string_pair_enumeration-c.lo lib/new_checker.lo modules/filter/url.lo modules/filter/email.lo modules/filter/tex.lo modules/filter/sgml.lo modules/filter/context.lo modules/filter/nroff.lo modules/filter/texinfo.lo /opt/gnu/lib/libintl.so -liconv -lc -rpath /opt/gnu/lib 
mkdir .libs
cxx -shared   common/.libs/cache.o common/.libs/string.o common/.libs/getdata.o common/.libs/itemize.o common/.libs/file_util.o common/.libs/string_map.o common/.libs/string_list.o common/.libs/config.o common/.libs/posib_err.o common/.libs/errors.o common/.libs/error.o common/.libs/fstream.o common/.libs/iostream.o common/.libs/info.o common/.libs/can_have_error.o common/.libs/convert.o common/.libs/tokenizer.o common/.libs/speller.o common/.libs/document_checker.o common/.libs/filter.o common/.libs/objstack.o common/.libs/strtonum.o common/.libs/gettext_init.o common/.libs/file_data_util.o modules/speller/default/.libs/readonly_ws.o modules/speller/default/.libs/suggest.o modules/speller/default/.libs/data.o modules/speller/default/.libs/multi_ws.o modules/speller/default/.libs/phonetic.o modules/speller/default/.libs/writable.o modules/speller/default/.libs/speller_impl.o modules/spel
 ler/default/.libs/phonet.o modules/speller/default/.libs/typo_editdist.o modules/speller/!
 default/.libs/editdist.o modules/speller/default/.libs/primes.o modules/speller/default/.libs/language.o modules/speller/default/.libs/leditdist.o modules/speller/default/.libs/affix.o modules/tokenizer/.libs/basic.o lib/.libs/filter-c.o lib/.libs/word_list-c.o lib/.libs/info-c.o lib/.libs/mutable_container-c.o lib/.libs/error-c.o lib/.libs/document_checker-c.o lib/.libs/string_map-c.o lib/.libs/new_config.o lib/.libs/config-c.o lib/.libs/string_enumeration-c.o lib/.libs/can_have_error-c.o lib/.libs/dummy.o lib/.libs/new_filter.o lib/.libs/new_fmode.o lib/.libs/string_list-c.o lib/.libs/find_speller.o lib/.libs/speller-c.o lib/.libs/string_pair_enumeration-c.o lib/.libs/new_checker.o modules/filter/.libs/url.o modules/filter/.libs/email.o modules/filter/.libs/tex.o modules/filter/.libs/sgml.o modules/filter/.libs/context.o modules/filter/.libs/nroff.o modules/filter/.libs/texinfo.o  -li
 conv -lc   -model ansi -pthread -msym -soname libaspell.so.15 `test -n "16.1.3:15.0:16.0"!
  && echo -set_version 16.1.3:15.0:16.0` -update_registry .libs/so_loca
tions -o .libs/libaspell.so.16.1.3
ld:
Warning: Unresolved:
libintl_dgettext
unsigned int acommon::HashTable<T0=acommon::StringMap::Parms>::erase(const T0::Key&)
void acommon::HashTable<acommon::StringMap::Parms>::init(unsigned int)
void acommon::HashTable<acommon::StringMap::Parms>::del(void)
void acommon::BlockSList<acommon::StringPair>::clear(void)
log
floor
sqrt
libintl_bind_textdomain_codeset



Forget about the missing acommon symbols and the math functions for now
(I'll have subsequent emails about them).  The generated shared aspell
shared library is missing two important gettext functions, because it
passed libtool the argument:

 	/opt/gnu/lib/libintl.so -liconv -lc -rpath /opt/gnu/lib

That comes directly from $(LIBINTL) in the generated Makefile.  When
libtool takes the step of actually creating the shared library, though,
it elides the /opt/gnu/lib/libintl.so, so libaspell.so never gets linked
against libintl.so.

After discussion on the libtool mailing list, it turns out that what
aspell should instead be using is $(LTLIBINTL).  The other variable
$(LIBINTL) is for projects that are not using libtool.  Projects like
aspell that are using libtool should instead use $(LTLIBINTL).

The fix is trivial:


diff -ur aspell-0.60.3.orig/Makefile.am aspell-0.60.3/Makefile.am
--- aspell-0.60.3.orig/Makefile.am	2005-06-27 04:15:37.000000000 -0500
+++ aspell-0.60.3/Makefile.am	2005-10-12 10:38:28.000000000 -0500
@@ -91,7 +91,7 @@
    lib/string_pair_enumeration-c.cpp\
    lib/new_checker.cpp

-libaspell_la_LIBADD =  $(LIBINTL) $(PTHREAD_LIB)
+libaspell_la_LIBADD =  $(LTLIBINTL) $(PTHREAD_LIB)

  if INCREMENTED_SONAME
  libaspell_la_LDFLAGS = -version-info 16:3:0 -no-undefined



This only affects platforms that have gettext external to libc and
use GNU gettext.  I've verified that using $(LTLIBINTL) works for linking
with libtool, whether or not the libintl.la file is installed on the
system.

Please let me know if you have any comments or questions!

Tim
-- 
Tim Mooney                              [email protected]
Information Technology Services         (701) 231-1076 (Voice)
Room 242-J6, IACC Building              (701) 231-8541 (Fax)
North Dakota State University, Fargo, ND 58105-5164

_______________________________________________
Aspell-devel mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/aspell-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.