summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorChristophe Fergeau <cfergeau@redhat.com>2012-08-07 16:19:14 +0200
committerChristophe Fergeau <cfergeau@redhat.com>2012-08-07 17:06:01 +0200
commit8955614755b4f49974f779a5e9a7cb6a427cd9f2 (patch)
tree2b28daedcfb161a25506ff46724610bb5011343f /configure.ac
parent9057d3ac9c169836274ef5eb62a3b0a76744367f (diff)
build: add --enable-smartcard=auto support
Currently, when running configure with no arguments, smartcard support is enabled by default, and configure will fail if it cannot find libcacard. This commit adds a --enable-smartcard=auto mode to configure which will use automatically enable smartcard support if libcacard is available, but it will be silently disabled if libcacard is not available. Passing --enable-smartcard will fail if libcacard is not available. Passing --disable-smartcard will always disable smartcard support and will not test for libcacard availability.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac22
1 files changed, 13 insertions, 9 deletions
diff --git a/configure.ac b/configure.ac
index e246f16..38ceeab 100644
--- a/configure.ac
+++ b/configure.ac
@@ -321,17 +321,21 @@ AC_SUBST(Z_LIBS)
AC_ARG_ENABLE([smartcard],
AS_HELP_STRING([--enable-smartcard=@<:@yes/no@:>@],
- [Enable smartcard support @<:@default=yes@:>@]),
+ [Enable smartcard support @<:@default=auto@:>@]),
[],
- [enable_smartcard="yes"])
+ [enable_smartcard="auto"])
-if test "x$enable_smartcard" = "xno"; then
- AM_CONDITIONAL(WITH_SMARTCARD, false)
-else
- PKG_CHECK_MODULES(SMARTCARD, libcacard >= 0.1.2)
- AC_DEFINE(USE_SMARTCARD, [1], [Define if supporting smartcard proxying])
- AM_CONDITIONAL(WITH_SMARTCARD, true)
+have_smartcard=no
+if test "x$enable_smartcard" != "xno"; then
+ PKG_CHECK_MODULES(SMARTCARD, libcacard >= 0.1.2, [have_smartcard=yes], [have_smartcard=no])
+ if test "x$enable_smartcard" != "xauto" && test "x$have_smartcard" = "xno"; then
+ AC_MSG_ERROR("Smartcard support requested but libcacard could not be found")
+ fi
+ if test "x$have_smartcard" = "xyes"; then
+ AC_DEFINE(USE_SMARTCARD, [1], [Define if supporting smartcard proxying])
+ fi
fi
+AM_CONDITIONAL([WITH_SMARTCARD], [test "x$have_smartcard" = "xyes"])
AC_ARG_ENABLE([usbredir],
AS_HELP_STRING([--enable-usbredir=@<:@auto/yes/no@:>@],
@@ -656,7 +660,7 @@ AC_MSG_NOTICE([
Audio: ${with_audio}
Target: ${red_target}
SASL support: ${enable_sasl}
- Smartcard support: ${enable_smartcard}
+ Smartcard support: ${have_smartcard}
USB redirection support: ${have_usbredir}
Gtk: $GTK_API_VERSION