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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1944 - (show annotations) (download)
Mon Mar 20 08:20:00 2006 UTC (7 years, 2 months ago) by rousseau
File size: 6639 byte(s)
document --disable-multi-thread instead of --enable-multi-thread since
safe threading is used by default
1 # Process this file with autoconf to produce a configure script.
2 # You may need to use autoconf 2.56 or newer
3
4 # $Id$
5
6 # Require autoconf 2.52
7 AC_PREREQ(2.52)
8
9 AC_INIT(ccid, 1.0.0)
10 AC_CONFIG_SRCDIR(src/ifdhandler.c)
11 AC_CONFIG_AUX_DIR(build)
12 AM_INIT_AUTOMAKE
13
14 # Default install dir
15 AC_PREFIX_DEFAULT(/usr/local)
16
17 # Automake boilerplate.
18 AC_CANONICAL_HOST
19
20 # create a config.h file (Automake will add -DHAVE_CONFIG_H)
21 AM_CONFIG_HEADER(config.h)
22
23 # Options
24 AM_MAINTAINER_MODE
25
26 # 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
34 # check pcsc-lite version
35 PKG_CHECK_MODULES(PCSC, libpcsclite >= 1.2.9-beta9, [],
36 [ AC_MSG_RESULT([no])
37 if test -f /usr/local/lib/pkgconfig/libpcsclite.pc -a "x$PKG_CONFIG" != x ; then
38 AC_MSG_ERROR([use PKG_CONFIG_PATH=/usr/local/lib/pkgconfig ./configure])
39 else
40 AC_MSG_WARN([install pcsc-lite 1.2.9-beta9 or later])
41 fi
42 ])
43
44 saved_CPPFLAGS="$CPPFLAGS"
45 CPPFLAGS="$CPPFLAGS $PCSC_CFLAGS"
46 AC_CHECK_HEADER(ifdhandler.h,,
47 [AC_MSG_ERROR([ifdhandler.h not found, install pcsc-lite 1.2.9-beta9 or later, or use ./configure PCSC_CFLAGS=...])],
48 [ #include <ifdhandler.h> ])
49 AC_CHECK_HEADER(reader.h,,
50 [AC_MSG_ERROR([reader.h not found, install pcsc-lite 1.2.9-beta9 or later, or use ./configure PCSC_CFLAGS=...])],
51 [ #include <reader.h> ])
52 CPPFLAGS="$saved_CPPFLAGS"
53
54 # Add libtool support.
55 AM_PROG_LIBTOOL
56
57 # Automatically update the libtool script if it becomes out-of-date.
58 AC_SUBST(LIBTOOL_DEPS)
59
60 # Checks for header files.
61 AC_HEADER_STDC
62 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,,
63 [AC_MSG_WARN([some header files not found])])
64
65 # Checks for typedefs, structures, and compiler characteristics.
66 AC_C_CONST
67 AC_TYPE_SIZE_T
68 AC_HEADER_TIME
69
70 # Checks for library functions.
71 AC_CHECK_FUNCS(select strerror strncpy memcpy)
72
73 # Select OS specific versions of source files.
74 AC_SUBST(BUNDLE_HOST)
75 AC_SUBST(DYN_LIB_EXT)
76 case "$host" in
77 *-*-darwin*)
78 BUNDLE_HOST="MacOS"
79 DYN_LIB_EXT="dylib"
80
81 AC_SUBST(COREFOUNDATION)
82 COREFOUNDATION="-Wl,-framework,CoreFoundation"
83
84 AC_SUBST(IOKIT)
85 IOKIT="-Wl,-framework,IOKit"
86 if test "$GCC" = "yes"; then
87 CFLAGS="$CFLAGS -no-cpp-precomp"
88 fi
89 ;;
90 *-*-openbsd*)
91 BUNDLE_HOST="OpenBSD"
92 DYN_LIB_EXT="so.0.0"
93 ;;
94 *-*-solaris*)
95 BUNDLE_HOST="Solaris"
96 DYN_LIB_EXT="so"
97 ;;
98 *)
99 BUNDLE_HOST="Linux"
100 DYN_LIB_EXT="so"
101 esac
102
103 # --disable-libusb
104 AC_ARG_ENABLE(libusb,
105 AC_HELP_STRING([--disable-libusb],[do not use libusb]),
106 [ use_libusb="${enableval}" ], [ use_libusb=yes ] )
107
108 # check if libusb is used
109 if test "x$use_libusb" != xno ; then
110 PKG_CHECK_MODULES(LIBUSB, libusb, [],
111 [
112 AC_MSG_RESULT([no])
113 AC_CHECK_PROG([LIBUSBCONFIG], [libusb-config], [yes])
114
115 if test "$LIBUSBCONFIG" = "yes" ; then
116 LIBUSB_CFLAGS="$LIBUSB_CFLAGS `libusb-config --cflags`"
117 LIBUSB_LIBS="$LIBUSB_LIBS `libusb-config --libs`"
118 else
119 AC_MSG_WARN([libusb-config not found.])
120 fi
121 ])
122
123 saved_CPPFLAGS="$CPPFLAGS"
124 saved_LIBS="$LIBS"
125
126 CPPFLAGS="$CPPFLAGS $LIBUSB_CFLAGS"
127 LIBS="$LDFLAGS $LIBUSB_LIBS"
128
129 AC_CHECK_HEADERS(usb.h, [],
130 [ AC_MSG_ERROR([usb.h not found, use ./configure LIBUSB_CFLAGS=...]) ])
131
132 LIBS="$LIBS $COREFOUNDATION $IOKIT"
133
134 AC_MSG_CHECKING([for usb_init])
135 AC_TRY_LINK_FUNC(usb_init, [ AC_MSG_RESULT([yes]) ],
136 [ AC_MSG_ERROR([libusb not found, use ./configure LIBUSB_LIBS=...]) ])
137
138 AC_MSG_CHECKING([for usb_get_string_simple])
139 AC_TRY_LINK_FUNC(usb_get_string_simple, [ AC_MSG_RESULT([yes]) ],
140 [ AC_MSG_ERROR([your libusb is too old. install version 0.1.7 or above]) ])
141
142 CPPFLAGS="$saved_CPPFLAGS"
143 LIBS="$saved_LIBS"
144
145 use_libusb=yes
146 fi
147 AC_SUBST(LIBUSB_CFLAGS)
148 AC_SUBST(LIBUSB_LIBS)
149
150 AC_MSG_RESULT([use libusb : $use_libusb])
151
152 # check what to use for dlopen
153 AC_SUBST(LIBDL)
154 AC_CHECK_LIB(dl, dlopen, [LIBDL="$LIBDL -ldl" ac_cv_func_dlopen_ldl=yes], ac_cv_func_dlopen_ldl=no)
155
156 # --disable-multi-thread
157 AC_ARG_ENABLE(multi-thread,
158 AC_HELP_STRING([--disable-multi-thread],[disable multi threading]),
159 [ multithread="${enableval}" ], [ multithread=yes ] )
160
161 if test "${multithread}" != no ; then
162 ACX_PTHREAD(
163 [ AC_DEFINE(HAVE_PTHREAD, 1,
164 [Define if you have POSIX threads libraries and header files.])
165 ], [ AC_MSG_ERROR([POSIX thread support required]) ])
166
167 multithread=yes
168 fi
169 AC_MSG_RESULT([multi threading : $multithread])
170
171 # --enable-bundle=NAME
172 AC_ARG_ENABLE(bundle,
173 AC_HELP_STRING([--enable-bundle=NAME],[bundle directory name
174 (default ifd-ccid.bundle)]),
175 [bundle="${enableval}"], [bundle=false])
176 if test "${bundle}" = false ; then
177 bundle="ifd-ccid.bundle"
178 fi
179 AC_MSG_RESULT([bundle directory name : $bundle])
180 AC_DEFINE_UNQUOTED(BUNDLE, "$bundle", [bundle directory name])
181
182 # --enable-usbdropdir=DIR
183 AC_ARG_ENABLE(usbdropdir,
184 AC_HELP_STRING([--enable-usbdropdir=DIR],[directory containing USB
185 drivers (default to pcscd config or $(prefix)/pcsc/drivers)]),
186 [usbdropdir="${enableval}"], [usbdropdir=false])
187 if test "${usbdropdir}" = false ; then
188 usbdropdir=`pkg-config libpcsclite --variable=usbdropdir`
189 fi
190 AC_MSG_RESULT([USB drop directory : $usbdropdir])
191 AC_DEFINE_UNQUOTED(PCSCLITE_HP_DROPDIR, "$usbdropdir", [directory containing USB drivers])
192 if test "${usbdropdir}" = "" ; then
193 AC_MSG_ERROR([use --enable-usbdropdir=DIR])
194 fi
195
196 # --enable-ccidtwindir=DIR
197 AC_ARG_ENABLE(ccidtwindir,
198 AC_HELP_STRING([--enable-ccidtwindir=DIR],[directory to install the
199 serial Twin driver (default to pcscd config or $(prefix)/pcsc/drivers/serial)]),
200 [ccidtwindir="${enableval}"], [ccidtwindir=false])
201 if test "${ccidtwindir}" = false ; then
202 ccidtwindir=`pkg-config libpcsclite --variable=usbdropdir`/serial
203 fi
204 AC_MSG_RESULT([serial twin install dir : $ccidtwindir])
205
206 # --disable-pcsclite
207 AC_ARG_ENABLE(pcsclite,
208 AC_HELP_STRING([--disable-pcsclite],[do not use pcsc-lite debug support]),
209 [ pcsclite="${enableval}" ], [ pcsclite=yes ] )
210
211 if test "${pcsclite}" = no ; then
212 AM_CONDITIONAL(WITHOUT_PCSC, true)
213 AM_CONDITIONAL(NEED_PARSER, true)
214 else
215 # check that pcsc-lite is installed
216 OLD_LIBS="$LIBS"
217 LIBS="$LIBS $PCSC_LIBS"
218 AC_CHECK_LIB(pcsclite, SCardEstablishContext, [],
219 [AC_MSG_ERROR([SCardEstablishContext() not found, install pcsc-lite 1.2.9-beta9 or later, or use PCSC_LIBS=... ./configure])])
220 LIBS="$OLD_LIBS"
221
222 AM_CONDITIONAL(WITHOUT_PCSC, false)
223 AM_CONDITIONAL(NEED_PARSER, false)
224
225 pcsclite=yes
226 fi
227 AC_MSG_RESULT([compiled for pcsc-lite : $pcsclite])
228
229
230 # Setup dist stuff
231 AC_SUBST(ac_aux_dir)
232 AC_SUBST(bundle)
233 AC_SUBST(usbdropdir)
234 AC_SUBST(ccidtwindir)
235
236 # Write Makefiles.
237 AC_CONFIG_FILES(Makefile
238 aclocal/Makefile
239 src/Makefile
240 readers/Makefile
241 examples/Makefile)
242
243 AC_OUTPUT
244

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.5