~ubuntu-branches/ubuntu/jaunty/pcsc-lite/jaunty-security

« back to all changes in this revision

Viewing changes to configure.in

  • Committer: Bazaar Package Importer
  • Author(s): Ludovic Rousseau
  • Date: 2005-11-27 18:04:59 UTC
  • mfrom: (1.2.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20051127180459-qrex2gzpq9d8jexd
Tags: 1.2.9-beta9-1
* New upstream version
* debian/compat: change from 3 to 4

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# -*- mode: m4; -*-
 
2
# Process this file with autoconf to produce a configure script
 
3
 
 
4
AC_PREREQ(2.58)
 
5
 
 
6
AC_INIT(pcsc-lite, 1.2.9-beta9)
 
7
AC_CONFIG_SRCDIR(src/pcscdaemon.c)
 
8
AM_INIT_AUTOMAKE(1.8)
 
9
AM_CONFIG_HEADER(config.h)
 
10
 
 
11
AC_CONFIG_MACRO_DIR(m4)
 
12
 
 
13
AC_CANONICAL_HOST
 
14
AC_PROG_CC
 
15
AC_C_BIGENDIAN
 
16
 
 
17
# Check for some target-specific stuff
 
18
case "$host" in
 
19
*-*-hpux*)
 
20
        CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE_EXTENDED"
 
21
        ;;
 
22
*-*-solaris*)
 
23
        CPPFLAGS="$CPPFLAGS -I/usr/local/include"
 
24
        LDFLAGS="$LDFLAGS -L/usr/local/lib -R/usr/local/lib"
 
25
        need_dash_r=1
 
26
        ;;
 
27
*-*-sunos4*)
 
28
        CPPFLAGS="$CPPFLAGS -DSUNOS4"
 
29
        ;;
 
30
*-*-aix*)
 
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"
 
35
        fi
 
36
        ;;
 
37
*-*-osf*)
 
38
        CPPFLAGS="$CPPFLAGS -D_POSIX_PII_SOCKET"
 
39
        ;;
 
40
*-*-darwin*)
 
41
        AC_SUBST(COREFOUNDATION)
 
42
        COREFOUNDATION="-Wl,-framework,CoreFoundation"
 
43
        AC_SUBST(IOKIT)
 
44
        IOKIT="-Wl,-framework,IOKit"
 
45
        if test "$GCC" = "yes"; then
 
46
                CFLAGS="$CFLAGS -no-cpp-precomp"
 
47
        fi
 
48
        use_libusb=false
 
49
        AC_MSG_WARN([libusb disabled on Darwin for pcsc-lite])
 
50
        ;;
 
51
esac
 
52
 
 
53
# Options
 
54
AM_MAINTAINER_MODE
 
55
 
 
56
# Checks for programs
 
57
AC_PROG_CPP
 
58
AC_PROG_INSTALL
 
59
AC_PROG_LN_S
 
60
AC_PROG_MAKE_SET
 
61
AM_PROG_LEX
 
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)
 
65
 
 
66
# Special check for pthread support
 
67
ACX_PTHREAD(
 
68
[
 
69
 AC_DEFINE(HAVE_PTHREAD, 1,
 
70
  [Define if you have POSIX threads libraries and header files.])
 
71
], [
 
72
 AC_MSG_ERROR([POSIX thread support required])
 
73
])
 
74
 
 
75
LIBS="$PTHREAD_LIBS $LIBS"
 
76
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
 
77
CC="$PTHREAD_CC"
 
78
 
 
79
AC_SUBST(PTHREAD_LIBS)
 
80
AC_SUBST(PTHREAD_CFLAGS)
 
81
 
 
82
# Add libtool support
 
83
AM_PROG_LIBTOOL
 
84
# Automatically update the libtool script if it becomes out-of-date
 
85
#AC_SUBST(LIBTOOL_DEPS)
 
86
 
 
87
# Checks for header files
 
88
AC_HEADER_STDC
 
89
AC_HEADER_SYS_WAIT
 
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])
 
91
 
 
92
# Checks for typedefs, structures, and compiler characteristics
 
