/[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 443 by rousseau, Tue Sep 16 14:17:33 2003 UTC revision 2522 by rousseau, Thu May 10 09:16:42 2007 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.61
7  AC_PREREQ(2.52)  AC_PREREQ(2.61)
8    
9  AC_INIT(ccid, 0.3.1)  AC_INIT(ccid, 1.3.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    # 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    
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
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
33    PKG_PROG_PKG_CONFIG
34    
35  AC_CHECK_FUNCS(strerror)  # check pcsc-lite version
36  AC_CHECK_FUNCS(strncpy)  PCSC_NEEDED_VERSION="1.3.3"
37    PKG_CHECK_MODULES(PCSC, libpcsclite >= $PCSC_NEEDED_VERSION, [],
38  AC_CHECK_HEADERS(errno.h)          [ AC_MSG_RESULT([no])
39            if test -f /usr/local/lib/pkgconfig/libpcsclite.pc -a "x$PKG_CONFIG" != x ; then
40                    AC_MSG_ERROR([use PKG_CONFIG_PATH=/usr/local/lib/pkgconfig ./configure])
41              else
42                    AC_MSG_WARN([install pcsc-lite $PCSC_NEEDED_VERSION or later])
43              fi
44            ])
45    
46    saved_CPPFLAGS="$CPPFLAGS"
47    CPPFLAGS="$CPPFLAGS $PCSC_CFLAGS"
48    AC_CHECK_HEADER(ifdhandler.h,,
49            [AC_MSG_ERROR([ifdhandler.h not found, install pcsc-lite $PCSC_NEEDED_VERSION or later, or use ./configure PCSC_CFLAGS=...])])
50    AC_CHECK_DECL(IFD_NO_SUCH_DEVICE,, [AC_MSG_ERROR([install pcsc-lite $PCSC_NEEDED_VERSION or later])], [#include <ifdhandler.h>])
51    AC_CHECK_HEADER(reader.h,,
52            [AC_MSG_ERROR([reader.h not found, install pcsc-lite $PCSC_NEEDED_VERSION or later, or use ./configure PCSC_CFLAGS=...])])
53    CPPFLAGS="$saved_CPPFLAGS"
54    
55  dnl Add libtool support.  # Add libtool support.
56  AM_PROG_LIBTOOL  AM_PROG_LIBTOOL
57    
58  dnl Automatically update the libtool script if it becomes out-of-date.  # Automatically update the libtool script if it becomes out-of-date.
59  AC_SUBST(LIBTOOL_DEPS)  AC_SUBST(LIBTOOL_DEPS)
60    
61  dnl Checks for header files.  # Checks for header files.
62  AC_HEADER_STDC  AC_HEADER_STDC
63  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 arpa/inet.h,,
64            [AC_MSG_ERROR([some header files not found])])
65    
66  dnl Checks for typedefs, structures, and compiler characteristics.  # Checks for typedefs, structures, and compiler characteristics.
67  AC_C_CONST  AC_C_CONST
68  AC_TYPE_SIZE_T  AC_TYPE_SIZE_T
69  AC_HEADER_TIME  AC_HEADER_TIME
70    
71  dnl Checks for library functions.  # Checks for library functions.
72  AC_CHECK_FUNCS(select strerror strncpy memcpy)  AC_CHECK_FUNCS(select strerror strncpy memcpy strlcpy)
73    
74  dnl Select OS specific versions of source files.  # Select OS specific versions of source files.
75  AC_SUBST(BUNDLE_HOST)  AC_SUBST(BUNDLE_HOST)
76  AC_SUBST(DYN_LIB_EXT)  AC_SUBST(DYN_LIB_EXT)
77  case "$host" in  case "$host" in
78  *-*-darwin*)  *-*-darwin*)
79          BUNDLE_HOST="MacOS"          BUNDLE_HOST="MacOS"
80          DYN_LIB_EXT="dylib"          DYN_LIB_EXT="dylib"
         AM_CONDITIONAL(NEED_PARSER, true)  
81    
82          AC_SUBST(COREFOUNDATION)          AC_SUBST(COREFOUNDATION)
83          COREFOUNDATION="-Wl,-framework,CoreFoundation"          COREFOUNDATION="-Wl,-framework,CoreFoundation"
# Line 72  case "$host" in Line 88  case "$host" in
88                  CFLAGS="$CFLAGS -no-cpp-precomp"                  CFLAGS="$CFLAGS -no-cpp-precomp"
89          fi          fi
90          ;;          ;;
91    *-*-freebsd*)
92            BUNDLE_HOST="FreeBSD"
93            DYN_LIB_EXT="so"
94            ;;
95    *-*-openbsd*)
96            BUNDLE_HOST="OpenBSD"
97            DYN_LIB_EXT="so.0.0"
98            ;;
99    *-*-solaris*)
100            BUNDLE_HOST="Solaris"
101            DYN_LIB_EXT="so"
102            ;;
103  *)  *)
104          BUNDLE_HOST="Linux"          BUNDLE_HOST="Linux"
105          DYN_LIB_EXT="so"          DYN_LIB_EXT="so"
         AM_CONDITIONAL(NEED_PARSER, false)  
