0
0
mirror of https://github.com/OpenVPN/openvpn.git synced 2024-09-20 03:52:28 +02:00
Commit Graph

16 Commits

Author SHA1 Message Date
Frank Lichtenheld
e8881ec6dd CMake: Add complete MinGW and MSVC build
This is based on the initial CMake patch by
Arne Schwabe, but extends that to provide
a complete replacement for existing MinGW
build (autotools based) and MSVC build
(openvpn.sln).

The following features are added while switching
these builds to CMake:
 - vcpkg support for MinGW build, allowing for
   trivial cross-compilation on Linux
 - Add unittests to MSVC build
 - Rework MSVC config header generation, removing
   need for separate headers between autotools
   and MSVC

The following advantages are reasons for switching
to CMake over the existing MSVC build:
 - Easier to maintain CMake files without IDE
   than the sln and vcxproj files
 - Able to maintain MSVC and MinGW build side-by-side

The plan is to completely remove the existing MSVC
build system but leave the existing autotools builds
in place as-is, including MinGW support.

CMake is not the intended build system for Unix-like
platforms and there are no current plans to switch
to it.

v2:
 - Reduce default warning level for MSVC to /W2. With
   /W3 the build is just much too noisy, making it
   difficult to spot new warnings.
 - Change MSVC CMake presets to have hardcoded build
   type. When using pkg_search_module MSVC Multi-Config
   builds do not work correctly at all since PkgConfig
   doesn't seem to be able to create multi-config
   libraries like find_package does.
 - Change minGW presets to be Multi-Config capable.
 - Remove OPENVPN_VERSION_MAJOR, OPENVPN_VERSION_MINOR,
   OPENVPN_VERSION_PATCH from config.h.cmake.in.
   They are not required and cause macro redefinition
   warnings in MSVC (with openvpn-plugin.h). gcc doesn't
   warn about this because the definitions are identical
   so no need to fix this in autoheader config.h.in.
v3:
 - Apply fixes by Lev Stipakov to match MSVC compile
   options better to previous build.
 - Apply change by Lev Stipakov to enable generation
   of PDB files.
 - Move /Brepro to its own commit. This is a behavior
   change that should be more visible.
 - Rebase on top of my dist fixes.

Change-Id: I237f28eca618d4fc476225b887c0be26cca362b1
Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
Acked-by: Lev Stipakov <lstipakov@gmail.com>
Message-Id: <20230620135310.94455-3-frank@lichtenheld.com>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg26754.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
2023-06-27 18:07:03 +02:00
Frank Lichtenheld
0c25a5462e vcpkg-ports/pkcs11-helper: rename patches to make file names shorter
Remove the number prefixes we do not use anyway.

And then rename Allow-the-build-to-succeed-if-configured-with-disabl.patch
to make it short enough that it can fit in a tar archive
built with --old-archive. Otherwise make dist might not include it:

tar:
openvpn-2.7_git/contrib/vcpkg-ports/pkcs11-helper/Allow-the-build-to-succee
d-if-configured-with-disabl.patch:
file name is too long (max 99); not dumped

Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <20230619132934.76085-3-frank@lichtenheld.com>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg26747.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
2023-06-21 13:53:32 +02:00
Frank Lichtenheld
9577ffe92f vcpkg-ports/pkcs11-helper: reference upstream PRs in patches
So it is easier to check the merge status.

Change-Id: Ia1f8a8d26d4752a7dda1a20521c59ded06bc7c52
Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
Acked-by: Lev Stipakov <lstipakov@gmail.com>
Message-Id: <20230331154214.613245-4-frank@lichtenheld.com>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg26569.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
2023-05-08 17:32:48 +02:00
Frank Lichtenheld
a2160d3e42 vcpkg-ports/pkcs11-helper: Convert CONTROL to vcpkg.json
To be in line with current vcpkg packaging policies.

Change-Id: Ifad0965a2b724b0b278783ba9c0ad5a82274445d
Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
Acked-by: Lev Stipakov <lstipakov@gmail.com>
Message-Id: <20230331154214.613245-3-frank@lichtenheld.com>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg26571.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
2023-05-08 17:18:58 +02:00
Frank Lichtenheld
17746e53f6 vcpkg-ports/pkcs11-helper: Make compatible with mingw build
Annoyingly this requires custom vcpkg triplets because
the mingw toolchain definition and the vcpkg_configure_make
function use incompatible default triplets (-pc-mingw32 vs
-w64-mingw32).

Change-Id: I4e671938220e9bfd798f91819f34b6f8ceaa45f5
Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
Acked-by: Lev Stipakov <lstipakov@gmail.com>
Message-Id: <20230331154214.613245-2-frank@lichtenheld.com>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg26572.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
2023-05-08 17:04:44 +02:00
Marc Becker
2f9c56e2cb vcpkg-ports/pkcs11-helper: support loader flags
Add dynamic loader flag feature to bundled pkcs11-helper.
Required to allow special handling for PKCS11 providers on win32.

Signed-off-by: Marc Becker <marc.becker@astos.de>
Acked-by: Lev Stipakov <lstipakov@gmail.com>
Message-Id: <20221214143325.2604-1-marc.becker@astos.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg25691.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
2022-12-15 09:26:00 +01:00
Lev Stipakov
f6d80493a9 vcpkg: switch to manifest
Add vcpkg manifest file which lists
dependencies and enable manifest usage in
project file.

