]> www.infradead.org Git - users/dwmw2/qemu.git/commitdiff
iscsi: look for pkg-config file too
authorPaolo Bonzini <pbonzini@redhat.com>
Fri, 22 Feb 2013 17:14:28 +0000 (18:14 +0100)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Tue, 2 Apr 2013 15:52:33 +0000 (10:52 -0500)
Due to library conflicts, Fedora will have to put libiscsi in
/usr/lib/iscsi.  Simplify configuration by using a pkg-config
file.  The Fedora package will distribute one, and the patch
to add it has been sent to upstream libiscsi as well.

Cc: qemu-stable@nongnu.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
(cherry picked from commit 3c33ea9640758bb625e110a77673e5abfd184e54)

Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
configure

index 8789324a9b36d943583e0d053d2e1bddb834550f..5fb388a4fd25f29deeb1c1e065c9a1b4cf306860 100755 (executable)
--- a/configure
+++ b/configure
@@ -2759,7 +2759,13 @@ if test "$libiscsi" != "no" ; then
 #include <iscsi/iscsi.h>
 int main(void) { iscsi_unmap_sync(NULL,0,0,0,NULL,0); return 0; }
 EOF
-  if compile_prog "" "-liscsi" ; then
+  if $pkg_config --atleast-version=1.7.0 libiscsi --modversion >/dev/null 2>&1; then
+    libiscsi="yes"
+    libiscsi_cflags=$($pkg_config --cflags libiscsi 2>/dev/null)
+    libiscsi_libs=$($pkg_config --libs libiscsi 2>/dev/null)
+    CFLAGS="$CFLAGS $libiscsi_cflags"
+    LIBS="$LIBS $libiscsi_libs"
+  elif compile_prog "" "-liscsi" ; then
     libiscsi="yes"
     LIBS="$LIBS -liscsi"
   else