Changes between Version 1 and Version 2 of BuildingUsingGenericBuildsystem


Ignore:
Timestamp:
02/24/12 08:34:10 (12 years ago)
Author:
Samuli Seppänen
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • BuildingUsingGenericBuildsystem

    v1 v2  
    11= Introduction =
    22
    3 The original contents of this article were adapted from Alon Bar-Lev's (the buildsystem author) emails (see [wiki:BuildingUsingGenericBuildsystem#Externallinks External links] section.
     3The original contents of this article were adapted from Alon Bar-Lev's (the buildsystem author) emails (see [wiki:BuildingUsingGenericBuildsystem#Externallinks External links] section).
    44
     5= Generic build method =
    56
    6 = Creating the NSIS installer =
     7This is the most generic method: it can cross compile OpenVPN using any toolchain to any environment. Make sure you have installed [http://mingw-w64.sourceforge.net/ mingw-w64] before you start. Also, if you have [http://nsis.sourceforge.net/Main_Page NSIS] installed, you can use it to generate Windows installers. Below a few usage examples.
     8
     9Until the buildsystem is integrated with Git master, you need to copy Alon's Git repository on top of OpenVPN sources. If you're starting from scratch, use something like this:
     10
     11{{{
     12$ git clone git://openvpn.git.sourceforge.net/gitroot/openvpn/openvpn.git
     13$ git clone https://github.com/alonbl/openvpn-build
     14$ cp -r openvpn-build/* openvpn
     15}}}
     16
     17The build files are in ''generic'' and ''msvc'' subdirectories.
     18
     19== Compile 32/64-bit Windows binaries on Linux ==
     20
     21{{{
     22$ cd generic
     23$ IMAGEROOT=`pwd`/image-win32 CHOST=i686-w64-mingw32
     24CBUILD=x86_64-pc-linux-gnu ./build
     25$ IMAGEROOT=`pwd`/image-win64 CHOST=x86_64-w64-mingw32
     26CBUILD=x86_64-pc-linux-gnu ./build
     27}}}
     28
     29== Compile 32/64-bit Windows binaries on Cygwin ==
     30
     31Read README for required packages.
     32
     33{{{
     34$ cd generic
     35$ IMAGEROOT=`pwd`/image-win32 CHOST=i686-w64-mingw32
     36CBUILD=i686-pc-cygwin ./build
     37$ IMAGEROOT=`pwd`/image-win64 CHOST=x86_64-w64-mingw32
     38CBUILD=i686-pc-cygwin ./build
     39}}}
     40
     41== Cross-compile arm binaries on Linux ==
     42
     43{{{
     44$ cd generic
     45$ CHOST="arm-unknown-linux-gnueabi" CBUILD="x86_64-pc-linux-gnu" DO_STATIC=1 ./build
     46}}}
     47
     48This will create static dependencies, but a dynamic libc. If you want to keep everything really static use set the ''DO_REALLY_STATIC=1'' variable.
     49
     50= MSVC build method =
     51
     52'''NOTE:''' These instructions are still incomplete.
     53
     54First install Perl (e.g. [http://www.activestate.com/activeperl ActivePerl]).
     55
     56{{{
     57cd msvc
     58build
     59}}}
     60
     61== Visual Studio IDE ==
     62
     63After you have the dependencies of Complete Batch or your own. Create msvc-env-local.bat with OPENVPN_DEPROOT pointing to the
     64location of the dependencies.
     65
     66{{{
     67$ msvc-dev
     68}}}
     69
     70== MSBuild ==
     71
     72After you have the dependencies of Complete Batch or your own. Create msvc-env-local.bat with OPENVPN_DEPROOT pointing to the location of the dependencies.
     73
     74{{{
     75$ msvc-build
     76}}}
     77
     78= Creating a NSIS installer =
    779
    880You can use the buildsystem to create the NSIS installer for Windows, even if you're building on Linux. The process is as follows:
    981
    1082 1. Create binaries using openvpn-build/generic.
    11  2. Create tarball for easyrsa from master (temporary) files should be at easy-rsa-2.0.
    12  3. Create the installer using openvpn-build/windows-nsis.
    13 
    14 I did not add the UI stuff, I think there should be a discussion why
    15 these are embedded.
    16 
    17 Alon.
    18 
    19 
    20 
     83 2. Create tarball for easy-rsa from master (temporary) files should be at easy-rsa-2.0.
     84 3. Create the installer using '''openvpn-build/windows-nsis''.
    2185
    2286= External links =