/[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 460 by rousseau, Mon Sep 22 14:21:57 2003 UTC revision 1846 by rousseau, Mon Jan 30 15:13:51 2006 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.3.1)  AC_INIT(ccid, 0.9.4)
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    # create a config.h file (Automake will add -DHAVE_CONFIG_H)
 dnl 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
# Line 32  AC_PROG_MAKE_SET Line 31  AC_PROG_MAKE_SET
31  AC_PROG_LN_S  AC_PROG_LN_S
32  AM_PROG_LEX  AM_PROG_LEX
33    
34  AC_CHECK_FUNCS(strerror)  # check pcsc-lite version
35  AC_CHECK_FUNCS(strncpy)  PKG_CHECK_MODULES(PCSC, libpcsclite >= 1.2.9-beta9, [],
36            [ AC_MSG_RESULT([no])
37  AC_CHECK_HEADERS(errno.h)          if test -f /usr/local/lib/pkgconfig/libpcsclite.pc -a "x$PKG_CONFIG" != x ; then
38                    AC_MSG_ERROR([use PKG_CONFIG_PATH=/usr/local/lib/pkgconfig ./configure])
39              else
40                    AC_MSG_WARN([install pcsc-lite 1.2.9-beta9 or later])
41              fi
42            ])
43    
44    saved_CPPFLAGS="$CPPFLAGS"
45    CPPFLAGS="$CPPFLAGS $PCSC_CFLAGS"
46    AC_CHECK_HEADER(ifdhandler.h,,
47            [AC_MSG_ERROR([ifdhandler.h not found, install pcsc-lite 1.2.9-beta9 or later, or use ./configure PCSC_CFLAGS=...])],
48            [ #include <ifdhandler.h> ])
49    AC_CHECK_HEADER(reader.h,,
50            [AC_MSG_ERROR([reader.h not found, install pcsc-lite 1.2.9-beta9 or later, or use ./configure PCSC_CFLAGS=...])],
51            [ #include <reader.h> ])
52    CPPFLAGS="$saved_CPPFLAGS"
53    
54  dnl Add libtool support.  # Add libtool support.
55  AM_PROG_LIBTOOL  AM_PROG_LIBTOOL
56    
57  dnl Automatically update the libtool script if it becomes out-of-date.  # Automatically update the libtool script if it becomes out-of-date.
58  AC_SUBST(LIBTOOL_DEPS)  AC_SUBST(LIBTOOL_DEPS)
59    
60  dnl Checks for header files.  # Checks for header files.
61  AC_HEADER_STDC  AC_HEADER_STDC
62  AC_CHECK_HEADERS(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,,
63            [AC_MSG_WARN([some header files not found])])
64    
65  dnl Checks for typedefs, structures, and compiler characteristics.  # Checks for typedefs, structures, and compiler characteristics.
66  AC_C_CONST  AC_C_CONST
67  AC_TYPE_SIZE_T  AC_TYPE_SIZE_T
68  AC_HEADER_TIME  AC_HEADER_TIME
69    
70  dnl Checks for library functions.  # Checks for library functions.
71  AC_CHECK_FUNCS(select strerror strncpy memcpy)  AC_CHECK_FUNCS(select strerror strncpy memcpy)
72    
73  dnl Select OS specific versions of source files.  # Select OS specific versions of source files.
74  AC_SUBST(BUNDLE_HOST)  AC_SUBST(BUNDLE_HOST)
75  AC_SUBST(DYN_LIB_EXT)  AC_SUBST(DYN_LIB_EXT)
76  case "$host" in  case "$host" in
77  *-*-darwin*)  *-*-darwin*)
78          BUNDLE_HOST="MacOS"          BUNDLE_HOST="MacOS"
79          DYN_LIB_EXT="dylib"          DYN_LIB_EXT="dylib"
         AM_CONDITIONAL(NEED_PARSER, true)  
80    
81          AC_SUBST(COREFOUNDATION)          AC_SUBST(COREFOUNDATION)
82          COREFOUNDATION="-Wl,-framework,CoreFoundation"          COREFOUNDATION="-Wl,-framework,CoreFoundation"
# Line 73  case "$host" in Line 87  case "$host" in
87                  CFLAGS="$CFLAGS -no-cpp-precomp"                  CFLAGS="$CFLAGS -no-cpp-precomp"
88          fi          fi
89          ;;          ;;
90    *-*-openbsd*)
91            BUNDLE_HOST="OpenBSD"
92            DYN_LIB_EXT="so.0.0"
93            ;;
94  *)  *)
95          BUNDLE_HOST="Linux"          BUNDLE_HOST="Linux"
96          DYN_LIB_EXT="so"          DYN_LIB_EXT="so"
         AM_CONDITIONAL(NEED_PARSER, false)  
