[svn] gpg-error - r153 - in trunk: . src

svn author wk cvs at cvs.gnupg.org
Wed Nov 2 11:10:29 CET 2005


Author: wk
Date: 2005-11-02 11:10:28 +0100 (Wed, 02 Nov 2005)
New Revision: 153

Modified:
   trunk/ChangeLog
   trunk/autogen.sh
   trunk/configure.ac
   trunk/src/Makefile.am
   trunk/src/gpg-error.c
   trunk/src/w32-gettext.c
   trunk/src/w32-gettext.h
Log:
Changes for building on W32 without needing libintl.

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2005-10-26 10:48:47 UTC (rev 152)
+++ trunk/ChangeLog	2005-11-02 10:10:28 UTC (rev 153)
@@ -1,3 +1,16 @@
+2005-11-02  Werner Koch  <wk at g10code.com>
+
+	* src/Makefile.am (gpg_error_SOURCES): Include ARCH_SOURCES.
+	* src/gpg-error.c [W32]: Include gettext.h instead of libintl.h.
+
+	* configure.ac (AH_BOTTOM): Define ENABLE_NLS for W32 builds.
+	* src/w32-gettext.h (dgettext): Changed prototype from
+	libintl_dgettext.
+	* src/w32-gettext.c: Replaced use of WIN32 by HAVE_W32_SYSTEM on
+	demand of the holy GNUquisition.
+	(bindtextdomain, textdomain, dgettext): Need to cast the const way
+	from the return value.
+
 2005-10-26  Werner Koch  <wk at g10code.com>
 
 	* Makefile.am: Used dist-bzip2 option.

Modified: trunk/autogen.sh
===================================================================
--- trunk/autogen.sh	2005-10-26 10:48:47 UTC (rev 152)
+++ trunk/autogen.sh	2005-11-02 10:10:28 UTC (rev 153)
@@ -74,8 +74,7 @@
     fi
 
     ./configure --enable-maintainer-mode  --prefix=${w32root}  \
-            --host=i586-mingw32msvc --build=${build} \
-            --disable-shared
+            --host=i586-mingw32msvc --build=${build} 
 
     exit $?
 fi

Modified: trunk/configure.ac
===================================================================
--- trunk/configure.ac	2005-10-26 10:48:47 UTC (rev 152)
+++ trunk/configure.ac	2005-11-02 10:10:28 UTC (rev 153)
@@ -80,8 +80,15 @@
 esac
 
 
-# Checks for libraries.
+AH_BOTTOM([
+/* Force using of NLS for W32 even if no libintl has been found.  This is 
+   okay because we have our own gettext implementation for W32.  */
+#if defined(HAVE_W32_SYSTEM) && !defined(ENABLE_NLS)
+#define ENABLE_NLS 1
+#endif
+])
 
+
 # Note, that autogen.sh greps for the next line.
 AM_GNU_GETTEXT_VERSION(0.12.1)
 AM_GNU_GETTEXT([external])

Modified: trunk/src/Makefile.am
===================================================================
--- trunk/src/Makefile.am	2005-10-26 10:48:47 UTC (rev 152)
+++ trunk/src/Makefile.am	2005-11-02 10:10:28 UTC (rev 153)
@@ -95,7 +95,7 @@
 libgpg_error_la_CPPFLAGS = -DLOCALEDIR=\"$(localedir)\"
 libgpg_error_la_LIBADD = $(intllibs)
 
-gpg_error_SOURCES = strsource-sym.c strerror-sym.c gpg-error.c
+gpg_error_SOURCES = strsource-sym.c strerror-sym.c gpg-error.c $(arch_sources)
 gpg_error_CPPFLAGS = -DLOCALEDIR=\"$(localedir)\"
 gpg_error_LDADD = ./libgpg-error.la @LTLIBINTL@
 

