Monday, June 15, 2009

Building GnuTLS 2.10.5 for Win32

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.




  1. Zlib


    Although zlib is optional for GnuTLS, you can compile zlib as in this post.



  2. libgpg-error 1.10


    Compile libgpg-error:


    ./configure --prefix=/mingw --enable-static
    make
    make install


  3. libgcrypt 1.5.0


    Compile libgcrypt:


    ./configure --prefix=/mingw --enable-static
    make
    make install


  4. libtasn1 2.13


    Compile libtasn1:


    ./configure --prefix=/mingw
    make
    make install


  5. GnuTLS 2.10.5


    Build GNUtls:


    ./configure --prefix=/mingw --disable-guile --enable-static
    make
    make install



Building GnuTLS 3.0.22



  1. zlib


    First, compile zlib as shown in this post.

  2. GMP


    Download the pre-compiled GMP library from MinGW and install it.



  3. Nettle


    Then, compile nettle:


    ./configure --prefix=/mingw && make && make install


  4. libtasn1


    Compile libtasn1:


    ./configure --prefix=/mingw
    make
    make install


  5. gnutls 3.0.20


    Then, build gnutls:


    ./configure --prefix=/mingw --enable-static -enable-threads=win32 --disable-guile --disable-nls
    make
    make install


4 comments:

  1. as of now ibgpg-error and libgcrypt require --enable-static flag to configure, otherwise GnuTLS will complain about not finding static versions of each.

    ReplyDelete
  2. Furthermore, if you get undefined reference to to getaddrinfo(), ect (socket stuff), make sure to add

    #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

    ReplyDelete
  3. PS: Formating error, that should have been

    #include stdio.h
    #include ws2tcpip.h
    #include winsock.h
    #include winsock2.h

    (Add brackets!)

    ReplyDelete
  4. 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

About This Blog

KBlog logo This blog seeks to provide a collection of interesting pictures found on the Web. Thanks for visiting the blog and posting your comments.

© Contents by KBlog

© Blogger template by Emporium Digital 2008

Followers

Total Pageviews

Powered By Blogger