Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions make-srpm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ cat > "$SPEC" << EOF
%bcond_without python2
%endif

# build csdiff-static on 64bit RHEL-10+ and Fedora
%if 0%{?__isa_bits} == 64 && (0%{?rhel} > 9 || 0%{?fedora})
# build csdiff-static on 64bit RHEL-8+ and Fedora
%if 0%{?__isa_bits} == 64 && (0%{?rhel} > 7 || 0%{?fedora})
%bcond_without static
%else
%bcond_with static
Expand Down Expand Up @@ -150,7 +150,11 @@ defect lists using various filtering predicates.
%if %{with static}
%package static
Summary: Statically linked csgrep-static executable
%if 0%{?rhel} == 8 || 0%{?rhel} == 9
BuildRequires: boost1.78-static
%else
BuildRequires: boost-static
%endif
BuildRequires: glibc-static
BuildRequires: libstdc++-static

Expand Down Expand Up @@ -195,6 +199,11 @@ code scan defect lists to find out added or fixed defects.
export BOOST_INCLUDEDIR=/usr/include/boost169
export BOOST_LIBRARYDIR=/usr/lib64/boost169
%endif
%if 0%{?rhel} == 8 || 0%{?rhel} == 9
# Set paths for CMake's FindBoost
export BOOST_INCLUDEDIR=/usr/include/boost1.78
export BOOST_LIBRARYDIR=/usr/lib64/boost1.78
%endif

make version.cc
%if 0%{?rhel} == 7
Expand Down
14 changes: 10 additions & 4 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,17 @@ if(CSGREP_STATIC)
add_executable(csgrep-static csgrep.cc)
target_link_options(csgrep-static PRIVATE "-static")

# FIXME: do not hardcode paths to boost static libs
# Use BOOST_LIBRARYDIR if set, otherwise fallback to /usr/lib64
if(DEFINED ENV{BOOST_LIBRARYDIR})
set(Boost_STATIC_DIR "$ENV{BOOST_LIBRARYDIR}")
else()
set(Boost_STATIC_DIR "/usr/lib64")
endif()

target_link_libraries(csgrep-static cs
/usr/lib64/libboost_filesystem.a
/usr/lib64/libboost_program_options.a
/usr/lib64/libboost_regex.a)
${Boost_STATIC_DIR}/libboost_filesystem.a
${Boost_STATIC_DIR}/libboost_program_options.a
${Boost_STATIC_DIR}/libboost_regex.a)

install(TARGETS csgrep-static
DESTINATION ${CMAKE_INSTALL_LIBEXECDIR})
Expand Down