autoconf
[Top][All Lists]
Advanced

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

Re: conditional use of PKG_CHECK_MODULES, along with platforms that don'


From: Pete Batard
Subject: Re: conditional use of PKG_CHECK_MODULES, along with platforms that don't have pkg-config
Date: Tue, 21 Sep 2010 19:46:26 +0100
User-agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-GB; rv:1.9.2.9) Gecko/20100915 Thunderbird/3.1.4

Hi Eric,

On 2010.09.21 19:06, Eric Blake wrote:
Are you are trying to target development on these two machines (where
both Linux and mingw users run autoreconf, and you don't want autoreconf
to fail if PKG_CHECK_MODULES is used but pkg-config is not installed),
or are you targeting the end-user (where as long as the code for
PKG_CHECK_MODULES is never reached, it shouldn't matter if the end user
doesn't have pkg-config installed)?

I guess that would be development on the 2 machines. If you want some background, this configure.ac [1] is to be used in the libusb project [2], where we are in the process of adding hotplug support for Linux, Mac and Windows. On Linux platforms, hotplug comes from libudev, so we thought we'd use PKG_CHECK_MODULES to sort everything out with little effort, whereas on Mac and Windows, no additional libraries are needed and we typically expect users not to have pkg-config installed.

Insufficient m4 quoting. Get in the habit of using proper quotation, so
you can avoid subtle bugs later:

Good point. Will fix that.

Can
you instead write your tests using AC_SEARCH_LIBS, to see if libudev is
available (whether or not you are on Linux or mingw)?

Yes, that's the fallback option. We have some developers on our end who are very positive about pkg-config simplifying the dependency issue, so it seemed like a sensible approach on Linux.

Not being entirely familiar with the guts of PKG_CHECK_MODULES, what
exactly is it doing wrong on mingw that you are trying to avoid?

Well, on MinGW, because pkg-config is not supposed to be available, and we don't require additional libraries for hotplug, there is little point of using PKG_CHECK_MODULES.

If your problem is only one at autoreconf (that is, you are targeting
mingw development), you are free to ship additional m4 files in your
tarball, including the pkg-config.m4 file from pkg-config. True, that
means that you are introducing a potential version skew issue if your
package bundled an older version of that file than what would be on the
developer's machine when pkg-config is installed, but it means that the
macro is always available for developers.

That's an idea. We'll look into that.

Regards,

/Pete

[1] http://git.libusb.org/?p=libusb-pbatard.git;a=blob;f=configure.ac
[2] http://libusb.org/



reply via email to

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