meson: Add U2F key to meson

Signed-off-by: César Belley <cesar.belley@lse.epita.fr>
Message-id: 20200826114209.28821-8-cesar.belley@lse.epita.fr

[ fixes suggested by paolo ]

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
This commit is contained in:
César Belley 2020-08-26 13:42:04 +02:00 committed by Gerd Hoffmann
parent a983b1135f
commit 0a40bcb740
5 changed files with 27 additions and 1 deletions

8
configure vendored
View File

@ -495,6 +495,7 @@ trace_file="trace"
spice="" spice=""
rbd="" rbd=""
smartcard="" smartcard=""
u2f="auto"
libusb="" libusb=""
usb_redir="" usb_redir=""
opengl="" opengl=""
@ -1415,6 +1416,10 @@ for opt do
;; ;;
--enable-smartcard) smartcard="yes" --enable-smartcard) smartcard="yes"
;; ;;
--disable-u2f) u2f="disabled"
;;
--enable-u2f) u2f="enabled"
;;
--disable-libusb) libusb="no" --disable-libusb) libusb="no"
;; ;;
--enable-libusb) libusb="yes" --enable-libusb) libusb="yes"
@ -1945,6 +1950,7 @@ disabled with --disable-FEATURE, default is enabled if available:
libiscsi iscsi support libiscsi iscsi support
libnfs nfs support libnfs nfs support
smartcard smartcard support (libcacard) smartcard smartcard support (libcacard)
u2f U2F support (u2f-emu)
libusb libusb (for usb passthrough) libusb libusb (for usb passthrough)
live-block-migration Block migration in the main migration stream live-block-migration Block migration in the main migration stream
usb-redir usb network redirection support usb-redir usb network redirection support
@ -8229,7 +8235,7 @@ NINJA=${ninja:-$PWD/ninjatool} $meson setup \
-Db_coverage=$(if test "$gcov" = yes; then echo true; else echo false; fi) \ -Db_coverage=$(if test "$gcov" = yes; then echo true; else echo false; fi) \
-Dsdl=$sdl -Dsdl_image=$sdl_image \ -Dsdl=$sdl -Dsdl_image=$sdl_image \
-Dvnc=$vnc -Dvnc_sasl=$vnc_sasl -Dvnc_jpeg=$vnc_jpeg -Dvnc_png=$vnc_png \ -Dvnc=$vnc -Dvnc_sasl=$vnc_sasl -Dvnc_jpeg=$vnc_jpeg -Dvnc_png=$vnc_png \
-Dgettext=$gettext -Dxkbcommon=$xkbcommon \ -Dgettext=$gettext -Dxkbcommon=$xkbcommon -Du2f=$u2f\
$cross_arg \ $cross_arg \
"$PWD" "$source_path" "$PWD" "$source_path"

View File

@ -96,6 +96,11 @@ config USB_STORAGE_MTP
default y default y
depends on USB depends on USB
config USB_U2F
bool
default y
depends on USB
config IMX_USBPHY config IMX_USBPHY
bool bool
default y default y

View File

@ -50,6 +50,13 @@ if config_host.has_key('CONFIG_SMARTCARD')
hw_usb_modules += {'smartcard': usbsmartcard_ss} hw_usb_modules += {'smartcard': usbsmartcard_ss}
endif endif
# U2F
softmmu_ss.add(when: 'CONFIG_USB_U2F', if_true: files('u2f.c'))
softmmu_ss.add(when: ['CONFIG_LINUX', 'CONFIG_USB_U2F'], if_true: files('u2f-passthru.c'))
if u2f.found()
softmmu_ss.add(when: 'CONFIG_USB_U2F', if_true: [u2f, files('u2f-emulated.c')])
endif
# usb redirect # usb redirect
if config_host.has_key('CONFIG_USB_REDIR') if config_host.has_key('CONFIG_USB_REDIR')
usbredir_ss = ss.source_set() usbredir_ss = ss.source_set()

View File

@ -377,6 +377,12 @@ if 'CONFIG_SMARTCARD' in config_host
cacard = declare_dependency(compile_args: config_host['SMARTCARD_CFLAGS'].split(), cacard = declare_dependency(compile_args: config_host['SMARTCARD_CFLAGS'].split(),
link_args: config_host['SMARTCARD_LIBS'].split()) link_args: config_host['SMARTCARD_LIBS'].split())
endif endif
u2f = not_found
if have_system
u2f = dependency('u2f-emu', required: get_option('u2f'),
method: 'pkg-config',
static: enable_static)
endif
usbredir = not_found usbredir = not_found
if 'CONFIG_USB_REDIR' in config_host if 'CONFIG_USB_REDIR' in config_host
usbredir = declare_dependency(compile_args: config_host['USB_REDIR_CFLAGS'].split(), usbredir = declare_dependency(compile_args: config_host['USB_REDIR_CFLAGS'].split(),
@ -1375,6 +1381,7 @@ summary_info += {'spice support': config_host.has_key('CONFIG_SPICE')}
summary_info += {'rbd support': config_host.has_key('CONFIG_RBD')} summary_info += {'rbd support': config_host.has_key('CONFIG_RBD')}
summary_info += {'xfsctl support': config_host.has_key('CONFIG_XFS')} summary_info += {'xfsctl support': config_host.has_key('CONFIG_XFS')}
summary_info += {'smartcard support': config_host.has_key('CONFIG_SMARTCARD')} summary_info += {'smartcard support': config_host.has_key('CONFIG_SMARTCARD')}
summary_info += {'U2F support': u2f.found()}
summary_info += {'libusb': config_host.has_key('CONFIG_USB_LIBUSB')} summary_info += {'libusb': config_host.has_key('CONFIG_USB_LIBUSB')}
summary_info += {'usb net redir': config_host.has_key('CONFIG_USB_REDIR')} summary_info += {'usb net redir': config_host.has_key('CONFIG_USB_REDIR')}
summary_info += {'OpenGL support': config_host.has_key('CONFIG_OPENGL')} summary_info += {'OpenGL support': config_host.has_key('CONFIG_OPENGL')}

View File

@ -1,6 +1,7 @@
option('gettext', type : 'boolean', value : true) option('gettext', type : 'boolean', value : true)
option('sdl', type : 'feature', value : 'auto') option('sdl', type : 'feature', value : 'auto')
option('sdl_image', type : 'feature', value : 'auto') option('sdl_image', type : 'feature', value : 'auto')
option('u2f', type : 'feature', value : 'auto')
option('vnc', type : 'feature', value : 'enabled') option('vnc', type : 'feature', value : 'enabled')
option('vnc_jpeg', type : 'feature', value : 'auto') option('vnc_jpeg', type : 'feature', value : 'auto')
option('vnc_png', type : 'feature', value : 'auto') option('vnc_png', type : 'feature', value : 'auto')