GnuTLS is a library providing network security and used by many open-source software. I am compiling GnuTLS for Windows in order to port open-source software from Linux. GnuTLS depends on the following libraries:
The following commands are meant to be typed in a MSYS terminal. If you don’t understand what MSYS is, follow the instruction in this post to install MinGW first. Then, open a MSYS terminal from the desktop or Start menu.
Zlib
Although zlib is optional for GnuTLS, you can compile zlib as in this post.
libgpg-error 1.10
Compile libgpg-error:
./configure --prefix=/mingw --enable-static
make
make installlibgcrypt 1.5.0
Compile libgcrypt:
./configure --prefix=/mingw --enable-static
make
make installlibtasn1 2.13
Compile libtasn1:
./configure --prefix=/mingw
make
make installGnuTLS 2.10.5
Build GNUtls:
./configure --prefix=/mingw --disable-guile --enable-static
make
make install
Building GnuTLS 3.0.22
zlib
First, compile zlib as shown in this post.
GMP
Download the pre-compiled GMP library from MinGW and install it.
Nettle
Then, compile nettle:
./configure --prefix=/mingw && make && make install
libtasn1
Compile libtasn1:
./configure --prefix=/mingw
make
make installgnutls 3.0.20
Then, build gnutls:
./configure --prefix=/mingw --enable-static -enable-threads=win32 --disable-guile --disable-nls
make
make install
as of now ibgpg-error and libgcrypt require --enable-static flag to configure, otherwise GnuTLS will complain about not finding static versions of each.
ReplyDeleteFurthermore, if you get undefined reference to to getaddrinfo(), ect (socket stuff), make sure to add
ReplyDelete#define _WIN32_WINNT 0x501
#include
#include
#include
#include
to every file that complains while linking. (#define _WIN32_WINNT 0x501 being the important one here!)
AND if you have problems building a shared version --disable-cxx
PS: Formating error, that should have been
ReplyDelete#include stdio.h
#include ws2tcpip.h
#include winsock.h
#include winsock2.h
(Add brackets!)
Thanks for your helpful comments. I haven't compiled gnutls for a long time. Instead, I've been compiling OpenSSL more often. I think both have their own merits.
ReplyDelete