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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1359 - (hide annotations) (download)
Sun Feb 27 21:03:14 2005 UTC (8 years, 2 months ago) by rousseau
File size: 5671 byte(s)
if /usr/local/lib/pkgconfig/libpcsclite.pc exists (default pcsc-lite
configuration) we exit telling the user to use
PKG_CONFIG_PATH=/usr/local/lib/pkgconfig ./configure
1 rousseau 402 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 rousseau 1095 AC_INIT(ccid, 0.9.2)
10 rousseau 402 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 rousseau 448 AC_PROG_CPP
29 rousseau 402 AC_PROG_INSTALL
30     AC_PROG_MAKE_SET
31     AC_PROG_LN_S
32     AM_PROG_LEX
33 rousseau 1251
34 rousseau 1328 dnl check pcsc-lite version
35     PKG_CHECK_MODULES(PCSC, libpcsclite >= 1.2.9-beta5, [],
36 rousseau 1359 [ 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-beta5 or later])
40     fi
41     ])
42 rousseau 402
43 rousseau 1328 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-beta5 or later, or use CFLAGS=... ./configure])],
47     [ #include <ifdhandler.h> ])
48     CFLAGS="$OLD_CFLAGS"
49 rousseau 1253
50 rousseau 402 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 rousseau 876 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 rousseau 402
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 rousseau 887 CFLAGS="$CFLAGS -Wall"
94 rousseau 402
95 rousseau 436 dnl --enable-libusb=PATH
96 rousseau 460 AC_ARG_ENABLE(libusb,
97     AC_HELP_STRING([--enable-libusb=PATH],[libusb path (default /usr)]),
98 rousseau 436 [
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 rousseau 402 dnl check if libusb is available
114 rousseau 565 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 rousseau 436
119 rousseau 565 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 rousseau 402
125 rousseau 565 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 rousseau 556
132 rousseau 1302 dnl check what to use for dlopen
133 rousseau 402 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 rousseau 460 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 rousseau 563 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 rousseau 460 fi
148     AC_MSG_RESULT([multi threading : $multithread])
149    
150 rousseau 402 dnl --enable-bundle=NAME
151     AC_ARG_ENABLE(bundle,
152 rousseau 460 AC_HELP_STRING([--enable-bundle=NAME],[bundle directory name
153     (default ifd-ccid.bundle)]),
154     [bundle="${enableval}"], [bundle=false])
155 rousseau 402 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 rousseau 460 AC_HELP_STRING([--enable-usbdropdir=DIR],[directory containing USB
164 rousseau 871 drivers (default to pcscd config or $(prefix)/pcsc/drivers)]),
165 rousseau 460 [usbdropdir="${enableval}"], [usbdropdir=false])
166 rousseau 402 if test "${usbdropdir}" = false ; then
167 rousseau 1328 usbdropdir=`pkg-config libpcsclite --variable=usbdropdir`
168 rousseau 402 fi
169     AC_MSG_RESULT([USB drop directory : $usbdropdir])
170     AC_DEFINE_UNQUOTED(PCSCLITE_HP_DROPDIR, "$usbdropdir", [directory containing USB drivers])
171    
172 rousseau 564 dnl --enable-ccidtwindir=DIR
173     AC_ARG_ENABLE(ccidtwindir,
174     AC_HELP_STRING([--enable-ccidtwindir=DIR],[directory to install the
175 rousseau 871 serial Twin driver (default to pcscd config or $(prefix)/pcsc/drivers/serial)]),
176 rousseau 564 [ccidtwindir="${enableval}"], [ccidtwindir=false])
177     if test "${ccidtwindir}" = false ; then
178 rousseau 1328 ccidtwindir=`pkg-config libpcsclite --variable=usbdropdir`/serial
179 rousseau 564 fi
180     AC_MSG_RESULT([serial twin install dir : $ccidtwindir])
181     AC_DEFINE_UNQUOTED(PCSCLITE_HP_DROPDIR, "$ccidtwindir", [directory containing USB drivers])
182    
183 rousseau 896 dnl --enable-pcsclite
184     AC_ARG_ENABLE(pcsclite,
185     AC_HELP_STRING([--enable-pcsclite],[compile for pcsc-lite (default=yes)]),
186     [ pcsclite=no ], [ pcsclite=yes ] )
187 rousseau 564
188 rousseau 896 if test "${pcsclite}" = no ; then
189 rousseau 1342 AM_CONDITIONAL(WITHOUT_PCSC, true)
190 rousseau 896 AM_CONDITIONAL(NEED_PARSER, true)
191 rousseau 1349 else
192     AM_CONDITIONAL(WITHOUT_PCSC, false)
193 rousseau 896 fi
194     AC_MSG_RESULT([compiled for pcsc-lite : $pcsclite])
195    
196    
197 rousseau 402 dnl Setup dist stuff
198     AC_SUBST(ac_aux_dir)
199     AC_SUBST(bundle)
200     AC_SUBST(usbdropdir)
201 rousseau 564 AC_SUBST(ccidtwindir)
202 rousseau 402
203     dnl Write Makefiles.
204 rousseau 887 AC_CONFIG_FILES(Makefile
205     aclocal/Makefile
206     src/Makefile
207     readers/Makefile
208     examples/Makefile)
209    
210 rousseau 402 AC_OUTPUT
211    

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.5