Skip to content

Commit

Permalink
lib-qemu: support to use qemu-usb w/o webcam
Browse files Browse the repository at this point in the history
for other VMMs beside Virtualbox, e.g. Seoul or potentially arm/vmm. The
webcam model depends on libyuv, which uses stdcxx + full libc, which is not
desired or required for all VMM implementations.

Fixes #5208
  • Loading branch information
alex-ab authored and chelmuth committed May 13, 2024
1 parent 6c9d332 commit 59c42ff
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 13 deletions.
2 changes: 1 addition & 1 deletion repos/libports/lib/import/import-qemu-usb_include.mk
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
QEMU_CONTRIB_DIR := $(call select_from_ports,qemu-usb)/src/lib/qemu

LIB_DIR := $(REP_DIR)/src/lib/qemu-usb
LIB_DIR := $(call select_from_repositories,src/lib/qemu-usb)
LIB_INC_DIR := $(LIB_DIR)/include

#
Expand Down
12 changes: 12 additions & 0 deletions repos/libports/lib/mk/qemu-usb-webcam.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
include $(REP_DIR)/lib/mk/qemu-usb.inc

LIBS += libc
LIBS += libyuv
LIBS += format

SRC_CC += webcam.cc
SRC_C += dev-webcam.c

vpath dev-webcam.c $(LIB_DIR)

SHARED_LIB = yes
13 changes: 3 additions & 10 deletions repos/libports/lib/mk/qemu-usb.inc
Original file line number Diff line number Diff line change
@@ -1,25 +1,18 @@
LIB_DIR = $(REP_DIR)/src/lib/qemu-usb
LIB_DIR = $(call select_from_repositories,src/lib/qemu-usb)
QEMU_USB_DIR := $(call select_from_ports,qemu-usb)/src/lib/qemu/hw/usb

CC_WARN=

INC_DIR += $(LIB_DIR) $(QEMU_USB_DIR)

LIBS = qemu-usb_include
LIBS += libc
LIBS += libyuv
LIBS += format

SRC_CC = dummies.cc qemu_emul.cc host.cc webcam.cc
SRC_CC += dummies.cc qemu_emul.cc host.cc

SRC_C = desc.c hcd-xhci.c hcd-xhci-pci.c core.c bus.c
SRC_C += dev-webcam.c

SHARED_LIB = yes
SRC_C += desc.c hcd-xhci.c hcd-xhci-pci.c core.c bus.c

LD_OPT += --version-script=$(LIB_DIR)/symbol.map

vpath dev-webcam.c $(LIB_DIR)
vpath %.c $(QEMU_USB_DIR)
vpath %.cc $(LIB_DIR)

Expand Down
2 changes: 1 addition & 1 deletion repos/libports/lib/mk/spec/x86_32/qemu-usb.mk
Original file line number Diff line number Diff line change
@@ -1 +1 @@
include $(REP_DIR)/lib/mk/qemu-usb.inc
include $(REP_DIR)/lib/mk/qemu-usb-webcam.inc
2 changes: 1 addition & 1 deletion repos/libports/lib/mk/spec/x86_64/qemu-usb.mk
Original file line number Diff line number Diff line change
@@ -1 +1 @@
include $(REP_DIR)/lib/mk/qemu-usb.inc
include $(REP_DIR)/lib/mk/qemu-usb-webcam.inc
1 change: 1 addition & 0 deletions repos/ports/recipes/src/vbox5-nova/content.mk
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ MIRROR_FROM_LIBPORTS := lib/mk/libc-mem.mk \
lib/import/import-qemu-usb_include.mk \
lib/mk/qemu-usb_include.mk \
lib/mk/qemu-usb.inc \
lib/mk/qemu-usb-webcam.inc \
lib/mk/spec/x86_32/qemu-usb.mk \
lib/mk/spec/x86_64/qemu-usb.mk \
include/qemu \
Expand Down
1 change: 1 addition & 0 deletions repos/ports/recipes/src/vbox6/content.mk
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ MIRROR_FROM_LIBPORTS := \
lib/mk/libc-mem.mk \
lib/mk/qemu-usb.inc \
lib/mk/qemu-usb_include.mk \
lib/mk/qemu-usb-webcam.inc \
lib/mk/spec/x86_32/qemu-usb.mk \
lib/mk/spec/x86_64/qemu-usb.mk \
src/lib/libc/internal/init.h \
Expand Down

0 comments on commit 59c42ff

Please sign in to comment.