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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1473 - (show annotations) (download)
Wed Apr 27 13:36:01 2005 UTC (8 years ago) by rousseau
File size: 6080 byte(s)
version 0.9.4
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.4)
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
34 dnl check pcsc-lite version
35 PKG_CHECK_MODULES(PCSC, libpcsclite >= 1.2.9-beta7, [],
36 [ if test -f /usr/local/lib/pkgconfig/libpcsclite.pc ; then
37 AC_MSG_ERROR([use PKG_CONFIG_PATH=/usr/local/lib/pkgconfig ./configure])
38 else
39 AC_MSG_WARN([install pcsc-lite 1.2.9-beta7 or later])
40 fi
41 ])
42
43 OLD_CFLAGS="$CFLAGS"
44 CFLAGS="$CFLAGS $PCSC_CFLAGS"
45 AC_CHECK_HEADER(ifdhandler.h,,
46 [AC_MSG_ERROR([ifdhandler.h not found, install pcsc-lite 1.2.9-beta7 or later, or use CFLAGS=... ./configure])],
47 [ #include <ifdhandler.h> ])
48 CFLAGS="$OLD_CFLAGS"
49
50 dnl Add libtool support.
51 AM_PROG_LIBTOOL
52
53 dnl Automatically update the libtool script if it becomes out-of-date.
54 AC_SUBST(LIBTOOL_DEPS)
55
56 dnl Checks for header files.
57 AC_HEADER_STDC
58 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,,
59 [AC_MSG_WARN([some header files not found])])
60
61 dnl Checks for typedefs, structures, and compiler characteristics.
62 AC_C_CONST
63 AC_TYPE_SIZE_T
64 AC_HEADER_TIME
65
66 dnl Checks for library functions.
67 AC_CHECK_FUNCS(select strerror strncpy memcpy)
68
69 dnl Select OS specific versions of source files.
70 AC_SUBST(BUNDLE_HOST)
71 AC_SUBST(DYN_LIB_EXT)
72 case "$host" in
73 *-*-darwin*)
74 BUNDLE_HOST="MacOS"
75 DYN_LIB_EXT="dylib"
76 AM_CONDITIONAL(NEED_PARSER, true)
77
78 AC_SUBST(COREFOUNDATION)
79 COREFOUNDATION="-Wl,-framework,CoreFoundation"
80
81 AC_SUBST(IOKIT)
82 IOKIT="-Wl,-framework,IOKit"
83 if test "$GCC" = "yes"; then
84 CFLAGS="$CFLAGS -no-cpp-precomp"
85 fi
86 ;;
87 *)
88 BUNDLE_HOST="Linux"
89 DYN_LIB_EXT="so"
90 AM_CONDITIONAL(NEED_PARSER, false)
91 esac
92
93 CFLAGS="$CFLAGS -Wall"
94
95 dnl --enable-libusb=PATH
96 AC_ARG_ENABLE(libusb,
97 AC_HELP_STRING([--enable-libusb=PATH],[libusb path (default /usr)]),
98 [
99 case ${enableval} in
100 "" | "yes" | "YES")
101 ;;
102 "no" | "NO")
103 use_libusb=false
104 ;;
105 *)
106 CPPFLAGS="$CPPFLAGS -I${enableval}/include"
107 LDFLAGS="$LDFLAGS -L${enableval}/lib"
108 ;;
109 esac
110 ]
111 )
112
113 dnl check if libusb is available
114 if test "${use_libusb}" != false ; then
115 AC_SUBST(LIBUSB)
116 AC_CHECK_HEADERS(usb.h, [],
117 [ AC_MSG_ERROR([usb.h not found, use --enable-libusb=PATH]) ])
118
119 ac_save_LIBS="$LIBS"
120 LIBS="$LIBS $COREFOUNDATION $IOKIT"
121 AC_CHECK_LIB(usb, usb_init, [LIBUSB="$LIBUSB -lusb"],
122 [ AC_MSG_ERROR([libusb not found]) ])
123 LIBS="$ac_save_LIBS"
124
125 ac_save_LIBS="$LIBS"
126 LIBS="$LIBS $COREFOUNDATION $IOKIT"
127 AC_CHECK_LIB(usb, usb_get_string_simple, [LIBUSB="$LIBUSB -lusb"],
128 [ AC_MSG_ERROR([your libusb is too old. install version 0.1.7 or above]) ])
129 LIBS="$ac_save_LIBS"
130 fi
131
132 dnl check what to use for dlopen
133 AC_SUBST(LIBDL)
134 AC_CHECK_LIB(dl, dlopen, [LIBDL="$LIBDL -ldl" ac_cv_func_dlopen_ldl=yes], ac_cv_func_dlopen_ldl=no)
135
136 dnl --enable-multi-thread
137 AC_ARG_ENABLE(multi-thread,
138 AC_HELP_STRING([--enable-multi-thread],[enable multi threading
139 (default=yes)]),
140 [ multithread="${enableval}" ], [ multithread=yes ] )
141
142 if test "${multithread}" != no ; then
143 ACX_PTHREAD(
144 [ AC_DEFINE(HAVE_PTHREAD, 1,
145 [Define if you have POSIX threads libraries and header files.])
146 ], [ AC_MSG_ERROR([POSIX thread support required]) ])
147 fi
148 AC_MSG_RESULT([multi threading : $multithread])
149
150 dnl --enable-bundle=NAME
151 AC_ARG_ENABLE(bundle,
152 AC_HELP_STRING([--enable-bundle=NAME],[bundle directory name
153 (default ifd-ccid.bundle)]),
154 [bundle="${enableval}"], [bundle=false])
155 if test "${bundle}" = false ; then
156 bundle="ifd-ccid.bundle"
157 fi
158 AC_MSG_RESULT([bundle directory name : $bundle])
159 AC_DEFINE_UNQUOTED(BUNDLE, "$bundle", [bundle directory name])
160
161 dnl --enable-usbdropdir=DIR
162 AC_ARG_ENABLE(usbdropdir,
163 AC_HELP_STRING([--enable-usbdropdir=DIR],[directory containing USB
164 drivers (default to pcscd config or $(prefix)/pcsc/drivers)]),
165 [usbdropdir="${enableval}"], [usbdropdir=false])
166 if test "${usbdropdir}" = false ; then
167 usbdropdir=`pkg-config libpcsclite --variable=usbdropdir`
168 fi
169 AC_MSG_RESULT([USB drop directory : $usbdropdir])
170 AC_DEFINE_UNQUOTED(PCSCLITE_HP_DROPDIR, "$usbdropdir", [directory containing USB drivers])
171 if test "${usbdropdir}" = "" ; then
172 AC_MSG_ERROR([use --enable-usbdropdir=DIR])
173 fi
174
175 dnl --enable-ccidtwindir=DIR
176 AC_ARG_ENABLE(ccidtwindir,
177 AC_HELP_STRING([--enable-ccidtwindir=DIR],[directory to install the
178 serial Twin driver (default to pcscd config or $(prefix)/pcsc/drivers/serial)]),
179 [ccidtwindir="${enableval}"], [ccidtwindir=false])
180 if test "${ccidtwindir}" = false ; then
181 ccidtwindir=`pkg-config libpcsclite --variable=usbdropdir`/serial
182 fi
183 AC_MSG_RESULT([serial twin install dir : $ccidtwindir])
184 AC_DEFINE_UNQUOTED(PCSCLITE_HP_DROPDIR, "$ccidtwindir", [directory containing USB drivers])
185
186 dnl --enable-pcsclite
187 AC_ARG_ENABLE(pcsclite,
188 AC_HELP_STRING([--enable-pcsclite],[compile for pcsc-lite (default=yes)]),
189 [ pcsclite=no ], [ pcsclite=yes ] )
190
191 if test "${pcsclite}" = no ; then
192 AM_CONDITIONAL(WITHOUT_PCSC, true)
193 AM_CONDITIONAL(NEED_PARSER, true)
194 else
195 dnl check that pcsc-lite is installed
196 OLD_LDLIBS="$LDLIBS"
197 OLD_LIBS="$LIBS"
198 LDLIBS="$LDLIBS $PCSC_LIBS"
199 AC_CHECK_LIB(pcsclite, SCardEstablishContext, [],
200 [AC_MSG_ERROR([SCardEstablishContext() not found, install pcsc-lite 1.2.9-beta7 or later,or use LDLIBS=... ./configure])])
201 LDLIBS="$OLD_LDLIBS"
202 LIBS="$OLD_LIBS"
203
204 AM_CONDITIONAL(WITHOUT_PCSC, false)
205 fi
206 AC_MSG_RESULT([compiled for pcsc-lite : $pcsclite])
207
208
209 dnl Setup dist stuff
210 AC_SUBST(ac_aux_dir)
211 AC_SUBST(bundle)
212 AC_SUBST(usbdropdir)
213 AC_SUBST(ccidtwindir)
214
215 dnl Write Makefiles.
216 AC_CONFIG_FILES(Makefile
217 aclocal/Makefile
218 src/Makefile
219 readers/Makefile
220 examples/Makefile)
221
222 AC_OUTPUT
223

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.5