support clang build

This commit is contained in:
lf14 2023-10-12 09:46:10 +08:00
parent 7b87c97646
commit 4d25f3f671

View File

@ -12,7 +12,7 @@
%define _binaries_in_noarch_packages_terminate_build 0
Name: hadoop-3.1
Version: 3.1.4
Release: 6
Release: 7
Summary: A software platform for processing vast amounts of data
# The BSD license file is missing
# https://issues.apache.org/jira/browse/HADOOP-9849
@ -299,6 +299,12 @@ mvn install:install-file -DgroupId=orn.fusesource.hawtjni -DartifactId=hawtjni-r
%mvn_file :%{real_name}-common::tests: %{real_name}/%{real_name}-common
%build
if [[ "%{?toolchain}" == "clang" ]]
then
export CXXFLAGS="$CXXFLAGS -mcpu=generic+Crc -Wno-reserved-user-defined-literal"
export CFLAGS="$CFLAGS -mcpu=generic+Crc -Wno-reserved-user-defined-literal"
fi
mvn -Dsnappy.lib=/usr/lib64 -Dbundle.snappy -Dcontainer-executor.conf.dir=%{_sysconfdir}/%{real_name} -Pdist,native -DskipTests -DskipIT -Dmaven.javadoc.skip=true package
%install
@ -1114,6 +1120,9 @@ fi
%config(noreplace) %{_sysconfdir}/%{real_name}/container-executor.cfg
%changelog
* Wed Oct 11 2023 luofeng <luofeng13@huawei.com> - 3.1.4-7
- support clang build
* Fri Jul 21 2023 wenweijian <wenweijian2@huawei.com> - 3.1.4-6
- compatiable with gcc12