| 6 |
dnl Require autoconf 2.52 |
dnl Require autoconf 2.52 |
| 7 |
AC_PREREQ(2.52) |
AC_PREREQ(2.52) |
| 8 |
|
|
| 9 |
AC_INIT(ccid, 0.4.2) |
AC_INIT(ccid, 0.9.2) |
| 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 |
AC_CHECK_PROG([PKGCONFIG], [pkg-config], [yes]) |
|
| 34 |
|
dnl check pcsc-lite version |
| 35 |
|
PKG_CHECK_MODULES(PCSC, libpcsclite >= 1.2.9-beta5, [], |
| 36 |
|
[ if test -f /usr/local/lib/pkgconfig/libpcsclite.pc ; then |
| 37 |
|
AC_MSG_ERROR([use PKG_CONFIG_PATH=/usr/local/lib/pkgconfig ./configure]) |
| 38 |
|
else |
| 39 |
|
AC_MSG_WARN([install pcsc-lite 1.2.9-beta5 or later]) |
| 40 |
|
fi |
| 41 |
|
]) |
| 42 |
|
|
| 43 |
|
OLD_CFLAGS="$CFLAGS" |
| 44 |
|
CFLAGS="$CFLAGS $PCSC_CFLAGS" |
| 45 |
|
AC_CHECK_HEADER(ifdhandler.h,, |
| 46 |
|
[AC_MSG_ERROR([ifdhandler.h not found, install pcsc-lite 1.2.9-beta5 or later, or use CFLAGS=... ./configure])], |
| 47 |
|
[ #include <ifdhandler.h> ]) |
| 48 |
|
CFLAGS="$OLD_CFLAGS" |
| 49 |
|
|
| 50 |
dnl Add libtool support. |
dnl Add libtool support. |
| 51 |
AM_PROG_LIBTOOL |
AM_PROG_LIBTOOL |
| 58 |
AC_CHECK_HEADERS(errno.h fcntl.h stdlib.h unistd.h termios.h string.h errno.h sys/time.h sys/types.h stdarg.h,, |
AC_CHECK_HEADERS(errno.h fcntl.h stdlib.h unistd.h termios.h string.h errno.h sys/time.h sys/types.h stdarg.h,, |
| 59 |
[AC_MSG_WARN([some header files not found])]) |
[AC_MSG_WARN([some header files not found])]) |
| 60 |
|
|
|
AC_CHECK_HEADERS(pcsclite.h,, |
|
|
[AC_MSG_ERROR([pcsclite.h not found, install pcsc-lite])]) |
|
|
|
|
|
AC_CHECK_HEADERS(ifdhandler.h,, |
|
|
[AC_MSG_ERROR([ifdhandler.h not found, install pcsc-lite 1.2.9-beta3 or later])], |
|
|
[ #include <pcsclite.h> ]) |
|
|
|
|
|
|
|
| 61 |
dnl Checks for typedefs, structures, and compiler characteristics. |
dnl Checks for typedefs, structures, and compiler characteristics. |
| 62 |
AC_C_CONST |
AC_C_CONST |
| 63 |
AC_TYPE_SIZE_T |
AC_TYPE_SIZE_T |
| 90 |
AM_CONDITIONAL(NEED_PARSER, false) |
AM_CONDITIONAL(NEED_PARSER, false) |
| 91 |
esac |
esac |
| 92 |
|
|
| 93 |
CFLAGS="$CFLAGS -Wall -fno-common" |
CFLAGS="$CFLAGS -Wall" |
| 94 |
|
|
| 95 |
dnl --enable-libusb=PATH |
dnl --enable-libusb=PATH |
| 96 |
AC_ARG_ENABLE(libusb, |
AC_ARG_ENABLE(libusb, |
| 129 |
LIBS="$ac_save_LIBS" |
LIBS="$ac_save_LIBS" |
| 130 |
fi |
fi |
| 131 |
|
|
| 132 |
dnl check shat to use for dlopen |
dnl check what to use for dlopen |
| 133 |
AC_SUBST(LIBDL) |
AC_SUBST(LIBDL) |
| 134 |
AC_CHECK_LIB(dl, dlopen, [LIBDL="$LIBDL -ldl" ac_cv_func_dlopen_ldl=yes], ac_cv_func_dlopen_ldl=no) |
AC_CHECK_LIB(dl, dlopen, [LIBDL="$LIBDL -ldl" ac_cv_func_dlopen_ldl=yes], ac_cv_func_dlopen_ldl=no) |
| 135 |
|
|
| 164 |
drivers (default to pcscd config or $(prefix)/pcsc/drivers)]), |
drivers (default to pcscd config or $(prefix)/pcsc/drivers)]), |
| 165 |
[usbdropdir="${enableval}"], [usbdropdir=false]) |
[usbdropdir="${enableval}"], [usbdropdir=false]) |
| 166 |
if test "${usbdropdir}" = false ; then |
if test "${usbdropdir}" = false ; then |
| 167 |
if test "$prefix" = NONE ; then |
usbdropdir=`pkg-config libpcsclite --variable=usbdropdir` |
|
if test "$PKGCONFIG" = yes ; then |
|
|
usbdropdir=`pkg-config libpcsclite --variable=usbdropdir` |
|
|
else |
|
|
usbdropdir="" |
|
|
fi |
|
|
if test -z "$usbdropdir" ; then |
|
|
usbdropdir="$ac_default_prefix/pcsc/drivers" |
|
|
fi |
|
|
else |
|
|
usbdropdir="$prefix/pcsc/drivers" |
|
|
fi |
|
| 168 |
fi |
fi |
| 169 |
AC_MSG_RESULT([USB drop directory : $usbdropdir]) |
AC_MSG_RESULT([USB drop directory : $usbdropdir]) |
| 170 |
AC_DEFINE_UNQUOTED(PCSCLITE_HP_DROPDIR, "$usbdropdir", [directory containing USB drivers]) |
AC_DEFINE_UNQUOTED(PCSCLITE_HP_DROPDIR, "$usbdropdir", [directory containing USB drivers]) |
| 175 |
serial Twin driver (default to pcscd config or $(prefix)/pcsc/drivers/serial)]), |
serial Twin driver (default to pcscd config or $(prefix)/pcsc/drivers/serial)]), |
| 176 |
[ccidtwindir="${enableval}"], [ccidtwindir=false]) |
[ccidtwindir="${enableval}"], [ccidtwindir=false]) |
| 177 |
if test "${ccidtwindir}" = false ; then |
if test "${ccidtwindir}" = false ; then |
| 178 |
if test "$prefix" = NONE ; then |
ccidtwindir=`pkg-config libpcsclite --variable=usbdropdir`/serial |
|
if test "$PKGCONFIG" = yes ; then |
|
|
ccidtwindir=`pkg-config libpcsclite --variable=usbdropdir` |
|
|
else |
|
|
AC_MSG_RESULT([You should install pkg-config to get this configured automatically from pcsc-lite installation]) |
|
|
ccidtwindir="" |
|
|
fi |
|
|
if test -z "$ccidtwindir" ; then |
|
|
ccidtwindir="$ac_default_prefix/pcsc/drivers" |
|
|
fi |
|
|
ccidtwindir="$ccidtwindir/serial" |
|
|
else |
|
|
ccidtwindir="$prefix/pcsc/drivers/serial" |
|
|
fi |
|
| 179 |
fi |
fi |
| 180 |
AC_MSG_RESULT([serial twin install dir : $ccidtwindir]) |
AC_MSG_RESULT([serial twin install dir : $ccidtwindir]) |
| 181 |
AC_DEFINE_UNQUOTED(PCSCLITE_HP_DROPDIR, "$ccidtwindir", [directory containing USB drivers]) |
AC_DEFINE_UNQUOTED(PCSCLITE_HP_DROPDIR, "$ccidtwindir", [directory containing USB drivers]) |
| 182 |
|
|
| 183 |
|
dnl --enable-pcsclite |
| 184 |
|
AC_ARG_ENABLE(pcsclite, |
| 185 |
|
AC_HELP_STRING([--enable-pcsclite],[compile for pcsc-lite (default=yes)]), |
| 186 |
|
[ pcsclite=no ], [ pcsclite=yes ] ) |
| 187 |
|
|
| 188 |
|
if test "${pcsclite}" = no ; then |
| 189 |
|
AM_CONDITIONAL(WITHOUT_PCSC, true) |
| 190 |
|
AM_CONDITIONAL(NEED_PARSER, true) |
| 191 |
|
else |
| 192 |
|
AM_CONDITIONAL(WITHOUT_PCSC, false) |
| 193 |
|
fi |
| 194 |
|
AC_MSG_RESULT([compiled for pcsc-lite : $pcsclite]) |
| 195 |
|
|
| 196 |
|
|
| 197 |
dnl Setup dist stuff |
dnl Setup dist stuff |
| 198 |
AC_SUBST(ac_aux_dir) |
AC_SUBST(ac_aux_dir) |
| 201 |
AC_SUBST(ccidtwindir) |
AC_SUBST(ccidtwindir) |
| 202 |
|
|
| 203 |
dnl Write Makefiles. |
dnl Write Makefiles. |
| 204 |
AC_CONFIG_FILES(Makefile aclocal/Makefile src/Makefile readers/Makefile) |
AC_CONFIG_FILES(Makefile |
| 205 |
|
aclocal/Makefile |
| 206 |
|
src/Makefile |
| 207 |
|
readers/Makefile |
| 208 |
|
examples/Makefile) |
| 209 |
|
|
| 210 |
AC_OUTPUT |
AC_OUTPUT |
| 211 |
|
|