3
# This is the master OpenVPN build script for Windows.
4
# This script will build OpenVPN, the TAP driver, and
5
# the installer from source, targeting x86 on Windows
6
# 2000 and higher, and x64 on Windows 2003 and higher.
7
# For quick start options, see pre-built notes below.
9
# Note that if you are only looking to build the
10
# openvpn user-space binaries (openvpn.exe
11
# and openvpnserv.exe) you can use the
12
# provided autoconf/automake build environment.
14
# If you are building from an expanded .tar.gz file,
15
# make sure to run "./doclean" before "./domake-win".
17
# See top-level build configuration and settings in:
20
# install-win32/settings.in
22
# Mandatory prerequisites:
24
# MinGW -- for GNU C compiler
27
# NSIS -- for building installer
29
# The following additional prerequisites may be omitted
30
# when building in pre-built mode (see note below).
32
# svn -- for checking out source code (or TortoiseSVN)
33
# Windows Driver Kit (6001_17121_HyperV_WDK.iso) -- for building
34
# TAP driver + tapinstall
36
# Required libraries (must be prebuilt)
38
# OpenSSL -- define OPENSSL_DIR in settings.in
39
# LZO -- define LZO_DIR in settings.in
40
# PKCS11-HELPER -- define PKCS11_HELPER_DIR
42
# Optional OpenVPN GUI binary (prebuilt)
43
# -- define OPENVPN_GUI_DIR and OPENVPN_GUI in settings.in
45
# Required source code not included in OpenVPN SVN repository
46
# because of MS licensing restrictions:
48
# ../tapinstall -- This is based on 'devcon' which is found in the
49
# Windows Driver Kit (formerly known as DDK).
50
# Copy the 'devcon' source tree to ../tapinstall
51
# Edit 'sources' and modify TARGETNAME=tapinstall
53
# Note that all variables referenced here such as GENOUT,
54
# GENOUT_PREBUILT, and CLEAN are defined in install-win32/settings.in
56
# SPECIAL NOTES ON PRE-BUILT MODE
57
# Setting up a complete tool chain to build OpenVPN and all
58
# dependencies on Windows can be an onerous task, so the capability
59
# is provided to reference a directory of pre-built components during
60
# the build process. When dependencies are missing to build a given
61
# component (such as the TAP driver), the build script will auto-detect
62
# this and use the pre-built version instead. This would allow you, for
63
# example, to build an OpenVPN installer with custom edits to
64
# install-win32/settings.in, but then avoid needing to build all other
65
# components (such as OpenSSL, LZO, Pkcs11-helper, TAP driver, Windows
66
# service, etc.). The procedure is as follows. First Download and expand
67
# the pre-built binaries from:
69
# http://openvpn.net/prebuilt/ (choose the most recent -prebuilt .tbz file)
71
# After expanding the .tbz file, cd to the top level directory and
72
# expand an OpenVPN source distribution taken from either the subversion
73
# repository or a source .tar.gz file. It's best to use an OpenVPN source
74
# version that is the same or slightly later than the pre-built binaries
75
# file. So now you have a directory containing something that looks like
78
# gen-prebuilt -> from prebuilt .tbz file
79
# lzo-2.02 -> from prebuilt .tbz file
80
# openssl-0.9.8i -> from prebuilt .tbz file
81
# pkcs11-helper -> from prebuilt .tbz file
82
# openvpn-2.1_rc13.tar.gz -> downloaded from openvpn.net
83
# openvpn-2.1_rc13 -> directory expanded from above file
85
# Now cd to your expanded source tree (openvpn-2.1_rc13 in the
86
# example above), make edits to install-win32/settings.in (or even
87
# patch the OpenVPN source code directly), and run this script:
91
# If everything runs correctly, you should have a custom installer
92
# written to ./gen/install
94
# First build the autodefs directory, containing C, sh, and NSIS versions
95
# of global settings, using install-win32/settings.in as source.
96
# These settings will then drive the rest of the build process.
97
install-win32/winconfig
99
# clean all generated files
100
install-win32/doclean
102
# Load a pre-built GENOUT directory if GENOUT_PREBUILT is defined
103
# and the GENOUT directory is non-existing
104
install-win32/getprebuilt
106
# Each of the scripts below build, get, and/or possibly sign a different
107
# OpenVPN component, placing the generated files in GENOUT. Each of these
108
# steps is fully indepedent, and can be executed in any order or omitted.
109
# The exception is the last script which gathers together all files from
110
# GENOUT and builds the installer.
112
# Make the OpenVPN user-space components (OpenVPN and service)
113
install-win32/makeopenvpn
115
# Make the OpenVPN TAP driver
116
install-win32/maketap
118
# Make the tapinstall utility, used to install the TAP driver
119
install-win32/maketapinstall
121
# Get the OpenSSL libraries from a pre-build OpenSSL tree
122
install-win32/getopenssl
124
# Get the PKCS-11 helper library from a pre-built OpenSSL tree
125
install-win32/getpkcs11helper
127
# Get the OpenVPN GUI (must be prebuilt)
130
# Get the OpenVPN XML-based GUI (must be prebuilt)
131
install-win32/getxgui
133
# Produce the license text, install README, and sample config files
134
install-win32/maketext
136
# This final step builds the OpenVPN installer using generated
138
install-win32/buildinstaller