comparison Resources/CMake/OpenSslConfigurationStatic-1.1.1.cmake @ 3722:a49d49d945c9

fixing openssl compilation
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 05 Mar 2020 19:48:19 +0100
parents c575fb0adf91
children cc6d4edfe8fe
comparison
equal deleted inserted replaced
3721:c575fb0adf91 3722:a49d49d945c9
19 } 19 }
20 ") 20 ")
21 file(WRITE ${OPENSSL_SOURCES_DIR}/crypto/include/internal/bn_conf.h "") 21 file(WRITE ${OPENSSL_SOURCES_DIR}/crypto/include/internal/bn_conf.h "")
22 file(WRITE ${OPENSSL_SOURCES_DIR}/crypto/include/internal/dso_conf.h "") 22 file(WRITE ${OPENSSL_SOURCES_DIR}/crypto/include/internal/dso_conf.h "")
23 23
24 # Enabling deprecated API is needed for civetweb 24 configure_file(
25 # file(WRITE ${OPENSSL_SOURCES_DIR}/include/openssl/opensslconf.h " 25 ${ORTHANC_ROOT}/Resources/Patches/openssl-1.1.1d-conf.h.in
26 # #define DEPRECATEDIN_1_2_0(f) f; 26 ${OPENSSL_SOURCES_DIR}/include/openssl/opensslconf.h
27 # #define DEPRECATEDIN_1_1_0(f) f; 27 )
28 # #define DEPRECATEDIN_0_9_8(f) f;
29 # ")
30 28
31 # Apply the patches 29 # Apply the patches
32 execute_process( 30 execute_process(
33 COMMAND ${PATCH_EXECUTABLE} -p0 -N -i 31 COMMAND ${PATCH_EXECUTABLE} -p0 -N -i
34 ${ORTHANC_ROOT}/Resources/Patches/openssl-1.1.1d.patch 32 ${ORTHANC_ROOT}/Resources/Patches/openssl-1.1.1d.patch
71 -DOPENSSL_NO_SEED 69 -DOPENSSL_NO_SEED
72 -DOPENSSL_NO_WHIRLPOOL 70 -DOPENSSL_NO_WHIRLPOOL
73 -DOPENSSL_NO_RIPEMD 71 -DOPENSSL_NO_RIPEMD
74 72
75 -DOPENSSLDIR="/usr/local/ssl" 73 -DOPENSSLDIR="/usr/local/ssl"
76 -DOPENSSL_NO_ERR 74 )
77 )
78
79
80 if ("${CMAKE_SYSTEM_VERSION}" STREQUAL "LinuxStandardBase")
81 # In order for "crypto/mem_sec.c" to compile on LSB
82 add_definitions(-DOPENSSL_NO_SECURE_MEMORY)
83 endif()
84 75
85 76
86 include_directories( 77 include_directories(
87 ${OPENSSL_SOURCES_DIR} 78 ${OPENSSL_SOURCES_DIR}
88 ${OPENSSL_SOURCES_DIR}/crypto 79 ${OPENSSL_SOURCES_DIR}/crypto
208 ${OPENSSL_SOURCES_DIR}/crypto/ec/ecp_nistz256_table.c 199 ${OPENSSL_SOURCES_DIR}/crypto/ec/ecp_nistz256_table.c
209 ${OPENSSL_SOURCES_DIR}/crypto/engine/eng_devcrypto.c 200 ${OPENSSL_SOURCES_DIR}/crypto/engine/eng_devcrypto.c
210 ${OPENSSL_SOURCES_DIR}/crypto/ppccap.c 201 ${OPENSSL_SOURCES_DIR}/crypto/ppccap.c
211 ${OPENSSL_SOURCES_DIR}/crypto/s390xcap.c 202 ${OPENSSL_SOURCES_DIR}/crypto/s390xcap.c
212 ${OPENSSL_SOURCES_DIR}/crypto/sparcv9cap.c 203 ${OPENSSL_SOURCES_DIR}/crypto/sparcv9cap.c
204 ${OPENSSL_SOURCES_DIR}/crypto/poly1305/poly1305_base2_44.c # Cannot be compiled with MinGW
205 ${OPENSSL_SOURCES_DIR}/crypto/poly1305/poly1305_ieee754.c # Cannot be compiled with MinGW
213 ) 206 )
214 207
215 # Check out "${OPENSSL_SOURCES_DIR}/Configurations/README": "This is 208 # Check out "${OPENSSL_SOURCES_DIR}/Configurations/README": "This is
216 # default if no option is specified, it works on any supported 209 # default if no option is specified, it works on any supported
217 # system." It is mandatory to define it as a macro, as it is used by 210 # system." It is mandatory to define it as a macro, as it is used by
221 214
222 if ("${CMAKE_SYSTEM_NAME}" STREQUAL "Windows") 215 if ("${CMAKE_SYSTEM_NAME}" STREQUAL "Windows")
223 set(OPENSSL_DEFINITIONS 216 set(OPENSSL_DEFINITIONS
224 "${OPENSSL_DEFINITIONS};OPENSSL_SYSNAME_WIN32;SO_WIN32;WIN32_LEAN_AND_MEAN;L_ENDIAN;NO_WINDOWS_BRAINDEATH") 217 "${OPENSSL_DEFINITIONS};OPENSSL_SYSNAME_WIN32;SO_WIN32;WIN32_LEAN_AND_MEAN;L_ENDIAN;NO_WINDOWS_BRAINDEATH")
225 218
226 if (ENABLE_OPENSSL_ENGINES) 219 #if (ENABLE_OPENSSL_ENGINES)
227 link_libraries(crypt32) 220 # link_libraries(crypt32)
221 #endif()
222
223 add_definitions(
224 -DOPENSSL_RAND_SEED_OS # ${OPENSSL_SOURCES_DIR}/crypto/rand/rand_win.c
225 )
226
227 if (CMAKE_COMPILER_IS_GNUCXX) # MinGW
228 add_definitions(
229 -DOPENSSL_NO_CRYPTO_MDEBUG_BACKTRACE
230 )
228 endif() 231 endif()
229 endif() 232
233 elseif ("${CMAKE_SYSTEM_VERSION}" STREQUAL "LinuxStandardBase")
234 # In order for "crypto/mem_sec.c" to compile on LSB
235 add_definitions(
236 -DOPENSSL_NO_SECURE_MEMORY
237 -DOPENSSL_NO_CRYPTO_MDEBUG_BACKTRACE
238 )
239 endif()
240
230 241
231 set_source_files_properties( 242 set_source_files_properties(
232 ${OPENSSL_SOURCES} 243 ${OPENSSL_SOURCES}
233 PROPERTIES COMPILE_DEFINITIONS 244 PROPERTIES COMPILE_DEFINITIONS
234 "${OPENSSL_DEFINITIONS};DSO_NONE" 245 "${OPENSSL_DEFINITIONS};DSO_NONE"