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

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

Parent Directory Parent Directory | Revision Log Revision Log


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

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.5