Add configure option --disable-ccid-driver
[gnupg.git] / configure.ac
index 8b7f2c1..77b5f6e 100644 (file)
@@ -74,7 +74,7 @@ have_adns=no
 use_bzip2=yes
 use_exec=yes
 disable_keyserver_path=no
-
+use_ccid_driver=yes
 
 GNUPG_BUILD_PROGRAM(gpg, yes)
 GNUPG_BUILD_PROGRAM(gpgsm, yes)
@@ -298,6 +298,19 @@ AC_ARG_WITH(capabilities,
 [use_capabilities="$withval"],[use_capabilities=no])
 AC_MSG_RESULT($use_capabilities)
 
+
+#
+# Allow disabling of internal CCID support.
+# It is defined only after we confirm the library is available later
+#
+AC_MSG_CHECKING([whether to enable the internal CCID driver])
+AC_ARG_ENABLE(ccid-driver,
+              AC_HELP_STRING([--disable-ccid-driver],
+                             [disable the internal CCID driver]),
+              use_ccid_driver=$enableval)
+AC_MSG_RESULT($use_ccid_driver)
+
+
 #
 # To avoid double inclusion of config.h which might happen at some
 # places, we add the usual double inclusion protection at the top of
@@ -629,14 +642,16 @@ AM_PATH_KSBA("$NEED_KSBA_API:$NEED_KSBA_VERSION",have_ksba=yes,have_ksba=no)
 # libusb allows us to use the integrated CCID smartcard reader driver.
 #
 # FiXME: Use GNUPG_CHECK_LIBUSB and modify to use separate AC_SUBSTs.
-AC_CHECK_LIB(usb, usb_bulk_write,
-              [ LIBUSB_LIBS="$LIBUSB_LIBS -lusb"
-                AC_DEFINE(HAVE_LIBUSB,1,
-                         [defined if libusb is available])
-                have_libusb=yes
-             ])
+if test "$use_ccid_driver" = yes ; then
+  AC_CHECK_LIB(usb, usb_bulk_write,
+                [ LIBUSB_LIBS="$LIBUSB_LIBS -lusb"
+                  AC_DEFINE(HAVE_LIBUSB,1,
+                           [defined if libusb is available])
+                  have_libusb=yes
+               ])
+  AC_CHECK_FUNCS(usb_create_match)
+fi
 AC_SUBST(LIBUSB_LIBS)
-AC_CHECK_FUNCS(usb_create_match)
 
 #
 # Check wether it is necessary to link against libdl.