93
AC_C_CONST
 
94
AC_TYPE_UID_T
 
95
AC_TYPE_SIZE_T
 
96
AC_HEADER_TIME
 
97
 
 
98
# Checks for library functions
 
99
AC_FUNC_ERROR_AT_LINE
 
100
AC_FUNC_STAT
 
101
AC_FUNC_VPRINTF
 
102
AC_CHECK_FUNCS(daemon flock getopt_long nanosleep strerror vsnprintf)
 
103
 
 
104
# strlcpy, strlcat from OpenBSD
 
105
AC_CHECK_FUNCS(strlcpy strlcat)
 
106
 
 
107
# C Compiler features
 
108
AC_C_INLINE
 
109
if test "$GCC" = "yes"; then
 
110
        CFLAGS="-Wall -fno-common $CFLAGS"
 
111
fi
 
112
 
 
113
AC_SUBST(LIBDL)
 
114
AC_CHECK_LIB(dl, dlopen, [LIBDL="$LIBDL -ldl" ac_cv_func_dlopen_ldl=yes], ac_cv_func_dlopen_ldl=no)
 
115
 
 
116
# Use 'uname' output as an architecture define
 
117
uname=`uname`
 
118
case "$uname" in
 
119
Darwin)
 
120
        uname=MacOS
 
121
        ;;
 
122
esac
 
123
AC_DEFINE_UNQUOTED(PCSC_ARCH, "$uname", [PC/SC target architecture])
 
124
AC_DEFINE_UNQUOTED(MSC_ARCH, "$uname", [MuscleCard target architecture])
 
125
 
 
126
# See if socket() is found from libsocket
 
127
AC_CHECK_LIB(socket, socket, [LIBS="$LIBS -lsocket"])
 
128
 
 
129
AC_SUBST(LIBUSB)
 
130
# --enable-libusb=DIR
 
131
AC_ARG_ENABLE(libusb,
 
132
  AC_HELP_STRING([--enable-libusb=PATH],[enable USB hotplug using libusb]),
 
133
        [
 
134
                case ${enableval} in
 
135
                        "" | "yes" | "YES")
 
136
                                ;;
 
137
                        "no" | "NO")
 
138
                                use_libusb=false
 
139
                                ;;
 
140
                        *)
 
141
                                use_libusb=false
 
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"
 
148
                                fi
 
149
                                ;;
 
150
                esac
 
151
        ]
 
152
)
 
153
 
 
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 ])
 
159
fi
 
160
 
 
161
AC_MSG_RESULT([enable libusb support         : $use_libusb])
 
162
 
 
163
if test x$use_libusb = xtrue; then
 
164
  AC_DEFINE(HAVE_LIBUSB,1, [Libusb is available])
 
165
fi
 
166
 
 
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"
 
175
        else
 
176
                usbdropdir="$ac_default_prefix/pcsc/drivers"
 
177
        fi
 
178
fi
 
179
AC_MSG_RESULT([enable USB drop directory     : $usbdropdir])
 
180
AC_DEFINE_UNQUOTED(PCSCLITE_HP_DROPDIR, "$usbdropdir", [directory containing USB drivers])
 
181
 
 
182
# --enable-debugatr
 
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])
 
190
 
 
191
AC_MSG_RESULT([enable ATR parsing messages   : $debugatr])
 
192
 
 
193
if test x${debugatr} = xtrue ; then
 
194
  AC_DEFINE(ATR_DEBUG, 1, [display ATR parsing debug messages.])
 
195
fi
 
196
 
 
197
# --enable-scf
 
198
AC_ARG_ENABLE(scf,
 
199
  AC_HELP_STRING([--enable-scf],[use SCF for reader support]),
 
200
[ case "${enableval}" in
 
201
  yes)  scf=true ;;
 
202
  no)   scf=false ;;
 
203
  *) AC_MSG_ERROR([bad value ${enableval} for --enable-scf]) ;;
 
204
esac], [scf=false])
 
205
 
 
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)
 
209
else
 
210
  scf=false
 
211
fi
 
212
AC_MSG_RESULT([enable SCF reader support     : $scf])
 
