/[pcsclite]/tags/ccid/rel-1.3.3/configure.in
ViewVC logotype

Diff of /tags/ccid/rel-1.3.3/configure.in

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 887 by rousseau, Mon May 24 09:53:36 2004 UTC revision 2432 by rousseau, Sun Feb 25 10:47:39 2007 UTC
# Line 1  Line 1 
1  dnl Process this file with autoconf to produce a configure script.  # Process this file with autoconf to produce a configure script.
2  dnl You may need to use autoconf 2.56 or newer  # You may need to use autoconf 2.56 or newer
3    
4  dnl $Id$  # $Id$
5    
6  dnl Require autoconf 2.52  # Require autoconf 2.52
7  AC_PREREQ(2.52)  AC_PREREQ(2.52)
8    
9  AC_INIT(ccid, 0.4.2)  AC_INIT(ccid, 1.2.1)
10  AC_CONFIG_SRCDIR(src/ifdhandler.c)  AC_CONFIG_SRCDIR(src/ifdhandler.c)
11  AC_CONFIG_AUX_DIR(build)  AC_CONFIG_AUX_DIR(build)
12  AM_INIT_AUTOMAKE  AM_INIT_AUTOMAKE
13    
14  dnl Default install dir  # Default install dir
15  AC_PREFIX_DEFAULT(/usr/local)  AC_PREFIX_DEFAULT(/usr/local)
16    
17  dnl Automake boilerplate.  # Automake boilerplate.
18  AC_CANONICAL_HOST  AC_CANONICAL_HOST
19    
20  dnl create a config.h file (Automake will add -DHAVE_CONFIG_H)  # create a config.h file (Automake will add -DHAVE_CONFIG_H)
21  AM_CONFIG_HEADER(config.h)  AM_CONFIG_HEADER(config.h)
22    
23  dnl Options  # Options
24  AM_MAINTAINER_MODE  AM_MAINTAINER_MODE
25    
26  dnl Checks for programs.  # Checks for programs.
27  AC_PROG_CC  AC_PROG_CC
28  AC_PROG_CPP  AC_PROG_CPP
29  AC_PROG_INSTALL  AC_PROG_INSTALL
30  AC_PROG_MAKE_SET  AC_PROG_MAKE_SET
31  AC_PROG_LN_S  AC_PROG_LN_S
32  AM_PROG_LEX  AM_PROG_LEX
33  AC_CHECK_PROG([PKGCONFIG], [pkg-config], [yes])  PKG_PROG_PKG_CONFIG
34    
35  dnl Add libtool support.  # check pcsc-lite version
36    PCSC_NEEDED_VERSION="1.3.3"
37    PKG_CHECK_MODULES(PCSC, libpcsclite >= $PCSC_NEEDED_VERSION, [],
38            [ AC_MSG_RESULT([no])
39            if test -f /usr/local/lib/pkgconfig/libpcsclite.pc -a "x$PKG_CONFIG" != x ; then
40                    AC_MSG_ERROR([use PKG_CONFIG_PATH=/usr/local/lib/pkgconfig ./configure])
41              else
42                    AC_MSG_WARN([install pcsc-lite $PCSC_NEEDED_VERSION or later])
43              fi
44            ])
45    
46    saved_CPPFLAGS="$CPPFLAGS"
47    CPPFLAGS="$CPPFLAGS $PCSC_CFLAGS"
48    AC_CHECK_HEADER(ifdhandler.h,,
49            [AC_MSG_ERROR([ifdhandler.h not found, install pcsc-lite $PCSC_NEEDED_VERSION or later, or use ./configure PCSC_CFLAGS=...])])
50    AC_CHECK_DECL(IFD_NO_SUCH_DEVICE,, [AC_MSG_ERROR([install pcsc-lite $PCSC_NEEDED_VERSION or later])], [#include <ifdhandler.h>])
51    AC_CHECK_HEADER(reader.h,,
52            [AC_MSG_ERROR([reader.h not found, install pcsc-lite $PCSC_NEEDED_VERSION or later, or use ./configure PCSC_CFLAGS=...])])
53    CPPFLAGS="$saved_CPPFLAGS"
54    
55    # Add libtool support.
56  AM_PROG_LIBTOOL  AM_PROG_LIBTOOL
57    
58  dnl Automatically update the libtool script if it becomes out-of-date.  # Automatically update the libtool script if it becomes out-of-date.
59  AC_SUBST(LIBTOOL_DEPS)  AC_SUBST(LIBTOOL_DEPS)
60    
61  dnl Checks for header files.  # Checks for header files.
62  AC_HEADER_STDC  AC_HEADER_STDC
63  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,,  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 arpa/inet.h,,
64          [AC_MSG_WARN([some header files not found])])          [AC_MSG_ERROR([some header files not found])])
   
 AC_CHECK_HEADERS(pcsclite.h,,  
         [AC_MSG_ERROR([pcsclite.h not found, install pcsc-lite])])  
   
 AC_CHECK_HEADERS(ifdhandler.h,,  
         [AC_MSG_ERROR([ifdhandler.h not found, install pcsc-lite 1.2.9-beta3 or later])],  
         [ #include <pcsclite.h> ])  
   
65    
66  dnl Checks for typedefs, structures, and compiler characteristics.  # Checks for typedefs, structures, and compiler characteristics.
67  AC_C_CONST  AC_C_CONST
68  AC_TYPE_SIZE_T  AC_TYPE_SIZE_T
69  AC_HEADER_TIME  AC_HEADER_TIME
70    
71  dnl Checks for library functions.  # Checks for library functions.
72  AC_CHECK_FUNCS(select strerror strncpy memcpy)  AC_CHECK_FUNCS(select strerror strncpy memcpy)
73    
74  dnl Select OS specific versions of source files.  # Select OS specific versions of source files.
75  AC_SUBST(BUNDLE_HOST)  AC_SUBST(BUNDLE_HOST)
76  AC_SUBST(DYN_LIB_EXT)  AC_SUBST(DYN_LIB_EXT)
77  case "$host" in  case "$host" in
78  *-*-darwin*)  *-*-darwin*)
79          BUNDLE_HOST="MacOS"          BUNDLE_HOST="MacOS"
80          DYN_LIB_EXT="dylib"          DYN_LIB_EXT="dylib"
         AM_CONDITIONAL(NEED_PARSER, true)  
