[Pcsclite-cvs-commit] CVS Drivers/ccid

CVS User rousseau ludovic.rousseau@free.fr
Mon, 21 Feb 2005 05:29:33 -0700


Update of /cvsroot/pcsclite/Drivers/ccid
In directory haydn:/tmp/cvs-serv19974

Modified Files:
	configure.in 
Log Message:
use pkg-config(1) to find everything related to pcsc-lite

if you installed pcsc-lite in /usr/local you may use
$ PKG_CONFIG_PATH=/usr/local/lib/pkgconfig ./configure

if you do not have pkg-config installed you may use
$ CFLAGS=-I/usr/local/include/PCSC ./configure


--- /cvsroot/pcsclite/Drivers/ccid/configure.in	2005/01/11 14:30:36	1.32
+++ /cvsroot/pcsclite/Drivers/ccid/configure.in	2005/02/21 12:29:32	1.33
@@ -1,7 +1,7 @@
 dnl Process this file with autoconf to produce a configure script.
 dnl You may need to use autoconf 2.56 or newer
 
-dnl $Id: configure.in,v 1.32 2005/01/11 14:30:36 rousseau Exp $
+dnl $Id: configure.in,v 1.33 2005/02/21 12:29:32 rousseau Exp $
 
 dnl Require autoconf 2.52
 AC_PREREQ(2.52)
@@ -32,18 +32,16 @@
 AM_PROG_LEX
 AC_CHECK_PROG([PKGCONFIG], [pkg-config], [yes])
 
-dnl pcsc-lite install .pc files in /usr/local/lib/pkgconfig by default
-PKG_CONFIG_PATH="/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH"
-export PKG_CONFIG_PATH
-if test "$PKGCONFIG" = "yes"; then
-	if ! `pkg-config --print-errors --atleast-version=1.2.9-beta5 libpcsclite`
-	then
-		AC_MSG_ERROR([install pcsc-lite 1.2.9-beta5 or later])
-	fi
-fi
+dnl check pcsc-lite version
+PKG_CHECK_MODULES(PCSC, libpcsclite >= 1.2.9-beta5, [],
+	[AC_MSG_WARN([install pcsc-lite 1.2.9-beta5 or later])])
 
-AM_CPPFLAGS=`pkg-config libpcsclite --cflags`
-AC_SUBST(AM_CPPFLAGS)
+OLD_CFLAGS="$CFLAGS"
+CFLAGS="$CFLAGS $PCSC_CFLAGS"
+AC_CHECK_HEADER(ifdhandler.h,,
+	[AC_MSG_ERROR([ifdhandler.h not found, install pcsc-lite 1.2.9-beta5 or later, or use CFLAGS=... ./configure])],
+	[ #include <ifdhandler.h> ])
+CFLAGS="$OLD_CFLAGS"
 
 dnl Add libtool support.
 AM_PROG_LIBTOOL
@@ -56,14 +54,6 @@
 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_MSG_WARN([some header files not found])])
 
-OLD_CFLAGS="$CFLAGS"
-CFLAGS=`pkg-config libpcsclite --cflags`
-CFLAGS="$OLD_CFLAGS $CFLAGS"
-AC_CHECK_HEADER(ifdhandler.h,,
-	[AC_MSG_ERROR([ifdhandler.h not found, install pcsc-lite 1.2.9-beta5 or later])],
-	[ #include <pcsclite.h> ])
-CFLAGS="$OLD_CFLAGS"
-
 dnl Checks for typedefs, structures, and compiler characteristics.
 AC_C_CONST
 AC_TYPE_SIZE_T
@@ -170,18 +160,7 @@
 	drivers (default to pcscd config or $(prefix)/pcsc/drivers)]),
 	[usbdropdir="${enableval}"], [usbdropdir=false])
 if test "${usbdropdir}" = false ; then
-	if test "$PKGCONFIG" = yes ; then
-		usbdropdir=`pkg-config libpcsclite --variable=usbdropdir`
-	else
-		usbdropdir=""
-	fi
-	if test -z "$usbdropdir" ; then
-		if test "$prefix" = NONE ; then
-			usbdropdir="$ac_default_prefix/pcsc/drivers"
-		else
-			usbdropdir="$prefix/pcsc/drivers"
-		fi
-	fi
+	usbdropdir=`pkg-config libpcsclite --variable=usbdropdir`
 fi
 AC_MSG_RESULT([USB drop directory      : $usbdropdir])
 AC_DEFINE_UNQUOTED(PCSCLITE_HP_DROPDIR, "$usbdropdir", [directory containing USB drivers])
@@ -192,20 +171,7 @@
 	serial Twin driver (default to pcscd config or $(prefix)/pcsc/drivers/serial)]),
 	[ccidtwindir="${enableval}"], [ccidtwindir=false])
 if test "${ccidtwindir}" = false ; then
-	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
-		if test "$prefix" = NONE ; then
-			ccidtwindir="$ac_default_prefix/pcsc/drivers"
-		else
-			ccidtwindir="$prefix/pcsc/drivers"
-		fi
-	fi
-	ccidtwindir="$ccidtwindir/serial"
+	ccidtwindir=`pkg-config libpcsclite --variable=usbdropdir`/serial
 fi
 AC_MSG_RESULT([serial twin install dir : $ccidtwindir])
 AC_DEFINE_UNQUOTED(PCSCLITE_HP_DROPDIR, "$ccidtwindir", [directory containing USB drivers])