]> xenbits.xensource.com Git - xen.git/commitdiff
[VTD] dynamically determines whether to link with libpci or not in QEMU.
authorKeir Fraser <keir@xensource.com>
Thu, 20 Sep 2007 08:40:49 +0000 (09:40 +0100)
committerKeir Fraser <keir@xensource.com>
Thu, 20 Sep 2007 08:40:49 +0000 (09:40 +0100)
This patch to ioemu/Makefile.target dynamically decides whether to
link with libpci or not base on the existence of /usr/include/pci
directory.

If /usr/include/pci exists, PCI passthrough is enabled.  Otherwise, it
is disabled.

Signed-off-by: Allen Kay <allen.m.kay@intel.com>
tools/ioemu/Makefile.target

index d0a8162507d877db7087091441599d86186c9f04..5f1af2fabdb072a367f09146fd014827f339feb0 100644 (file)
@@ -197,9 +197,6 @@ CPPFLAGS+=-D_GNU_SOURCE
 LIBS+=-lm
 LIBS+=-L../../libxc -lxenctrl -lxenguest
 LIBS+=-L../../xenstore -lxenstore
-ifdef CONFIG_PASSTHROUGH
-LIBS+=-lpci
-endif
 ifndef CONFIG_USER_ONLY
 LIBS+=-lz
 endif
@@ -351,6 +348,16 @@ ifdef CONFIG_WIN32
 VL_OBJS+=tap-win32.o
 endif
 
+ifeq (,$(wildcard /usr/include/pci))
+$(warning *** pciutils-devl package not found - missing /usr/include/pci)
+$(warning *** PCI passthrough capability has been disabled)
+else
+LIBS+=-lpci
+VL_OBJS+= pass-through.o
+CFLAGS += -DCONFIG_PASSTHROUGH
+$(info *** PCI passthrough capability has been enabled ***)
+endif
+
 SOUND_HW = sb16.o es1370.o
 AUDIODRV = audio.o noaudio.o wavaudio.o
 ifdef CONFIG_SDL
@@ -403,9 +410,6 @@ VL_OBJS+= piix4acpi.o
 VL_OBJS+= xenstore.o
 VL_OBJS+= xen_platform.o
 VL_OBJS+= tpm_tis.o
-ifdef CONFIG_PASSTHROUGH
-VL_OBJS+= pass-through.o
-endif
 CPPFLAGS += -DHAS_AUDIO
 endif
 ifeq ($(TARGET_BASE_ARCH), ppc)