All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v2] ccid-card: include libcacard.h only
@ 2018-04-03 10:34 Michal Privoznik
  2018-04-03 11:38 ` Marc-André Lureau
  2018-04-27  8:58 ` Gerd Hoffmann
  0 siblings, 2 replies; 5+ messages in thread
From: Michal Privoznik @ 2018-04-03 10:34 UTC (permalink / raw)
  To: qemu-devel; +Cc: marcandre.lureau, kraxel

When trying to build with latest libcacard-2.5.1, I hit the
following error:

In file included from hw/usb/ccid-card-passthru.c:12:0:
/usr/include/cacard/vscard_common.h:26:2: error: #warning "Only <libcacard.h> can be included directly" [-Werror=cpp]
 #warning "Only <libcacard.h> can be included directly"

While it was fixed in libcacard upstream (so that individual
files can be included directly), it doesn't make much sense.
Let's switch to including the main libcacard.h and also require
at least libcacard-2.5.1 which introduced it. It's available
since late 2015.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
---

diff to v1:
- Introduce configure change to require newer libcacard version

 configure                   | 2 +-
 hw/usb/ccid-card-emulated.c | 5 +----
 hw/usb/ccid-card-passthru.c | 2 +-
 3 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/configure b/configure
index 4d0e92c96c..0edec24fff 100755
--- a/configure
+++ b/configure
@@ -4440,7 +4440,7 @@ fi
 
 # check for smartcard support
 if test "$smartcard" != "no"; then
-    if $pkg_config libcacard; then
+    if $pkg_config --atleast-version=2.5.1 libcacard; then
         libcacard_cflags=$($pkg_config --cflags libcacard)
         libcacard_libs=$($pkg_config --libs libcacard)
         smartcard="yes"
diff --git a/hw/usb/ccid-card-emulated.c b/hw/usb/ccid-card-emulated.c
index ea42e4681d..7b538ae6da 100644
--- a/hw/usb/ccid-card-emulated.c
+++ b/hw/usb/ccid-card-emulated.c
@@ -27,10 +27,7 @@
  */
 
 #include "qemu/osdep.h"
-#include <eventt.h>
-#include <vevent.h>
-#include <vreader.h>
-#include <vcard_emul.h>
+#include <cacard/libcacard.h>
 
 #include "qemu/thread.h"
 #include "qemu/main-loop.h"
diff --git a/hw/usb/ccid-card-passthru.c b/hw/usb/ccid-card-passthru.c
index b7dd3602dc..982d575edd 100644
--- a/hw/usb/ccid-card-passthru.c
+++ b/hw/usb/ccid-card-passthru.c
@@ -9,7 +9,7 @@
  */
 
 #include "qemu/osdep.h"
-#include <cacard/vscard_common.h>
+#include <cacard/libcacard.h>
 #include "chardev/char-fe.h"
 #include "qemu/error-report.h"
 #include "qemu/sockets.h"
-- 
2.16.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [PATCH v2] ccid-card: include libcacard.h only
  2018-04-03 10:34 [Qemu-devel] [PATCH v2] ccid-card: include libcacard.h only Michal Privoznik
