Changes between Version 52 and Version 53 of BuildingOnWindows


Ignore:
Timestamp:
02/15/11 14:29:32 (13 years ago)
Author:
Samuli Seppänen
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • BuildingOnWindows

    v52 v53  
    33= Introduction =
    44
    5 The traditional way to build OpenVPN for Windows is to cross-compile it on *NIX. This works, but does not allow signing the TUN/TAP driver, which is required for Windows Vista/7 and later. Due to this a new, relatively simple Python-based build system was written. This new build system allows building OpenVPN on Windows more easily, but requires the use of a commercial version of Visual Studio development environment. However, the new build system is "external" from Visual Studio's viewpoint, so meddling with VS's graphical user interface is not necessary.
     5The traditional way to build OpenVPN for Windows is to cross-compile it on *NIX. This works, but does not allow signing the TUN/TAP driver, which is required for Windows Vista/7 and later. Due to this a new, relatively simple Python-based build system was written. This new build system allows building OpenVPN on Windows more easily, but may require a commercial version of Visual Studio development environment. Fortunately the new build system is "external" from Visual Studio's viewpoint, so meddling with VS's graphical user interface is not necessary.
    66
    77= Installing prequisites =
     
    99== Visual Studio 2008 Professional ==
    1010
    11 Visual Studio 2008 Professional is required to build OpenVPN on Windows. Note that the free Express edition might not work. Also make sure you select "Typical installation", not "Full installation". Full installation installs ''x86 cross-tools'' which can cause nasty, hard to debug issues. See ''Troubleshooting'' section for details.
     11Visual Studio 2008 Professional is used to build OpenVPN on Windows. Note that the free Express edition might not work. Also make sure you select "Typical installation", not "Full installation". Full installation installs ''x86 cross-tools'' which can cause nasty, hard to debug issues. See ''Troubleshooting'' section for details.
    1212
    1313== Windows Software Development Kit ==
     
    9595}}}
    9696
    97 Or if you're using NASM, run
     97If you're using NASM, run
    9898
    9999{{{
     
    125125The new Python-based build system we're using in this article has gone through significant changes during late 2010 and early 2011. You're strongly encouraged to fetch latest Git development code using ''Git for Windows'' (Git shell) or ''!GitExtensions'' (GUI). Check [wiki:TesterDocumentation these instructions] to see which Git URI to use.
    126126
    127 OpenVPN depends on several other pieces of software during build and packaging phases. It also has several runtime dependencies (e.g. lzo2, openssl). Before starting OpenVPN build, you need to setup the dependencies into a very specific directory layout, which should look like this:
     127OpenVPN has several build and runtime dependencies that need to be placed into a strict directory hierarchy along with OpenVPN sources:
    128128 
    129  * '''C:\openvpn-build''': root build directory
    130  * '''C:\openvpn-build\openvpn-testing''': openvpn sources fetched from Git
    131  * '''C:\openvpn-build\tapinstall\7600''': directory containing ''devcon.exe'' sources, which can be found from ''C:\WINDDK\7600.16385.1\src\setup\devcon''. As you can see, the last part of the tapinstall directory path depends on the major version of WINDDK. Note that in OpenVPN world ''Devcon.exe'' is (confusingly) also known as ''tapinstall.exe''.
    132  * '''C:\openvpn-build\pkcs11-helper'': pkcs11-helper build directory
    133  * '''C:\openvpn-build\pkcs11-helper\lib'': must contain ''libpkcs11-helper-1.dll'' and ''libpkcs11-helper-1.dll.manifest'' files produced by pkcs11-helper build
    134  * '''C:\openvpn-build\openssl''': copy of the openssl install directory which contains the openssl libraries you built earlier. It's location depends on the --prefix parameter you when configuring the openssl build.
    135  * '''C:\openvpn-build\lzo\include''': this directory is a copy of the ''include'' directory in the lzo source package
    136  * '''C:\openvpn-build\lzo\bin''': this directory must contain the ''lzo2.dll'' and ''lzo2.dll.manifest'' files generated during lzo build
    137  * '''C:\openvpn-build\lzo\lib''': this directory must contain the ''lzo2.lib'' file generated during lzo build
    138  * '''C:\openvpn-build\Microsoft.VC90.CRT''': this directory is a copy of ''C:\Program Files\MicrosofT Visual Studio 9.0\VC\redist\x86\Microsoft.VC90.CRT'' directory; the exact path may vary. Note that using the wrong version will cause issues on 32-bit or 64-bit Windows versions.
    139  * '''C:\openvpn-build\signtool'''. a directory containing ''signtool.exe''. This tool can be found from the Microsoft SDK directory (e.g. ''C:\Program Files\Microsoft SDKs\Windows\V6.0A\bin''). Note that this tool's Python wrapper is only used internally at OpenVPN Technologies, so you can skip this dependency.
     129 * '''<openvpn-build-root>''': root build directory, e.g. ''C:\openvpn-build''
     130  * '''<openvpn-sources>''': a directory containing openvpn sources
     131  * '''tapinstall'''
     132   * '''7600''': copy of devcon.exe ''build directory''. Can be found from ''C:\WINDDK\7600.16385.1\src\setup\devcon'' or similar, depending on the version of WINDDK. Note that in OpenVPN world ''devcon.exe'' is (confusingly) also known as ''tapinstall.exe''.
     133  * '''pkcs11-helper''': copy of pkcs11-helper ''build directory''
     134   * '''lib''': must also contain ''libpkcs11-helper-1.dll'' and ''libpkcs11-helper-1.dll.manifest'' files produced by pkcs11-helper build
     135  * '''openssl''': copy of the openssl ''install directory''
     136  * '''lzo'''
     137   * '''include''': a copy of the ''include'' directory in the lzo ''build directory''
     138   * '''bin''': must also contain the ''lzo2.dll'' and ''lzo2.dll.manifest'' files generated by lzo build
     139   * '''lib''': must also contain the ''lzo2.lib'' file generated by lzo build
     140  * '''Microsoft.VC90.CRT''': a copy of ''C:\Program Files\MicrosofT Visual Studio 9.0\VC\redist\x86\Microsoft.VC90.CRT'' directory; the exact path may vary. Note that using the wrong version will cause issues on 32-bit or 64-bit Windows versions.
     141  * '''signtool''': this directory should contain ''signtool.exe'', which can be found from the Microsoft SDK directory (e.g. ''C:\Program Files\Microsoft SDKs\Windows\V6.0A\bin''). However, it's Python wrapper (''Sign'' class) is only available internally at OpenVPN Technologies, so you can skip this dependency.
    140142
    141143== Setting build parameters ==
     
    187189  * tapinstall.exe
    188190 * '''bin'''
    189   * Microsoft.VC90.CRT
     191  * '''Microsoft.VC90.CRT'''
    190192   * msvcr90.dll
    191193   * Microsoft.VC90.CRT.manifest