]> git.pld-linux.org Git - packages/llvm.git/blame - llvm.spec
- fix building with g++ 7
[packages/llvm.git] / llvm.spec
CommitLineData
6df3b432
JB
1# TODO:
2# - move and package:
3# %{_datadir}/clang/clang-format-sublime.py - sublime plugin
4# %{_datadir}/clang/clang-format.el - emacs mode
5# %{_datadir}/clang/clang-format.py - vim plugin
6# - no content in doc package (it used to contain parts of clang apidocs and some examples)
6c2b1a44 7# - system isl in polly?
bc88141a 8#
9556f4c9 9# Conditional build:
589b92f5
JB
10%bcond_without lldb # LLDB debugger
11%bcond_without polly # Polly cache-locality optimization, auto-parallelism and vectorization
12%bcond_without rt # compiler-rt libraries
13%bcond_without multilib # compiler-rt multilib libraries
14%bcond_without ocaml # OCaml binding
15%bcond_without doc # HTML docs and man pages
16%bcond_with apidocs # doxygen docs (HUGE, so they are not built by default)
17%bcond_with tests # run tests
9556f4c9 18
4ba3b2b3 19# No ocaml on other arches or no native ocaml (required for ocaml-ctypes)
509439cf 20%ifnarch %{ix86} %{x8664} arm aarch64 ppc sparc sparcv9
9556f4c9
ER
21%undefine with_ocaml
22%endif
23
aa11c230 24Summary: The Low Level Virtual Machine (An Optimizing Compiler Infrastructure)
2326a99f 25Summary(pl.UTF-8): Niskopoziomowa maszyna wirtualna (infrastruktura kompilatora optymalizującego)
aa11c230 26Name: llvm
b6fdc1d7 27Version: 3.9.1
e748f12a 28Release: 3.2
aa11c230 29License: University of Illinois/NCSA Open Source License
30Group: Development/Languages
dd9350c7 31#Source0Download: http://llvm.org/releases/download.html
b883cf1e 32Source0: http://llvm.org/releases/%{version}/%{name}-%{version}.src.tar.xz
b6fdc1d7 33# Source0-md5: 3259018a7437e157f3642df80f1983ea
b883cf1e 34Source1: http://llvm.org/releases/%{version}/cfe-%{version}.src.tar.xz
b6fdc1d7 35# Source1-md5: 45713ec5c417ed9cad614cd283d786a1
b883cf1e 36Source2: http://llvm.org/releases/%{version}/compiler-rt-%{version}.src.tar.xz
b6fdc1d7 37# Source2-md5: aadc76e7e180fafb10fb729444e287a3
b883cf1e 38Source3: http://llvm.org/releases/%{version}/lldb-%{version}.src.tar.xz
b6fdc1d7 39# Source3-md5: 91399402f287d3f637db1207113deecb
b883cf1e 40Source4: http://llvm.org/releases/%{version}/polly-%{version}.src.tar.xz
b6fdc1d7 41# Source4-md5: 2cc7fe2bd9539775ba140abfd375bec6
b883cf1e 42Source5: http://llvm.org/releases/%{version}/clang-tools-extra-%{version}.src.tar.xz
b6fdc1d7 43# Source5-md5: 1a01d545a064fcbc46a2f05f6880d3d7
ba1cf74d 44Source6: http://llvm.org/releases/%{version}/lld-%{version}.src.tar.xz
b6fdc1d7 45# Source6-md5: 6254dd138e23b098df4ef7840c11e2c8
3c402b7e 46Patch0: %{name}-lld-link.patch
9f7b77bd
JR
47Patch1: %{name}-pld.patch
48Patch2: libdir.patch
49Patch3: x32-gcc-toolchain.patch
d96b39d3 50Patch4: cmake-buildtype.patch
d706a70d 51Patch5: %{name}-ocaml-shared.patch
3a980ab4 52Patch6: D35246.diff
20d59128 53Patch7: gcc7.patch
2326a99f 54URL: http://llvm.org/
bc88141a 55BuildRequires: bash
d997b14b 56BuildRequires: bison
036156f1 57BuildRequires: cmake >= 3.4.3
d997b14b 58BuildRequires: flex
dd9350c7
JB
59BuildRequires: gcc >= 5:3.4
60# gcc4 might be installed, but not current __cc
61%if "%(echo %{cc_version} | cut -d. -f1,2)" < "3.4"
62BuildRequires: __cc >= 3.4
9556f4c9 63%endif
2bbd0701
JR
64%ifarch x32
65BuildRequires: glibc-devel(x86_64)
66%endif
d997b14b 67BuildRequires: groff
6c2b1a44 68BuildRequires: libedit-devel
bc88141a 69BuildRequires: libltdl-devel
d997b14b 70BuildRequires: libstdc++-devel >= 5:3.4
6c2b1a44 71BuildRequires: ncurses-devel
2bbd0701 72%if %{with ocaml}
c6c890ee 73BuildRequires: ocaml-ctypes-devel >= 0.4
2bbd0701 74BuildRequires: ocaml-findlib
77c13dab 75BuildRequires: ocaml-ocamldoc
2bbd0701
JR
76BuildRequires: ocaml-ounit
77%endif
8132e62b 78BuildRequires: perl-base >= 1:5.6
8c156e7d 79BuildRequires: perl-tools-pod
6c2b1a44 80BuildRequires: python >= 1:2.7
8c156e7d 81BuildRequires: rpm-pythonprov
b0068ae4 82%{?with_doc:BuildRequires: sphinx-pdg}
b883cf1e
JB
83BuildRequires: tar >= 1:1.22
84BuildRequires: xz
6c2b1a44 85BuildRequires: zlib-devel
dd9350c7
JB
86%if %{with apidocs}
87BuildRequires: doxygen
88BuildRequires: graphviz
89%endif
90%if %{with tests}
91BuildRequires: dejagnu
dd9350c7 92BuildRequires: tcl-devel
356a0bbd 93%endif
589b92f5
JB
94%if %{with rt} && %{with multilib}
95%ifarch %{x8664}
96BuildRequires: gcc-c++-multilib-32
97BuildRequires: libstdc++-multilib-32-devel
98%endif
fe705967
JK
99%ifarch x32
100BuildRequires: gcc-c++-multilib-32
101BuildRequires: libstdc++-multilib-32-devel
102BuildRequires: gcc-c++-multilib-64
103BuildRequires: libstdc++-multilib-64-devel
104%endif
589b92f5 105%endif
b883cf1e 106%if %{with lldb}
c6c890ee 107BuildRequires: epydoc
64f4e87f
JB
108%ifarch i386 i486
109BuildRequires: libatomic-devel
110%endif
b883cf1e
JB
111BuildRequires: libxml2-devel >= 2
112BuildRequires: ncurses-ext-devel
113BuildRequires: python-devel >= 2
c6c890ee 114BuildRequires: swig-python
b883cf1e 115%endif
b0068ae4 116%if %{with polly}
6c2b1a44
JB
117#BuildRequires: gmp-devel or imath-devel (private copy in polly/lib/External/isl/imath)
118# private copy in polly/lib/External/isl
8f8049c8 119#BuildRequires: isl-devel >= 0.17.1
6c2b1a44 120#TODO (bcond): cuda-devel (with POLLY_ENABLE_GPGPU_CODEGEN=ON)
b0068ae4 121%endif
634a3e5b
JB
122%if %{with ocaml}
123BuildConflicts: llvm-ocaml
124%endif
8c514f23 125Requires: %{name}-libs = %{version}-%{release}
9556f4c9
ER
126# LLVM is not supported on PPC64
127# http://llvm.org/bugs/show_bug.cgi?id=3729
128ExcludeArch: ppc64
aa11c230 129BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
130
9ace1f65 131%define abi 3.9
356a0bbd 132%define _sysconfdir /etc/%{name}
021b3c3d 133
9556f4c9 134%define specflags_ppc -fno-var-tracking-assignments
af221038
JR
135# ix86 and x32 - the same issue as https://llvm.org/bugs/show_bug.cgi?id=27237
136%define specflags_ia32 -gsplit-dwarf
35707fa4 137%define specflags_x32 -gsplit-dwarf
9556f4c9 138
6832a5c5
ER
139# strip corrupts: $RPM_BUILD_ROOT/usr/lib64/llvm-gcc/bin/llvm-c++ ...
140%define _noautostrip .*/\\(libmud.*\\.a\\|bin/llvm-.*\\|lib.*++\\.a\\)
141
782c6e1e
ER
142# clang doesn't know -fvar-tracking-assignments, and leaving it here would pollute llvm-config
143# -Werror=format-security is for swig
144# TODO: add - -Werror=format-security to tools/lldb/scripts/LLDBWrapPython.cpp
4a1d21cc 145%define filterout_c -fvar-tracking-assignments
782c6e1e 146%define filterout_cxx -fvar-tracking-assignments -Werror=format-security
4a1d21cc
JR
147%define filterout_ccpp -fvar-tracking-assignments
148
6df3b432 149# std::__once_call, std::__once_callable non-function symbols
9a23736f 150%define skip_post_check_so liblldb.so.*
6df3b432 151
aa11c230 152%description
153LLVM is a compiler infrastructure designed for compile-time,
154link-time, runtime, and idle-time optimization of programs from
155arbitrary programming languages. LLVM is written in C++ and has been
156developed since 2000 at the University of Illinois and Apple. It
621ec11f
JB
157currently supports compilation of C and C++ programs using clang
158frontend.
aa11c230 159
2326a99f
JB
160%description -l pl.UTF-8
161LLVM to infrastruktura kompilatora zaprojektowana do optymalizacji
162czasu kompilowania, linkowania, działania i bezczynności programów w
163dowolnych językach programowania. Jest napisana w C++, rozwijana od
164roku 2000 przez Uniwersytet w Illinois i Apple. Aktualnie obsługuje
621ec11f 165kompilację programów w C i C++ przy użyciu frontendu clang.
2326a99f 166
8c514f23 167%package libs
87977e26
JR
168Summary: LLVM shared libraries
169Summary(pl.UTF-8): Biblioteki współdzielone LLVM-a
8c514f23
JB
170Group: Libraries
171Conflicts: llvm < 3.2
172
173%description libs
87977e26 174LLVM shared libraries.
8c514f23
JB
175
176%description libs -l pl.UTF-8
87977e26 177Biblioteki współdzielone LLVM-a.
8c514f23 178
bc88141a 179%package devel
621ec11f
JB
180Summary: Static libraries and header files for LLVM
181Summary(pl.UTF-8): Biblioteki statyczne i pliki nagłówkowe dla LLVM-a
bc88141a 182Group: Development/Languages
8c514f23 183Requires: %{name}-libs = %{version}-%{release}
bc88141a
ER
184Requires: libstdc++-devel >= 6:3.4
185
186%description devel
621ec11f
JB
187This package contains static libraries and header files needed to
188develop new native programs that use the LLVM infrastructure.
189
190%description devel -l pl.UTF-8
191Ten pakiet zawiera biblioteki statyczne oraz pliki nagłówkowe
192potrzebne do tworzenia nowych programów natywnych wykorzystujących
193infrastrukturę LLVM.
bc88141a 194
9556f4c9
ER
195%package doc
196Summary: Documentation for LLVM
621ec11f 197Summary(pl.UTF-8): Dokumentacja do LLVM-a
9556f4c9
ER
198Group: Documentation
199# does not require base
bc88141a 200
9556f4c9
ER
201%description doc
202Documentation for the LLVM compiler infrastructure.
bc88141a 203
621ec11f
JB
204%description doc -l pl.UTF-8
205Dokumentacja do infrastruktury kompilatorów LLVM.
206
9556f4c9
ER
207%package apidocs
208Summary: API documentation for LLVM
621ec11f 209Summary(pl.UTF-8): Dokumentacja API LLVM-a
9556f4c9
ER
210Group: Development/Languages
211Requires: %{name}-doc = %{version}-%{release}
bc88141a 212
9556f4c9
ER
213%description apidocs
214API documentation for the LLVM compiler infrastructure.
bc88141a 215
621ec11f
JB
216%description apidocs -l pl.UTF-8
217Dokumentacja API infrastruktury kompilatorów LLVM.
218
b0068ae4
JB
219%package polly
220Summary: Polyhedral optimizations for LLVM
221Summary(pl.UTF-8): Optymalizacje wielościanowe dla LLVM-a
222Group: Development/Tools
223URL: http://polly.llvm.org/
224Requires: %{name} = %{version}-%{release}
225
226%description polly
227Polly is a high-level loop and data-locality optimizer and
228optimization infrastructure for LLVM. It uses an abstract mathematical
229representation based on integer polyhedra to analyze and optimize the
230memory access pattern of a program.
231
232%description polly -l pl.UTF-8
233Polly to wysokopoziomowy optymalizator i infrastruktura LLVM-a do
234optymalizacji pętli i położenia danych. Wykorzystuje abstrakcyjną
235reprezentację matematyczną opartą na wielościanach całkowitoliczbowych
236do analizy i optymalizacji wzorców dostępu do pamięci przez program.
237
238%package polly-devel
239Summary: Header files for LLVM Polly optimization infrastructure
240Summary(pl.UTF-8): Pliki nagłówkowe infrastruktury optymalizacji LLVM-a Polly
241Group: Development/Libraries
242URL: http://polly.llvm.org/
243Requires: %{name}-devel = %{version}-%{release}
244Requires: %{name}-polly = %{version}-%{release}
245
246%description polly-devel
247Header files for LLVM Polly optimization infrastructure.
248
249%description polly-devel -l pl.UTF-8
250Pliki nagłówkowe infrastruktury optymalizacji LLVM-a Polly.
251
d997b14b
AM
252%package -n clang
253Summary: A C language family frontend for LLVM
621ec11f 254Summary(pl.UTF-8): Frontend LLVM-a do języków z rodziny C
d997b14b
AM
255License: NCSA
256Group: Development/Languages
8c514f23 257Requires: %{name} = %{version}-%{release}
87977e26 258Requires: clang-libs = %{version}-%{release}
d997b14b
AM
259
260%description -n clang
261clang: noun 1. A loud, resonant, metallic sound. 2. The strident call
262of a crane or goose. 3. C-language family front-end toolkit.
263
264The goal of the Clang project is to create a new C, C++, Objective C
265and Objective C++ front-end for the LLVM compiler. Its tools are built
266as libraries and designed to be loosely-coupled and extendable.
267
621ec11f
JB
268%description -n clang -l pl.UTF-8
269clang (z angielskiego): 1. głośny, rezonujący, metaliczny dźwięk; 2.
270piskliwy odgłos żurawia lub gęsi; 3. narzędzia frontendowe dla języków
271z rodziny C.
272
273Celem projektu Clang jest utworzenie nowego frontendu dla kompilatora
274LLVM do języków C, C++, Objective C i Objective C++. Narzędzia są
275budowane jako biblioteki i zaprojektowane z myślą o swobodnym łączeniu
276i rozszerzaniu.
277
87977e26
JR
278%package -n clang-libs
279Summary: Clang shared libraries
280Summary(pl.UTF-8): Biblioteki współdzielone Clanga
281Group: Libraries
282
283%description -n clang-libs
284Clang shared libraries.
285
286%description -n clang-libs -l pl.UTF-8
287Biblioteki współdzielone Clanga.
288
9eefd942
JR
289%package -n clang-multilib
290Summary: A C language family frontend for LLVM - 32-bit support
291Summary(pl.UTF-8): Frontend LLVM-a do języków z rodziny C - obsługa binariów 32-bitowych
292License: NCSA
293Group: Development/Languages
294Requires: clang = %{version}-%{release}
295
296%description -n clang-multilib
297clang: noun 1. A loud, resonant, metallic sound. 2. The strident call
298of a crane or goose. 3. C-language family front-end toolkit.
299
300The goal of the Clang project is to create a new C, C++, Objective C
301and Objective C++ front-end for the LLVM compiler. Its tools are built
302as libraries and designed to be loosely-coupled and extendable.
303
304This package contains the C compiler support for producing 32-bit
305programs on 64-bit host.
306
307%description -n clang-multilib -l pl.UTF-8
308clang (z angielskiego): 1. głośny, rezonujący, metaliczny dźwięk; 2.
309piskliwy odgłos żurawia lub gęsi; 3. narzędzia frontendowe dla języków
310z rodziny C.
311
312Celem projektu Clang jest utworzenie nowego frontendu dla kompilatora
313LLVM do języków C, C++, Objective C i Objective C++. Narzędzia są
314budowane jako biblioteki i zaprojektowane z myślą o swobodnym łączeniu
315i rozszerzaniu.
316
317Ten pakiet zawiera rozszerzenie kompilatora C o obsługę tworzenia
318programów 32-bitowych na maszynie 64-bitowej.
319
d997b14b
AM
320%package -n clang-analyzer
321Summary: A source code analysis framework
621ec11f 322Summary(pl.UTF-8): Szkielet do analizy kodu źródłowego
d997b14b
AM
323License: NCSA
324Group: Development/Languages
325Requires: clang = %{version}-%{release}
326# not picked up automatically since files are currently not instaled
327# in standard Python hierarchies yet
328Requires: python
329
330%description -n clang-analyzer
331The Clang Static Analyzer consists of both a source code analysis
332framework and a standalone tool that finds bugs in C and Objective-C
333programs. The standalone tool is invoked from the command-line, and is
334intended to run in tandem with a build of a project or code base.
335
621ec11f
JB
336%description -n clang-analyzer -l pl.UTF-8
337Clang Static Analyzer składa się ze szkieletu do analizy kodu
338źródłowego oraz samodzielnego narzędzia znajdującego błędy w
339programach w C i C++. Narzędzie jest wywoływane z linii poleceń, z
340myślą o uruchamianiu wraz z kompilacją projektu lub kodu.
341
9556f4c9 342%package -n clang-devel
621ec11f
JB
343Summary: Header files for Clang
344Summary(pl.UTF-8): Pliki nagłówkowe Clanga
9556f4c9 345Group: Development/Languages
8c514f23 346Requires: %{name}-devel = %{version}-%{release}
9556f4c9
ER
347Requires: clang = %{version}-%{release}
348
349%description -n clang-devel
350This package contains header files for the Clang compiler.
351
621ec11f
JB
352%description -n clang-devel -l pl.UTF-8
353Ten pakiet zawiera pliki nagłówkowe kompilatora Clang.
354
9556f4c9
ER
355%package -n clang-doc
356Summary: Documentation for Clang
621ec11f 357Summary(pl.UTF-8): Dokumentacja do Clanga
9556f4c9
ER
358Group: Documentation
359Requires: %{name} = %{version}-%{release}
360
361%description -n clang-doc
362Documentation for the Clang compiler front-end.
363
621ec11f
JB
364%description -n clang-doc -l pl.UTF-8
365Dokumentacja do frontendu kompilatora Clang.
366
9556f4c9
ER
367%package -n clang-apidocs
368Summary: API documentation for Clang
621ec11f 369Summary(pl.UTF-8): Dokumentacja API Clanga
9556f4c9
ER
370Group: Development/Languages
371Requires: clang-doc = %{version}-%{release}
372
373%description -n clang-apidocs
374API documentation for the Clang compiler.
375
621ec11f
JB
376%description -n clang-apidocs -l pl.UTF-8
377Dokumentacja API kompilatora Clang.
378
b0068ae4
JB
379%package -n clang-tools-extra
380Summary: Extra tools for Clang
381Summary(pl.UTF-8): Dodatkowe narzędzia do kompilatora Clang
382Group: Development/Tools
383URL: http://clang.llvm.org/docs/ClangTools.html
384Requires: clang = %{version}-%{release}
385
386%description -n clang-tools-extra
387Extra tools for Clang.
388
389%description -n clang-tools-extra -l pl.UTF-8
390Dodatkowe narzędzia do kompilatora Clang.
391
ba1cf74d
JB
392%package -n lld
393Summary: The LLVM linker
394Summary(pl.UTF-8): Konsolidator z projektu LLVM
395Group: Development/Libraries
396URL: http://lld.llvm.org/
397Requires: %{name} = %{version}-%{release}
398
399%description -n lld
400lld is a new set of modular code for creating linker tools.
401
402%description -n lld -l pl.UTF-8
403lld to nowy zbiór modularnego kodu do tworzenia narzędzi
404konsolidujących.
405
406%package -n lld-devel
407Summary: Development files for LLD linker tools
408Summary(pl.UTF-8): Pliki programistyczne narzędzi konsolidujących LLD
409Group: Development/Tools
410URL: http://lld.llvm.org/
411Requires: %{name}-devel = %{version}-%{release}
412
413%description -n lld-devel
414Development files for LLD linker tools.
415
416%description -n lld-devel -l pl.UTF-8
417Pliki programistyczne narzędzi konsolidujących LLD.
418
5a7ac479
JB
419%package -n lldb
420Summary: Next generation high-performance debugger
421Summary(pl.UTF-8): Wydajny debugger nowej generacji
422Group: Development/Debuggers
ba1cf74d 423URL: http://lldb.llvm.org/
5a7ac479 424Requires: %{name} = %{version}-%{release}
d706a70d 425Requires: python-six
5a7ac479
JB
426
427%description -n lldb
428LLDB is a next generation, high-performance debugger. It is built as a
429set of reusable components which highly leverage existing libraries in
430the larger LLVM Project, such as the Clang expression parser and LLVM
431disassembler.
432
433%description -n lldb -l pl.UTF-8
434LLDB to wydajny debugger nowej generacji. Jest zbudowany w oparciu o
435komponenty wielokrotnego użytku, wykorzystujące istniejące biblioteki
436w projekcie LLVM, takie jak analizator wyrażeń kompilatora Clang oraz
437disasembler LLVM.
438
439%package -n lldb-devel
ba1cf74d
JB
440Summary: Development files for LLDB debugger
441Summary(pl.UTF-8): Pliki programistyczne debuggera LLDB
5a7ac479 442Group: Development/Libraries
ba1cf74d 443URL: http://lldb.llvm.org/
5a7ac479
JB
444Requires: %{name}-devel = %{version}-%{release}
445Requires: clang-devel = %{version}-%{release}
446Requires: lldb = %{version}-%{release}
447
448%description -n lldb-devel
ba1cf74d 449Development files for LLDB debugger.
5a7ac479
JB
450
451%description -n lldb-devel -l pl.UTF-8
ba1cf74d 452Pliki programistyczne debuggera LLDB.
5a7ac479 453
9556f4c9
ER
454%package ocaml
455Summary: OCaml binding for LLVM
621ec11f
JB
456Summary(pl.UTF-8): Wiązanie OCamla do LLVM-a
457Group: Libraries
9556f4c9 458Requires: %{name} = %{version}-%{release}
c450bf27 459%if %{with ocaml}
9556f4c9 460%requires_eq ocaml-runtime
c450bf27 461%endif
9556f4c9 462
621ec11f 463%description ocaml
9556f4c9
ER
464OCaml binding for LLVM.
465
621ec11f
JB
466%description ocaml -l pl.UTF-8
467Wiązanie OCamla do LLVM-a.
468
9556f4c9 469%package ocaml-devel
621ec11f
JB
470Summary: Development files for LLVM OCaml binding
471Summary(pl.UTF-8): Pliki programistyczne wiązania OCamla do LLVM-a
9556f4c9
ER
472Group: Development/Libraries
473Requires: %{name}-devel = %{version}-%{release}
474Requires: %{name}-ocaml = %{version}-%{release}
475
476%description ocaml-devel
477The llvm-ocaml-devel package contains libraries and signature files
621ec11f
JB
478for developing applications that use llvm-ocaml binding.
479
480%description ocaml-devel -l pl.UTF-8
481Ten pakiet zawiera biblioteki i pliki sygnatur do tworzenia aplikacji
482wykorzystujących wiązanie llvm-ocaml.
483
9556f4c9
ER
484%package ocaml-doc
485Summary: Documentation for LLVM's OCaml binding
621ec11f 486Summary(pl.UTF-8): Dokumentacja wiązania OCamla do LLVM-a
9556f4c9
ER
487Group: Documentation
488Requires: %{name}-ocaml = %{version}-%{release}
489
490%description ocaml-doc
491HTML documentation for LLVM's OCaml binding.
492
621ec11f
JB
493%description ocaml-doc -l pl.UTF-8
494Dokumentacja HTML wiązania OCamla do LLVM-a.
495
aa11c230 496%prep
ba1cf74d 497%setup -q -n %{name}-%{version}.src -a1 %{?with_rt:-a2} %{?with_lldb:-a3} %{?with_polly:-a4} -a5 -a6
d706a70d 498%{__mv} cfe-%{version}.src tools/clang
b883cf1e
JB
499%{?with_rt:mv compiler-rt-%{version}.src projects/compiler-rt}
500%{?with_lldb:mv lldb-%{version}.src tools/lldb}
501%{?with_polly:mv polly-%{version}.src tools/polly}
d706a70d
JB
502%{__mv} clang-tools-extra-%{version}.src tools/clang/tools/extra
503%{__mv} lld-%{version}.src tools/lld
5a7ac479 504
3c402b7e 505%patch0 -p1
9f7b77bd 506%patch1 -p1
ebde279d 507%patch2 -p1
9f7b77bd 508%patch3 -p1
d96b39d3 509%patch4 -p1
d706a70d 510%patch5 -p1
3a980ab4 511%patch6 -p0
20d59128 512%patch7 -p1
ce9cc204 513
bacc8b96
ER
514grep -rl /usr/bin/env tools utils | xargs sed -i -e '1{
515 s,^#!.*bin/env python,#!%{__python},
516 s,^#!.*bin/env perl,#!%{__perl},
517}'
518
d756c460 519%build
41876fe7 520install -d build
ebde279d 521
d997b14b 522# Disabling assertions now, rec. by pure and needed for OpenGTL
9556f4c9 523# TESTFIX no PIC on ix86: http://llvm.org/bugs/show_bug.cgi?id=3801
41876fe7 524cd build
5e689738 525CPPFLAGS="%{rpmcppflags} -D_FILE_OFFSET_BITS=64"
2bbd0701 526
d96b39d3 527%cmake \
41876fe7
JR
528%ifarch %{x8664}
529 -DLLVM_LIBDIR_SUFFIX:STRING=64 \
530%endif
531%ifarch x32
532 -DLLVM_LIBDIR_SUFFIX:STRING=x32 \
533%endif
9556f4c9 534%if %{with apidocs}
41876fe7 535 -DLLVM_ENABLE_DOXYGEN:BOOL=ON \
d997b14b 536%endif
41876fe7
JR
537%if %{with doc}
538 -DLLVM_ENABLE_SPHINX:BOOL=ON \
e962ba72 539 -DSPHINX_WARNINGS_AS_ERRORS=OFF \
41876fe7 540%endif
6c382d2a 541 -DLLVM_ENABLE_PIC:BOOL=ON \
41876fe7
JR
542 -DLLVM_ENABLE_ASSERTIONS:BOOL=OFF \
543 -DLLVM_ENABLE_CXX1Y:BOOL=ON \
82174e17 544 -DLLVM_BINDINGS_LIST:LIST="%{?with_ocaml:ocaml}" \
9a23736f
JB
545 -DLLVM_BUILD_LLVM_DYLIB:BOOL=ON \
546 -DLLVM_LINK_LLVM_DYLIB:BOOL=ON \
547 -DBUILD_SHARED_LIBS:BOOL=OFF \
036156f1 548 -DENABLE_LINKER_BUILD_ID:BOOL=ON \
e748f12a 549 -DLLVM_BINUTILS_INCDIR:STRING=%{_includedir} \
d96b39d3 550 ../
41876fe7 551
d997b14b 552%{__make} \
1628dc68 553 VERBOSE=1 \
0a0b7076 554 REQUIRES_RTTI=1 \
d997b14b 555 OPTIMIZE_OPTION="%{rpmcflags} %{rpmcppflags}"
aa11c230 556
827664e9 557%if %{with tests}
9556f4c9
ER
558%{__make} check 2>&1 | tee llvm-testlog.txt
559%{__make} -C tools/clang test 2>&1 | tee clang-testlog.txt
560%endif
561
b0068ae4 562%if %{with doc}
41876fe7
JR
563%{__make} -C docs docs-llvm-html
564%{__make} -C docs docs-llvm-man
c6c890ee 565%if %{with ocaml}
41876fe7 566%{__make} -C docs ocaml_doc
c6c890ee 567%endif
41876fe7
JR
568%{__make} -C tools/clang/docs docs-clang-html
569%{__make} -C tools/clang/docs docs-clang-man
570%{__make} -C tools/lld/docs docs-lld-html
571%{__make} -C tools/lldb/docs lldb-python-doc
572%{__make} -C tools/lldb/docs lldb-cpp-doc
dd9350c7
JB
573%endif
574
aa11c230 575%install
576rm -rf $RPM_BUILD_ROOT
41876fe7 577%{__make} -C build install \
aa11c230 578 DESTDIR=$RPM_BUILD_ROOT
579
6df3b432
JB
580# only some .pyc files are created by make install
581%py_comp $RPM_BUILD_ROOT%{py_sitedir}
582%py_ocomp $RPM_BUILD_ROOT%{py_sitedir}
583
634a3e5b 584# Adjust static analyzer installation
9556f4c9 585# http://clang-analyzer.llvm.org/installation#OtherPlatforms
634a3e5b
JB
586install -d $RPM_BUILD_ROOT%{_libdir}/scan-build
587%{__mv} $RPM_BUILD_ROOT%{_prefix}/libexec/c??-analyzer $RPM_BUILD_ROOT%{_libdir}/scan-build
80d95ac6 588%{__sed} -i -e 's,/\.\./libexec/,/../%{_lib}/scan-build/,' $RPM_BUILD_ROOT%{_bindir}/scan-build
634a3e5b
JB
589%py_comp $RPM_BUILD_ROOT%{_datadir}/scan-view
590%py_ocomp $RPM_BUILD_ROOT%{_datadir}/scan-view
591%py_postclean %{_datadir}/scan-view
d997b14b 592
6df3b432 593# not installed by cmake buildsystem
6df3b432
JB
594install build/bin/pp-trace $RPM_BUILD_ROOT%{_bindir}
595
b0068ae4 596%if %{with doc}
6df3b432 597cp -p build/docs/man/*.1 $RPM_BUILD_ROOT%{_mandir}/man1
b883cf1e
JB
598# these tools are not installed
599%{__rm} $RPM_BUILD_ROOT%{_mandir}/man1/{FileCheck,llvm-build}.1
b0068ae4
JB
600# make links
601echo '.so llvm-ar.1' > $RPM_BUILD_ROOT%{_mandir}/man1/llvm-ranlib.1
dd9350c7
JB
602%endif
603
d997b14b 604# Move documentation back to build directory
2bbd0701 605%if %{with ocaml}
6df3b432 606rm -rf ocamldocs
634a3e5b 607%{__mv} $RPM_BUILD_ROOT%{_prefix}/docs/ocaml/html/html ocamldocs
2bbd0701 608%endif
9556f4c9
ER
609
610# and separate the apidoc
611%if %{with apidocs}
6df3b432
JB
612rm -rf clang-apidoc
613cp -a build/tools/clang/docs/html clang-apidoc
9556f4c9 614%endif
d997b14b
AM
615
616# And prepare Clang documentation
d997b14b 617rm -rf clang-docs
9556f4c9 618install -d clang-docs
827664e9 619for f in LICENSE.TXT NOTES.txt README.txt; do
9556f4c9 620 ln tools/clang/$f clang-docs
d997b14b 621done
021b3c3d 622
6832a5c5 623# Get rid of erroneously installed example files.
6df3b432
JB
624%{__rm} $RPM_BUILD_ROOT%{_libdir}/LLVMHello.so
625# test?
d706a70d 626%{__rm} $RPM_BUILD_ROOT%{_bindir}/{c-index-test,llvm-c-test}
6df3b432
JB
627# not this OS
628%{__rm} $RPM_BUILD_ROOT%{_datadir}/clang/clang-format-bbedit.applescript
d706a70d
JB
629# use system six
630%{__rm} $RPM_BUILD_ROOT%{py_sitedir}/six.py*
03073220
JK
631# it seems it is used internally by an extra clang tool
632%{__rm} $RPM_BUILD_ROOT%{_libdir}/libfindAllSymbols.a
6832a5c5 633
aa11c230 634%clean
635rm -rf $RPM_BUILD_ROOT
636
8c514f23
JB
637%post libs -p /sbin/ldconfig
638%postun libs -p /sbin/ldconfig
aa11c230 639
5a7ac479
JB
640%post -n clang -p /sbin/ldconfig
641%postun -n clang -p /sbin/ldconfig
642
643%post -n lldb -p /sbin/ldconfig
644%postun -n lldb -p /sbin/ldconfig
645
aa11c230 646%files
647%defattr(644,root,root,755)
8132e62b 648%doc CREDITS.TXT LICENSE.TXT README.txt %{?with_tests:llvm-testlog.txt}
a9beeab5 649%attr(755,root,root) %{_bindir}/bugpoint
a9beeab5
JB
650%attr(755,root,root) %{_bindir}/llc
651%attr(755,root,root) %{_bindir}/lli
8132e62b
JB
652%attr(755,root,root) %{_bindir}/llvm-ar
653%attr(755,root,root) %{_bindir}/llvm-as
654%attr(755,root,root) %{_bindir}/llvm-bcanalyzer
827664e9 655%attr(755,root,root) %{_bindir}/llvm-cov
8132e62b
JB
656%attr(755,root,root) %{_bindir}/llvm-diff
657%attr(755,root,root) %{_bindir}/llvm-dis
4ba3b2b3 658%attr(755,root,root) %{_bindir}/llvm-dsymutil
827664e9 659%attr(755,root,root) %{_bindir}/llvm-dwarfdump
264482e1 660%attr(755,root,root) %{_bindir}/llvm-dwp
8132e62b 661%attr(755,root,root) %{_bindir}/llvm-extract
6df3b432 662%attr(755,root,root) %{_bindir}/llvm-lib
8132e62b 663%attr(755,root,root) %{_bindir}/llvm-link
3c402b7e 664%attr(755,root,root) %{_bindir}/llvm-lto
8132e62b 665%attr(755,root,root) %{_bindir}/llvm-mc
dd9350c7 666%attr(755,root,root) %{_bindir}/llvm-mcmarkup
8132e62b
JB
667%attr(755,root,root) %{_bindir}/llvm-nm
668%attr(755,root,root) %{_bindir}/llvm-objdump
b883cf1e 669%attr(755,root,root) %{_bindir}/llvm-profdata
8132e62b 670%attr(755,root,root) %{_bindir}/llvm-ranlib
f981d747 671%attr(755,root,root) %{_bindir}/llvm-readobj
827664e9
PS
672%attr(755,root,root) %{_bindir}/llvm-rtdyld
673%attr(755,root,root) %{_bindir}/llvm-size
264482e1 674%attr(755,root,root) %{_bindir}/llvm-split
f981d747 675%attr(755,root,root) %{_bindir}/llvm-stress
1628dc68 676%attr(755,root,root) %{_bindir}/llvm-symbolizer
827664e9 677%attr(755,root,root) %{_bindir}/llvm-tblgen
41876fe7
JR
678%attr(755,root,root) %{_bindir}/llvm-cxxdump
679%attr(755,root,root) %{_bindir}/llvm-pdbdump
4ba3b2b3 680%attr(755,root,root) %{_bindir}/obj2yaml
8132e62b 681%attr(755,root,root) %{_bindir}/opt
d706a70d 682%attr(755,root,root) %{_bindir}/sancov
03073220 683%attr(755,root,root) %{_bindir}/sanstats
4ba3b2b3
JB
684%attr(755,root,root) %{_bindir}/verify-uselistorder
685%attr(755,root,root) %{_bindir}/yaml2obj
b0068ae4 686%if %{with doc}
a9beeab5 687%{_mandir}/man1/bugpoint.1*
a7973f21 688%{_mandir}/man1/lit.1*
a9beeab5
JB
689%{_mandir}/man1/llc.1*
690%{_mandir}/man1/lli.1*
8132e62b
JB
691%{_mandir}/man1/llvm-ar.1*
692%{_mandir}/man1/llvm-as.1*
693%{_mandir}/man1/llvm-bcanalyzer.1*
f981d747 694%{_mandir}/man1/llvm-cov.1*
8132e62b
JB
695%{_mandir}/man1/llvm-diff.1*
696%{_mandir}/man1/llvm-dis.1*
b883cf1e 697%{_mandir}/man1/llvm-dwarfdump.1*
8132e62b 698%{_mandir}/man1/llvm-extract.1*
d706a70d 699%{_mandir}/man1/llvm-lib.1*
8132e62b
JB
700%{_mandir}/man1/llvm-link.1*
701%{_mandir}/man1/llvm-nm.1*
b883cf1e 702%{_mandir}/man1/llvm-profdata.1*
8132e62b 703%{_mandir}/man1/llvm-ranlib.1*
c999855f 704%{_mandir}/man1/llvm-readobj.1*
f981d747 705%{_mandir}/man1/llvm-stress.1*
1628dc68 706%{_mandir}/man1/llvm-symbolizer.1*
a9beeab5 707%{_mandir}/man1/opt.1*
dd9350c7 708%{_mandir}/man1/tblgen.1*
b0068ae4 709%endif
bc88141a 710
8c514f23
JB
711%files libs
712%defattr(644,root,root,755)
9a23736f
JB
713%attr(755,root,root) %{_libdir}/libLLVM-%{abi}.so
714# non-soname symlink
715%attr(755,root,root) %{_libdir}/libLLVM-%{version}.so
716%attr(755,root,root) %{_libdir}/libLTO.so
e748f12a 717%attr(755,root,root) %{_libdir}/LLVMgold.so
8c514f23 718
bc88141a
ER
719%files devel
720%defattr(644,root,root,755)
721%attr(755,root,root) %{_bindir}/llvm-config
9a23736f 722%attr(755,root,root) %{_libdir}/libLLVM.so
0a8510f2 723%attr(755,root,root) %{_libdir}/BugpointPasses.so
d706a70d 724%{_libdir}/libLLVM*.a
8132e62b
JB
725%{_includedir}/llvm
726%{_includedir}/llvm-c
9ace1f65 727%{_libdir}/cmake/llvm
b0068ae4 728%if %{with doc}
8132e62b 729%{_mandir}/man1/llvm-config.1*
b0068ae4 730%endif
bc88141a 731
6df3b432
JB
732#%files doc
733#%defattr(644,root,root,755)
9556f4c9
ER
734
735%if %{with apidocs}
736%files apidocs
737%defattr(644,root,root,755)
738%doc apidoc/*
739%endif
740
b0068ae4
JB
741%if %{with polly}
742%files polly
743%defattr(644,root,root,755)
6c2b1a44 744%doc tools/polly/{CREDITS.txt,LICENSE.txt,README} tools/polly/www/{bugs,changelog,contributors}.html
b0068ae4
JB
745%attr(755,root,root) %{_libdir}/LLVMPolly.so
746
747%files polly-devel
748%defattr(644,root,root,755)
9a23736f
JB
749%{_libdir}/libPolly.a
750%{_libdir}/libPollyISL.a
03073220 751%{_libdir}/libPollyPPCG.a
b0068ae4
JB
752%{_includedir}/polly
753%endif
754
d997b14b 755%files -n clang
bc88141a 756%defattr(644,root,root,755)
827664e9 757%doc clang-docs/{LICENSE.TXT,NOTES.txt,README.txt} %{?with_tests:clang-testlog.txt}
8132e62b
JB
758%attr(755,root,root) %{_bindir}/clang
759%attr(755,root,root) %{_bindir}/clang++
509439cf 760%attr(755,root,root) %{_bindir}/clang-%{abi}
dd9350c7 761%attr(755,root,root) %{_bindir}/clang-check
6df3b432 762%attr(755,root,root) %{_bindir}/clang-cl
1628dc68 763%attr(755,root,root) %{_bindir}/clang-format
6df3b432 764%attr(755,root,root) %{_bindir}/git-clang-format
5a7ac479
JB
765%dir %{_libdir}/clang
766%dir %{_libdir}/clang/%{version}
767%{_libdir}/clang/%{version}/include
768%if %{with rt}
b0e18b64 769%ifarch %{ix86} %{x8664} x32
9eefd942
JR
770%dir %{_libdir}/clang/%{version}/lib
771%dir %{_libdir}/clang/%{version}/lib/linux
772%endif
773%ifarch %{ix86}
774%{_libdir}/clang/%{version}/lib/linux/libclang_rt.*-i*86.a
775%attr(755,root,root) %{_libdir}/clang/%{version}/lib/linux/libclang_rt.*-i*86.so
c6c890ee
JB
776%endif
777%ifarch %{x8664}
9eefd942
JR
778%{_libdir}/clang/%{version}/lib/linux/libclang_rt.*-x86_64.a
779%attr(755,root,root) %{_libdir}/clang/%{version}/lib/linux/libclang_rt.*-x86_64.so
f4c0e8bd 780%{_libdir}/clang/%{version}/lib/linux/libclang_rt.*-x86_64.a.syms
3c402b7e 781%endif
b0e18b64 782%ifarch %{ix86} %{x8664} x32 %{arm} aarch64 mips mips64 ppc64
d706a70d
JB
783%{_libdir}/clang/%{version}/asan_blacklist.txt
784%endif
b0e18b64 785%ifarch %{ix86} %{x8664} x32 mips64
d706a70d
JB
786%{_libdir}/clang/%{version}/cfi_blacklist.txt
787%endif
b0e18b64 788%ifarch %{x8664} x32 aarch64 mips64
d706a70d
JB
789%{_libdir}/clang/%{version}/dfsan_abilist.txt
790%{_libdir}/clang/%{version}/msan_blacklist.txt
791%endif
5a7ac479 792%endif
3c402b7e
JB
793%dir %{_datadir}/clang
794%{_datadir}/clang/clang-format-diff.py
d997b14b 795
87977e26
JR
796%files -n clang-libs
797%defattr(644,root,root,755)
509439cf 798%attr(755,root,root) %{_libdir}/libclang.so.%{abi}
87977e26 799
589b92f5 800%if %{with rt} && %{with multilib}
b0e18b64 801%ifarch %{x8664} x32
9eefd942
JR
802%files -n clang-multilib
803%defattr(644,root,root,755)
804%{_libdir}/clang/%{version}/lib/linux/libclang_rt.*-i386.a
805%attr(755,root,root) %{_libdir}/clang/%{version}/lib/linux/libclang_rt.*-i386.so
806%endif
b0e18b64
JB
807%ifarch x32
808%{_libdir}/clang/%{version}/lib/linux/libclang_rt.*-x86_64.a
809%attr(755,root,root) %{_libdir}/clang/%{version}/lib/linux/libclang_rt.*-x86_64.so
810%{_libdir}/clang/%{version}/lib/linux/libclang_rt.*-x86_64.a.syms
811%endif
9eefd942
JR
812%endif
813
d997b14b 814%files -n clang-analyzer
bc88141a 815%defattr(644,root,root,755)
d997b14b
AM
816%attr(755,root,root) %{_bindir}/scan-build
817%attr(755,root,root) %{_bindir}/scan-view
634a3e5b
JB
818%{_datadir}/scan-build
819%{_datadir}/scan-view
dd9350c7 820%{_mandir}/man1/scan-build.1*
4522eb9a
JB
821%dir %{_libdir}/scan-build
822%attr(755,root,root) %{_libdir}/scan-build/c++-analyzer
823%attr(755,root,root) %{_libdir}/scan-build/ccc-analyzer
8132e62b 824
9556f4c9
ER
825%files -n clang-devel
826%defattr(644,root,root,755)
9a23736f
JB
827%attr(755,root,root) %{_libdir}/libclang.so
828%{_libdir}/libclang*.a
9556f4c9
ER
829%{_includedir}/clang
830%{_includedir}/clang-c
9ace1f65 831%{_libdir}/cmake/clang
9556f4c9
ER
832
833%files -n clang-doc
834%defattr(644,root,root,755)
41876fe7 835%doc tools/clang/docs/*.{html,png,txt}
9556f4c9
ER
836
837%if %{with apidocs}
838%files -n clang-apidocs
839%defattr(644,root,root,755)
840%doc clang-apidoc/*
841%endif
842
b0068ae4
JB
843%files -n clang-tools-extra
844%defattr(644,root,root,755)
9ace1f65 845%doc tools/clang/tools/extra/{CODE_OWNERS.TXT,README.txt}
b0068ae4 846%attr(755,root,root) %{_bindir}/clang-apply-replacements
03073220 847%attr(755,root,root) %{_bindir}/clang-include-fixer
b883cf1e 848%attr(755,root,root) %{_bindir}/clang-query
4ba3b2b3 849%attr(755,root,root) %{_bindir}/clang-rename
b0068ae4 850%attr(755,root,root) %{_bindir}/clang-tidy
03073220 851%attr(755,root,root) %{_bindir}/find-all-symbols
d706a70d 852%attr(755,root,root) %{_bindir}/modularize
b0068ae4 853%attr(755,root,root) %{_bindir}/pp-trace
03073220 854%{_datadir}/clang/clang-include-fixer.py
d706a70d
JB
855%{_datadir}/clang/clang-tidy-diff.py
856%{_datadir}/clang/run-clang-tidy.py
03073220 857%{_datadir}/clang/run-find-all-symbols.py
b0068ae4 858
ba1cf74d
JB
859%files -n lld
860%defattr(644,root,root,755)
861%doc tools/lld/{LICENSE.TXT,README.md}
d706a70d 862%attr(755,root,root) %{_bindir}/ld.lld
ba1cf74d 863%attr(755,root,root) %{_bindir}/lld
d706a70d 864%attr(755,root,root) %{_bindir}/lld-link
ba1cf74d
JB
865
866%files -n lld-devel
867%defattr(644,root,root,755)
9a23736f 868%{_libdir}/liblld[ACDEHMRXY]*.a
ba1cf74d
JB
869%{_includedir}/lld
870
5a7ac479
JB
871%if %{with lldb}
872%files -n lldb
873%defattr(644,root,root,755)
874%attr(755,root,root) %{_bindir}/lldb
6df3b432 875%attr(755,root,root) %{_bindir}/lldb-%{version}
4522eb9a 876%attr(755,root,root) %{_bindir}/lldb-argdumper
b883cf1e 877%attr(755,root,root) %{_bindir}/lldb-mi
6df3b432
JB
878%attr(755,root,root) %{_bindir}/lldb-mi-%{version}
879%attr(755,root,root) %{_bindir}/lldb-server
880%attr(755,root,root) %{_bindir}/lldb-server-%{version}
881%attr(755,root,root) %{_libdir}/liblldb.so.%{version}
b883cf1e 882%dir %{py_sitedir}/lldb
4522eb9a 883%attr(755,root,root) %{py_sitedir}/lldb/lldb-argdumper
6df3b432
JB
884%{py_sitedir}/lldb/formatters
885%{py_sitedir}/lldb/runtime
886%{py_sitedir}/lldb/utils
887%{py_sitedir}/lldb/__init__.py[co]
888%{py_sitedir}/lldb/embedded_interpreter.py[co]
b883cf1e
JB
889%attr(755,root,root) %{py_sitedir}/lldb/_lldb.so
890%attr(755,root,root) %{py_sitedir}/readline.so
5a7ac479
JB
891
892%files -n lldb-devel
893%defattr(644,root,root,755)
6df3b432 894%attr(755,root,root) %{_libdir}/liblldb.so
5a7ac479
JB
895%{_libdir}/liblldb*.a
896%{_includedir}/lldb
897%endif
898
9556f4c9 899%if %{with ocaml}
d997b14b
AM
900%files ocaml
901%defattr(644,root,root,755)
11b6f380
JB
902%{_libdir}/ocaml/META.llvm*
903%attr(755,root,root) %{_libdir}/ocaml/dllllvm*.so
8132e62b
JB
904%{_libdir}/ocaml/llvm*.cma
905%{_libdir}/ocaml/llvm*.cmi
d997b14b
AM
906
907%files ocaml-devel
908%defattr(644,root,root,755)
8132e62b
JB
909%{_libdir}/ocaml/libllvm*.a
910%{_libdir}/ocaml/llvm*.a
911%{_libdir}/ocaml/llvm*.cmx*
9556f4c9
ER
912
913%files ocaml-doc
914%defattr(644,root,root,755)
6df3b432 915%doc ocamldocs/*
9556f4c9 916%endif
This page took 0.290757 seconds and 4 git commands to generate.