From: Duncan Mac-Vicar P Date: Thu, 26 May 2011 16:59:42 +0000 (+0200) Subject: That udev is there is not enough. Double check that udev has the right X-Git-Tag: 9.3.0~8 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0eb707d708643b1ae67a250ecc856b708987250d;p=platform%2Fupstream%2Flibzypp.git That udev is there is not enough. Double check that udev has the right APIs, if not, fallback to HAL. For the distro. Use udev only if suse_version >= 1130 --- diff --git a/cmake/modules/FindUdev.cmake b/cmake/modules/FindUdev.cmake index 25ca80c5f..afc285436 100644 --- a/cmake/modules/FindUdev.cmake +++ b/cmake/modules/FindUdev.cmake @@ -13,5 +13,11 @@ FIND_LIBRARY( UDEV_LIBRARY NAMES udev /usr/local/lib ) -FIND_PACKAGE_HANDLE_STANDARD_ARGS( Udev DEFAULT_MSG UDEV_LIBRARY UDEV_INCLUDE_DIR ) +# check if udev is usable for us +INCLUDE (CheckSymbolExists) +SET(CMAKE_REQUIRED_LIBRARIES udev) +CHECK_SYMBOL_EXISTS(udev_enumerate_new libudev.h USABLE_UDEV) +SET(CMAKE_REQUIRED_LIBRARIES "") + +FIND_PACKAGE_HANDLE_STANDARD_ARGS( Udev DEFAULT_MSG UDEV_LIBRARY UDEV_INCLUDE_DIR USABLE_UDEV) MARK_AS_ADVANCED( UDEV_LIBRARY UDEV_INCLUDE_DIR ) diff --git a/libzypp.spec.cmake b/libzypp.spec.cmake index 8c73e653f..80583897c 100644 --- a/libzypp.spec.cmake +++ b/libzypp.spec.cmake @@ -26,7 +26,11 @@ Recommends: logrotate %endif BuildRequires: cmake BuildRequires: openssl-devel +%if 0%{?suse_version} >= 1130 BuildRequires: libudev-devel +%else +BuildRequires: hal-devel +%endif BuildRequires: boost-devel BuildRequires: dejagnu BuildRequires: doxygen @@ -143,7 +147,11 @@ Requires: bzip2 Requires: popt-devel Requires: boost-devel Requires: libstdc++-devel +%if 0%{?suse_version} >= 1130 Requires: libudev-devel +%else +Requires: hal-devel +%endif Requires: cmake %if 0%{?suse_version} %if 0%{?suse_version} >= 1100