[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: gettext 0.10.40 build problem of tar-1.13.25 on Yellow Dog GNU/Linux
From: |
Bruno Haible |
Subject: |
Re: gettext 0.10.40 build problem of tar-1.13.25 on Yellow Dog GNU/Linux |
Date: |
Fri, 26 Oct 2001 23:56:54 +0200 (CEST) |
> gcc -g -O2 -o tar buffer.o compare.o create.o delete.o extract.o
> incremen.o list.o mangle.o misc.o names.o rtapelib.o tar.o update.o
> ../lib/libtar.a ../lib/libtar.a -lrt
> ../lib/libtar.a(unicodeio.o): In function `unicode_to_mb':
> /local/build/tar-1.13.25/lib/unicodeio.c:154: undefined reference to
> `libiconv_open'
Paul,
Here is a two-step fix.
1) Step 1.
Here is a patch.
*** tar-1.13.24/src/Makefile.am.bak Sun Sep 23 08:48:38 2001
--- tar-1.13.24/src/Makefile.am Fri Oct 26 23:36:11 2001
***************
*** 38,43 ****
# Link libtar.a after @INTLLIBS@, since @INTLLIBS@ might invoke rpl_realloc.
# Also, link it before @INTTLIBS@, since unicodeio.c might invoke
# locale_charset. Sigh.
! LDADD = ../lib/libtar.a @INTLLIBS@ ../lib/libtar.a
rmt_LDADD = $(LDADD) @rmt_LDADD@
tar_LDADD = $(LDADD) @tar_LDADD@
--- 38,44 ----
# Link libtar.a after @INTLLIBS@, since @INTLLIBS@ might invoke rpl_realloc.
# Also, link it before @INTTLIBS@, since unicodeio.c might invoke
# locale_charset. Sigh.
! # Also, link with @LIBICONV@ since iconv is be used by unicodeio.c.
! LDADD = ../lib/libtar.a @INTLLIBS@ ../lib/libtar.a @LIBICONV@
rmt_LDADD = $(LDADD) @rmt_LDADD@
tar_LDADD = $(LDADD) @tar_LDADD@
To reproduce the problem, I used the following commands and builds:
;; Simulate /usr/local, without killing my own /usr/local
$ mkdir /tmp/prefix
$ export CPPFLAGS=-I/tmp/prefix/include LDFLAGS=-L/tmp/prefix/lib
libiconv-1.7:
./configure --prefix=/tmp/prefix
make
make install
gettext-0.10.40:
./configure --prefix=/tmp/prefix
make
make install
tar-1.13.24:
./configure --prefix=/tmp/prefix
make
make install
Without this patch, I get the same link error as Nelson. It is caused
by the use of libiconv, and the fact that @LIBICONV@ (defined by
iconv.m4) is not used in the Makefile. You wouldn't see the error if
@LIBINTL@ happened to contain -liconv, but in this case @LIBINTL@ is
empty because gettext() is already found in libc. With this patch,
link works fine.
Step 2)
The 'tar' program installed by step 1 cannot be executed.
$ ldd /tmp/prefix/bin/tar
libiconv.so.2 => not found
libc.so.6 => /lib/libc.so.6 (0x40019000)
/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)
Here is a second patch. It consists of adding AM_PROG_LIBTOOL to
configure.ac or configure.in. libtool-1.4 or newer is required.
Use "aclocal -Im4" to regenerate aclocal.m4.
Only in tar-1.13.24a: ltmain.sh
Only in tar-1.13.24a/m4: libtool.m4
diff -r -c3 --exclude=Makefile.in --exclude=aclocal.m4 --exclude=configure
tar-1.13.24/configure.ac tar-1.13.24a/configure.ac
*** tar-1.13.24/configure.ac Fri Sep 21 23:23:51 2001
--- tar-1.13.24a/configure.ac Fri Oct 26 23:25:14 2001
***************
*** 37,42 ****
--- 37,43 ----
AM_C_PROTOTYPES
AC_C_CONST
AC_C_INLINE
+ AM_PROG_LIBTOOL
# getdate.y works with bison only.
YACC=${YACC-'bison -y'}
With this patch,
export CPPFLAGS=-I/tmp/prefix/include LDFLAGS=-L/tmp/prefix/lib
mkdir /tmp/prefix
libiconv-1.7:
./configure --prefix=/tmp/prefix
make
make install
gettext-0.10.40:
./configure --prefix=/tmp/prefix
make
make install
tar-1.13.24:
./configure --prefix=/tmp/prefix
make
make install
$ ldd /tmp/prefix/bin/tar
libiconv.so.2 => /tmp/prefix/lib/libiconv.so.2 (0x40015000)
libc.so.6 => /lib/libc.so.6 (0x400ef000)
/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)
i.e. the installed program is runnable without LD_LIBRARY_PATH and/or
/etc/ld.so.conf tweaking.
> This might be a problem in tar/m4/gettext.m4
Indeed I'm now considering whether I should add AM_PROG_LIBTOOL to
gettext.m4, thus forcing every package using libintl to also use
libtool.
Bruno