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