Mailing List Archive

Build failure on MinGW32 with libgpg-error 1.5
Hi! I discovered and solved this problem some time ago, and may have
reported it but I couldn't find the report now. So in case I never
reported it, or if it was forgotten, here is a complete report. In case
I reported this and my suggested patch was incorrect, perhaps we could
restart any old discussion.

Building libgpg-error 1.5 under mingw32 on a debian machine fails:

$ tar xfj libgpg-error-1.5.tar.bz2
$ cd libgpg-error-1.5
$ ./configure --host=i586-mingw32msvc --build=i686-pc-linux-gnu && make
...
make[3]: Entering directory `/home/jas/gnutls4win/dist/libgpg-error-1.5/src'
if /bin/sh ../libtool --tag=CC --mode=compile i586-mingw32msvc-gcc -DHAVE_CONFIG_H -I. -I. -I.. -DLOCALEDIR=\"/usr/local/share/locale\" -g -O2 -MT libgpg_error_la-w32-gettext.lo -MD -MP -MF ".deps/libgpg_error_la-w32-gettext.Tpo" -c -o libgpg_error_la-w32-gettext.lo `test -f 'w32-gettext.c' || echo './'`w32-gettext.c; \
then mv -f ".deps/libgpg_error_la-w32-gettext.Tpo" ".deps/libgpg_error_la-w32-gettext.Plo"; else rm -f ".deps/libgpg_error_la-w32-gettext.Tpo"; exit 1; fi
i586-mingw32msvc-gcc -DHAVE_CONFIG_H -I. -I. -I.. -DLOCALEDIR=\"/usr/local/share/locale\" -g -O2 -MT libgpg_error_la-w32-gettext.lo -MD -MP -MF .deps/libgpg_error_la-w32-gettext.Tpo -c w32-gettext.c -DDLL_EXPORT -DPIC -o .libs/libgpg_error_la-w32-gettext.o
w32-gettext.c: In function '_nl_locale_name':
w32-gettext.c:851: error: duplicate case value
w32-gettext.c:850: error: previously used here
w32-gettext.c:1059: error: duplicate case value
w32-gettext.c:1058: error: previously used here
w32-gettext.c:1067: error: duplicate case value
w32-gettext.c:1066: error: previously used here
make[3]: *** [libgpg_error_la-w32-gettext.lo] Error 1
make[3]: Leaving directory `/home/jas/gnutls4win/dist/libgpg-error-1.5/src'

The relevant code (line ~850) reads:

switch (sub)
{
case SUBLANG_BENGALI_INDIA: return "bn_IN";
case SUBLANG_BENGALI_BANGLADESH: return "bn_BD";
}

The reason is that the system headers declare one of the symbols:

