Index: aclocal/dc_pcsc.m4 ================================================================== --- aclocal/dc_pcsc.m4 +++ aclocal/dc_pcsc.m4 @@ -6,11 +6,11 @@ found_pcsclite=0 found_winscard=0 found_wintypes=0 - for headerpath in /usr/include /usr/local/include /usr/cac/include; do + for headerpath in /usr/include /usr/local/include /usr/cac/include /Developers/SDKs/*/System/Library/Frameworks/PCSC.framework/Versions/A/Headers; do for subdir in smartcard PCSC pcsc pcsclite ""; do headerdir="${headerpath}/${subdir}" CFLAGS="${SAVE_CFLAGS} -I${headerdir}" CPPFLAGS="${SAVE_CPPFLAGS} -I${headerdir}" @@ -62,21 +62,37 @@ CPPFLAGS="${SAVE_CPPFLAGS}${ADD_CPPFLAGS}" ]) AC_DEFUN(DC_PCSC_LIBS, [ foundlib="0" - for lib in pcsclite pcsc-lite pcsc; do - AC_CHECK_LIB(${lib}, SCardEstablishContext, [ - LIBS="${LIBS} -l${lib}" + + SAVELIBS="${LIBS}" + + AC_MSG_CHECKING([for how to link to PC/SC]) + + for lib in -lpcsclite -lpcsc-lite -lpcsc /Developer/SDKs/*/System/Library/Frameworks/PCSC.framework/PCSC; do + LIBS="${SAVELIBS} ${lib}" + + AC_LINK_IFELSE(AC_LANG_PROGRAM([[ +int SCardEstablishContext(void); +]], [[ + int x; + + x = SCardEstablishContext(); + ]]), [ + AC_MSG_RESULT([${lib}]) + LIBS="${SAVELIBS} ${lib}" foundlib="1" break ]) done if test "${foundlib}" = "0"; then + AC_MSG_RESULT(cant) + AC_MSG_WARN([unable to find PCSC library, compilation will likely fail.]) fi dnl Check for SCardIsValidContext, only in newer PCSC-Lite AC_CHECK_FUNCS(SCardIsValidContext)