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