/[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 887 by rousseau, Mon May 24 09:53:36 2004 UTC revision 1769 by rousseau, Tue Nov 29 09:19:22 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.4.2)  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
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
 AC_CHECK_PROG([PKGCONFIG], [pkg-config], [yes])  
33    
34  dnl Add libtool support.  # check pcsc-lite version
35    PKG_CHECK_MODULES(PCSC, libpcsclite >= 1.2.9-beta9, [],
36            [ if test -f /usr/local/lib/pkgconfig/libpcsclite.pc ; then
37                    AC_MSG_ERROR([use PKG_CONFIG_PATH=/usr/local/lib/pkgconfig ./configure])
38              else
39                    AC_MSG_WARN([install pcsc-lite 1.2.9-beta9 or later])
40              fi
41            ])
42    
43    saved_CPPFLAGS="$CPPFLAGS"
44    CPPFLAGS="$CPPFLAGS $PCSC_CFLAGS"
45    AC_CHECK_HEADER(ifdhandler.h,,
46            [AC_MSG_ERROR([ifdhandler.h not found, install pcsc-lite 1.2.9-beta9 or later, or use ./configure PCSC_CFLAGS=...])],
47            [ #include <ifdhandler.h> ])
48    AC_CHECK_HEADER(reader.h,,
49            [AC_MSG_ERROR([reader.h not found, install pcsc-lite 1.2.9-beta9 or later, or use ./configure PCSC_CFLAGS=...])],
50            [ #include <reader.h> ])
51    CPPFLAGS="$saved_CPPFLAGS"
52    
53    # 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  AC_CHECK_HEADERS(pcsclite.h,,  # Checks for typedefs, structures, and compiler characteristics.
         [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> ])  
   
   
 dnl 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 80  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 96  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_CPPFLAGS"
136            LIBS="$saved_LIBS"
137  fi  fi
138    AC_SUBST(LIBUSB_CFLAGS)
139    AC_SUBST(LIBUSB_LIBS)
140    
141  dnl check shat 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 140  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 151  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)]),
174          [usbdropdir="${enableval}"], [usbdropdir=false])          [usbdropdir="${enableval}"], [usbdropdir=false])
175  if test "${usbdropdir}" = false ; then  if test "${usbdropdir}" = false ; then
176          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  
177  fi  fi
178  AC_MSG_RESULT([USB drop directory      : $usbdropdir])  AC_MSG_RESULT([USB drop directory      : $usbdropdir])
179  AC_DEFINE_UNQUOTED(PCSCLITE_HP_DROPDIR, "$usbdropdir", [directory containing USB drivers])  AC_DEFINE_UNQUOTED(PCSCLITE_HP_DROPDIR, "$usbdropdir", [directory containing USB drivers])
180    if test "${usbdropdir}" = "" ; then
181            AC_MSG_ERROR([use --enable-usbdropdir=DIR])
182    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)]),
188          [ccidtwindir="${enableval}"], [ccidtwindir=false])          [ccidtwindir="${enableval}"], [ccidtwindir=false])
189  if test "${ccidtwindir}" = false ; then  if test "${ccidtwindir}" = false ; then
190          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  
191  fi  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])  
194    # --enable-pcsclite
195    AC_ARG_ENABLE(pcsclite,
196            AC_HELP_STRING([--enable-pcsclite],[compile for pcsc-lite (default=yes)]),
197            [ pcsclite=no ], [ pcsclite=yes ] )
198    
199    if test "${pcsclite}" = no ; then
200            AM_CONDITIONAL(WITHOUT_PCSC, true)
201            AM_CONDITIONAL(NEED_PARSER, true)
202    else
203            # check that pcsc-lite is installed
204            OLD_LDLIBS="$LDLIBS"
205            OLD_LIBS="$LIBS"
206            LDLIBS="$LDLIBS $PCSC_LIBS"
207            AC_CHECK_LIB(pcsclite, SCardEstablishContext, [],
208                    [AC_MSG_ERROR([SCardEstablishContext() not found, install pcsc-lite 1.2.9-beta9 or later, or use LDLIBS=... ./configure])])
209            LDLIBS="$OLD_LDLIBS"
210            LIBS="$OLD_LIBS"
211    
212            AM_CONDITIONAL(WITHOUT_PCSC, false)
213            AM_CONDITIONAL(NEED_PARSER, false)
214    fi
215    AC_MSG_RESULT([compiled for pcsc-lite  : $pcsclite])
216    
217    
218  dnl Setup dist stuff  # Setup dist stuff
219  AC_SUBST(ac_aux_dir)  AC_SUBST(ac_aux_dir)
220  AC_SUBST(bundle)  AC_SUBST(bundle)
221  AC_SUBST(usbdropdir)  AC_SUBST(usbdropdir)
222  AC_SUBST(ccidtwindir)  AC_SUBST(ccidtwindir)
223    
224  dnl Write Makefiles.  # Write Makefiles.
225  AC_CONFIG_FILES(Makefile  AC_CONFIG_FILES(Makefile
226          aclocal/Makefile          aclocal/Makefile
227          src/Makefile          src/Makefile

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

  ViewVC Help
Powered by ViewVC 1.1.5