- Updated PCSC test code; allow building --without-pcsc
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@949 c6295689-39f2-0310-b995-f0e70906c6a9
This commit is contained in:
parent
ec6c86512e
commit
496b30d30e
73
configure.in
73
configure.in
|
@ -738,60 +738,66 @@ fi
|
|||
|
||||
AM_CONDITIONAL(HAVE_SIA, test "x$SIA_MSG" = "xyes")
|
||||
|
||||
PCSC_MSG=no
|
||||
pcsc_path=/usr
|
||||
AC_SUBST(CFLAGS_PCSC)
|
||||
AC_SUBST(LIBPCSC)
|
||||
LIBPCSC="-lpcsclite"
|
||||
found_pcsclite=no
|
||||
saved_LIBS="$LIBS"
|
||||
saved_LDFLAGS="$LDFLAGS"
|
||||
saved_CPPFLAGS="$CPPFLAGS"
|
||||
LIBS="$LIBPCSC $saved_LIBS"
|
||||
AC_ARG_WITH(pcsclite,
|
||||
[ --with-pcsclite=PATH use PC/SC Lite in PATH],
|
||||
[
|
||||
AC_MSG_CHECKING([for SCardEstablishContext])
|
||||
[pcsc_path=$withval])
|
||||
|
||||
if test "$pcsc_path" != "no"; then
|
||||
AC_MSG_CHECKING(for PC/SC-Lite support)
|
||||
for pcscdir in /pcsc ""; do
|
||||
LDFLAGS="$saved_LDFLAGS"
|
||||
CPPFLAGS="$saved_CPPFLAGS"
|
||||
CFLAGS_PCSC=
|
||||
LIBS="-lpcsclite $saved_LIBS"
|
||||
|
||||
if test -d "$withval/lib$pcscdir"; then
|
||||
if test -n "${need_dash_r}"; then
|
||||
LDFLAGS="-L${withval}/lib${pcscdir}/ -R${withval}/lib${pcscdir}/ ${LDFLAGS}"
|
||||
else
|
||||
LDFLAGS="-L${withval}/lib${pcscdir} ${LDFLAGS}"
|
||||
for libdir in $pcsc_path/lib$pcscdir \
|
||||
$pcsc_path$pcscdir/lib \
|
||||
$pcsc_path$pcscdir; do
|
||||
if test -d $libdir; then
|
||||
if test -n "${need_dash_r}"; then
|
||||
LDFLAGS="-R${libdir}/ ${LDFLAGS}"
|
||||
fi
|
||||
LDFLAGS="-L${libdir} ${LDFLAGS}"
|
||||
fi
|
||||
else
|
||||
if test -n "${need_dash_r}"; then
|
||||
LDFLAGS="-L${withval}${pcscdir} -R${withval}${pcscdir} ${LDFLAGS}"
|
||||
else
|
||||
LDFLAGS="-L${withval}${pcscdir} ${LDFLAGS}"
|
||||
fi
|
||||
fi
|
||||
if test -d "$withval/include"; then
|
||||
CFLAGS_PCSC="-I${withval}/include${pcscdir} ${CFLAGS_PCSC}"
|
||||
else
|
||||
CFLAGS_PCSC="-I${withval}${pcscdir} ${CFLAGS_PCSC}"
|
||||
fi
|
||||
CPPFLAGS="$CFLAGS_PCSC $saved_CPPFLAGS"
|
||||
done
|
||||
|
||||
for incdir in $pcsc_path/include$pcscdir \
|
||||
$pcsc_path$pcscdir/include \
|
||||
$pcsc_path$pcscdir; do
|
||||
if test -d $incdir; then
|
||||
CFLAGS_PCSC="-I${incdir}"
|
||||
break;
|
||||
fi
|
||||
done
|
||||
|
||||
CPPFLAGS="${CFLAGS_PCSC} ${CPPFLAGS}"
|
||||
AC_TRY_LINK([#include <stdlib.h>
|
||||
#include <winscard.h>],[SCardEstablishContext(0, NULL, NULL, NULL);], ac_cv_lib_pcsclite_SCardEstablishContext=yes)
|
||||
CPPFLAGS="$saved_CPPFLAGS"
|
||||
if test "x$ac_cv_lib_pcsclite_SCardEstablishContext" = "xyes"; then
|
||||
AC_DEFINE(HAVE_LIBPCSCLITE)
|
||||
found_pcsclite=yes
|
||||
AC_DEFINE(HAVE_PCSCLITE, 1, [Have PC/SC Lite])
|
||||
PCSC_MSG=yes
|
||||
break;
|
||||
fi
|
||||
CPPFLAGS="$saved_CPPFLAGS"
|
||||
LDFLAGS="$saved_LDFLAGS"
|
||||
LIBS="$saved_LIBS"
|
||||
done
|
||||
if test "x$found_pcsclite" != "xyes" ; then
|
||||
AC_MSG_RESULT(no)
|
||||
AC_MSG_RESULT($PCSC_MSG)
|
||||
if test "x$PCSC_MSG" != "xyes" ; then
|
||||
AC_CHECK_LIB(pcsclite, SCardEstablishContext, ,
|
||||
AC_MSG_ERROR([*** PC/SC Lite missing - please install first]))
|
||||
else
|
||||
AC_MSG_RESULT(yes)
|
||||
LIBPCSC="-lpcsclite"
|
||||
fi
|
||||
]
|
||||
)
|
||||
if test "x$found_pcsclite" != "xyes" ; then
|
||||
AC_CHECK_LIB(pcsclite, SCardEstablishContext, , AC_MSG_ERROR([*** PC/SC Lite missing - please install first]))
|
||||
fi
|
||||
LIBS="$saved_LIBS"
|
||||
AM_CONDITIONAL(HAVE_PCSCLITE, test "x$ac_cv_lib_pcsclite_SCardEstablishContext" = "xyes")
|
||||
|
||||
# Check for user-specified random device, otherwise check /dev/urandom
|
||||
|
@ -1098,6 +1104,7 @@ echo "Libraries: ${LIBS}"
|
|||
echo ""
|
||||
echo "Random number collection: ${RAND_MSG}"
|
||||
echo "OpenSSL support: ${SSL_MSG}"
|
||||
echo "PC/SC support: ${PCSC_MSG}"
|
||||
echo "Assuan support: ${ASSUAN_MSG}"
|
||||
echo "LDAP support: ${LDAP_MSG}"
|
||||
echo "PAM support: ${PAM_MSG}"
|
||||
|
|
Loading…
Reference in New Issue