| 6 |
# Require autoconf 2.52 |
# Require autoconf 2.52 |
| 7 |
AC_PREREQ(2.52) |
AC_PREREQ(2.52) |
| 8 |
|
|
| 9 |
AC_INIT(ccid, 1.0.1) |
AC_INIT(ccid, 1.2.1) |
| 10 |
AC_CONFIG_SRCDIR(src/ifdhandler.c) |
AC_CONFIG_SRCDIR(src/ifdhandler.c) |
| 11 |
AC_CONFIG_AUX_DIR(build) |
AC_CONFIG_AUX_DIR(build) |
| 12 |
AM_INIT_AUTOMAKE |
AM_INIT_AUTOMAKE |
| 30 |
AC_PROG_MAKE_SET |
AC_PROG_MAKE_SET |
| 31 |
AC_PROG_LN_S |
AC_PROG_LN_S |
| 32 |
AM_PROG_LEX |
AM_PROG_LEX |
| 33 |
|
PKG_PROG_PKG_CONFIG |
| 34 |
|
|
| 35 |
# check pcsc-lite version |
# check pcsc-lite version |
| 36 |
PKG_CHECK_MODULES(PCSC, libpcsclite >= 1.2.9-beta9, [], |
PCSC_NEEDED_VERSION="1.3.3" |
| 37 |
|
PKG_CHECK_MODULES(PCSC, libpcsclite >= $PCSC_NEEDED_VERSION, [], |
| 38 |
[ AC_MSG_RESULT([no]) |
[ AC_MSG_RESULT([no]) |
| 39 |
if test -f /usr/local/lib/pkgconfig/libpcsclite.pc -a "x$PKG_CONFIG" != x ; then |
if test -f /usr/local/lib/pkgconfig/libpcsclite.pc -a "x$PKG_CONFIG" != x ; then |
| 40 |
AC_MSG_ERROR([use PKG_CONFIG_PATH=/usr/local/lib/pkgconfig ./configure]) |
AC_MSG_ERROR([use PKG_CONFIG_PATH=/usr/local/lib/pkgconfig ./configure]) |
| 41 |
else |
else |
| 42 |
AC_MSG_WARN([install pcsc-lite 1.2.9-beta9 or later]) |
AC_MSG_WARN([install pcsc-lite $PCSC_NEEDED_VERSION or later]) |
| 43 |
fi |
fi |
| 44 |
]) |
]) |
| 45 |
|
|
| 46 |
saved_CPPFLAGS="$CPPFLAGS" |
saved_CPPFLAGS="$CPPFLAGS" |
| 47 |
CPPFLAGS="$CPPFLAGS $PCSC_CFLAGS" |
CPPFLAGS="$CPPFLAGS $PCSC_CFLAGS" |
| 48 |
AC_CHECK_HEADER(ifdhandler.h,, |
AC_CHECK_HEADER(ifdhandler.h,, |
| 49 |
[AC_MSG_ERROR([ifdhandler.h not found, install pcsc-lite 1.2.9-beta9 or later, or use ./configure PCSC_CFLAGS=...])], |
[AC_MSG_ERROR([ifdhandler.h not found, install pcsc-lite $PCSC_NEEDED_VERSION or later, or use ./configure PCSC_CFLAGS=...])]) |
| 50 |
[ #include <ifdhandler.h> ]) |
AC_CHECK_DECL(IFD_NO_SUCH_DEVICE,, [AC_MSG_ERROR([install pcsc-lite $PCSC_NEEDED_VERSION or later])], [#include <ifdhandler.h>]) |
| 51 |
AC_CHECK_HEADER(reader.h,, |
AC_CHECK_HEADER(reader.h,, |
| 52 |
[AC_MSG_ERROR([reader.h not found, install pcsc-lite 1.2.9-beta9 or later, or use ./configure PCSC_CFLAGS=...])], |
[AC_MSG_ERROR([reader.h not found, install pcsc-lite $PCSC_NEEDED_VERSION or later, or use ./configure PCSC_CFLAGS=...])]) |
|
[ #include <reader.h> ]) |
|
| 53 |
CPPFLAGS="$saved_CPPFLAGS" |
CPPFLAGS="$saved_CPPFLAGS" |
| 54 |
|
|
| 55 |
# Add libtool support. |
# Add libtool support. |
| 154 |
|
|
| 155 |
AC_MSG_RESULT([use libusb : $use_libusb]) |
AC_MSG_RESULT([use libusb : $use_libusb]) |
| 156 |
|
|
|
# check what to use for dlopen |
|
|
AC_SUBST(LIBDL) |
|
|
AC_CHECK_LIB(dl, dlopen, [LIBDL="$LIBDL -ldl" ac_cv_func_dlopen_ldl=yes], ac_cv_func_dlopen_ldl=no) |
|
|
|
|
| 157 |
# check if the compiler support -fvisibility=hidden (GCC >= 4) |
# check if the compiler support -fvisibility=hidden (GCC >= 4) |
| 158 |
saved_CFLAGS="$CFLAGS" |
saved_CFLAGS="$CFLAGS" |
| 159 |
CFLAGS="$CFLAGS -fvisibility=hidden" |
CFLAGS="$CFLAGS -fvisibility=hidden" |
| 205 |
AC_MSG_ERROR([use --enable-usbdropdir=DIR]) |
AC_MSG_ERROR([use --enable-usbdropdir=DIR]) |
| 206 |
fi |
fi |
| 207 |
|
|
| 208 |
|
# --enable-twinserial |
| 209 |
|
AC_ARG_ENABLE(twinserial, |
| 210 |
|
AC_HELP_STRING([--enable-twinserial],[also compile and install the serial Twin driver]), |
| 211 |
|
[twinserial="${enableval}"], [twinserial=no]) |
| 212 |
|
AC_MSG_RESULT([build and install serial Twin driver : $twinserial]) |
| 213 |
|
AM_CONDITIONAL(WITH_TWIN_SERIAL, test "${twinserial}" != "no") |
| 214 |
|
|
| 215 |
# --enable-ccidtwindir=DIR |
# --enable-ccidtwindir=DIR |
| 216 |
AC_ARG_ENABLE(ccidtwindir, |
AC_ARG_ENABLE(ccidtwindir, |
| 217 |
AC_HELP_STRING([--enable-ccidtwindir=DIR],[directory to install the |
AC_HELP_STRING([--enable-ccidtwindir=DIR],[directory to install the |
| 227 |
AC_HELP_STRING([--disable-pcsclite],[do not use pcsc-lite debug support]), |
AC_HELP_STRING([--disable-pcsclite],[do not use pcsc-lite debug support]), |
| 228 |
[ pcsclite="${enableval}" ], [ pcsclite=yes ] ) |
[ pcsclite="${enableval}" ], [ pcsclite=yes ] ) |
| 229 |
|
|
| 230 |
if test "${pcsclite}" = no ; then |
if test "${pcsclite}" != no ; then |
|
AM_CONDITIONAL(WITHOUT_PCSC, true) |
|
|
else |
|
| 231 |
# check that pcsc-lite is installed |
# check that pcsc-lite is installed |
| 232 |
OLD_LIBS="$LIBS" |
OLD_LIBS="$LIBS" |
| 233 |
LIBS="$LIBS $PCSC_LIBS" |
LIBS="$LIBS $PCSC_LIBS" |
| 234 |
AC_CHECK_LIB(pcsclite, SCardEstablishContext, [], |
AC_MSG_CHECKING([for SCardEstablishContext]) |
| 235 |
[AC_MSG_ERROR([SCardEstablishContext() not found, install pcsc-lite 1.2.9-beta9 or later, or use PCSC_LIBS=... ./configure])]) |
AC_TRY_LINK_FUNC(SCardEstablishContext, |
| 236 |
|
[ AC_MSG_RESULT([yes]) ], |
| 237 |
|
[ AC_MSG_ERROR([SCardEstablishContext() not found, install pcsc-lite 1.2.9-beta9 or later,or use LDLIBS=... ./configure]) ]) |
| 238 |
LIBS="$OLD_LIBS" |
LIBS="$OLD_LIBS" |
| 239 |
|
|
|
AM_CONDITIONAL(WITHOUT_PCSC, false) |
|
|
|
|
| 240 |
pcsclite=yes |
pcsclite=yes |
| 241 |
fi |
fi |
| 242 |
AC_MSG_RESULT([compiled for pcsc-lite : $pcsclite]) |
AC_MSG_RESULT([compiled for pcsc-lite : $pcsclite]) |
| 243 |
|
AM_CONDITIONAL(WITHOUT_PCSC, test "${pcsclite}" != "yes") |
| 244 |
|
|
| 245 |
|
# --enable-udev |
| 246 |
|
AC_ARG_ENABLE(udev, |
| 247 |
|
AC_HELP_STRING([--enable-udev],[udev support for pcscd hotplug]), |
| 248 |
|
[udev="${enableval}"], [udev=no]) |
| 249 |
|
AC_MSG_RESULT([udev support : $udev]) |
| 250 |
|
AM_CONDITIONAL(UDEV, test "${udev}" != "no") |
| 251 |
|
|
| 252 |
|
|
| 253 |
# Setup dist stuff |
# Setup dist stuff |