/[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 1405 by rousseau, Thu Mar 17 10:13:02 2005 UTC revision 1737 by rousseau, Thu Nov 24 13:50:24 2005 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.9.3)  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  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
# Line 31  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  dnl check pcsc-lite version  # check pcsc-lite version
35  PKG_CHECK_MODULES(PCSC, libpcsclite >= 1.2.9-beta5, [],  PKG_CHECK_MODULES(PCSC, libpcsclite >= 1.2.9-beta8, [],
36          [ if test -f /usr/local/lib/pkgconfig/libpcsclite.pc ; then          [ if test -f /usr/local/lib/pkgconfig/libpcsclite.pc ; then
37                  AC_MSG_ERROR([use PKG_CONFIG_PATH=/usr/local/lib/pkgconfig ./configure])                  AC_MSG_ERROR([use PKG_CONFIG_PATH=/usr/local/lib/pkgconfig ./configure])
38            else            else
39                  AC_MSG_WARN([install pcsc-lite 1.2.9-beta5 or later])                  AC_MSG_WARN([install pcsc-lite 1.2.9-beta8 or later])
40            fi            fi
41          ])          ])
42    
43  OLD_CFLAGS="$CFLAGS"  OLD_CFLAGS="$CFLAGS"
44  CFLAGS="$CFLAGS $PCSC_CFLAGS"  CFLAGS="$CFLAGS $PCSC_CFLAGS"
45  AC_CHECK_HEADER(ifdhandler.h,,  AC_CHECK_HEADER(ifdhandler.h,,
46          [AC_MSG_ERROR([ifdhandler.h not found, install pcsc-lite 1.2.9-beta5 or later, or use CFLAGS=... ./configure])],          [AC_MSG_ERROR([ifdhandler.h not found, install pcsc-lite 1.2.9-beta8 or later, or use CFLAGS=... ./configure])],
47          [ #include <ifdhandler.h> ])          [ #include <ifdhandler.h> ])
48    AC_CHECK_HEADER(reader.h,,
49            [AC_MSG_ERROR([reader.h not found, install pcsc-lite 1.2.9-beta8 or later, or use CFLAGS=... ./configure])],
50            [ #include <reader.h> ])
51  CFLAGS="$OLD_CFLAGS"  CFLAGS="$OLD_CFLAGS"
52    
53  dnl Add libtool support.  # Add libtool support.
54  AM_PROG_LIBTOOL  AM_PROG_LIBTOOL
55    
56  dnl Automatically update the libtool script if it becomes out-of-date.  # Automatically update the libtool script if it becomes out-of-date.
57  AC_SUBST(LIBTOOL_DEPS)  AC_SUBST(LIBTOOL_DEPS)
58    
59  dnl Checks for header files.  # Checks for header files.
60  AC_HEADER_STDC  AC_HEADER_STDC
61  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,,
62          [AC_MSG_WARN([some header files not found])])          [AC_MSG_WARN([some header files not found])])
63    
64  dnl Checks for typedefs, structures, and compiler characteristics.  # Checks for typedefs, structures, and compiler characteristics.
65  AC_C_CONST  AC_C_CONST
66  AC_TYPE_SIZE_T  AC_TYPE_SIZE_T
67  AC_HEADER_TIME  AC_HEADER_TIME
68    
69  dnl Checks for library functions.  # Checks for library functions.
70  AC_CHECK_FUNCS(select strerror strncpy memcpy)  AC_CHECK_FUNCS(select strerror strncpy memcpy)
71    
72  dnl Select OS specific versions of source files.  # Select OS specific versions of source files.
73  AC_SUBST(BUNDLE_HOST)  AC_SUBST(BUNDLE_HOST)
74  AC_SUBST(DYN_LIB_EXT)  AC_SUBST(DYN_LIB_EXT)
75  case "$host" in  case "$host" in
76  *-*-darwin*)  *-*-darwin*)
77          BUNDLE_HOST="MacOS"          BUNDLE_HOST="MacOS"
78          DYN_LIB_EXT="dylib"          DYN_LIB_EXT="dylib"
         AM_CONDITIONAL(NEED_PARSER, true)  
79    
80          AC_SUBST(COREFOUNDATION)          AC_SUBST(COREFOUNDATION)
81          COREFOUNDATION="-Wl,-framework,CoreFoundation"          COREFOUNDATION="-Wl,-framework,CoreFoundation"
# Line 87  case "$host" in Line 89  case "$host" in
89  *)  *)
90          BUNDLE_HOST="Linux"          BUNDLE_HOST="Linux"
91          DYN_LIB_EXT="so"          DYN_LIB_EXT="so"
         AM_CONDITIONAL(NEED_PARSER, false)  
