Commit a7ab9f28 authored by Michał Kępień's avatar Michał Kępień
Browse files

Use devtoolset-8 for building on RHEL/CentOS 6 & 7

protobuf 3.11+ does not compile with GCC 4.8.5 available from stock
RHEL/CentOS 7 packages.  RHEL/CentOS 6 faced a similar issue after
protobuf version was bumped to 3.6 and the solution was to use
devtoolset-7 on that operating system.  Since devtoolset-8 is the latest
C toolchain SCL available for both RHEL/CentOS 6 and RHEL/CentOS 7, use
it for building protobuf on those operating systems.
parent b0f185db
......@@ -19,8 +19,8 @@ Source0: %{url}/releases/download/v%{version}/%{pkg_name}-%{version}.tar.
BuildRequires: autoconf automake libtool
BuildRequires: gcc-c++
BuildRequires: pkgconfig(protobuf)
%if 0%{?rhel} && 0%{?rhel} < 7
BuildRequires: devtoolset-7
%if 0%{?rhel} && 0%{?rhel} < 8
BuildRequires: devtoolset-8
%endif
%{?scl:BuildRequires: %{scl}-build}
......@@ -55,21 +55,21 @@ This package contains protobuf-c headers and libraries.
%build
# autoreconf -ifv
%if 0%{?rhel} && 0%{?rhel} < 7
scl enable devtoolset-7 -- <<\EOF
%if 0%{?rhel} && 0%{?rhel} < 8
scl enable devtoolset-8 -- <<\EOF
%endif
%configure --disable-static
%{?scl:scl enable %scl -- }%make_build
%if 0%{?rhel} && 0%{?rhel} < 7
%if 0%{?rhel} && 0%{?rhel} < 8
EOF
%endif
%check
%if 0%{?rhel} && 0%{?rhel} < 7
scl enable devtoolset-7 -- <<\EOF
%if 0%{?rhel} && 0%{?rhel} < 8
scl enable devtoolset-8 -- <<\EOF
%endif
make check
%if 0%{?rhel} && 0%{?rhel} < 7
%if 0%{?rhel} && 0%{?rhel} < 8
EOF
%endif
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment