[Top][All Lists]

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

Re: static lib with libtool 1.5

From: Ralf Wildenhues
Subject: Re: static lib with libtool 1.5
Date: Tue, 28 Jun 2005 18:40:55 +0200
User-agent: Mutt/1.4.1i

Hi Jeremie,

* Jeremie LE HEN wrote on Tue, Jun 28, 2005 at 05:14:14PM CEST:
> > > I'm trying to build both a static and a shared library.  This used to
> > > work fine with libtool-1.4, but since I upgraded to libtool-1.5, I can't
> > > build a static library any more.  I gave a try to the Changelog, but it
> > > is too heavy, IMO.

> I'm sure it possible and I'm currently missing something.  I don't use
> autotools, I just use libtool manually, as explained in the
> documentation.

OK.  New set of questions, then.  :)

> I attached my Makefile, I hope this mailing-list doesn't get rid of
> MIME attachement.

Nope, that's fine.

> Here is the output with libtool-1.4.3 :
> As you can see, no command is issued when I'm trying to build
> libsitalibs.a with libtool-1.5.6.  (Note that I have recently added the
> "-static" argument, while trying to make libtool-1.5 behave correctly).

First, a note to your Makefile:

| ${LIB_A}:       ${OBJS_A}
|         libtool --mode=link ${CC} -o $@ $^ -static
| # -rpath is mandatory, libtool --mode=install will fail otherwise.
| ${LIB_SO}:      ${OBJS_SO}
|         libtool --mode=link ${CC} -o $@ $^ -version-number ${VERSION} -rpath 

You don't need both of these rules.  As the output from 1.4 shows, the
second one builds both static and shared libraries.
I would write like this (modulo naming):

| LIBTOOL = libtool
| $(OBJS_LA)
|         $(LIBTOOL) $(LIBTOOLFLAGS) --mode=link $(CC) -o $@ $^ -version-number 
${VERSION} -rpath /usr/lib

You should really omit $(DESTDIR) in -rpath here (but not in the install

I'd also write

| clean:
|        $(LIBTOOL) --mode=clean /bin/rm $(OBJS_SO)

which should remove all your built objects

Now back to the problem: Show

$ libtool --config 
$ libtool --features

for both versions.  Next question might be that I'd like you to try
1.5.18, in order to prevent any known regressions from skewing what we
see here (unless it's obvious from above output what's happening here).
If you do build 1.5.18 yourself, show output of its configure run plus
config.log as well.


reply via email to

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