Modified: trunk/src/gpg-error.c
===================================================================
--- trunk/src/gpg-error.c	2005-10-26 10:48:47 UTC (rev 152)
+++ trunk/src/gpg-error.c	2005-11-02 10:10:28 UTC (rev 153)
@@ -33,7 +33,11 @@
 # include <locale.h>	
 #endif
 #ifdef ENABLE_NLS
+#ifdef HAVE_W32_SYSTEM
+# include "gettext.h"
+#else
 # include <libintl.h>
+#endif
 # define _(a) gettext (a)
 # ifdef gettext_noop
 #  define N_(a) gettext_noop (a)

Modified: trunk/src/w32-gettext.c
===================================================================
--- trunk/src/w32-gettext.c	2005-10-26 10:48:47 UTC (rev 152)
+++ trunk/src/w32-gettext.c	2005-11-02 10:10:28 UTC (rev 153)
@@ -70,13 +70,7 @@
 #include <stdlib.h>
 #include <locale.h>
 
-#if defined _WIN32 || defined __WIN32__
-# undef WIN32   /* avoid warning on mingw32 */
-# define WIN32
-#endif
-
-#ifdef WIN32
-# define WIN32_LEAN_AND_MEAN
+#ifdef HAVE_W32_SYSTEM
 # include <windows.h>
 /* List of language codes, sorted by value:
    0x01 LANG_ARABIC
@@ -725,7 +719,7 @@
 # ifndef SUBLANG_UZBEK_CYRILLIC
 # define SUBLANG_UZBEK_CYRILLIC 0x02
 # endif
-#endif
+#endif /* HAVE_W32_SYSTEM */
 
 /* XPG3 defines the result of 'setlocale (category, NULL)' as:
    "Directs 'setlocale()' to query 'category' and return the current
@@ -748,13 +742,13 @@
 {
   const char *retval;
 
-#ifndef WIN32
+#ifndef HAVE_W32_SYSTEM
 
   /* Use the POSIX methods of looking to 'LC_ALL', 'LC_xxx', and 'LANG'.
      On some systems this can be done by the 'setlocale' function itself.  */
 # if defined HAVE_SETLOCALE && defined HAVE_LC_MESSAGES && defined HAVE_LOCALE_NULL
   retval = setlocale (category, NULL);
-# else
+# else 
   /* Setting of LC_ALL overwrites all other.  */
   retval = getenv ("LC_ALL");
   if (retval == NULL || retval[0] == '\0')
@@ -775,7 +769,7 @@
 
   return retval;
 
-#else /* WIN32 */
+#else /* HAVE_W32_SYSTEM */
 
   /* Return an XPG style locale name language[_territory][@modifier].
      Don't even bother determining the codeset; it's not useful in this
@@ -1185,7 +1179,7 @@
     default: return "C";
     }
 
-#endif
+#endif /* HAVE_W32_SYSTEM */
 }
 
 /* localname.c from gettext END.  */
@@ -1617,7 +1611,9 @@
   if (the_domain)
     free_domain (the_domain);
   the_domain = domain;
-  return dirname;
+
+  /* For historic reasoins we are not allowed to return a const char*. */
+  return (char*)dirname;
 }
 
 
@@ -1705,12 +1701,12 @@
 textdomain (const char *domainname)
 {
   /* For now, support only one domain.  */
-  return domainname;
+  return (char*)domainname;
 }
 
 char *
 dgettext (const char *domainname, const char *msgid)
 {
   /* For now, support only one domain.  */
-  return gettext (msgid);
+  return (char*)gettext (msgid);
 }

Modified: trunk/src/w32-gettext.h
===================================================================
--- trunk/src/w32-gettext.h	2005-10-26 10:48:47 UTC (rev 152)
+++ trunk/src/w32-gettext.h	2005-11-02 10:10:28 UTC (rev 153)
@@ -49,6 +49,6 @@
 
 char *textdomain (const char *domainname);
 
-char *libintl_dgettext (const char *domainname, const char *msgid);
+char *dgettext (const char *domainname, const char *msgid);
 
 #endif	/* ENABLE_NLS */




More information about the Gnupg-commits mailing list