/[pcsclite]/trunk/Drivers/ccid/configure.in
ViewVC logotype

Contents of /trunk/Drivers/ccid/configure.in

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1342 - (show annotations) (download)
Wed Feb 23 12:08:51 2005 UTC (8 years, 3 months ago) by rousseau
File size: 5525 byte(s)
if --disable-pcsclite is used we must link the library with debug.c
to provide debug_msg()
1 dnl Process this file with autoconf to produce a configure script.
2 dnl You may need to use autoconf 2.56 or newer
3
4 dnl $Id$
5
6 dnl Require autoconf 2.52
7 AC_PREREQ(2.52)
8
9 AC_INIT(ccid, 0.9.2)
10 AC_CONFIG_SRCDIR(src/ifdhandler.c)
11 AC_CONFIG_AUX_DIR(build)
12 AM_INIT_AUTOMAKE
13
14 dnl Default install dir
15 AC_PREFIX_DEFAULT(/usr/local)
16
17 dnl Automake boilerplate.
18 AC_CANONICAL_HOST
19
20 dnl create a config.h file (Automake will add -DHAVE_CONFIG_H)
21 AM_CONFIG_HEADER(config.h)
22
23 dnl Options
24 AM_MAINTAINER_MODE
25
26 dnl Checks for programs.
27 AC_PROG_CC
28 AC_PROG_CPP
29 AC_PROG_INSTALL
30 AC_PROG_MAKE_SET
31 AC_PROG_LN_S
32 AM_PROG_LEX
33 AC_CHECK_PROG([PKGCONFIG], [pkg-config], [yes])
34
35 dnl check pcsc-lite version
36 PKG_CHECK_MODULES(PCSC, libpcsclite >= 1.2.9-beta5, [],
37 [AC_MSG_WARN([install pcsc-lite 1.2.9-beta5 or later])])
38
39 OLD_CFLAGS="$CFLAGS"
40 CFLAGS="$CFLAGS $PCSC_CFLAGS"
41 AC_CHECK_HEADER(ifdhandler.h,,
42 [AC_MSG_ERROR([ifdhandler.h not found, install pcsc-lite 1.2.9-beta5 or later, or use CFLAGS=... ./configure])],
43 [ #include <ifdhandler.h> ])
44 CFLAGS="$OLD_CFLAGS"
45
46 dnl Add libtool support.
47 AM_PROG_LIBTOOL
48
49 dnl Automatically update the libtool script if it becomes out-of-date.
50 AC_SUBST(LIBTOOL_DEPS)
51
52 dnl Checks for header files.
53 AC_HEADER_STDC
54 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,,
55 [AC_MSG_WARN([some header files not found])])
56
57 dnl Checks for typedefs, structures, and compiler characteristics.
58 AC_C_CONST
59 AC_TYPE_SIZE_T
60 AC_HEADER_TIME
61
62 dnl Checks for library functions.
63 AC_CHECK_FUNCS(select strerror strncpy memcpy)
64
65 dnl Select OS specific versions of source files.
66 AC_SUBST(BUNDLE_HOST)
67 AC_SUBST(DYN_LIB_EXT)
68 case "$host" in
69 *-*-darwin*)
70 BUNDLE_HOST="MacOS"
71 DYN_LIB_EXT="dylib"
72 AM_CONDITIONAL(NEED_PARSER, true)
73
74 AC_SUBST(COREFOUNDATION)
75 COREFOUNDATION="-Wl,-framework,CoreFoundation"
76
77 AC_SUBST(IOKIT)
78 IOKIT="-Wl,-framework,IOKit"
79 if test "$GCC" = "yes"; then
80 CFLAGS="$CFLAGS -no-cpp-precomp"
81 fi
82 ;;
83 *)
84 BUNDLE_HOST="Linux"
85 DYN_LIB_EXT="so"
86 AM_CONDITIONAL(NEED_PARSER, false)
87 esac
88
89 CFLAGS="$CFLAGS -Wall"
90
91 dnl --enable-libusb=PATH
92 AC_ARG_ENABLE(libusb,
93 AC_HELP_STRING([--enable-libusb=PATH],[libusb path (default /usr)]),
94 [
95 case ${enableval} in
96 "" | "yes" | "YES")
97 ;;
98 "no" | "NO")
99 use_libusb=false
100 ;;
101 *)
102 CPPFLAGS="$CPPFLAGS -I${enableval}/include"
103 LDFLAGS="$LDFLAGS -L${enableval}/lib"
104 ;;
105 esac
106 ]
107 )
108
109 dnl check if libusb is available
110 if test "${use_libusb}" != false ; then
111 AC_SUBST(LIBUSB)
112 AC_CHECK_HEADERS(usb.h, [],
113 [ AC_MSG_ERROR([usb.h not found, use --enable-libusb=PATH]) ])
114
115 ac_save_LIBS="$LIBS"
116 LIBS="$LIBS $COREFOUNDATION $IOKIT"
117 AC_CHECK_LIB(usb, usb_init, [LIBUSB="$LIBUSB -lusb"],
118 [ AC_MSG_ERROR([libusb not found]) ])
119 LIBS="$ac_save_LIBS"
120
121 ac_save_LIBS="$LIBS"
122 LIBS="$LIBS $COREFOUNDATION $IOKIT"
123 AC_CHECK_LIB(usb, usb_get_string_simple, [LIBUSB="$LIBUSB -lusb"],
124 [ AC_MSG_ERROR([your libusb is too old. install version 0.1.7 or above]) ])
125 LIBS="$ac_save_LIBS"
126 fi
127
128 dnl check what to use for dlopen
129 AC_SUBST(LIBDL)
130 AC_CHECK_LIB(dl, dlopen, [LIBDL="$LIBDL -ldl" ac_cv_func_dlopen_ldl=yes], ac_cv_func_dlopen_ldl=no)
131
132 dnl --enable-multi-thread
133 AC_ARG_ENABLE(multi-thread,
134 AC_HELP_STRING([--enable-multi-thread],[enable multi threading
135 (default=yes)]),
136 [ multithread="${enableval}" ], [ multithread=yes ] )
137
138 if test "${multithread}" != no ; then
139 ACX_PTHREAD(
140 [ AC_DEFINE(HAVE_PTHREAD, 1,
141 [Define if you have POSIX threads libraries and header files.])
142 ], [ AC_MSG_ERROR([POSIX thread support required]) ])
143 fi
144 AC_MSG_RESULT([multi threading : $multithread])
145
146 dnl --enable-bundle=NAME
147 AC_ARG_ENABLE(bundle,
148 AC_HELP_STRING([--enable-bundle=NAME],[bundle directory name
149 (default ifd-ccid.bundle)]),
150 [bundle="${enableval}"], [bundle=false])
151 if test "${bundle}" = false ; then
152 bundle="ifd-ccid.bundle"
153 fi
154 AC_MSG_RESULT([bundle directory name : $bundle])
155 AC_DEFINE_UNQUOTED(BUNDLE, "$bundle", [bundle directory name])
156
157 dnl --enable-usbdropdir=DIR
158 AC_ARG_ENABLE(usbdropdir,
159 AC_HELP_STRING([--enable-usbdropdir=DIR],[directory containing USB
160 drivers (default to pcscd config or $(prefix)/pcsc/drivers)]),
161 [usbdropdir="${enableval}"], [usbdropdir=false])
162 if test "${usbdropdir}" = false ; then
163 usbdropdir=`pkg-config libpcsclite --variable=usbdropdir`
164 fi
165 AC_MSG_RESULT([USB drop directory : $usbdropdir])
166 AC_DEFINE_UNQUOTED(PCSCLITE_HP_DROPDIR, "$usbdropdir", [directory containing USB drivers])
167
168 dnl --enable-ccidtwindir=DIR
169 AC_ARG_ENABLE(ccidtwindir,
170 AC_HELP_STRING([--enable-ccidtwindir=DIR],[directory to install the
171 serial Twin driver (default to pcscd config or $(prefix)/pcsc/drivers/serial)]),
172 [ccidtwindir="${enableval}"], [ccidtwindir=false])
173 if test "${ccidtwindir}" = false ; then
174 ccidtwindir=`pkg-config libpcsclite --variable=usbdropdir`/serial
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 dnl --enable-pcsclite
180 AC_ARG_ENABLE(pcsclite,
181 AC_HELP_STRING([--enable-pcsclite],[compile for pcsc-lite (default=yes)]),
182 [ pcsclite=no ], [ pcsclite=yes ] )
183
184 if test "${pcsclite}" = no ; then
185 AM_CONDITIONAL(WITHOUT_PCSC, true)
186 AM_CONDITIONAL(NEED_PARSER, true)
187 fi
188 AC_MSG_RESULT([compiled for pcsc-lite : $pcsclite])
189
190
191 dnl Setup dist stuff
192 AC_SUBST(ac_aux_dir)
193 AC_SUBST(bundle)
194 AC_SUBST(usbdropdir)
195 AC_SUBST(ccidtwindir)
196
197 dnl Write Makefiles.
198 AC_CONFIG_FILES(Makefile
199 aclocal/Makefile
200 src/Makefile
201 readers/Makefile
202 examples/Makefile)
203
204 AC_OUTPUT
205

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision

  ViewVC Help
Powered by ViewVC 1.1.5