81    
82          AC_SUBST(COREFOUNDATION)          AC_SUBST(COREFOUNDATION)
83          COREFOUNDATION="-Wl,-framework,CoreFoundation"          COREFOUNDATION="-Wl,-framework,CoreFoundation"
# Line 77  case "$host" in Line 88  case "$host" in
88                  CFLAGS="$CFLAGS -no-cpp-precomp"                  CFLAGS="$CFLAGS -no-cpp-precomp"
89          fi          fi
90          ;;          ;;
91    *-*-freebsd*)
92            BUNDLE_HOST="FreeBSD"
93            DYN_LIB_EXT="so"
94            ;;
95    *-*-openbsd*)
96            BUNDLE_HOST="OpenBSD"
97            DYN_LIB_EXT="so.0.0"
98            ;;
99    *-*-solaris*)
100            BUNDLE_HOST="Solaris"
101            DYN_LIB_EXT="so"
102            ;;
103  *)  *)
104          BUNDLE_HOST="Linux"          BUNDLE_HOST="Linux"
105          DYN_LIB_EXT="so"          DYN_LIB_EXT="so"
         AM_CONDITIONAL(NEED_PARSER, false)  
106  esac  esac
107    
108  CFLAGS="$CFLAGS -Wall"  # --disable-libusb
   
 dnl --enable-libusb=PATH  