97  esac  esac
98    
99  CFLAGS="$CFLAGS -Wall -fno-common"  CFLAGS="$CFLAGS -Wall"
100    
101  dnl --enable-libusb=PATH  # --enable-libusb
102  AC_ARG_ENABLE(libusb,  AC_ARG_ENABLE(libusb,
103          AC_HELP_STRING([--enable-libusb=PATH],[libusb path (default /usr)]),          AC_HELP_STRING([--enable-libusb],[use libusb (default=yes)]),
104          [          [ use_libusb=no ], [ use_libusb=yes ] )
                 case ${enableval} in  
                         "" | "yes" | "YES")  
                                 ;;  
                         "no" | "NO")  
                                 use_libusb=false  
                                 ;;  
                         *)  
                                 CPPFLAGS="$CPPFLAGS -I${enableval}/include"  
                                 LDFLAGS="$LDFLAGS -L${enableval}/lib"  
                                 ;;  
                 esac  
         ]  
 )  
   
 dnl check if libusb is available  
 AC_SUBST(LIBUSB)  
 AC_CHECK_HEADERS(usb.h, [],  
         [ AC_MSG_ERROR([usb.h not found, use --enable-libusb=PATH]) ])  
   
 ac_save_LIBS="$LIBS"  
 LIBS="$LIBS $COREFOUNDATION $IOKIT"  
 AC_CHECK_LIB(usb, usb_init, [LIBUSB="$LIBUSB -lusb"],  
         [ AC_MSG_ERROR([libusb not found]) ])  
 LIBS="$ac_save_LIBS"  
