From abf4e369f5dc3d2688b7206f79996f9c8f045c3d Mon Sep 17 00:00:00 2001 From: reshke Date: Thu, 31 Aug 2023 13:25:58 +0500 Subject: [PATCH] Add makefile and CMakeFiles code to use custom openssl in build (#529) * Add makefile and CMakeFiles code to use custom openssl in build * APlyy fmt and rebase --- CMakeLists.txt | 8 ++++++++ Makefile | 4 ++-- sources/auth.c | 2 +- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 298727815..8fd16af99 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -90,6 +90,10 @@ find_package(PostgreSQL REQUIRED) set(od_libraries ${od_libraries} ${POSTGRESQL_LIBRARY} ${POSTGRESQL_LIBPGPORT} ${PQ_LIBRARY}) include_directories(${POSTGRESQL_INCLUDE_DIR}) +set(OPENSSL_INCLUDE_DIR $ENV{OPENSSL_INCLUDE_DIR}) +set(OPENSSL_LIBRARIES $ENV{OPENSSL_LIBRARIES}) +set(OPENSSL_VERSION $ENV{OPENSSL_VERSION}) + # use BoringSSL or OpenSSL option(USE_BORINGSSL "Use BoringSSL" OFF) if (USE_BORINGSSL) @@ -103,6 +107,10 @@ elseif ("${OPENSSL_LIBRARIES}" STREQUAL "") set(od_ssl ${OPENSSL_LIBRARIES}) include_directories(${OPENSSL_INCLUDE_DIR}) add_definitions(-DUSE_SSL) +else () + set(od_ssl ${OPENSSL_LIBRARIES}) + include_directories(${OPENSSL_INCLUDE_DIR}) + add_definitions(-DUSE_SSL) endif () # use PAM diff --git a/Makefile b/Makefile index 0f88622d0..1ce2e43cf 100644 --- a/Makefile +++ b/Makefile @@ -23,8 +23,8 @@ clean: rm -fr $(BUILD_TEST_ASAN_DIR) local_build: clean - $(CMAKE_BIN) -S $(ODY_DIR) -B$(BUILD_TEST_DIR) -DCMAKE_BUILD_TYPE=$(BUILD_TYPE) $(CMAKE_FLAGS) - make -C$(BUILD_TEST_DIR) -j$(COMPILE_CONCURRENCY) + +$(CMAKE_BIN) -S $(ODY_DIR) -B$(BUILD_TEST_DIR) -DCMAKE_BUILD_TYPE=$(BUILD_TYPE) $(CMAKE_FLAGS) + +make -C$(BUILD_TEST_DIR) -j$(COMPILE_CONCURRENCY) local_run: $(BUILD_TEST_DIR)/sources/odyssey $(DEV_CONF) diff --git a/sources/auth.c b/sources/auth.c index 2564485ec..d627cd270 100644 --- a/sources/auth.c +++ b/sources/auth.c @@ -335,7 +335,7 @@ static inline int od_auth_frontend_scram_sha_256(od_client_t *client) { od_instance_t *instance = client->global->instance; char *mechanisms[2] = { "SCRAM-SHA-256", "SCRAM-SHA-256-PLUS" }; - + /* request AuthenticationSASL */ machine_msg_t *msg;