Index: aclocal/Makefile ================================================================== --- aclocal/Makefile +++ aclocal/Makefile @@ -1,2 +1,2 @@ -../aclocal.m4: acx_pthread.m4 dc_shobjs.m4 +../aclocal.m4: acx_pthread.m4 dc_shobjs.m4 dc_pcscheaders.m4 cat $^ > "$@" ADDED aclocal/dc_pcscheaders.m4 Index: aclocal/dc_pcscheaders.m4 ================================================================== --- aclocal/dc_pcscheaders.m4 +++ aclocal/dc_pcscheaders.m4 @@ -0,0 +1,32 @@ +AC_DEFUN(DC_PCSC_HEADERS, [ + SAVE_CFLAGS="${CFLAGS}" + SAVE_CPPFLAGS="${CPPFLAGS}" + ADD_CFLAGS="" + ADD_CPPFLAGS="" + + for headerpath in /usr/include /usr/local/include /usr/cac/include; do + for subdir in smartcard PCSC pcsc pcsclite ""; do + headerdir="${headerpath}/${subdir}" + CFLAGS="${SAVE_CFLAGS} -I${headerdir}" + CPPFLAGS="${SAVE_CPPFLAGS} -I${headerdir}" + + unset ac_cv_header_pcsclite_h + + AC_CHECK_HEADER(pcsclite.h, [ + AC_DEFINE(HAVE_PCSCLITE_H, [1], [Define if you have the PCSC-Lite header file (you should)]) + + ADD_CFLAGS=" -I${headerdir}" + ADD_CPPFLAGS=" -I${headerdir}" + + break + ]) + done + + if test -n "${ADD_CFLAGS}" -o -n "${ADD_CPPFLAGS}"; then + break + fi + done + + CFLAGS="${SAVE_CFLAGS}${ADD_CFLAGS}" + CPPFLAGS="${SAVE_CPPFLAGS}${ADD_CPPFLAGS}" +]) Index: cackey.c ================================================================== --- cackey.c +++ cackey.c @@ -1,3 +1,9 @@ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #ifdef HAVE_PCSCLITE_H #include #endif + + Index: configure.ac ================================================================== --- configure.ac +++ configure.ac @@ -60,14 +60,17 @@ #endif #ifdef HAVE_PTHREAD_H # include #endif ]) + +dnl Check for PC/SC headers +DC_PCSC_HEADERS dnl Upate LDFLAGS to include setting the run-time linker path to the same as our compile-time linker DC_SYNC_RPATH dnl If we updated LIBOBJS, update SHLIBOBJS -- must be last. DC_SYNC_SHLIBOBJS dnl Produce Makefile AC_OUTPUT(Makefile)