0
0
mirror of https://github.com/OpenVPN/openvpn3.git synced 2024-09-20 04:02:15 +02:00
Commit Graph

200 Commits

Author SHA1 Message Date
Mark Deric
318d83ae43 Fix fail silently bug in pre-commit hook
Without the change and in the absence of a clang-format command in the
user's PATH, the script will fail in line 79 of the hook due to set
-e.  It will fail to produce the error message starting at line 83.

The change allows the error message to print.

Signed-off-by: Mark Deric <jmark@openvpn.net>
2024-08-13 23:26:06 -07:00
Arne Schwabe
247e74a929 Teach build to compile multiple compilation unit
Even though this script is deprecated, it is still used.

Signed-off-by: Arne Schwabe <arne@openvpn.net>
2023-12-13 16:51:22 +01:00
James Yonan
7fe39be0df scripts/build: support $VAL levels for valgrind other than 1
Signed-off-by: James Yonan <james@openvpn.net>
2023-09-17 10:08:36 -06:00
David Sommerseth
75dbcdfa93
Merge OpenVPN 3 Core v3.8.2 into master
Signed-off-by: David Sommerseth <davids@openvpn.net>
2023-09-13 16:46:05 +02:00
Frank Lichtenheld
df5f6d5810
mingw/build: Fix xxHash build
Adapt to vcpkg changes.

Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
2023-08-02 17:33:37 +02:00
Frank Lichtenheld
e9e49239ce mingw: disable VCPKG_APPLOCAL_DEPS in build-vcpkg
We do not want to force a dependency on powershell.
Copying the right dlls is rather trivial.

Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
2023-02-28 13:45:16 +01:00
Frank Lichtenheld
866e0c9596 mingw: add new script build-vcpkg
This avoids all the manual deps building and instead
uses vcpkg directly.

Note: need to remove gtest from VCPKG manifest for now:
- it only builds with -posix variant of mingw compiler
- vcpkg uses the non-posix variant and can't be trivially
  reconfigured
- we build gtest from unittests anyway and that one uses
  the compiler we specify

Using the posix variant of mingw compiler will require
setting up a custom triplet and toolchain. That will be
done in a later commit.

Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
2023-02-28 13:45:16 +01:00
Frank Lichtenheld
fb9bee5ad6 vcpkg.json: Allow to use on Linux
- Fix PATCHES to work on Linux
- While here, fix version number

Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
2023-02-28 12:30:30 +01:00
David Sommerseth
3bcb671d33
scripts: Add pre-commit hook for clang-format style check
When enabling this pre-commit hook, clang-format will be run before the
commit can be completed.  If the changes about to be committed does not
adhere to the defined code style, the current commit will not be completed.

To install this pre-commit hook, run:

    $ ./scripts/git-pre-commit-clangformat.sh install

This script is a slightly modified version of what is used in the
OpenVPN 2.x project, slightly modified to use clang-format instead of
uncrustify and to extend the file change filter check to include C++ source
and header files.

