/[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 418 by rousseau, Wed Sep 10 09:45:58 2003 UTC revision 1555 by rousseau, Wed Jun 15 12:46:05 2005 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.0)  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
# 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 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)  dnl check pcsc-lite version
35  AC_CHECK_FUNCS(strncpy)  PKG_CHECK_MODULES(PCSC, libpcsclite >= 1.2.9-beta8, [],
36            [ if test -f /usr/local/lib/pkgconfig/libpcsclite.pc ; then
37  AC_CHECK_HEADERS(errno.h)                  AC_MSG_ERROR([use PKG_CONFIG_PATH=/usr/local/lib/pkgconfig ./configure])
38              else
39                    AC_MSG_WARN([install pcsc-lite 1.2.9-beta8 or later])
40              fi
41            ])
42    
43    OLD_CFLAGS="$CFLAGS"
44    CFLAGS="$CFLAGS $PCSC_CFLAGS"
45    AC_CHECK_HEADER(ifdhandler.h,,
46            [AC_MSG_ERROR([ifdhandler.h not found, install pcsc-lite 1.2.9-beta8 or later, or use CFLAGS=... ./configure])],
47            [ #include <ifdhandler.h> ])
48    CFLAGS="$OLD_CFLAGS"
49    
50  dnl Add libtool support.  dnl Add libtool support.
51  AM_PROG_LIBTOOL  AM_PROG_LIBTOOL
# Line 45  AC_SUBST(LIBTOOL_DEPS) Line 55  AC_SUBST(LIBTOOL_DEPS)
55    
56  dnl Checks for header files.  dnl Checks for header files.
57  AC_HEADER_STDC  AC_HEADER_STDC
58  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,,
59            [AC_MSG_WARN([some header files not found])])
60    
61  dnl Checks for typedefs, structures, and compiler characteristics.  dnl Checks for typedefs, structures, and compiler characteristics.
62  AC_C_CONST  AC_C_CONST
# Line 79  case "$host" in Line 90  case "$host" in
90          AM_CONDITIONAL(NEED_PARSER, false)          AM_CONDITIONAL(NEED_PARSER, false)
91  esac  esac
92    
93  CFLAGS="$CFLAGS -Wall -fno-common"  CFLAGS="$CFLAGS -Wall"
94    
95    dnl --enable-libusb=PATH
96    AC_ARG_ENABLE(libusb,
97            AC_HELP_STRING([--enable-libusb=PATH],[libusb path (default /usr)]),
98            [
99                    case ${enableval} in
100                            "" | "yes" | "YES")
101                                    ;;
102                            "no" | "NO")
103                                    use_libusb=false
104                                    ;;
105                            *)
106                                    CPPFLAGS="$CPPFLAGS -I${enableval}/include"
107                                    LDFLAGS="$LDFLAGS -L${enableval}/lib"
108                                    ;;
109                    esac
110            ]
111    )
112    
113  dnl check if libusb is available  dnl check if libusb is available
114  AC_SUBST(LIBUSB)  if test "${use_libusb}" != false ; then
115  AC_CHECK_HEADERS(usb.h)          AC_SUBST(LIBUSB)
116  ac_save_LIBS="$LIBS"          AC_CHECK_HEADERS(usb.h, [],
117  LIBS="$LIBS $COREFOUNDATION $IOKIT"                  [ AC_MSG_ERROR([usb.h not found, use --enable-libusb=PATH]) ])
118  AC_CHECK_LIB(usb, usb_init, [LIBUSB="$LIBUSB -lusb"],  
119  [ AC_MSG_ERROR([libusb not found]) ])          ac_save_LIBS="$LIBS"
120  LIBS="$ac_save_LIBS"          LIBS="$LIBS $COREFOUNDATION $IOKIT"
121            AC_CHECK_LIB(usb, usb_init, [LIBUSB="$LIBUSB -lusb"],
122                    [ AC_MSG_ERROR([libusb not found]) ])
123            LIBS="$ac_save_LIBS"
124    
125            ac_save_LIBS="$LIBS"
126            LIBS="$LIBS $COREFOUNDATION $IOKIT"
127            AC_CHECK_LIB(usb, usb_get_string_simple, [LIBUSB="$LIBUSB -lusb"],
128                    [ AC_MSG_ERROR([your libusb is too old. install version 0.1.7 or above]) ])
129            LIBS="$ac_save_LIBS"
130    fi
131    
132  dnl check shat to use for dlopen  dnl check what to use for dlopen
133  AC_SUBST(LIBDL)  AC_SUBST(LIBDL)
134  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)
135    
136    dnl --enable-multi-thread
137    AC_ARG_ENABLE(multi-thread,
138            AC_HELP_STRING([--enable-multi-thread],[enable multi threading
139            (default=yes)]),
140            [ multithread="${enableval}" ], [ multithread=yes ] )
141    
142    if test "${multithread}" != no ; then
143            ACX_PTHREAD(
144                    [ AC_DEFINE(HAVE_PTHREAD, 1,
145                            [Define if you have POSIX threads libraries and header files.])
146                    ], [ AC_MSG_ERROR([POSIX thread support required]) ])
147    fi
148    AC_MSG_RESULT([multi threading         : $multithread])
149    
150  dnl --enable-bundle=NAME  dnl --enable-bundle=NAME
151  AC_ARG_ENABLE(bundle,  AC_ARG_ENABLE(bundle,
152  [  --enable-bundle=NAME    bundle directory name (default ifd-ccid.bundle)],          AC_HELP_STRING([--enable-bundle=NAME],[bundle directory name
153  [bundle="${enableval}"], [bundle=false])          (default ifd-ccid.bundle)]),
154            [bundle="${enableval}"], [bundle=false])
155  if test "${bundle}" = false ; then  if test "${bundle}" = false ; then
156          bundle="ifd-ccid.bundle"          bundle="ifd-ccid.bundle"
157  fi  fi
# Line 106  AC_DEFINE_UNQUOTED(BUNDLE, "$bundle", [b Line 160  AC_DEFINE_UNQUOTED(BUNDLE, "$bundle", [b
160    
161  dnl --enable-usbdropdir=DIR  dnl --enable-usbdropdir=DIR
162  AC_ARG_ENABLE(usbdropdir,  AC_ARG_ENABLE(usbdropdir,
163  [  --enable-usbdropdir=DIR directory containing USB drivers                                                (default /usr/local/pcsc/drivers)],          AC_HELP_STRING([--enable-usbdropdir=DIR],[directory containing USB
164  [usbdropdir="${enableval}"], [usbdropdir=false])          drivers (default to pcscd config or $(prefix)/pcsc/drivers)]),
165            [usbdropdir="${enableval}"], [usbdropdir=false])
166  if test "${usbdropdir}" = false ; then  if test "${usbdropdir}" = false ; then
167          usbdropdir="/usr/local/pcsc/drivers"          usbdropdir=`pkg-config libpcsclite --variable=usbdropdir`
168  fi  fi
169  AC_MSG_RESULT([USB drop directory      : $usbdropdir])  AC_MSG_RESULT([USB drop directory      : $usbdropdir])
170  AC_DEFINE_UNQUOTED(PCSCLITE_HP_DROPDIR, "$usbdropdir", [directory containing USB drivers])  AC_DEFINE_UNQUOTED(PCSCLITE_HP_DROPDIR, "$usbdropdir", [directory containing USB drivers])
171    if test "${usbdropdir}" = "" ; then
172  dnl --enable-debugcritical          AC_MSG_ERROR([use --enable-usbdropdir=DIR])
 AC_ARG_ENABLE(debugcritical,  
 [  --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])  
