You can use the generic buildsystem from openvpn-build subproject to cross-compile OpenVPN using any toolchain to any target environment. The build host must have a *NIX-like environment, e.g. Linux, *BSD or Cygwin (on Windows).

Note: (December 2018) The build system is known to work only on:

  • Ubuntu 16.04 LTS x86_64
  • Ubuntu 18.04 LTS x86_64
  • Debian 8 x86_64
  • Debian 9 x86_64

Generic instructions

You need to install a bunch of tools before attempting a build:

  • mingw-w64, version 2.0.x. With recent OpenVPN 2.3.x releases you need to use our patched version of mingw-w64 or build mingw-w64 yourself
  • gcc-*-arm-linux-gnueabi (if building Arm binaries)
  • Git
  • man2html1 (for windows-nsis builds)
  • dos2unix (for windows-nsis builds)
  • NSIS: if you need support for riducuously long PATHs, you need to use our patched NSIS version or build NSIS yourself.
  • osslsigncode version 1.4 or later (pkcs12 support needed). Earlier versions can be used with minor modifications to the codesign() method in the build scripts.

The automated buildsystem setup script installs patched nsis and mingw-w64 by default.

1 On Cygwin man2html is not available, but you can hack around it the same way as in our Appveyor config.

cp `which true` /usr/bin/man2html

Converting certificates to PKCS12 format

If you have code-signing certificates generated with MS tools (.spc and .pvk files), you can convert them into standard (pkcs12) format using this script. If that fails, look at this old version of this page for manual instructions.

You can also create self-signed certificate for testing like this:

$ openssl req -newkey rsa:1024 -new -x509 -subj "/CN=test1" -out test.crt	
$ openssl pkcs12 -export -inkey privkey.pem -in test.crt -out test.p12	

Once you have the pkcs12 archive, you can give it and it's password as argument to the buildsystem(s). For details, look here:

Automated openvpn-build setup on Ubuntu

On Ubuntu 14.04 and earlier please use shell scripts attached to this page (below) to set up the build system. Generally you should use the latest version of the script, but attachment comments have more details. For Ubuntu 16.04 and 18.04 please get the script from openvpn-vagrant repository.

Please let us know if the script does not work for you. Manual setup instruction can be deduced from the script.

Setup on Windows

If you're building using Cygwin on Windows, it's best to configure Git not to translate LF to CR/LF. For this reason it's probably best to use Cygwin's Git. Also take a look at Cygwin's README to see which packages are required.

Last modified 4 years ago Last modified on 12/02/18 15:18:54

Attachments (7)

Download all attachments as: .zip