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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2078 - (show annotations) (download)
Thu Jun 8 08:36:49 2006 UTC (7 years ago) by rousseau
File size: 6981 byte(s)
add support of FreeBSD
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 *-*-freebsd*)
91 BUNDLE_HOST="FreeBSD"
92 DYN_LIB_EXT="so"
93 ;;
94 *-*-openbsd*)
95 BUNDLE_HOST="OpenBSD"
96 DYN_LIB_EXT="so.0.0"
97 ;;
98 *-*-solaris*)
99 BUNDLE_HOST="Solaris"
100 DYN_LIB_EXT="so"
101 ;;
102 *)
103 BUNDLE_HOST="Linux"
104 DYN_LIB_EXT="so"
105 esac
106
107 # --disable-libusb
108 AC_ARG_ENABLE(libusb,
109 AC_HELP_STRING([--disable-libusb],[do not use libusb]),
110 [ use_libusb="${enableval}" ], [ use_libusb=yes ] )
111
112 # check if libusb is used
113 if test "x$use_libusb" != xno ; then
114 PKG_CHECK_MODULES(LIBUSB, libusb, [],
115 [
116 AC_MSG_RESULT([no])
117 AC_CHECK_PROG([LIBUSBCONFIG], [libusb-config], [yes])
118
119 if test "$LIBUSBCONFIG" = "yes" ; then
120 LIBUSB_CFLAGS="$LIBUSB_CFLAGS `libusb-config --cflags`"
121 LIBUSB_LIBS="$LIBUSB_LIBS `libusb-config --libs`"
122 else
123 AC_MSG_WARN([libusb-config not found.])
124 fi
125 ])
126
127 saved_CPPFLAGS="$CPPFLAGS"
128 saved_LIBS="$LIBS"
129
130 CPPFLAGS="$CPPFLAGS $LIBUSB_CFLAGS"
131 LIBS="$LDFLAGS $LIBUSB_LIBS"
132
133 AC_CHECK_HEADERS(usb.h, [],
134 [ AC_MSG_ERROR([usb.h not found, use ./configure LIBUSB_CFLAGS=...]) ])
135
136 LIBS="$LIBS $COREFOUNDATION $IOKIT"
137
138 AC_MSG_CHECKING([for usb_init])
139 AC_TRY_LINK_FUNC(usb_init, [ AC_MSG_RESULT([yes]) ],
140 [ AC_MSG_ERROR([libusb not found, use ./configure LIBUSB_LIBS=...]) ])
141
142 AC_MSG_CHECKING([for usb_get_string_simple])
143 AC_TRY_LINK_FUNC(usb_get_string_simple, [ AC_MSG_RESULT([yes]) ],
144 [ AC_MSG_ERROR([your libusb is too old. install version 0.1.7 or above]) ])
145
146 CPPFLAGS="$saved_CPPFLAGS"
147 LIBS="$saved_LIBS"
148
149 use_libusb=yes
150 fi
151 AC_SUBST(LIBUSB_CFLAGS)
152 AC_SUBST(LIBUSB_LIBS)
153
154 AC_MSG_RESULT([use libusb : $use_libusb])
155
156 # check what to use for dlopen
157 AC_SUBST(LIBDL)
158 AC_CHECK_LIB(dl, dlopen, [LIBDL="$LIBDL -ldl" ac_cv_func_dlopen_ldl=yes], ac_cv_func_dlopen_ldl=no)
159
160 # check if the compiler support -fvisibility=hidden (GCC >= 4)
161 saved_CFLAGS="$CFLAGS"
162 CFLAGS="$CFLAGS -fvisibility=hidden"
163 AC_MSG_CHECKING([for -fvisibility=hidden])
164 AC_COMPILE_IFELSE([char foo;],
165 [ AC_MSG_RESULT([yes])
166 SYMBOL_VISIBILITY="-fvisibility=hidden" ],
167 AC_MSG_RESULT([no]))
168 CFLAGS="$saved_CFLAGS"
169 AC_SUBST(SYMBOL_VISIBILITY)
170
171 # --disable-multi-thread
172 AC_ARG_ENABLE(multi-thread,
173 AC_HELP_STRING([--disable-multi-thread],[disable multi threading]),
174 [ multithread="${enableval}" ], [ multithread=yes ] )
175
176 if test "${multithread}" != no ; then
177 ACX_PTHREAD(
178 [ AC_DEFINE(HAVE_PTHREAD, 1,
179 [Define if you have POSIX threads libraries and header files.])
180 ], [ AC_MSG_ERROR([POSIX thread support required]) ])
181
182 multithread=yes
183 fi
184 AC_MSG_RESULT([multi threading : $multithread])
185
186 # --enable-bundle=NAME
187 AC_ARG_ENABLE(bundle,
188 AC_HELP_STRING([--enable-bundle=NAME],[bundle directory name
189 (default ifd-ccid.bundle)]),
190 [bundle="${enableval}"], [bundle=false])
191 if test "${bundle}" = false ; then
192 bundle="ifd-ccid.bundle"
193 fi
194 AC_MSG_RESULT([bundle directory name : $bundle])
195 AC_DEFINE_UNQUOTED(BUNDLE, "$bundle", [bundle directory name])
196
197 # --enable-usbdropdir=DIR
198 AC_ARG_ENABLE(usbdropdir,
199 AC_HELP_STRING([--enable-usbdropdir=DIR],[directory containing USB
200 drivers (default to pcscd config or $(prefix)/pcsc/drivers)]),
201 [usbdropdir="${enableval}"], [usbdropdir=false])
202 if test "${usbdropdir}" = false ; then
203 usbdropdir=`pkg-config libpcsclite --variable=usbdropdir`
204 fi
205 AC_MSG_RESULT([USB drop directory : $usbdropdir])
206 AC_DEFINE_UNQUOTED(PCSCLITE_HP_DROPDIR, "$usbdropdir", [directory containing USB drivers])
207 if test "${usbdropdir}" = "" ; then
208 AC_MSG_ERROR([use --enable-usbdropdir=DIR])
209 fi
210
211 # --enable-ccidtwindir=DIR
212 AC_ARG_ENABLE(ccidtwindir,
213 AC_HELP_STRING([--enable-ccidtwindir=DIR],[directory to install the
214 serial Twin driver (default to pcscd config or $(prefix)/pcsc/drivers/serial)]),
215 [ccidtwindir="${enableval}"], [ccidtwindir=false])
216 if test "${ccidtwindir}" = false ; then
217 ccidtwindir=`pkg-config libpcsclite --variable=usbdropdir`/serial
218 fi
219 AC_MSG_RESULT([serial twin install dir : $ccidtwindir])
220
221 # --disable-pcsclite
222 AC_ARG_ENABLE(pcsclite,
223 AC_HELP_STRING([--disable-pcsclite],[do not use pcsc-lite debug support]),
224 [ pcsclite="${enableval}" ], [ pcsclite=yes ] )
225
226 if test "${pcsclite}" = no ; then
227 AM_CONDITIONAL(WITHOUT_PCSC, true)
228 else
229 # check that pcsc-lite is installed
230 OLD_LIBS="$LIBS"
231 LIBS="$LIBS $PCSC_LIBS"
232 AC_CHECK_LIB(pcsclite, SCardEstablishContext, [],
233 [AC_MSG_ERROR([SCardEstablishContext() not found, install pcsc-lite 1.2.9-beta9 or later, or use PCSC_LIBS=... ./configure])])
234 LIBS="$OLD_LIBS"
235
236 AM_CONDITIONAL(WITHOUT_PCSC, false)
237
238 pcsclite=yes
239 fi
240 AC_MSG_RESULT([compiled for pcsc-lite : $pcsclite])
241
242
243 # Setup dist stuff
244 AC_SUBST(ac_aux_dir)
245 AC_SUBST(bundle)
246 AC_SUBST(usbdropdir)
247 AC_SUBST(ccidtwindir)
248
249 # Write Makefiles.
250 AC_CONFIG_FILES(Makefile
251 aclocal/Makefile
252 src/Makefile
253 readers/Makefile
254 examples/Makefile)
255
256 AC_OUTPUT
257

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.5