12 | | $ git clone git://openvpn.git.sourceforge.net/gitroot/openvpn/openvpn.git |
13 | | $ git clone https://github.com/alonbl/openvpn-build |
14 | | }}} |
15 | | |
16 | | The build files are in ''generic'' and ''msvc'' subdirectories. |
17 | | |
18 | | == Compile 32/64-bit Windows binaries on Linux == |
19 | | |
20 | | {{{ |
21 | | $ cd generic |
22 | | $ IMAGEROOT=`pwd`/image-win32 CHOST=i686-w64-mingw32 |
23 | | CBUILD=x86_64-pc-linux-gnu ./build |
24 | | $ IMAGEROOT=`pwd`/image-win64 CHOST=x86_64-w64-mingw32 |
25 | | CBUILD=x86_64-pc-linux-gnu ./build |
26 | | }}} |
27 | | |
28 | | == Compile 32/64-bit Windows binaries on Cygwin == |
29 | | |
30 | | Read README for required packages. |
31 | | |
32 | | {{{ |
33 | | $ cd generic |
34 | | $ IMAGEROOT=`pwd`/image-win32 CHOST=i686-w64-mingw32 |
35 | | CBUILD=i686-pc-cygwin ./build |
36 | | $ IMAGEROOT=`pwd`/image-win64 CHOST=x86_64-w64-mingw32 |
37 | | CBUILD=i686-pc-cygwin ./build |
38 | | }}} |
39 | | |
40 | | == Cross-compile arm binaries on Linux == |
41 | | |
42 | | {{{ |
43 | | $ cd generic |
44 | | $ CHOST="arm-unknown-linux-gnueabi" CBUILD="x86_64-pc-linux-gnu" DO_STATIC=1 ./build |
45 | | }}} |
46 | | |
47 | | 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. |
48 | | |
49 | | = MSVC build method = |
50 | | |
51 | | 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'': |
52 | | |
53 | | {{{ |
54 | | $ git clone https://github.com/alonbl/openvpn-build |
55 | | }}} |
56 | | |
57 | | Then switch to a Visual Studio command-prompt and run the following commands: |
58 | | |
59 | | {{{ |
60 | | $ cd openvpn-build\msvc |
61 | | $ build |
| 14 | $ git clone https://github.com/alonbl/openvpn-build.git |
| 15 | $ cd openvpn-build/generic |
| 16 | # native |
| 17 | $ IMAGEROOT=`pwd`/image-native ./build |
| 18 | # Windows 32bit |
| 19 | $ IMAGEROOT=`pwd`/image-win32 CHOST=i686-w64-mingw32 \ |
| 20 | CBUILD=x86_64-pc-linux-gnu ./build |
| 21 | # Windows 64bit |
| 22 | $ IMAGEROOT=`pwd`/image-win64 CHOST=x86_64-w64-mingw32 \ |
| 23 | CBUILD=x86_64-pc-linux-gnu ./build |
| 24 | # arm |
| 25 | $ IMAGEROOT=`pwd`/image-arm CHOST=arm-unknown-linux-gnueabi \ |
| 26 | CBUILD=x86_64-pc-linux-gnu ./build |
| 31 | To build only dependencies (helpful for developers): |
| 32 | |
| 33 | {{{ |
| 34 | $ DO_ONLY_DEPS=1 IMAGEROOT=`pwd`/deps-win32 CHOST=i686-w64-mingw32 \ |
| 35 | CBUILD=x86_64-pc-linux-gnu ./build |
| 36 | }}} |
| 37 | |
| 38 | Most probably the following configuration is required for OpenVPN: |
| 39 | {{{ |
| 40 | $ DEP=location of the dependencies |
| 41 | $ ./configure host=... \ |
| 42 | CFLAGS="-I$DEP/include" LDFLAGS="-L$DEB/lib" \ |
| 43 | --enable-lzo --enable-pkcs11 \ |
| 44 | PKCS11_HELPER_CFLAGS=" " PKCS11_HELPER_LIBS="-lpkcs11-helper" |
| 45 | }}} |
| 46 | |
| 47 | = MSVC build method = |
| 48 | |
| 49 | MSVC build was written with least dependencies in mind. You'll need only [http://www.activestate.com/activeperl Perl] and Visual Studio 2008+. |
| 50 | |
| 51 | First clone the openvpn-build repository, .e.g using ''Git Bash'': |
| 52 | |
| 53 | {{{ |
| 54 | $ git clone https://github.com/alonbl/openvpn-build.git |
| 55 | }}} |
| 56 | |
| 57 | Then at command prompt: |
| 58 | |
| 59 | {{{ |
| 60 | > cd openvpn-build\msvc |
| 61 | > build |
| 62 | }}} |
| 63 | |
| 64 | This fetches all the dependencies, builds them and builds OpenVPN. |
| 65 | |
| 66 | To build only dependencies (helpful for developers): |
| 67 | |
| 68 | {{{ |
| 69 | > set DO_ONLY_DEPS=true |
| 70 | > set TARGET=%cd%\deps |
| 71 | > build |
| 72 | }}} |
| 73 | |
| 74 | At OpenVPN source root, create a file msvc-env-local.bat with: |
| 75 | |
| 76 | {{{ |
| 77 | set OPENVPN_DEPROOT=location of the dependencies |
| 78 | }}} |
| 79 | |
| 80 | Visual Studio can be run using: |
| 81 | |
| 82 | {{{ |
| 83 | > msvc-dev |
| 84 | }}} |
| 85 | |
70 | | 1. Create binaries using openvpn-build/generic. |
71 | | 2. Create tarball for easy-rsa from master (temporary) files should be at easy-rsa-2.0. |
72 | | 3. Create the installer using ''openvpn-build/windows-nsis''. |
| 90 | NSIS must be available on system. If installed not in path or standard location set MAKENSIS environment variable. Same goes for OSSLSIGNCODE. |
| 91 | |
| 92 | The process is as follows: |
| 93 | |
| 94 | {{{ |
| 95 | $ git clone https://github.com/alonbl/openvpn-build.git |
| 96 | $ cd openvpn-build/windows-nsis |
| 97 | $ ./build-complete |
| 98 | }}} |
| 99 | |
| 100 | Refer to ./build-complete --help for more options. |
| 101 | |
| 102 | = TAP-Windows = |
| 103 | |
| 104 | Required software: Microsoft Visual Studio 2008, recent Windows DDK. |
| 105 | |
| 106 | First clone the openvpn-build repository, .e.g using ''Git Bash'': |
| 107 | |
| 108 | {{{ |
| 109 | $ git clone https://github.com/alonbl/tap-windows |
| 110 | }}} |
| 111 | |
| 112 | Then build: |
| 113 | |
| 114 | {{{ |
| 115 | > configure |
| 116 | > build |
| 117 | }}} |
| 118 | |
| 119 | Customization can be done using config-local.m4 file which overrides variables, and environment variables which override auto detection code, for example DDK to specify DDK location, see configure --help. |