jas@mocca:~$ grep SUBLANG_BENGALI /usr/i586-mingw32msvc/include/*
/usr/i586-mingw32msvc/include/winnt.h:#define SUBLANG_BENGALI_INDIA 0x01
jas@mocca:~$

And w32-gettext.c declares the other symbol:

# ifndef SUBLANG_BENGALI_INDIA
# define SUBLANG_BENGALI_INDIA 0x00
# endif
# ifndef SUBLANG_BENGALI_BANGLADESH
# define SUBLANG_BENGALI_BANGLADESH 0x01
# endif

I'm using the patch below to solve this. What do you think?

--- src/libgpg-error-1.5/src/w32-gettext.c.orig 2007-06-27 12:40:37.000000000 +0200
+++ src/libgpg-error-1.5/src/w32-gettext.c 2007-06-27 12:41:11.000000000 +0200
@@ -522,10 +522,10 @@
# define SUBLANG_AZERI_CYRILLIC 0x02
# endif
# ifndef SUBLANG_BENGALI_INDIA
-# define SUBLANG_BENGALI_INDIA 0x00
+# define SUBLANG_BENGALI_INDIA 0x01
# endif
# ifndef SUBLANG_BENGALI_BANGLADESH
-# define SUBLANG_BENGALI_BANGLADESH 0x01
+# define SUBLANG_BENGALI_BANGLADESH 0x00
# endif
# ifndef SUBLANG_CHINESE_MACAU
# define SUBLANG_CHINESE_MACAU 0x05
@@ -618,16 +618,16 @@
# define SUBLANG_NEPALI_INDIA 0x02
# endif
# ifndef SUBLANG_PUNJABI_INDIA
-# define SUBLANG_PUNJABI_INDIA 0x00
+# define SUBLANG_PUNJABI_INDIA 0x01
# endif
# ifndef SUBLANG_PUNJABI_PAKISTAN
-# define SUBLANG_PUNJABI_PAKISTAN 0x01
+# define SUBLANG_PUNJABI_PAKISTAN 0x00
# endif
# ifndef SUBLANG_ROMANIAN_ROMANIA
-# define SUBLANG_ROMANIAN_ROMANIA 0x00
+# define SUBLANG_ROMANIAN_ROMANIA 0x01
# endif
# ifndef SUBLANG_ROMANIAN_MOLDOVA
-# define SUBLANG_ROMANIAN_MOLDOVA 0x01
+# define SUBLANG_ROMANIAN_MOLDOVA 0x00
# endif
# ifndef SUBLANG_SERBIAN_LATIN
# define SUBLANG_SERBIAN_LATIN 0x02

Thanks,
Simon

_______________________________________________
Gcrypt-devel mailing list
Gcrypt-devel@gnupg.org
http://lists.gnupg.org/mailman/listinfo/gcrypt-devel
Re: Build failure on MinGW32 with libgpg-error 1.5 [ In reply to ]
On Sat, 27 Oct 2007 23:02, simon@josefsson.org said:

> reported it but I couldn't find the report now. So in case I never
> reported it, or if it was forgotten, here is a complete report. In case
> I reported this and my suggested patch was incorrect, perhaps we could
> restart any old discussion.

Thanks.

I another project (GpgOL) I applied this fix:

2007-08-21 Werner Koch <wk@g10code.com>

* w32-gettext.c (SUBLANG_BENGALI_BANGLADESH): Fix to 2 as per MSDN.
(SUBLANG_PUNJABI_PAKISTAN): Remove as it is not in MSDN.
(SUBLANG_ROMANIAN_MOLDOVA): Remove as it is not in MSDN.
(SUBLANG_ROMANIAN_ROMANIA): Change to value 1 as per MSDN.

The diff towards libgpg-error is:

@@ -522,10 +521,10 @@
# define SUBLANG_AZERI_CYRILLIC 0x02
# endif
# ifndef SUBLANG_BENGALI_INDIA
-# define SUBLANG_BENGALI_INDIA 0x00
+# define SUBLANG_BENGALI_INDIA 0x01
# endif
# ifndef SUBLANG_BENGALI_BANGLADESH
-# define SUBLANG_BENGALI_BANGLADESH 0x01
+# define SUBLANG_BENGALI_BANGLADESH 0x02
# endif
# ifndef SUBLANG_CHINESE_MACAU
# define SUBLANG_CHINESE_MACAU 0x05
@@ -618,16 +617,10 @@
# define SUBLANG_NEPALI_INDIA 0x02
# endif
# ifndef SUBLANG_PUNJABI_INDIA
-# define SUBLANG_PUNJABI_INDIA 0x00
-# endif
-# ifndef SUBLANG_PUNJABI_PAKISTAN
-# define SUBLANG_PUNJABI_PAKISTAN 0x01
+# define SUBLANG_PUNJABI_INDIA 0x01
# endif
# ifndef SUBLANG_ROMANIAN_ROMANIA
-# define SUBLANG_ROMANIAN_ROMANIA 0x00
-# endif
-# ifndef SUBLANG_ROMANIAN_MOLDOVA
-# define SUBLANG_ROMANIAN_MOLDOVA 0x01
+# define SUBLANG_ROMANIAN_ROMANIA 0x01
# endif
# ifndef SUBLANG_SERBIAN_LATIN
# define SUBLANG_SERBIAN_LATIN 0x02
@@ -1056,7 +1049,6 @@
switch (sub)
{
case SUBLANG_PUNJABI_INDIA: return "pa_IN"; /* Gurmukhi script */
- case SUBLANG_PUNJABI_PAKISTAN: return "pa_PK"; /* Arabic script */
}
return "pa";
case LANG_RHAETO_ROMANCE: return "rm_CH";
@@ -1064,7 +1056,6 @@
switch (sub)
{
case SUBLANG_ROMANIAN_ROMANIA: return "ro_RO";
- case SUBLANG_ROMANIAN_MOLDOVA: return "ro_MD";
}
return "ro";
case LANG_RUSSIAN:

