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