Index: configure.ac ================================================================== --- configure.ac +++ configure.ac @@ -4,10 +4,11 @@ dnl Locate standard tools AC_PROG_CC AC_PROG_MAKE_SET AC_PROG_INSTALL AC_AIX +AC_LANG(C) dnl Determine this platform DC_CHK_OS_INFO dnl Determine how to create shared objects on this platform @@ -75,10 +76,67 @@ dnl Check for PC/SC headers and libraries DC_PCSC dnl Check for ZLIB libraries AC_CHECK_LIB(z, uncompress) + +dnl Verify that a basic program will compile +AC_MSG_CHECKING([if basic PC/SC program works]) +AC_LINK_IFELSE( + AC_LANG_PROGRAM([[ +#ifdef HAVE_PCSCLITE_H +# include +#endif +#ifdef HAVE_WINSCARD_H +# include +#endif +#ifdef HAVE_STDINT_H +# include +#endif +#ifdef HAVE_INTTYPES_H +# include +#endif +#ifdef HAVE_STDLIB_H +# include +#endif +#ifdef HAVE_UNISTD_H +# include +#endif +#ifdef HAVE_STRING_H +# include +#endif +#ifdef HAVE_PTHREAD_H +# include +#endif +#ifdef HAVE_LIMITS_H +# include +#endif +#ifdef HAVE_STDIO_H +# include +#endif +#ifdef HAVE_ZLIB_H +# ifdef HAVE_LIBZ +# include +# endif +#endif + ]], [[ + LPSCARDHANDLE hCard; + SCARDCONTEXT hContext; + DWORD dwActiveProtocol; + LONG scard_conn_ret, scard_est_context_ret; + + scard_est_context_ret = SCardEstablishContext(SCARD_SCOPE_SYSTEM, NULL, NULL, &hContext); + + scard_conn_ret = SCardConnect(hContext, "Reader X", SCARD_SHARE_SHARED, SCARD_PROTOCOL_T0, &hCard, &dwActiveProtocol); + ]]), [ + AC_MSG_RESULT(okay) + ], [ + AC_MSG_RESULT(failed) + + AC_MSG_FAILURE([simple PC/SC program failed]) + ] +) dnl Set version script, to limit the scope of symbols DC_SETVERSIONSCRIPT(libcackey.vers) dnl Upate LDFLAGS to include setting the run-time linker path to the same as our compile-time linker