From 8f620c8c2c9a283e74c0cf75f348bfc929117d72 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Mon, 6 Dec 2004 13:49:14 +0000 Subject: [PATCH] * configure.ac (have_w32_system): New. Disable Pth checks for W32. Link jnlib/w32-pth.h to pth.h. * Makefile.am (pkglib_PROGRAMS): Build only for W32. * keydb.c: Don't define DIRSEP_S here. --- ChangeLog | 5 +++++ NEWS | 2 +- build-w32.sh | 19 ++++++++++++------- configure.ac | 40 ++++++++++++++++++++++++++++------------ jnlib/w32-pth.h | 29 +++++++++++++++++++++++++++++ scd/ChangeLog | 4 ++++ scd/Makefile.am | 2 ++ sm/ChangeLog | 4 ++++ sm/keydb.c | 2 -- 9 files changed, 85 insertions(+), 22 deletions(-) create mode 100644 jnlib/w32-pth.h diff --git a/ChangeLog b/ChangeLog index 6dbe8663f..d290c9481 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2004-12-06 Werner Koch + + * configure.ac (have_w32_system): New. Disable Pth checks for W32. + Link jnlib/w32-pth.h to pth.h. + 2004-12-03 Werner Koch Released 1.9.13. diff --git a/NEWS b/NEWS index 18f84ed1c..0d0a7058f 100644 --- a/NEWS +++ b/NEWS @@ -7,7 +7,7 @@ Noteworthy changes in version 1.9.13 (2004-12-03) * [gpgsm] New option --prefer-system-dirmngr. - * Minor cleanups and debbuging aids. + * Minor cleanups and debugging aids. Noteworthy changes in version 1.9.12 (2004-10-22) diff --git a/build-w32.sh b/build-w32.sh index c9ea984dc..0983012aa 100644 --- a/build-w32.sh +++ b/build-w32.sh @@ -1,10 +1,15 @@ - ./configure --enable-maintainer-mode --prefix=/home/wk/w32root \ +#!/bin/sh + +[ -z "$w32root" ] && w32root="$HOME/w32root" + + ./configure --enable-maintainer-mode --prefix=${w32root} \ --host=i586-mingw32msvc --build=`scripts/config.guess` \ - --with-gpg-error-prefix=/home/wk/w32root \ - --with-ksba-prefix=/home/wk/w32root \ - --with-libgcrypt-prefix=/home/wk/w32root \ - --with-libassuan-prefix=/home/wk/w32root \ - --with-zlib=/home/wk/w32root - + --with-gpg-error-prefix=${w32root} \ + --with-ksba-prefix=${w32root} \ + --with-libgcrypt-prefix=${w32root} \ + --with-libassuan-prefix=${w32root} \ + --with-zlib=${w32root} \ + --with-pth-prefix=${w32root} + diff --git a/configure.ac b/configure.ac index 25446a04a..2b5d21a23 100644 --- a/configure.ac +++ b/configure.ac @@ -141,7 +141,7 @@ AC_ARG_ENABLE(agent-only, build_agent_only=$enableval) -# Configure option to allow ot disallow execution of external +# Configure option to allow or disallow execution of external # programs, like a photo viewer. AC_MSG_CHECKING([whether to enable external program execution]) AC_ARG_ENABLE(exec, @@ -343,6 +343,7 @@ GNUPG_CHECK_DOCBOOK_TO_TEXI try_gettext=yes have_dosish_system=no +have_w32_system=no case "${host}" in *-*-mingw32*) # special stuff for Windoze NT @@ -356,6 +357,7 @@ case "${host}" in MingW32 systems and these systems lack Posix functions, we use a simplified version of gettext]) have_dosish_system=yes + have_w32_system=yes try_gettext="no" ;; i?86-emx-os2 | i?86-*-os2*emx ) @@ -409,12 +411,18 @@ esac if test "$have_dosish_system" = yes; then AC_DEFINE(HAVE_DOSISH_SYSTEM,1, - [defined if we run on some of the PCDOS like systems + [Defined if we run on some of the PCDOS like systems (DOS, Windoze. OS/2) with special properties like no file modes]) fi AM_CONDITIONAL(HAVE_DOSISH_SYSTEM, test "$have_dosish_system" = yes) +if test "$have_w32_system" = yes; then + AC_DEFINE(HAVE_W32_SYSTEM,1, [Defined if we run on a W32 API based system]) +fi +AM_CONDITIONAL(HAVE_W32_SYSTEM, test "$have_w32_system" = yes) + + # # Checks for libraries. @@ -480,6 +488,7 @@ AM_CONDITIONAL(HAVE_OPENSC, test "$have_opensc" = "yes") # # Check whether the (highly desirable) GNU Pth library is available +# Note, that we include a Pth emulation for W32. # AC_ARG_WITH(pth-prefix, AC_HELP_STRING([--with-pth-prefix=PFX], @@ -489,7 +498,8 @@ if test x$pth_config_prefix != x ; then PTH_CONFIG="$pth_config_prefix/bin/pth-config" fi AC_PATH_PROG(PTH_CONFIG, pth-config, no) -if test "$PTH_CONFIG" = "no"; then +if test "$have_w32_system" = no; then + if test "$PTH_CONFIG" = "no"; then AC_MSG_WARN([[ *** *** To support concurrent access to the gpg-agent and the SCdaemon @@ -498,7 +508,7 @@ if test "$PTH_CONFIG" = "no"; then *** On a Debian GNU/Linux system you might want to try *** apt-get install libpth-dev ***]]) -else + else GNUPG_PTH_VERSION_CHECK(1.3.7) if test $have_pth = yes; then PTH_CFLAGS=`$PTH_CONFIG --cflags` @@ -507,6 +517,12 @@ else AC_DEFINE(USE_GNU_PTH, 1, [Defined if the GNU Portable Thread Library should be used]) fi + fi +else + have_pth=yes + PTH_CFLAGS="" + PTH_LIBS="" + AC_DEFINE(USE_GNU_PTH, 1) fi AC_SUBST(PTH_CFLAGS) AC_SUBST(PTH_LIBS) @@ -968,15 +984,11 @@ AM_CONDITIONAL(CROSS_COMPILING, test x$cross_compiling = xyes) GNUPG_CHECK_GNUMAKE -# add some extra libs here so that previous tests don't fail for +# Add some extra libs here so that previous tests don't fail for # mysterious reasons - the final link step should bail out. -case "${host}" in - *-*-mingw32*) - W32LIBS="-lwsock32" - ;; - *) - ;; -esac +if test "$have_w32_system" = yes; then + W32LIBS="-lwsock32" +fi if test "$GCC" = yes; then @@ -996,6 +1008,10 @@ AC_SUBST(W32LIBS) AC_DEFINE(HAVE_JNLIB_LOGGING, 1, [Defined if jnlib style logging functions are available]) +# For W32 we need to use our Pth emulation code +if test "$have_w32_system" = yes; then + AC_CONFIG_LINKS(pth.h:jnlib/w32-pth.h) +fi # diff --git a/jnlib/w32-pth.h b/jnlib/w32-pth.h new file mode 100644 index 000000000..b9c03323f --- /dev/null +++ b/jnlib/w32-pth.h @@ -0,0 +1,29 @@ +/* w32-pth.h - GNU Pth emulation for W32 (MS Windows). + * Copyright (C) 2004 g10 Code GmbH + * + * This file is part of GnuPG. + * + * GnuPG is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * GnuPG is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + */ + +/* Note that this header is usually through a symlinked pth.h file. + This is needed so that we don't have a pth.h file here which would + conflict if a system really has pth available. */ +#ifndef W32_PTH_H +#define W32_PTH_H + + + +#endif /*W32_PTH_H*/ diff --git a/scd/ChangeLog b/scd/ChangeLog index 660865638..628055e80 100644 --- a/scd/ChangeLog +++ b/scd/ChangeLog @@ -1,3 +1,7 @@ +2004-12-06 Werner Koch + + * Makefile.am (pkglib_PROGRAMS): Build only for W32. + 2004-10-22 Werner Koch * app-openpgp.c (verify_chv3): The minium length for CHV3 is diff --git a/scd/Makefile.am b/scd/Makefile.am index 0d83271e0..43bee4889 100644 --- a/scd/Makefile.am +++ b/scd/Makefile.am @@ -19,7 +19,9 @@ ## Process this file with automake to produce Makefile.in bin_PROGRAMS = scdaemon sc-copykeys +if HAVE_W32_SYSTEM pkglib_PROGRAMS = pcsc-wrapper +endif AM_CPPFLAGS = -I$(top_srcdir)/intl -I$(top_srcdir)/common diff --git a/sm/ChangeLog b/sm/ChangeLog index 930584af3..a0d5cc033 100644 --- a/sm/ChangeLog +++ b/sm/ChangeLog @@ -1,3 +1,7 @@ +2004-12-06 Werner Koch + + * keydb.c: Don't define DIRSEP_S here. + 2004-12-02 Werner Koch * certchain.c (gpgsm_basic_cert_check): Dump certs with bad diff --git a/sm/keydb.c b/sm/keydb.c index 6c5c77364..293e5233d 100644 --- a/sm/keydb.c +++ b/sm/keydb.c @@ -33,8 +33,6 @@ #include "keydb.h" #include "i18n.h" -#define DIRSEP_C '/' - static int active_handles; typedef enum {