From 4aedda5e1bda6798b525f5e92be54579f3221466 Mon Sep 17 00:00:00 2001 From: frankmorgner Date: Thu, 14 Oct 2010 05:39:01 +0000 Subject: [PATCH] - define PICCDEV at compile time via configure option - fixed compile error due to missing semi colon git-svn-id: https://vsmartcard.svn.sourceforge.net/svnroot/vsmartcard@332 96b47cad-a561-4643-ad3b-153ac7d7599c --- picc_to_pcsc/configure.ac | 9 ++++++++- picc_to_pcsc/src/Makefile.am | 2 +- picc_to_pcsc/src/picc_to_pcsc.c | 6 +++--- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/picc_to_pcsc/configure.ac b/picc_to_pcsc/configure.ac index 356bfc4..eb38e86 100644 --- a/picc_to_pcsc/configure.ac +++ b/picc_to_pcsc/configure.ac @@ -2,7 +2,7 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ([2.65]) -AC_INIT([picc_to_pcsc], [0.1], [oepen@informatik.hu-berlin.de]) +AC_INIT([picc_to_pcsc], [0.1], [http://sourceforge.net/projects/vsmartcard/support]) AC_CONFIG_SRCDIR([src/picc_to_pcsc.c]) AC_CONFIG_HEADERS([config.h]) AM_INIT_AUTOMAKE @@ -32,6 +32,13 @@ CPPFLAGS="$saved_CPPFLAGS" LIBS="$saved_LIBS" +# --enable-piccdev=DEV +piccdev_default= +AC_ARG_ENABLE(piccdev, + AC_HELP_STRING([--enable-piccdev=DEV],[OpenPICC character device (default: /dev/ttyACM0)]), + [piccdev="${enableval}"], [piccdev="/dev/ttyACM0"]) +AC_DEFINE_UNQUOTED(PICCDEV, "${piccdev}", [OpenPICC character device]) + # Checks for header files. AC_CHECK_HEADERS([fcntl.h stdint.h stdlib.h string.h unistd.h]) diff --git a/picc_to_pcsc/src/Makefile.am b/picc_to_pcsc/src/Makefile.am index 68361af..513c119 100644 --- a/picc_to_pcsc/src/Makefile.am +++ b/picc_to_pcsc/src/Makefile.am @@ -7,4 +7,4 @@ picc_to_pcsc_SOURCES = picc_to_pcsc.c pcscutil.c picc_to_pcsc_LDADD = $(PCSC_LIBS) picc_to_pcsc_CFLAGS = $(PCSC_CFLAGS) -noinst_HEADERS = picc_to_pcsc.h pcscutil.h +noinst_HEADERS = pcscutil.h diff --git a/picc_to_pcsc/src/picc_to_pcsc.c b/picc_to_pcsc/src/picc_to_pcsc.c index d32b3e4..3ff74a3 100644 --- a/picc_to_pcsc/src/picc_to_pcsc.c +++ b/picc_to_pcsc/src/picc_to_pcsc.c @@ -29,7 +29,7 @@ #include #include -#include "picc_to_pcsc.h" +#include "config.h" #include "pcscutil.h" static FILE *picc_fd = NULL; /*filehandle used for PICCDEV*/ @@ -41,8 +41,8 @@ static SCARDHANDLE hCard = 0; /* Forward declaration */ static void cleanup_exit(int signo); static void cleanup(void); -static size_t picc_decode_apdu(char *inbuf, size_t inlen, unsigned char **outbuf) -static size_t picc_encode_rapdu(unsigned char *inbuf, size_t inlen, char **outbuf) +static size_t picc_decode_apdu(char *inbuf, size_t inlen, unsigned char **outbuf); +static size_t picc_encode_rapdu(unsigned char *inbuf, size_t inlen, char **outbuf); void cleanup_exit(int signo){ cleanup();