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