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

Re: [Xen-devel] [PATCH 1 of 5 V2] remus: add libnl3 dependency to autoconf scripts



On Wed, Oct 9, 2013 at 1:06 AM, Ian Campbell <Ian.Campbell@xxxxxxxxxx> wrote:
On Tue, 2013-10-08 at 19:14 -0700, Shriram Rajagopalan wrote:

>
>         > +# Check for libnl3 >=3.2.8. If present enable remus network
>         buffering.
>         > +PKG_CHECK_EXISTS([libnl-3.0 >= 3.2.8 libnl-route-3.0 >=
>         3.2.8 libnl-cli-3.0 >= 3.2.8],
>         > +             [libnl3_lib="y"], [libnl3_lib="n"])
>         > +AC_CHECK_HEADER([netlink/route/qdisc/plug.h],
>         [libnl3_dev="y"], [libnl3_dev="n"])
>
>
>         Aren't these a bit redundant? i.e. doesn't PKG_CHECK_EXISTS
>         cover the development headers?

> Unfortunately, libnl3 does not have a pkgconfig .pc file for its dev
> headers. So there is no standard way to check for these headers.
> Debian has libnl-3-dev. OpenSUSE has libnl3-devel, etc.

I think you are confused about what pkg-config and .pc files are.

They are part of the "dev headers" and describe how to compile and link
against the library. You are entitled to assume that if pkg-config
returns that the pkg exists you can use it and link against it etc.

IOW the .pc file is exactly the standard way to check for these things.


I am a little confused. I do know that if pkg exists, then linking/compiling isn't an issue.

The issue with libnl3 is "compiling" - i.e., dev headers, that libxl uses to invoke libnl API.
There is no pkg-config module for libnl3 development headers (Just like the ones for 
libraries: libnl-3.0, libnl-route-3.0, etc) [see http://git.infradead.org/users/tgr/libnl.git/tree ]

It has package config files for libnl-3.0.pc (-lnl-3), libnl-route-3.0.pc (-lnl-route-3)
but none for dev headers.

Do they get installed along with the libraries ? Don't think so (atleast on debian & ubuntu).

root@localhost:~# apt-cache search libnl
libnl-3-200 - library for dealing with netlink sockets
libnl-3-dev - development library and headers for libnl-3
libnl-cli-3-200 - library for dealing with netlink sockets - cli helpers
libnl-cli-3-dev - development library and headers for libnl-cli-3
libnl-route-3-200 - library for dealing with netlink sockets - route interface
libnl-route-3-dev - development library and headers for libnl-route-3


So what do you suggest ?

>         > +         AC_SUBST(remus_netbuf, [n])
>         > +         ],[
>         > +         LIBNL3_LIBS="-lnl-3 -lnl-route-3"
>
>
>         Since libnl3 uses pkg-cofnig, these should come from there I
>         think.
>         There's probably a macro in pkg-config.m4 to help?

> None that I could find.

Looks like PKG_CHECK_MODULES sets <PKG>_CFLAGS and _LDFLAGS.

See
https://www.flameeyes.eu/autotools-mythbuster/pkgconfig/pkg_check_modules.html and https://developer.gnome.org/anjuta-build-tutorial/stable/library-autotools.html.en for info (first two hits on google for "pkg-config autoconf")

Ian.



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.