[[TOC(inline, depth=1)]] = Introduction = You can use the [wiki:BuildingUsingGenericBuildsystem generic buildsystem] from [https://github.com/OpenVPN/openvpn-build 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). = Generic instructions = You need to install a bunch of tools before attempting a build: * [http://mingw-w64.sourceforge.net/ mingw-w64], version 2.0.x. * gcc-*-arm-linux-gnueabi (if building Arm binaries) * [http://git-scm.com/ Git] * [http://www.nongnu.org/man2html/ man2html] (for ''windows-nsis'' builds) * [http://waterlan.home.xs4all.nl/dos2unix.html dos2unix] (for ''windows-nsis'' builds) * [http://nsis.sourceforge.net/Main_Page NSIS]: if you need support for riducuously long PATHs, you need to [wiki::BuildingMakeNSIS build NSIS] yourself. * [http://osslsigncode.sourceforge.net/ 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. = 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 [attachment:spc+pvk-to-p12.sh this script]. If that fails, look at this [wiki:BuildingUsingGenericBuildsystem@51 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: * [wiki:BuildingUsingGenericBuildsystem#CreatingaNSISinstallerwindows-nsissubdir Building Windows NSIS installer] * [wiki:BuildingUsingGenericBuildsystem#BuildingTAP-Windows Building tap-windows] = Build environment -specific instructions = == Automated setup for Ubuntu == == Manual setup for Ubuntu == On Ubuntu 12.04 and 12.10 (64-bit) you most build dependencies are satisfied if you run the following command: {{{ $ apt-get update $ apt-get install git-core mingw-w64 gcc-4.6-arm-linux-gnueabi man2html dos2unix nsis unzip }}} If you intend to build Windows installers with OpenVPN-GUI, you need to install a [wiki:InstallingMingwW64 modified MinGW version]. If you wish to sign the release files (executables, libraries and installers), you need to build [http://sourceforge.net/projects/osslsigncode/ osslsigncode] manually. First install OpenSSL and Curl development libraries: {{{ $ apt-get update $ apt-get install libssl-dev libcurl4-openssl-dev build-essential }}} The curl library is used for timestamping support. Extract the osslsigncode tarball and issue the usual commands: {{{ $ ./configure $ make $ sudo make install }}} This will put osslsigncode in PATH where the build system can find it. == 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.