mirror of
https://github.com/curl/curl.git
synced 2026-08-26 19:03:32 +03:00
build: tidy up and improve versioned-symbols options
- autotools: add support for custom prefix.
Usage: `--enable-versioned-symbols=MYPREFIX_`
Catching up with cmake.
- add default versioned prefix for Rustls builds.
- delete `HIDDEN` entry from version script `lib/libcurl.vers.in`.
It referred to symbol names that never existed in libcurl.
- cmake: use `lib/libcurl.vers.in` as a template instead of generating
it from scratch. Adapt `./configure` accordingly, and add comments
to keep hard-wired soname in sync with `lib/Makefile.soname`.
- autotools: delete Schannel and Secure Transport version prefixes.
Windows and macOS don't support the versioned symbols option.
Follow-up to 7b14449790 #14378
Closes #14818
This commit is contained in:
parent
30ab1133c4
commit
7100c5bc9b
4 changed files with 26 additions and 29 deletions
|
|
@ -238,15 +238,18 @@ if(BUILD_SHARED_LIBS)
|
|||
set(CURL_LIBCURL_VERSIONED_SYMBOLS_PREFIX "WOLFSSL_")
|
||||
elseif(CURL_USE_GNUTLS)
|
||||
set(CURL_LIBCURL_VERSIONED_SYMBOLS_PREFIX "GNUTLS_")
|
||||
elseif(CURL_USE_RUSTLS)
|
||||
set(CURL_LIBCURL_VERSIONED_SYMBOLS_PREFIX "RUSTLS_")
|
||||
endif()
|
||||
endif()
|
||||
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/libcurl.vers" "
|
||||
HIDDEN {};
|
||||
CURL_${CURL_LIBCURL_VERSIONED_SYMBOLS_PREFIX}${_cmakesoname}
|
||||
{
|
||||
global: curl_*;
|
||||
local: *;
|
||||
};")
|
||||
# Generate version script for the linker, for versioned symbols.
|
||||
# Consumed variables:
|
||||
# CURL_LIBCURL_VERSIONED_SYMBOLS_PREFIX
|
||||
# CURL_LIBCURL_VERSIONED_SYMBOLS_SONAME
|
||||
set(CURL_LIBCURL_VERSIONED_SYMBOLS_SONAME ${_cmakesoname})
|
||||
configure_file(
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/libcurl.vers.in"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/libcurl.vers" @ONLY)
|
||||
include(CheckCSourceCompiles)
|
||||
set(CMAKE_REQUIRED_LINK_OPTIONS "-Wl,--version-script=${CMAKE_CURRENT_BINARY_DIR}/libcurl.vers")
|
||||
check_c_source_compiles("int main(void) { return 0; }" HAVE_VERSIONED_SYMBOLS)
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@
|
|||
#
|
||||
###########################################################################
|
||||
|
||||
# Keep in sync with CURL_LIBCURL_VERSIONED_SYMBOLS_SONAME in configure.ac
|
||||
VERSIONCHANGE=12
|
||||
VERSIONADD=0
|
||||
VERSIONDEL=8
|
||||
|
|
|
|||
|
|
@ -1,12 +1,4 @@
|
|||
HIDDEN
|
||||
{
|
||||
local:
|
||||
__*;
|
||||
_rest*;
|
||||
_save*;
|
||||
};
|
||||
|
||||
CURL_@CURL_LT_SHLIB_VERSIONED_FLAVOUR@4
|
||||
CURL_@CURL_LIBCURL_VERSIONED_SYMBOLS_PREFIX@@CURL_LIBCURL_VERSIONED_SYMBOLS_SONAME@
|
||||
{
|
||||
global: curl_*;
|
||||
local: *;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue