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


_______________________________________________
http://lists.gnu.org/mailman/listinfo/libtool

Reply via email to