!65 Make spec file support both system-version and multi-version
From: @cf-zhao Reviewed-by: @eastb233 Signed-off-by: @eastb233
This commit is contained in:
commit
1869d557d1
42
0001-fedora-PATCH-clang-Reorganize-gtest-integration.patch
Normal file
42
0001-fedora-PATCH-clang-Reorganize-gtest-integration.patch
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
From c6b921c8d833546946b70a8c2640032fd7c62461 Mon Sep 17 00:00:00 2001
|
||||||
|
From: serge-sans-paille <sguelton@redhat.com>
|
||||||
|
Date: Thu, 25 Feb 2021 14:04:52 +0100
|
||||||
|
Subject: [PATCH 1/6] [PATCH][clang] Reorganize gtest integration
|
||||||
|
|
||||||
|
---
|
||||||
|
clang/CMakeLists.txt | 12 +++++-------
|
||||||
|
1 file changed, 5 insertions(+), 7 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/clang/CMakeLists.txt b/clang/CMakeLists.txt
|
||||||
|
index 9e74014..0185276 100644
|
||||||
|
--- a/clang/CMakeLists.txt
|
||||||
|
+++ b/clang/CMakeLists.txt
|
||||||
|
@@ -153,12 +153,6 @@ if( CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR )
|
||||||
|
set(LLVM_UTILS_PROVIDED ON)
|
||||||
|
set(CLANG_TEST_DEPS FileCheck count not)
|
||||||
|
endif()
|
||||||
|
- set(UNITTEST_DIR ${LLVM_MAIN_SRC_DIR}/utils/unittest)
|
||||||
|
- if(EXISTS ${UNITTEST_DIR}/googletest/include/gtest/gtest.h
|
||||||
|
- AND NOT EXISTS ${LLVM_LIBRARY_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}gtest${CMAKE_STATIC_LIBRARY_SUFFIX}
|
||||||
|
- AND EXISTS ${UNITTEST_DIR}/CMakeLists.txt)
|
||||||
|
- add_subdirectory(${UNITTEST_DIR} utils/unittest)
|
||||||
|
- endif()
|
||||||
|
else()
|
||||||
|
# Seek installed Lit.
|
||||||
|
find_program(LLVM_LIT
|
||||||
|
@@ -537,7 +531,11 @@ endif()
|
||||||
|
|
||||||
|
|
||||||
|
if( CLANG_INCLUDE_TESTS )
|
||||||
|
- if(EXISTS ${LLVM_MAIN_SRC_DIR}/utils/unittest/googletest/include/gtest/gtest.h)
|
||||||
|
+ set(UNITTEST_DIR ${LLVM_MAIN_SRC_DIR}/utils/unittest)
|
||||||
|
+ if(EXISTS ${UNITTEST_DIR}/googletest/include/gtest/gtest.h
|
||||||
|
+ AND NOT EXISTS ${LLVM_LIBRARY_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}gtest${CMAKE_STATIC_LIBRARY_SUFFIX}
|
||||||
|
+ AND EXISTS ${UNITTEST_DIR}/CMakeLists.txt)
|
||||||
|
+ add_subdirectory(${UNITTEST_DIR} utils/unittest)
|
||||||
|
add_subdirectory(unittests)
|
||||||
|
list(APPEND CLANG_TEST_DEPS ClangUnitTests)
|
||||||
|
list(APPEND CLANG_TEST_PARAMS
|
||||||
|
--
|
||||||
|
1.8.3.1
|
||||||
|
|
||||||
25
0003-fedora-PATCH-clang-Don-t-install-static-libraries.patch
Normal file
25
0003-fedora-PATCH-clang-Don-t-install-static-libraries.patch
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
From 2c6cd40d016f492d53e16f1c7424a0d9878ae7ec Mon Sep 17 00:00:00 2001
|
||||||
|
From: Tom Stellard <tstellar@redhat.com>
|
||||||
|
Date: Fri, 31 Jan 2020 11:04:57 -0800
|
||||||
|
Subject: [PATCH 3/6] [PATCH][clang] Don't install static libraries
|
||||||
|
|
||||||
|
---
|
||||||
|
clang/cmake/modules/AddClang.cmake | 2 +-
|
||||||
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/clang/cmake/modules/AddClang.cmake b/clang/cmake/modules/AddClang.cmake
|
||||||
|
index 704278a..1737b24 100644
|
||||||
|
--- a/clang/cmake/modules/AddClang.cmake
|
||||||
|
+++ b/clang/cmake/modules/AddClang.cmake
|
||||||
|
@@ -111,7 +111,7 @@ macro(add_clang_library name)
|
||||||
|
if(TARGET ${lib})
|
||||||
|
target_link_libraries(${lib} INTERFACE ${LLVM_COMMON_LIBS})
|
||||||
|
|
||||||
|
- if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY OR ARG_INSTALL_WITH_TOOLCHAIN)
|
||||||
|
+ if (ARG_SHARED AND (NOT LLVM_INSTALL_TOOLCHAIN_ONLY OR ARG_INSTALL_WITH_TOOLCHAIN))
|
||||||
|
set(export_to_clangtargets)
|
||||||
|
if(${lib} IN_LIST LLVM_DISTRIBUTION_COMPONENTS OR
|
||||||
|
"clang-libraries" IN_LIST LLVM_DISTRIBUTION_COMPONENTS OR
|
||||||
|
--
|
||||||
|
1.8.3.1
|
||||||
|
|
||||||
22
README.en.md
22
README.en.md
@ -1,22 +1,14 @@
|
|||||||
# clang
|
# clang
|
||||||
|
|
||||||
#### Description
|
#### Description
|
||||||
{**When you're done, you can delete the content in this README and update the file with details for others getting started with your repository**}
|
clang: noun
|
||||||
|
1. A loud, resonant, metallic sound.
|
||||||
|
2. The strident call of a crane or goose.
|
||||||
|
3. C-language family front-end toolkit.
|
||||||
|
|
||||||
#### Software Architecture
|
The goal of the Clang project is to create a new C, C++, Objective C
|
||||||
Software architecture description
|
and Objective C++ front-end for the LLVM compiler. Its tools are built
|
||||||
|
as libraries and designed to be loosely-coupled and extensible.
|
||||||
#### Installation
|
|
||||||
|
|
||||||
1. xxxx
|
|
||||||
2. xxxx
|
|
||||||
3. xxxx
|
|
||||||
|
|
||||||
#### Instructions
|
|
||||||
|
|
||||||
1. xxxx
|
|
||||||
2. xxxx
|
|
||||||
3. xxxx
|
|
||||||
|
|
||||||
#### Contribution
|
#### Contribution
|
||||||
|
|
||||||
|
|||||||
25
README.md
25
README.md
@ -1,25 +1,14 @@
|
|||||||
# clang
|
# clang
|
||||||
|
|
||||||
#### 介绍
|
#### 介绍
|
||||||
{**以下是码云平台说明,您可以替换此简介**
|
clang: noun
|
||||||
码云是 OSCHINA 推出的基于 Git 的代码托管平台(同时支持 SVN)。专为开发者提供稳定、高效、安全的云端软件开发协作平台
|
1. A loud, resonant, metallic sound.
|
||||||
无论是个人、团队、或是企业,都能够用码云实现代码托管、项目管理、协作开发。企业项目请看 [https://gitee.com/enterprises](https://gitee.com/enterprises)}
|
2. The strident call of a crane or goose.
|
||||||
|
3. C-language family front-end toolkit.
|
||||||
|
|
||||||
#### 软件架构
|
The goal of the Clang project is to create a new C, C++, Objective C
|
||||||
软件架构说明
|
and Objective C++ front-end for the LLVM compiler. Its tools are built
|
||||||
|
as libraries and designed to be loosely-coupled and extensible.
|
||||||
|
|
||||||
#### 安装教程
|
|
||||||
|
|
||||||
1. xxxx
|
|
||||||
2. xxxx
|
|
||||||
3. xxxx
|
|
||||||
|
|
||||||
#### 使用说明
|
|
||||||
|
|
||||||
1. xxxx
|
|
||||||
2. xxxx
|
|
||||||
3. xxxx
|
|
||||||
|
|
||||||
#### 参与贡献
|
#### 参与贡献
|
||||||
|
|
||||||
|
|||||||
386
clang.spec
386
clang.spec
@ -1,51 +1,128 @@
|
|||||||
|
%bcond_with sys_llvm
|
||||||
|
%bcond_with check
|
||||||
|
|
||||||
%global maj_ver 12
|
%global maj_ver 12
|
||||||
%global min_ver 0
|
%global min_ver 0
|
||||||
%global patch_ver 1
|
%global patch_ver 1
|
||||||
%global clang_srcdir clang-%{version}.src
|
%global clang_version %{maj_ver}.%{min_ver}.%{patch_ver}
|
||||||
%global clang_tools_srcdir clang-tools-extra-%{version}.src
|
|
||||||
|
|
||||||
Name: clang
|
%if %{with sys_llvm}
|
||||||
Version: 12.0.1
|
%global pkg_name clang
|
||||||
Release: 3
|
%global install_prefix %{_prefix}
|
||||||
License: GPL-2.0-only and Apache-2.0 and MIT
|
%else
|
||||||
Summary: An "LLVM native" C/C++/Objective-C compiler
|
%global pkg_name clang%{maj_ver}
|
||||||
|
%global install_prefix %{_libdir}/llvm%{maj_ver}
|
||||||
|
%endif
|
||||||
|
|
||||||
|
%global install_bindir %{install_prefix}/bin
|
||||||
|
%global install_includedir %{install_prefix}/include
|
||||||
|
%if 0%{?__isa_bits} == 64
|
||||||
|
%global install_libdir %{install_prefix}/lib64
|
||||||
|
%else
|
||||||
|
%global install_libdir %{install_prefix}/lib
|
||||||
|
%endif
|
||||||
|
%global install_libexecdir %{install_prefix}/libexec
|
||||||
|
%global install_sharedir %{install_prefix}/share
|
||||||
|
%global install_docdir %{install_sharedir}/doc
|
||||||
|
|
||||||
|
%global clang_srcdir clang-%{clang_version}.src
|
||||||
|
%global clang_tools_srcdir clang-tools-extra-%{clang_version}.src
|
||||||
|
%global max_link_jobs %{_smp_build_ncpus}
|
||||||
|
|
||||||
|
# Disable LTO as this causes crash if gcc lto enabled.
|
||||||
|
%define _lto_cflags %{nil}
|
||||||
|
|
||||||
|
Name: %{pkg_name}
|
||||||
|
Version: %{clang_version}
|
||||||
|
Release: 4
|
||||||
|
Summary: A C language family front-end for LLVM
|
||||||
|
|
||||||
|
License: NCSA
|
||||||
URL: http://llvm.org
|
URL: http://llvm.org
|
||||||
Source0: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{version}/%{clang_srcdir}.tar.xz
|
Source0: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{clang_version}/%{clang_srcdir}.tar.xz
|
||||||
Source1: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{version}/%{clang_tools_srcdir}.tar.xz
|
Source1: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{clang_version}/%{clang_tools_srcdir}.tar.xz
|
||||||
Source2: clang-config.h
|
|
||||||
|
|
||||||
BuildRequires: cmake gcc-c++ python-sphinx git
|
Patch1: 0001-fedora-PATCH-clang-Reorganize-gtest-integration.patch
|
||||||
|
Patch2: 0003-fedora-PATCH-clang-Don-t-install-static-libraries.patch
|
||||||
|
Patch201: support-ignored_and_replaced_opts.patch
|
||||||
|
Patch202: support-print-c-function-prototype.patch
|
||||||
|
|
||||||
|
BuildRequires: gcc
|
||||||
|
BuildRequires: gcc-c++
|
||||||
|
BuildRequires: cmake
|
||||||
|
BuildRequires: libatomic
|
||||||
|
|
||||||
|
%if %{with sys_llvm}
|
||||||
BuildRequires: llvm-devel = %{version}
|
BuildRequires: llvm-devel = %{version}
|
||||||
BuildRequires: llvm-static = %{version}
|
BuildRequires: llvm-static = %{version}
|
||||||
|
BuildRequires: llvm-test = %{version}
|
||||||
BuildRequires: llvm-googletest = %{version}
|
BuildRequires: llvm-googletest = %{version}
|
||||||
BuildRequires: libxml2-devel perl-generators ncurses-devel emacs libatomic
|
%else
|
||||||
BuildRequires: python3-lit python3-sphinx python3-devel
|
BuildRequires: llvm%{maj_ver}-devel = %{version}
|
||||||
|
BuildRequires: llvm%{maj_ver}-static = %{version}
|
||||||
|
BuildRequires: llvm%{maj_ver}-test = %{version}
|
||||||
|
BuildRequires: llvm%{maj_ver}-googletest = %{version}
|
||||||
|
%endif
|
||||||
|
|
||||||
|
BuildRequires: libxml2-devel
|
||||||
|
BuildRequires: multilib-rpm-config
|
||||||
|
BuildRequires: ninja-build
|
||||||
|
BuildRequires: ncurses-devel
|
||||||
|
BuildRequires: perl-generators
|
||||||
|
BuildRequires: python3-lit >= %{version}
|
||||||
|
BuildRequires: python3-sphinx
|
||||||
|
BuildRequires: python3-recommonmark
|
||||||
|
BuildRequires: python3-devel
|
||||||
|
|
||||||
|
BuildRequires: perl(Digest::MD5)
|
||||||
|
BuildRequires: perl(File::Copy)
|
||||||
|
BuildRequires: perl(File::Find)
|
||||||
|
BuildRequires: perl(File::Path)
|
||||||
|
BuildRequires: perl(File::Temp)
|
||||||
|
BuildRequires: perl(FindBin)
|
||||||
|
BuildRequires: perl(Hash::Util)
|
||||||
|
BuildRequires: perl(lib)
|
||||||
|
BuildRequires: perl(Term::ANSIColor)
|
||||||
|
BuildRequires: perl(Text::ParseWords)
|
||||||
|
BuildRequires: perl(Sys::Hostname)
|
||||||
|
|
||||||
|
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
|
||||||
|
|
||||||
|
Requires: libstdc++-devel
|
||||||
|
Requires: gcc-c++
|
||||||
|
|
||||||
Requires: libstdc++-devel gcc-c++ emacs-filesystem
|
|
||||||
Requires: %{name}-resource-filesystem = %{version}
|
|
||||||
Provides: clang(major) = %{maj_ver}
|
Provides: clang(major) = %{maj_ver}
|
||||||
Provides: %{name}-libs = %{version}-%{release}
|
|
||||||
Obsoletes: %{name}-libs < %{version}-%{release}
|
|
||||||
Recommends: libomp = %{version}
|
|
||||||
Recommends: compiler-rt = %{version}
|
|
||||||
|
|
||||||
Conflicts: compiler-rt < %{version}
|
Conflicts: compiler-rt < 11.0.0
|
||||||
Conflicts: compiler-rt > %{version}
|
|
||||||
|
|
||||||
Patch0: support-ignored_and_replaced_opts.patch
|
|
||||||
Patch1: support-print-c-function-prototype.patch
|
|
||||||
|
|
||||||
%description
|
%description
|
||||||
The Clang project provides a language front-end and tooling infrastructure for\
|
clang: noun
|
||||||
languages in the C language family (C, C++, Objective C/C++, OpenCL, CUDA, and\
|
1. A loud, resonant, metallic sound.
|
||||||
RenderScript) for the LLVM project. Both a GCC-compatible compiler driver (clang)\
|
2. The strident call of a crane or goose.
|
||||||
and an MSVC-compatible compiler driver (clang-cl.exe) are provided.\
|
3. C-language family front-end toolkit.
|
||||||
|
|
||||||
|
The goal of the Clang project is to create a new C, C++, Objective C
|
||||||
|
and Objective C++ front-end for the LLVM compiler. Its tools are built
|
||||||
|
as libraries and designed to be loosely-coupled and extensible.
|
||||||
|
|
||||||
|
Install compiler-rt if you want the Blocks C language extension or to
|
||||||
|
enable sanitization and profiling options when building, and
|
||||||
|
libomp-devel to enable -fopenmp.
|
||||||
|
|
||||||
|
%package libs
|
||||||
|
Summary: Runtime library for clang
|
||||||
|
Requires: %{name}-resource-filesystem%{?_isa} = %{version}
|
||||||
|
Recommends: compiler-rt%{?_isa} = %{version}
|
||||||
|
Recommends: libatomic%{?_isa}
|
||||||
|
Recommends: libomp-devel%{_isa} = %{version}
|
||||||
|
Recommends: libomp%{_isa} = %{version}
|
||||||
|
|
||||||
|
%description libs
|
||||||
|
Runtime library for clang.
|
||||||
|
|
||||||
%package devel
|
%package devel
|
||||||
Summary: Development header files for clang.
|
Summary: Development header files for clang
|
||||||
Requires: %{name} = %{version}-%{release}
|
Requires: %{name}-libs = %{version}-%{release}
|
||||||
Requires: %{name}-tools-extra = %{version}-%{release}
|
|
||||||
|
|
||||||
%description devel
|
%description devel
|
||||||
Development header files for clang.
|
Development header files for clang.
|
||||||
@ -57,18 +134,12 @@ Provides: %{name}-resource-filesystem(major) = %{maj_ver}
|
|||||||
%description resource-filesystem
|
%description resource-filesystem
|
||||||
This package owns the clang resouce directory: $libdir/clang/$version/
|
This package owns the clang resouce directory: $libdir/clang/$version/
|
||||||
|
|
||||||
%package help
|
|
||||||
Summary: Help manual for %{name}
|
|
||||||
|
|
||||||
%description help
|
|
||||||
The %{name}-help package conatins man manual etc
|
|
||||||
|
|
||||||
%package analyzer
|
%package analyzer
|
||||||
Summary: A source code analysis framework
|
Summary: A source code analysis framework
|
||||||
License: NCSA and MIT
|
License: NCSA and MIT
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
Requires: %{name} = %{version}-%{release}
|
Requires: %{name} = %{version}-%{release}
|
||||||
Requires: python3
|
|
||||||
|
|
||||||
%description analyzer
|
%description analyzer
|
||||||
The Clang Static Analyzer consists of both a source code analysis
|
The Clang Static Analyzer consists of both a source code analysis
|
||||||
@ -78,58 +149,61 @@ intended to run in tandem with a build of a project or code base.
|
|||||||
|
|
||||||
%package tools-extra
|
%package tools-extra
|
||||||
Summary: Extra tools for clang
|
Summary: Extra tools for clang
|
||||||
Requires: %{name}-libs = %{version}-%{release}
|
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
|
||||||
Requires: emacs-filesystem
|
Requires: emacs-filesystem
|
||||||
|
|
||||||
%description tools-extra
|
%description tools-extra
|
||||||
A set of extra tools built using Clang's tooling API.
|
A set of extra tools built using Clang's tooling API.
|
||||||
|
|
||||||
%package -n git-clang-format
|
%package -n git-clang-format
|
||||||
Summary: clang-format integration for git
|
Summary: Integration of clang-format for git
|
||||||
Requires: %{name} = %{version}-%{release}
|
Requires: %{name}-tools-extra = %{version}-%{release}
|
||||||
Requires: git
|
Requires: git
|
||||||
|
Requires: python3
|
||||||
|
|
||||||
%description -n git-clang-format
|
%description -n git-clang-format
|
||||||
clang-format integration for git.
|
clang-format integration for git.
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup -T -q -b 1 -n %{clang_tools_srcdir}
|
%setup -T -q -b 1 -n %{clang_tools_srcdir}
|
||||||
|
|
||||||
pathfix.py -i %{__python3} -pn \
|
pathfix.py -i %{__python3} -pn \
|
||||||
clang-tidy/tool/*.py
|
clang-tidy/tool/*.py
|
||||||
|
|
||||||
%autosetup -n %{clang_srcdir} -p1
|
%setup -q -n %{clang_srcdir}
|
||||||
|
%autopatch -M200 -p2
|
||||||
|
%autopatch -m200 -p1
|
||||||
|
|
||||||
|
# failing test case
|
||||||
|
rm test/CodeGen/profile-filter.c
|
||||||
|
|
||||||
pathfix.py -i %{__python3} -pn \
|
pathfix.py -i %{__python3} -pn \
|
||||||
tools/clang-format/*.py \
|
tools/clang-format/*.py \
|
||||||
tools/clang-format/git-clang-format \
|
tools/clang-format/git-clang-format \
|
||||||
utils/hmaptool/hmaptool \
|
utils/hmaptool/hmaptool \
|
||||||
tools/scan-view/bin/scan-view
|
tools/scan-view/bin/scan-view
|
||||||
|
|
||||||
mv ../%{clang_tools_srcdir} tools/extra
|
mv ../%{clang_tools_srcdir} tools/extra
|
||||||
|
|
||||||
%build
|
%build
|
||||||
|
|
||||||
mkdir -p _build
|
mkdir -p _build
|
||||||
cd _build
|
cd _build
|
||||||
|
%cmake .. -G Ninja \
|
||||||
|
-DCLANG_DEFAULT_PIE_ON_LINUX=ON \
|
||||||
%global optflags %(echo %{optflags} | sed 's/-g /-g1 /')
|
-DLLVM_PARALLEL_LINK_JOBS=%{max_link_jobs} \
|
||||||
|
|
||||||
|
|
||||||
%cmake .. \
|
|
||||||
-DLLVM_LINK_LLVM_DYLIB:BOOL=ON \
|
-DLLVM_LINK_LLVM_DYLIB:BOOL=ON \
|
||||||
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
|
-DCMAKE_BUILD_TYPE=Release \
|
||||||
-DCMAKE_INSTALL_RPATH:BOOL=";" \
|
-DPYTHON_EXECUTABLE=%{__python3} \
|
||||||
-DCMAKE_C_FLAGS_RELWITHDEBINFO="%{optflags} -DNDEBUG" \
|
-DCMAKE_SKIP_RPATH:BOOL=ON \
|
||||||
-DCMAKE_CXX_FLAGS_RELWITHDEBINFO="%{optflags} -DNDEBUG" \
|
-DCLANG_BUILD_TOOLS:BOOL=ON \
|
||||||
-DLLVM_CONFIG:FILEPATH=/usr/bin/llvm-config-%{__isa_bits} \
|
-DCMAKE_INSTALL_PREFIX=%{install_prefix} \
|
||||||
-DCLANG_INCLUDE_TESTS:BOOL=ON \
|
-DCLANG_INCLUDE_TESTS:BOOL=ON \
|
||||||
-DLLVM_EXTERNAL_LIT=%{_bindir}/lit \
|
-DLLVM_EXTERNAL_LIT=%{_bindir}/lit \
|
||||||
-DLLVM_MAIN_SRC_DIR=%{_datadir}/llvm/src \
|
-DLLVM_CONFIG:FILEPATH=%{install_bindir}/llvm-config \
|
||||||
%if 0%{?__isa_bits} == 64
|
-DLLVM_TABLEGEN_EXE:FILEPATH=%{install_bindir}/llvm-tblgen \
|
||||||
-DLLVM_LIBDIR_SUFFIX=64 \
|
-DLLVM_MAIN_SRC_DIR=%{install_prefix}/src \
|
||||||
%else
|
-DLLVM_LIT_ARGS="-vv" \
|
||||||
-DLLVM_LIBDIR_SUFFIX= \
|
-DLLVM_BUILD_UTILS:BOOL=ON \
|
||||||
%endif
|
|
||||||
\
|
|
||||||
-DCLANG_ENABLE_ARCMT:BOOL=ON \
|
-DCLANG_ENABLE_ARCMT:BOOL=ON \
|
||||||
-DCLANG_ENABLE_STATIC_ANALYZER:BOOL=ON \
|
-DCLANG_ENABLE_STATIC_ANALYZER:BOOL=ON \
|
||||||
-DCLANG_INCLUDE_DOCS:BOOL=ON \
|
-DCLANG_INCLUDE_DOCS:BOOL=ON \
|
||||||
@ -139,136 +213,120 @@ cd _build
|
|||||||
-DLLVM_ENABLE_RTTI=ON \
|
-DLLVM_ENABLE_RTTI=ON \
|
||||||
-DLLVM_BUILD_DOCS=ON \
|
-DLLVM_BUILD_DOCS=ON \
|
||||||
-DLLVM_ENABLE_SPHINX=ON \
|
-DLLVM_ENABLE_SPHINX=ON \
|
||||||
|
-DCLANG_LINK_CLANG_DYLIB=ON \
|
||||||
-DSPHINX_WARNINGS_AS_ERRORS=OFF \
|
-DSPHINX_WARNINGS_AS_ERRORS=OFF \
|
||||||
\
|
|
||||||
-DCLANG_BUILD_EXAMPLES:BOOL=OFF \
|
-DCLANG_BUILD_EXAMPLES:BOOL=OFF \
|
||||||
-DCLANG_REPOSITORY_STRING="%{_vendor} %{version}-%{release}" \
|
-DBUILD_SHARED_LIBS=OFF \
|
||||||
-DLIB_SUFFIX=
|
-DCLANG_REPOSITORY_STRING="%{?distro} %{version}-%{release}" \
|
||||||
|
%if 0%{?__isa_bits} == 64
|
||||||
|
-DLLVM_LIBDIR_SUFFIX=64 \
|
||||||
|
%else
|
||||||
|
-DLLVM_LIBDIR_SUFFIX= \
|
||||||
|
%endif
|
||||||
|
-DCLANG_DEFAULT_UNWINDLIB=libgcc
|
||||||
|
|
||||||
%make_build
|
%ninja_build
|
||||||
|
|
||||||
%install
|
%install
|
||||||
%make_install -C _build
|
|
||||||
|
|
||||||
mv -v %{buildroot}%{_includedir}/clang/Config/config{,-%{__isa_bits}}.h
|
%ninja_install -C _build
|
||||||
install -m 0644 %{SOURCE2} %{buildroot}%{_includedir}/clang/Config/config.h
|
mkdir -p %{buildroot}/%{_bindir}
|
||||||
|
|
||||||
mkdir -p %{buildroot}%{_emacs_sitestartdir}
|
rm -vf %{buildroot}%{install_sharedir}/clang/clang-format-bbedit.applescript
|
||||||
for f in clang-format.el clang-rename.el clang-include-fixer.el; do
|
rm -vf %{buildroot}%{install_sharedir}/clang/clang-format-sublime.py*
|
||||||
mv %{buildroot}{%{_datadir}/clang,%{_emacs_sitestartdir}}/$f
|
|
||||||
done
|
|
||||||
|
|
||||||
rm -vf %{buildroot}%{_datadir}/clang/clang-format-bbedit.applescript
|
rm -Rvf %{buildroot}%{install_docdir}/clang/html
|
||||||
rm -vf %{buildroot}%{_datadir}/clang/clang-format-sublime.py*
|
rm -Rvf %{buildroot}%{install_sharedir}/clang/clang-doc-default-stylesheet.css
|
||||||
|
rm -Rvf %{buildroot}%{install_sharedir}/clang/index.js
|
||||||
|
rm -vf %{buildroot}%{install_sharedir}/clang/bash-autocomplete.sh
|
||||||
|
|
||||||
rm -Rvf %{buildroot}%{_pkgdocdir}
|
mkdir -p %{buildroot}%{install_libdir}/clang/%{version}/{include,lib,share}/
|
||||||
|
|
||||||
rm -vf %{buildroot}%{_datadir}/clang/bash-autocomplete.sh
|
|
||||||
|
|
||||||
# Create sub-directories in the clang resource directory that will be
|
|
||||||
# populated by other packages
|
|
||||||
mkdir -p %{buildroot}%{_libdir}/clang/%{version}/{include,lib,share}/
|
|
||||||
|
|
||||||
# Remove clang-tidy headers.
|
|
||||||
rm -Rvf %{buildroot}%{_includedir}/clang-tidy/
|
|
||||||
|
|
||||||
ln -s clang++ %{buildroot}%{_bindir}/clang++-%{maj_ver}
|
|
||||||
|
|
||||||
%check
|
%check
|
||||||
# Checking is disabled because we don't pack libLLVMTestingSupport.a, which makes
|
%if %{with check}
|
||||||
# standalone build of clang impossible.
|
|
||||||
|
|
||||||
#cd _build
|
LD_LIBRARY_PATH=%{buildroot}/%{install_libdir} %{__ninja} check-all -C ./_build/
|
||||||
#PATH=%{_libdir}/llvm:$PATH make %{?_smp_mflags} check-clang || \
|
%endif
|
||||||
#%ifarch %{arm}
|
|
||||||
#:
|
|
||||||
#%else
|
|
||||||
#false
|
|
||||||
#%endif
|
|
||||||
|
|
||||||
%post
|
|
||||||
/sbin/ldconfig
|
|
||||||
|
|
||||||
%postun
|
|
||||||
/sbin/ldconfig
|
|
||||||
|
|
||||||
%files
|
%files
|
||||||
%{_bindir}/clang
|
%license LICENSE.TXT
|
||||||
%{_bindir}/clang++
|
%{install_bindir}/clang
|
||||||
%{_bindir}/clang-%{maj_ver}
|
%{install_bindir}/clang++
|
||||||
%{_bindir}/clang++-%{maj_ver}
|
%{install_bindir}/clang-%{maj_ver}
|
||||||
%{_bindir}/clang-check
|
%{install_bindir}/clang-cl
|
||||||
%{_bindir}/clang-cl
|
%{install_bindir}/clang-cpp
|
||||||
%{_bindir}/clang-cpp
|
%{install_prefix}/share/man/man1/*
|
||||||
%{_bindir}/clang-format
|
|
||||||
%{_bindir}/clang-doc
|
%files libs
|
||||||
%{_bindir}/clang-extdef-mapping
|
%{install_libdir}/*.so.*
|
||||||
%{_bindir}/clang-move
|
%{install_libdir}/clang/%{version}/include/*
|
||||||
%{_bindir}/clang-offload-wrapper
|
|
||||||
%{_bindir}/clang-scan-deps
|
|
||||||
%{_bindir}/pp-trace
|
|
||||||
%{_bindir}/clang-offload-bundler
|
|
||||||
%{_bindir}/diagtool
|
|
||||||
%{_bindir}/hmaptool
|
|
||||||
%{_bindir}/c-index-test
|
|
||||||
%{_emacs_sitestartdir}/clang-format.el
|
|
||||||
%{_datadir}/clang/clang-format.py*
|
|
||||||
%{_datadir}/clang/clang-format-diff.py*
|
|
||||||
%{_libdir}/clang/
|
|
||||||
%{_libdir}/*.so.*
|
|
||||||
|
|
||||||
%files devel
|
%files devel
|
||||||
%{_libdir}/*.so
|
%{install_libdir}/*.so
|
||||||
%{_includedir}/clang/
|
%{install_includedir}/clang/
|
||||||
%{_includedir}/clang-c/
|
%{install_includedir}/clang-c/
|
||||||
%{_libdir}/cmake/*
|
%{install_includedir}/clang-tidy/
|
||||||
%dir %{_datadir}/clang/
|
%{install_libdir}/cmake/*
|
||||||
|
|
||||||
|
|
||||||
%files resource-filesystem
|
%files resource-filesystem
|
||||||
%dir %{_libdir}/clang/%{version}/
|
%dir %{install_libdir}/clang/%{version}/
|
||||||
%dir %{_libdir}/clang/%{version}/include/
|
%dir %{install_libdir}/clang/%{version}/include/
|
||||||
%dir %{_libdir}/clang/%{version}/lib/
|
%dir %{install_libdir}/clang/%{version}/lib/
|
||||||
%dir %{_libdir}/clang/%{version}/share/
|
%dir %{install_libdir}/clang/%{version}/share/
|
||||||
|
|
||||||
%files help
|
|
||||||
%{_mandir}/man1/clang.1.gz
|
|
||||||
%{_mandir}/man1/diagtool.1.gz
|
|
||||||
|
|
||||||
%files analyzer
|
%files analyzer
|
||||||
%{_bindir}/scan-view
|
%{install_libexecdir}/ccc-analyzer
|
||||||
%{_bindir}/scan-build
|
%{install_libexecdir}/c++-analyzer
|
||||||
%{_libexecdir}/ccc-analyzer
|
%{install_bindir}/scan-view
|
||||||
%{_libexecdir}/c++-analyzer
|
%{install_bindir}/scan-build
|
||||||
%{_datadir}/scan-view/
|
%{install_prefix}/share/man/man1/*
|
||||||
%{_datadir}/scan-build/
|
%{install_sharedir}/scan-view
|
||||||
%{_mandir}/man1/scan-build.1.*
|
%{install_sharedir}/scan-build
|
||||||
|
|
||||||
|
|
||||||
%files tools-extra
|
%files tools-extra
|
||||||
%{_bindir}/clangd
|
%{install_bindir}/c-index-test
|
||||||
%{_bindir}/clang-apply-replacements
|
%{install_bindir}/clang-apply-replacements
|
||||||
%{_bindir}/clang-change-namespace
|
%{install_bindir}/clang-change-namespace
|
||||||
%{_bindir}/clang-include-fixer
|
%{install_bindir}/clang-check
|
||||||
%{_bindir}/clang-query
|
%{install_bindir}/clang-doc
|
||||||
%{_bindir}/clang-refactor
|
%{install_bindir}/clang-extdef-mapping
|
||||||
%{_bindir}/clang-reorder-fields
|
%{install_bindir}/clang-format
|
||||||
%{_bindir}/clang-rename
|
%{install_bindir}/clang-include-fixer
|
||||||
%{_bindir}/clang-tidy
|
%{install_bindir}/clang-move
|
||||||
%{_bindir}/find-all-symbols
|
%{install_bindir}/clang-offload-bundler
|
||||||
%{_bindir}/modularize
|
%{install_bindir}/clang-offload-wrapper
|
||||||
%{_emacs_sitestartdir}/clang-rename.el
|
%{install_bindir}/clang-query
|
||||||
%{_emacs_sitestartdir}/clang-include-fixer.el
|
%{install_bindir}/clang-refactor
|
||||||
%{_datadir}/clang/clang-include-fixer.py*
|
%{install_bindir}/clang-rename
|
||||||
%{_datadir}/clang/clang-tidy-diff.py*
|
%{install_bindir}/clang-reorder-fields
|
||||||
%{_datadir}/clang/run-clang-tidy.py*
|
%{install_bindir}/clang-scan-deps
|
||||||
%{_datadir}/clang/run-find-all-symbols.py*
|
%{install_bindir}/clang-tidy
|
||||||
%{_datadir}/clang/clang-rename.py*
|
%{install_bindir}/clangd
|
||||||
%{_datadir}/clang/index.js
|
%{install_bindir}/diagtool
|
||||||
%{_datadir}/clang/clang-doc-default-stylesheet.css
|
%{install_bindir}/hmaptool
|
||||||
|
%{install_bindir}/pp-trace
|
||||||
|
%{install_bindir}/find-all-symbols
|
||||||
|
%{install_bindir}/modularize
|
||||||
|
%{install_sharedir}/clang/clang-format.el
|
||||||
|
%{install_sharedir}/clang/clang-rename.el
|
||||||
|
%{install_sharedir}/clang/clang-include-fixer.el
|
||||||
|
%{install_sharedir}/clang/clang-format.py
|
||||||
|
%{install_sharedir}/clang/clang-format-diff.py
|
||||||
|
%{install_sharedir}/clang/clang-include-fixer.py
|
||||||
|
%{install_sharedir}/clang/clang-tidy-diff.py
|
||||||
|
%{install_sharedir}/clang/run-find-all-symbols.py
|
||||||
|
%{install_sharedir}/clang/run-clang-tidy.py
|
||||||
|
%{install_sharedir}/clang/clang-rename.py
|
||||||
|
|
||||||
%files -n git-clang-format
|
%files -n git-clang-format
|
||||||
%{_bindir}/git-clang-format
|
%{install_bindir}/git-clang-format
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Thu Jul 6 2023 cf-zhao <zhaochuanfeng@huawei.com> -12.0.1-4
|
||||||
|
- Make this spec file support both system-version and multi-version.
|
||||||
|
|
||||||
* Thu Sep 22 2022 linguoxiong <cokelin@hnu.edu.cn> - 12.0.1-3
|
* Thu Sep 22 2022 linguoxiong <cokelin@hnu.edu.cn> - 12.0.1-3
|
||||||
- Implement the "-aux-info" option to print function prototype
|
- Implement the "-aux-info" option to print function prototype
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user