conditional use of PKG_CHECK_MODULES, along with platforms that don't have pkg-config

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

 



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/autoconf@xxxxxxx/msg14840.html
[2] http://www.mail-archive.com/autoconf@xxxxxxx/msg16976.html

_______________________________________________
Autoconf mailing list
Autoconf@xxxxxxx
http://lists.gnu.org/mailman/listinfo/autoconf


[Index of Archives]     [GCC Help]     [Kernel Discussion]     [RPM Discussion]     [Red Hat Development]     [Yosemite News]     [Linux USB]     [Samba]

  Powered by Linux