[Pcsclite-cvs-commit] r4901 - in /trunk/PCSC: configure.in src/Makefile.am src/hotplug_libhal.c src/pcscdaemon.c src/readerfactory.c

rousseau at users.alioth.debian.org rousseau at users.alioth.debian.org
Thu Apr 29 07:26:37 UTC 2010


Author: rousseau
Date: Thu Apr 29 07:26:36 2010
New Revision: 4901

URL: http://svn.debian.org/wsvn/pcsclite/?sc=1&rev=4901
Log:
Add --disable-serial and --disable-usb options

--disable-serial removes support of /etc/reader.conf
gain: 8.0kB of .text (12%) and 160 bytes of .bss (4%) for pcscd

--disable-usb removes support of USB hotplug
gain: 9.7kB of .text (14%) and 960 bytes of .bss (23%) for pcscd

If you use both options (and use a static driver configuration)
gain: 17.7kB of .text (26%) and 1152 bytes of .bss (28%) for pcscd

Modified:
    trunk/PCSC/configure.in
    trunk/PCSC/src/Makefile.am
    trunk/PCSC/src/hotplug_libhal.c
    trunk/PCSC/src/pcscdaemon.c
    trunk/PCSC/src/readerfactory.c

Modified: trunk/PCSC/configure.in
URL: http://svn.debian.org/wsvn/pcsclite/trunk/PCSC/configure.in?rev=4901&op=diff
==============================================================================
--- trunk/PCSC/configure.in (original)
+++ trunk/PCSC/configure.in Thu Apr 29 07:26:36 2010
@@ -138,6 +138,26 @@
 
 # See if socket() is found from libsocket
 AC_CHECK_LIB(socket, socket, [LIBS="$LIBS -lsocket"])
+
+# --disable-serial
+AC_ARG_ENABLE(serial,
+	AC_HELP_STRING([--disable-serial],[do not use serial reader.conf file]),
+	[ use_serial="${enableval}" ], [ use_serial="yes" ] )
+AM_CONDITIONAL(ENABLE_SERIAL, test "$use_serial" != "no")
+if test "$use_serial" != "no"; then
+	AC_DEFINE(USE_SERIAL, 1, [Use serial conf file mechanism])
+	PCSCLITE_FEATURES="${PCSCLITE_FEATURES} serial"
+fi
+
+# --disable-usb
+AC_ARG_ENABLE(usb,
+	AC_HELP_STRING([--disable-usb],[do not use usb hotplug]),
+	[ use_usb="${enableval}" ], [ use_usb="yes" ] )
+AM_CONDITIONAL(ENABLE_USB, test "$use_usb" != "no")
+if test "$use_usb" != "no"; then
+	AC_DEFINE(USE_USB, 1, [Use USB hotplug mechanism])
+	PCSCLITE_FEATURES="${PCSCLITE_FEATURES} usb"
+fi
 
 # --enable-libhal
 AC_ARG_ENABLE(libhal,
@@ -342,6 +362,8 @@
 USB drop directory:   ${usbdropdir}
 ATR parsing messages: ${debugatr}
 ipcdir:               ${ipcdir}
+use serial:           ${use_serial}
+use usb:              ${use_usb}
 
 PCSCLITE_FEATURES:    ${PCSCLITE_FEATURES}
 

Modified: trunk/PCSC/src/Makefile.am
URL: http://svn.debian.org/wsvn/pcsclite/trunk/PCSC/src/Makefile.am?rev=4901&op=diff
==============================================================================
--- trunk/PCSC/src/Makefile.am (original)
+++ trunk/PCSC/src/Makefile.am Thu Apr 29 07:26:36 2010
@@ -7,6 +7,18 @@
 
 sbin_PROGRAMS = pcscd
 noinst_PROGRAMS = testpcsc pcsc-wirecheck pcsc-wirecheck-gen
+
+if ENABLE_SERIAL
+SERIAL_CONFIG = configfile.l
+endif
+
+if ENABLE_USB
+USB_CONFIG = tokenparser.l \
+	hotplug_libhal.c \
+	hotplug_libusb.c \
+	hotplug_linux.c \
+	hotplug_macosx.c
+endif
 
 libpcsclite_la_SOURCES = \
 	debug.c \
@@ -27,7 +39,7 @@
 	atrhandler.c \
 	atrhandler.h \
 	configfile.h \
-	configfile.l \
+	$(SERIAL_CONFIG) \
 	debuglog.c \
 	dyn_generic.h \
 	dyn_hpux.c \
@@ -37,10 +49,6 @@
 	eventhandler.h \
 	hotplug_generic.c \
 	hotplug.h \
-	hotplug_libhal.c \
-	hotplug_libusb.c \
-	hotplug_linux.c \
-	hotplug_macosx.c \
 	ifdwrapper.c \
 	ifdwrapper.h \
 	misc.h \
@@ -67,7 +75,7 @@
 	strlcpycat.h \
 	sys_generic.h \
 	sys_unix.c \
-	tokenparser.l \
+	$(USB_CONFIG) \
 	utils.c \
 	utils.h \
 	winscard.c \

Modified: trunk/PCSC/src/hotplug_libhal.c
URL: http://svn.debian.org/wsvn/pcsclite/trunk/PCSC/src/hotplug_libhal.c?rev=4901&op=diff
==============================================================================
--- trunk/PCSC/src/hotplug_libhal.c (original)
+++ trunk/PCSC/src/hotplug_libhal.c Thu Apr 29 07:26:36 2010
@@ -13,7 +13,7 @@
  */
 
 #include "config.h"
-#ifdef HAVE_LIBHAL
+#if defined(HAVE_LIBHAL) && defined(USE_USB)
 
 #include <string.h>
 #include <stdio.h>

Modified: trunk/PCSC/src/pcscdaemon.c
URL: http://svn.debian.org/wsvn/pcsclite/trunk/PCSC/src/pcscdaemon.c?rev=4901&op=diff
==============================================================================
--- trunk/PCSC/src/pcscdaemon.c (original)
+++ trunk/PCSC/src/pcscdaemon.c Thu Apr 29 07:26:36 2010
@@ -111,7 +111,7 @@
 	(void)signal(SIGHUP, SIG_IGN);	/* needed for Solaris. The signal is sent
 				 * when the shell is existed */
 
-#ifndef PCSCLITE_STATIC_DRIVER
+#if !defined(PCSCLITE_STATIC_DRIVER) && defined(USE_USB)
 	/*
 	 * Set up the search for USB/PCMCIA devices
 	 */
@@ -169,7 +169,9 @@
 		if (AraKiri)
 		{
 			/* stop the hotpug thread and waits its exit */
+#ifdef USE_USB
 			(void)HPStopHotPluggables();
+#endif
 			(void)SYS_Sleep(1);
 
 			/* now stop all the drivers */
@@ -492,6 +494,7 @@
 	if (SCARD_S_SUCCESS != rv)
 		at_exit();
 
+#ifdef USE_SERIAL
 	/*
 	 * Grab the information from the reader.conf
 	 */
@@ -527,6 +530,7 @@
 				at_exit();
 			}
 	}
+#endif
 
 	Log1(PCSC_LOG_INFO, "pcsc-lite " VERSION " daemon ready.");
 
@@ -579,7 +583,9 @@
 	if (AraKiri)
 		return;
 
+#ifdef USE_USB
 	HPReCheckSerialReaders();
+#endif
 } /* signal_reload */
 
 static void signal_trap(int sig)

Modified: trunk/PCSC/src/readerfactory.c
URL: http://svn.debian.org/wsvn/pcsclite/trunk/PCSC/src/readerfactory.c?rev=4901&op=diff
==============================================================================
--- trunk/PCSC/src/readerfactory.c (original)
+++ trunk/PCSC/src/readerfactory.c Thu Apr 29 07:26:36 2010
@@ -51,8 +51,10 @@
 static READER_CONTEXT * sReadersContexts[PCSCLITE_MAX_READERS_CONTEXTS];
 static int maxReaderHandles = PCSC_MAX_READER_HANDLES;
 static DWORD dwNumReadersContexts = 0;
+#ifdef USE_SERIAL
 static char *ConfigFile = NULL;
 static int ConfigFileCRC = 0;
+#endif
 static pthread_mutex_t LockMutex = PTHREAD_MUTEX_INITIALIZER;
 
 #define IDENTITY_SHIFT 16
@@ -1307,6 +1309,7 @@
 	}
 }
 
+#ifdef USE_SERIAL
 int RFStartSerialReaders(const char *readerconf)
 {
 	SerialReader *reader_list;
@@ -1439,6 +1442,7 @@
 	}
 	free(reader_list);
 }
+#endif
 
 #if 0
 void RFSuspendAllReaders(void)




More information about the Pcsclite-cvs-commit mailing list