2
# Process this file with autoconf to produce a configure script
6
AC_INIT(pcsc-lite, 1.2.9-beta9)
7
AC_CONFIG_SRCDIR(src/pcscdaemon.c)
9
AM_CONFIG_HEADER(config.h)
11
AC_CONFIG_MACRO_DIR(m4)
17
# Check for some target-specific stuff
20
CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE_EXTENDED"
23
CPPFLAGS="$CPPFLAGS -I/usr/local/include"
24
LDFLAGS="$LDFLAGS -L/usr/local/lib -R/usr/local/lib"
28
CPPFLAGS="$CPPFLAGS -DSUNOS4"
31
CPPFLAGS="$CPPFLAGS -I/usr/local/include"
32
LDFLAGS="$LDFLAGS -L/usr/local/lib"
33
if (test "$LD" != "gcc" && test -z "$blibpath"); then
34
blibpath="/usr/lib:/lib:/usr/local/lib"
38
CPPFLAGS="$CPPFLAGS -D_POSIX_PII_SOCKET"
41
AC_SUBST(COREFOUNDATION)
42
COREFOUNDATION="-Wl,-framework,CoreFoundation"
44
IOKIT="-Wl,-framework,IOKit"
45
if test "$GCC" = "yes"; then
46
CFLAGS="$CFLAGS -no-cpp-precomp"
49
AC_MSG_WARN([libusb disabled on Darwin for pcsc-lite])
62
AC_PATH_PROG(TEST_MINUS_S_SH, bash)
63
AC_PATH_PROG(TEST_MINUS_S_SH, ksh)
64
AC_PATH_PROG(TEST_MINUS_S_SH, sh)
66
# Special check for pthread support
69
AC_DEFINE(HAVE_PTHREAD, 1,
70
[Define if you have POSIX threads libraries and header files.])
72
AC_MSG_ERROR([POSIX thread support required])
75
LIBS="$PTHREAD_LIBS $LIBS"
76
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
79
AC_SUBST(PTHREAD_LIBS)
80
AC_SUBST(PTHREAD_CFLAGS)
84
# Automatically update the libtool script if it becomes out-of-date
85
#AC_SUBST(LIBTOOL_DEPS)
87
# Checks for header files
90
AC_CHECK_HEADERS([dirent.h dl.h dlfcn.h errno.h fcntl.h getopt.h malloc.h stdlib.h string.h strings.h sys/filio.h sys/time.h syslog.h unistd.h smartcard/scf.h])
92
# Checks for typedefs, structures, and compiler characteristics
98
# Checks for library functions
102
AC_CHECK_FUNCS(daemon flock getopt_long nanosleep strerror vsnprintf)
104
# strlcpy, strlcat from OpenBSD
105
AC_CHECK_FUNCS(strlcpy strlcat)
107
# C Compiler features
109
if test "$GCC" = "yes"; then
110
CFLAGS="-Wall -fno-common $CFLAGS"
114
AC_CHECK_LIB(dl, dlopen, [LIBDL="$LIBDL -ldl" ac_cv_func_dlopen_ldl=yes], ac_cv_func_dlopen_ldl=no)
116
# Use 'uname' output as an architecture define
123
AC_DEFINE_UNQUOTED(PCSC_ARCH, "$uname", [PC/SC target architecture])
124
AC_DEFINE_UNQUOTED(MSC_ARCH, "$uname", [MuscleCard target architecture])
126
# See if socket() is found from libsocket
127
AC_CHECK_LIB(socket, socket, [LIBS="$LIBS -lsocket"])
130
# --enable-libusb=DIR
131
AC_ARG_ENABLE(libusb,
132
AC_HELP_STRING([--enable-libusb=PATH],[enable USB hotplug using libusb]),
142
libusb_prefix=${enableval}
143
AC_CHECK_LIB(usb, usb_init, [LIBUSB="$LIBUSB -lusb" use_libusb=true ], [ use_libusb=false ], "-L${libusb_prefix}/lib")
144
AC_CHECK_HEADERS(${libusb_prefix}/include/usb.h, [ use_libusb=true ], [ use_libusb=false ])
145
if test x$use_libusb = xtrue; then
146
CPPFLAGS="$CPPFLAGS -I${libusb_prefix}/include"
147
LDFLAGS="$LDFLAGS -L${libusb_prefix}/lib"
154
# if use_libusb is not yet defined
155
if test x$use_libusb = x; then
156
# check if libusb is available
157
AC_CHECK_HEADERS(usb.h, [ use_libusb=true ], [ use_libusb=false ])
158
AC_CHECK_LIB(usb, usb_init, [LIBUSB="$LIBUSB -lusb" use_libusb=true ], [ use_libusb=false ])
161
AC_MSG_RESULT([enable libusb support : $use_libusb])
163
if test x$use_libusb = xtrue; then
164
AC_DEFINE(HAVE_LIBUSB,1, [Libusb is available])
167
# --enable-usbdropdir=DIR
168
AC_ARG_ENABLE(usbdropdir,
169
AC_HELP_STRING([--enable-usbdropdir=DIR],[directory containing USB
170
drivers (default /usr/local/pcsc/drivers)]),
171
[usbdropdir="${enableval}"], [usbdropdir=false])
172
if test x${usbdropdir} = xfalse ; then
173
if test "x$prefix" != xNONE; then
174
usbdropdir="$prefix/pcsc/drivers"
176
usbdropdir="$ac_default_prefix/pcsc/drivers"
179
AC_MSG_RESULT([enable USB drop directory : $usbdropdir])
180
AC_DEFINE_UNQUOTED(PCSCLITE_HP_DROPDIR, "$usbdropdir", [directory containing USB drivers])
183
AC_ARG_ENABLE(debugatr,
184
AC_HELP_STRING([--enable-debugatr],[enable ATR debug messages from pcscd]),
185
[ case "${enableval}" in
186
yes) debugatr=true ;;
187
no) debugatr=false ;;
188
*) AC_MSG_ERROR([bad value ${enableval} for --enable-debugatr]) ;;
189
esac], [debugatr=false])
191
AC_MSG_RESULT([enable ATR parsing messages : $debugatr])
193
if test x${debugatr} = xtrue ; then
194
AC_DEFINE(ATR_DEBUG, 1, [display ATR parsing debug messages.])
199
AC_HELP_STRING([--enable-scf],[use SCF for reader support]),
200
[ case "${enableval}" in
203
*) AC_MSG_ERROR([bad value ${enableval} for --enable-scf]) ;;
206
AC_SUBST(LIBSMARTCARD)
207
if test x$scf = xtrue -a x$ac_cv_header_smartcard_scf_h = xyes; then
208
AC_CHECK_LIB(smartcard, SCF_strerror, [LIBSMARTCARD="$LIBSMARTCARD -lsmartcard" scf=true], scf=false)
212
AC_MSG_RESULT([enable SCF reader support : $scf])
213
AM_CONDITIONAL(HAVE_SCF, test x$scf = xtrue)
215
# --enable-confdir=DIR
216
AC_ARG_ENABLE(confdir,
217
AC_HELP_STRING([--enable-confdir=DIR],[directory containing reader.conf
219
[confdir="${enableval}"], [confdir=false])
221
if test x${confdir} != xfalse ; then
222
AC_MSG_RESULT([enable confdir : $confdir])
225
AC_MSG_RESULT([enable confdir : /etc (default)])
228
# --enable-runpid=FILE
229
AC_ARG_ENABLE(runpid,
230
AC_HELP_STRING([--enable-runpid=FILE],[file containing pcscd pid]),
231
[runpid="${enableval}"], [runpid=false])
233
AC_MSG_RESULT([enable runpid : $runpid])
235
# HAVE_RUNPID is for pcscd.8
236
if test x${runpid} != xfalse ; then
237
AC_DEFINE_UNQUOTED(USE_RUN_PID, "$runpid", [file containing pcscd pid])
238
AC_SUBST(HAVE_RUNPID,'')
240
AC_SUBST(HAVE_RUNPID,'.\" ')
243
# --enable-ipcdir=DIR
244
AC_ARG_ENABLE(ipcdir,
245
AC_HELP_STRING([--enable-ipcdir=DIR],[directory containing IPC files
246
(default /var/run)]),
247
[ipcdir="${enableval}"], [ipcdir=false])
249
if test x${ipcdir} != xfalse ; then
250
AC_MSG_RESULT([enable ipcdir : $ipcdir])
252
AC_DEFINE_UNQUOTED(USE_IPCDIR, "$ipcdir", [directory containing IPC files (default /var/run)])
254
AC_MSG_RESULT([enable ipcdir : /var/run (default)])
257
# --enable-extendedapdu
258
AC_ARG_ENABLE(extendedapdu,
259
AC_HELP_STRING([--enable-extendedapdu], [support of extended APDU (for APDU 256B < size < 32KB)]),
260
[ case "${enableval}" in
261
yes) extendedapdu=true ;;
262
no) extendedapdu=false ;;
263
*) AC_MSG_ERROR([bad value ${enableval} for --enable-extendedapdu]) ;;
264
esac], [extendedapdu=false])
266
AC_MSG_RESULT([enable extended APDU : $extendedapdu])
268
if test x${extendedapdu} = xtrue ; then
269
extended_apdu="#define PCSCLITE_ENHANCED_MESSAGING"
271
extended_apdu="#undef PCSCLITE_ENHANCED_MESSAGING"
274
# --enable-muscledropdir=DIR
275
AC_ARG_ENABLE(muscledropdir,
276
AC_HELP_STRING([--enable-muscledropdir=DIR],[directory containing
277
MuscleCard bundles (default /usr/local/pcsc/services)]),
278
[muscledropdir="${enableval}"], [muscledropdir=false])
279
if test x${muscledropdir} = xfalse ; then
280
if test "x$prefix" != xNONE; then
281
muscledropdir="$prefix/services"
283
muscledropdir="$ac_default_prefix/pcsc/services"
286
AC_MSG_RESULT([enable MuscleCard bundles dir : $muscledropdir])
287
AC_DEFINE_UNQUOTED(MSC_SVC_DROPDIR, "$muscledropdir", [directory containing MuscleCard bundles])
289
# --enable-musclecarddebug
290
AC_ARG_ENABLE(musclecarddebug,
291
AC_HELP_STRING([--enable-musclecarddebug],[enable libmusclecard debug messages through pcscd]),
292
[ case "${enableval}" in
294
musclecarddebug=true ;;
296
musclecarddebug=false ;;
297
*) AC_MSG_ERROR([bad value ${enableval} for --enable-musclecarddebug]) ;;
298
esac], [musclecarddebug=true])
299
AC_MSG_RESULT([enable MuscleCard debug : $musclecarddebug])
300
if test x${musclecarddebug} = xfalse ; then
301
AC_DEFINE(NO_MSC_DEBUG, 1, [disable MuscleCard debug messaging.])
304
CPPFLAGS="-I\${top_srcdir}/src $CPPFLAGS"
307
if test "x$ac_cv_c_bigendian" = "xyes"; then
308
AC_SUBST(host_to_ccid_16, ['((((x) >> 8) & 0xFF) + ((x & 0xFF) << 8))'])
309
AC_SUBST(host_to_ccid_32, ['((((x) >> 24) & 0xFF) + (((x) >> 8) & 0xFF00) + ((x & 0xFF00) << 8) + (((x) & 0xFF) << 24))'])
310
AC_MSG_RESULT([plateform endianess : big endian])
312
AC_SUBST(host_to_ccid_16, ['(x)'])
313
AC_SUBST(host_to_ccid_32, ['(x)'])
314
AC_MSG_RESULT([plateform endianess : little endian])
321
AC_SUBST(extended_apdu)
322
AC_SUBST(muscledropdir)
323
AC_SUBST(host_to_ccid_16)
324
AC_SUBST(host_to_ccid_32)
325
AS_AC_EXPAND(confdir_exp,$confdir)
326
AS_AC_EXPAND(sysconfdir_exp,$sysconfdir)
327
AS_AC_EXPAND(sbindir_exp,$sbindir)
328
AS_AC_EXPAND(localstatedir_exp,$localstatedir)
342
etc/update-reader.conf
349
libmusclecard/Makefile
350
libmusclecard/doc/Makefile
351
libmusclecard/src/libmusclecard.pc
352
libmusclecard/src/Makefile
353
libmusclecard/utils/Makefile
354
libmusclecard/utils/bundleTool/bundleTool.8
355
libmusclecard/utils/bundleTool/Makefile