wiki:BuildingUsingGenericBuildsystem

Version 2 (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
$ cp -r openvpn-build/* openvpn

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

NOTE: These instructions are still incomplete.

First install Perl (e.g. ActivePerl).

cd msvc
build

Visual Studio IDE

After 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.

$ msvc-dev

MSBuild

After 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.

$ msvc-build

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

Alon's Git repositories

Alon's original instructions from emails

Installers and files

Attachments (1)

Download all attachments as: .zip