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