/[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 1556 by rousseau, Wed Jun 15 12:53:41 2005 UTC revision 1926 by rousseau, Mon Mar 6 09:12:44 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.9.4)  AC_INIT(ccid, 1.0.0)
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-beta8, [],  PKG_CHECK_MODULES(PCSC, libpcsclite >= 1.2.9-beta9, [],
36          [ if test -f /usr/local/lib/pkgconfig/libpcsclite.pc ; then          [ AC_MSG_RESULT([no])
37            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])                  AC_MSG_ERROR([use PKG_CONFIG_PATH=/usr/local/lib/pkgconfig ./configure])
39            else            else
40                  AC_MSG_WARN([install pcsc-lite 1.2.9-beta8 or later])                  AC_MSG_WARN([install pcsc-lite 1.2.9-beta9 or later])
41            fi            fi
42          ])          ])
43    
44  OLD_CFLAGS="$CFLAGS"  saved_CPPFLAGS="$CPPFLAGS"
45  CFLAGS="$CFLAGS $PCSC_CFLAGS"  CPPFLAGS="$CPPFLAGS $PCSC_CFLAGS"
46  AC_CHECK_HEADER(ifdhandler.h,,  AC_CHECK_HEADER(ifdhandler.h,,
47          [AC_MSG_ERROR([ifdhandler.h not found, install pcsc-lite 1.2.9-beta8 or later, or use CFLAGS=... ./configure])],          [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> ])          [ #include <ifdhandler.h> ])
49  AC_CHECK_HEADER(reader.h,,  AC_CHECK_HEADER(reader.h,,
50          [AC_MSG_ERROR([reader.h not found, install pcsc-lite 1.2.9-beta8 or later, or use CFLAGS=... ./configure])],          [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> ])          [ #include <reader.h> ])
52  CFLAGS="$OLD_CFLAGS"  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(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,,
63          [AC_MSG_WARN([some header files not found])])          [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 87  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    *-*-solaris*)
95            BUNDLE_HOST="Solaris"
96            DYN_LIB_EXT="so"
97            ;;
98  *)  *)
99          BUNDLE_HOST="Linux"          BUNDLE_HOST="Linux"
100          DYN_LIB_EXT="so"          DYN_LIB_EXT="so"
         AM_CONDITIONAL(NEED_PARSER, false)  
101  esac  esac
102    
103  CFLAGS="$CFLAGS -Wall"  # --enable-libusb
   
 dnl --enable-libusb=PATH  
104  AC_ARG_ENABLE(libusb,  AC_ARG_ENABLE(libusb,
105          AC_HELP_STRING([--enable-libusb=PATH],[libusb path (default /usr)]),          AC_HELP_STRING([--enable-libusb],[use libusb (default=yes)]),
106          [          [ use_libusb=no ], [ use_libusb=yes ] )
107                  case ${enableval} in  
108                          "" | "yes" | "YES")  # check if libusb is used
109                                  ;;  if test "x$use_libusb" != xno ; then
110                          "no" | "NO")          PKG_CHECK_MODULES(LIBUSB, libusb, [],
111                                  use_libusb=false                  [
112                                  ;;                          AC_MSG_RESULT([no])
113                          *)                          AC_CHECK_PROG([LIBUSBCONFIG], [libusb-config], [yes])
114                                  CPPFLAGS="$CPPFLAGS -I${enableval}/include"  
115                                  LDFLAGS="$LDFLAGS -L${enableval}/lib"                          if test "$LIBUSBCONFIG" = "yes" ; then
116                                  ;;                                  LIBUSB_CFLAGS="$LIBUSB_CFLAGS `libusb-config --cflags`"
117                  esac                                  LIBUSB_LIBS="$LIBUSB_LIBS `libusb-config --libs`"
118          ]                          else
119  )                                  AC_MSG_WARN([libusb-config not found.])
120                            fi
121  dnl check if libusb is available                  ])
122  if test "${use_libusb}" != false ; then  
123          AC_SUBST(LIBUSB)          saved_CPPFLAGS="$CPPFLAGS"
124            saved_LIBS="$LIBS"
125    
126            CPPFLAGS="$CPPFLAGS $LIBUSB_CFLAGS"
127            LIBS="$LDFLAGS $LIBUSB_LIBS"
128    
129          AC_CHECK_HEADERS(usb.h, [],          AC_CHECK_HEADERS(usb.h, [],
130                  [ AC_MSG_ERROR([usb.h not found, use --enable-libusb=PATH]) ])                  [ AC_MSG_ERROR([usb.h not found, use ./configure LIBUSB_CFLAGS=...]) ])
131    
         ac_save_LIBS="$LIBS"  
