Skip to content

Commit

Permalink
Remove EXTRA_EXPORT and LIBTLS_EXTRA_EXPORT
Browse files Browse the repository at this point in the history
Fixes #969
  • Loading branch information
botovq committed Dec 13, 2023
1 parent 05902e6 commit 798bf14
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 53 deletions.
45 changes: 0 additions & 45 deletions crypto/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -750,37 +750,18 @@ endif()

if(WIN32)
set(CRYPTO_SRC ${CRYPTO_SRC} compat/posix_win.c)
set(EXTRA_EXPORT ${EXTRA_EXPORT} gettimeofday)
set(EXTRA_EXPORT ${EXTRA_EXPORT} getuid)
set(EXTRA_EXPORT ${EXTRA_EXPORT} posix_perror)
set(EXTRA_EXPORT ${EXTRA_EXPORT} posix_fopen)
set(EXTRA_EXPORT ${EXTRA_EXPORT} posix_fgets)
set(EXTRA_EXPORT ${EXTRA_EXPORT} posix_open)
set(EXTRA_EXPORT ${EXTRA_EXPORT} posix_rename)
set(EXTRA_EXPORT ${EXTRA_EXPORT} posix_connect)
set(EXTRA_EXPORT ${EXTRA_EXPORT} posix_close)
set(EXTRA_EXPORT ${EXTRA_EXPORT} posix_read)
set(EXTRA_EXPORT ${EXTRA_EXPORT} posix_write)
set(EXTRA_EXPORT ${EXTRA_EXPORT} posix_getsockopt)
set(EXTRA_EXPORT ${EXTRA_EXPORT} posix_setsockopt)
endif()

if(NOT HAVE_ASPRINTF)
set(CRYPTO_SRC ${CRYPTO_SRC} compat/bsd-asprintf.c)
set(EXTRA_EXPORT ${EXTRA_EXPORT} libressl_asprintf)
set(EXTRA_EXPORT ${EXTRA_EXPORT} libressl_vasprintf)
endif()

if(NOT HAVE_FREEZERO)
set(CRYPTO_SRC ${CRYPTO_SRC} compat/freezero.c)
set(EXTRA_EXPORT ${EXTRA_EXPORT} libressl_freezero)
endif()

if(NOT HAVE_GETOPT)
set(CRYPTO_SRC ${CRYPTO_SRC} compat/getopt_long.c)
set(EXTRA_EXPORT ${EXTRA_EXPORT} getopt)
set(EXTRA_EXPORT ${EXTRA_EXPORT} optarg)
set(EXTRA_EXPORT ${EXTRA_EXPORT} optind)
endif()

if(NOT HAVE_GETPAGESIZE)
Expand All @@ -799,46 +780,37 @@ endif()

if(NOT HAVE_REALLOCARRAY)
set(CRYPTO_SRC ${CRYPTO_SRC} compat/reallocarray.c)
set(EXTRA_EXPORT ${EXTRA_EXPORT} libressl_reallocarray)
endif()

if(NOT HAVE_RECALLOCARRAY)
set(CRYPTO_SRC ${CRYPTO_SRC} compat/recallocarray.c)
set(EXTRA_EXPORT ${EXTRA_EXPORT} libressl_recallocarray)
endif()

if(NOT HAVE_STRCASECMP)
set(CRYPTO_SRC ${CRYPTO_SRC} compat/strcasecmp.c)
set(EXTRA_EXPORT ${EXTRA_EXPORT} libressl_strcasecmp)
endif()

if(NOT HAVE_STRLCAT)
set(CRYPTO_SRC ${CRYPTO_SRC} compat/strlcat.c)
set(EXTRA_EXPORT ${EXTRA_EXPORT} libressl_strlcat)
endif()

if(NOT HAVE_STRLCPY)
set(CRYPTO_SRC ${CRYPTO_SRC} compat/strlcpy.c)
set(EXTRA_EXPORT ${EXTRA_EXPORT} libressl_strlcpy)
endif()

if(NOT HAVE_STRNDUP)
set(CRYPTO_SRC ${CRYPTO_SRC} compat/strndup.c)
set(EXTRA_EXPORT ${EXTRA_EXPORT} libressl_strndup)
if(NOT HAVE_STRNLEN)
set(CRYPTO_SRC ${CRYPTO_SRC} compat/strnlen.c)
set(EXTRA_EXPORT ${EXTRA_EXPORT} libressl_strnlen)
endif()
endif()

