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

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

Parent Directory Parent Directory | Revision Log Revision Log


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

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.5