This breaks OS X/Darwin. I thus changed it to what is attached.
darwin-mingw64.diff
Description: Binary data
m. On 27.10.2008, at 21:16, [EMAIL PROTECTED] wrote:
Revision: 3590 Author: alonbl Date: 2008-10-27 20:16:28 +0100 (Mon, 27 Oct 2008) Log Message: ----------- Re-add pcsc-lite compile-time dependency Win64 changed the SCARDCONTEXT from LONG to ULONG_PTR, pcsc-lite did not follow this on 64bit platforms. This breaks the pcsc module. To solve this we use installed winscard.h in order to get proper declerations. As mingw32 does not have winscard.h we keep current types. mingw64 and pcsc-lite system have winscard.h. Modified Paths: -------------- trunk/configure.ac trunk/src/libopensc/Makefile.am trunk/src/libopensc/internal-winscard.h Modified: trunk/configure.ac =================================================================== --- trunk/configure.ac 2008-10-26 19:13:14 UTC (rev 3589) +++ trunk/configure.ac 2008-10-27 19:16:28 UTC (rev 3590) @@ -490,7 +490,17 @@ fi if test "${enable_pcsc}" = "yes"; then - AC_DEFINE([ENABLE_PCSC], [1], [Define if PC/SC is to be enabled]) + AC_ARG_VAR([PCSC_CFLAGS], [C compiler flags for pcsc]) + if test "${WIN32}" != "yes"; then + test -z "${PCSC_CFLAGS}" && PCSC_CFLAGS="-I/usr/include/PCSC" + fi + + saved_CFLAGS="${CFLAGS}" + CFLAGS="${CFLAGS} ${PCSC_CFLAGS}"+ # We must cope with mingw32 that does not have winscard.h mingw64 has it. + AC_CHECK_HEADERS([winscard.h],,[test "${WIN32}" != "yes" && AC_MSG_ERROR([winscard.h is required for pcsc])])+ CFLAGS="${saved_CFLAGS}" + if test "${with_pcsc_provider}" = "detect"; then case "${host}" in *-*-darwin*) @@ -507,6 +517,7 @@ DEFAULT_PCSC_PROVIDER="${with_pcsc_provider}" fiAC_DEFINE_UNQUOTED([DEFAULT_PCSC_PROVIDER], ["$ {DEFAULT_PCSC_PROVIDER}"], [Default PC/SC provider])+ AC_DEFINE([ENABLE_PCSC], [1], [Define if PC/SC is to be enabled]) fi dnl AM_PATH_LIBASSUAN([MINIMUM-VERSION, @@ -545,7 +556,10 @@ OPTIONAL_OPENCT_CFLAGS="${OPENCT_CFLAGS}" OPTIONAL_OPENCT_LIBS="${OPENCT_LIBS}" fi-test "${enable_pcsc}" = "yes" && OPENSC_FEATURES="$ {OPENSC_FEATURES} pcsc(${DEFAULT_PCSC_PROVIDER})"+if test "${enable_pcsc}" = "yes"; then + OPENSC_FEATURES="${OPENSC_FEATURES} pcsc(${DEFAULT_PCSC_PROVIDER})" + OPTIONAL_PCSC_CFLAGS="${PCSC_CFLAGS}" +fitest "${enable_nsplugin}" = "yes" && OPENSC_FEATURES="$ {OPENSC_FEATURES} nsplugin"AC_DEFINE_UNQUOTED([OPENSC_ETC_PATH], ["${full_sysconfdir}"], [etc path for libopensc])@@ -579,6 +593,7 @@ AC_SUBST([OPTIONAL_OPENSSL_LIBS]) AC_SUBST([OPTIONAL_OPENCT_CFLAGS]) AC_SUBST([OPTIONAL_OPENCT_LIBS]) +AC_SUBST([OPTIONAL_PCSC_CFLAGS]) AM_CONDITIONAL([SVN_CHECKOUT], [test "${svn_checkout}" = "yes"]) AM_CONDITIONAL([ENABLE_MAN], [test "${enable_man}" = "yes"]) @@ -671,6 +686,7 @@ OPENSSL_LIBS: ${OPENSSL_LIBS} OPENCT_CFLAGS: ${OPENCT_CFLAGS} OPENCT_LIBS: ${OPENCT_LIBS} +PCSC_CFLAGS: ${PCSC_CFLAGS} LIBASSUAN_CFLAGS: ${LIBASSUAN_CFLAGS} LIBASSUAN_LIBS: ${LIBASSUAN_LIBS} Modified: trunk/src/libopensc/Makefile.am =================================================================== --- trunk/src/libopensc/Makefile.am 2008-10-26 19:13:14 UTC (rev 3589) +++ trunk/src/libopensc/Makefile.am 2008-10-27 19:16:28 UTC (rev 3590) @@ -16,7 +16,7 @@ pkgconfig_DATA = libopensc.pc libpkcs15init.pc libscconf.pc AM_CFLAGS = $(OPTIONAL_OPENSSL_CFLAGS) $(OPTIONAL_OPENCT_CFLAGS) \ - $(OPTIONAL_ZLIB_CFLAGS) $(LTLIB_CFLAGS) + $(OPTIONAL_PCSC_CFLAGS) $(OPTIONAL_ZLIB_CFLAGS) $(LTLIB_CFLAGS) INCLUDES = -I$(top_builddir)/src/include -I$(top_srcdir)/src/common libopensc_la_SOURCES = \ Modified: trunk/src/libopensc/internal-winscard.h ===================================================================--- trunk/src/libopensc/internal-winscard.h 2008-10-26 19:13:14 UTC (rev 3589) +++ trunk/src/libopensc/internal-winscard.h 2008-10-27 19:16:28 UTC (rev 3590)@@ -3,19 +3,6 @@ /* Mostly copied from pcsc-lite, this is the minimum required */ -#ifndef _WIN32 -#ifndef BYTE -typedef unsigned char BYTE; -#endif -typedef const void *LPCVOID; -typedef void *LPVOID; -typedef unsigned long DWORD; -typedef long LONG; -typedef const char *LPCSTR; -typedef BYTE *LPBYTE; -typedef DWORD *LPDWORD; -typedef char *LPSTR; -#endif #if defined(HAVE_INTTYPES_H) #include <inttypes.h> #elif defined(HAVE_STDINT_H) @@ -28,7 +15,11 @@ #warning no uint32_t type available, please contact [EMAIL PROTECTED] #endif -#ifndef _MSC_VER +#ifdef HAVE_WINSCARD_H +#include <winscard.h> +#else +/* mingw32 does not have winscard.h */ + #define MAX_ATR_SIZE 33 /**< Maximum ATR size */ #define SCARD_PROTOCOL_T0 0x0001 /**< T=0 active protocol. */ @@ -64,7 +55,6 @@#define SCARD_W_REMOVED_CARD 0x80100069 /**< The smart card has been removed, so further communication is not possible. */#endif -#define SCARD_CTL_CODE(code) (0x42000000 + (code)) typedef const BYTE *LPCBYTE;typedef long SCARDCONTEXT; /**< \p hContext returned by SCardEstablishContext() */@@ -92,8 +82,12 @@ } SCARD_IO_REQUEST, *PSCARD_IO_REQUEST, *LPSCARD_IO_REQUEST; -#endif /* MSC_VER */ +typedef const SCARD_IO_REQUEST *LPCSCARD_IO_REQUEST; +typedef SCARD_READERSTATE_A SCARD_READERSTATE, *PSCARD_READERSTATE_A, + *LPSCARD_READERSTATE_A; +#endif /* HAVE_SCARD_H */ + #if defined(_WIN32) #define PCSC_API WINAPI #elif defined(USE_CYGWIN) @@ -102,10 +96,6 @@ #define PCSC_API #endif -typedef const SCARD_IO_REQUEST *LPCSCARD_IO_REQUEST; -typedef SCARD_READERSTATE_A SCARD_READERSTATE, *PSCARD_READERSTATE_A, - *LPSCARD_READERSTATE_A; -typedef LONG (PCSC_API *SCardEstablishContext_t)(DWORD dwScope, LPCVOID pvReserved1,LPCVOID pvReserved2, LPSCARDCONTEXT phContext); typedef LONG (PCSC_API *SCardReleaseContext_t)(SCARDCONTEXT hContext); @@ -133,6 +123,10 @@ /* Copied from pcsc-lite reader.h */ +#ifndef SCARD_CTL_CODE +#define SCARD_CTL_CODE(code) (0x42000000 + (code)) +#endif + /** * TeleTrust Class 2 reader tags */ _______________________________________________ opensc-commits mailing list [EMAIL PROTECTED] http://www.opensc-project.org/mailman/listinfo/opensc-commits
-- Martin Paljak http://martin.paljak.pri.ee +372.515.6495
_______________________________________________ opensc-devel mailing list opensc-devel@lists.opensc-project.org http://www.opensc-project.org/mailman/listinfo/opensc-devel