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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2020 - (show annotations) (download)
Sat Apr 22 15:31:05 2006 UTC (7 years, 1 month ago) by rousseau
File size: 6922 byte(s)
release 1.0.1
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.1)
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 # check if the compiler support -fvisibility=hidden (GCC >= 4)
157 saved_CFLAGS="$CFLAGS"
158 CFLAGS="$CFLAGS -fvisibility=hidden"
159 AC_MSG_CHECKING([for -fvisibility=hidden])
160 AC_COMPILE_IFELSE([char foo;],
161 [ AC_MSG_RESULT([yes])
162 SYMBOL_VISIBILITY="-fvisibility=hidden" ],
163 AC_MSG_RESULT([no]))
164 CFLAGS="$saved_CFLAGS"
165 AC_SUBST(SYMBOL_VISIBILITY)
166
167 # --disable-multi-thread
168 AC_ARG_ENABLE(multi-thread,
169 AC_HELP_STRING([--disable-multi-thread],[disable multi threading]),
170 [ multithread="${enableval}" ], [ multithread=yes ] )
171
172 if test "${multithread}" != no ; then
173 ACX_PTHREAD(
174 [ AC_DEFINE(HAVE_PTHREAD, 1,
175 [Define if you have POSIX threads libraries and header files.])
176 ], [ AC_MSG_ERROR([POSIX thread support required]) ])
177
178 multithread=yes
179 fi
180 AC_MSG_RESULT([multi threading : $multithread])
181
182 # --enable-bundle=NAME
183 AC_ARG_ENABLE(bundle,
184 AC_HELP_STRING([--enable-bundle=NAME],[bundle directory name
185 (default ifd-ccid.bundle)]),
186 [bundle="${enableval}"], [bundle=false])
187 if test "${bundle}" = false ; then
188 bundle="ifd-ccid.bundle"
189 fi
190 AC_MSG_RESULT([bundle directory name : $bundle])
191 AC_DEFINE_UNQUOTED(BUNDLE, "$bundle", [bundle directory name])
192
193 # --enable-usbdropdir=DIR
194 AC_ARG_ENABLE(usbdropdir,
195 AC_HELP_STRING([--enable-usbdropdir=DIR],[directory containing USB
196 drivers (default to pcscd config or $(prefix)/pcsc/drivers)]),
197 [usbdropdir="${enableval}"], [usbdropdir=false])
198 if test "${usbdropdir}" = false ; then
199 usbdropdir=`pkg-config libpcsclite --variable=usbdropdir`
200 fi
201 AC_MSG_RESULT([USB drop directory : $usbdropdir])
202 AC_DEFINE_UNQUOTED(PCSCLITE_HP_DROPDIR, "$usbdropdir", [directory containing USB drivers])
203 if test "${usbdropdir}" = "" ; then
204 AC_MSG_ERROR([use --enable-usbdropdir=DIR])
205 fi
206
207 # --enable-ccidtwindir=DIR
208 AC_ARG_ENABLE(ccidtwindir,
209 AC_HELP_STRING([--enable-ccidtwindir=DIR],[directory to install the
210 serial Twin driver (default to pcscd config or $(prefix)/pcsc/drivers/serial)]),
211 [ccidtwindir="${enableval}"], [ccidtwindir=false])
212 if test "${ccidtwindir}" = false ; then
213 ccidtwindir=`pkg-config libpcsclite --variable=usbdropdir`/serial
214 fi
215 AC_MSG_RESULT([serial twin install dir : $ccidtwindir])
216
217 # --disable-pcsclite
218 AC_ARG_ENABLE(pcsclite,
219 AC_HELP_STRING([--disable-pcsclite],[do not use pcsc-lite debug support]),
220 [ pcsclite="${enableval}" ], [ pcsclite=yes ] )
221
222 if test "${pcsclite}" = no ; then
223 AM_CONDITIONAL(WITHOUT_PCSC, true)
224 else
225 # check that pcsc-lite is installed
226 OLD_LIBS="$LIBS"
227 LIBS="$LIBS $PCSC_LIBS"
228 AC_CHECK_LIB(pcsclite, SCardEstablishContext, [],
229 [AC_MSG_ERROR([SCardEstablishContext() not found, install pcsc-lite 1.2.9-beta9 or later, or use PCSC_LIBS=... ./configure])])
230 LIBS="$OLD_LIBS"
231
232 AM_CONDITIONAL(WITHOUT_PCSC, false)
233
234 pcsclite=yes
235 fi
236 AC_MSG_RESULT([compiled for pcsc-lite : $pcsclite])
237
238
239 # Setup dist stuff
240 AC_SUBST(ac_aux_dir)
241 AC_SUBST(bundle)
242 AC_SUBST(usbdropdir)
243 AC_SUBST(ccidtwindir)
244
245 # Write Makefiles.
246 AC_CONFIG_FILES(Makefile
247 aclocal/Makefile
248 src/Makefile
249 readers/Makefile
250 examples/Makefile)
251
252 AC_OUTPUT
253

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.5