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