File tree Expand file tree Collapse file tree 2 files changed +21
-6
lines changed
Expand file tree Collapse file tree 2 files changed +21
-6
lines changed Original file line number Diff line number Diff line change @@ -89,8 +89,8 @@ cat > "$SPEC" << EOF
8989%bcond_without python2
9090%endif
9191
92- # build csdiff-static on 64bit RHEL-10 + and Fedora
93- %if 0%{?__isa_bits} == 64 && (0%{?rhel} > 9 || 0%{?fedora})
92+ # build csdiff-static on 64bit RHEL-8 + and Fedora
93+ %if 0%{?__isa_bits} == 64 && (0%{?rhel} > 7 || 0%{?fedora})
9494%bcond_without static
9595%else
9696%bcond_with static
@@ -150,7 +150,11 @@ defect lists using various filtering predicates.
150150%if %{with static}
151151%package static
152152Summary: Statically linked csgrep-static executable
153+ %if 0%{?rhel} == 8 || 0%{?rhel} == 9
154+ BuildRequires: boost1.78-static
155+ %else
153156BuildRequires: boost-static
157+ %endif
154158BuildRequires: glibc-static
155159BuildRequires: libstdc++-static
156160
@@ -195,6 +199,11 @@ code scan defect lists to find out added or fixed defects.
195199export BOOST_INCLUDEDIR=/usr/include/boost169
196200export BOOST_LIBRARYDIR=/usr/lib64/boost169
197201%endif
202+ %if 0%{?rhel} == 8 || 0%{?rhel} == 9
203+ # Set paths for CMake's FindBoost
204+ export BOOST_INCLUDEDIR=/usr/include/boost1.78
205+ export BOOST_LIBRARYDIR=/usr/lib64/boost1.78
206+ %endif
198207
199208make version.cc
200209%if 0%{?rhel} == 7
Original file line number Diff line number Diff line change @@ -102,11 +102,17 @@ if(CSGREP_STATIC)
102102 add_executable (csgrep-static csgrep.cc )
103103 target_link_options (csgrep-static PRIVATE "-static" )
104104
105- # FIXME: do not hardcode paths to boost static libs
105+ # Use BOOST_LIBRARYDIR if set, otherwise fallback to /usr/lib64
106+ if (DEFINED ENV{BOOST_LIBRARYDIR})
107+ set (Boost_STATIC_DIR "$ENV{BOOST_LIBRARYDIR} " )
108+ else ()
109+ set (Boost_STATIC_DIR "/usr/lib64" )
110+ endif ()
111+
106112 target_link_libraries (csgrep-static cs
107- /usr/lib64 /libboost_filesystem.a
108- /usr/lib64 /libboost_program_options.a
109- /usr/lib64 /libboost_regex.a )
113+ ${Boost_STATIC_DIR} /libboost_filesystem.a
114+ ${Boost_STATIC_DIR} /libboost_program_options.a
115+ ${Boost_STATIC_DIR} /libboost_regex.a )
110116
111117 install (TARGETS csgrep-static
112118 DESTINATION ${CMAKE_INSTALL_LIBEXECDIR} )
You can’t perform that action at this time.
0 commit comments