Hey,
On Thu, Sep 13, 2012 at 06:14:05AM -0600, Eric Blake wrote:
On 09/12/2012 10:46 PM, Osier Yang wrote:
> On 2012年09月11日 06:14, Eric Blake wrote:
>> Recent spec file changes ensure that in distro situations, netcf
>> and libvirt will link against the same libnl in order to avoid
>> dumping core. But for every-day development, if you are F17 and
>> have the libnl3-devel headers available, libvirt was blindly
>> linking against libnl3 even though F17 netcf still links against
>> libnl1, making testing a self-built binary on F17 impossible.
>> + case $libnl_ldd:${LIBNL_CFLAGS+set} in
>> + *libnl.so.1*:) ;;
>
> The typo ':', as the end of the pattern, causes build failure.
That is NOT a typo. The case statement is looking at: contents of
$libnl_ldd (which might be empty), followed by a literal :, followed by
the contenst of ${LIBNL_CFLAGS+set} (which will either be empty or the
literal string 'set'). We insist that $libnl_ldd contain libnl.so.1 and
that LIBNL_CFLAGS not be set before we hit this statement.
Unfortunately this bit of magic is currently not working as right above
this block LIBNL_CFLAGS is unconditionally set:
dnl netlink library
LIBNL_ROUTE3_CFLAGS=""
LIBNL_ROUTE3_LIBS=""
LIBNL_CFLAGS=""
LIBNL_LIBS=""
have_libnl=no
if test "$with_linux" = "yes"; then
# When linking with netcf, we must ensure that we pick the same version
# of libnl that netcf picked. Prefer libnl-3 unless we can prove
# netcf linked against libnl-1, or unless the user set LIBNL_CFLAGS.
# (Setting LIBNL_CFLAGS is already used by PKG_CHECK_MODULES to
# override any probing, so if it set, you know which libnl is in use.)
This causes libnl3 to be used on my f17 system where libnetcf is linked
with libnl1. If I'm not mistaken, the 4 lines setting LIBNL_* to "" can be
safely removed. I've checked that after this change my f17 box picks
libnl1.
Christophe