implemented my own version of libpcsclite

Allows customizing of the default adress to which vpcd or libpcsclite
connect to.

My libpcsclite is currently not thread safe. It should not be installed
together with PCSC-Lite since both packages have conflicting files. Use
./configure --enable-libpcsclite to use my version. Use ./configure
--enable-vpcdhost=ADRESS to define connection mode and adress of vpicc.
This commit is contained in:
Frank Morgner
2013-07-18 14:03:47 +02:00
parent 291178d139
commit cdf68d62b3
17 changed files with 2270 additions and 54 deletions

View File

@@ -43,54 +43,83 @@ m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
# Checks for libraries.
PKG_CHECK_EXISTS([libpcsclite],
[PKG_CHECK_MODULES([PCSC], [libpcsclite])],
[AC_MSG_WARN([libpcsclite not found by pkg-config])])
saved_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $PCSC_CFLAGS"
AC_CHECK_HEADERS(ifdhandler.h,,
[ AC_MSG_ERROR([ifdhandler.h not found, install libpcsclite or use ./configure PCSC_CFLAGS=...]) ])
CPPFLAGS="$saved_CPPFLAGS"
# --enable-libpcsclite
AC_ARG_ENABLE(libpcsclite,
AC_HELP_STRING([--enable-libpcsclite=DIR],[Build a lightweight version of
libpcsclite, conflicts with PCSC-Lite @<:@default=no@:>@]),
[libpcsclite="${enableval}"], [libpcsclite=no])
if test "${libpcsclite}" = no ; then
PKG_CHECK_EXISTS([libpcsclite],
[PKG_CHECK_MODULES([PCSC], [libpcsclite])],
[AC_MSG_WARN([libpcsclite not found by pkg-config])])
saved_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $PCSC_CFLAGS"
AC_CHECK_HEADERS(ifdhandler.h,,
[ AC_MSG_ERROR([ifdhandler.h not found, install libpcsclite or use ./configure PCSC_CFLAGS=...]) ])
CPPFLAGS="$saved_CPPFLAGS"
# --enable-serialdropdir=DIR
AC_ARG_ENABLE(serialdropdir,
AC_HELP_STRING([--enable-serialdropdir=DIR],[directory to install the
serial wrapper driver (default to pcscd config or $(prefix)/pcsc/drivers/serial)]),
[serialdropdir="${enableval}"], [serialdropdir=false])
if test "${serialdropdir}" = false ; then
if test "${prefix}" = NONE ; then
serialdropdir="`$PKG_CONFIG libpcsclite --variable=usbdropdir`/serial"
if test "${serialdropdir}" = "/serial" ; then
AC_MSG_ERROR([use --enable-serialdropdir=DIR])
fi
else
serialdropdir="${prefix}`$PKG_CONFIG libpcsclite --variable=usbdropdir`/serial"
if test "${serialdropdir}" = "${prefix}/serial" ; then
AC_MSG_ERROR([use --enable-serialdropdir=DIR])
# --enable-serialdropdir=DIR
AC_ARG_ENABLE(serialdropdir,
AC_HELP_STRING([--enable-serialdropdir=DIR],[directory to install the
serial wrapper driver (default to pcscd config or $(prefix)/pcsc/drivers/serial)]),
[serialdropdir="${enableval}"], [serialdropdir=no])
if test "${serialdropdir}" = no ; then
if test "${prefix}" = NONE ; then
serialdropdir="`$PKG_CONFIG libpcsclite --variable=usbdropdir`/serial"
if test "${serialdropdir}" = "/serial" ; then
AC_MSG_ERROR([use --enable-serialdropdir=DIR])
fi
else
serialdropdir="${prefix}`$PKG_CONFIG libpcsclite --variable=usbdropdir`/serial"
if test "${serialdropdir}" = "${prefix}/serial" ; then
AC_MSG_ERROR([use --enable-serialdropdir=DIR])
fi
fi
fi
# --enable-serialconfdir=DIR
AC_ARG_ENABLE(serialconfdir,
AC_HELP_STRING([--enable-serialconfdir=DIR],[directory to install the
serial wrapper driver (default to pcscd config or /etc/reader.conf.d)]),
[serialconfdir="${enableval}"], [serialconfdir=no])
if test "${serialconfdir}" = no ; then
if test "${prefix}" = NONE ; then
serialconfdir="`$PKG_CONFIG libpcsclite --variable=serialconfdir`"
if test "${serialconfdir}" = "" ; then
serialconfdir="/etc/reader.conf.d"
fi
else
serialconfdir="${prefix}`$PKG_CONFIG libpcsclite --variable=serialconfdir`"
if test "${serialconfdir}" = "${prefix}" ; then
serialconfdir="${prefix}/etc/reader.conf.d"
fi
fi
fi
else
builddir="`pwd`"
PCSC_CFLAGS="-DNO_LOG -I${builddir}/${srcdir}/src/libpcsclite/PCSC -I${builddir}/${srcdir}/src/libpcsclite"
PCSC_LIBS="$builddir/src/libpcsclite/libpcsclite.la"
AC_SUBST(PCSC_CFLAGS)
AC_SUBST(PCSC_LIBS)
fi
# --enable-serialconfdir=DIR
AC_ARG_ENABLE(serialconfdir,
AC_HELP_STRING([--enable-serialconfdir=DIR],[directory to install the
serial wrapper driver (default to pcscd config or /etc/reader.conf.d)]),
[serialconfdir="${enableval}"], [serialconfdir=false])
if test "${serialconfdir}" = false ; then
if test "${prefix}" = NONE ; then
serialconfdir="`$PKG_CONFIG libpcsclite --variable=serialconfdir`"
if test "${serialconfdir}" = "" ; then
serialconfdir="/etc/reader.conf.d"
fi
else
serialconfdir="${prefix}`$PKG_CONFIG libpcsclite --variable=serialconfdir`"
if test "${serialconfdir}" = "${prefix}" ; then
serialconfdir="${prefix}/etc/reader.conf.d"
fi
fi
# --enable-vpcdhost
AC_ARG_ENABLE(vpcdhost,
AC_HELP_STRING([--enable-vpcdhost=ADRESS],[Default address to connect to when
communicating with vicc. Use "/dev/null" if vpcd shall open
the socket and wait for an incoming connection.
@<:@default=/dev/null@:>@]),
[vpcdhost="${enableval}"], [vpcdhost=/dev/null])
AC_SUBST(vpcdhost)
if test "${vpcdhost}" = "/dev/null"; then
AC_DEFINE_UNQUOTED(VPCDHOST, NULL, [OpenPICC character device])
else
AC_DEFINE_UNQUOTED(VPCDHOST, "${vpcdhost}", [OpenPICC character device])
fi
@@ -104,12 +133,15 @@ AC_CHECK_HEADERS([arpa/inet.h stdint.h stdlib.h string.h sys/socket.h sys/time.h
# Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_SIZE_T
AC_TYPE_UINT16_T
AC_CHECK_DECLS([SO_NOSIGPIPE], [], [], [#include <sys/socket.h>])
AC_CHECK_DECLS([MSG_NOSIGNAL], [], [], [#include <sys/socket.h>])
# Checks for library functions.
AC_FUNC_MALLOC
AC_CHECK_FUNCS([memset select socket])
# Select OS specific versions of source files.
AM_CONDITIONAL([BUILD_LIBPCSCLITE], [test "${libpcsclite}" = "yes"])
AC_SUBST(BUNDLE_HOST)
AC_SUBST(DYN_LIB_EXT)
AC_SUBST(LIB_PREFIX)
@@ -159,8 +191,11 @@ ${PACKAGE} has been configured with following options:
Version: ${PACKAGE_VERSION}
User binaries: $(eval eval eval echo "${bindir}")
PC/SC configuration: ${serialconfdir}
Python site-packages: $(eval eval eval echo "${pythondir}")
Driver directory: ${serialdropdir}
Python site-packages: $(eval eval eval echo "${pythondir}")
Build libpcsclite: ${libpcsclite}
VPCD hostname: ${vpcdhost}
Host: ${host}
@@ -188,6 +223,7 @@ AC_CONFIG_FILES([Makefile
npa-example-data/dh/Makefile
npa-example-data/ecdh/Makefile
src/Makefile
src/libpcsclite/Makefile
src/vpcd/Makefile
src/vpicc/Makefile
])