On Tue, 2013-10-08 at 19:14 -0700, Shriram Rajagopalan wrote:I think you are confused about what pkg-config and .pc files are.
>
> > +# 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.
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])Looks like PKG_CHECK_MODULES sets <PKG>_CFLAGS and _LDFLAGS.
> > + ],[
> > + 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.
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.