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