= Introduction = The original contents of this article were adapted from Alon Bar-Lev's (the buildsystem author) emails (see [wiki:BuildingUsingGenericBuildsystem#Externallinks 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 [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. 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 [http://www.activestate.com/activeperl 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 = '''Alon's Git repositories''' * https://github.com/alonbl/easy-rsa * https://github.com/downloads/alonbl/easy-rsa/easy-rsa-2.1.0.tar.gz * https://github.com/alonbl/openvpn-build '''Alon's original instructions from emails''' * http://thread.gmane.org/gmane.network.openvpn.devel/5560 * http://thread.gmane.org/gmane.network.openvpn.devel/5495/focus=5599 * http://thread.gmane.org/gmane.network.openvpn.devel/5495/focus=5592 '''Installers and files''' * [https://github.com/downloads/alonbl/openvpn/openvpn-install-2.3-alpha1-I000.exe OpenVPN 2.3-alpha1 Windows installer build using this new buildsyste] * [https://github.com/downloads/alonbl/openvpn/openvpn-2.3-alpha1.tar.gz OpenVPN 2.3-alpha1 source directory with integrated buildsystem]