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

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

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

revision 448 by rousseau, Tue Sep 16 16:51:02 2003 UTC revision 1251 by rousseau, Wed Sep 29 07:04:55 2004 UTC
# Line 6  dnl $Id$ Line 6  dnl $Id$
6  dnl Require autoconf 2.52  dnl 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.2)
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
# Line 17  AC_PREFIX_DEFAULT(/usr/local) Line 17  AC_PREFIX_DEFAULT(/usr/local)
17  dnl Automake boilerplate.  dnl Automake boilerplate.
18  AC_CANONICAL_HOST  AC_CANONICAL_HOST
19    
   
20  dnl 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    
# Line 31  AC_PROG_INSTALL Line 30  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])
34    
35  AC_CHECK_FUNCS(strerror)  dnl pcsc-lite install .pc files in /usr/local/lib/pkgconfig by default
36  AC_CHECK_FUNCS(strncpy)  PKG_CONFIG_PATH="/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH"
37    export PKG_CONFIG_PATH
38  AC_CHECK_HEADERS(errno.h)  if test "$PKGCONFIG" = "yes"; then
39            if ! `PKG_CONFIG_PATH=/usr/local/lib/pkgconfig pkg-config --print-errors --atleast-version=1.2.9-beta5 libpcsclite`
40            then
41                    AC_MSG_ERROR([install pcsc-lite 1.2.9-beta5 or later])
42            fi
43    fi
44    
45  dnl Add libtool support.  dnl Add libtool support.
46  AM_PROG_LIBTOOL  AM_PROG_LIBTOOL
# Line 45  AC_SUBST(LIBTOOL_DEPS) Line 50  AC_SUBST(LIBTOOL_DEPS)
50    
51  dnl Checks for header files.  dnl Checks for header files.
52  AC_HEADER_STDC  AC_HEADER_STDC
53  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,,
54            [AC_MSG_WARN([some header files not found])])
55    
56    OLD_CFLAGS="$CFLAGS"
57    CFLAGS=`pkg-config libpcsclite --cflags`
58    CFLAGS="$OLD_CFLAGS $CFLAGS"
59    AC_CHECK_HEADER(ifdhandler.h,,
60            [AC_MSG_ERROR([ifdhandler.h not found, install pcsc-lite 1.2.9-beta5 or later])],
61            [ #include <pcsclite.h> ])
62    CFLAGS="$OLD_CFLAGS"
63    
64  dnl Checks for typedefs, structures, and compiler characteristics.  dnl Checks for typedefs, structures, and compiler characteristics.
65  AC_C_CONST  AC_C_CONST
# Line 79  case "$host" in Line 93  case "$host" in
93          AM_CONDITIONAL(NEED_PARSER, false)          AM_CONDITIONAL(NEED_PARSER, false)
94  esac  esac
95    
96  CFLAGS="$CFLAGS -Wall -fno-common"  CFLAGS="$CFLAGS -Wall"
97    
98  dnl --enable-libusb=PATH  dnl --enable-libusb=PATH
99  AC_ARG_ENABLE(libusb, [  --enable-libusb=PATH    libusb path (default /usr)],  AC_ARG_ENABLE(libusb,
100            AC_HELP_STRING([--enable-libusb=PATH],[libusb path (default /usr)]),
101          [          [
102                  case ${enableval} in                  case ${enableval} in
103                          "" | "yes" | "YES")                          "" | "yes" | "YES")
# Line 99  AC_ARG_ENABLE(libusb, [  --enable-libusb Line 114  AC_ARG_ENABLE(libusb, [  --enable-libusb
114  )  )
115    
116  dnl check if libusb is available  dnl check if libusb is available
117  AC_SUBST(LIBUSB)  if test "${use_libusb}" != false ; then
118  AC_CHECK_HEADERS(usb.h, [],          AC_SUBST(LIBUSB)
119          [ AC_MSG_ERROR([usb.h not found, use --enable-libusb=PATH]) ])          AC_CHECK_HEADERS(usb.h, [],
120                    [ AC_MSG_ERROR([usb.h not found, use --enable-libusb=PATH]) ])
121  ac_save_LIBS="$LIBS"  
122  LIBS="$LIBS $COREFOUNDATION $IOKIT"          ac_save_LIBS="$LIBS"
123  AC_CHECK_LIB(usb, usb_init, [LIBUSB="$LIBUSB -lusb"],          LIBS="$LIBS $COREFOUNDATION $IOKIT"
124          [ AC_MSG_ERROR([libusb not found]) ])          AC_CHECK_LIB(usb, usb_init, [LIBUSB="$LIBUSB -lusb"],
125  LIBS="$ac_save_LIBS"                  [ AC_MSG_ERROR([libusb not found]) ])
126            LIBS="$ac_save_LIBS"
127    
128            ac_save_LIBS="$LIBS"
129            LIBS="$LIBS $COREFOUNDATION $IOKIT"
130            AC_CHECK_LIB(usb, usb_get_string_simple, [LIBUSB="$LIBUSB -lusb"],
131                    [ AC_MSG_ERROR([your libusb is too old. install version 0.1.7 or above]) ])
132            LIBS="$ac_save_LIBS"
133    fi
134    
135  dnl check shat to use for dlopen  dnl check shat to use for dlopen
136  AC_SUBST(LIBDL)  AC_SUBST(LIBDL)
137  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)
138    
139    dnl --enable-multi-thread
140    AC_ARG_ENABLE(multi-thread,
141            AC_HELP_STRING([--enable-multi-thread],[enable multi threading
142            (default=yes)]),
143            [ multithread="${enableval}" ], [ multithread=yes ] )
144    
145    if test "${multithread}" != no ; then
146            ACX_PTHREAD(
147                    [ AC_DEFINE(HAVE_PTHREAD, 1,
148                            [Define if you have POSIX threads libraries and header files.])
149                    ], [ AC_MSG_ERROR([POSIX thread support required]) ])
150    fi
151    AC_MSG_RESULT([multi threading         : $multithread])
152    
153  dnl --enable-bundle=NAME  dnl --enable-bundle=NAME
154  AC_ARG_ENABLE(bundle,  AC_ARG_ENABLE(bundle,
155  [  --enable-bundle=NAME    bundle directory name (default ifd-ccid.bundle)],          AC_HELP_STRING([--enable-bundle=NAME],[bundle directory name
156  [bundle="${enableval}"], [bundle=false])          (default ifd-ccid.bundle)]),
157            [bundle="${enableval}"], [bundle=false])
158  if test "${bundle}" = false ; then  if test "${bundle}" = false ; then
159          bundle="ifd-ccid.bundle"          bundle="ifd-ccid.bundle"
160  fi  fi
# Line 125  AC_DEFINE_UNQUOTED(BUNDLE, "$bundle", [b Line 163  AC_DEFINE_UNQUOTED(BUNDLE, "$bundle", [b
163    
164  dnl --enable-usbdropdir=DIR  dnl --enable-usbdropdir=DIR
165  AC_ARG_ENABLE(usbdropdir,  AC_ARG_ENABLE(usbdropdir,
166  [  --enable-usbdropdir=DIR directory containing USB drivers                                                (default /usr/local/pcsc/drivers)],          AC_HELP_STRING([--enable-usbdropdir=DIR],[directory containing USB
167  [usbdropdir="${enableval}"], [usbdropdir=false])          drivers (default to pcscd config or $(prefix)/pcsc/drivers)]),
168            [usbdropdir="${enableval}"], [usbdropdir=false])
169  if test "${usbdropdir}" = false ; then  if test "${usbdropdir}" = false ; then
170          usbdropdir="/usr/local/pcsc/drivers"          if test "$PKGCONFIG" = yes ; then
171                    usbdropdir=`pkg-config libpcsclite --variable=usbdropdir`
172            else
173                    usbdropdir=""
174            fi
175            if test -z "$usbdropdir" ; then
176                    if test "$prefix" = NONE ; then
177                            usbdropdir="$ac_default_prefix/pcsc/drivers"
178                    else
179                            usbdropdir="$prefix/pcsc/drivers"
180                    fi
181            fi
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    
186  dnl --enable-debugcritical  dnl --enable-ccidtwindir=DIR
187  AC_ARG_ENABLE(debugcritical,  AC_ARG_ENABLE(ccidtwindir,
188  [  --enable-debugcritical  print critical debug messages (default yes)],          AC_HELP_STRING([--enable-ccidtwindir=DIR],[directory to install the
189  [ debugcritical="${enableval}" ], [ debugcritical=yes ])          serial Twin driver (default to pcscd config or $(prefix)/pcsc/drivers/serial)]),
190  dnl yes by default          [ccidtwindir="${enableval}"], [ccidtwindir=false])
191  if test "${debugcritical}" != yes  if test "${ccidtwindir}" = false ; then
192  then          if test "$PKGCONFIG" = yes ; then
193          AC_MSG_RESULT([critical debug messages : no])                  ccidtwindir=`pkg-config libpcsclite --variable=usbdropdir`
194  else          else
195          AC_MSG_RESULT([critical debug messages : yes])                  AC_MSG_RESULT([You should install pkg-config to get this configured automatically from pcsc-lite installation])
196          AC_DEFINE_UNQUOTED(DEBUG_LEVEL_CRITICAL, 1, [print critical debug messages])                  ccidtwindir=""
197  fi          fi
198            if test -z "$ccidtwindir" ; then
199  dnl --enable-debuginfo                  if test "$prefix" = NONE ; then
200  AC_ARG_ENABLE(debuginfo,                          ccidtwindir="$ac_default_prefix/pcsc/drivers"
201  [  --enable-debuginfo      print info debug messages (default yes)],                  else
202  [ debuginfo="${enableval}" ], [ debuginfo=yes ])                          ccidtwindir="$prefix/pcsc/drivers"
203  dnl yes by default                  fi
204  if test "${debuginfo}" != yes          fi
205  then          ccidtwindir="$ccidtwindir/serial"
         AC_MSG_RESULT([info debug messages     : no])  
 else  
         AC_MSG_RESULT([info debug messages     : yes])  
         AC_DEFINE_UNQUOTED(DEBUG_LEVEL_INFO, 1, [print info debug messages])  
 fi  
   
 dnl --enable-debugperiodic  
 AC_ARG_ENABLE(debugperiodic,  
 [  --enable-debugperiodic  print periodic debug 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])  
 else  
         AC_MSG_RESULT([periodic debug messages : no])  
 fi  
   
 dnl --enable-debugcomm  
 AC_ARG_ENABLE(debugcomm,  
 [  --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])  
206  fi  fi
207    AC_MSG_RESULT([serial twin install dir : $ccidtwindir])
208    AC_DEFINE_UNQUOTED(PCSCLITE_HP_DROPDIR, "$ccidtwindir", [directory containing USB drivers])
209    
210    dnl --enable-pcsclite
211    AC_ARG_ENABLE(pcsclite,
212            AC_HELP_STRING([--enable-pcsclite],[compile for pcsc-lite (default=yes)]),
213            [ pcsclite=no ], [ pcsclite=yes ] )
214    
215    if test "${pcsclite}" = no ; then
216            AM_CONDITIONAL(NEED_PARSER, true)
217    fi
218    AC_MSG_RESULT([compiled for pcsc-lite  : $pcsclite])
219    
220    
221  dnl Setup dist stuff  dnl 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  dnl Write Makefiles.  dnl Write Makefiles.
228  AC_CONFIG_FILES(Makefile src/Makefile readers/Makefile)  AC_CONFIG_FILES(Makefile
229            aclocal/Makefile
230            src/Makefile
231            readers/Makefile
232            examples/Makefile)
233    
234  AC_OUTPUT  AC_OUTPUT
235    

Legend:
Removed from v.448  
changed lines
  Added in v.1251

  ViewVC Help
Powered by ViewVC 1.1.5