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