101 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
James Yonan
a0d05ee96c unittests: updated googletest lib dir in build script
Signed-off-by: James Yonan <james@openvpn.net>
2019-11-27 18:55:07 +01:00
James Yonan
fa38064403 build script: added a new PROF type "auto" that tries to automatically determine the local platform
Signed-off-by: James Yonan <james@openvpn.net>
2019-09-25 19:51:27 +02:00
James Yonan
5befbd430f build: added CAP=1 -- build with libcap
libcap linkage is needed for use of the Linux capabilities API.

Signed-off-by: James Yonan <james@openvpn.net>
2019-07-17 10:53:46 -06:00
James Yonan
1c7bac90d9 build script: when building with DEBUG=1 on Linux, use -ggdb instead of -g
Signed-off-by: James Yonan <james@openvpn.net>
2019-07-17 10:53:46 -06:00
James Yonan
310766b270 build: added MTLS_DIST setting
MTLS_DIST=path -- use user-specified mbedTLS distribution

Signed-off-by: James Yonan <james@openvpn.net>
2019-07-17 10:53:46 -06:00
James Yonan
58a7866b45 build script: added OPENSSL_DIST parameter to specify a custom OpenSSL build
Signed-off-by: James Yonan <james@openvpn.net>
2019-05-22 17:57:42 +02:00
James Yonan
aebea64562 build script: minor changes to Cityhash inclusion
Don't include -I and -L compiler options for Cityhash pointing
to $DEP_DIR, unless the directories exist.

Signed-off-by: James Yonan <james@openvpn.net>
2018-12-12 23:26:12 -07:00
James Yonan
8f20f76936 build: use LZ4_SYS=1 default when target is Linux
Signed-off-by: James Yonan <james@openvpn.net>
2018-08-30 13:00:27 +03:00
Arne Schwabe
dd47138adf Add script for building cityhash 2018-04-25 18:25:28 +02:00
James Yonan
2b4c85091d Debugging: added header and build flag for valgrind run-time
extensions.

Signed-off-by: James Yonan <james@openvpn.net>
2017-12-22 17:59:38 +08:00
Antonio Quartulli
7cbf539222 [OVPN3-5] build script: allow user to specify its own mbedTLS folder and LDFLAGS
Signed-off-by: Antonio Quartulli <antonio@openvpn.net>
2017-09-27 16:16:18 +08:00
Lev Stipakov
8ae2a3f7cf Integrate Google Test framework
Implemented sample test for LogInfo class.

OVPN3-27
2017-09-27 16:16:18 +08:00
Lev Stipakov
7db95ccde6 Make build fail on compilation errors
Signed-off-by: Lev Stipakov <lev@openvpn.net>
2017-09-27 16:16:18 +08:00
James Yonan
81cb887f67 build script: added DPROF=1 flag
When DPROF=1 and PROF is specified, build with
the debugging variant of the vars file.

Signed-off-by: James Yonan <james@openvpn.net>
2017-09-27 16:16:18 +08:00
James Yonan
ce0977b2ea Support Cityhash.
When running build script, add CITY=1 to build with Cityhash library.

Signed-off-by: James Yonan <james@openvpn.net>
2017-09-27 16:16:17 +08:00
James Yonan
916856d9b7 build script: updated Objective-C support when OBJC=1.
Signed-off-by: James Yonan <james@openvpn.net>
2017-04-12 11:42:41 -06:00
James Yonan
691a641a43 Added i/o abstraction layer.
Created a lightweight abstraction layer so that another i/o
reactor can be dropped in place of asio.

The basic approach is to rename all references to asio::xxx
types to openvpn_io::xxx and then make openvpn_io a
preprocessor variable that points to the top-level namespace
of the i/o reactor implementation.

All of the source files that currently include <asio.hpp> now
include <openvpn/io/io.hpp> instead:

This gives us a lightweight abstraction layer that allows us
to define openvpn_io to be something other than asio.

Other changes:

* Inclusion of asio by scripts/build is now optional, and is
  enabled by passing ASIO=1 or ASIO_DIR=<dir>.

* Refactored openvpn/common/socktypes.hpp to no longer
  require asio.

* Refactored openvpn/log/logthread.hpp to no longer require
  asio.

* Added openvpn::get_hostname() method as alternative to
  calling asio directly.

* openvpn/openssl/util/init.hpp will now #error
  if USE_ASIO is undefined.

Signed-off-by: James Yonan <james@openvpn.net>
2017-03-30 15:48:14 -06:00
James Yonan
f8876e5ef3 build script: added new parameters
PROF=<platform> -- source vars/vars-<platform> before running
ASIO_DIR=<dir> -- specify ASIO tree
MTLS_SYS=1 -- use system mbedTLS
LZ4_SYS=1 -- build with system LZ4 compression library
2017-03-18 12:24:54 -06:00
James Yonan
052f565ed7 build-mbedtls : simplify mbedTLS build script to no longer
depend on cmake.
2017-03-18 12:24:54 -06:00
James Yonan
ba47bd6f05 build script : OSSL=1 option on Linux will link
with system OpenSSL.
2017-03-18 12:24:54 -06:00
James Yonan
050e8717f1 mbedTLS: Port from polarssl-1.3 to mbedtls-2.3 (symbol renames)
This patch renames internal OpenVPN 3 symbols
from polarssl -> mbedtls.

