Skip to content

Commit

Permalink
Update openssl and curl version for 'PHOTON_BUILD_DEPENDENCIES' option
Browse files Browse the repository at this point in the history
  • Loading branch information
beef9999 committed Nov 13, 2024
1 parent 8cf352f commit 05b0e92
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 36 deletions.
13 changes: 5 additions & 8 deletions .github/workflows/ci.linux.arm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,17 +50,14 @@ jobs:
- uses: actions/checkout@v4
- name: Build
run: |
dnf -q -y install git gcc-c++ cmake gcc-toolset-9-gcc-c++ openssl-devel libcurl-devel
dnf -q -y install autoconf automake libtool
dnf -q -y install git gcc-c++ cmake gcc-toolset-9-gcc-c++
source /opt/rh/gcc-toolset-9/enable
cmake -B build -D CMAKE_BUILD_TYPE=Debug \
-D PHOTON_ENABLE_ECOSYSTEM=ON \
-D PHOTON_BUILD_DEPENDENCIES=ON \
-D PHOTON_BUILD_TESTING=ON \
-D PHOTON_ENABLE_ECOSYSTEM=ON \
-D PHOTON_ENABLE_SASL=OFF \
-D PHOTON_ENABLE_FUSE=OFF \
-D PHOTON_ENABLE_URING=ON \
-D PHOTON_ENABLE_EXTFS=OFF \
-D PHOTON_BUILD_DEPENDENCIES=ON \
-D PHOTON_OPENSSL_SOURCE="" \
-D PHOTON_CURL_SOURCE=""
cmake --build build -j $(nproc) -- VERBOSE=1
-D PHOTON_ENABLE_EXTFS=OFF
cmake --build build -j $(nproc)
32 changes: 10 additions & 22 deletions CMake/build-from-src.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,12 @@ function(build_from_src [dep])
ExternalProject_Add(
openssl
URL ${PHOTON_OPENSSL_SOURCE}
URL_MD5 bad68bb6bd9908da75e2c8dedc536b29
URL_MD5 3f76825f195e52d4b10c70040681a275
UPDATE_DISCONNECTED ON
BUILD_IN_SOURCE ON
CONFIGURE_COMMAND ./config -fPIC --prefix=${BINARY_DIR} --openssldir=${BINARY_DIR} shared
BUILD_COMMAND make -j 1 # https://github.com/openssl/openssl/issues/5762#issuecomment-376622684
INSTALL_COMMAND make -j 1 install
CONFIGURE_COMMAND ./config -fPIC --prefix=${BINARY_DIR} --openssldir=${BINARY_DIR} no-shared
BUILD_COMMAND $(MAKE)
INSTALL_COMMAND $(MAKE) install
LOG_CONFIGURE ON
LOG_BUILD ON
LOG_INSTALL ON
Expand All @@ -104,26 +104,14 @@ function(build_from_src [dep])
ExternalProject_Add(
curl
URL ${PHOTON_CURL_SOURCE}
URL_MD5 a66270f11e3fbfad709600bbd1686704
UPDATE_DISCONNECTED ON
BUILD_IN_SOURCE ON
CONFIGURE_COMMAND autoreconf -i COMMAND ./configure --with-ssl=${OPENSSL_ROOT_DIR}
--without-libssh2 --enable-static --enable-shared=no --enable-optimize
--disable-manual --without-libidn
--disable-ftp --disable-file --disable-ldap --disable-ldaps
--disable-rtsp --disable-dict --disable-telnet --disable-tftp
--disable-pop3 --disable-imap --disable-smb --disable-smtp
--disable-gopher --without-nghttp2 --enable-http --disable-verbose
--with-pic=PIC --prefix=${BINARY_DIR}
BUILD_COMMAND $(MAKE)
INSTALL_COMMAND $(MAKE) install
DEPENDS openssl
LOG_CONFIGURE ON
LOG_BUILD ON
LOG_INSTALL ON
URL_MD5 1211d641ae670cebce361ab6a7c6acff
CMAKE_ARGS -DOPENSSL_ROOT_DIR=${OPENSSL_ROOT_DIR} -DCMAKE_INSTALL_PREFIX=${BINARY_DIR}
-DBUILD_SHARED_LIBS=OFF -DHTTP_ONLY=ON -DBUILD_CURL_EXE=OFF
-DCMAKE_POSITION_INDEPENDENT_CODE=ON
)
add_dependencies(curl openssl)
set(CURL_INCLUDE_DIRS ${BINARY_DIR}/include PARENT_SCOPE)
set(CURL_LIBRARIES ${BINARY_DIR}/lib/libcurl.a PARENT_SCOPE)
set(CURL_LIBRARIES ${BINARY_DIR}/lib64/libcurl.a PARENT_SCOPE)
endif ()

list(APPEND actually_built ${dep})
Expand Down
11 changes: 5 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ option(PHOTON_ENABLE_ECOSYSTEM "enable ecosystem" OFF)
option(PHOTON_BUILD_DEPENDENCIES "" OFF)
set(PHOTON_AIO_SOURCE "https://pagure.io/libaio/archive/libaio-0.3.113/libaio-0.3.113.tar.gz" CACHE STRING "")
set(PHOTON_ZLIB_SOURCE "https://github.com/madler/zlib/releases/download/v1.2.13/zlib-1.2.13.tar.gz" CACHE STRING "")
set(PHOTON_OPENSSL_SOURCE "https://github.com/openssl/openssl/archive/refs/heads/OpenSSL_1_0_2-stable.tar.gz" CACHE STRING "")
set(PHOTON_CURL_SOURCE "https://github.com/curl/curl/archive/refs/tags/curl-7_42_1.tar.gz" CACHE STRING "")
set(PHOTON_OPENSSL_SOURCE "https://github.com/openssl/openssl/releases/download/OpenSSL_1_1_1w/openssl-1.1.1w.tar.gz" CACHE STRING "")
set(PHOTON_CURL_SOURCE "https://github.com/curl/curl/releases/download/curl-7_88_1/curl-7.88.1.tar.gz" CACHE STRING "")
set(PHOTON_URING_SOURCE "https://github.com/axboe/liburing/archive/refs/tags/liburing-2.3.tar.gz" CACHE STRING "")
set(PHOTON_FUSE_SOURCE "" CACHE STRING "")
set(PHOTON_GSASL_SOURCE "" CACHE STRING "")
Expand Down Expand Up @@ -353,11 +353,9 @@ else ()
)
endif ()

