1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-05-28 21:50:02 +02:00

* configure.ac: Define AM conditional HAVE_OPENSC.

* Makefile.am: Make OpenSC lib link after libgcrypt. Do not link
to pth.
* apdu.c: Don't use Pth if we use OpenSC.
* sc-investigate.c, scdaemon.c: Disable use of pth if OpenSC is used.

* scdaemon.c (main): Bumbed thread stack size up to 512k.
This commit is contained in:
Werner Koch 2004-07-22 10:52:56 +00:00
parent d9147773b4
commit 44bf2d0ae4
7 changed files with 41 additions and 12 deletions

View File

@ -2,6 +2,8 @@
Released 1.9.10. Released 1.9.10.
* configure.ac: Define AM conditional HAVE_OPENSC.
2004-07-21 Werner Koch <wk@g10code.de> 2004-07-21 Werner Koch <wk@g10code.de>
* configure.ac: Don't set DIE to no after it might has been set to * configure.ac: Don't set DIE to no after it might has been set to

View File

@ -471,6 +471,7 @@ if test $have_opensc = yes; then
AC_DEFINE(HAVE_OPENSC,1, AC_DEFINE(HAVE_OPENSC,1,
[defined if the OpenSC library is available]) [defined if the OpenSC library is available])
fi fi
AM_CONDITIONAL(HAVE_OPENSC, test "$have_opensc" = "yes")
# #
# Check whether the (highly desirable) GNU Pth library is available # Check whether the (highly desirable) GNU Pth library is available

View File

@ -1,5 +1,10 @@
2004-07-22 Werner Koch <wk@g10code.de> 2004-07-22 Werner Koch <wk@g10code.de>
* Makefile.am: Make OpenSC lib link after libgcrypt. Do not link
to pth.
* apdu.c: Don't use Pth if we use OpenSC.
* sc-investigate.c, scdaemon.c: Disable use of pth if OpenSC is used.
* scdaemon.c (main): Bumbed thread stack size up to 512k. * scdaemon.c (main): Bumbed thread stack size up to 512k.
2004-07-16 Werner Koch <wk@gnupg.org> 2004-07-16 Werner Koch <wk@gnupg.org>

View File

@ -25,6 +25,13 @@ AM_CPPFLAGS = -I$(top_srcdir)/intl -I$(top_srcdir)/common
include $(top_srcdir)/am/cmacros.am include $(top_srcdir)/am/cmacros.am
# avoid linking against Pth if we are using OpenSC.
if HAVE_OPENSC
pth_libs =
else
pth_libs = $(PTH_LIBS)
endif
AM_CFLAGS = $(OPENSC_CFLAGS) $(LIBGCRYPT_CFLAGS) \ AM_CFLAGS = $(OPENSC_CFLAGS) $(LIBGCRYPT_CFLAGS) \
$(KSBA_CFLAGS) $(LIBASSUAN_CFLAGS) $(PTH_CFLAGS) $(KSBA_CFLAGS) $(LIBASSUAN_CFLAGS) $(PTH_CFLAGS)
@ -44,9 +51,9 @@ scdaemon_SOURCES = \
scdaemon_LDADD = ../jnlib/libjnlib.a ../common/libcommon.a \ scdaemon_LDADD = ../jnlib/libjnlib.a ../common/libcommon.a \
$(OPENSC_LIBS) $(LIBGCRYPT_LIBS) $(PTH_LIBS) \ $(LIBGCRYPT_LIBS) $(pth_libs) \
$(KSBA_LIBS) $(LIBASSUAN_LIBS) \ $(KSBA_LIBS) $(LIBASSUAN_LIBS) \
$(LIBUSB_LIBS) -lgpg-error @INTLLIBS@ -ldl $(LIBUSB_LIBS) $(OPENSC_LIBS) -lgpg-error @INTLLIBS@ -ldl
sc_investigate_SOURCES = \ sc_investigate_SOURCES = \
sc-investigate.c scdaemon.h \ sc-investigate.c scdaemon.h \
@ -59,8 +66,8 @@ sc_investigate_SOURCES = \
sc_investigate_LDADD = \ sc_investigate_LDADD = \
../jnlib/libjnlib.a ../common/libcommon.a \ ../jnlib/libjnlib.a ../common/libcommon.a \
$(OPENSC_LIBS) $(LIBGCRYPT_LIBS) $(PTH_LIBS) \ $(LIBGCRYPT_LIBS) $(pth_libs) \
$(KSBA_LIBS) $(LIBUSB_LIBS) \ $(KSBA_LIBS) $(LIBUSB_LIBS) $(OPENSC_LIBS) \
@INTLLIBS@ -lgpg-error -ldl @INTLLIBS@ -lgpg-error -ldl
@ -76,8 +83,8 @@ sc_copykeys_SOURCES = \
sc_copykeys_LDADD = \ sc_copykeys_LDADD = \
../jnlib/libjnlib.a ../common/libcommon.a \ ../jnlib/libjnlib.a ../common/libcommon.a \
../common/libsimple-pwquery.a \ ../common/libsimple-pwquery.a \
$(OPENSC_LIBS) $(LIBGCRYPT_LIBS) $(PTH_LIBS) \ $(LIBGCRYPT_LIBS) $(pth_libs) \
$(KSBA_LIBS) $(LIBUSB_LIBS) \ $(KSBA_LIBS) $(LIBUSB_LIBS) $(OPENSC_LIBS) \
-lgpg-error @INTLLIBS@ -ldl -lgpg-error @INTLLIBS@ -ldl
pcsc_wrapper_SOURCES = pcsc-wrapper.c pcsc_wrapper_SOURCES = pcsc-wrapper.c