Signed-off-by: James Yonan <james@openvpn.net>
2017-03-18 12:24:54 -06:00
James Yonan
a6b7cf458f mbedTLS: Port from polarssl-1.3 to mbedtls-2.3 (functional)
This patch builds on work by David Sommerseth <davids@openvpn.net>
to move the PolarSSL API from polarssl-1.3 to mbedtls-2.3, which
has significant differences in some areas.

- Strings containing keys, certificates, CRLs, and DH parameters
  need to be NULL-terminated and the length argument provided to
  the corresponding mbedtls parse function must be able to read
  the NULL-terminator.  These places have been modified with a
  '+1' to the length argument (x509cert.hpp, x509crl.hpp, dh.hpp,
  pkctx.hpp).

- The SSL context object has been split up in mbedtls-2.3
  Now many of the SSL configurations are done in a separate
  SSL config object, which is added to the SSL context once
  configured.  In addition private/public keys are now stored
  in a separate pk_context, which is later on attached to the
  SSL context.  Due to this, many of the calls setting either
  SSL configuration parameters or working with pk_contexts have
  been refactored.  (sslctx.hpp)

- The older API loading the CA chain took a hostname argument.
  The new API requires mbedtls_ssl_set_hostname() explicitly to
  be called setting hostname.  Some refactoring was needed here
  too (sslctx.hpp).

- x509_oid_get_description() is now replaced by
  mbedtls_oid_get_extended_key_usage().

- when mbedTLS renamed OID_CMP to MBEDTLS_OID_CMP, the return
  value was changed so that a return value of 0 now means equal
  rather than not-equal.

- mbedtls/platform.h must be loaded before any other mbedtls
  include files (sslchoose.hpp).

- All functions and macros related to mbedTLS are now prefixed
  with mbedtls_/MBEDTLS_

- Refactored External PKI and added some options to cli.cpp
  to make it easier to test that the feature still works
  correctly.  This included removing the sig_type var and
  standardizing on a PKCS#1 digest prefix per RFC 3447.

- Updated test keys to 2048 bits.

- Updated dependency build scripts to build mbedTLS.

- Enable MD4 in mbedTLS build script (needed for NTLM auth).

- Use an allow-all X509 cert profile to preserve compatibility
  with older configs.  Going forward, we will implement new
  options to increase strictness on minimum RSA key size and
  required cert signing algs.

- Added human-readable reason strings that explain why
  a given cert in the chain wasn't accepted.

- This patch doesn't rename any files or rename internal
  OpenVPN 3 symbols such as PolarSSLContext.  This will
  be done in a separate commit.

Signed-off-by: James Yonan <james@openvpn.net>
2017-03-18 12:24:54 -06:00
James Yonan
ba15049f18 Mac client : implemented INFO,OPEN_URL handler for Mac OS X
command line client.
2016-08-11 14:05:33 -06:00
James Yonan
18bf3158a5 Updated ovpn3 dependencies:
* Updated all libraries to latest versions
* PolarSSL -> mbedTLS renaming
2015-12-28 17:47:18 -07:00
James Yonan
6eaf1e324b Changes to build script:
* Added EXTRA_CPP var for specifying additional .cpp files
  to be built as separate compilation units.

* Don't emit -fwhole-program flag if compile-only flag
  (CO) is enabled or EXTRA_CPP is defined.

* Clear out EXTRA_SRC_OBJ if compile-only flag (CO) is
  enabled to avoid warnings.
2015-11-25 12:14:02 -07:00
James Yonan
3825535db2 Added "JAVA=1" option to build script to build with JVM. 2015-08-14 05:19:04 -07:00
James Yonan
16bde170c0 Don't use deprecated asio features. 2015-06-30 00:05:37 -06:00
James Yonan
04637e486a Started process of switching over from asiodispatch
to C++11 lambdas.
2015-06-24 16:16:57 -06:00
James Yonan
c6a21c827b Boost dependency elimination -- final removal of Boost
dependency.  Asio is now included as a standalone,
header-only dependency.
2015-06-06 10:59:18 -06:00
James Yonan
4d660c0eca Added OUTBIN parm to build script. 2015-04-25 15:12:15 -06:00
James Yonan
a51c0bf0bf Mostly complete transition from boost::thread to std::thread. 2015-04-23 17:07:56 -06:00
James Yonan
5539a22684 Repo reorganization: standardize on $O3 representing the top-level
directory that contains core and possibly other components as well.
2014-08-29 18:42:02 -06:00
James Yonan
68afaf3324 Created build-extras system where other components (outside of core)
can modify build system behavior.
2014-08-28 16:06:26 -06:00
James Yonan
6ba90c9ef7 In build script, remove references to DBG_DIR_SUFFIX as it is made
obsolete by existence of vars-x-dbg files.
2014-08-28 16:04:27 -06:00
James Yonan
302046c3ea Updated build scripts for repo reorganization. 2014-08-28 13:33:14 -06:00
James Yonan
76b317e9f1 Added JsonCpp support. 2014-08-10 20:16:36 -06:00
James Yonan
d9dfc91031 In build script, don't add -fwhole-program
flag when DEBUG_BUILD == 1.
2014-08-10 20:02:25 -06:00