Subversion Repositories Kolibri OS

Rev

Go to most recent revision | Blame | Last modification | View Log | Download | RSS feed

  1. --------------------------------------------------------------------------------
  2.   Build Instructions for Windows NetSurf                      13 February 2010
  3. --------------------------------------------------------------------------------
  4.  
  5.   This document provides instructions for building the Windows version
  6.   of NetSurf and provides guidance on obtaining NetSurf's build
  7.   dependencies.
  8.  
  9.   Windows NetSurf has been tested on Wine and Vista.
  10.  
  11.  
  12.   Building and executing NetSurf
  13. ================================
  14.  
  15.   The windows netsurf port uses the MinGW (Minimal GNU on Windows)
  16.   system as its build infrastructure. This allows the normal netsurf
  17.   build process to be used.
  18.  
  19.   The method outlined here to create executables cross compiles
  20.   windows executable from a Linux OS host.
  21.  
  22.   First of all, you should examine the contents of Makefile.defaults
  23.   and enable and disable relevant features as you see fit by creating
  24.   a Makefile.config file.  Some of these options can be automatically
  25.   detected and used, and where this is the case they are set to such.
  26.   Others cannot be automatically detected from the Makefile, so you
  27.   will either need to install the dependencies, or set them to NO.
  28.  
  29.   You should then obtain NetSurf's dependencies, keeping in mind which
  30.   options you have enabled in the configuration file.  See the next
  31.   section for specifics.
  32.  
  33.   Once done, to build windows NetSurf on a UNIX-like platform, simply run:
  34.  
  35.       $ export MINGW_PREFIX=i586-mingw32msvc-
  36.       $ export MINGW_INSTALL_ENV=/usr/i586-mingw32msvc/
  37.       $ make TARGET=windows
  38.  
  39.   If that produces errors, you probably don't have some of NetSurf's
  40.   build dependencies installed. See "Obtaining NetSurf's dependencies"
  41.   below. Or turn off the complaining features in a Makefile.config
  42.   file. You may need to "make clean" before attempting to build after
  43.   installing the dependencies.
  44.  
  45.   You will need the libgnurx-0.dll from /usr/i586-mingw32msvc/bin/
  46.   copied next to the exe and the windows/res directory available, also
  47.   next to the executable.
  48.  
  49.   Run NetSurf by executing it:
  50.  
  51.       $ wine NetSurf.exe
  52.  
  53.   The staticaly linked binary which is generated may be several
  54.   megabytes in size, this can be reduced by stripping the binary.
  55.  
  56.       $ i586-mingw32msvc-strip NetSurf.exe
  57.  
  58.  
  59.   Obtaining NetSurf's build dependencies
  60. ========================================
  61.  
  62.   Package installation
  63. ----------------------
  64.  
  65.   Debian-based OS:
  66.  
  67.   The mingw cross compilation tools are required. These can be
  68.   installed as pakages on Debian/Ubuntu systems:
  69.  
  70.       $ sudo apt-get install mingw32 mingw32-binutils mingw32-runtime
  71.  
  72.   These provide a suitable set of compilers and headers including the win32 API.
  73.  
  74.   The includes and associated libraries are installed in
  75.   /usr/i586-mingw32msvc/ Which is where the build system will include
  76.   files from by default. The packages at time of writing only target
  77.   32bit windows builds.
  78.  
  79.   Other:
  80.  
  81.   For other OS the apropriate packages and environment must be installed.
  82.  
  83.   pkg-config
  84. ------------
  85.  
  86.   A pkg-config wrapper script is required to make things easier
  87.  
  88. cat > /usr/i586-mingw32msvc/bin/pkg-config <<EOF
  89. #!/bin/bash
  90. export PKG_CONFIG_LIBDIR=/usr/i586-mingw32msvc/lib/pkgconfig
  91. /usr/bin/pkg-config $*
  92. EOF
  93.  
  94.  
  95.   Base libraries
  96. ----------------
  97.  
  98.   Unlike other OS the base libraries and their dependancies need to be
  99.   built and installed.
  100.  
  101.   The instructions given here assume you will be installing on a
  102.   Debian derived OS using the mingw32 packages. The libraries should
  103.   be unpacked and built from a suitable temporary directory.
  104.  
  105.   zlib:
  106.  
  107.       $ apt-get source zlib1g
  108.       $ cd zlib-1.2.3.3.dfsg
  109.       $ CC=i586-mingw32msvc-gcc AR=i586-mingw32msvc-ar RANLIB=i586-mingw32msvc-ranlib CFLAGS="-DNO_FSEEKO" ./configure --prefix=/usr/i586-mingw32msvc/
  110.       $ make
  111.       $ sudo make install
  112.  
  113.   libiconv:
  114.  
  115.       $ wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.13.1.tar.gz
  116.       $ tar -zxf libiconv-1.13.1.tar.gz
  117.       $ cd libiconv-1.13.1
  118.       $ ./configure --prefix=/usr/i586-mingw32msvc/ --host=i586-mingw32msvc --disable-shared
  119.       $ make
  120.       $ sudo make install
  121.  
  122.   regex:
  123.  
  124.       $ wget http://kent.dl.sourceforge.net/project/mingw/Other/UserContributed/regex/mingw-regex-2.5.1/mingw-libgnurx-2.5.1-src.tar.gz
  125.       $ tar -zxf mingw-libgnurx-2.5.1-src.tar.gz
  126.       $ cd mingw-libgnurx-2.5.1
  127.       $ ./configure --prefix=/usr/i586-mingw32msvc/ --host=i586-mingw32msvc
  128.       $ make
  129.       $ sudo make install
  130.  
  131.   openssl:
  132.  
  133.       $ wget http://www.openssl.org/source/openssl-1.0.0a.tar.gz
  134.       $ tar -zxf openssl-1.0.0a.tar.gz
  135.       $ cd openssl-1.0.0a
  136.       $ PATH=/usr/i586-mingw32msvc/bin/:$PATH ./Configure no-shared disable-capieng --prefix=/usr/i586-mingw32msvc/ mingw
  137.       $ PATH=/usr/i586-mingw32msvc/bin/:$PATH make CC=i586-mingw32msvc-gcc RANLIB=i586-mingw32msvc-ranlib
  138.       $ sudo make install
  139.  
  140.   libcurl:
  141.  
  142.       $ wget http://curl.haxx.se/download/curl-7.26.0.tar.gz
  143.       $ tar -zxf curl-7.26.0.tar.gz
  144.       $ cd curl-7.26.0
  145.       $ LDFLAGS=-mwindows ./configure --prefix=/usr/i586-mingw32msvc/ --host=i586-mingw32msvc --disable-shared --disable-ldap --without-random
  146.       $ make
  147.       $ sudo make install
  148.  
  149.   libpng:
  150.  
  151.       $ wget http://kent.dl.sourceforge.net/project/libpng/libpng14/1.4.12/libpng-1.4.12.tar.gz
  152.       $ tar -zxf libpng-1.4.12.tar.gz
  153.       $ cd libpng-1.4.12
  154.       $ ./configure --prefix=/usr/i586-mingw32msvc/ --host=i586-mingw32msvc
  155.       $ make
  156.       $ sudo make install
  157.  
  158.   libjpeg:
  159.  
  160.       $ wget http://www.ijg.org/files/jpegsrc.v8d.tar.gz
  161.       $ tar -zxf jpegsrc.v8d.tar.gz
  162.       $ cd jpeg-8d
  163.       $ ./configure --prefix=/usr/i586-mingw32msvc/ --host=i586-mingw32msvc --disable-shared
  164.       $ make
  165.       $ sudo make install
  166.  
  167.   The NetSurf project's libraries
  168. ---------------------------------
  169.  
  170.   The NetSurf project has developed several libraries which are required by
  171.   the browser. These are:
  172.  
  173.   LibParserUtils  --  Parser building utility functions
  174.   LibWapcaplet    --  String internment
  175.   Hubbub          --  HTML5 compliant HTML parser
  176.   LibCSS          --  CSS parser and selection engine
  177.   LibNSGIF        --  GIF format image decoder
  178.   LibNSBMP        --  BMP and ICO format image decoder
  179.   LibROSprite     --  RISC OS Sprite format image decoder
  180.  
  181.   To fetch each of these libraries, run the appropriate commands from the
  182.   Docs/LIBRARIES file.
  183.  
  184.   To build and install these libraries.
  185.  
  186.   Ensure the MINGW_INSTALL_ENV variable is correctly set.
  187.  
  188.       $ export MINGW_INSTALL_ENV=/usr/i586-mingw32msvc/
  189.  
  190.  Then simply enter each of their directories and run:
  191.  
  192.       $ make TARGET=windows PREFIX=/usr/i586-mingw32msvc/
  193.       $ sudo make TARGET=windows PREFIX=/usr/i586-mingw32msvc/ install
  194.  
  195.   Resources
  196. -----------
  197.  
  198.   The windows resources may be rebuilt. Currently there is 1 object
  199.   file included in the Git distribution of NetSurf that could be
  200.   manually compiled
  201.  
  202.       $ cd windows/res
  203.       $ i586-mingw32msvc-windres resource.rc -O coff -o resource.o
  204.