105    
106  dnl check shat to use for dlopen  # check if libusb is used
107    if test "x$use_libusb" != xno ; then
108            PKG_CHECK_MODULES(LIBUSB, libusb, [],
109                    [
110                            AC_MSG_RESULT([no])
111                            AC_CHECK_PROG([LIBUSBCONFIG], [libusb-config], [yes])
112    
113                            if test "$LIBUSBCONFIG" = "yes" ; then
114                                    LIBUSB_CFLAGS="$LIBUSB_CFLAGS `libusb-config --cflags`"
115                                    LIBUSB_LIBS="$LIBUSB_LIBS `libusb-config --libs`"
116                            else
117                                    AC_MSG_WARN([libusb-config not found.])
118                            fi
119                    ])
120    
121            saved_CPPFLAGS="$CPPFLAGS"
122            saved_LIBS="$LIBS"
123    
124            CPPFLAGS="$CPPFLAGS $LIBUSB_CFLAGS"
125            LIBS="$LDFLAGS $LIBUSB_LIBS"
126    
127            AC_CHECK_HEADERS(usb.h, [],
128                    [ AC_MSG_ERROR([usb.h not found, use ./configure LIBUSB_CFLAGS=...]) ])
129    
130            LIBS="$LIBS $COREFOUNDATION $IOKIT"
131    
132            AC_MSG_CHECKING([for usb_init])
133            AC_TRY_LINK_FUNC(usb_init, [ AC_MSG_RESULT([yes]) ],
134                    [ AC_MSG_ERROR([libusb not found, use ./configure LIBUSB_LIBS=...]) ])
135    
136            AC_MSG_CHECKING([for usb_get_string_simple])
137            AC_TRY_LINK_FUNC(usb_get_string_simple, [ AC_MSG_RESULT([yes]) ],
138                    [ AC_MSG_ERROR([your libusb is too old. install version 0.1.7 or above]) ])
139    
140            CPPFLAGS="$saved_CPPFLAGS"
141            LIBS="$saved_LIBS"
142    fi
143    AC_SUBST(LIBUSB_CFLAGS)
144    AC_SUBST(LIBUSB_LIBS)
145    
146    # check what to use for dlopen
147  AC_SUBST(LIBDL)  AC_SUBST(LIBDL)
148  AC_CHECK_LIB(dl, dlopen, [LIBDL="$LIBDL -ldl" ac_cv_func_dlopen_ldl=yes], ac_cv_func_dlopen_ldl=no)  AC_CHECK_LIB(dl, dlopen, [LIBDL="$LIBDL -ldl" ac_cv_func_dlopen_ldl=yes], ac_cv_func_dlopen_ldl=no)
149    
150  dnl --enable-multi-thread  # --enable-multi-thread
151  AC_ARG_ENABLE(multi-thread,  AC_ARG_ENABLE(multi-thread,
152          AC_HELP_STRING([--enable-multi-thread],[enable multi threading          AC_HELP_STRING([--enable-multi-thread],[enable multi threading
153          (default=yes)]),          (default=yes)]),
154          [ multithread="${enableval}" ], [ multithread=yes ] )          [ multithread="${enableval}" ], [ multithread=yes ] )
155    
156  if test "${multithread}" != no ; then  if test "${multithread}" != no ; then
157          AC_CHECK_HEADERS(pthread.h, [], [ AC_MSG_ERROR([pthread.h not found]) ])          ACX_PTHREAD(
158          AC_CHECK_LIB(pthread, pthread_mutex_lock, [ LIBS="$LIBS -lpthread" ],                  [ AC_DEFINE(HAVE_PTHREAD, 1,
159                  [ multithread=no ])                          [Define if you have POSIX threads libraries and header files.])
160                    ], [ AC_MSG_ERROR([POSIX thread support required]) ])
161  fi  fi
162  AC_MSG_RESULT([multi threading         : $multithread])  AC_MSG_RESULT([multi threading         : $multithread])
163    
164  dnl --enable-bundle=NAME  # --enable-bundle=NAME
165  AC_ARG_ENABLE(bundle,  AC_ARG_ENABLE(bundle,
166          AC_HELP_STRING([--enable-bundle=NAME],[bundle directory name          AC_HELP_STRING([--enable-bundle=NAME],[bundle directory name
167          (default ifd-ccid.bundle)]),          (default ifd-ccid.bundle)]),
# Line 138  fi Line 172  fi
172  AC_MSG_RESULT([bundle directory name   : $bundle])  AC_MSG_RESULT([bundle directory name   : $bundle])
173  AC_DEFINE_UNQUOTED(BUNDLE, "$bundle", [bundle directory name])  AC_DEFINE_UNQUOTED(BUNDLE, "$bundle", [bundle directory name])
174    
175  dnl --enable-usbdropdir=DIR  # --enable-usbdropdir=DIR
176  AC_ARG_ENABLE(usbdropdir,  AC_ARG_ENABLE(usbdropdir,
177          AC_HELP_STRING([--enable-usbdropdir=DIR],[directory containing USB          AC_HELP_STRING([--enable-usbdropdir=DIR],[directory containing USB
178          drivers (default /usr/local/pcsc/drivers)]),          drivers (default to pcscd config or $(prefix)/pcsc/drivers)]),
179          [usbdropdir="${enableval}"], [usbdropdir=false])          [usbdropdir="${enableval}"], [usbdropdir=false])
180  if test "${usbdropdir}" = false ; then  if test "${usbdropdir}" = false ; then
181          usbdropdir="/usr/local/pcsc/drivers"          usbdropdir=`pkg-config libpcsclite --variable=usbdropdir`
182  fi  fi
183  AC_MSG_RESULT([USB drop directory      : $usbdropdir])  AC_MSG_RESULT([USB drop directory      : $usbdropdir])
184  AC_DEFINE_UNQUOTED(PCSCLITE_HP_DROPDIR, "$usbdropdir", [directory containing USB drivers])  AC_DEFINE_UNQUOTED(PCSCLITE_HP_DROPDIR, "$usbdropdir", [directory containing USB drivers])
185    if test "${usbdropdir}" = "" ; then
186  dnl --enable-debugcritical          AC_MSG_ERROR([use --enable-usbdropdir=DIR])
 AC_ARG_ENABLE(debugcritical,  
         AC_HELP_STRING([--enable-debugcritical],[print critical debug  
         messages (default yes)]), [ debugcritical="${enableval}" ],  
         [ debugcritical=yes ])  
 dnl yes by default  
 if test "${debugcritical}" != yes  
 then  
         AC_MSG_RESULT([critical debug messages : no])  
 else  
         AC_MSG_RESULT([critical debug messages : yes])  
         AC_DEFINE_UNQUOTED(DEBUG_LEVEL_CRITICAL, 1, [print critical debug messages])  
187  fi  fi
188    
189  dnl --enable-debuginfo  # --enable-ccidtwindir=DIR
190  AC_ARG_ENABLE(debuginfo,  AC_ARG_ENABLE(ccidtwindir,
191          AC_HELP_STRING([--enable-debuginfo],[print info debug messages          AC_HELP_STRING([--enable-ccidtwindir=DIR],[directory to install the
192          (default yes)]),          serial Twin driver (default to pcscd config or $(prefix)/pcsc/drivers/serial)]),
193          [ debuginfo="${enableval}" ], [ debuginfo=yes ])          [ccidtwindir="${enableval}"], [ccidtwindir=false])
194  dnl yes by default  if test "${ccidtwindir}" = false ; then
195  if test "${debuginfo}" != yes          ccidtwindir=`pkg-config libpcsclite --variable=usbdropdir`/serial
196  then  fi
197          AC_MSG_RESULT([info debug messages     : no])  AC_MSG_RESULT([serial twin install dir : $ccidtwindir])
198  else  
199          AC_MSG_RESULT([info debug messages     : yes])  # --enable-pcsclite
200          AC_DEFINE_UNQUOTED(DEBUG_LEVEL_INFO, 1, [print info debug messages])  AC_ARG_ENABLE(pcsclite,
201  fi          AC_HELP_STRING([--enable-pcsclite],[compile for pcsc-lite (default=yes)]),
202            [ pcsclite=no ], [ pcsclite=yes ] )
203    
204  dnl --enable-debugperiodic  if test "${pcsclite}" = no ; then
205  AC_ARG_ENABLE(debugperiodic,          AM_CONDITIONAL(WITHOUT_PCSC, true)
206          AC_HELP_STRING([--enable-debugperiodic],[print periodic debug          AM_CONDITIONAL(NEED_PARSER, true)
         messages (default no)]),  
         [ debugperiodic="${enableval}" ], [ debugperiodic=no ])  
 dnl no by default  
 if test "${debugperiodic}" != no  
 then  
         AC_MSG_RESULT([periodic debug messages : yes])  
         AC_DEFINE_UNQUOTED(DEBUG_LEVEL_PERIODIC, 1, [print periodic debug messages])  
207  else  else
208          AC_MSG_RESULT([periodic debug messages : no])          # check that pcsc-lite is installed
209  fi          OLD_LIBS="$LIBS"
210            LIBS="$LIBS $PCSC_LIBS"
211            AC_CHECK_LIB(pcsclite, SCardEstablishContext, [],
212                    [AC_MSG_ERROR([SCardEstablishContext() not found, install pcsc-lite 1.2.9-beta9 or later, or use PCSC_LIBS=... ./configure])])
213            LIBS="$OLD_LIBS"
214    
215  dnl --enable-debugcomm          AM_CONDITIONAL(WITHOUT_PCSC, false)
216  AC_ARG_ENABLE(debugcomm,          AM_CONDITIONAL(NEED_PARSER, false)
         AC_HELP_STRING([--enable-debugcomm],[print comm debug messages  
         (default no)]),  
         [ debugcomm="${enableval}" ], [ debugcomm=no ])  
 dnl no by default  
 if test "${debugcomm}" != no  
 then  
         AC_MSG_RESULT([comm debug messages     : yes])  
         AC_DEFINE_UNQUOTED(DEBUG_LEVEL_COMM, 1, [print comm debug messages])  
 else  
         AC_MSG_RESULT([comm debug messages     : no])  
217  fi  fi
218    AC_MSG_RESULT([compiled for pcsc-lite  : $pcsclite])
219    
220  dnl Setup dist stuff  
221    # Setup dist stuff
222  AC_SUBST(ac_aux_dir)  AC_SUBST(ac_aux_dir)
223  AC_SUBST(bundle)  AC_SUBST(bundle)
224  AC_SUBST(usbdropdir)  AC_SUBST(usbdropdir)
225    AC_SUBST(ccidtwindir)
226    
227    # Write Makefiles.
228    AC_CONFIG_FILES(Makefile
229            aclocal/Makefile
230            src/Makefile
231            readers/Makefile
232            examples/Makefile)
233    
 dnl Write Makefiles.  
 AC_CONFIG_FILES(Makefile src/Makefile readers/Makefile)  
234  AC_OUTPUT  AC_OUTPUT
235    

Legend:
Removed from v.460  
changed lines
  Added in v.1846

  ViewVC Help
Powered by ViewVC 1.1.5