autoconf
[Top][All Lists]
Advanced

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

libtool libraries requiring other libraries


From: Steffen Sledz
Subject: libtool libraries requiring other libraries
Date: Tue, 16 Jul 2013 16:56:05 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130620 Thunderbird/17.0.7

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 <address@hidden>



reply via email to

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