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