View File

@ -19,6 +19,7 @@
*/ */
#include <config.h> #include <config.h>
#include <errno.h> #include <errno.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
@ -31,6 +32,9 @@
#endif #endif
#ifdef HAVE_OPENSC #ifdef HAVE_OPENSC
# include <opensc/opensc.h> # include <opensc/opensc.h>
# ifdef USE_GNU_PTH
# undef USE_GNU_PTH
# endif
#endif #endif
/* If requested include the definitions for the remote APDU protocol /* If requested include the definitions for the remote APDU protocol

View File

@ -90,12 +90,12 @@ static ARGPARSE_OPTS opts[] = {
{0} {0}
}; };
#ifndef HAVE_OPENSC
#ifdef USE_GNU_PTH #ifdef USE_GNU_PTH
/* Pth wrapper function definitions. */ /* Pth wrapper function definitions. */
GCRY_THREAD_OPTION_PTH_IMPL; GCRY_THREAD_OPTION_PTH_IMPL;
#endif /*USE_GNU_PTH*/ #endif /*USE_GNU_PTH*/
#endif /*!HAVE_OPENSC*/
static void interactive_shell (int slot); static void interactive_shell (int slot);
static void dump_other_cards (int slot); static void dump_other_cards (int slot);
@ -160,8 +160,10 @@ main (int argc, char **argv )
/* Try to auto set the character set. */ /* Try to auto set the character set. */
set_native_charset (NULL); set_native_charset (NULL);
/* Libgcrypt requires us to register the threading model first. /* Libgcrypt requires us to register the threading model first. We
Note that this will also do the pth_init. */ can't use pth at all if we are using OpenSC becuase OpenSC uses
ptreads. Note that this will also do the pth_init. */
#ifndef HAVE_OPENSC
#ifdef USE_GNU_PTH #ifdef USE_GNU_PTH
rc = gcry_control (GCRYCTL_SET_THREAD_CBS, &gcry_threads_pth); rc = gcry_control (GCRYCTL_SET_THREAD_CBS, &gcry_threads_pth);
if (rc) if (rc)
@ -170,6 +172,7 @@ main (int argc, char **argv )
gpg_strerror (rc)); gpg_strerror (rc));
} }
#endif /*USE_GNU_PTH*/ #endif /*USE_GNU_PTH*/
#endif /*!HAVE_OPENSC*/
/* Check that the libraries are suitable. Do it here because /* Check that the libraries are suitable. Do it here because
the option parsing may need services of the library */ the option parsing may need services of the library */

View File

@ -144,13 +144,14 @@ static int maybe_setuid = 1;
static char socket_name[128]; static char socket_name[128];
#ifndef HAVE_OPENSC
#ifdef USE_GNU_PTH #ifdef USE_GNU_PTH
/* Pth wrapper function definitions. */ /* Pth wrapper function definitions. */
GCRY_THREAD_OPTION_PTH_IMPL; GCRY_THREAD_OPTION_PTH_IMPL;
static void *ticker_thread (void *arg); static void *ticker_thread (void *arg);
#endif /*USE_GNU_PTH*/ #endif /*USE_GNU_PTH*/
#endif /*!HAVE_OPENSC*/
static const char * static const char *
my_strusage (int level) my_strusage (int level)
@ -336,6 +337,7 @@ main (int argc, char **argv )
/* Libgcrypt requires us to register the threading model first. /* Libgcrypt requires us to register the threading model first.
Note that this will also do the pth_init. */ Note that this will also do the pth_init. */
#ifndef HAVE_OPENSC
#ifdef USE_GNU_PTH #ifdef USE_GNU_PTH
err = gcry_control (GCRYCTL_SET_THREAD_CBS, &gcry_threads_pth); err = gcry_control (GCRYCTL_SET_THREAD_CBS, &gcry_threads_pth);
if (err) if (err)
@ -344,6 +346,7 @@ main (int argc, char **argv )
gpg_strerror (err)); gpg_strerror (err));
} }
#endif /*USE_GNU_PTH*/ #endif /*USE_GNU_PTH*/
#endif /*!HAVE_OPENSC*/
/* Check that the libraries are suitable. Do it here because /* Check that the libraries are suitable. Do it here because
the option parsing may need services of the library */ the option parsing may need services of the library */
@ -598,6 +601,7 @@ main (int argc, char **argv )
if (pipe_server) if (pipe_server)
{ /* This is the simple pipe based server */ { /* This is the simple pipe based server */
#ifndef HAVE_OPENSC
#ifdef USE_GNU_PTH #ifdef USE_GNU_PTH
pth_attr_t tattr; pth_attr_t tattr;
@ -612,6 +616,7 @@ main (int argc, char **argv )
scd_exit (2); scd_exit (2);
} }
#endif /*USE_GNU_PTH*/ #endif /*USE_GNU_PTH*/
#endif /*!HAVE_OPENSC*/
scd_command_handler (-1); scd_command_handler (-1);
} }
else if (!is_daemon) else if (!is_daemon)
@ -827,6 +832,7 @@ scd_init_default_ctrl (CTRL ctrl)
} }
#ifndef HAVE_OPENSC
#ifdef USE_GNU_PTH #ifdef USE_GNU_PTH
static void static void
@ -931,3 +937,4 @@ ticker_thread (void *dummy_arg)
pth_event_free (sigs_ev, PTH_FREE_ALL); pth_event_free (sigs_ev, PTH_FREE_ALL);
} }
#endif /*USE_GNU_PTH*/ #endif /*USE_GNU_PTH*/
#endif /*!HAVE_OPENSC*/