92  esac  esac
93    
94  CFLAGS="$CFLAGS -Wall"  CFLAGS="$CFLAGS -Wall"
95    
96  dnl --enable-libusb=PATH  # --enable-libusb=PATH
97    LIBUSB_CFLAGS=`libusb-config --cflags`
98    LIBUSB_LIBS=`libusb-config --libs`
99  AC_ARG_ENABLE(libusb,  AC_ARG_ENABLE(libusb,
100          AC_HELP_STRING([--enable-libusb=PATH],[libusb path (default /usr)]),          AC_HELP_STRING([--enable-libusb=PATH],[libusb path (default /usr)]),
101          [          [
# Line 103  AC_ARG_ENABLE(libusb, Line 106  AC_ARG_ENABLE(libusb,
106                                  use_libusb=false                                  use_libusb=false
107                                  ;;                                  ;;
108                          *)                          *)
109                                  CPPFLAGS="$CPPFLAGS -I${enableval}/include"                                  LIBUSB_CFLAGS="-I${enableval}/include"
110                                  LDFLAGS="$LDFLAGS -L${enableval}/lib"                                  LIBUSB_LIBS="-L${enableval}/lib -lusb"
111                                  ;;                                  ;;
112                  esac                  esac
113          ]          ]
114  )  )
115    
116  dnl check if libusb is available  # check if libusb is available
117  if test "${use_libusb}" != false ; then  if test "x$use_libusb" != xfalse ; then
118          AC_SUBST(LIBUSB)          saved_CPPFLAGS="$CPPFLAGS"
119            saved_LIBS="$LIBS"
120    
121            CPPFLAGS="$CPPFLAGS $LIBUSB_CFLAGS"
122            LIBS="$LDFLAGS $LIBUSB_LIBS"
123    
124          AC_CHECK_HEADERS(usb.h, [],          AC_CHECK_HEADERS(usb.h, [],
125                  [ AC_MSG_ERROR([usb.h not found, use --enable-libusb=PATH]) ])                  [ AC_MSG_ERROR([usb.h not found, use --enable-libusb=PATH]) ])
126    
         ac_save_LIBS="$LIBS"  
127          LIBS="$LIBS $COREFOUNDATION $IOKIT"          LIBS="$LIBS $COREFOUNDATION $IOKIT"
128          AC_CHECK_LIB(usb, usb_init, [LIBUSB="$LIBUSB -lusb"],          AC_CHECK_LIB(usb, usb_init, [LIBUSB="$LIBUSB -lusb"],
129                  [ AC_MSG_ERROR([libusb not found]) ])                  [ AC_MSG_ERROR([libusb not found]) ])
         LIBS="$ac_save_LIBS"  
130    
         ac_save_LIBS="$LIBS"  
