From: Jon Maloy <jmaloy@redhat.com>
To: qemu-devel@nongnu.org
Cc: marcandre.lureau@gmail.com, pbonzini@redhat.com,
jmaloy@redhat.com, jasowang@redhat.com, philmd@linaro.com,
stefanha@redhat.com
Subject: [PATCH v3 2/2] hw/usb: add configuration flag for Common Access Card library code
Date: Mon, 12 Dec 2022 17:09:49 -0500 [thread overview]
Message-ID: <20221212220949.1278269-3-jmaloy@redhat.com> (raw)
In-Reply-To: <20221212220949.1278269-1-jmaloy@redhat.com>
We add a new configuration flag, LIBCACARD, indicating availability of the
libcacard code for building. This way, we can eliminate the explicit test
for cacard.found() when configuring USB_SMARTCARD_EMULATED/USB_SMARTCARD_PASSTHRU
in hw/usb/meson.build.
Signed-off-by: Jon Maloy <jmaloy@redhat.com>
---
Kconfig.host | 3 +++
hw/usb/Kconfig | 2 ++
hw/usb/meson.build | 11 ++++-------
meson.build | 1 +
4 files changed, 10 insertions(+), 7 deletions(-)
diff --git a/Kconfig.host b/Kconfig.host
index d763d89269..d7fd4a2203 100644
--- a/Kconfig.host
+++ b/Kconfig.host
@@ -39,6 +39,9 @@ config MULTIPROCESS_ALLOWED
bool
imply MULTIPROCESS
+config LIBCACARD
+ bool
+
config FUZZ
bool
select SPARSE_MEM
diff --git a/hw/usb/Kconfig b/hw/usb/Kconfig
index 6b29e91593..5c3da7c34d 100644
--- a/hw/usb/Kconfig
+++ b/hw/usb/Kconfig
@@ -113,12 +113,14 @@ config USB_SMARTCARD_PASSTHRU
bool
default y
depends on USB
+ depends on LIBCACARD
select USB_SMARTCARD
config USB_SMARTCARD_EMULATED
bool
default y
depends on USB
+ depends on LIBCACARD
select USB_SMARTCARD
config USB_STORAGE_MTP
diff --git a/hw/usb/meson.build b/hw/usb/meson.build
index 353006fb6c..499be1122c 100644
--- a/hw/usb/meson.build
+++ b/hw/usb/meson.build
@@ -48,13 +48,10 @@ softmmu_ss.add(when: ['CONFIG_POSIX', 'CONFIG_USB_STORAGE_MTP'], if_true: files(
# smartcard
softmmu_ss.add(when: 'CONFIG_USB_SMARTCARD', if_true: files('dev-smartcard-reader.c'))
-
-if cacard.found()
- usbsmartcard_ss = ss.source_set()
- usbsmartcard_ss.add(when: 'CONFIG_USB_SMARTCARD_EMULATED', if_true: [cacard, files('ccid-card-emulated.c')])
- usbsmartcard_ss.add(when: 'CONFIG_USB_SMARTCARD_PASSTHRU', if_true: [cacard, files('ccid-card-passthru.c')])
- hw_usb_modules += {'smartcard': usbsmartcard_ss}
-endif
+usbsmartcard_ss = ss.source_set()
+usbsmartcard_ss.add(when: 'CONFIG_USB_SMARTCARD_EMULATED', if_true: [cacard, files('ccid-card-emulated.c')])
+usbsmartcard_ss.add(when: 'CONFIG_USB_SMARTCARD_PASSTHRU', if_true: [cacard, files('ccid-card-passthru.c')])
+hw_usb_modules += {'smartcard': usbsmartcard_ss}
# U2F
softmmu_ss.add(when: 'CONFIG_USB_U2F', if_true: files('u2f.c'))
diff --git a/meson.build b/meson.build
index 5c6b5a1c75..10e9b77ec1 100644
--- a/meson.build
+++ b/meson.build
@@ -2493,6 +2493,7 @@ have_ivshmem = config_host_data.get('CONFIG_EVENTFD')
host_kconfig = \
(get_option('fuzzing') ? ['CONFIG_FUZZ=y'] : []) + \
(have_tpm ? ['CONFIG_TPM=y'] : []) + \
+ (cacard.found() ? ['CONFIG_LIBCACARD=y'] : []) + \
(spice.found() ? ['CONFIG_SPICE=y'] : []) + \
(have_ivshmem ? ['CONFIG_IVSHMEM=y'] : []) + \
(opengl.found() ? ['CONFIG_OPENGL=y'] : []) + \
--
2.35.3
next prev parent reply other threads:[~2022-12-12 22:12 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-12 22:09 [PATCH v3 0/2] hw/usb: add configuration flags for emulated and passthru usb smartcard Jon Maloy
2022-12-12 22:09 ` [PATCH v3 1/2] " Jon Maloy
2022-12-12 22:09 ` Jon Maloy [this message]
2022-12-12 22:13 ` [PATCH v3 0/2] " Philippe Mathieu-Daudé
2022-12-13 21:02 ` Stefan Hajnoczi
2023-01-19 23:47 ` Jon Maloy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20221212220949.1278269-3-jmaloy@redhat.com \
--to=jmaloy@redhat.com \
--cc=jasowang@redhat.com \
--cc=marcandre.lureau@gmail.com \
--cc=pbonzini@redhat.com \
--cc=philmd@linaro.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.