132          LIBS="$LIBS $COREFOUNDATION $IOKIT"          LIBS="$LIBS $COREFOUNDATION $IOKIT"
         AC_CHECK_LIB(usb, usb_init, [LIBUSB="$LIBUSB -lusb"],  
                 [ AC_MSG_ERROR([libusb not found]) ])  
         LIBS="$ac_save_LIBS"  
133    
134          ac_save_LIBS="$LIBS"          AC_MSG_CHECKING([for usb_init])
135          LIBS="$LIBS $COREFOUNDATION $IOKIT"          AC_TRY_LINK_FUNC(usb_init, [ AC_MSG_RESULT([yes]) ],
136          AC_CHECK_LIB(usb, usb_get_string_simple, [LIBUSB="$LIBUSB -lusb"],                  [ AC_MSG_ERROR([libusb not found, use ./configure LIBUSB_LIBS=...]) ])
137    
138            AC_MSG_CHECKING([for usb_get_string_simple])
139            AC_TRY_LINK_FUNC(usb_get_string_simple, [ AC_MSG_RESULT([yes]) ],
140                  [ 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]) ])
141          LIBS="$ac_save_LIBS"  
142            CPPFLAGS="$saved_CPPFLAGS"
143            LIBS="$saved_LIBS"
144  fi  fi
145    AC_SUBST(LIBUSB_CFLAGS)
146    AC_SUBST(LIBUSB_LIBS)
147    
148  dnl check what to use for dlopen  # check what to use for dlopen
149  AC_SUBST(LIBDL)  AC_SUBST(LIBDL)
150  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)
151    
152  dnl --enable-multi-thread  # --enable-multi-thread
153  AC_ARG_ENABLE(multi-thread,  AC_ARG_ENABLE(multi-thread,
154          AC_HELP_STRING([--enable-multi-thread],[enable multi threading          AC_HELP_STRING([--enable-multi-thread],[enable multi threading
155          (default=yes)]),          (default=yes)]),
# Line 150  if test "${multithread}" != no ; then Line 163  if test "${multithread}" != no ; then
163  fi  fi
164  AC_MSG_RESULT([multi threading         : $multithread])  AC_MSG_RESULT([multi threading         : $multithread])
165    
166  dnl --enable-bundle=NAME  # --enable-bundle=NAME
167  AC_ARG_ENABLE(bundle,  AC_ARG_ENABLE(bundle,
168          AC_HELP_STRING([--enable-bundle=NAME],[bundle directory name          AC_HELP_STRING([--enable-bundle=NAME],[bundle directory name
169          (default ifd-ccid.bundle)]),          (default ifd-ccid.bundle)]),
# Line 161  fi Line 174  fi
174  AC_MSG_RESULT([bundle directory name   : $bundle])  AC_MSG_RESULT([bundle directory name   : $bundle])
175  AC_DEFINE_UNQUOTED(BUNDLE, "$bundle", [bundle directory name])  AC_DEFINE_UNQUOTED(BUNDLE, "$bundle", [bundle directory name])
176    
177  dnl --enable-usbdropdir=DIR  # --enable-usbdropdir=DIR
178  AC_ARG_ENABLE(usbdropdir,  AC_ARG_ENABLE(usbdropdir,
179          AC_HELP_STRING([--enable-usbdropdir=DIR],[directory containing USB          AC_HELP_STRING([--enable-usbdropdir=DIR],[directory containing USB
180          drivers (default to pcscd config or $(prefix)/pcsc/drivers)]),          drivers (default to pcscd config or $(prefix)/pcsc/drivers)]),
# Line 175  if test "${usbdropdir}" = "" ; then Line 188  if test "${usbdropdir}" = "" ; then
188          AC_MSG_ERROR([use --enable-usbdropdir=DIR])          AC_MSG_ERROR([use --enable-usbdropdir=DIR])
189  fi  fi
190    
191  dnl --enable-ccidtwindir=DIR  # --enable-ccidtwindir=DIR
192  AC_ARG_ENABLE(ccidtwindir,  AC_ARG_ENABLE(ccidtwindir,
193          AC_HELP_STRING([--enable-ccidtwindir=DIR],[directory to install the          AC_HELP_STRING([--enable-ccidtwindir=DIR],[directory to install the
194          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 184  if test "${ccidtwindir}" = false ; then Line 197  if test "${ccidtwindir}" = false ; then
197          ccidtwindir=`pkg-config libpcsclite --variable=usbdropdir`/serial          ccidtwindir=`pkg-config libpcsclite --variable=usbdropdir`/serial
198  fi  fi
199  AC_MSG_RESULT([serial twin install dir : $ccidtwindir])  AC_MSG_RESULT([serial twin install dir : $ccidtwindir])
 AC_DEFINE_UNQUOTED(PCSCLITE_HP_DROPDIR, "$ccidtwindir", [directory containing USB drivers])  
200    
201  dnl --enable-pcsclite  # --enable-pcsclite
202  AC_ARG_ENABLE(pcsclite,  AC_ARG_ENABLE(pcsclite,
203          AC_HELP_STRING([--enable-pcsclite],[compile for pcsc-lite (default=yes)]),          AC_HELP_STRING([--enable-pcsclite],[compile for pcsc-lite (default=yes)]),
204          [ pcsclite=no ], [ pcsclite=yes ] )          [ pcsclite=no ], [ pcsclite=yes ] )
# Line 195  if test "${pcsclite}" = no ; then Line 207  if test "${pcsclite}" = no ; then
207          AM_CONDITIONAL(WITHOUT_PCSC, true)          AM_CONDITIONAL(WITHOUT_PCSC, true)
208          AM_CONDITIONAL(NEED_PARSER, true)          AM_CONDITIONAL(NEED_PARSER, true)
209  else  else
210          dnl check that pcsc-lite is installed          # check that pcsc-lite is installed
         OLD_LDLIBS="$LDLIBS"  
211          OLD_LIBS="$LIBS"          OLD_LIBS="$LIBS"
212          LDLIBS="$LDLIBS $PCSC_LIBS"          LIBS="$LIBS $PCSC_LIBS"
213          AC_CHECK_LIB(pcsclite, SCardEstablishContext, [],          AC_CHECK_LIB(pcsclite, SCardEstablishContext, [],
214                  [AC_MSG_ERROR([SCardEstablishContext() not found, install pcsc-lite 1.2.9-beta8 or later, or use LDLIBS=... ./configure])])                  [AC_MSG_ERROR([SCardEstablishContext() not found, install pcsc-lite 1.2.9-beta9 or later, or use PCSC_LIBS=... ./configure])])
         LDLIBS="$OLD_LDLIBS"  
215          LIBS="$OLD_LIBS"          LIBS="$OLD_LIBS"
216    
217          AM_CONDITIONAL(WITHOUT_PCSC, false)          AM_CONDITIONAL(WITHOUT_PCSC, false)
218            AM_CONDITIONAL(NEED_PARSER, false)
219  fi  fi
220  AC_MSG_RESULT([compiled for pcsc-lite  : $pcsclite])  AC_MSG_RESULT([compiled for pcsc-lite  : $pcsclite])
221    
222    
223  dnl Setup dist stuff  # Setup dist stuff
224  AC_SUBST(ac_aux_dir)  AC_SUBST(ac_aux_dir)
225  AC_SUBST(bundle)  AC_SUBST(bundle)
226  AC_SUBST(usbdropdir)  AC_SUBST(usbdropdir)
227  AC_SUBST(ccidtwindir)  AC_SUBST(ccidtwindir)
228    
229  dnl Write Makefiles.  # Write Makefiles.
230  AC_CONFIG_FILES(Makefile  AC_CONFIG_FILES(Makefile
231          aclocal/Makefile          aclocal/Makefile
232          src/Makefile          src/Makefile

Legend:
Removed from v.1556  
changed lines
  Added in v.1926

  ViewVC Help
Powered by ViewVC 1.1.5