109  AC_ARG_ENABLE(libusb,  AC_ARG_ENABLE(libusb,
110          AC_HELP_STRING([--enable-libusb=PATH],[libusb path (default /usr)]),          AC_HELP_STRING([--disable-libusb],[do not use libusb]),
111          [          [ use_libusb="${enableval}" ], [ use_libusb=yes ] )
112                  case ${enableval} in  
113                          "" | "yes" | "YES")  # check if libusb is used
114                                  ;;  if test "x$use_libusb" != xno ; then
115                          "no" | "NO")          PKG_CHECK_MODULES(LIBUSB, libusb, [],
116                                  use_libusb=false                  [
117                                  ;;                          AC_MSG_RESULT([no])
118                          *)                          AC_CHECK_PROG([LIBUSBCONFIG], [libusb-config], [yes])
119                                  CPPFLAGS="$CPPFLAGS -I${enableval}/include"  
120                                  LDFLAGS="$LDFLAGS -L${enableval}/lib"                          if test "$LIBUSBCONFIG" = "yes" ; then
121                                  ;;                                  LIBUSB_CFLAGS="$LIBUSB_CFLAGS `libusb-config --cflags`"
122                  esac                                  LIBUSB_LIBS="$LIBUSB_LIBS `libusb-config --libs`"
123          ]                          else
124  )                                  AC_MSG_WARN([libusb-config not found.])
125                            fi
126  dnl check if libusb is available                  ])
127  if test "${use_libusb}" != false ; then  
128          AC_SUBST(LIBUSB)          saved_CPPFLAGS="$CPPFLAGS"
129            saved_LIBS="$LIBS"
130    
131            CPPFLAGS="$CPPFLAGS $LIBUSB_CFLAGS"
132            LIBS="$LDFLAGS $LIBUSB_LIBS"
133    
134          AC_CHECK_HEADERS(usb.h, [],          AC_CHECK_HEADERS(usb.h, [],
135                  [ AC_MSG_ERROR([usb.h not found, use --enable-libusb=PATH]) ])                  [ AC_MSG_ERROR([usb.h not found, use ./configure LIBUSB_CFLAGS=...]) ])
136    
         ac_save_LIBS="$LIBS"  
137          LIBS="$LIBS $COREFOUNDATION $IOKIT"          LIBS="$LIBS $COREFOUNDATION $IOKIT"
         AC_CHECK_LIB(usb, usb_init, [LIBUSB="$LIBUSB -lusb"],  
                 [ AC_MSG_ERROR([libusb not found]) ])  
         LIBS="$ac_save_LIBS"  
138    
139          ac_save_LIBS="$LIBS"          AC_MSG_CHECKING([for usb_init])
140          LIBS="$LIBS $COREFOUNDATION $IOKIT"          AC_TRY_LINK_FUNC(usb_init, [ AC_MSG_RESULT([yes]) ],
141          AC_CHECK_LIB(usb, usb_get_string_simple, [LIBUSB="$LIBUSB -lusb"],                  [ AC_MSG_ERROR([libusb not found, use ./configure LIBUSB_LIBS=...]) ])
142    
143            AC_MSG_CHECKING([for usb_get_string_simple])
144            AC_TRY_LINK_FUNC(usb_get_string_simple, [ AC_MSG_RESULT([yes]) ],
145                  [ AC_MSG_ERROR([your libusb is too old. install version 0.1.7 or above]) ])                  [ AC_MSG_ERROR([your libusb is too old. install version 0.1.7 or above]) ])
146          LIBS="$ac_save_LIBS"  
147            CPPFLAGS="$saved_CPPFLAGS"
148            LIBS="$saved_LIBS"
149    
150            use_libusb=yes
151  fi  fi
152    AC_SUBST(LIBUSB_CFLAGS)
153    AC_SUBST(LIBUSB_LIBS)
154    
155  dnl check shat to use for dlopen  AC_MSG_RESULT([use libusb              : $use_libusb])
 AC_SUBST(LIBDL)  
 AC_CHECK_LIB(dl, dlopen, [LIBDL="$LIBDL -ldl" ac_cv_func_dlopen_ldl=yes], ac_cv_func_dlopen_ldl=no)  
