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