[Pkg-gnupg-commit] [gnupg2] 142/205: w32: Replace libiconv DLL by iconv feature of libgpg-error.

Daniel Kahn Gillmor dkg at fifthhorseman.net
Wed May 11 08:38:30 UTC 2016


This is an automated email from the git hooks/post-receive script.

dkg pushed a commit to branch experimental
in repository gnupg2.

commit bd4d65615b3a5360d455b99e77bd113ad90f1539
Author: Werner Koch <wk at gnupg.org>
Date:   Thu Apr 21 09:17:11 2016 +0200

    w32: Replace libiconv DLL by iconv feature of libgpg-error.
    
    * configure.ac: Do nor require libiconv for W32.
    * common/utf8conv.c [W32]: Do not incluce iconv.h.  Request
    libgpg-error iconv macros.
    (jnlib_iconv): Use ICONV_CONST macro.
    * build-aux/speedo/w32/inst.nsi [!WITH_GUI]: Do not install libiconv.
    * build-aux/speedo.mk (speedo_spkgs) [!WITH_GUI]: Likewise.
    
    Signed-off-by: Werner Koch <wk at gnupg.org>
---
 build-aux/speedo.mk           |  4 ++--
 build-aux/speedo/w32/inst.nsi | 18 +++++++++---------
 common/utf8conv.c             | 16 ++++++++++++----
 configure.ac                  |  4 +++-
 4 files changed, 26 insertions(+), 16 deletions(-)

diff --git a/build-aux/speedo.mk b/build-aux/speedo.mk
index 7b29025..2812773 100644
--- a/build-aux/speedo.mk
+++ b/build-aux/speedo.mk
@@ -172,9 +172,9 @@ speedo_spkgs  = \
 
 ifeq ($(TARGETOS),w32)
 speedo_spkgs += \
-	zlib bzip2 adns sqlite libiconv
+	zlib bzip2 adns sqlite
 ifeq ($(WITH_GUI),1)
-speedo_spkgs += gettext
+speedo_spkgs += gettext libiconv
 endif
 endif
 
diff --git a/build-aux/speedo/w32/inst.nsi b/build-aux/speedo/w32/inst.nsi
index a695d99..3a2d582 100644
--- a/build-aux/speedo/w32/inst.nsi
+++ b/build-aux/speedo/w32/inst.nsi
@@ -633,11 +633,6 @@ Section "-libgpg-error" SEC_libgpg_error
   File include/gpg-error.h
 SectionEnd
 
-Section "-libiconv" SEC_libiconv
-  SetOutPath "$INSTDIR\bin"
-  File bin/libiconv-2.dll
-SectionEnd
-
 Section "-zlib" SEC_zlib
   SetOutPath "$INSTDIR\bin"
   File bin/zlib1.dll
@@ -701,6 +696,11 @@ Section "-gpgme" SEC_gpgme
 SectionEnd
 
 !ifdef WITH_GUI
+Section "-libiconv" SEC_libiconv
+  SetOutPath "$INSTDIR\bin"
+  File bin/libiconv-2.dll
+SectionEnd
+
 Section "-gettext" SEC_gettext
   SetOutPath "$INSTDIR\bin"
   File bin/libintl-8.dll
@@ -1054,6 +1054,10 @@ Section "-un.gettext"
   Delete "$INSTDIR\bin\libintl-8.dll"
 SectionEnd
 
+Section "-un.libiconv"
+  Delete "$INSTDIR\bin\libiconv-2.dll"
+SectionEnd
+
 Section "-un.gpgme"
   Delete "$INSTDIR\bin\libgpgme-11.dll"
   Delete "$INSTDIR\bin\libgpgme-glib-11.dll"
@@ -1097,10 +1101,6 @@ Section "-un.zlib"
   Delete "$INSTDIR\bin\zlib1.dll"
 SectionEnd
 
-Section "-un.libiconv"
-  Delete "$INSTDIR\bin\libiconv-2.dll"
-SectionEnd
-
 Section "-un.libgpg-error"
   Delete "$INSTDIR\bin\libgpg-error-0.dll"
   Delete "$INSTDIR\lib\libgpg-error.imp"
diff --git a/common/utf8conv.c b/common/utf8conv.c
index 8a2cf8a..83e6eae 100644
--- a/common/utf8conv.c
+++ b/common/utf8conv.c
@@ -38,10 +38,17 @@
 #include <langinfo.h>
 #endif
 #include <errno.h>
-#ifndef HAVE_ANDROID_SYSTEM
+
+#if HAVE_W32_SYSTEM
+# /* Tell libgpg-error to provide the iconv macros.  */
+# define GPGRT_ENABLE_W32_ICONV_MACROS 1
+#elif HAVE_ANDROID_SYSTEM
+# /* No iconv support.  */
+#else
 # include <iconv.h>
 #endif
 
+
 #include "util.h"
 #include "common-defs.h"
 #include "i18n.h"
@@ -244,8 +251,8 @@ set_native_charset (const char *newset)
      as Latin-1.  This makes sense because many Unix system don't have
      their locale set up properly and thus would get annoying error
      messages and we have to handle all the "bug" reports. Latin-1 has
-     always been the character set used for 8 bit characters on Unix
-     systems. */
+     traditionally been the character set used for 8 bit characters on
+     Unix systems. */
   if ( !*newset
        || !ascii_strcasecmp (newset, "8859-1" )
        || !ascii_strcasecmp (newset, "646" )
@@ -700,7 +707,8 @@ jnlib_iconv (jnlib_iconv_t cd,
              const char **inbuf, size_t *inbytesleft,
              char **outbuf, size_t *outbytesleft)
 {
-  return iconv ((iconv_t)cd, (char**)inbuf, inbytesleft, outbuf, outbytesleft);
+  return iconv ((iconv_t)cd, (ICONV_CONST char**)inbuf, inbytesleft,
+                outbuf, outbytesleft);
 }
 
 /* Wrapper function for iconv_close, required for W32 as we dlopen that
diff --git a/configure.ac b/configure.ac
index d959fc5..6bbb41f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -47,8 +47,9 @@ m4_define([mym4_version],      m4_argn(4, mym4_verslist))
 m4_define([mym4_revision],     m4_argn(7, mym4_verslist))
 m4_define([mym4_revision_dec], m4_argn(8, mym4_verslist))
 m4_esyscmd([echo ]mym4_version[>VERSION])
-AC_INIT([mym4_package],[mym4_version], [http://bugs.gnupg.org])
+AC_INIT([mym4_package],[mym4_version], [https://bugs.gnupg.org])
 
+# Note that for Windows we require version 1.22
 NEED_GPG_ERROR_VERSION=1.21
 
 NEED_LIBGCRYPT_API=1
@@ -639,6 +640,7 @@ case "${host}" in
                    we use a simplified version of gettext])
         have_dosish_system=yes
         have_w32_system=yes
+        require_iconv=no
         run_tests=no
         use_ldapwrapper=no  # Fixme: Do this only for CE.
         case "${host}" in

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-gnupg/gnupg2.git



More information about the Pkg-gnupg-commit mailing list