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