bug-libtool
[Top][All Lists]
Advanced

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

libtool removes library variants if the name contains a dot


From: Martin Bravenboer
Subject: libtool removes library variants if the name contains a dot
Date: Sun, 04 Jul 2004 16:00:40 +0200
User-agent: Mozilla Thunderbird 0.6 (X11/20040502)

Hi,

I've found a problem in Libtool 1.5.6 (previous versions will probably be affected as well). The problem is related to
http://lists.gnu.org/archive/html/bug-libtool/2003-11/msg00025.html .

The package that I've just converted to libtool builds several alternatives of the same of the same library: .opt.la, .prof.la and .dbg.la.

Reduced Makefile.am:
-------------------------------------------------------
AM_CFLAGS   = -Wall
AM_LDFLAGS  = -avoid-version

pkglib_LTLIBRARIES = \
  libstratego.la \
  libstratego.prof.la

LIB_SOURCES = ....

libstratego_la_SOURCES      = $(LIB_SOURCES)
libstratego_prof_la_SOURCES = $(LIB_SOURCES)
-------------------------------------------------------
(complete Makefile.am available at
https://svn.cs.uu.nl:12443/repos/StrategoXT/trunk/StrategoXT/srts/src/Makefile.am )

The two dots in the library name 'libstratego.prof.la' cause the problem.

After a succesful build the subdirectory .libs contains:
-------------------------------------------------------
libstratego.so
libstratego.opt.so
-------------------------------------------------------

Now I remove libstratego.la and rebuild
-------------------------------------------------------
> rm libstratego.la
> make libstratego.la

bin/sh ../libtool --mode=link gcc -Wall -g -O2 -avoid-version -o libstratego.la -rpath /pkg/strategoxt/2004-07-04-09-47/lib/srts stratego.lo aterm-extension.lo debug.lo mprotect.lo

rm -fr .libs/libstratego.a .libs/libstratego.la .libs/libstratego.lai .libs/libstratego.opt.a .libs/libstratego.opt.la .libs/libstratego.opt.lai .libs/libstratego.opt.so .libs/libstratego.so
....
-------------------------------------------------------

Notice the libstratego.opt.so in the rm command. It is removed and not recreated.

The problem is this piece of code in the libtool script:

-------------------------------------------------------
$output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
       if test "X$precious_files_regex" != "X"; then
         if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
         then
           continue
         fi
       fi
       removelist="$removelist $p"
       ;;
    *) ;;
-------------------------------------------------------

$output_objdir/$libname.* will also match libstratego.opt.so and therefore it will be removed.

I know that I could solve this by defining a precious files regexp, but it would be a good idea to take somewhat more control over the files that are removed by libtool.

If this is not going to happen, then this restriction of the name of a library should be documented somewhere, since this problem is rather difficult to find.

Cheers,
--
Martin Bravenboer
---------------------------------------------------------------------
Center for Software Technology
Institute of Information and Computing Sciences
Utrecht University

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]