[Pcsclite-cvs-commit] PCSC configure.in,1.28,1.29 config.h.in,1.11,1.12

aet-guest@quantz.debian.org aet-guest@quantz.debian.org
Sun, 07 Sep 2003 20:05:25 +0200


Update of /cvsroot/pcsclite/PCSC
In directory quantz:/tmp/cvs-serv31551

Modified Files:
	configure.in config.h.in 
Log Message:
Checkpoint commit + bootstrap update


Index: configure.in
===================================================================
RCS file: /cvsroot/pcsclite/PCSC/configure.in,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -d -r1.28 -r1.29
--- configure.in	7 Sep 2003 17:34:41 -0000	1.28
+++ configure.in	7 Sep 2003 18:05:23 -0000	1.29
@@ -1,35 +1,103 @@
-dnl Process this file with autoconf to produce a configure script.
-dnl You may need to use autoconf 2.56 or newer
+dnl -*- mode: m4; -*-
+dnl Process this file with autoconf to produce a configure script
 
-dnl $Id$
+# Require autoconf 2.52
+AC_PREREQ(2.52)
 
-AC_INIT(src/winscard.h)
-AC_CONFIG_AUX_DIR(build)
+AC_INIT(COPYING)
+AM_INIT_AUTOMAKE(pcsc-lite, 1.2.0-cvs)
+AM_CONFIG_HEADER(config.h)
 
-dnl Default install dir
+AC_CONFIG_SRCDIR(src/pcscdaemon.c)
+
+AC_CONFIG_AUX_DIR(build)
 AC_PREFIX_DEFAULT(/usr/local)
 
-dnl Automake boilerplate.
 AC_CANONICAL_HOST
+AC_PROG_CC
+AC_C_BIGENDIAN
 
-dnl Every other copy of the package version number gets its value from here
-AM_INIT_AUTOMAKE(pcsc-lite, 1.2.0-rc2)
+dnl Check for some target-specific stuff
+case "$host" in
+*-*-hpux*)
+	CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE_EXTENDED"
+	;;
+*-*-solaris*)
+	CPPFLAGS="$CPPFLAGS -I/usr/local/include"
+	LDFLAGS="$LDFLAGS -L/usr/local/lib -R/usr/local/lib"
+	need_dash_r=1
+	;;
+*-*-sunos4*)
+	CPPFLAGS="$CPPFLAGS -DSUNOS4"
+	;;
+*-*-aix*)
+	CPPFLAGS="$CPPFLAGS -I/usr/local/include"
+	LDFLAGS="$LDFLAGS -L/usr/local/lib"
+	if (test "$LD" != "gcc" && test -z "$blibpath"); then
+		blibpath="/usr/lib:/lib:/usr/local/lib"
+	fi
+	;;
+*-*-osf*)
+	CPPFLAGS="$CPPFLAGS -D_POSIX_PII_SOCKET"
+	;;
+*-*-darwin*)
+	LIBS="$LIBS -lobjc"
+	if test "$GCC" = "yes"; then
+		CFLAGS="$CFLAGS -no-cpp-precomp"
+	fi
+	;;
+esac
 
-dnl create a config.h file (Automake will add -DHAVE_CONFIG_H)
-AM_CONFIG_HEADER(config.h)
+AC_ARG_WITH(common-dir,
+	[  --with-common-dir=PATH  Specify path for common installation libraries],
+	[
+		if test "x$withval" != "xno" ; then
+			trycommondir=$withval
+		fi
+	]
+)
+
+saved_LDFLAGS="$LDFLAGS"
+saved_CPPFLAGS="$CPPFLAGS"
+AC_CACHE_CHECK([for common directory], ac_cv_commondir, [
+	for commondir in $trycommondir "" /usr/local /usr/pkg /opt ; do
+		# Skip directories if they don't exist
+		if test ! -z "$commondir" -a ! -d "$commondir/" ; then
+			continue;
+		fi
+		CPPFLAGS="$saved_CPPFLAGS"
+		LDFLAGS="$saved_LDFLAGS"
+
+		if test ! -z "$commondir" -a "x$commondir" != "x/usr"; then
+			LDFLAGS="-L$commondir/lib $saved_LDFLAGS"
+			if test ! -z "$need_dash_r" ; then
+				LDFLAGS="-R$commondir/lib $LDFLAGS"
+			fi
+			CPPFLAGS="-I$commondir/include $saved_CPPFLAGS"
+		fi
+		break;
+	done
+
+	if test -z "$commondir" ; then
+		commondir="(system)"
+	fi
+	ac_cv_commondir=$commondir
+])
 
 dnl Options
 AM_MAINTAINER_MODE
 