106  esac  esac
107    
108  CFLAGS="$CFLAGS -Wall -fno-common"  # --disable-libusb
109    AC_ARG_ENABLE(libusb,
110            AC_HELP_STRING([--disable-libusb],[do not use libusb]),
111            [ use_libusb="${enableval}" ], [ use_libusb=yes ] )
112    
113    # check if libusb is used
114    if test "x$use_libusb" != xno ; then
115            PKG_CHECK_MODULES(LIBUSB, libusb, [],
116                    [
117                            AC_MSG_RESULT([no])
118                            AC_CHECK_PROG([LIBUSBCONFIG], [libusb-config], [yes])
119    
120                            if test "$LIBUSBCONFIG" = "yes" ; then
121                                    LIBUSB_CFLAGS="$LIBUSB_CFLAGS `libusb-config --cflags`"
122                                    LIBUSB_LIBS="$LIBUSB_LIBS `libusb-config --libs`"
123                            else
124                                    AC_MSG_WARN([libusb-config not found.])
125                            fi
126                    ])
127    
128            saved_CPPFLAGS="$CPPFLAGS"
129            saved_LIBS="$LIBS"
130    
131            CPPFLAGS="$CPPFLAGS $LIBUSB_CFLAGS"
132            LIBS="$LDFLAGS $LIBUSB_LIBS"
133    
134            AC_CHECK_HEADERS(usb.h, [],
135                    [ AC_MSG_ERROR([usb.h not found, use ./configure LIBUSB_CFLAGS=...]) ])
136    
137            LIBS="$LIBS $COREFOUNDATION $IOKIT"
138    
139            AC_MSG_CHECKING([for usb_init])
140            AC_TRY_LINK_FUNC(usb_init, [ AC_MSG_RESULT([yes]) ],
141                    [ AC_MSG_ERROR([libusb not found, use ./configure LIBUSB_LIBS=...]) ])
142    
143            AC_MSG_CHECKING([for usb_get_string_simple])
144            AC_TRY_LINK_FUNC(usb_get_string_simple, [ AC_MSG_RESULT([yes]) ],
145                    [ AC_MSG_ERROR([your libusb is too old. install version 0.1.7 or above]) ])
146    
147            CPPFLAGS="$saved_CPPFLAGS"
148            LIBS="$saved_LIBS"
149    
150            use_libusb=yes
151    fi
152    AC_SUBST(LIBUSB_CFLAGS)
153    AC_SUBST(LIBUSB_LIBS)
154    
155    AC_MSG_RESULT([use libusb              : $use_libusb])
156    
157    # check if the compiler support -fvisibility=hidden (GCC >= 4)
158    saved_CFLAGS="$CFLAGS"
159    CFLAGS="$CFLAGS -fvisibility=hidden"
160    AC_MSG_CHECKING([for -fvisibility=hidden])
161    AC_COMPILE_IFELSE([char foo;],
162        [   AC_MSG_RESULT([yes])
163            SYMBOL_VISIBILITY="-fvisibility=hidden" ],
164        AC_MSG_RESULT([no]))
165    CFLAGS="$saved_CFLAGS"
166    AC_SUBST(SYMBOL_VISIBILITY)
167    
168    # --disable-multi-thread
169    AC_ARG_ENABLE(multi-thread,
170            AC_HELP_STRING([--disable-multi-thread],[disable multi threading]),
171            [ multithread="${enableval}" ], [ multithread=yes ] )
172    
173    if test "${multithread}" != no ; then
174            ACX_PTHREAD(
175                    [ AC_DEFINE(HAVE_PTHREAD, 1,
176                            [Define if you have POSIX threads libraries and header files.])
177                    ], [ AC_MSG_ERROR([POSIX thread support required]) ])
178    
179  dnl --enable-libusb=PATH          multithread=yes
180  AC_ARG_ENABLE(libusb, [  --enable-libusb=PATH    libusb path (default /usr)],  fi
181          [  AC_MSG_RESULT([multi threading         : $multithread])
                 case ${enableval} in  
                         "" | "yes" | "YES")  
                                 ;;  
                         "no" | "NO")  
                                 use_libusb=false  
                                 ;;  
                         *)  
                                 CPPFLAGS="$CPPFLAGS -I${enableval}/include"  
                                 LDFLAGS="$LDFLAGS -L${enableval}/lib"  
                                 ;;  
                 esac  
         ]  
 )  
   
 dnl check if libusb is available  
 AC_SUBST(LIBUSB)  
 AC_CHECK_HEADERS(usb.h, [],  
         [ AC_MSG_ERROR([usb.h not found, use --enable-libusb=PATH]) ])  
   
 ac_save_LIBS="$LIBS"  
 LIBS="$LIBS $COREFOUNDATION $IOKIT"  
 AC_CHECK_LIB(usb, usb_init, [LIBUSB="$LIBUSB -lusb"],  
         [ AC_MSG_ERROR([libusb not found]) ])  
 LIBS="$ac_save_LIBS"  
   
 dnl check shat to use for dlopen  
 AC_SUBST(LIBDL)  
 AC_CHECK_LIB(dl, dlopen, [LIBDL="$LIBDL -ldl" ac_cv_func_dlopen_ldl=yes], ac_cv_func_dlopen_ldl=no)  
