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