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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1328 - (hide annotations) (download)
Mon Feb 21 12:29:32 2005 UTC (8 years, 3 months ago) by rousseau
File size: 5489 byte(s)
use pkg-config(1) to find everything related to pcsc-lite

if you installed pcsc-lite in /usr/local you may use
$ PKG_CONFIG_PATH=/usr/local/lib/pkgconfig ./configure

if you do not have pkg-config installed you may use
$ CFLAGS=-I/usr/local/include/PCSC ./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 872 AC_CHECK_PROG([PKGCONFIG], [pkg-config], [yes])
34 rousseau 1251
35 rousseau 1328 dnl check pcsc-lite version
36     PKG_CHECK_MODULES(PCSC, libpcsclite >= 1.2.9-beta5, [],
37     [AC_MSG_WARN([install pcsc-lite 1.2.9-beta5 or later])])
38 rousseau 402
39 rousseau 1328 OLD_CFLAGS="$CFLAGS"
40     CFLAGS="$CFLAGS $PCSC_CFLAGS"
41     AC_CHECK_HEADER(ifdhandler.h,,
42     [AC_MSG_ERROR([ifdhandler.h not found, install pcsc-lite 1.2.9-beta5 or later, or use CFLAGS=... ./configure])],
43     [ #include <ifdhandler.h> ])
44     CFLAGS="$OLD_CFLAGS"
45 rousseau 1253
46 rousseau 402 dnl Add libtool support.
47     AM_PROG_LIBTOOL
48    
49     dnl Automatically update the libtool script if it becomes out-of-date.
50     AC_SUBST(LIBTOOL_DEPS)
51    
52     dnl Checks for header files.
53     AC_HEADER_STDC
54 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,,
55     [AC_MSG_WARN([some header files not found])])
56 rousseau 402
57     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 1302 dnl check what to use for dlopen
129 rousseau 402 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 1328 usbdropdir=`pkg-config libpcsclite --variable=usbdropdir`
164 rousseau 402 fi
165     AC_MSG_RESULT([USB drop directory : $usbdropdir])
166     AC_DEFINE_UNQUOTED(PCSCLITE_HP_DROPDIR, "$usbdropdir", [directory containing USB drivers])
167    
168 rousseau 564 dnl --enable-ccidtwindir=DIR
169     AC_ARG_ENABLE(ccidtwindir,
170     AC_HELP_STRING([--enable-ccidtwindir=DIR],[directory to install the
171 rousseau 871 serial Twin driver (default to pcscd config or $(prefix)/pcsc/drivers/serial)]),
172 rousseau 564 [ccidtwindir="${enableval}"], [ccidtwindir=false])
173     if test "${ccidtwindir}" = false ; then
174 rousseau 1328 ccidtwindir=`pkg-config libpcsclite --variable=usbdropdir`/serial
175 rousseau 564 fi
176     AC_MSG_RESULT([serial twin install dir : $ccidtwindir])
177     AC_DEFINE_UNQUOTED(PCSCLITE_HP_DROPDIR, "$ccidtwindir", [directory containing USB drivers])
178    
179 rousseau 896 dnl --enable-pcsclite
180     AC_ARG_ENABLE(pcsclite,
181     AC_HELP_STRING([--enable-pcsclite],[compile for pcsc-lite (default=yes)]),
182     [ pcsclite=no ], [ pcsclite=yes ] )
183 rousseau 564
184 rousseau 896 if test "${pcsclite}" = no ; then
185     AM_CONDITIONAL(NEED_PARSER, true)
186     fi
187     AC_MSG_RESULT([compiled for pcsc-lite : $pcsclite])
188    
189    
190 rousseau 402 dnl Setup dist stuff
191     AC_SUBST(ac_aux_dir)
192     AC_SUBST(bundle)
193     AC_SUBST(usbdropdir)
194 rousseau 564 AC_SUBST(ccidtwindir)
195 rousseau 402
196     dnl Write Makefiles.
197 rousseau 887 AC_CONFIG_FILES(Makefile
198     aclocal/Makefile
199     src/Makefile
200     readers/Makefile
201     examples/Makefile)
202    
203 rousseau 402 AC_OUTPUT
204    

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.5