qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 078/142] meson: convert hw/usb


From: Paolo Bonzini
Subject: [PATCH 078/142] meson: convert hw/usb
Date: Tue, 28 Jan 2020 18:52:38 +0100

From: Marc-André Lureau <address@hidden>

Signed-off-by: Marc-André Lureau <address@hidden>
---
 Makefile.target    |  1 +
 hw/Makefile.objs   |  1 -
 hw/meson.build     |  1 +
 hw/usb/meson.build | 53 ++++++++++++++++++++++++++++++++++++++++++++++
 meson.build        | 15 +++++++++++++
 5 files changed, 70 insertions(+), 1 deletion(-)
 create mode 100644 hw/usb/meson.build

diff --git a/Makefile.target b/Makefile.target
index 15e7c861f2..ea6f485675 100644
--- a/Makefile.target
+++ b/Makefile.target
@@ -169,6 +169,7 @@ endif
 LIBS := $(LIBS) $(BRLAPI_LIBS) $(SDL_LIBS) $(SPICE_LIBS) $(OPENGL_LIBS) 
$(SECCOMP_LIBS)
 LIBS := $(LIBS) $(COREAUDIO_LIBS) $(DSOUND_LIBS)
 LIBS := $(LIBS) $(VDE_LIBS) $(SLIRP_LIBS)
+LIBS := $(LIBS) $(LIBUSB_LIBS) $(SMARTCARD_LIBS) $(USB_REDIR_LIBS)
 
 # Hardware support
 ifeq ($(TARGET_NAME), sparc64)
diff --git a/hw/Makefile.objs b/hw/Makefile.objs
index cbd4e07fe5..72f808f8ec 100644
--- a/hw/Makefile.objs
+++ b/hw/Makefile.objs
@@ -30,7 +30,6 @@ devices-dirs-y += sd/
 devices-dirs-y += ssi/
 devices-dirs-y += timer/
 devices-dirs-$(CONFIG_TPM) += tpm/
-devices-dirs-y += usb/
 endif
 
 common-obj-y += $(devices-dirs-y)
diff --git a/hw/meson.build b/hw/meson.build
index 4dafc8a08e..89bd6adb70 100644
--- a/hw/meson.build
+++ b/hw/meson.build
@@ -3,6 +3,7 @@ subdir('mem')
 subdir('nubus')
 subdir('semihosting')
 subdir('smbios')
+subdir('usb')
 subdir('vfio')
 subdir('virtio')
 subdir('watchdog')
diff --git a/hw/usb/meson.build b/hw/usb/meson.build
new file mode 100644
index 0000000000..0cf91bea45
--- /dev/null
+++ b/hw/usb/meson.build
@@ -0,0 +1,53 @@
+# usb subsystem core
+softmmu_ss.add(files(
+  'bus.c',
+  'combined-packet.c',
+  'core.c',
+  'libhw.c'
+))
+
+softmmu_ss.add(when: 'CONFIG_USB', if_true: files(
+  'desc.c',
+  'desc-msos.c',
+))
+
+# usb host adapters
+softmmu_ss.add(when: 'CONFIG_USB_UHCI', if_true: files('hcd-uhci.c'))
+softmmu_ss.add(when: 'CONFIG_USB_OHCI', if_true: files('hcd-ohci.c'))
+softmmu_ss.add(when: 'CONFIG_USB_OHCI_PCI', if_true: files('hcd-ohci-pci.c'))
+softmmu_ss.add(when: 'CONFIG_USB_EHCI', if_true: files('hcd-ehci.c'))
+softmmu_ss.add(when: 'CONFIG_USB_EHCI_PCI', if_true: files('hcd-ehci-pci.c'))
+softmmu_ss.add(when: 'CONFIG_USB_EHCI_SYSBUS', if_true: files('hcd-ehci.c', 
'hcd-ehci-sysbus.c'))
+softmmu_ss.add(when: 'CONFIG_USB_XHCI', if_true: files('hcd-xhci.c'))
+softmmu_ss.add(when: 'CONFIG_USB_XHCI_NEC', if_true: files('hcd-xhci-nec.c'))
+softmmu_ss.add(when: 'CONFIG_USB_MUSB', if_true: files('hcd-musb.c'))
+
+specific_ss.add(when: 'CONFIG_TUSB6010', if_true: files('tusb6010.c'))
+specific_ss.add(when: 'CONFIG_IMX', if_true: files('chipidea.c'))
+
+# emulated usb devices
+softmmu_ss.add(when: 'CONFIG_USB', if_true: files('dev-hub.c'))
+softmmu_ss.add(when: 'CONFIG_USB', if_true: files('dev-hid.c'))
+softmmu_ss.add(when: 'CONFIG_USB_TABLET_WACOM', if_true: files('dev-wacom.c'))
+softmmu_ss.add(when: 'CONFIG_USB_STORAGE_BOT', if_true: files('dev-storage.c'))
+softmmu_ss.add(when: 'CONFIG_USB_STORAGE_UAS', if_true: files('dev-uas.c'))
+softmmu_ss.add(when: 'CONFIG_USB_AUDIO', if_true: files('dev-audio.c'))
+softmmu_ss.add(when: 'CONFIG_USB_SERIAL', if_true: files('dev-serial.c'))
+softmmu_ss.add(when: 'CONFIG_USB_NETWORK', if_true: files('dev-network.c'))
+
+softmmu_ss.add(when: 'CONFIG_USB_SMARTCARD', if_true: 
files('dev-smartcard-reader.c'))
+softmmu_ss.add(when: ['CONFIG_USB_SMARTCARD', 'CONFIG_SMARTCARD', cacard], 
if_true: files(
+  'ccid-card-emulated.c',
+  'ccid-card-passthru.c',
+))
+
+softmmu_ss.add(when: ['CONFIG_POSIX', 'CONFIG_USB_STORAGE_MTP'], if_true: 
files('dev-mtp.c'))
+
+# usb redirect
+softmmu_ss.add(when: [usbredir, 'CONFIG_USB_REDIR'], if_true: 
files('redirect.c', 'quirks.c'))
+
+# usb pass-through
+softmmu_ss.add(when: [libusb, 'CONFIG_USB_LIBUSB'], if_true: 
files('host-libusb.c'), if_false: files('host-stub.c'))
+softmmu_ss.add(when: 'CONFIG_ALL', if_true: files('host-stub.c'))
+
+softmmu_ss.add(when: [libusb, 'CONFIG_XEN'], if_true: files('xen-usb.c'))
diff --git a/meson.build b/meson.build
index 583c42ccf5..0c61aa5cd4 100644
--- a/meson.build
+++ b/meson.build
@@ -299,6 +299,21 @@ if 'CONFIG_XEN_BACKEND' in config_host
   xen = declare_dependency(compile_args: config_host['XEN_CFLAGS'].split(),
                            link_args: config_host['XEN_LIBS'].split())
 endif
+cacard = declare_dependency()
+if 'CONFIG_SMARTCARD' in config_host
+  cacard = declare_dependency(compile_args: 
config_host['SMARTCARD_CFLAGS'].split(),
+                              link_args: config_host['SMARTCARD_LIBS'].split())
+endif
+usbredir = declare_dependency()
+if 'CONFIG_USB_REDIR' in config_host
+  usbredir = declare_dependency(compile_args: 
config_host['USB_REDIR_CFLAGS'].split(),
+                                link_args: 
config_host['USB_REDIR_LIBS'].split())
+endif
+libusb = declare_dependency()
+if 'CONFIG_USB_LIBUSB' in config_host
+  libusb = declare_dependency(compile_args: 
config_host['LIBUSB_CFLAGS'].split(),
+                              link_args: config_host['LIBUSB_LIBS'].split())
+endif
 
 create_config = find_program('scripts/create_config')
 minikconf = find_program('scripts/minikconf.py')
-- 
2.21.0





reply via email to

[Prev in Thread] Current Thread [Next in Thread]