From e1565a0ea91cdc31394183953811653506e2e15f Mon Sep 17 00:00:00 2001 From: Ruben Kerkhof Date: Sun, 24 Jul 2016 16:43:30 +0200 Subject: [PATCH] configure.ac: always use pkg-config to detect hal Hal needs dbus, but we need pkg-config to tell us that. Now that pkg-config is not optional anymore, rewrite the check to always use it. Also add a check for the header. Fixes building the uuid plugin on Solaris 11.3 --- configure.ac | 37 +++++++++++++++++++++++++------------ 1 file changed, 25 insertions(+), 12 deletions(-) diff --git a/configure.ac b/configure.ac index c69842cc..e3d09da6 100644 --- a/configure.ac +++ b/configure.ac @@ -1621,18 +1621,31 @@ AC_CHECK_LIB(resolv, res_search, AM_CONDITIONAL(BUILD_WITH_LIBRESOLV, test "x$with_libresolv" = "xyes") dnl Check for HAL (hardware abstraction library) -with_libhal="yes" -AC_CHECK_LIB(hal,libhal_device_property_exists, - [AC_DEFINE(HAVE_LIBHAL, 1, [Define to 1 if you have 'hal' library])], - [with_libhal="no"]) -if test "x$with_libhal" = "xyes"; then - if test "x$PKG_CONFIG" != "x"; then - BUILD_WITH_LIBHAL_CFLAGS="`$PKG_CONFIG --cflags hal`" - BUILD_WITH_LIBHAL_LIBS="`$PKG_CONFIG --libs hal`" - AC_SUBST(BUILD_WITH_LIBHAL_CFLAGS) - AC_SUBST(BUILD_WITH_LIBHAL_LIBS) - fi -fi +with_libhal="no" +PKG_CHECK_MODULES([HAL], [hal], + [ + SAVE_LIBS="$LIBS" + LIBS="$HAL_LIBS $LIBS" + AC_CHECK_LIB([hal], [libhal_device_property_exists], + [ + SAVE_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$HAL_CFLAGS $CPPFLAGS" + AC_CHECK_HEADERS([libhal.h], + [ + with_libhal="yes" + BUILD_WITH_LIBHAL_CFLAGS="$HAL_CFLAGS" + BUILD_WITH_LIBHAL_LIBS="$HAL_LIBS" + ]) + CPPFLAGS="$SAVE_CPPFLAGS" + ], + [] + ) + LIBS="$SAVE_LIBS" + ] +) +AC_SUBST(BUILD_WITH_LIBHAL_CFLAGS) +AC_SUBST(BUILD_WITH_LIBHAL_LIBS) + SAVE_LIBS="$LIBS" AC_CHECK_LIB([pthread], -- 2.11.0