@ 2018-04-03 11:38 ` Marc-André Lureau
  2018-04-03 11:48   ` Michal Privoznik
  2018-04-27  8:58 ` Gerd Hoffmann
  1 sibling, 1 reply; 5+ messages in thread
From: Marc-André Lureau @ 2018-04-03 11:38 UTC (permalink / raw)
  To: Michal Privoznik; +Cc: QEMU, Gerd Hoffmann

Hi

On Tue, Apr 3, 2018 at 12:34 PM, Michal Privoznik <mprivozn@redhat.com> wrote:
> When trying to build with latest libcacard-2.5.1, I hit the
> following error:
>
> In file included from hw/usb/ccid-card-passthru.c:12:0:
> /usr/include/cacard/vscard_common.h:26:2: error: #warning "Only <libcacard.h> can be included directly" [-Werror=cpp]
>  #warning "Only <libcacard.h> can be included directly"
>
> While it was fixed in libcacard upstream (so that individual
> files can be included directly), it doesn't make much sense.
> Let's switch to including the main libcacard.h and also require
> at least libcacard-2.5.1 which introduced it. It's available
> since late 2015.
>
> Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
> ---
>
> diff to v1:
> - Introduce configure change to require newer libcacard version
>
>  configure                   | 2 +-
>  hw/usb/ccid-card-emulated.c | 5 +----
>  hw/usb/ccid-card-passthru.c | 2 +-
>  3 files changed, 3 insertions(+), 6 deletions(-)
>
> diff --git a/configure b/configure
> index 4d0e92c96c..0edec24fff 100755
> --- a/configure
> +++ b/configure
> @@ -4440,7 +4440,7 @@ fi
>
>  # check for smartcard support
>  if test "$smartcard" != "no"; then
> -    if $pkg_config libcacard; then
> +    if $pkg_config --atleast-version=2.5.1 libcacard; then
>          libcacard_cflags=$($pkg_config --cflags libcacard)
>          libcacard_libs=$($pkg_config --libs libcacard)
>          smartcard="yes"
> diff --git a/hw/usb/ccid-card-emulated.c b/hw/usb/ccid-card-emulated.c
> index ea42e4681d..7b538ae6da 100644
> --- a/hw/usb/ccid-card-emulated.c
> +++ b/hw/usb/ccid-card-emulated.c
> @@ -27,10 +27,7 @@
>   */
>
>  #include "qemu/osdep.h"
> -#include <eventt.h>
> -#include <vevent.h>
> -#include <vreader.h>
> -#include <vcard_emul.h>
> +#include <cacard/libcacard.h>

You should be able to #include <libcacard.h> only

>
>  #include "qemu/thread.h"
>  #include "qemu/main-loop.h"
> diff --git a/hw/usb/ccid-card-passthru.c b/hw/usb/ccid-card-passthru.c
> index b7dd3602dc..982d575edd 100644
> --- a/hw/usb/ccid-card-passthru.c
> +++ b/hw/usb/ccid-card-passthru.c
> @@ -9,7 +9,7 @@
>   */
>
>  #include "qemu/osdep.h"
> -#include <cacard/vscard_common.h>
> +#include <cacard/libcacard.h>
>  #include "chardev/char-fe.h"
>  #include "qemu/error-report.h"
>  #include "qemu/sockets.h"
> --
> 2.16.1
>



-- 
Marc-André Lureau

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [PATCH v2] ccid-card: include libcacard.h only
  2018-04-03 11:38 ` Marc-André Lureau
@ 2018-04-03 11:48   ` Michal Privoznik
  2018-04-03 14:54     ` Marc-André Lureau
  0 siblings, 1 reply; 5+ messages in thread
From: Michal Privoznik @ 2018-04-03 11:48 UTC (permalink / raw)
  To: Marc-André Lureau; +Cc: QEMU, Gerd Hoffmann

On 04/03/2018 01:38 PM, Marc-André Lureau wrote:
> Hi
> 
> On Tue, Apr 3, 2018 at 12:34 PM, Michal Privoznik <mprivozn@redhat.com> wrote:
>> When trying to build with latest libcacard-2.5.1, I hit the
>> following error:
>>
>> In file included from hw/usb/ccid-card-passthru.c:12:0:
>> /usr/include/cacard/vscard_common.h:26:2: error: #warning "Only <libcacard.h> can be included directly" [-Werror=cpp]
>>  #warning "Only <libcacard.h> can be included directly"
>>
>> While it was fixed in libcacard upstream (so that individual
>> files can be included directly), it doesn't make much sense.
>> Let's switch to including the main libcacard.h and also require
>> at least libcacard-2.5.1 which introduced it. It's available
>> since late 2015.
>>
>> Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
>> ---
>>
>> diff to v1:
>> - Introduce configure change to require newer libcacard version
>>
>>  configure                   | 2 +-
>>  hw/usb/ccid-card-emulated.c | 5 +----
>>  hw/usb/ccid-card-passthru.c | 2 +-
>>  3 files changed, 3 insertions(+), 6 deletions(-)
>>
>> diff --git a/configure b/configure
>> index 4d0e92c96c..0edec24fff 100755
>> --- a/configure
>> +++ b/configure
>> @@ -4440,7 +4440,7 @@ fi
>>
>>  # check for smartcard support
>>  if test "$smartcard" != "no"; then
>> -    if $pkg_config libcacard; then
>> +    if $pkg_config --atleast-version=2.5.1 libcacard; then
>>          libcacard_cflags=$($pkg_config --cflags libcacard)
>>          libcacard_libs=$($pkg_config --libs libcacard)
>>          smartcard="yes"
>> diff --git a/hw/usb/ccid-card-emulated.c b/hw/usb/ccid-card-emulated.c
>> index ea42e4681d..7b538ae6da 100644
>> --- a/hw/usb/ccid-card-emulated.c
>> +++ b/hw/usb/ccid-card-emulated.c
>> @@ -27,10 +27,7 @@
>>   */
>>
>>  #include "qemu/osdep.h"
>> -#include <eventt.h>
>> -#include <vevent.h>
>> -#include <vreader.h>
>> -#include <vcard_emul.h>
>> +#include <cacard/libcacard.h>
> 
> You should be able to #include <libcacard.h> only.

Yes, you're right. Do you want me to resend or will you handle this when
merging the patch?


Thanks,
Michal

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [PATCH v2] ccid-card: include libcacard.h only
  2018-04-03 11:48   ` Michal Privoznik
@ 2018-04-03 14:54     ` Marc-André Lureau
  0 siblings, 0 replies; 5+ messages in thread