I'll apply that to libgpg-error and see whether I can do a release
today.


Shalom-Salam,

Werner


--
Die Gedanken sind frei. Auschnahme regelt ein Bundeschgesetz.


_______________________________________________
Gcrypt-devel mailing list
Gcrypt-devel@gnupg.org
http://lists.gnupg.org/mailman/listinfo/gcrypt-devel
Re: Build failure on MinGW32 with libgpg-error 1.5 [ In reply to ]
On Sat, 27 Oct 2007 23:02, simon@josefsson.org said:

> Building libgpg-error 1.5 under mingw32 on a debian machine fails:

Given that I was not able to reproduce the problem on my machines [1],
I'd appreciate if you can do a test build of:

ftp://ftp.g10code.com/g10code/scratch/libgpg-error-1.6-svn200.tar.bz2

f38767b1ad247d8668b8369b906027b4ac435b90 libgpg-error-1.6-svn200.tar.bz2



Shalom-Salam,

Werner


[1] I have not yet updated mingw to the Sid's current version.

--
Die Gedanken sind frei. Auschnahme regelt ein Bundeschgesetz.


_______________________________________________
Gcrypt-devel mailing list
Gcrypt-devel@gnupg.org
http://lists.gnupg.org/mailman/listinfo/gcrypt-devel
Re: Build failure on MinGW32 with libgpg-error 1.5 [ In reply to ]
Werner Koch <wk@gnupg.org> writes:

> On Sat, 27 Oct 2007 23:02, simon@josefsson.org said:
>
>> Building libgpg-error 1.5 under mingw32 on a debian machine fails:
>
> Given that I was not able to reproduce the problem on my machines [1],
> I'd appreciate if you can do a test build of:
>
> ftp://ftp.g10code.com/g10code/scratch/libgpg-error-1.6-svn200.tar.bz2
>
> f38767b1ad247d8668b8369b906027b4ac435b90 libgpg-error-1.6-svn200.tar.bz2

It seems to work.

> [1] I have not yet updated mingw to the Sid's current version.

I started to get the problem in the last few months, after doing a mingw
upgrade.

Thanks,
Simon

_______________________________________________
Gcrypt-devel mailing list
Gcrypt-devel@gnupg.org
http://lists.gnupg.org/mailman/listinfo/gcrypt-devel
Re: Build failure on MinGW32 with libgpg-error 1.5 [ In reply to ]
On Mon, 29 Oct 2007 15:39, simon@josefsson.org said:

>> [1] I have not yet updated mingw to the Sid's current version.
>
> I started to get the problem in the last few months, after doing a mingw
> upgrade.

Yeah, I fear the next update :-(. It will lead to a lot of work and
testing to keep support with the previous version.


Shalom-Salam,

Werner


--
Die Gedanken sind frei. Auschnahme regelt ein Bundeschgesetz.


_______________________________________________
Gcrypt-devel mailing list
Gcrypt-devel@gnupg.org
http://lists.gnupg.org/mailman/listinfo/gcrypt-devel