diff options
-rw-r--r-- | CMakeLists.txt | 20 | ||||
-rw-r--r-- | tdecore/tdehw/tdecryptographiccarddevice.cpp | 4 | ||||
-rw-r--r-- | tdecore/tdehw/tdecryptographiccarddevice_private.h | 4 |
3 files changed, 27 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index b4bd0036a..f9465a9c0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -97,6 +97,7 @@ option( WITH_CONSOLEKIT "Enable ConsoleKit support" ${WITH_ALL_OPTIONS} ) OPTION( WITH_NETWORK_MANAGER_BACKEND "Enable network-manager support" OFF ) OPTION( WITH_SUDO_TDESU_BACKEND "Use sudo as backend for tdesu (default is su)" OFF ) OPTION( WITH_OLD_XDG_STD "Use the pre R14.0.0 XDG standard where both TDE and KDE are recognized in desktop files" OFF ) +option( WITH_PCSC "Enable PC/SC SmartCard support" ${WITH_ALL_OPTIONS} ) OPTION( WITH_LZMA "Enable support for LZMA/XZ" ${WITH_ALL_OPTIONS} ) OPTION( WITH_LIBBFD "Enable pretty backtraces with libbfd from GNU binutils" OFF ) OPTION( WITH_XRANDR "Build the tderandr library" ON ) @@ -626,6 +627,25 @@ if( WITH_LZMA ) endif( WITH_LZMA ) +##### check for pcsc ############################ + +if( WITH_PCSC ) + find_path( PCSCLITE_INCLUDE_DIR pcsclite.h + HINTS /usr/include/PCSC ) + find_library( PCSCLITE_LIBRARY NAMES pcsclite libpcsclite PCSC ) + if( PCSCLITE_LIBRARY AND PCSCLITE_INCLUDE_DIR ) + message( STATUS "Found PCSCLITE: ${PCSCLITE_LIBRARY}" ) + set( PCSCLITE_FOUND 1 ) + set( PCSCLITE_INCLUDE_DIRS ${PCSCLITE_INCLUDE_DIR} ) + set( PCSCLITE_LIBRARIES ${PCSCLITE_LIBRARY} ) + endif( PCSCLITE_LIBRARY AND PCSCLITE_INCLUDE_DIR ) + if( NOT PCSCLITE_FOUND ) + tde_message_fatal( "PCSCLITE is requested, but not found on your system" ) + endif( NOT PCSCLITE_FOUND ) + set( HAVE_PCSC_SUPPORT 1 ) +endif( WITH_PCSC ) + + ##### check for jpeg ############################ find_package( JPEG ) diff --git a/tdecore/tdehw/tdecryptographiccarddevice.cpp b/tdecore/tdehw/tdecryptographiccarddevice.cpp index 9c827a1f6..7c8e3c7f4 100644 --- a/tdecore/tdehw/tdecryptographiccarddevice.cpp +++ b/tdecore/tdehw/tdecryptographiccarddevice.cpp @@ -38,6 +38,7 @@ /* FIXME * This is incomplete */ +#ifdef WITH_PCSC static TQString pcsc_error_code_to_string(long errcode) { if (errcode == SCARD_W_UNPOWERED_CARD) { return i18n("card not powered on"); @@ -49,6 +50,7 @@ static TQString pcsc_error_code_to_string(long errcode) { return TQString::null; } } +#endif CryptoCardDeviceWatcher::CryptoCardDeviceWatcher() { m_readerStates = NULL; @@ -170,6 +172,7 @@ void CryptoCardDeviceWatcher::requestTermination() { } TQString CryptoCardDeviceWatcher::getCardATR(TQString readerName) { +#ifdef WITH_PCSC unsigned int i; long ret; TQString atr_formatted; @@ -205,6 +208,7 @@ TQString CryptoCardDeviceWatcher::getCardATR(TQString readerName) { } return atr_formatted; +#endif } TDECryptographicCardDevice::TDECryptographicCardDevice(TDEGenericDeviceType::TDEGenericDeviceType dt, TQString dn) : TDEGenericDevice(dt, dn), diff --git a/tdecore/tdehw/tdecryptographiccarddevice_private.h b/tdecore/tdehw/tdecryptographiccarddevice_private.h index a82fe1ae5..6ee4cd34a 100644 --- a/tdecore/tdehw/tdecryptographiccarddevice_private.h +++ b/tdecore/tdehw/tdecryptographiccarddevice_private.h @@ -52,8 +52,10 @@ class CryptoCardDeviceWatcher : public TQObject private: bool m_terminationRequested; +#ifdef WITH_PCSC SCARDCONTEXT m_cardContext; SCARD_READERSTATE *m_readerStates; +#endif }; -#endif // _TDECRYPTOGRAPHICCARDDEVICE_PRIVATE_H
\ No newline at end of file +#endif // _TDECRYPTOGRAPHICCARDDEVICE_PRIVATE_H |