Re: libtool libraries requiring other libraries

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

 



Steffen,

I would suggest asking questions about Libtool on a libtool mailing list.

That said - It looks to me like you're not *using* libtool to do your linking.
Libtool's la files contain all the dependencies that a library needs.
This is a big help when using static archives because they need
to have everything listed in the proper order on the link line.
If you add

LT_INIT

to configure.ac your problem should go away.

HTH,

Robert Boehne

On 07/16/13 09:56, Steffen Sledz wrote:
Sorry, if this is a faq, but i didn't found a clear answer searching around.

Given situation: We have a library called e.g. libfoo which uses e.g. mq_open from librt. Than we have a program e.g. called progbar which requires libfoo (and therefor also librt).

Our current solution looks like this, but it does not work, because linking progbar is missing the -lrt option.

progbar/configure.ac:
---------------------> snip <---------------------
...
AC_CHECK_LIB([rt], [mq_open], [], [ AC_MSG_ERROR([*** Could not find librt ***]) ])
...
if test -n "$with_libfoo_path" ; then
       FOO_LDFLAGS="-L$with_libfoo_path/lib -lfoo"
       FOO_CPPFLAGS="-I$with_libfoo_path/include"
else
       AC_CHECK_LIB([foo], [foo_init], [], [ AC_MSG_ERROR([*** Could not find libfoo, use --with-libfoo-path option ***]) ], [-lrt])
fi
AC_SUBST(FOO_LDFLAGS)
AC_SUBST(FOO_CPPFLAGS)
...
---------------------> snap <---------------------

progbar/src/Makefile.am:
---------------------> snip <---------------------
bin_PROGRAM = progbar
...
progbar_CPPFLAGS = $(FOO_CPPFLAGS)
progbar_LDFLAGS = $(FOO_LDFLAGS)
...
---------------------> snap <---------------------

Where do we have to make which checks?

Do we need a check for librt in the libfoo package?

Do we have to mention the librt link option somewhere in the progbar package?

Thx for any help,
Steffen

PS: FUP set to <autoconf@xxxxxxx>


_______________________________________________
Autoconf mailing list
Autoconf@xxxxxxx
https://lists.gnu.org/mailman/listinfo/autoconf




[Index of Archives]     [GCC Help]     [Kernel Discussion]     [RPM Discussion]     [Red Hat Development]     [Yosemite News]     [Linux USB]     [Samba]

  Powered by Linux