Version 2 (modified by 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:
- Create binaries using openvpn-build/generic.
- Create tarball for easy-rsa from master (temporary) files should be at easy-rsa-2.0.
- 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
Attachments (1)
-
spc+pvk-to-p12.sh (592 bytes) - added by 12 years ago.
Script from Alon Bar-Lev to convert .spc + .pvk files into a pkcs12 keystore
Download all attachments as: .zip