compiling GnuPG for x86_64-pc-mingw32

Tom Pegios tomp at idirect.com
Mon Dec 31 00:25:16 CET 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

The x86_64-pc-mingw32 (64-bit)  version of GnuPG can be built on MSYS
now but requires 2 changes to the source code.

in configure.ac original is
........................
case "${host}" in
    *-mingw32*)
dnl      NETLIBS="$NETLIBS -lwsock32"
	W32LIBS="-lwsock32"
        ;;
    *)
       ;;
esac
.......................

needs to be changed to
.......................
case "${host}" in
    x86_64-pc-mingw32)
dnl      NETLIBS="$NETLIBS -lws2_32"
	W32LIBS="-lws2_32"
	;;
    *-mingw32*)
dnl      NETLIBS="$NETLIBS -lwsock32"
	W32LIBS="-lwsock32"
        ;;
    *)
       ;;
esac
.......................

libwsock32.a doesn't exist in x86_64-pc-mingw32 but libws2_32.a does and
works.

in util/regcomp.c original is:
...........................
size_t
regerror (errcode, preg, errbuf, errbuf_size)
    int errcode;
    const regex_t *preg;
    char *errbuf;
    size_t errbuf_size;
...............................

needs to be changed to :
...............................
size_t regerror (int errcode, const regex_t *preg, char *errbuf, size_t
errbuf_size)
..............................

this will prevent the following error:
................................
In file included from regex.c:50:
regcomp.c:528: error: expected declaration specifiers or '...' before 'preg'
regcomp.c:528: error: expected declaration specifiers or '...' before
'errbuf'
regcomp.c:528: error: expected declaration specifiers or '...' before
'errbuf_si
ze'
regcomp.c:528: error: conflicting types for 'regerror'
../include/_regex.h:555: error: previous declaration of 'regerror' was here
regcomp.c: In function 'regerror':
regcomp.c:533: error: old-style parameter declarations in prototyped
function definition
regcomp.c:528: error: parameter name omitted
regcomp.c:537: error: expected expression before 'errcode'
regcomp.c:537: error: too few arguments to function '__builtin_expect'
regcomp.c:546: error: expected expression before 'errcode'
regcomp.c:550: error: 'errbuf_size' undeclared (first use in this function)
regcomp.c:550: error: (Each undeclared identifier is reported only once
regcomp.c:550: error: for each function it appears in.)
regcomp.c:557: error: 'errbuf' undeclared (first use in this function)
make[1]: *** [regex.o] Error 1
..................................


If these 2 changes can be included in GnuPG this will allow for a
successful 64-bit build under windows without any file modifications.

Using -lws2_32 instead of -lwsock32 works appears to work on a 32-bit build.
I'm not sure of the differences between the two libs.

Regards
Tom Pegios



-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.8-svn-4660. (x86_64-pc-MingW32)

iEYEAREIAAYFAkd4KNsACgkQxDTq4V42xe4kigCgqu0c2UtjlcF6ugbtsl+1KQBz
f3wAmgOoyYRNdwY1VnXT6gGe1Z0t1jZx
=c9wd
-----END PGP SIGNATURE-----




More information about the Gnupg-devel mailing list