| 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.3.1) |
AC_INIT(ccid, 0.4.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 |
| 17 |
dnl Automake boilerplate. |
dnl Automake boilerplate. |
| 18 |
AC_CANONICAL_HOST |
AC_CANONICAL_HOST |
| 19 |
|
|
|
|
|
| 20 |
dnl create a config.h file (Automake will add -DHAVE_CONFIG_H) |
dnl create a config.h file (Automake will add -DHAVE_CONFIG_H) |
| 21 |
AM_CONFIG_HEADER(config.h) |
AM_CONFIG_HEADER(config.h) |
| 22 |
|
|
| 99 |
) |
) |
| 100 |
|
|
| 101 |
dnl check if libusb is available |
dnl check if libusb is available |
| 102 |
AC_SUBST(LIBUSB) |
if test "${use_libusb}" != false ; then |
| 103 |
AC_CHECK_HEADERS(usb.h, [], |
AC_SUBST(LIBUSB) |
| 104 |
[ AC_MSG_ERROR([usb.h not found, use --enable-libusb=PATH]) ]) |
AC_CHECK_HEADERS(usb.h, [], |
| 105 |
|
[ AC_MSG_ERROR([usb.h not found, use --enable-libusb=PATH]) ]) |
| 106 |
ac_save_LIBS="$LIBS" |
|
| 107 |
LIBS="$LIBS $COREFOUNDATION $IOKIT" |
ac_save_LIBS="$LIBS" |
| 108 |
AC_CHECK_LIB(usb, usb_init, [LIBUSB="$LIBUSB -lusb"], |
LIBS="$LIBS $COREFOUNDATION $IOKIT" |
| 109 |
[ AC_MSG_ERROR([libusb not found]) ]) |
AC_CHECK_LIB(usb, usb_init, [LIBUSB="$LIBUSB -lusb"], |
| 110 |
LIBS="$ac_save_LIBS" |
[ AC_MSG_ERROR([libusb not found]) ]) |
| 111 |
|
LIBS="$ac_save_LIBS" |
| 112 |
|
|
| 113 |
|
ac_save_LIBS="$LIBS" |
| 114 |
|
LIBS="$LIBS $COREFOUNDATION $IOKIT" |
| 115 |
|
AC_CHECK_LIB(usb, usb_get_string_simple, [LIBUSB="$LIBUSB -lusb"], |
| 116 |
|
[ AC_MSG_ERROR([your libusb is too old. install version 0.1.7 or above]) ]) |
| 117 |
|
LIBS="$ac_save_LIBS" |
| 118 |
|
fi |
| 119 |
|
|
| 120 |
dnl check shat to use for dlopen |
dnl check shat to use for dlopen |
| 121 |
AC_SUBST(LIBDL) |
AC_SUBST(LIBDL) |
| 128 |
[ multithread="${enableval}" ], [ multithread=yes ] ) |
[ multithread="${enableval}" ], [ multithread=yes ] ) |
| 129 |
|
|
| 130 |
if test "${multithread}" != no ; then |
if test "${multithread}" != no ; then |
| 131 |
AC_CHECK_HEADERS(pthread.h, [], [ AC_MSG_ERROR([pthread.h not found]) ]) |
ACX_PTHREAD( |
| 132 |
AC_CHECK_LIB(pthread, pthread_mutex_lock, [ LIBS="$LIBS -lpthread" ], |
[ AC_DEFINE(HAVE_PTHREAD, 1, |
| 133 |
[ multithread=no ]) |
[Define if you have POSIX threads libraries and header files.]) |
| 134 |
|
], [ AC_MSG_ERROR([POSIX thread support required]) ]) |
| 135 |
fi |
fi |
| 136 |
AC_MSG_RESULT([multi threading : $multithread]) |
AC_MSG_RESULT([multi threading : $multithread]) |
| 137 |
|
|
| 149 |
dnl --enable-usbdropdir=DIR |
dnl --enable-usbdropdir=DIR |
| 150 |
AC_ARG_ENABLE(usbdropdir, |
AC_ARG_ENABLE(usbdropdir, |
| 151 |
AC_HELP_STRING([--enable-usbdropdir=DIR],[directory containing USB |
AC_HELP_STRING([--enable-usbdropdir=DIR],[directory containing USB |
| 152 |
drivers (default /usr/local/pcsc/drivers)]), |
drivers (default $(prefix)/pcsc/drivers)]), |
| 153 |
[usbdropdir="${enableval}"], [usbdropdir=false]) |
[usbdropdir="${enableval}"], [usbdropdir=false]) |
| 154 |
if test "${usbdropdir}" = false ; then |
if test "${usbdropdir}" = false ; then |
| 155 |
usbdropdir="/usr/local/pcsc/drivers" |
if test "$prefix" = NONE ; then |
| 156 |
|
usbdropdir="$ac_default_prefix/pcsc/drivers" |
| 157 |
|
else |
| 158 |
|
usbdropdir="$prefix/pcsc/drivers" |
| 159 |
|
fi |
| 160 |
fi |
fi |
| 161 |
AC_MSG_RESULT([USB drop directory : $usbdropdir]) |
AC_MSG_RESULT([USB drop directory : $usbdropdir]) |
| 162 |
AC_DEFINE_UNQUOTED(PCSCLITE_HP_DROPDIR, "$usbdropdir", [directory containing USB drivers]) |
AC_DEFINE_UNQUOTED(PCSCLITE_HP_DROPDIR, "$usbdropdir", [directory containing USB drivers]) |
| 163 |
|
|
| 164 |
|
dnl --enable-ccidtwindir=DIR |
| 165 |
|
AC_ARG_ENABLE(ccidtwindir, |
| 166 |
|
AC_HELP_STRING([--enable-ccidtwindir=DIR],[directory to install the |
| 167 |
|
serial Twin driver (default $(prefix)/pcsc/drivers/serial)]), |
| 168 |
|
[ccidtwindir="${enableval}"], [ccidtwindir=false]) |
| 169 |
|
if test "${ccidtwindir}" = false ; then |
| 170 |
|
if test "$prefix" = NONE ; then |
| 171 |
|
ccidtwindir="$ac_default_prefix/pcsc/drivers/serial" |
| 172 |
|
else |
| 173 |
|
ccidtwindir="$prefix/pcsc/drivers/serial" |
| 174 |
|
fi |
| 175 |
|
fi |
| 176 |
|
AC_MSG_RESULT([serial twin install dir : $ccidtwindir]) |
| 177 |
|
AC_DEFINE_UNQUOTED(PCSCLITE_HP_DROPDIR, "$ccidtwindir", [directory containing USB drivers]) |
| 178 |
|
|
| 179 |
|
|
| 180 |
dnl --enable-debugcritical |
dnl --enable-debugcritical |
| 181 |
AC_ARG_ENABLE(debugcritical, |
AC_ARG_ENABLE(debugcritical, |
| 182 |
AC_HELP_STRING([--enable-debugcritical],[print critical debug |
AC_HELP_STRING([--enable-debugcritical],[print critical debug |
| 237 |
AC_SUBST(ac_aux_dir) |
AC_SUBST(ac_aux_dir) |
| 238 |
AC_SUBST(bundle) |
AC_SUBST(bundle) |
| 239 |
AC_SUBST(usbdropdir) |
AC_SUBST(usbdropdir) |
| 240 |
|
AC_SUBST(ccidtwindir) |
| 241 |
|
|
| 242 |
dnl Write Makefiles. |
dnl Write Makefiles. |
| 243 |
AC_CONFIG_FILES(Makefile src/Makefile readers/Makefile) |
AC_CONFIG_FILES(Makefile aclocal/Makefile src/Makefile readers/Makefile) |
| 244 |
AC_OUTPUT |
AC_OUTPUT |
| 245 |
|
|