213
AM_CONDITIONAL(HAVE_SCF, test x$scf = xtrue)
 
214
 
 
215
# --enable-confdir=DIR
 
216
AC_ARG_ENABLE(confdir,
 
217
AC_HELP_STRING([--enable-confdir=DIR],[directory containing reader.conf
 
218
                                (default /etc)]),
 
219
[confdir="${enableval}"], [confdir=false])
 
220
 
 
221
if test x${confdir} != xfalse ; then
 
222
        AC_MSG_RESULT([enable confdir                : $confdir])
 
223
else
 
224
        confdir="/etc"
 
225
        AC_MSG_RESULT([enable confdir                : /etc (default)])
 
226
fi
 
227
 
 
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])
 
232
 
 
233
AC_MSG_RESULT([enable runpid                 : $runpid])
 
234
 
 
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,'')
 
239
else
 
240
        AC_SUBST(HAVE_RUNPID,'.\" ')
 
241
fi
 
242
 
 
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])
 
248
 
 
249
if test x${ipcdir} != xfalse ; then
 
250
        AC_MSG_RESULT([enable ipcdir                 : $ipcdir])
 
251
 
 
252
        AC_DEFINE_UNQUOTED(USE_IPCDIR, "$ipcdir", [directory containing IPC files (default /var/run)])
 
253
else
 
254
        AC_MSG_RESULT([enable ipcdir                 : /var/run (default)])
 
255
fi
 
256
 
 
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])
 
265
 
 
266
AC_MSG_RESULT([enable extended APDU          : $extendedapdu])
 
267
 
 
268
if test x${extendedapdu} = xtrue ; then
 
269
  extended_apdu="#define PCSCLITE_ENHANCED_MESSAGING"
 
270
else
 
271
  extended_apdu="#undef PCSCLITE_ENHANCED_MESSAGING"
 
272
fi
 
273
 
 
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"
 
282
        else
 
283
                muscledropdir="$ac_default_prefix/pcsc/services"
 
284
        fi
 
285
fi
 
286
AC_MSG_RESULT([enable MuscleCard bundles dir : $muscledropdir])
 
287
AC_DEFINE_UNQUOTED(MSC_SVC_DROPDIR, "$muscledropdir", [directory containing MuscleCard bundles])
 
288
 
 
289
# --enable-musclecarddebug
 
290
AC_ARG_ENABLE(musclecarddebug,
 
291
        AC_HELP_STRING([--enable-musclecarddebug],[enable libmusclecard debug messages through pcscd]),
 
292
[ case "${enableval}" in
 
293
  yes)
 
294
    musclecarddebug=true ;;
 
295
  no)
 
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.])
 
302
fi
 
303
 
 
304
CPPFLAGS="-I\${top_srcdir}/src $CPPFLAGS"
 
305
 
 
306
# HOST_TO_CCID
 
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])
 
311
else
 
312
        AC_SUBST(host_to_ccid_16, ['(x)'])
 
313
        AC_SUBST(host_to_ccid_32, ['(x)'])
 
314
        AC_MSG_RESULT([plateform endianess           : little endian])
 
315
fi
 
316
 
 
317
# Setup dist stuff
 
318
AC_SUBST(usbdropdir)
 
319
AC_SUBST(confdir)
 
320
AC_SUBST(runpid)
 
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)
 
329
 
 
330
# Write Makefiles
 
331
AC_CONFIG_FILES([
 
332
Makefile
 
333
m4/Makefile
 
334
doc/Makefile
 
335
doc/doxygen.conf
 
336
doc/pcscd.8
 
337
doc/reader.conf.5
 
338
doc/example/Makefile
 
339
etc/Makefile
 
340
etc/pcscd.init
 
341
etc/reader.conf
 
342
etc/update-reader.conf
 
343
src/Makefile
 
344
src/libpcsclite.pc
 
345
src/PCSC/pcsclite.h
 
346
src/PCSC/reader.h
 
347
src/utils/Makefile
 
348
win32/Makefile
 
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
 
356
])
 
357
AC_OUTPUT
 
358