Signed-off-by: David Sommerseth <davids@openvpn.net>
2023-02-01 19:16:51 +01:00
David Sommerseth
4996c38ed4
Merge lastest changes from Core v3.7.2 2022-12-14 17:34:29 +01:00
Lev Stipakov
cc5efc52a4 mingw: adapt to vcpkg openssl portfile change
vcpkg has removed OPENSSL_VERSION from portfile.cmake
in favor of VERSION variable which is set based on port version
(https://github.com/microsoft/vcpkg/pull/27178/files).

Parse port manifest to get OpenSSL version.

Signed-off-by: Lev Stipakov <lev@openvpn.net>
(cherry picked from commit a12737b5cc)
2022-12-07 11:43:07 +01:00
Lev Stipakov
a12737b5cc mingw: adapt to vcpkg openssl portfile change
vcpkg has removed OPENSSL_VERSION from portfile.cmake
in favor of VERSION variable which is set based on port version
(https://github.com/microsoft/vcpkg/pull/27178/files).

Parse port manifest to get OpenSSL version.

Signed-off-by: Lev Stipakov <lev@openvpn.net>
2022-11-03 11:30:23 +02:00
Lev Stipakov
e01375daa0
vcpkg-ports: remove ovpn-dco-win port
The UAPI header (ovpn-dco.h) is now part of openvpn3 core
repo, so no need in separate vcpkg port.

Signed-off-by: Lev Stipakov <lev@openvpn.net>
2022-10-13 15:16:21 +02:00
David Sommerseth
8c94a8f774
copyright: Update to 2022
Signed-off-by: David Sommerseth <davids@openvpn.net>
2022-09-29 12:00:26 +02:00
James Yonan
e7ffa06f1e scripts/build: added SQLITE=1 parameter to build with sqlite3 library
Signed-off-by: James Yonan <james@openvpn.net>
2022-09-21 23:00:13 -06:00
Arne Schwabe
664b3d6651
Remove several no longer used or supported build scripts
- the OpenSSL build script for all platform, was only
  used on macOS and better alternatives like homebrew exit there
- mac build scripts in general, cmake/homebrew is a better alternative
- vars for Android, Android uses CMake based build, see ics-openvpn for an example
- lzo build scripts. Core can do lzo decompress witout it and if used, system lzo can
  be used

Signed-off-by: Arne Schwabe <arne@openvpn.net>
2022-08-24 17:09:13 +02:00
Arne Schwabe
a1c44bd0c6
Update OpenSSL to 3.0.5, build fat lib for macos, drop 32 bit on iOS 2022-07-13 20:42:52 +02:00
Frank Lichtenheld
a04266120d mingw: fix OpenSSL on x86_64
Hardcode libdir to lib, because openssl3 chooses
lib64 otherwise.

While here, some small changes:
- remove dangerous "|| true" after openssl make
- remove "-j1" for openssl "make install". Speeds
  up the documentation generation.
- use set -x

Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
(cherry picked from commit f27157e28b)
2022-07-11 12:21:08 +02:00
Lev Stipakov
029ac68090 mingw: fix broken OpenSSL checkout
OpenSSL has changed tags naming to
something like openssl-3.0.2, so adapt
our script accordingly.

Signed-off-by: Lev Stipakov <lev@openvpn.net>
(cherry picked from commit 296abfca32)
2022-07-11 12:20:56 +02:00
Frank Lichtenheld
c618e4a667 mingw: add xxHash dependency
Required by some of the unittests.

Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
2022-07-06 11:21:28 +02:00
James Yonan
2323950565 build: added SYSD=1 flag to build with systemd library
Signed-off-by: James Yonan <james@openvpn.net>
2022-05-13 19:09:09 -06:00
Lev Stipakov
b7c6e2d5af dco-win: remove ovpn-dco-win vcpkg dependency
uapi header has been added to the source code, so
we don't need that dependency anymore.

Fix MinGW script accordingly.

Signed-off-by: Lev Stipakov <lev@openvpn.net>
2022-05-02 15:22:49 +03:00
Frank Lichtenheld
f27157e28b mingw: fix OpenSSL on x86_64
Hardcode libdir to lib, because openssl3 chooses
lib64 otherwise.

While here, some small changes:
- remove dangerous "|| true" after openssl make
- remove "-j1" for openssl "make install". Speeds
  up the documentation generation.
- use set -x

Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
2022-04-07 18:19:46 +02:00
Lev Stipakov
296abfca32 mingw: fix broken OpenSSL checkout
OpenSSL has changed tags naming to
something like openssl-3.0.2, so adapt
our script accordingly.

Signed-off-by: Lev Stipakov <lev@openvpn.net>
2022-04-07 13:11:37 +02:00
Arne Schwabe
568f6615cf Update build instruction for macOS and cleanup/remove build var
Remove the vars-osx64 and vars-iossim files which are no longer used.
The IOS simulator does not support the VPN API and builds for the
IOS simulator have not been done in a very long time nor are they
particular useful.

Also switch to pkg-config for jsoncpp by default.

Signed-off-by: Arne Schwabe <arne@openvpn.net>
2022-02-10 18:59:01 +01:00
Frank Lichtenheld
7b2413eee2 scripts/{linux,mac}/build-all: cleanup
- remove commented out lines that are unlikely to be useful
- enable set -u
- allow to skip mbedtls build on linux
2022-01-28 12:20:02 +01:00
Frank Lichtenheld
e82303ad2a deps: remove unused dependencies
Most of these haven't been used in years and are
probably useless now. If required they can always
be recovered from the git history.

Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
2022-01-28 12:18:39 +01:00
Frank Lichtenheld
5f5f3be09a mac: Fix some issues in build-all
- No need to "build" asio twice.
- Avoid "[: =: unary operator expected" warnings due
  to undefined variables.
2021-12-22 10:29:42 +01:00
Mark Deric
7fa1c70821
Add set -x to scripts conditioned on XTRACE=1
Signed-off-by: Mark Deric <jmark@openvpn.net>
2021-12-08 20:09:50 +01:00
Jeff Lucovsky
2996dfbe19
Build with ASAN when requested
This commit will build with ASAN when the environment variable ASAN=1.

Building with ASAN:
- Add "-fsanitize=address" to enable ASAN checks
- Add "-ggdb3" for higher-fidelity stack traces
- Add "-fno-omit-frame-pointer" to maintain fp info on call stacks

If both ASAN=1 and VAL=1, ASAN takes precedence.

Signed-off-by: Jeff Lucovsky <jeff.lucovsky@openvpn.net>
2021-11-18 18:33:44 +01:00
Frank Lichtenheld
8bafab1ebb OVPN3-800 build: enable LTO by default on linux
No need to set LTO flag.
2021-10-20 19:53:38 +02:00
Lev Stipakov
d31620d0c6
agent mac: move from common
Windows agent has been moved from common to core,
so for consistency move mac agent too.

Since agent and agent-enabled client depend on jsoncpp,
also move jsoncpp build scripts.

Signed-off-by: Lev Stipakov <lev@openvpn.net>
2021-06-10 23:06:24 +02:00
Heiko Hund
b3e47fbdb8 sync dependency versions used by MSVC and MinGW
Add some logic to the script which builds the binaries using mingw. Git
revisions and patch information are extracted from the vcpkg portfiles
used for the MSVC build. This way the builds should be more alike.

Signed-off-by: Heiko Hund <heiko@openvpn.net>
2021-04-28 16:56:55 +02:00
Heiko Hund
2170f5a2aa
support ovpn-dco-win builds with mingw
Signed-off-by: Heiko Hund <heiko@openvpn.net>
2021-04-14 22:44:52 +02:00
Heiko Hund
9b03cddea9
add support for ovpn-dco-win TAP driver
Signed-off-by: Heiko Hund <heiko@openvpn.net>
2021-04-14 22:44:49 +02:00
Arne Schwabe
d62bcb3283 Remove cityhash from buildall and add xxHash to mac buildall
Signed-off-by: Arne Schwabe <arne@openvpn.net>
2021-01-20 18:25:44 +01:00
Arne Schwabe
af43bf0145
Add script for building xxHash
The code that requires xxHash requires a fairly new xxHash version, so
add a local copy of 0.8.0 to build with this header only library.

Signed-off-by: Arne Schwabe <arne@openvpn.net>
2021-01-20 17:02:30 +01:00
James Yonan
64d6934f8f scripts/build: rename xxHash dependency directory to use the same capitalization syntax as the github name
Signed-off-by: James Yonan <james@openvpn.net>
2021-01-11 11:40:25 -07:00
James Yonan
21b1c6b2fb Replaced CityHash with XXHash
Still to do -- update CMake files

Signed-off-by: James Yonan <james@openvpn.net>
2020-12-09 07:51:10 -07:00
James Yonan
0657de823e build script: XXHASH=1 -- build with XXHash hash library
Signed-off-by: James Yonan <james@openvpn.net>
2020-10-15 22:47:24 -06:00
Lev Stipakov
bca2a06c29 mingw: use asio 1.16
Signed-off-by: Lev Stipakov <lev@openvpn.net>
2020-08-26 10:53:27 +00:00
Lev Stipakov
2ce3635b9c
mingw: fix lz4 build
Signed-off-by: Lev Stipakov <lev@openvpn.net>
2020-08-26 13:51:41 +03:00
James Yonan
1324bad624
build script: allow main .cpp file to be missing when EXTRA_CPP is defined
Signed-off-by: James Yonan <james@openvpn.net>
2020-08-19 18:53:08 +02:00
Arne Schwabe
e6d544b8a5 Add support building deps with clang/libc++
Signed-off-by: Arne Schwabe <arne@openvpn.net>
2020-04-29 11:55:38 +02:00
James Yonan
6688f2d372
scripts/build: added PCRE=1 to build with PCRE (Perl-compatible regular expressions) library
Signed-off-by: James Yonan <james@openvpn.net>
2020-03-25 18:49:10 +01:00
David Sommerseth
3fbe0a2701
Update copyrights
Signed-off-by: David Sommerseth <davids@openvpn.net>
2020-03-18 19:37:32 +01:00
Lev Stipakov
7cf2e210d1
mingw: fix various warnings
- remove unused variable
 - replace deprecated JsonReader with CharReader
 - fix initialization order
 - fix signed-unsigned comparison
 - fix string constant to char* conversion
 - fix unknown (to mingw) format character
 - fix passing NULL to non-pointer agrument
 - remove unneeded #pragma once

Signed-off-by: Lev Stipakov <lev@openvpn.net>
2020-03-11 19:44:40 +01:00
Lev Stipakov
2fbea7bebe
mingw/build: add build options
ARCH enables to build certain architecture only.

NO_DEPS disables downloading and building dependencies.

NO_OPENSSL disables downloading and building OpenSSL.

OPENSSL_ROOT_DIR allows to specify location for OpenSSL root

Example:

    ARCH=x86_64 NO_OPENSSL=1 ./build

Signed-off-by: Lev Stipakov <lev@openvpn.net>
2020-02-19 17:57:42 +01:00
Lev Stipakov
4a7294bd31
mingw: add .gitignore
Signed-off-by: Lev Stipakov <lev@openvpn.net>
2020-02-12 21:48:45 +02:00
Lev Stipakov
31fe32c925
mingw: add build script
Signed-off-by: Lev Stipakov <lev@openvpn.net>
2020-02-12 21:48:45 +02:00