# Build test cases
# Build examples and test cases
if (PHOTON_BUILD_TESTING)
include_directories(photon_static ${GFLAGS_INCLUDE_DIRS} ${GOOGLETEST_INCLUDE_DIRS})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/examples-output)
link_libraries(${GFLAGS_LIBRARIES})
add_subdirectory(examples)

include(CTest)
Expand All @@ -367,7 +365,8 @@ if (PHOTON_BUILD_TESTING)
add_library(ci-tools STATIC test/ci-tools.cpp)
target_include_directories(ci-tools PRIVATE include)

link_libraries(${GFLAGS_LIBRARIES} ${GOOGLETEST_LIBRARIES} ci-tools)
target_include_directories(photon_shared PUBLIC ${CURL_INCLUDE_DIRS} ${GFLAGS_INCLUDE_DIRS} ${GOOGLETEST_INCLUDE_DIRS})
target_link_libraries(photon_shared PUBLIC ${CURL_LIBRARIES} ${GFLAGS_LIBRARIES} ${GOOGLETEST_LIBRARIES} ci-tools)

add_subdirectory(common/checksum/test)
add_subdirectory(common/test)
Expand Down
3 changes: 3 additions & 0 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
link_libraries(${GFLAGS_LIBRARIES})
include_directories(${GFLAGS_INCLUDE_DIRS})

add_executable(simple-example simple/simple.cpp)
target_link_libraries(simple-example PRIVATE photon_static)

Expand Down

0 comments on commit 05b0e92

Please sign in to comment.