182    
183  dnl --enable-bundle=NAME  # --enable-bundle=NAME
184  AC_ARG_ENABLE(bundle,  AC_ARG_ENABLE(bundle,
185  [  --enable-bundle=NAME    bundle directory name (default ifd-ccid.bundle)],          AC_HELP_STRING([--enable-bundle=NAME],[bundle directory name
186  [bundle="${enableval}"], [bundle=false])          (default ifd-ccid.bundle)]),
187            [bundle="${enableval}"], [bundle=false])
188  if test "${bundle}" = false ; then  if test "${bundle}" = false ; then
189          bundle="ifd-ccid.bundle"          bundle="ifd-ccid.bundle"
190  fi  fi
191  AC_MSG_RESULT([bundle directory name   : $bundle])  AC_MSG_RESULT([bundle directory name   : $bundle])
192  AC_DEFINE_UNQUOTED(BUNDLE, "$bundle", [bundle directory name])  AC_DEFINE_UNQUOTED(BUNDLE, "$bundle", [bundle directory name])
193    
194  dnl --enable-usbdropdir=DIR  # --enable-usbdropdir=DIR
195  AC_ARG_ENABLE(usbdropdir,  AC_ARG_ENABLE(usbdropdir,
196  [  --enable-usbdropdir=DIR directory containing USB drivers                                                (default /usr/local/pcsc/drivers)],          AC_HELP_STRING([--enable-usbdropdir=DIR],[directory containing USB
197  [usbdropdir="${enableval}"], [usbdropdir=false])          drivers (default to pcscd config or $(prefix)/pcsc/drivers)]),
198            [usbdropdir="${enableval}"], [usbdropdir=false])
199  if test "${usbdropdir}" = false ; then  if test "${usbdropdir}" = false ; then
200          usbdropdir="/usr/local/pcsc/drivers"          usbdropdir=`pkg-config libpcsclite --variable=usbdropdir`
201  fi  fi
202  AC_MSG_RESULT([USB drop directory      : $usbdropdir])  AC_MSG_RESULT([USB drop directory      : $usbdropdir])
203  AC_DEFINE_UNQUOTED(PCSCLITE_HP_DROPDIR, "$usbdropdir", [directory containing USB drivers])  AC_DEFINE_UNQUOTED(PCSCLITE_HP_DROPDIR, "$usbdropdir", [directory containing USB drivers])
204    if test "${usbdropdir}" = "" ; then
205            AC_MSG_ERROR([use --enable-usbdropdir=DIR])
206    fi
207    
208    # --enable-twinserial
209    AC_ARG_ENABLE(twinserial,
210            AC_HELP_STRING([--enable-twinserial],[also compile and install the serial Twin driver]),
211            [twinserial="${enableval}"], [twinserial=no])
212    AC_MSG_RESULT([build and install serial Twin driver : $twinserial])
213    AM_CONDITIONAL(WITH_TWIN_SERIAL, test "${twinserial}" != "no")
214    
215    # --enable-ccidtwindir=DIR
216    AC_ARG_ENABLE(ccidtwindir,
217            AC_HELP_STRING([--enable-ccidtwindir=DIR],[directory to install the
218            serial Twin driver (default to pcscd config or $(prefix)/pcsc/drivers/serial)]),
219            [ccidtwindir="${enableval}"], [ccidtwindir=false])
220    if test "${ccidtwindir}" = false ; then
221            ccidtwindir=`pkg-config libpcsclite --variable=usbdropdir`/serial
222    fi
223    AC_MSG_RESULT([serial twin install dir : $ccidtwindir])
224    
225    # --disable-pcsclite
226    AC_ARG_ENABLE(pcsclite,
227            AC_HELP_STRING([--disable-pcsclite],[do not use pcsc-lite debug support]),
228            [ pcsclite="${enableval}" ], [ pcsclite=yes ] )
229    
230    if test "${pcsclite}" != no ; then
231            # check that pcsc-lite is installed
232            OLD_LIBS="$LIBS"
233            LIBS="$LIBS $PCSC_LIBS"
234            AC_MSG_CHECKING([for SCardEstablishContext])
235            AC_TRY_LINK_FUNC(SCardEstablishContext,
236                [ AC_MSG_RESULT([yes]) ],
237                    [ AC_MSG_ERROR([SCardEstablishContext() not found, install pcsc-lite 1.2.9-beta9 or later,or use LDLIBS=...  ./configure]) ])
238            LIBS="$OLD_LIBS"
239    
240  dnl --enable-debugcritical          pcsclite=yes
 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])  
 fi  
   
 dnl --enable-debuginfo  
 AC_ARG_ENABLE(debuginfo,  
 [  --enable-debuginfo      print info debug messages (default yes)],  
 [ debuginfo="${enableval}" ], [ debuginfo=yes ])  
 dnl yes by default  
 if test "${debuginfo}" != yes  
 then  
         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])  
