[libvirt] [PATCH 1/2] Remove obsolte devicekit checks

Device kit support was removed, but the configure.ac checks were left in place. A number of the XXX_REQUIRED=X.Y.Z variables were not declared in the correct location (ie top of the file) * configure.in: Remove device kit checks & move mis-placed variables to correct location --- configure.in | 66 +++++---------------------------------------------------- 1 files changed, 6 insertions(+), 60 deletions(-) diff --git a/configure.in b/configure.in index df8eba2..1c705b2 100644 --- a/configure.in +++ b/configure.in @@ -34,6 +34,12 @@ AVAHI_REQUIRED="0.6.0" POLKIT_REQUIRED="0.6" PARTED_REQUIRED="1.8.0" NETCF_REQUIRED="0.1.3" +UDEV_REQUIRED=145 +PCIACCESS_REQUIRED=0.10.0 +XMLRPC_REQUIRED=1.14.0 +HAL_REQUIRED=0.5.0 +DEVMAPPER_REQUIRED=1.0.0 +LIBCURL_REQUIRED="7.18.0" dnl Checks for C compiler. AC_PROG_CC @@ -472,8 +478,6 @@ PKG_PROG_PKG_CONFIG dnl OpenNebula driver Compilation setting dnl -XMLRPC_REQUIRED=1.14.0 - XMLRPC_CFLAGS= XMLRPC_LIBS= if test "x$with_one" = "xyes" -o "x$with_one" = "xcheck"; then @@ -1304,7 +1308,6 @@ fi AM_CONDITIONAL([WITH_STORAGE_MPATH], [test "$with_storage_mpath" = "yes"]) if test "$with_storage_mpath" = "yes"; then - DEVMAPPER_REQUIRED=0.0 DEVMAPPER_CFLAGS= DEVMAPPER_LIBS= PKG_CHECK_MODULES([DEVMAPPER], [devmapper >= $DEVMAPPER_REQUIRED], [], [DEVMAPPER_FOUND=no]) @@ -1379,7 +1382,6 @@ dnl LIBCURL_CFLAGS="" LIBCURL_LIBS="" -LIBCURL_REQUIRED="7.18.0" LIBCURL_FOUND="no" if test "$with_esx" = "yes" -o "$with_esx" = "check"; then @@ -1655,7 +1657,6 @@ LV_LIBTOOL_OBJDIR=${lt_cv_objdir-.} AC_SUBST([LV_LIBTOOL_OBJDIR]) dnl HAL, DeviceKit, or libudev library for host device enumeration -HAL_REQUIRED=0.0 HAL_CFLAGS= HAL_LIBS= AC_ARG_WITH([hal], @@ -1694,61 +1695,7 @@ AM_CONDITIONAL([HAVE_HAL], [test "x$with_hal" = "xyes"]) AC_SUBST([HAL_CFLAGS]) AC_SUBST([HAL_LIBS]) -DEVKIT_REQUIRED=0.0 -DEVKIT_CFLAGS= -DEVKIT_LIBS= -AC_ARG_WITH([devkit], - [ --with-devkit use DeviceKit for host device enumeration], - [], - [with_devkit=no]) -if test "$with_libvirtd" = "no" ; then - with_devkit=no -fi - -dnl Extra check needed while devkit pkg-config info missing glib2 dependency -PKG_CHECK_MODULES(GLIB2, glib-2.0 >= 0.0,,[ - if test "x$with_devkit" = "xcheck"; then - with_devkit=no - elif test "x$with_devkit" = "xyes"; then - AC_MSG_ERROR([required package DeviceKit requires package glib-2.0]) - fi]) - -if test "x$with_devkit" = "xyes" -o "x$with_devkit" = "xcheck"; then - PKG_CHECK_MODULES(DEVKIT, devkit-gobject >= $DEVKIT_REQUIRED, - [with_devkit=yes], [ - if test "x$with_devkit" = "xcheck" ; then - with_devkit=no - else - AC_MSG_ERROR( - [You must install DeviceKit-devel >= $DEVKIT_REQUIRED to compile libvirt]) - fi - ]) - if test "x$with_devkit" = "xyes" ; then - AC_DEFINE_UNQUOTED([HAVE_DEVKIT], 1, - [use DeviceKit for host device enumeration]) - - dnl Add glib2 flags explicitly while devkit pkg-config info missing glib2 dependency - DEVKIT_CFLAGS="$GLIB2_CFLAGS $DEVKIT_CFLAGS" - DEVKIT_LIBS="$GLIB2_LIBS $DEVKIT_LIBS" - - dnl Add more flags apparently required for devkit to work properly - DEVKIT_CFLAGS="$DEVKIT_CFLAGS -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT" - - old_CFLAGS=$CFLAGS - old_LDFLAGS=$LDFLAGS - CFLAGS="$CFLAGS $DEVKIT_CFLAGS" - LDFLAGS="$LDFLAGS $DEVKIT_LIBS" - AC_CHECK_FUNCS([devkit_client_connect],,[with_devkit=no]) - CFLAGS="$old_CFLAGS" - LDFLAGS="$old_LDFLAGS" - fi -fi -AM_CONDITIONAL([HAVE_DEVKIT], [test "x$with_devkit" = "xyes"]) -AC_SUBST([DEVKIT_CFLAGS]) -AC_SUBST([DEVKIT_LIBS]) - -UDEV_REQUIRED=145 UDEV_CFLAGS= UDEV_LIBS= AC_ARG_WITH([udev], @@ -1781,7 +1728,6 @@ if test "x$with_udev" = "xyes" -o "x$with_udev" = "xcheck"; then CFLAGS="$old_CFLAGS" LDFLAGS="$old_LDFLAGS" fi - PCIACCESS_REQUIRED=0.10.0 PCIACCESS_CFLAGS= PCIACCESS_LIBS= PKG_CHECK_MODULES([PCIACCESS], [pciaccess >= $PCIACCESS_REQUIRED], [], [PCIACCESS_FOUND=no]) -- 1.6.2.5

If 'with_udev=check' then missing pciaccess should not be a fatal error. It should merely disable the udev driver. * configure.in: Fix pciaccess check to be non-fatal --- configure.in | 33 +++++++++++++++++---------------- 1 files changed, 17 insertions(+), 16 deletions(-) diff --git a/configure.in b/configure.in index 1c705b2..760369c 100644 --- a/configure.in +++ b/configure.in @@ -1656,7 +1656,7 @@ test "$enable_shared" = no && lt_cv_objdir=. LV_LIBTOOL_OBJDIR=${lt_cv_objdir-.} AC_SUBST([LV_LIBTOOL_OBJDIR]) -dnl HAL, DeviceKit, or libudev library for host device enumeration +dnl HAL library check for host device enumeration HAL_CFLAGS= HAL_LIBS= AC_ARG_WITH([hal], @@ -1696,8 +1696,11 @@ AC_SUBST([HAL_CFLAGS]) AC_SUBST([HAL_LIBS]) +dnl udev/libpciaccess library check for alternate host device enumeration UDEV_CFLAGS= UDEV_LIBS= +PCIACCESS_CFLAGS= +PCIACCESS_LIBS= AC_ARG_WITH([udev], [ --with-udev use libudev for host device enumeration], [], @@ -1708,7 +1711,7 @@ if test "$with_libvirtd" = "no" ; then fi if test "x$with_udev" = "xyes" -o "x$with_udev" = "xcheck"; then PKG_CHECK_MODULES(UDEV, libudev >= $UDEV_REQUIRED, - [with_udev=yes], [ + [], [ if test "x$with_udev" = "xcheck" ; then with_udev=no else @@ -1716,24 +1719,22 @@ if test "x$with_udev" = "xyes" -o "x$with_udev" = "xcheck"; then [You must install libudev-devel >= $UDEV_REQUIRED to compile libvirt]) fi ]) + if test "x$with_udev" != "xno"; then + PKG_CHECK_MODULES(PCIACCESS, pciaccess >= $PCIACCESS_REQUIRED, + [with_udev=yes], + [ + if test "x$with_udev" = "xcheck" ; then + with_udev=no + else + AC_MSG_ERROR( + [You must install libpciaccess-devel >= $PCIACCESS_REQUIRED to compile libvirt]) + fi + ]) + fi if test "x$with_udev" = "xyes" ; then AC_DEFINE_UNQUOTED([HAVE_UDEV], 1, [use UDEV for host device enumeration]) - - old_CFLAGS=$CFLAGS - old_LDFLAGS=$LDFLAGS - CFLAGS="$CFLAGS $UDEV_CFLAGS" - LDFLAGS="$LDFLAGS $UDEV_LIBS" - AC_CHECK_FUNCS([udev_new],,[with_udev=no]) - CFLAGS="$old_CFLAGS" - LDFLAGS="$old_LDFLAGS" fi - PCIACCESS_CFLAGS= - PCIACCESS_LIBS= - PKG_CHECK_MODULES([PCIACCESS], [pciaccess >= $PCIACCESS_REQUIRED], [], [PCIACCESS_FOUND=no]) - if test "$PCIACCESS_FOUND" = "no" ; then - AC_MSG_ERROR([You must install libpciaccess/libpciaccess-devel >= $PCIACCESS_REQUIRED to compile libvirt]) - fi fi AM_CONDITIONAL([HAVE_UDEV], [test "x$with_udev" = "xyes"]) AC_SUBST([UDEV_CFLAGS]) -- 1.6.2.5

On Fri, Nov 13, 2009 at 12:20:07PM +0000, Daniel P. Berrange wrote:
If 'with_udev=check' then missing pciaccess should not be a fatal error. It should merely disable the udev driver.
* configure.in: Fix pciaccess check to be non-fatal --- configure.in | 33 +++++++++++++++++---------------- 1 files changed, 17 insertions(+), 16 deletions(-)
diff --git a/configure.in b/configure.in index 1c705b2..760369c 100644 --- a/configure.in +++ b/configure.in @@ -1656,7 +1656,7 @@ test "$enable_shared" = no && lt_cv_objdir=. LV_LIBTOOL_OBJDIR=${lt_cv_objdir-.} AC_SUBST([LV_LIBTOOL_OBJDIR])
-dnl HAL, DeviceKit, or libudev library for host device enumeration +dnl HAL library check for host device enumeration HAL_CFLAGS= HAL_LIBS= AC_ARG_WITH([hal], @@ -1696,8 +1696,11 @@ AC_SUBST([HAL_CFLAGS]) AC_SUBST([HAL_LIBS])
+dnl udev/libpciaccess library check for alternate host device enumeration UDEV_CFLAGS= UDEV_LIBS= +PCIACCESS_CFLAGS= +PCIACCESS_LIBS= AC_ARG_WITH([udev], [ --with-udev use libudev for host device enumeration], [], @@ -1708,7 +1711,7 @@ if test "$with_libvirtd" = "no" ; then fi if test "x$with_udev" = "xyes" -o "x$with_udev" = "xcheck"; then PKG_CHECK_MODULES(UDEV, libudev >= $UDEV_REQUIRED, - [with_udev=yes], [ + [], [ if test "x$with_udev" = "xcheck" ; then with_udev=no else @@ -1716,24 +1719,22 @@ if test "x$with_udev" = "xyes" -o "x$with_udev" = "xcheck"; then [You must install libudev-devel >= $UDEV_REQUIRED to compile libvirt]) fi ]) + if test "x$with_udev" != "xno"; then + PKG_CHECK_MODULES(PCIACCESS, pciaccess >= $PCIACCESS_REQUIRED, + [with_udev=yes], + [ + if test "x$with_udev" = "xcheck" ; then + with_udev=no + else + AC_MSG_ERROR( + [You must install libpciaccess-devel >= $PCIACCESS_REQUIRED to compile libvirt]) + fi + ]) + fi if test "x$with_udev" = "xyes" ; then AC_DEFINE_UNQUOTED([HAVE_UDEV], 1, [use UDEV for host device enumeration]) - - old_CFLAGS=$CFLAGS - old_LDFLAGS=$LDFLAGS - CFLAGS="$CFLAGS $UDEV_CFLAGS" - LDFLAGS="$LDFLAGS $UDEV_LIBS" - AC_CHECK_FUNCS([udev_new],,[with_udev=no]) - CFLAGS="$old_CFLAGS" - LDFLAGS="$old_LDFLAGS" fi - PCIACCESS_CFLAGS= - PCIACCESS_LIBS= - PKG_CHECK_MODULES([PCIACCESS], [pciaccess >= $PCIACCESS_REQUIRED], [], [PCIACCESS_FOUND=no]) - if test "$PCIACCESS_FOUND" = "no" ; then - AC_MSG_ERROR([You must install libpciaccess/libpciaccess-devel >= $PCIACCESS_REQUIRED to compile libvirt]) - fi fi AM_CONDITIONAL([HAVE_UDEV], [test "x$with_udev" = "xyes"]) AC_SUBST([UDEV_CFLAGS])
ACK, this also cleans up some of the comments ... We will have to give a bit of love to the spec file too Daniel -- Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/ daniel@veillard.com | Rpmfind RPM search engine http://rpmfind.net/ http://veillard.com/ | virtualization library http://libvirt.org/

On Fri, Nov 13, 2009 at 12:20:06PM +0000, Daniel P. Berrange wrote:
Device kit support was removed, but the configure.ac checks were left in place. A number of the XXX_REQUIRED=X.Y.Z variables were not declared in the correct location (ie top of the file)
* configure.in: Remove device kit checks & move mis-placed variables to correct location
ACK ! Daniel -- Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/ daniel@veillard.com | Rpmfind RPM search engine http://rpmfind.net/ http://veillard.com/ | virtualization library http://libvirt.org/
participants (2)
-
Daniel P. Berrange
-
Daniel Veillard