131          LIBS="$LIBS $COREFOUNDATION $IOKIT"          LIBS="$LIBS $COREFOUNDATION $IOKIT"
132          AC_CHECK_LIB(usb, usb_get_string_simple, [LIBUSB="$LIBUSB -lusb"],          AC_CHECK_LIB(usb, usb_get_string_simple, [LIBUSB="$LIBUSB -lusb"],
133                  [ 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]) ])
134          LIBS="$ac_save_LIBS"  
135            CPPFLAGS="$saved_LIBS"
136            LIBS="$saved_LIBS"
137  fi  fi
138    AC_SUBST(LIBUSB_CFLAGS)
139    AC_SUBST(LIBUSB_LIBS)
140    
141  dnl check what to use for dlopen  # check what to use for dlopen
142  AC_SUBST(LIBDL)  AC_SUBST(LIBDL)
143  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)
144    
145  dnl --enable-multi-thread  # --enable-multi-thread
146  AC_ARG_ENABLE(multi-thread,  AC_ARG_ENABLE(multi-thread,
147          AC_HELP_STRING([--enable-multi-thread],[enable multi threading          AC_HELP_STRING([--enable-multi-thread],[enable multi threading
148          (default=yes)]),          (default=yes)]),
# Line 147  if test "${multithread}" != no ; then Line 156  if test "${multithread}" != no ; then
156  fi  fi
157  AC_MSG_RESULT([multi threading         : $multithread])  AC_MSG_RESULT([multi threading         : $multithread])
158    
159  dnl --enable-bundle=NAME  # --enable-bundle=NAME
160  AC_ARG_ENABLE(bundle,  AC_ARG_ENABLE(bundle,
161          AC_HELP_STRING([--enable-bundle=NAME],[bundle directory name          AC_HELP_STRING([--enable-bundle=NAME],[bundle directory name
162          (default ifd-ccid.bundle)]),          (default ifd-ccid.bundle)]),
# Line 158  fi Line 167  fi
167  AC_MSG_RESULT([bundle directory name   : $bundle])  AC_MSG_RESULT([bundle directory name   : $bundle])
168  AC_DEFINE_UNQUOTED(BUNDLE, "$bundle", [bundle directory name])  AC_DEFINE_UNQUOTED(BUNDLE, "$bundle", [bundle directory name])
169    
170  dnl --enable-usbdropdir=DIR  # --enable-usbdropdir=DIR
171  AC_ARG_ENABLE(usbdropdir,  AC_ARG_ENABLE(usbdropdir,
172          AC_HELP_STRING([--enable-usbdropdir=DIR],[directory containing USB          AC_HELP_STRING([--enable-usbdropdir=DIR],[directory containing USB
173          drivers (default to pcscd config or $(prefix)/pcsc/drivers)]),          drivers (default to pcscd config or $(prefix)/pcsc/drivers)]),
# Line 172  if test "${usbdropdir}" = "" ; then Line 181  if test "${usbdropdir}" = "" ; then
181          AC_MSG_ERROR([use --enable-usbdropdir=DIR])          AC_MSG_ERROR([use --enable-usbdropdir=DIR])
182  fi  fi
183    
184  dnl --enable-ccidtwindir=DIR  # --enable-ccidtwindir=DIR
185  AC_ARG_ENABLE(ccidtwindir,  AC_ARG_ENABLE(ccidtwindir,
186          AC_HELP_STRING([--enable-ccidtwindir=DIR],[directory to install the          AC_HELP_STRING([--enable-ccidtwindir=DIR],[directory to install the
187          serial Twin driver (default to pcscd config or $(prefix)/pcsc/drivers/serial)]),          serial Twin driver (default to pcscd config or $(prefix)/pcsc/drivers/serial)]),
# Line 183  fi Line 192  fi
192  AC_MSG_RESULT([serial twin install dir : $ccidtwindir])  AC_MSG_RESULT([serial twin install dir : $ccidtwindir])
193  AC_DEFINE_UNQUOTED(PCSCLITE_HP_DROPDIR, "$ccidtwindir", [directory containing USB drivers])  AC_DEFINE_UNQUOTED(PCSCLITE_HP_DROPDIR, "$ccidtwindir", [directory containing USB drivers])
194    
195  dnl --enable-pcsclite  # --enable-pcsclite
196  AC_ARG_ENABLE(pcsclite,  AC_ARG_ENABLE(pcsclite,
197          AC_HELP_STRING([--enable-pcsclite],[compile for pcsc-lite (default=yes)]),          AC_HELP_STRING([--enable-pcsclite],[compile for pcsc-lite (default=yes)]),
198          [ pcsclite=no ], [ pcsclite=yes ] )          [ pcsclite=no ], [ pcsclite=yes ] )
# Line 192  if test "${pcsclite}" = no ; then Line 201  if test "${pcsclite}" = no ; then
201          AM_CONDITIONAL(WITHOUT_PCSC, true)          AM_CONDITIONAL(WITHOUT_PCSC, true)
202          AM_CONDITIONAL(NEED_PARSER, true)          AM_CONDITIONAL(NEED_PARSER, true)
203  else  else
204          dnl check that pcsc-lite is installed          # check that pcsc-lite is installed
205          OLD_LDLIBS="$LDLIBS"          OLD_LDLIBS="$LDLIBS"
206          OLD_LIBS="$LIBS"          OLD_LIBS="$LIBS"
207          LDLIBS="$LDLIBS $PCSC_LIBS"          LDLIBS="$LDLIBS $PCSC_LIBS"
208          AC_CHECK_LIB(pcsclite, SCardEstablishContext, [],          AC_CHECK_LIB(pcsclite, SCardEstablishContext, [],
209                  [AC_MSG_ERROR([SCardEstablishContext() not found, install pcsc-lite 1.2.9-beta5 or later,or use LDLIBS=... ./configure])])                  [AC_MSG_ERROR([SCardEstablishContext() not found, install pcsc-lite 1.2.9-beta8 or later, or use LDLIBS=... ./configure])])
210          LDLIBS="$OLD_LDLIBS"          LDLIBS="$OLD_LDLIBS"
211          LIBS="$OLD_LIBS"          LIBS="$OLD_LIBS"
212    
213          AM_CONDITIONAL(WITHOUT_PCSC, false)          AM_CONDITIONAL(WITHOUT_PCSC, false)
214            AM_CONDITIONAL(NEED_PARSER, false)
215  fi  fi
216  AC_MSG_RESULT([compiled for pcsc-lite  : $pcsclite])  AC_MSG_RESULT([compiled for pcsc-lite  : $pcsclite])
217    
218    
219  dnl Setup dist stuff  # Setup dist stuff
220  AC_SUBST(ac_aux_dir)  AC_SUBST(ac_aux_dir)
221  AC_SUBST(bundle)  AC_SUBST(bundle)
222  AC_SUBST(usbdropdir)  AC_SUBST(usbdropdir)
223  AC_SUBST(ccidtwindir)  AC_SUBST(ccidtwindir)
224    
225  dnl Write Makefiles.  # Write Makefiles.
226  AC_CONFIG_FILES(Makefile  AC_CONFIG_FILES(Makefile
227          aclocal/Makefile          aclocal/Makefile
228          src/Makefile          src/Makefile

Legend:
Removed from v.1405  
changed lines
  Added in v.1737

  ViewVC Help
Powered by ViewVC 1.1.5