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

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

Parent Directory Parent Directory | Revision Log Revision Log


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

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.5