GNUnet
GNU’s decentralized anonymous and censorship-resistant P2P framework.
GNUnet logo  
[English | Afrikaans | Bulgarian | Catalan | Czech | Danish | Dutch | Esperanto | Finnish | French | Galician | German | Hungarian | Italian | Japanese | Polish | Portuguese | Romanian | Russian | Simplified chinese | Slovak | Spanish | Swedish | Traditional chinese | Ukrainian]

Building GNUnet and libextractor on Microsoft Windows 32-bit Platforms

This document is a guide to building GNUnet and libextractor on Windows platforms.

The Windows build uses a UNIX emulator for Windows, MinGW, to build the executable modules. These modules run natively on Windows and do not require additional emulation software besides the usual dependencies.

GNUnet development is mostly done under Linux and especially SVN checkouts may not build out of the box. We regret any inconvenience, and if you have problems, please report them or ask the mailinglist for assistance.

Hardware and OS requirements

Software installation

  1. Compression software
    The software packages GNUnet depends on are usually compressed using UNIX tools like tar, gzip and bzip2. If you do not already have an utility that is able to extract such archives, get 7-Zip.
  2. UNIX environment
    The MinGW project provides the compiler toolchain that is used to build GNUnet.
    Get the following packages from the MinGW project:
    1. Install MSYS (to c:\mingw, for example.) Do not use spaces in the pathname (c:\program files\mingw).
    2. Install MinGW runtime, utilities and GCC to a subdirectory (to c:\mingw\mingw, for example)
    3. Install the Development Kit to the MSYS directory (c:\mingw)
    4. Create a batch file bash.bat in your MSYS directory with the content:
      bin\sh.exe --login
      This batch file opens a shell which is used to invoke the build processes. MinGW′s standard shell (msys.bat) is not suitable because it opens a separate console window for each compilation step. On Vista, bash.bat needs to be run as administrator.
    5. Start bash.sh and rename (c:\mingw\mingw\)lib\libstdc++.la to avoid problems:
      mv /usr/mingw/lib/libstdc++.la /usr/mingw/lib/libstdc++.la.broken
    6. Unpack the Windows API to the MinGW directory (c:\mingw\mingw\) and remove the declaration of DATADIR from (c:\mingw\mingw\)include\objidl.h (lines 55-58)
    7. Unpack autoconf, automake to the MSYS directory (c:\mingw)
    8. Install all other packages to the MinGW directory (c:\mingw\mingw\)
  3. GNU Libtool
    GNU Libtool is required to use shared libraries.
    Get the prebuilt package from here and unpack it to the MinGW directory (c:\mingw)
  4. Pthreads
    GNUnet uses the portable POSIX thread library for multi-threading.
    1. Save libpthreadGC2.a as libpthread.a into the lib directory (c:\mingw\mingw\lib\libpthread.a)
    2. Save pthreadGC2.dll into the MinGW bin directory (c:\mingw\mingw\bin)
    3. Download all header files from include/ to the include directory (c:\mingw\mingw\include)
  5. GNU MP
    GNUnet uses the GNU Multiple Precision library for special cryptographic operations.
    Get the GMP binary package from the MinGW repository and unpack it to the MinGW directory (c:\mingw\mingw)
  6. GNU Gettext
    GNU gettext is used to provide national language support.
    Get the prebuilt package from here and unpack it to the MinGW directory (c:\mingw\mingw)
  7. GNU iconv
    GNU Libiconv is used for character encoding conversion.
    Get the prebuilt package from here and unpack it to the MinGW directory (c:\mingw\mingw)
  8. SQLite
    GNUnet uses the SQLite database to store content.
    Get the prebuilt binary from here and unpack it to your MinGW directory.
  9. MySQL
    As an alternative to SQLite, GNUnet also supports MySQL.
    1. Get the binary installer from the MySQL project (version 4.1), install it and follow the instructions in README.mysql.
    2. Create a temporary build directory (c:\mysql)
    3. Copy the directories include\ and lib\ from the MySQL directory to the new directory
    4. Get the patches from Bug #8906 and Bug #8872 (the latter is only required for MySQL < 4.1.12) and apply them:
      patch -p 0 < mysql01.diff
      patch -p 0 < mysql_def03.diff
    5. Move lib\opt\libmysql.dll to lib\libmysql.dll
    6. Change to lib\ and create an import library:
      dlltool --input-def ../include/libmySQL.def --dllname libmysql.dll --output-lib libmysqlclient.a -k
    7. Copy include\* to include\mysql\
    8. Pass "--with-mysql=/c/mysql" to ./configure and copy libmysql.dll to your PATH or GNUnet′s bin\ directory
  10. GTK+
    gnunet-gtk and libextractor depend on GTK.
    Get the the binary and developer packages of atk, glib, gtk, iconv, gettext-runtime, pango from gtk.org and unpack it to the MinGW directory (c:\mingw\mingw)
    Get pkg-config and libpng from http://www.gimp.org/~tml/gimp/win32/downloads.html and unpack them to the MinGW directory (c:\mingw\mingw)
    Do not overwrite any existing files!
  11. Glade
    gnunet-gtk and and gnunet-setup were created using this interface builder.
  12. zLib
    libextractor requires zLib to decompress some file formats. GNUnet uses it to (de)compress meta-data.
    Get zLib from here (Signature) and unpack it to the MinGW directory (c:\mingw\mingw)
  13. Bzip2
    libextractor also requires Bzip2 to decompress some file formats.
    Get Bzip2 (binary and developer package) from GnuWin32 and unpack it to the MinGW directory (c:\mingw\mingw)
  14. Libgcrypt
    Libgcrypt provides the cryptographic functions used by GNUnet
    Get Libgcrypt from here (Signature) and unpack it to the MinGW directory (c:\mingw\mingw)
  15. PlibC
    PlibC emulates Unix functions under Windows.
    Get PlibC from here and unpack it to the MinGW directory (c:\mingw\mingw)
  16. OGG Vorbis
    OGG Vorbis is used to extract meta-data from .ogg files
    Get the packages libogg and libvorbis and unpack them to the MinGW directory (c:\mingw\mingw)

Building libextractor and GNUnet

Before you compile libextractor or GNUnet, be sure to set PKG_CONFIG_PATH:

export PKG_CONFIG_PATH=/mingw/lib/pkgconfig

See Installation for basic instructions on building libextractor and GNUnet.

By default, all modules that are created in this way contain debug information and are quite large. To compile release versions (small and fast) set the variable CFLAGS:

CFLAGS='-O2 -march=pentium -fomit-frame-pointer' ./configure --prefix=$HOME --with-extractor=$HOME

Installer

The GNUnet installer is made with NSIS. The installer script is located in contrib\win in the GNUnet source tree.

Source

The sources of all dependencies are available here.



Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 Christian Grothoff.
Verbatim copying and distribution of this entire article
is permitted in any medium, provided this notice is preserved.

Translation engine based on i18nHTML (C) 2003, 2004, 2005, 2006, 2007 Christian Grothoff.

go to i18nHTML administration page