-dnl Checks for programs.
-AC_PROG_CC
+dnl Checks for programs
 AC_PROG_CPP
 AC_PROG_INSTALL
-AC_PROG_MAKE_SET
 AC_PROG_LN_S
+AC_PROG_MAKE_SET
 AM_PROG_LEX
+AC_PATH_PROG(TEST_MINUS_S_SH, bash)
+AC_PATH_PROG(TEST_MINUS_S_SH, ksh)
+AC_PATH_PROG(TEST_MINUS_S_SH, sh)
 
-dnl Special check for pthread support.
+dnl Special check for pthread support
 ACX_PTHREAD(
 [
  AC_DEFINE(HAVE_PTHREAD, 1,
@@ -38,34 +106,36 @@
  AC_MSG_ERROR([POSIX thread support required])
 ])
 
-AC_CHECK_FUNCS(daemon)
-AC_CHECK_FUNCS(getopt_long)
-AC_CHECK_FUNCS(snprintf vsnprintf)
-AC_CHECK_FUNCS(strerror)
-AC_CHECK_FUNCS(strncpy)
-
-AC_CHECK_HEADERS(getopt.h)
-AC_CHECK_HEADERS(errno.h)
-
-dnl Add libtool support.
+dnl Add libtool support
 AM_PROG_LIBTOOL
+dnl Automatically update the libtool script if it becomes out-of-date
+#AC_SUBST(LIBTOOL_DEPS)
 
-dnl Automatically update the libtool script if it becomes out-of-date.
-AC_SUBST(LIBTOOL_DEPS)
-
-dnl Checks for header files.
+dnl Checks for header files
 AC_HEADER_STDC
-#AC_HEADER_SYS_WAIT
-#AC_CHECK_HEADERS(fcntl.h sys/time.h unistd.h)
+AC_HEADER_SYS_WAIT
+AC_CHECK_HEADERS([dirent.h dl.h dlfcn.h errno.h fcntl.h getopt.h malloc.h stdlib.h string.h strings.h sys/filio.h sys/time.h syslog.h unistd.h])
 
-dnl Checks for typedefs, structures, and compiler characteristics.
-#AC_C_CONST
-#AC_HEADER_TIME
+dnl Checks for typedefs, structures, and compiler characteristics
+AC_C_CONST
+AC_TYPE_UID_T
+AC_TYPE_SIZE_T
+AC_HEADER_TIME
 
-dnl Checks for library functions.
-#AC_FUNC_MMAP
-#AC_TYPE_SIGNAL
-#AC_CHECK_FUNCS(gettimeofday strdup strtoul)
+dnl Checks for library functions
+AC_FUNC_ERROR_AT_LINE
+AC_FUNC_STAT
+AC_FUNC_VPRINTF
+AC_CHECK_FUNCS(daemon flock getopt_long nanosleep strerror strncpy vsnprintf)
+
+dnl C Compiler features
+AC_C_INLINE
+if test "$GCC" = "yes"; then
+	CFLAGS="-Wall -fno-common $CFLAGS"
+fi
+
+AC_SUBST(LIBDL)
+AC_CHECK_LIB(dl, dlopen, [LIBDL="$LIBDL -ldl" ac_cv_func_dlopen_ldl=yes], ac_cv_func_dlopen_ldl=no)
 
 dnl Use 'uname' output as an architecture define
 uname=`uname`
@@ -76,6 +146,103 @@
 esac
 AC_DEFINE_UNQUOTED(PCSC_ARCH, "$uname", [PC/SC target architecture])
 
+#
+#  We check for various libraries
+#  - SysVr4 style of "-lsocket" at first (unless in libc)
+#    The hallmark is  connect()  routine (we presume)
+#
+AC_SUBST(LIBSOCKET)dnl
+ac_cv_libsocket_both=1
+AC_CHECK_FUNC(connect, ac_cv_libsocket_both=0)
+AC_CHECK_FUNC(gethostbyname, ac_cv_libsocket_both=0)
+if test "$ac_cv_libsocket_both" = 1 ; then
+  # Check cache
+  if test "$ac_cv_func_socket_lsocket" = yes ; then
+    AC_MSG_RESULT([need -lsocket library (cached)])
+    LIBSOCKET="-lsocket"
+    if test "$ac_cv_func_gethostbyname_lnsl" = yes ; then
+	LIBSOCKET="-lsocket -lnsl"
+    fi
+  else
+    # Well, will this work ?  SysVR4, but not Sun Solaris ?
+    AC_CHECK_LIB(socket, connect, [LIBSOCKET="-lsocket"
+				   ac_cv_func_socket_lsocket=yes],
+				   ac_cv_func_socket_lsocket=no)
+    if test "$ac_cv_func_socket_lsocket" = yes ; then
+      t_oldLibs="$LIBS"
+      LIBS="$LIBS -lsocket $LIBRESOLV"
+      AC_TRY_LINK([],[gethostbyname();], ,[
+	  LIBS="$LIBS -lnsl" # Add this Solaris library
+	  AC_TRY_LINK([],[gethostbyname();],[
+			LIBSOCKET="-lsocket -lnsl"
+			ac_cv_func_gethostbyname_lnsl=yes
+		], [
+		   AC_MSG_ERROR([Weird, '$LIBS' not enough to find  gethostbyname() ?!])
+		])
+	])
+      LIBS="$t_oldLibs"
+    fi
+  fi
+fi
+
+AC_SUBST(LIBRESOLV)dnl
+if test "x$LIBRESOLV" = "x"; then
+  # Ok, No  -lresolv,  is this enough for the  _res  to appear ?
+  t_oldLibs="$LIBS"
+  LIBS="$LIBS $LIBSOCKET"
+  ac_cv_var__res_options=no
+  # This following is for IRIX6.4, and I sincerely hope it
+  # will not fail on other systems...  It did! It did!
+  # Many systems don't have idemponent headers, they need specific
+  # includes before latter ones, or the latter ones won't be successful
+  AC_TRY_LINK([#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/nameser.h>
+#include <resolv.h>],
+	      [_res.options = RES_INIT;],
+		ac_cv_var__res_options=yes);
+  if test "$ac_cv_var__res_options" != "yes"; then
+    LIBRESOLV="-lresolv"
+  fi
+  LIBS="$t_oldLibs"
+fi
+
+if test "x$LIBRESOLV" = "x"; then
+  # glibc 2.2.4 and libresolv is difficult
+  #  -	gethostbyname won't require lresolv because all
+  #	queries are made through the nsswitch
+  #  -	checking for the variable _res will not require
+  #	lresolv because _res is defined somewhere
+  AC_CHECK_LIB(resolv, res_query, [LIBRESOLV=-lresolv])
+  LIBS="$t_oldLibs"
+fi
+
+# See about the routines that possibly exist at the libraries
+LIBS="$t_oldLibs $LIBSOCKET"
+AC_CHECK_FUNCS(socket socketpair)
+LIBS="$t_oldLibs"
+
+if test "$ac_cv_func_socket" = no -a "$LIBSOCKET" != ""; then
+  LIBS="$LIBS $LIBSOCKET"
+  AC_TRY_LINK([],[socket();], ac_cv_func_socket=yes)
+  if test $ac_cv_func_socket = yes; then
+    AC_DEFINE(HAVE_SOCKET, 1, [Have socket])
+  fi
+  LIBS="$t_oldLibs"
+fi
+if test "$ac_cv_func_socketpair" = no -a "$LIBSOCKET" != ""; then
+  LIBS="$LIBS $LIBSOCKET"
+  AC_TRY_LINK([],[socketpair();], ac_cv_func_socketpair=yes)
+  if test $ac_cv_func_socketpair = yes; then
+    AC_DEFINE(HAVE_SOCKETPAIR, 1, [Have socketpair])
+  fi
+  LIBS="$t_oldLibs"
+fi
+
+# Always link lib{socket,nsl,resolv) if found, sigh
+LIBS="$LIBS $LIBSOCKET $LIBRESOLV"
+
 dnl check if libusb is available
 AC_CHECK_LIB(usb, usb_init, [ use_libusb=true ], [ use_libusb=false ])
 AC_CHECK_HEADERS(usb.h, [ use_libusb=true ], [ use_libusb=false ])
@@ -106,7 +273,9 @@
 AC_MSG_RESULT([enable libusb support         : $use_libusb])
 
 AM_CONDITIONAL(PCSC_USE_LIBUSB, test x$use_libusb = xtrue)
-
+if test x$use_libusb = xtrue; then
+  AC_DEFINE(HAVE_LIBUSB,1, [Libusb is available])
+fi
 
 dnl --enable-threadsafe
 AC_ARG_ENABLE(threadsafe,
@@ -148,7 +317,6 @@
   AC_DEFINE(MSC_DEBUG, 1, [enable full musclecard debug messaging.])
 fi
 
-
 dnl --enable-debugatr
 AC_ARG_ENABLE(debugatr,
 [  --enable-debugatr       enable ATR debug messages from pcscd.],
@@ -164,7 +332,6 @@
   AC_DEFINE(ATR_DEBUG, 1, [display ATR parsing debug messages.])
 fi
 
-
 dnl --enable-scf
 AC_ARG_ENABLE(scf,
 [  --enable-scf            use SCF for reader support.],
@@ -178,20 +345,18 @@
 
 AM_CONDITIONAL(MSC_ENABLE_SCF, test x$scf = xtrue)
 
-
 dnl --disable-musclecard
 AC_ARG_ENABLE(musclecard,
 [  --disable-musclecard    musclecard framework disabled.],
 [case "${enableval}" in
-  yes)	musclecard=false ;;
-  no)	musclecard=true ;;
+  yes)	musclecard=true ;;
+  no)	musclecard=false ;;
   *) AC_MSG_ERROR([bad value ${enableval} for --disable-musclecard]) ;;
- esac], [musclecard=false])
-
-AC_MSG_RESULT([disable musclecard            : $musclecard])
+ esac], [musclecard=true])
 
