[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
conditional use of PKG_CHECK_MODULES, along with platforms that don't ha
From: |
Pete Batard |
Subject: |
conditional use of PKG_CHECK_MODULES, along with platforms that don't have pkg-config |
Date: |
Tue, 21 Sep 2010 18:15:50 +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,
After reading from [1] & [2], it looks like the PKG_CHECK_MODULES()
macro cannot be used in conditionals, unless you actually have
pkg-config installed, as it unconditionally results in a pkg-config
related AC_REQUIRE.
I am however trying to create a configure.ac where PKG_CHECK_MODULES
could be used on platforms that typically have it (Linux), while ignored
on platforms that don't (MinGW). What I'm trying to achieve then is
something like:
AC_MSG_CHECKING([operating system])
case $host in
*-linux*)
AC_DEFINE(OS_LINUX, [], [Linux backend])
(...)
PKG_CHECK_MODULES(UDEV, libudev)
(...)
;;
*-mingw*)
AC_DEFINE(OS_WINDOWS, [], [Windows backend])
(...use non pkg-config equivalent library...)
;;
esac
Unless I'm missing something, what I read from [2] leads me to think
that neither case nor AS_CASE can be used to prevent the pkg-config
requirement, and indeed, I am getting an error with the above on MinGW.
This means that, the only possibility would be to either make pkg-config
a requirement for all platforms (inconvenient for users) or not use
PKG_CHECK_MODULES on platforms that have it.
Are there other options to use PKG_CHECK_MODULES conditionally?
I am using autoconf v2.65.
Regards,
/Pete
[1] http://www.mail-archive.com/address@hidden/msg14840.html
[2] http://www.mail-archive.com/address@hidden/msg16976.html
- conditional use of PKG_CHECK_MODULES, along with platforms that don't have pkg-config,
Pete Batard <=