wiki:BuildingUsingGenericBuildsystem

Version 5 (modified by Samuli Seppänen, 12 years ago) (diff)

--

Introduction

The original contents of this article were adapted from Alon Bar-Lev's (the buildsystem author) emails (see External links section).

Generic build method

This is the most generic method: it can cross compile OpenVPN using any toolchain to any environment. Make sure you have installed mingw-w64 before you start. Also, if you have NSIS installed, you can use it to generate Windows installers. Below a few usage examples.

Until 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:

$ git clone git://openvpn.git.sourceforge.net/gitroot/openvpn/openvpn.git
$ git clone https://github.com/alonbl/openvpn-build

The build files are in generic and msvc subdirectories.

Compile 32/64-bit Windows binaries on Linux

$ cd generic
$ IMAGEROOT=`pwd`/image-win32 CHOST=i686-w64-mingw32
CBUILD=x86_64-pc-linux-gnu ./build
$ IMAGEROOT=`pwd`/image-win64 CHOST=x86_64-w64-mingw32
CBUILD=x86_64-pc-linux-gnu ./build

Compile 32/64-bit Windows binaries on Cygwin

Read README for required packages.

$ cd generic
$ IMAGEROOT=`pwd`/image-win32 CHOST=i686-w64-mingw32
CBUILD=i686-pc-cygwin ./build
$ IMAGEROOT=`pwd`/image-win64 CHOST=x86_64-w64-mingw32
CBUILD=i686-pc-cygwin ./build

Cross-compile arm binaries on Linux

$ cd generic
$ CHOST="arm-unknown-linux-gnueabi" CBUILD="x86_64-pc-linux-gnu" DO_STATIC=1 ./build

This will create static dependencies, but a dynamic libc. If you want to keep everything really static use set the DO_REALLY_STATIC=1 variable.

MSVC build method

You'll need Perl and Visual Studio 2008+ if you want to use this build method. First clone the openvpn-build repository, .e.g using Git Bash:

$ git clone https://github.com/alonbl/openvpn-build

Then switch to a Visual Studio command-prompt and run the following commands:

$ cd openvpn-build\msvc
$ build

This fetches all the dependencies, builds them and builds OpenVPN.

Creating a NSIS installer

You can use the buildsystem to create the NSIS installer for Windows, even if you're building on Linux. The process is as follows:

  1. Create binaries using openvpn-build/generic.
  2. Create tarball for easy-rsa from master (temporary) files should be at easy-rsa-2.0.
  3. Create the installer using openvpn-build/windows-nsis.

External links

Alons Git repositories

Alon's original instructions from emails

Installers and files

Attachments (1)

Download all attachments as: .zip