Subject: Re: Compiling 2.1rc7 on Windows with VC
Date: Monday 5th May 2008 05:41:32 UTC (over 10 years ago)
Hello, In the past I also encountered problems compiling OpenVPN post 2.1 rc4 on Windows. The method has changend. In the OpenVPN.devel mailinglist James Yoran has explained in several postings how to compile post rc4 on Windows. For example in Re: Compiling OpenVPN 2.1rc7 on 18/02/2008 and in Re: build Openvpn 2.1RC4 on Windows failure (Repost, no answer in openvpn.user group). on 21/08/2007 Success, John To quote James: 1: The latest Windows build system for OpenVPN is actually quite powerful, and can autodetect when certain dependencies are missing, such as the Windows DDK, and substitute in a pre-built binary of the driver, instead of requiring that every component be built from source. This means, for example, that if you just want to make a simple change to the NSIS script, you don't need to have the DDK installed or build OpenSSL, lzo, or PKCS11-Helper. To build OpenVPN for Windows, use the ./domake-win script. This script has extensive comments, and describes how to use the pre-built binaries feature, where pre-built binaries are substituted at every build step where a lack of dependencies precludes a build from source. You can also view the ./domake-win script here: http://svn.openvpn.net/projects/openvpn/branches/BETA21/openvpn/domake-win For example, suppose you want to build a windows installer for OpenVPN that includes a custom configuration file and keys. Here is a quick-start guide: (1) Install the minimum tool chain: # MinGW -- for GNU C compiler # MSYS -- for bash # msysDTK -- for perl # NSIS -- for building installer (2) Download and expand the prebuilt binaries distribution, for example: https://secure.openvpn.net/devel/openvpn-2.1_rc7a-prebuilt.tbz (3) In the top-level directory of the prebuilt-binary distribution, download and expand a source .tar.gz file, for example: https://secure.openvpn.net/devel/openvpn-2.1_rc7a.tar.gz Edit install-win32/settings.in, uncommenting out these lines, and setting them to the appropriate file names: # include a sample configuration file and key ;!define SAMPCONF_DIR "test-key" ;!define SAMPCONF_CONF "test.ovpn" ;!define SAMPCONF_P12 "test.p12" ;!define SAMPCONF_TA "ta.key" In the commented-out example above, the test-key directory should be present in the prebuilt-binaries top-level directory (the parent directory of the source distribution), and should contain the files test.ovpn, test.p12, ta.key. Now you should be able to build an installer with ./domake-win that includes these custom configuration files, such that when the installer is run by an end-user, these files are placed into \program files\openvpn\config James 2: John, Yes, there have been some changes in the Windows build procedure for the 2.1 beta series. The ./domake-win script is now used to build OpenVPN on Windows (in the MinGW/MSYS environment). This approach has a number of advantages, including the ability to build a signed Windows installer from source in a single step, and the consolidation of build-level configuration parameters in a single file: install-win32/settings.in Changes such as these that are of interest to developers are always documented first in the subversion commit logs (use "svn log" to see them). James "Ehsan Akhgari"