This simplifies build process by eliminating
separate "vcpkg install" step to install dependencies.

Since vcpkg added openssl3 port, remove ours.

Signed-off-by: Lev Stipakov <lev@openvpn.net>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <20220505121449.347-1-lstipakov@gmail.com>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg24285.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
2022-05-05 15:41:23 +02:00
Marc Becker
99e6b814ed vcpkg-ports/pkcs11-helper: bump to release 1.29
This release has merged win32 support patch,
so our own patch could be removed from the port.

Upstream archive format changed back to BZIP2.

Signed-off-by: Marc Becker <becm@gmx.de>
Acked-by: Lev Stipakov <lstipakov@gmail.com>
Message-Id: <20220423135704.88164-1-becm@gmx.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg24180.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
2022-04-25 09:57:01 +02:00
Lev Stipakov
2047522286 vcpkg-ports\pkcs11-helper: shorten patch filename
"make dist" uses 'tar -o' which breaks on long filenames:

  tar:

openvpn-2.5.6/contrib/vcpkg-ports/pkcs11-helper/0003-config-w32-vc.h.in-ind
icate-OpenSSL-EC-support.patch:
  file name is too long (max 99); not dumped
  tar: Exiting with failure status due to previous errors

and then "make dist" continues.

Make filename shorter to make tar happy.

Signed-off-by: Lev Stipakov <lev@openvpn.net>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <20220316135411.217-1-lstipakov@gmail.com>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg23977.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
2022-03-17 09:20:39 +01:00
Lev Stipakov
fd567aa0ef vcpkg-ports/pkcs11-helper: adapt to new upstream URL
Signed-off-by: Lev Stipakov <lev@openvpn.net>
Acked-by: Frank Lichtenheld <frank@lichtenheld.com>
Message-Id: <20220314120334.231-1-lstipakov@gmail.com>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg23940.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
2022-03-14 20:06:58 +01:00
Lev Stipakov
225893ef7d msvc: switch to openssl3
Add openssl3 vcpkg port, which is slightly modified version of
openssl1.1.1 port from official vcpkg repo.

Signed-off-by: Lev Stipakov <lev@openvpn.net>
Acked-by: Antonio Quartulli <antonio@openvpn.net>
Message-Id: <20220126123502.403-1-lstipakov@gmail.com>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg23662.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
2022-02-02 17:36:57 +01:00
Lev Stipakov
95b0761449 vcpkg-ports/pkcs11-helper: indicate OpenSSL EC support
We always build with OpenSSL >= 1.1.1, which has EC support.

Signed-off-by: Lev Stipakov <lev@openvpn.net>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <20220111150647.267-1-lstipakov@gmail.com>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg23527.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
2022-01-21 14:23:44 +01:00
Lev Stipakov
bced08530c vcpkg-ports/pkcs11-helper: bump to release 1.28
This release has merged openssl 1.1.1 support patch,
so our own patch could be removed from the port.

Remove unconditional /release flag, which is added by vcpkg
for release builds. Having this flag unconditionally breaks vcpkg
debug builds.

Signed-off-by: Lev Stipakov <lev@openvpn.net>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <20220111150605.208-1-lstipakov@gmail.com>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg23526.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
2022-01-21 14:20:31 +01:00
Lev Stipakov
e832658a6d vcpkg/pkcs11-helper: compatibility with latest vcpkg
Starting from commit 21b2dbd3 "[scripts-audit] nmake buildsystem"
vcpkg has removed NO_DEBUG support from nmake buildsystem
and now builds debug variant unconditionally. Debug flags contradict
build options hardcoded in pkcs11 nmake script (like /O2).

Remove hardcoded release options and other options which
are (also) set by vcpkg nmake buildsystem.

Bump vcpkg commit in GitHub actions.

Signed-off-by: Lev Stipakov <lev@openvpn.net>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <20211124100838.861-1-lstipakov@gmail.com>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg23253.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
2021-12-05 19:01:25 +01:00
Lev Stipakov
7421234982 vcpkg-ports: restore trailing whitespaces in .patch files
Commit 36b9aa "contrib/vcpkg-ports: add pkcs11-helper port"
has trimmed trailing white space in .patch files and thus corrupted them.

Restore trailing whitespaces to "uncorrupt" patches.

** applied with git am --whitespace=nowarn **

Signed-off-by: Lev Stipakov <lev@openvpn.net>
Acked-By: Gert Doering <gert@greenie.muc.de>
Message-Id: <20210615104331.210-1-lstipakov@gmail.com>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg22553.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
2021-06-15 13:18:43 +02:00
Lev Stipakov
36b9aa0c1e contrib/vcpkg-ports: add pkcs11-helper port
pkcs11-helper is a dependency library used by OpenVPN.
So far it has been built only by mingw.

Since we're making MSVC build system a first class citizen,
we need to build depencencies with MSVC, which we do with vcpkg.
All dependencies are in vcpkg official repo, expect pkcs11-helper.

This provides vcpkg port for building pkcs11-helper.

Example usage:

 vcpkg --overlay-ports=<openvpn>\contrib\vcpkg-ports install pkcs11-helper

Signed-off-by: Lev Stipakov <lev@openvpn.net>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <20210607104213.216-1-lstipakov@gmail.com>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg22503.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
2021-06-15 11:17:17 +02:00