-AM_CONDITIONAL(MCARD_ENABLED, test x$musclecard = xfalse)
+AC_MSG_RESULT([enable musclecard             : $musclecard])
 
+AM_CONDITIONAL(HAVE_MUSCLECARD, test x$musclecard = xtrue)
 
 dnl --enable-muscledropdir=DIR
 AC_ARG_ENABLE(muscledropdir,
@@ -203,7 +368,6 @@
 AC_MSG_RESULT([enable MuscleCard bundles dir : $muscledropdir])
 AC_DEFINE_UNQUOTED(MSC_SVC_DROPDIR, "$muscledropdir", [directory containing MuscleCard bundles])
 
-
 dnl --enable-confdir=DIR
 AC_ARG_ENABLE(confdir,
 [  --enable-confdir=DIR    directory containing reader.conf (default /etc)],
@@ -217,7 +381,6 @@
 	AC_MSG_RESULT([enable confdir                : /etc (default)])
 fi
 
-
 dnl --enable-runpid=FILE
 AC_ARG_ENABLE(runpid,
 [  --enable-runpid=FILE    file containing pcscd pid],
@@ -229,7 +392,6 @@
 	AC_DEFINE_UNQUOTED(USE_RUN_PID, "$runpid", [file containing pcscd pid])
 fi
 
-
 dnl --enable-ipcdir=DIR
 AC_ARG_ENABLE(ipcdir,
 [  --enable-ipcdir=DIR     directory containing IPC files (default /var/run/)],
@@ -243,7 +405,6 @@
 	AC_MSG_RESULT([enable ipcdir                 : /var/run/ (default)])
 fi
 
-
 dnl warning about pthread
 if test x${threadsafe} = xtrue ; then
   AC_MSG_RESULT([NOTE :: You must link pthread libraries with your app.])
@@ -253,10 +414,6 @@
   CC="$PTHREAD_CC"
 fi
 
-if test "$GCC" = "yes"; then
-	CFLAGS="$CFLAGS -Wall -fno-common"
-fi
-
 dnl Setup dist stuff
 AC_SUBST(ac_aux_dir)
 AC_SUBST(muscledropdir)
@@ -264,10 +421,16 @@
 AC_SUBST(confdir)
 AC_SUBST(runpid)
 
-dnl Write Makefiles.
-AC_CONFIG_FILES(Makefile src/Makefile src/utils/Makefile etc/Makefile
-				doc/Makefile doc/bundleTool.8 doc/pcscd.8
-				doc/example/Makefile
-				etc/reader.conf src/libpcsclite.pc)
-AC_OUTPUT
-
+dnl Write Makefiles
+AC_OUTPUT([
+Makefile
+doc/Makefile
+doc/bundleTool.8
+doc/pcscd.8
+doc/example/Makefile
+etc/Makefile
+etc/reader.conf
+src/Makefile
+src/libpcsclite.pc
+src/utils/Makefile
+])

Index: config.h.in
===================================================================
RCS file: /cvsroot/pcsclite/PCSC/config.h.in,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- config.h.in	7 Sep 2003 17:34:41 -0000	1.11
+++ config.h.in	7 Sep 2003 18:05:23 -0000	1.12
@@ -6,12 +6,27 @@
 /* Define to 1 if you have the `daemon' function. */
 #undef HAVE_DAEMON
 
+/* Define to 1 if you have the <dirent.h> header file. */
+#undef HAVE_DIRENT_H
+
 /* Define to 1 if you have the <dlfcn.h> header file. */
 #undef HAVE_DLFCN_H
 
+/* Define to 1 if you have the <dl.h> header file. */
+#undef HAVE_DL_H
+
+/* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */
+#undef HAVE_DOPRNT
+
 /* Define to 1 if you have the <errno.h> header file. */
 #undef HAVE_ERRNO_H
 
+/* Define to 1 if you have the <fcntl.h> header file. */
+#undef HAVE_FCNTL_H
+
+/* Define to 1 if you have the `flock' function. */
+#undef HAVE_FLOCK
+
 /* Define to 1 if you have the <getopt.h> header file. */
 #undef HAVE_GETOPT_H
 
@@ -21,14 +36,30 @@
 /* Define to 1 if you have the <inttypes.h> header file. */
 #undef HAVE_INTTYPES_H
 
+/* Libusb is available */
+#undef HAVE_LIBUSB
+
+/* Define to 1 if you have the <malloc.h> header file. */
+#undef HAVE_MALLOC_H
+
 /* Define to 1 if you have the <memory.h> header file. */
 #undef HAVE_MEMORY_H
 
+/* Define to 1 if you have the `nanosleep' function. */
+#undef HAVE_NANOSLEEP
+
 /* Define if you have POSIX threads libraries and header files. */
 #undef HAVE_PTHREAD
 
-/* Define to 1 if you have the `snprintf' function. */
-#undef HAVE_SNPRINTF
+/* Have socket */
+#undef HAVE_SOCKET
+
+/* Have socketpair */
+#undef HAVE_SOCKETPAIR
+
+/* Define to 1 if `stat' has the bug that it succeeds when given the
+   zero-length file name argument. */
+#undef HAVE_STAT_EMPTY_STRING_BUG
 
 /* Define to 1 if you have the <stdint.h> header file. */
 #undef HAVE_STDINT_H
@@ -48,21 +79,40 @@
 /* Define to 1 if you have the `strncpy' function. */
 #undef HAVE_STRNCPY
 
+/* Define to 1 if you have the <syslog.h> header file. */
+#undef HAVE_SYSLOG_H
+
+/* Define to 1 if you have the <sys/filio.h> header file. */
+#undef HAVE_SYS_FILIO_H
+
 /* Define to 1 if you have the <sys/stat.h> header file. */
 #undef HAVE_SYS_STAT_H
 
+/* Define to 1 if you have the <sys/time.h> header file. */
+#undef HAVE_SYS_TIME_H
+
 /* Define to 1 if you have the <sys/types.h> header file. */
 #undef HAVE_SYS_TYPES_H
 
+/* Define to 1 if you have <sys/wait.h> that is POSIX.1 compatible. */
+#undef HAVE_SYS_WAIT_H
+
 /* Define to 1 if you have the <unistd.h> header file. */
 #undef HAVE_UNISTD_H
 
 /* Define to 1 if you have the <usb.h> header file. */
 #undef HAVE_USB_H
 
+/* Define to 1 if you have the `vprintf' function. */
+#undef HAVE_VPRINTF
+
 /* Define to 1 if you have the `vsnprintf' function. */
 #undef HAVE_VSNPRINTF
 
+/* Define to 1 if `lstat' dereferences a symlink specified with a trailing
+   slash. */
+#undef LSTAT_FOLLOWS_SLASHED_SYMLINK
+
 /* enable full musclecard debug messaging. */
 #undef MSC_DEBUG
 
@@ -90,6 +140,9 @@
 /* directory containing USB drivers */
 #undef PCSCLITE_HP_DROPDIR
 
+/* PC/SC target architecture */
+#undef PCSC_ARCH
+
 /* enable full PCSC debug messaging. */
 #undef PCSC_DEBUG
 
@@ -100,6 +153,9 @@
 /* Define to 1 if you have the ANSI C header files. */
 #undef STDC_HEADERS
 
+/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
+#undef TIME_WITH_SYS_TIME
+
 /* directory containing IPC files (default /var/run/) */
 #undef USE_IPCDIR
 
@@ -115,6 +171,26 @@
 /* Version number of package */
 #undef VERSION
 
+/* Define to 1 if your processor stores words with the most significant byte
+   first (like Motorola and SPARC, unlike Intel and VAX). */
+#undef WORDS_BIGENDIAN
+
 /* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a
    `char[]'. */
 #undef YYTEXT_POINTER
+
+/* Define to empty if `const' does not conform to ANSI C. */
+#undef const
+
+/* Define to `int' if <sys/types.h> doesn't define. */
+#undef gid_t
+
+/* Define as `__inline' if that's what the C compiler calls it, or to nothing
+   if it is not supported. */
+#undef inline
+
+/* Define to `unsigned' if <sys/types.h> does not define. */
+#undef size_t
+
+/* Define to `int' if <sys/types.h> doesn't define. */
+#undef uid_t