if(NOT HAVE_STRSEP)
set(CRYPTO_SRC ${CRYPTO_SRC} compat/strsep.c)
set(EXTRA_EXPORT ${EXTRA_EXPORT} libressl_strsep)
endif()

if(NOT HAVE_STRTONUM)
set(CRYPTO_SRC ${CRYPTO_SRC} compat/strtonum.c)
set(EXTRA_EXPORT ${EXTRA_EXPORT} libressl_strtonum)
endif()

if(NOT HAVE_SYSLOG_R)
Expand All @@ -847,7 +819,6 @@ endif()

if(NOT HAVE_TIMEGM)
set(CRYPTO_SRC ${CRYPTO_SRC} compat/timegm.c)
set(EXTRA_EXPORT ${EXTRA_EXPORT} timegm)
endif()

if(NOT HAVE_EXPLICIT_BZERO)
Expand All @@ -857,15 +828,11 @@ if(NOT HAVE_EXPLICIT_BZERO)
set(CRYPTO_SRC ${CRYPTO_SRC} compat/explicit_bzero.c)
set_source_files_properties(compat/explicit_bzero.c PROPERTIES COMPILE_FLAGS -O0)
endif()
set(EXTRA_EXPORT ${EXTRA_EXPORT} libressl_explicit_bzero)
endif()

if(NOT HAVE_ARC4RANDOM_BUF)
set(CRYPTO_SRC ${CRYPTO_SRC} compat/arc4random.c)
set(CRYPTO_SRC ${CRYPTO_SRC} compat/arc4random_uniform.c)
set(EXTRA_EXPORT ${EXTRA_EXPORT} libressl_arc4random)
set(EXTRA_EXPORT ${EXTRA_EXPORT} libressl_arc4random_buf)
set(EXTRA_EXPORT ${EXTRA_EXPORT} libressl_arc4random_uniform)

if(NOT HAVE_GETENTROPY)
if(WIN32)
Expand All @@ -885,18 +852,15 @@ if(NOT HAVE_ARC4RANDOM_BUF)
elseif(CMAKE_SYSTEM_NAME MATCHES "SunOS")
set(CRYPTO_SRC ${CRYPTO_SRC} compat/getentropy_solaris.c)
endif()
set(EXTRA_EXPORT ${EXTRA_EXPORT} getentropy)
endif()
endif()

if(NOT HAVE_TIMINGSAFE_BCMP)
set(CRYPTO_SRC ${CRYPTO_SRC} compat/timingsafe_bcmp.c)
set(EXTRA_EXPORT ${EXTRA_EXPORT} libressl_timingsafe_bcmp)
endif()

if(NOT HAVE_TIMINGSAFE_MEMCMP)
set(CRYPTO_SRC ${CRYPTO_SRC} compat/timingsafe_memcmp.c)
set(EXTRA_EXPORT ${EXTRA_EXPORT} libressl_timingsafe_memcmp)
endif()

if(NOT ENABLE_ASM)
Expand All @@ -919,15 +883,6 @@ foreach(SYM IN LISTS CRYPTO_UNEXPORT)
string(REPLACE "${SYM}\n" "" SYMS ${SYMS})
endforeach()
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/crypto_p.sym ${SYMS})
# XXX should we still be doing this?
if(EXTRA_EXPORT)
list(SORT EXTRA_EXPORT)
foreach(SYM IN LISTS EXTRA_EXPORT)
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/crypto_p.sym "${SYM}\n")
endforeach()
endif()

set(LIBTLS_EXTRA_EXPORT ${EXTRA_EXPORT} PARENT_SCOPE)

add_library(crypto_obj OBJECT ${CRYPTO_SRC})
target_include_directories(crypto_obj
Expand Down
8 changes: 0 additions & 8 deletions tls/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,12 @@ if(WIN32)
compat/pread.c
compat/pwrite.c
)

set(LIBTLS_EXTRA_EXPORT ${LIBTLS_EXTRA_EXPORT} ftruncate)
endif()

add_definitions(-DTLS_DEFAULT_CA_FILE=\"${OPENSSLDIR}/cert.pem\")

file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/tls.sym DESTINATION
${CMAKE_CURRENT_BINARY_DIR})
if(LIBTLS_EXTRA_EXPORT)
list(SORT LIBTLS_EXTRA_EXPORT)
foreach(SYM IN LISTS LIBTLS_EXTRA_EXPORT)
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/tls.sym "${SYM}\n")
endforeach()
endif()

add_library(tls_obj OBJECT ${TLS_SRC})
target_include_directories(tls_obj
Expand Down

0 comments on commit 798bf14

Please sign in to comment.