156    
157  dnl --enable-multi-thread  # check if the compiler support -fvisibility=hidden (GCC >= 4)
158    saved_CFLAGS="$CFLAGS"
159    CFLAGS="$CFLAGS -fvisibility=hidden"
160    AC_MSG_CHECKING([for -fvisibility=hidden])
161    AC_COMPILE_IFELSE([char foo;],
162        [   AC_MSG_RESULT([yes])
163            SYMBOL_VISIBILITY="-fvisibility=hidden" ],
164        AC_MSG_RESULT([no]))
165    CFLAGS="$saved_CFLAGS"
166    AC_SUBST(SYMBOL_VISIBILITY)
167    
168    # --disable-multi-thread
169  AC_ARG_ENABLE(multi-thread,  AC_ARG_ENABLE(multi-thread,
170          AC_HELP_STRING([--enable-multi-thread],[enable multi threading          AC_HELP_STRING([--disable-multi-thread],[disable multi threading]),
         (default=yes)]),  
171          [ multithread="${enableval}" ], [ multithread=yes ] )          [ multithread="${enableval}" ], [ multithread=yes ] )
172    
173  if test "${multithread}" != no ; then  if test "${multithread}" != no ; then
# Line 137  if test "${multithread}" != no ; then Line 175  if test "${multithread}" != no ; then
175                  [ AC_DEFINE(HAVE_PTHREAD, 1,                  [ AC_DEFINE(HAVE_PTHREAD, 1,
176                          [Define if you have POSIX threads libraries and header files.])                          [Define if you have POSIX threads libraries and header files.])
177                  ], [ AC_MSG_ERROR([POSIX thread support required]) ])                  ], [ AC_MSG_ERROR([POSIX thread support required]) ])
178    
179            multithread=yes
180  fi  fi
181  AC_MSG_RESULT([multi threading         : $multithread])  AC_MSG_RESULT([multi threading         : $multithread])
182    
183  dnl --enable-bundle=NAME  # --enable-bundle=NAME
184  AC_ARG_ENABLE(bundle,  AC_ARG_ENABLE(bundle,
185          AC_HELP_STRING([--enable-bundle=NAME],[bundle directory name          AC_HELP_STRING([--enable-bundle=NAME],[bundle directory name
186          (default ifd-ccid.bundle)]),          (default ifd-ccid.bundle)]),
# Line 151  fi Line 191  fi
191  AC_MSG_RESULT([bundle directory name   : $bundle])  AC_MSG_RESULT([bundle directory name   : $bundle])
192  AC_DEFINE_UNQUOTED(BUNDLE, "$bundle", [bundle directory name])  AC_DEFINE_UNQUOTED(BUNDLE, "$bundle", [bundle directory name])
193    
194  dnl --enable-usbdropdir=DIR  # --enable-usbdropdir=DIR
195  AC_ARG_ENABLE(usbdropdir,  AC_ARG_ENABLE(usbdropdir,
196          AC_HELP_STRING([--enable-usbdropdir=DIR],[directory containing USB          AC_HELP_STRING([--enable-usbdropdir=DIR],[directory containing USB
197          drivers (default to pcscd config or $(prefix)/pcsc/drivers)]),          drivers (default to pcscd config or $(prefix)/pcsc/drivers)]),
198          [usbdropdir="${enableval}"], [usbdropdir=false])          [usbdropdir="${enableval}"], [usbdropdir=false])
199  if test "${usbdropdir}" = false ; then  if test "${usbdropdir}" = false ; then
200          if test "$prefix" = NONE ; then          usbdropdir=`pkg-config libpcsclite --variable=usbdropdir`
                 if test "$PKGCONFIG" = yes ; then  
                         usbdropdir=`pkg-config libpcsclite --variable=usbdropdir`  
                 else  
                         usbdropdir=""  
                 fi  
                 if test -z "$usbdropdir" ; then  
                         usbdropdir="$ac_default_prefix/pcsc/drivers"  
                 fi  
         else  
                 usbdropdir="$prefix/pcsc/drivers"  
         fi  
201  fi  fi
202  AC_MSG_RESULT([USB drop directory      : $usbdropdir])  AC_MSG_RESULT([USB drop directory      : $usbdropdir])
203  AC_DEFINE_UNQUOTED(PCSCLITE_HP_DROPDIR, "$usbdropdir", [directory containing USB drivers])  AC_DEFINE_UNQUOTED(PCSCLITE_HP_DROPDIR, "$usbdropdir", [directory containing USB drivers])
204    if test "${usbdropdir}" = "" ; then
205            AC_MSG_ERROR([use --enable-usbdropdir=DIR])
206    fi
207    
208    # --enable-twinserial
209    AC_ARG_ENABLE(twinserial,
210            AC_HELP_STRING([--enable-twinserial],[also compile and install the serial Twin driver]),
211            [twinserial="${enableval}"], [twinserial=no])
212    AC_MSG_RESULT([build and install serial Twin driver : $twinserial])
213    AM_CONDITIONAL(WITH_TWIN_SERIAL, test "${twinserial}" != "no")
214    
215  dnl --enable-ccidtwindir=DIR  # --enable-ccidtwindir=DIR
216  AC_ARG_ENABLE(ccidtwindir,  AC_ARG_ENABLE(ccidtwindir,
217          AC_HELP_STRING([--enable-ccidtwindir=DIR],[directory to install the          AC_HELP_STRING([--enable-ccidtwindir=DIR],[directory to install the
218          serial Twin driver (default to pcscd config or $(prefix)/pcsc/drivers/serial)]),          serial Twin driver (default to pcscd config or $(prefix)/pcsc/drivers/serial)]),
219          [ccidtwindir="${enableval}"], [ccidtwindir=false])          [ccidtwindir="${enableval}"], [ccidtwindir=false])
220  if test "${ccidtwindir}" = false ; then  if test "${ccidtwindir}" = false ; then
221          if test "$prefix" = NONE ; then          ccidtwindir=`pkg-config libpcsclite --variable=usbdropdir`/serial
                 if test "$PKGCONFIG" = yes ; then  
                         ccidtwindir=`pkg-config libpcsclite --variable=usbdropdir`  
                 else  
                         AC_MSG_RESULT([You should install pkg-config to get this configured automatically from pcsc-lite installation])  
                         ccidtwindir=""  
                 fi  
                 if test -z "$ccidtwindir" ; then  
                         ccidtwindir="$ac_default_prefix/pcsc/drivers"  
                 fi  
                 ccidtwindir="$ccidtwindir/serial"  
         else  
                 ccidtwindir="$prefix/pcsc/drivers/serial"  
         fi  
222  fi  fi
223  AC_MSG_RESULT([serial twin install dir : $ccidtwindir])  AC_MSG_RESULT([serial twin install dir : $ccidtwindir])
224  AC_DEFINE_UNQUOTED(PCSCLITE_HP_DROPDIR, "$ccidtwindir", [directory containing USB drivers])  
225    # --disable-pcsclite
226    AC_ARG_ENABLE(pcsclite,
227            AC_HELP_STRING([--disable-pcsclite],[do not use pcsc-lite debug support]),
228            [ pcsclite="${enableval}" ], [ pcsclite=yes ] )
229    
230    if test "${pcsclite}" != no ; then
231            # check that pcsc-lite is installed
232            OLD_LIBS="$LIBS"
233            LIBS="$LIBS $PCSC_LIBS"
234            AC_MSG_CHECKING([for SCardEstablishContext])
235            AC_TRY_LINK_FUNC(SCardEstablishContext,
236                [ AC_MSG_RESULT([yes]) ],
237                    [ AC_MSG_ERROR([SCardEstablishContext() not found, install pcsc-lite 1.2.9-beta9 or later,or use LDLIBS=...  ./configure]) ])
238            LIBS="$OLD_LIBS"
239    
240            pcsclite=yes
241    fi
242    AC_MSG_RESULT([compiled for pcsc-lite  : $pcsclite])
243    AM_CONDITIONAL(WITHOUT_PCSC, test "${pcsclite}" != "yes")
244    
245    # --enable-udev
246    AC_ARG_ENABLE(udev,
247            AC_HELP_STRING([--enable-udev],[udev support for pcscd hotplug]),
248            [udev="${enableval}"], [udev=no])
249    AC_MSG_RESULT([udev support            : $udev])
250    AM_CONDITIONAL(UDEV, test "${udev}" != "no")
251    
252    
253  dnl Setup dist stuff  # Setup dist stuff
254  AC_SUBST(ac_aux_dir)  AC_SUBST(ac_aux_dir)
255  AC_SUBST(bundle)  AC_SUBST(bundle)
256  AC_SUBST(usbdropdir)  AC_SUBST(usbdropdir)
257  AC_SUBST(ccidtwindir)  AC_SUBST(ccidtwindir)
258    
259  dnl Write Makefiles.  # Write Makefiles.
260  AC_CONFIG_FILES(Makefile  AC_CONFIG_FILES(Makefile
261          aclocal/Makefile          aclocal/Makefile
262          src/Makefile          src/Makefile
263          readers/Makefile          readers/Makefile
264            contrib/Makefile
265            contrib/Kobil_mIDentity_switch/Makefile
266          examples/Makefile)          examples/Makefile)
267    
268  AC_OUTPUT  AC_OUTPUT

Legend:
Removed from v.887  
changed lines
  Added in v.2432

  ViewVC Help
Powered by ViewVC 1.1.5