From: Marc-André Lureau @ 2018-04-03 14:54 UTC (permalink / raw)
  To: Michal Privoznik; +Cc: QEMU, Gerd Hoffmann

Hi

On Tue, Apr 3, 2018 at 1:48 PM, Michal Privoznik <mprivozn@redhat.com> wrote:
> On 04/03/2018 01:38 PM, Marc-André Lureau wrote:
>> Hi
>>
>> On Tue, Apr 3, 2018 at 12:34 PM, Michal Privoznik <mprivozn@redhat.com> wrote:
>>> When trying to build with latest libcacard-2.5.1, I hit the
>>> following error:
>>>
>>> In file included from hw/usb/ccid-card-passthru.c:12:0:
>>> /usr/include/cacard/vscard_common.h:26:2: error: #warning "Only <libcacard.h> can be included directly" [-Werror=cpp]
>>>  #warning "Only <libcacard.h> can be included directly"
>>>
>>> While it was fixed in libcacard upstream (so that individual
>>> files can be included directly), it doesn't make much sense.
>>> Let's switch to including the main libcacard.h and also require
>>> at least libcacard-2.5.1 which introduced it. It's available
>>> since late 2015.
>>>
>>> Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
>>> ---
>>>
>>> diff to v1:
>>> - Introduce configure change to require newer libcacard version
>>>
>>>  configure                   | 2 +-
>>>  hw/usb/ccid-card-emulated.c | 5 +----
>>>  hw/usb/ccid-card-passthru.c | 2 +-
>>>  3 files changed, 3 insertions(+), 6 deletions(-)
>>>
>>> diff --git a/configure b/configure
>>> index 4d0e92c96c..0edec24fff 100755
>>> --- a/configure
>>> +++ b/configure
>>> @@ -4440,7 +4440,7 @@ fi
>>>
>>>  # check for smartcard support
>>>  if test "$smartcard" != "no"; then
>>> -    if $pkg_config libcacard; then
>>> +    if $pkg_config --atleast-version=2.5.1 libcacard; then
>>>          libcacard_cflags=$($pkg_config --cflags libcacard)
>>>          libcacard_libs=$($pkg_config --libs libcacard)
>>>          smartcard="yes"
>>> diff --git a/hw/usb/ccid-card-emulated.c b/hw/usb/ccid-card-emulated.c
>>> index ea42e4681d..7b538ae6da 100644
>>> --- a/hw/usb/ccid-card-emulated.c
>>> +++ b/hw/usb/ccid-card-emulated.c
>>> @@ -27,10 +27,7 @@
>>>   */
>>>
>>>  #include "qemu/osdep.h"
>>> -#include <eventt.h>
>>> -#include <vevent.h>
>>> -#include <vreader.h>
>>> -#include <vcard_emul.h>
>>> +#include <cacard/libcacard.h>
>>
>> You should be able to #include <libcacard.h> only.
>
> Yes, you're right. Do you want me to resend or will you handle this when
> merging the patch?

I'll let Gerd decide:
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>



-- 
Marc-André Lureau

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [PATCH v2] ccid-card: include libcacard.h only
  2018-04-03 10:34 [Qemu-devel] [PATCH v2] ccid-card: include libcacard.h only Michal Privoznik
  2018-04-03 11:38 ` Marc-André Lureau
@ 2018-04-27  8:58 ` Gerd Hoffmann
  1 sibling, 0 replies; 5+ messages in thread
From: Gerd Hoffmann @ 2018-04-27  8:58 UTC (permalink / raw)
  To: Michal Privoznik; +Cc: qemu-devel, marcandre.lureau

On Tue, Apr 03, 2018 at 12:34:37PM +0200, Michal Privoznik wrote:
> When trying to build with latest libcacard-2.5.1, I hit the
> following error:
> 
> In file included from hw/usb/ccid-card-passthru.c:12:0:
> /usr/include/cacard/vscard_common.h:26:2: error: #warning "Only <libcacard.h> can be included directly" [-Werror=cpp]
>  #warning "Only <libcacard.h> can be included directly"
> 
> While it was fixed in libcacard upstream (so that individual
> files can be included directly), it doesn't make much sense.
> Let's switch to including the main libcacard.h and also require
> at least libcacard-2.5.1 which introduced it. It's available
> since late 2015.

Added to usb queue.

thanks,
  Gerd

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-04-27  8:58 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-03 10:34 [Qemu-devel] [PATCH v2] ccid-card: include libcacard.h only Michal Privoznik
2018-04-03 11:38 ` Marc-André Lureau
2018-04-03 11:48   ` Michal Privoznik
2018-04-03 14:54     ` Marc-André Lureau
2018-04-27  8:58 ` Gerd Hoffmann

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.