Deal with new pcsc-lite code changes.

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1845 c6295689-39f2-0310-b995-f0e70906c6a9
This commit is contained in:
aj 2004-07-20 20:52:21 +00:00
parent 16fc784ae9
commit c9dfe962b9
2 changed files with 19 additions and 4 deletions

View File

@ -541,11 +541,11 @@ if test "x$pcsc_path" = "xno"; then
PCSC_MSG="no"
fi
if test "x$pcsc_path" != "xno" -a "x$PCSC_MSG" != "xyes"; then
AC_MSG_CHECKING(for PC/SC Lite support)
PKG_CHECK_MODULES(PCSC, libpcscslite, [
PCSC_MSG="yes"
AC_MSG_RESULT($PCSC_MSG)
],[
AC_MSG_CHECKING(for PC/SC Lite support (old style))
for pcscdir in "" /pcsc /PCSC; do
CPPFLAGS="$saved_CPPFLAGS"
LDFLAGS="$saved_LDFLAGS"
@ -600,6 +600,21 @@ else
PCSC_CFLAGS=""
fi
if test "x$PCSC_MSG" = "xyes"; then
CFLAGS="$PCSC_CFLAGS $saved_CFLAGS"
LIBS="$PCSC_LIBS $saved_LIBS"
AC_TRY_LINK([
#include <stdlib.h>
#include <winscard.h>
], [
SCardControl(NULL, NULL, 0, NULL, 0);
], [
AC_DEFINE(HAVE_PCSC_OLD, 1, [old version of pc/sc-lite])
])
CFLAGS="$saved_CFLAGS"
LIBS="$saved_LIBS"
fi
OPENCT_MSG=no
openct_path=/usr
AC_SUBST(OPENCT_CFLAGS)
@ -616,11 +631,11 @@ if test "x$openct_path" = "xno"; then
OPENCT_MSG="no"
fi
if test "x$openct_path" != "xno" -a "x$OPENCT_MSG" != "xyes"; then
AC_MSG_CHECKING(for OpenCT support)
PKG_CHECK_MODULES(OPENCT, libopenct, [
OPENCT_MSG="yes"
AC_MSG_RESULT($OPENCT_MSG)
], [
AC_MSG_CHECKING(for OpenCT support (old style))
CPPFLAGS="$saved_CPPFLAGS"
LDFLAGS="$saved_LDFLAGS"
LIBS="$saved_LIBS"

View File

@ -150,7 +150,7 @@ static int pcsc_transmit(struct sc_reader *reader, struct sc_slot_info *slot,
rv = SCardTransmit(card, &sSendPci, sendbuf, dwSendLength,
&sRecvPci, recvbuf, &dwRecvLength);
} else {
#ifndef _WIN32
#ifdef HAVE_PCSC_OLD
rv = SCardControl(card, sendbuf, dwSendLength,
recvbuf, &dwRecvLength);
#else
@ -472,7 +472,7 @@ static int pcsc_init(struct sc_context *ctx, void **reader_data)
LONG rv;
DWORD reader_buf_size;
char *reader_buf, *p;
LPCSTR mszGroups = NULL;
const char *mszGroups = NULL;
SCARDCONTEXT pcsc_ctx;
int r, i;
struct pcsc_global_private_data *gpriv;