This article demonstrates compiling OpenVpn with Cygwin on Windows.
The first step is to get build scripts from https://github.com/OpenVPN/openvpn-build.
When cloning OpenVpn repositories to Windows machine, make sure Git client for Windows does not automatically convert Unix-style line endings (LF) in source files into Windows-style line endings (CRLF). If this happens UNIX tools that run in Cygwin will report an error complaining about extra CR characters. So, when cloning, use the following command:
Required Cygwin packages are listed here: https://github.com/OpenVPN/openvpn-build/tree/master/generic
Download Perl script man2html and save it as a file with no extensions in /bin directory (C:\cygwin64\bin). Script URL is: http://cpansearch.perl.org/src/EHOOD/man2html3.0.1/man2html. If build is run with no having this script, the following error is reported at the output:
Make sure that man2html's shebang contains correct path to perl. In order to find perl's path in Cygwin we can do the following:
In my case shebang
has to be replaced with:
In order to build x64 version of OpenVpn go to ../OpenVpn/openvpn-build/generic and execute:
A bit about Cygwin
Checking whether some particular package has been installed (e.g. ca-certificates):
http://stackoverflow.com/questions/9224298/how-do-i-fix-certificate-errors-when-running-wget-on-an-https-url-in-cygwin
$ git clone https://github.com/OpenVPN/openvpn-build.git --config core.autocrlf=false
Required Cygwin packages are listed here: https://github.com/OpenVPN/openvpn-build/tree/master/generic
Package name | Cygwin installer path |
---|---|
diffutils | All --> Utils |
m4 | All --> Interpreters |
make | All -> Devel |
mingw64-i686-binutils | All -> Devel |
mingw64-i686-gcc-core | All -> Devel |
mingw64-i686-headers | All -> Devel |
mingw64-i686-pthreads | All -> Devel |
mingw64-i686-runtime | All -> Devel |
mingw64-x86_64-binutils | All -> Devel |
mingw64-x86_64-gcc-core | All -> Devel |
mingw64-x86_64-headers | All -> Devel |
mingw64-x86_64-pthreads | All -> Devel |
mingw64-x86_64-runtime | All -> Devel |
patch | All -> Devel |
patchutils | All -> Devel |
perl | All --> Interpreters |
unzip | All --> Archive |
wget | All --> Web |
Download Perl script man2html and save it as a file with no extensions in /bin directory (C:\cygwin64\bin). Script URL is: http://cpansearch.perl.org/src/EHOOD/man2html3.0.1/man2html. If build is run with no having this script, the following error is reported at the output:
checking for man2html... no
configure: error: man2html is required for win32
FATAL: Configure pkcs11-helper
Make sure that man2html's shebang contains correct path to perl. In order to find perl's path in Cygwin we can do the following:
$ which perl
/usr/bin/perl
In my case shebang
#!/usr/local/bin/perl
has to be replaced with:
#!/usr/bin/perl
In order to build x64 version of OpenVpn go to ../OpenVpn/openvpn-build/generic and execute:
$ IMAGEROOT=`pwd`/image-win64 CHOST=x86_64-w64-mingw32 CBUILD=i686-pc-cygwin ./build
A bit about Cygwin
Checking whether some particular package has been installed (e.g. ca-certificates):
$ cygcheck -c ca-certificates
Cygwin Package Information
Package Version Status
ca-certificates 2.9-1 OK
http://stackoverflow.com/questions/9224298/how-do-i-fix-certificate-errors-when-running-wget-on-an-https-url-in-cygwin
No comments:
Post a Comment