[Spice-devel,02/12] build-sys: add --enable-pcsc

Submitted by marcandre.lureau@redhat.com on Oct. 8, 2015, 3:40 p.m.

Details

Message ID 1444318841-16508-3-git-send-email-marcandre.lureau@redhat.com
State New
Headers show

Not browsing as part of any series.

Commit Message

marcandre.lureau@redhat.com Oct. 8, 2015, 3:40 p.m.
From: Marc-André Lureau <marcandre.lureau@redhat.com>

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
 configure.ac | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

Patch hide | download patch | download mbox

diff --git a/configure.ac b/configure.ac
index b841ec1..b878526 100644
--- a/configure.ac
+++ b/configure.ac
@@ -36,9 +36,35 @@  AX_CODE_COVERAGE()
 PKG_CHECK_MODULES(CACARD, [glib-2.0 >= 2.22 nss >= 3.12.8])
 PKG_CHECK_MODULES(GTHREAD, [gthread-2.0])
 
+dnl === --enable-pcsc ==========================================================
+
+AC_ARG_ENABLE([pcsc],
+              AS_HELP_STRING([--disable-pcsc],
+                             [do not build passthrough support]),,
+              enable_pcsc=auto)
+if test "x$enable_pcsc" != "xno"; then
+   PKG_CHECK_MODULES(PCSC, libpcsclite, have_pcsc=yes, have_pcsc=no)
+   if test "x$have_pcsc" = "xno" -a "x$enable_pcsc" = "xyes"; then
+      AC_MSG_ERROR([pcsc support explicitly requested, but libpcsclite couldn't be found])
+   fi
+   if test "x$have_pcsc" = "xyes"; then
+      enable_pcsc=yes
+   fi
+fi
+AM_CONDITIONAL(ENABLE_PCSC, test "x$enable_pcsc" = "xyes")
+
 AC_CONFIG_FILES([
 Makefile
 src/Makefile
 libcacard.pc
 ])
 AC_OUTPUT
+
+AC_MSG_NOTICE([
+
+libcacard - $VERSION
+
+• Prefix: $prefix
+• PCSC enabled: $enable_pcsc
+
+])

Comments

On Thu, Oct 08, 2015 at 05:40:31PM +0200, marcandre.lureau@redhat.com wrote:
> From: Marc-André Lureau <marcandre.lureau@redhat.com>
> 
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> ---
>  configure.ac | 26 ++++++++++++++++++++++++++
>  1 file changed, 26 insertions(+)
> 
> diff --git a/configure.ac b/configure.ac
> index b841ec1..b878526 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -36,9 +36,35 @@ AX_CODE_COVERAGE()
>  PKG_CHECK_MODULES(CACARD, [glib-2.0 >= 2.22 nss >= 3.12.8])
>  PKG_CHECK_MODULES(GTHREAD, [gthread-2.0])
>  
> +dnl === --enable-pcsc ==========================================================
> +
> +AC_ARG_ENABLE([pcsc],
> +              AS_HELP_STRING([--disable-pcsc],
> +                             [do not build passthrough support]),,
> +              enable_pcsc=auto)

I think there could be a few more [] around enable_pcsc=auto...



> +if test "x$enable_pcsc" != "xno"; then
> +   PKG_CHECK_MODULES(PCSC, libpcsclite, have_pcsc=yes, have_pcsc=no)

...and around the args here (though I never know when there should be []
or not).

I'm fine if you keep the patch this way.

Christophe

> +   if test "x$have_pcsc" = "xno" -a "x$enable_pcsc" = "xyes"; then
> +      AC_MSG_ERROR([pcsc support explicitly requested, but libpcsclite couldn't be found])
> +   fi
> +   if test "x$have_pcsc" = "xyes"; then
> +      enable_pcsc=yes
> +   fi
> +fi
> +AM_CONDITIONAL(ENABLE_PCSC, test "x$enable_pcsc" = "xyes")
> +
>  AC_CONFIG_FILES([
>  Makefile
>  src/Makefile
>  libcacard.pc
>  ])
>  AC_OUTPUT
> +
> +AC_MSG_NOTICE([
> +
> +libcacard - $VERSION
> +
> +• Prefix: $prefix
> +• PCSC enabled: $enable_pcsc
> +
> +])
> -- 
> 2.4.3
> 
> _______________________________________________
> Spice-devel mailing list
> Spice-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/spice-devel
----- Original Message -----
> On Thu, Oct 08, 2015 at 05:40:31PM +0200, marcandre.lureau@redhat.com wrote:
> > From: Marc-André Lureau <marcandre.lureau@redhat.com>
> > 
> > Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> > ---
> >  configure.ac | 26 ++++++++++++++++++++++++++
> >  1 file changed, 26 insertions(+)
> > 
> > diff --git a/configure.ac b/configure.ac
> > index b841ec1..b878526 100644
> > --- a/configure.ac
> > +++ b/configure.ac
> > @@ -36,9 +36,35 @@ AX_CODE_COVERAGE()
> >  PKG_CHECK_MODULES(CACARD, [glib-2.0 >= 2.22 nss >= 3.12.8])
> >  PKG_CHECK_MODULES(GTHREAD, [gthread-2.0])
> >  
> > +dnl === --enable-pcsc
> > ==========================================================
> > +
> > +AC_ARG_ENABLE([pcsc],
> > +              AS_HELP_STRING([--disable-pcsc],
> > +                             [do not build passthrough support]),,
> > +              enable_pcsc=auto)
> 
> I think there could be a few more [] around enable_pcsc=auto...
> 
> 
> 
> > +if test "x$enable_pcsc" != "xno"; then
> > +   PKG_CHECK_MODULES(PCSC, libpcsclite, have_pcsc=yes, have_pcsc=no)
> 
> ...and around the args here (though I never know when there should be []
> or not).

I think it's unneeded most of the time, except perhaps for later concatenation: FOO -> FOO_CFLAGS..

> I'm fine if you keep the patch this way.
> 
> Christophe
> 
> > +   if test "x$have_pcsc" = "xno" -a "x$enable_pcsc" = "xyes"; then
> > +      AC_MSG_ERROR([pcsc support explicitly requested, but libpcsclite
> > couldn't be found])
> > +   fi
> > +   if test "x$have_pcsc" = "xyes"; then
> > +      enable_pcsc=yes
> > +   fi
> > +fi
> > +AM_CONDITIONAL(ENABLE_PCSC, test "x$enable_pcsc" = "xyes")
> > +
> >  AC_CONFIG_FILES([
> >  Makefile
> >  src/Makefile
> >  libcacard.pc
> >  ])
> >  AC_OUTPUT
> > +
> > +AC_MSG_NOTICE([
> > +
> > +libcacard - $VERSION
> > +
> > +• Prefix: $prefix
> > +• PCSC enabled: $enable_pcsc
> > +
> > +])
> > --
> > 2.4.3
> > 
> > _______________________________________________
> > Spice-devel mailing list
> > Spice-devel@lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/spice-devel
>