From: Ian Campbell Subject: Re: [PATCH 1 of 5 V2] remus: add libnl3 dependency to autoconf scripts Date: Wed, 9 Oct 2013 09:06:54 +0100 Message-ID: <1381306014.9920.18.camel@kazak.uk.xensource.com> References: <1378302026.17510.124.camel@kazak.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: rshriram@cs.ubc.ca Cc: Andrew Cooper , Stefano Stabellini , Ian Jackson , "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org 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. > > + 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 _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.