-
Notifications
You must be signed in to change notification settings - Fork 107
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[cmake] Update static dependencies to fix build issues (#272)
* Update mariadb-connector-c to 3.3.4 Fixes #216 * Update apache, apr, and aprutil This means we no longer need to use the trunk version for mac, since the new releases have the desired patches for: https://bz.apache.org/bugzilla/show_bug.cgi?id=64753 Also means we no longer need pcre1, since now apache can use pcre2. Apache 2.4.55, apr 1.7.2, and aprutil 1.6.3. * Update remaining dependencies OpenSSL 1.1.1t, pcre2 10.42, SQLite 3.40.1, and MbedTLS 2.28.2 * Remove unneeded cmake scripts * Use sha256 for zlib instead of md5 * Reuse zlib build for mariadbconnector This allows mariadbconnector to reuse the static zlib build created for zlib.ndll, or to use the system version otherwise on unix systems. * Fix pcre linking * Fix make cflags for pcre2 build on mac * Fix and update cmake patches Remove obsolete patches Avoid patch error with semicolons https://stackoverflow.com/questions/72098319/cmake-string-replace-removes-semi-colon * Fix openssl linking for mariadbconnector Should ensure static linking on all platforms if STATIC_OPENSSL is set. * Cleanup openssl config * Remove openssl config from aprutil build These flags are not enough to build aprutil with openssl support, so they have had no effect even for aprutil 1.5.4. * Update cmake version to 3.14 This gives access to FindSQLite3. * Fix new aprutil build on windows We now have to download and build the expat library separately, as it is no longer bundled with aprutil. This requires patching the aprutil cmakelists file, as cmake's findexpat script is currently quite limited. See: https://gitlab.kitware.com/cmake/cmake/-/issues/24422 It also requires setting the CMP0074 policy (available from cmake 3.12) when building aprutil, so that EXPAT_ROOT is not ignored. * Fix apache static linking to pcre on windows * Update changelog * Fix azure pipeline step name * Use add_compile_definitions We can use this now with cmake 3.12+ * Avoid error when only Apache is set in STATIC_DEPS If Apache was set in STATIC_DEPS, but not APR or APRutil, this would cause a build error previously. * Fix GNUInstallDirs warning project() call should come first * Clean up minor issues * Remove call to find openssl If we are not doing a static build, then there is no reason to know anything about the openssl library. That will be handled by the mariadbconnector build scripts. * Fix "WARNING: OpenSSL version is too old" * Fix openssl static linking * Add version check for expat locating code * Clean up cmake version checks * Fix "no known rule" error for libssl.a * Update CHANGES * Fix changelog * Restore cmake 3.10.2 support * Add warning about CMake 3.12 on Windows When building APRutil, we rely on EXPAT_ROOT for finding expat, which is only available with CMP0074 on CMake 3.12+. This means building APRutil on Windows will fail if CMake is older than 3.12. * Remove redundant policy setting This policy is from CMake 3.9, so it gets set automatically with: cmake_minimum_required(VERSION 3.10.2) * Update mbedtls to 2.28.3 --------- Co-authored-by: Simon Krajewski <[email protected]>
- Loading branch information
Showing
22 changed files
with
395 additions
and
410 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
# https://gitlab.kitware.com/cmake/cmake/-/blob/master/Modules/FindSQLite3.cmake | ||
|
||
#[==[ | ||
CMake - Cross Platform Makefile Generator | ||
Copyright 2000-2023 Kitware, Inc. and Contributors | ||
All rights reserved. | ||
|
||
Redistribution and use in source and binary forms, with or without | ||
modification, are permitted provided that the following conditions | ||
are met: | ||
|
||
* Redistributions of source code must retain the above copyright | ||
notice, this list of conditions and the following disclaimer. | ||
|
||
* Redistributions in binary form must reproduce the above copyright | ||
notice, this list of conditions and the following disclaimer in the | ||
documentation and/or other materials provided with the distribution. | ||
|
||
* Neither the name of Kitware, Inc. nor the names of Contributors | ||
may be used to endorse or promote products derived from this | ||
software without specific prior written permission. | ||
|
||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
]==] | ||
|
||
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying | ||
# file Copyright.txt or https://cmake.org/licensing for details. | ||
|
||
#[=======================================================================[.rst: | ||
FindSQLite3 | ||
----------- | ||
|
||
.. versionadded:: 3.14 | ||
|
||
Find the SQLite libraries, v3 | ||
|
||
IMPORTED targets | ||
^^^^^^^^^^^^^^^^ | ||
|
||
This module defines the following :prop_tgt:`IMPORTED` target: | ||
|
||
``SQLite::SQLite3`` | ||
|
||
Result variables | ||
^^^^^^^^^^^^^^^^ | ||
|
||
This module will set the following variables if found: | ||
|
||
``SQLite3_INCLUDE_DIRS`` | ||
where to find sqlite3.h, etc. | ||
``SQLite3_LIBRARIES`` | ||
the libraries to link against to use SQLite3. | ||
``SQLite3_VERSION`` | ||
version of the SQLite3 library found | ||
``SQLite3_FOUND`` | ||
TRUE if found | ||
|
||
#]=======================================================================] | ||
|
||
|
||
# Look for the necessary header | ||
find_path(SQLite3_INCLUDE_DIR NAMES sqlite3.h) | ||
mark_as_advanced(SQLite3_INCLUDE_DIR) | ||
|
||
# Look for the necessary library | ||
find_library(SQLite3_LIBRARY NAMES sqlite3 sqlite) | ||
mark_as_advanced(SQLite3_LIBRARY) | ||
|
||
# Extract version information from the header file | ||
if(SQLite3_INCLUDE_DIR) | ||
file(STRINGS ${SQLite3_INCLUDE_DIR}/sqlite3.h _ver_line | ||
REGEX "^#define SQLITE_VERSION *\"[0-9]+\\.[0-9]+\\.[0-9]+\"" | ||
LIMIT_COUNT 1) | ||
string(REGEX MATCH "[0-9]+\\.[0-9]+\\.[0-9]+" | ||
SQLite3_VERSION "${_ver_line}") | ||
unset(_ver_line) | ||
endif() | ||
|
||
include(FindPackageHandleStandardArgs) | ||
find_package_handle_standard_args(SQLite3 | ||
REQUIRED_VARS SQLite3_INCLUDE_DIR SQLite3_LIBRARY | ||
VERSION_VAR SQLite3_VERSION) | ||
|
||
# Create the imported target | ||
if(SQLite3_FOUND) | ||
set(SQLite3_INCLUDE_DIRS ${SQLite3_INCLUDE_DIR}) | ||
set(SQLite3_LIBRARIES ${SQLite3_LIBRARY}) | ||
if(NOT TARGET SQLite::SQLite3) | ||
add_library(SQLite::SQLite3 UNKNOWN IMPORTED) | ||
set_target_properties(SQLite::SQLite3 PROPERTIES | ||
IMPORTED_LOCATION "${SQLite3_LIBRARY}" | ||
INTERFACE_INCLUDE_DIRECTORIES "${SQLite3_INCLUDE_DIR}") | ||
endif() | ||
endif() |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# https://github.com/apache/httpd/commit/dd4561dd17a669a8c1757ada0ca875dfa840d0e7 | ||
# https://github.com/apache/httpd/pull/343 | ||
|
||
set(cmakelists ${apache_source}/CMakeLists.txt) | ||
|
||
file(READ ${cmakelists} content) | ||
|
||
string(REPLACE | ||
"pcre2-8d.lib" | ||
"pcre2-8-staticd.lib" | ||
content "${content}" | ||
) | ||
|
||
string(REPLACE | ||
"pcre2-8.lib" | ||
"pcre2-8-static.lib" | ||
content "${content}" | ||
) | ||
|
||
string(REPLACE | ||
"\"-DHAVE_PCRE2\"" | ||
"\"-DHAVE_PCRE2 -DPCRE2_STATIC\"" | ||
content "${content}" | ||
) | ||
|
||
file(WRITE ${cmakelists} "${content}") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# This is necessary so that the CMAKE_FIND_LIBRARY_SUFFIXES is preserved when | ||
# locating expat, since it gets reset when PROJECT is called | ||
|
||
set(cmakelists "${apr-util_source}/CMakeLists.txt") | ||
|
||
file(READ ${cmakelists} content) | ||
|
||
string(REPLACE | ||
"PROJECT(APR-Util C) | ||
CMAKE_MINIMUM_REQUIRED(VERSION 2.8) | ||
FIND_PACKAGE(OpenSSL) | ||
FIND_PACKAGE(EXPAT)" | ||
|
||
"CMAKE_MINIMUM_REQUIRED(VERSION 2.8) | ||
FIND_PACKAGE(OpenSSL) | ||
FIND_PACKAGE(EXPAT) | ||
PROJECT(APR-Util C)" | ||
|
||
content "${content}" | ||
) | ||
|
||
file(WRITE ${cmakelists} "${content}") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.