summaryrefslogtreecommitdiff
path: root/infrastructure
diff options
context:
space:
mode:
authorChris Wilson <qris@users.noreply.github.com>2018-01-02 21:13:55 +0000
committerGitHub <noreply@github.com>2018-01-02 21:13:55 +0000
commit6d7e9562e8485591a4888f1fc2d3c6c657dc7a01 (patch)
tree237b161707ed2b45b07a455f0089f23c6ecc1dd3 /infrastructure
parenta0fa0c4f5f338335034f172af290025d48d5a1d5 (diff)
parent85e7efc3fa0477f60318d2cd2144503a9ea8feb9 (diff)
Merge pull request #22 from boxbackup/openssl_1_1
Fix compatibility with OpenSSL 1.1
Diffstat (limited to 'infrastructure')
-rw-r--r--infrastructure/cmake/CMakeLists.txt21
-rw-r--r--infrastructure/cmake/windows/CMakeLists.txt23
-rw-r--r--infrastructure/m4/boxbackup_tests.m48
-rwxr-xr-xinfrastructure/makebuildenv.pl.in25
4 files changed, 62 insertions, 15 deletions
diff --git a/infrastructure/cmake/CMakeLists.txt b/infrastructure/cmake/CMakeLists.txt
index 25015452..65f59eb8 100644
--- a/infrastructure/cmake/CMakeLists.txt
+++ b/infrastructure/cmake/CMakeLists.txt
@@ -407,7 +407,26 @@ else()
endif()
# Link to OpenSSL
-find_package(OpenSSL REQUIRED)
+# Workaround for incorrect library suffixes searched by FindOpenSSL:
+# https://gitlab.kitware.com/cmake/cmake/issues/17604
+if(WIN32 AND MSVC)
+ find_package(OpenSSL)
+ set(OPENSSL_SSL_LIBRARY ${SSL_EAY_RELEASE})
+ set(OPENSSL_CRYPTO_LIBRARY ${LIB_EAY_RELEASE})
+ set(OPENSSL_LIBRARIES ${OPENSSL_SSL_LIBRARY} ${OPENSSL_CRYPTO_LIBRARY} crypt32)
+ find_package_handle_standard_args(OpenSSL
+ REQUIRED_VARS
+ OPENSSL_SSL_LIBRARY
+ OPENSSL_CRYPTO_LIBRARY
+ OPENSSL_INCLUDE_DIR
+ VERSION_VAR
+ OPENSSL_VERSION
+ FAIL_MESSAGE
+ "Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the system variable OPENSSL_ROOT_DIR"
+ )
+else()
+ find_package(OpenSSL REQUIRED)
+endif()
include_directories(${OPENSSL_INCLUDE_DIR})
target_link_libraries(lib_crypto PUBLIC ${OPENSSL_LIBRARIES})
diff --git a/infrastructure/cmake/windows/CMakeLists.txt b/infrastructure/cmake/windows/CMakeLists.txt
index 80d1369b..49a1ea4d 100644
--- a/infrastructure/cmake/windows/CMakeLists.txt
+++ b/infrastructure/cmake/windows/CMakeLists.txt
@@ -15,9 +15,9 @@ set(ZLIB_VERSION 1.2.11)
set(ZLIB_HASH SHA256=c3e5e9fdd5004dcb542feda5ee4f0ff0744628baf8ed2dd5d66f8ca1197cb1a1)
# Version of OpenSSL to download, build, and compile Box Backup against:
-set(OPENSSL_VERSION 1.0.2j)
+set(OPENSSL_VERSION 1.1.0g)
# Hash of openssl-${OPENSSL_VERSION}.tar.gz, to be verified after download:
-set(OPENSSL_HASH SHA256=e7aff292be21c259c6af26469c7a9b3ba26e9abaaffd325e3dccc9785256c431)
+set(OPENSSL_HASH SHA256=de4d501267da39310905cb6dc8c6121f7a2cad45a7707f76df828fe1b85073af)
# Version of PCRE to download, build, and compile Box Backup against:
set(PCRE_VERSION 8.39)
@@ -49,15 +49,21 @@ if(WIN32)
URL "https://www.openssl.org/source/openssl-${OPENSSL_VERSION}.tar.gz"
URL_HASH ${OPENSSL_HASH}
DOWNLOAD_NO_PROGRESS 1
- CONFIGURE_COMMAND perl Configure debug-VC-WIN32 no-asm --prefix=${install_dir}
- COMMAND cmd /c ms\\do_ms.bat
+ CONFIGURE_COMMAND perl Configure debug-VC-WIN32 no-asm no-shared
+ --prefix=${install_dir}
+ --openssldir=etc
+ # Run tests before install, but don't make the main target depend on them, so that
+ # we don't have to run them whenever we build manually on Windows.
+ TEST_BEFORE_INSTALL 1
+ TEST_EXCLUDE_FROM_MAIN 1
# You would expect us to use nt.mak to compile a static library here, but mk1mf.pl uses the /MT[d]
# CRT in that case, which is incompatible with our dynamic runtime, /MD[d]. It seems that the libs
# built by ntdll.mak, which are compiled with /MD[d], are full libraries and not import libs,
# so we can link statically against them and still get a dynamic runtime.
BUILD_IN_SOURCE 1
- BUILD_COMMAND nmake /s /f ms\\nt.mak
- INSTALL_COMMAND nmake /s /f ms\\nt.mak install
+ BUILD_COMMAND nmake /s
+ TEST_COMMAND nmake /s test
+ INSTALL_COMMAND nmake /s install
)
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
ExternalProject_Add(openssl
@@ -100,6 +106,8 @@ ExternalProject_Add(boost
URL "http://downloads.sourceforge.net/project/boost/boost/${BOOST_VERSION}/boost_${BOOST_VERSION_UNDERSCORES}.tar.bz2"
URL_HASH ${BOOST_HASH}
# DOWNLOAD_NO_PROGRESS 1
+ # Disable automatic updating (untarring) as it's slow and not necessary
+ UPDATE_DISCONNECTED 1
CONFIGURE_COMMAND ${CMAKE_COMMAND} -E echo "No configure step needed"
BUILD_COMMAND ${CMAKE_COMMAND} -E echo "No build step needed"
INSTALL_COMMAND ${CMAKE_COMMAND} -E echo "No install step needed"
@@ -124,5 +132,6 @@ ExternalProject_Add(boxbackup
-DDEBUG=${DEBUG}
${boxbackup_cmake_args}
${SUB_CMAKE_EXTRA_ARGS}
- STEP_TARGETS configure build install
+ INSTALL_COMMAND ${CMAKE_COMMAND} -E echo "No install step needed"
+ STEP_TARGETS configure build
)
diff --git a/infrastructure/m4/boxbackup_tests.m4 b/infrastructure/m4/boxbackup_tests.m4
index 7410159a..59467e66 100644
--- a/infrastructure/m4/boxbackup_tests.m4
+++ b/infrastructure/m4/boxbackup_tests.m4
@@ -357,4 +357,10 @@ fi
;;
esac
-
+AC_CHECK_PROGS(default_debugger, [lldb gdb])
+AC_ARG_WITH([debugger],
+ [AS_HELP_STRING([--with-debugger=<gdb|lldb|...>],
+ [use this debugger in t-gdb scripts to debug tests @<:@default=lldb if present, otherwise gdb@:>@])],
+ [],
+ [with_debugger=$default_debugger])
+AC_SUBST([with_debugger])
diff --git a/infrastructure/makebuildenv.pl.in b/infrastructure/makebuildenv.pl.in
index 597b6f82..d5ac9f2f 100755
--- a/infrastructure/makebuildenv.pl.in
+++ b/infrastructure/makebuildenv.pl.in
@@ -379,6 +379,7 @@ $default_cflags =~ s/ -O2//g;
$default_cxxflags =~ s/ -O2//g;
my $debug_base_dir = 'debug';
my $release_base_dir = 'release';
+my $debugger = '@with_debugger@';
my $release_flags = "-O2";
if ($target_windows)
@@ -390,6 +391,9 @@ if ($target_windows)
print "done\n\nGenerating Makefiles...\n";
my $makefile_ifdef_prefix = $bsd_make ? "." : "";
+my $autoconf_cppflags = '@CPPFLAGS@';
+my $autoconf_cxxflags = '@CXXFLAGS_STRICT@';
+my $autoconf_ldflags = '@LDFLAGS@';
open MASTER_MAKEFILE, ">Makefile" or die "Makefile: $!";
print MASTER_MAKEFILE <<__E;
@@ -411,13 +415,13 @@ WINDRES = @WINDRES@
# Work around a mistake in QDBM (using <angled> includes for a file not in the
# system path) by adding it to the include path with -I.
-DEFAULT_CFLAGS = \@CPPFLAGS@ $default_cflags \@CXXFLAGS_STRICT@ \\
+DEFAULT_CFLAGS = $autoconf_cppflags $default_cflags $autoconf_cxxflags \\
$extra_platform_defines $platform_compile_line_extra \\
-DBOX_VERSION="\\"$product_version\\"" -Iqdbm
-DEFAULT_CXXFLAGS = \@CPPFLAGS@ $default_cxxflags \@CXXFLAGS_STRICT@ \\
+DEFAULT_CXXFLAGS = $autoconf_cppflags $default_cxxflags $autoconf_cxxflags \\
$extra_platform_defines $platform_compile_line_extra \\
-DBOX_VERSION="\\"$product_version\\""
-LDFLAGS += \@LDFLAGS@ \@LDADD_RDYNAMIC@ $platform_link_line_extra
+LDFLAGS += $autoconf_ldflags \@LDADD_RDYNAMIC@ $platform_link_line_extra
RELEASE_CFLAGS = \$(DEFAULT_CFLAGS) -DBOX_RELEASE_BUILD $release_flags
RELEASE_CXXFLAGS = \$(DEFAULT_CXXFLAGS) -DBOX_RELEASE_BUILD $release_flags
@@ -614,9 +618,18 @@ __E
writetestfile("$mod/t", "GLIBCXX_FORCE_NEW=1 ".
'./_test' . $platform_exe_ext . ' "$@"', $mod);
- writetestfile("$mod/t-gdb", "GLIBCXX_FORCE_NEW=1 ".
- 'gdb ./_test' . $platform_exe_ext . ' "$@"', $mod);
-
+
+ if($debugger)
+ {
+ writetestfile("$mod/t-gdb", "GLIBCXX_FORCE_NEW=1 ".
+ $debugger . ' ./_test' . $platform_exe_ext . ' "$@"', $mod);
+ }
+ else
+ {
+ writetestfile("$mod/t-gdb",
+ "echo 'No debugger was detected by configure script'\n".
+ "exit 2");
+ }
}
my @all_deps_for_module;