From da529dec0824c4e3e2753a3a262f9a6800c5b144 Mon Sep 17 00:00:00 2001 From: York Wong <965612+ethinx@users.noreply.github.com> Date: Mon, 25 Dec 2023 23:24:33 +0800 Subject: [PATCH] [build] fix for zlib and BPF issue on CentOS 7 --- deps/zlib-1.3/CMakeLists.txt | 4 +++- rpm/pipy.spec | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/deps/zlib-1.3/CMakeLists.txt b/deps/zlib-1.3/CMakeLists.txt index 7f1b69f4..622554e1 100644 --- a/deps/zlib-1.3/CMakeLists.txt +++ b/deps/zlib-1.3/CMakeLists.txt @@ -5,6 +5,7 @@ project(zlib C) set(VERSION "1.3") +option(BUILD_SAMPLES "Build minigzip and test" OFF) set(INSTALL_BIN_DIR "${CMAKE_INSTALL_PREFIX}/bin" CACHE PATH "Installation directory for executables") set(INSTALL_LIB_DIR "${CMAKE_INSTALL_PREFIX}/lib" CACHE PATH "Installation directory for libraries") set(INSTALL_INC_DIR "${CMAKE_INSTALL_PREFIX}/include" CACHE PATH "Installation directory for headers") @@ -193,7 +194,7 @@ endif() #============================================================================ # Example binaries #============================================================================ - +if(BUILD_SAMPLES) add_executable(example test/example.c) target_link_libraries(example zlib) add_test(example example) @@ -211,3 +212,4 @@ if(HAVE_OFF64_T) target_link_libraries(minigzip64 zlib) set_target_properties(minigzip64 PROPERTIES COMPILE_FLAGS "-D_FILE_OFFSET_BITS=64") endif() +endif(BUILD_SAMPLES) diff --git a/rpm/pipy.spec b/rpm/pipy.spec index 9c61f22a..10a094d8 100644 --- a/rpm/pipy.spec +++ b/rpm/pipy.spec @@ -60,12 +60,14 @@ source /opt/rh/rh-nodejs14/enable %endif %if 0%{?rhel} == 7 source /opt/rh/llvm-toolset-7.0/enable +PIPY_BPF=OFF %endif cd build CXX=clang++ CC=clang cmake3 \ -DPIPY_GUI=%{?with_gui:ON}%{!?with_gui:OFF} \ -DPIPY_SAMPLES=%{?with_gui:ON}%{!?with_gui:OFF} \ -DPIPY_STATIC=${PIPY_STATIC} \ + -DPIPY_BPF=${PIPY_BPF} \ -DCMAKE_BUILD_TYPE=${BUILD_TYPE} .. make -j$(getconf _NPROCESSORS_ONLN)