241  fi  fi
242    AC_MSG_RESULT([compiled for pcsc-lite  : $pcsclite])
243    AM_CONDITIONAL(WITHOUT_PCSC, test "${pcsclite}" != "yes")
244    
245    # --enable-udev
246    AC_ARG_ENABLE(udev,
247            AC_HELP_STRING([--enable-udev],[udev support for pcscd hotplug]),
248            [udev="${enableval}"], [udev=no])
249    AC_MSG_RESULT([udev support            : $udev])
250    AM_CONDITIONAL(UDEV, test "${udev}" != "no")
251    
252  dnl Setup dist stuff  
253    # Setup dist stuff
254  AC_SUBST(ac_aux_dir)  AC_SUBST(ac_aux_dir)
255  AC_SUBST(bundle)  AC_SUBST(bundle)
256  AC_SUBST(usbdropdir)  AC_SUBST(usbdropdir)
257    AC_SUBST(ccidtwindir)
258    
259    # Write Makefiles.
260    AC_CONFIG_FILES(Makefile
261            aclocal/Makefile
262            src/Makefile
263            readers/Makefile
264            contrib/Makefile
265            contrib/Kobil_mIDentity_switch/Makefile
266            contrib/RSA_SecurID/Makefile
267            examples/Makefile)
268    
 dnl Write Makefiles.  
 AC_CONFIG_FILES(Makefile src/Makefile readers/Makefile)  
269  AC_OUTPUT  AC_OUTPUT
270    

Legend:
Removed from v.443  
changed lines
  Added in v.2522

  ViewVC Help
Powered by ViewVC 1.1.5