libtool
[Top][All Lists]
Advanced

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

Re: using .la or .a when linking an executable ?


From: Ralf Wildenhues
Subject: Re: using .la or .a when linking an executable ?
Date: Mon, 29 Sep 2008 08:26:25 +0200
User-agent: Mutt/1.5.18 (2008-05-17)

Hello Vincent,

* Vincent Torri wrote on Sun, Sep 28, 2008 at 01:04:44PM CEST:
> eet_LDADD = $(top_builddir)/src/lib/libeet.la
>
> Hence when I call objdump -p on my eet binary, i get:
>
>   NEEDED      libeet.so.1
>   NEEDED      libz.so.1
>   NEEDED      libjpeg.so.62
>
> But a friend told me that the eet binary should not have libz and 
> libjpeg, only libeet.

On many modern systems it is not necessary to link against indirect
dependencies.

> 1) Is my friend right ?

Partly.

> 2) If he is right, what should I do to remove those "dependencies" ? 
> (flag to pass in a variable in my Makefile.am, or something like that)

You can pass -Wl,--as-needed when the linker is the GNU binutils one.
But beware that it may break things with some compilers (notably C++
ones), with some apps that do dlopen and expect dependencies to be
present, and did not work right in some older versions of ld.

> eet_LDADD = $(top_builddir)/src/lib/libeet.la
> eet_DEPENDENCIES = $(top_builddir)/src/lib/libeet.la

The last line is not needed, automake can infer that from the one above.

Cheers,
Ralf




reply via email to

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