yeahuh / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone
ae23c9
From 1adffaf59f8b1a62353a009ac62aef8172514e2c Mon Sep 17 00:00:00 2001
ae23c9
From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= <marcandre.lureau@redhat.com>
ae23c9
Date: Sun, 4 Nov 2018 15:45:26 +0000
ae23c9
Subject: [PATCH 01/35] configure: add test for libudev
ae23c9
MIME-Version: 1.0
ae23c9
Content-Type: text/plain; charset=UTF-8
ae23c9
Content-Transfer-Encoding: 8bit
ae23c9
ae23c9
RH-Author: Marc-André Lureau <marcandre.lureau@redhat.com>
ae23c9
Message-id: <20181104154528.19241-2-marcandre.lureau@redhat.com>
ae23c9
Patchwork-id: 82925
ae23c9
O-Subject: [RHEL8/rhel qemu-kvm PATCH 1/3] configure: add test for libudev
ae23c9
Bugzilla: 1636185
ae23c9
RH-Acked-by: Laurent Vivier <lvivier@redhat.com>
ae23c9
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
ae23c9
RH-Acked-by: Markus Armbruster <armbru@redhat.com>
ae23c9
ae23c9
From: Tomáš Golembiovský <tgolembi@redhat.com>
ae23c9
ae23c9
Signed-off-by: Tomáš Golembiovský <tgolembi@redhat.com>
ae23c9
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
ae23c9
*make libudev optional to avoid breaking existing build/test environments
ae23c9
*disable libudev for --static builds
ae23c9
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
ae23c9
ae23c9
BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1636185
ae23c9
ae23c9
(cherry picked from commit 3efac6ebb88e4d099f07fef65178ebaa595ae770)
ae23c9
ae23c9
[ fix conflicts due to extra configure checks for pmem & cross upstream ]
ae23c9
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
ae23c9
ae23c9
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
ae23c9
---
ae23c9
 configure | 19 +++++++++++++++++++
ae23c9
 1 file changed, 19 insertions(+)
ae23c9
ae23c9
diff --git a/configure b/configure
ae23c9
index efd9eb6..0cb2b79 100755
ae23c9
--- a/configure
ae23c9
+++ b/configure
ae23c9
@@ -451,6 +451,7 @@ jemalloc="no"
ae23c9
 replication="yes"
ae23c9
 vxhs=""
ae23c9
 libxml2=""
ae23c9
+libudev="no"
ae23c9
 
ae23c9
 supported_cpu="no"
ae23c9
 supported_os="no"
ae23c9
@@ -819,6 +820,7 @@ Linux)
ae23c9
   vhost_vsock="yes"
ae23c9
   QEMU_INCLUDES="-I\$(SRC_PATH)/linux-headers -I$(pwd)/linux-headers $QEMU_INCLUDES"
ae23c9
   supported_os="yes"
ae23c9
+  libudev="yes"
ae23c9
 ;;
ae23c9
 esac
ae23c9
 
ae23c9
@@ -5440,6 +5442,17 @@ if test "$libnfs" != "no" ; then
ae23c9
   fi
ae23c9
 fi
ae23c9
 
ae23c9
+##########################################
ae23c9
+# Do we have libudev
ae23c9
+if test "$libudev" != "no" ; then
ae23c9
+  if $pkg_config libudev && test "$static" != "yes"; then
ae23c9
+    libudev="yes"
ae23c9
+    libudev_libs=$($pkg_config --libs libudev)
ae23c9
+  else
ae23c9
+    libudev="no"
ae23c9
+  fi
ae23c9
+fi
ae23c9
+
ae23c9
 # Now we've finished running tests it's OK to add -Werror to the compiler flags
ae23c9
 if test "$werror" = "yes"; then
ae23c9
     QEMU_CFLAGS="-Werror $QEMU_CFLAGS"
ae23c9
@@ -5858,6 +5871,7 @@ echo "avx2 optimization $avx2_opt"
ae23c9
 echo "replication support $replication"
ae23c9
 echo "VxHS block device $vxhs"
ae23c9
 echo "capstone          $capstone"
ae23c9
+echo "libudev           $libudev"
ae23c9
 
ae23c9
 if test "$sdl_too_old" = "yes"; then
ae23c9
 echo "-> Your SDL version is too old - please upgrade to have SDL support"
ae23c9
@@ -6684,6 +6698,11 @@ if test "$gcov" = "yes" ; then
ae23c9
   echo "GCOV=$gcov_tool" >> $config_host_mak
ae23c9
 fi
ae23c9
 
ae23c9
+if test "$libudev" != "no"; then
ae23c9
+    echo "CONFIG_LIBUDEV=y" >> $config_host_mak
ae23c9
+    echo "LIBUDEV_LIBS=$libudev_libs" >> $config_host_mak
ae23c9
+fi
ae23c9
+
ae23c9
 # use included Linux headers
ae23c9
 if test "$linux" = "yes" ; then
ae23c9
   mkdir -p linux-headers
ae23c9
-- 
ae23c9
1.8.3.1
ae23c9