173  fi  fi
174    
175  dnl --enable-debuginfo  dnl --enable-ccidtwindir=DIR
176  AC_ARG_ENABLE(debuginfo,  AC_ARG_ENABLE(ccidtwindir,
177  [  --enable-debuginfo      print info debug messages (default yes)],          AC_HELP_STRING([--enable-ccidtwindir=DIR],[directory to install the
178  [ debuginfo="${enableval}" ], [ debuginfo=yes ])          serial Twin driver (default to pcscd config or $(prefix)/pcsc/drivers/serial)]),
179  dnl yes by default          [ccidtwindir="${enableval}"], [ccidtwindir=false])
180  if test "${debuginfo}" != yes  if test "${ccidtwindir}" = false ; then
181  then          ccidtwindir=`pkg-config libpcsclite --variable=usbdropdir`/serial
182          AC_MSG_RESULT([info debug messages     : no])  fi
183  else  AC_MSG_RESULT([serial twin install dir : $ccidtwindir])
184          AC_MSG_RESULT([info debug messages     : yes])  AC_DEFINE_UNQUOTED(PCSCLITE_HP_DROPDIR, "$ccidtwindir", [directory containing USB drivers])
185          AC_DEFINE_UNQUOTED(DEBUG_LEVEL_INFO, 1, [print info debug messages])  
186  fi  dnl --enable-pcsclite
187    AC_ARG_ENABLE(pcsclite,
188            AC_HELP_STRING([--enable-pcsclite],[compile for pcsc-lite (default=yes)]),
189            [ pcsclite=no ], [ pcsclite=yes ] )
190    
191  dnl --enable-debugperiodic  if test "${pcsclite}" = no ; then
192  AC_ARG_ENABLE(debugperiodic,          AM_CONDITIONAL(WITHOUT_PCSC, true)
193  [  --enable-debugperiodic  print periodic debug messages (default no)],          AM_CONDITIONAL(NEED_PARSER, true)
 [ 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])  
194  else  else
195          AC_MSG_RESULT([periodic debug messages : no])          dnl check that pcsc-lite is installed
196  fi          OLD_LDLIBS="$LDLIBS"
197            OLD_LIBS="$LIBS"
198            LDLIBS="$LDLIBS $PCSC_LIBS"
199            AC_CHECK_LIB(pcsclite, SCardEstablishContext, [],
200                    [AC_MSG_ERROR([SCardEstablishContext() not found, install pcsc-lite 1.2.9-beta8 or later, or use LDLIBS=... ./configure])])
201            LDLIBS="$OLD_LDLIBS"
202            LIBS="$OLD_LIBS"
203    
204  dnl --enable-debugcomm          AM_CONDITIONAL(WITHOUT_PCSC, false)
 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])  
205  fi  fi
206    AC_MSG_RESULT([compiled for pcsc-lite  : $pcsclite])
207    
208    
209  dnl Setup dist stuff  dnl Setup dist stuff
210  AC_SUBST(ac_aux_dir)  AC_SUBST(ac_aux_dir)
211  AC_SUBST(bundle)  AC_SUBST(bundle)
212  AC_SUBST(usbdropdir)  AC_SUBST(usbdropdir)
213    AC_SUBST(ccidtwindir)
214    
215  dnl Write Makefiles.  dnl Write Makefiles.
216  AC_CONFIG_FILES(Makefile src/Makefile readers/Makefile)  AC_CONFIG_FILES(Makefile
217            aclocal/Makefile
218            src/Makefile
219            readers/Makefile
220            examples/Makefile)
221    
222  AC_OUTPUT  AC_OUTPUT
223    

Legend:
Removed from v.418  
changed lines
  Added in v.1555

  ViewVC Help
Powered by ViewVC 1.1.5