3 # - fix include search path to support libdir/gcc/platform/version/include.
4 # current error: /usr/include/wchar.h:39:11: fatal error: 'stdarg.h' file not found# include <stdarg.h>
7 %bcond_without lldb # LLDB debugger
8 %bcond_without rt # compiler-rt libraries
9 %bcond_without ocaml # OCaml binding
10 %bcond_without man # man pages
11 %bcond_with apidocs # doxygen docs (HUGE, so they are not built by default)
12 %bcond_with tests # run tests
14 %ifarch s390 s390x sparc64
15 # No ocaml on these arches
19 Summary: The Low Level Virtual Machine (An Optimizing Compiler Infrastructure)
20 Summary(pl.UTF-8): Niskopoziomowa maszyna wirtualna (infrastruktura kompilatora optymalizującego)
24 License: University of Illinois/NCSA Open Source License
25 Group: Development/Languages
26 #Source0Download: http://llvm.org/releases/download.html
27 Source0: http://llvm.org/releases/%{version}/%{name}-%{version}.src.tar.gz
28 # Source0-md5: b90697f4de35563ad6c35924defa8dd1
29 Source1: http://llvm.org/releases/%{version}/cfe-%{version}.src.tar.gz
30 # Source1-md5: c64fdc567383211c9ac212d6f7b69263
31 Source2: http://llvm.org/releases/3.4/compiler-rt-3.4.src.tar.gz
32 # Source2-md5: 7938353e3a3bda85733a165e7ac4bb84
33 Source3: http://llvm.org/releases/3.4/lldb-3.4.src.tar.gz
34 # Source3-md5: 7ed60a0463f9fdfa20db7109d4624cee
35 Patch0: %{name}-config.patch
36 # Data files should be installed with timestamps preserved
37 Patch1: %{name}-2.6-timestamp.patch
38 Patch2: %{name}-pld.patch
39 Patch3: %{name}-destdir.patch
41 BuildRequires: autoconf >= 2.60
42 BuildRequires: automake >= 1:1.9.6
46 BuildRequires: gcc >= 5:3.4
47 # gcc4 might be installed, but not current __cc
48 %if "%(echo %{cc_version} | cut -d. -f1,2)" < "3.4"
49 BuildRequires: __cc >= 3.4
52 BuildRequires: libltdl-devel
53 BuildRequires: libtool >= 2:1.5.22
54 BuildRequires: libstdc++-devel >= 5:3.4
55 BuildRequires: ocaml-ocamldoc
56 BuildRequires: perl-base >= 1:5.6
57 BuildRequires: perl-tools-pod
58 BuildRequires: rpm-pythonprov
59 %{?with_man:BuildRequires: sphinx-pdg}
61 BuildRequires: doxygen
62 BuildRequires: graphviz
65 BuildRequires: dejagnu
67 BuildRequires: tcl-devel
69 Requires: %{name}-libs = %{version}-%{release}
70 # LLVM is not supported on PPC64
71 # http://llvm.org/bugs/show_bug.cgi?id=3729
73 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
75 %define _sysconfdir /etc/%{name}
77 %define specflags_ppc -fno-var-tracking-assignments
79 # strip corrupts: $RPM_BUILD_ROOT/usr/lib64/llvm-gcc/bin/llvm-c++ ...
80 %define _noautostrip .*/\\(libmud.*\\.a\\|bin/llvm-.*\\|lib.*++\\.a\\)
83 LLVM is a compiler infrastructure designed for compile-time,
84 link-time, runtime, and idle-time optimization of programs from
85 arbitrary programming languages. LLVM is written in C++ and has been
86 developed since 2000 at the University of Illinois and Apple. It
87 currently supports compilation of C and C++ programs using clang
90 %description -l pl.UTF-8
91 LLVM to infrastruktura kompilatora zaprojektowana do optymalizacji
92 czasu kompilowania, linkowania, działania i bezczynności programów w
93 dowolnych językach programowania. Jest napisana w C++, rozwijana od
94 roku 2000 przez Uniwersytet w Illinois i Apple. Aktualnie obsługuje
95 kompilację programów w C i C++ przy użyciu frontendu clang.
98 Summary: LLVM shared library
99 Summary(pl.UTF-8): Biblioteka współdzielona LLVM-a
101 Conflicts: llvm < 3.2
106 %description libs -l pl.UTF-8
107 Biblioteka współdzielona LLVM-a.
110 Summary: Static libraries and header files for LLVM
111 Summary(pl.UTF-8): Biblioteki statyczne i pliki nagłówkowe dla LLVM-a
112 Group: Development/Languages
113 Requires: %{name}-libs = %{version}-%{release}
114 Requires: libstdc++-devel >= 6:3.4
117 This package contains static libraries and header files needed to
118 develop new native programs that use the LLVM infrastructure.
120 %description devel -l pl.UTF-8
121 Ten pakiet zawiera biblioteki statyczne oraz pliki nagłówkowe
122 potrzebne do tworzenia nowych programów natywnych wykorzystujących
126 Summary: Documentation for LLVM
127 Summary(pl.UTF-8): Dokumentacja do LLVM-a
129 # does not require base
132 Documentation for the LLVM compiler infrastructure.
134 %description doc -l pl.UTF-8
135 Dokumentacja do infrastruktury kompilatorów LLVM.
138 Summary: API documentation for LLVM
139 Summary(pl.UTF-8): Dokumentacja API LLVM-a
140 Group: Development/Languages
141 Requires: %{name}-doc = %{version}-%{release}
144 API documentation for the LLVM compiler infrastructure.
146 %description apidocs -l pl.UTF-8
147 Dokumentacja API infrastruktury kompilatorów LLVM.
150 Summary: A C language family frontend for LLVM
151 Summary(pl.UTF-8): Frontend LLVM-a do języków z rodziny C
153 Group: Development/Languages
154 Requires: %{name} = %{version}-%{release}
156 %description -n clang
157 clang: noun 1. A loud, resonant, metallic sound. 2. The strident call
158 of a crane or goose. 3. C-language family front-end toolkit.
160 The goal of the Clang project is to create a new C, C++, Objective C
161 and Objective C++ front-end for the LLVM compiler. Its tools are built
162 as libraries and designed to be loosely-coupled and extendable.
164 %description -n clang -l pl.UTF-8
165 clang (z angielskiego): 1. głośny, rezonujący, metaliczny dźwięk; 2.
166 piskliwy odgłos żurawia lub gęsi; 3. narzędzia frontendowe dla języków
169 Celem projektu Clang jest utworzenie nowego frontendu dla kompilatora
170 LLVM do języków C, C++, Objective C i Objective C++. Narzędzia są
171 budowane jako biblioteki i zaprojektowane z myślą o swobodnym łączeniu
174 %package -n clang-analyzer
175 Summary: A source code analysis framework
176 Summary(pl.UTF-8): Szkielet do analizy kodu źródłowego
178 Group: Development/Languages
179 Requires: clang = %{version}-%{release}
180 # not picked up automatically since files are currently not instaled
181 # in standard Python hierarchies yet
184 %description -n clang-analyzer
185 The Clang Static Analyzer consists of both a source code analysis
186 framework and a standalone tool that finds bugs in C and Objective-C
187 programs. The standalone tool is invoked from the command-line, and is
188 intended to run in tandem with a build of a project or code base.
190 %description -n clang-analyzer -l pl.UTF-8
191 Clang Static Analyzer składa się ze szkieletu do analizy kodu
192 źródłowego oraz samodzielnego narzędzia znajdującego błędy w
193 programach w C i C++. Narzędzie jest wywoływane z linii poleceń, z
194 myślą o uruchamianiu wraz z kompilacją projektu lub kodu.
196 %package -n clang-devel
197 Summary: Header files for Clang
198 Summary(pl.UTF-8): Pliki nagłówkowe Clanga
199 Group: Development/Languages
200 Requires: %{name}-devel = %{version}-%{release}
201 Requires: clang = %{version}-%{release}
203 %description -n clang-devel
204 This package contains header files for the Clang compiler.
206 %description -n clang-devel -l pl.UTF-8
207 Ten pakiet zawiera pliki nagłówkowe kompilatora Clang.
209 %package -n clang-doc
210 Summary: Documentation for Clang
211 Summary(pl.UTF-8): Dokumentacja do Clanga
213 Requires: %{name} = %{version}-%{release}
215 %description -n clang-doc
216 Documentation for the Clang compiler front-end.
218 %description -n clang-doc -l pl.UTF-8
219 Dokumentacja do frontendu kompilatora Clang.
221 %package -n clang-apidocs
222 Summary: API documentation for Clang
223 Summary(pl.UTF-8): Dokumentacja API Clanga
224 Group: Development/Languages
225 Requires: clang-doc = %{version}-%{release}
227 %description -n clang-apidocs
228 API documentation for the Clang compiler.
230 %description -n clang-apidocs -l pl.UTF-8
231 Dokumentacja API kompilatora Clang.
234 Summary: Next generation high-performance debugger
235 Summary(pl.UTF-8): Wydajny debugger nowej generacji
236 Group: Development/Debuggers
237 Requires: %{name} = %{version}-%{release}
240 LLDB is a next generation, high-performance debugger. It is built as a
241 set of reusable components which highly leverage existing libraries in
242 the larger LLVM Project, such as the Clang expression parser and LLVM
245 %description -n lldb -l pl.UTF-8
246 LLDB to wydajny debugger nowej generacji. Jest zbudowany w oparciu o
247 komponenty wielokrotnego użytku, wykorzystujące istniejące biblioteki
248 w projekcie LLVM, takie jak analizator wyrażeń kompilatora Clang oraz
251 %package -n lldb-devel
252 Summary: Header files for LLDB
253 Summary(pl.UTF-8): Pliki nagłówkowe LLDB
254 Group: Development/Libraries
255 Requires: %{name}-devel = %{version}-%{release}
256 Requires: clang-devel = %{version}-%{release}
257 Requires: lldb = %{version}-%{release}
259 %description -n lldb-devel
260 Header files for LLDB.
262 %description -n lldb-devel -l pl.UTF-8
263 Pliki nagłówkowe LLDB.
266 Summary: OCaml binding for LLVM
267 Summary(pl.UTF-8): Wiązanie OCamla do LLVM-a
269 Requires: %{name} = %{version}-%{release}
270 %requires_eq ocaml-runtime
273 OCaml binding for LLVM.
275 %description ocaml -l pl.UTF-8
276 Wiązanie OCamla do LLVM-a.
279 Summary: Development files for LLVM OCaml binding
280 Summary(pl.UTF-8): Pliki programistyczne wiązania OCamla do LLVM-a
281 Group: Development/Libraries
282 Requires: %{name}-devel = %{version}-%{release}
283 Requires: %{name}-ocaml = %{version}-%{release}
285 %description ocaml-devel
286 The llvm-ocaml-devel package contains libraries and signature files
287 for developing applications that use llvm-ocaml binding.
289 %description ocaml-devel -l pl.UTF-8
290 Ten pakiet zawiera biblioteki i pliki sygnatur do tworzenia aplikacji
291 wykorzystujących wiązanie llvm-ocaml.
294 Summary: Documentation for LLVM's OCaml binding
295 Summary(pl.UTF-8): Dokumentacja wiązania OCamla do LLVM-a
297 Requires: %{name}-ocaml = %{version}-%{release}
299 %description ocaml-doc
300 HTML documentation for LLVM's OCaml binding.
302 %description ocaml-doc -l pl.UTF-8
303 Dokumentacja HTML wiązania OCamla do LLVM-a.
306 %setup -q -n %{name}-%{version}.src -a1 -a2 -a3
307 mv cfe-%{version}.src tools/clang
308 %{?with_rt:mv compiler-rt-3.4 projects/compiler-rt}
309 %{?with_lldb:mv lldb-3.4 tools/lldb}
316 # configure does not properly specify libdir
317 %{__sed} -i 's|(PROJ_prefix)/lib|(PROJ_prefix)/%{_lib}|g' Makefile.config.in
319 %{__sed} -i 's|(PROJ_prefix)/lib/|(PROJ_prefix)/%{_lib}/|g' tools/clang/lib/Headers/Makefile
320 %{__sed} -i 's|"lib"|"%{_lib}"|' tools/clang/lib/Driver/Driver.cpp
322 grep -rl /usr/bin/env tools utils | xargs sed -i -e '1{
323 s,^#!.*bin/env python,#!%{__python},
324 s,^#!.*bin/env perl,#!%{__perl},
332 %{__autoconf} -o ../configure configure.ac
334 %{__autoheader} -I autoconf -I autoconf/m4 autoconf/configure.ac
336 # Disabling assertions now, rec. by pure and needed for OpenGTL
337 # TESTFIX no PIC on ix86: http://llvm.org/bugs/show_bug.cgi?id=3801
339 # bash specific 'test a < b'
342 --datadir=%{_datadir}/%{name}-%{version} \
343 --disable-assertions \
349 --enable-bindings=%{?with_ocaml:ocaml}%{!?with_ocaml:none} \
350 --enable-debug-runtime \
354 --enable-experimental-targets=R600 \
363 OPTIMIZE_OPTION="%{rpmcflags} %{rpmcppflags}"
366 %{__make} check 2>&1 | tee llvm-testlog.txt
367 %{__make} -C tools/clang test 2>&1 | tee clang-testlog.txt
373 %{__make} -C docs -f Makefile.sphinx man
377 rm -rf $RPM_BUILD_ROOT
378 %{__make} -C obj -j1 install \
379 PROJ_docsdir=/moredocs \
380 DESTDIR=$RPM_BUILD_ROOT
382 # Static analyzer not installed by default:
383 # http://clang-analyzer.llvm.org/installation#OtherPlatforms
384 install -d $RPM_BUILD_ROOT%{_libdir}/clang-analyzer
386 for f in scan-{build,view}; do
387 ln -s %{_libdir}/clang-analyzer/$f/$f $RPM_BUILD_ROOT%{_bindir}/$f
388 cp -pr tools/clang/tools/$f $RPM_BUILD_ROOT%{_libdir}/clang-analyzer
390 %{__mv} $RPM_BUILD_ROOT%{_libdir}/clang-analyzer/scan-build/scan-build.1 $RPM_BUILD_ROOT%{_mandir}/man1
391 %py_comp $RPM_BUILD_ROOT%{_libdir}/clang-analyzer/scan-view
392 %py_ocomp $RPM_BUILD_ROOT%{_libdir}/clang-analyzer/scan-view
393 %py_postclean %{_libdir}/clang-analyzer/scan-view
396 install -d $RPM_BUILD_ROOT%{_mandir}/man1
397 cp -p docs/_build/man/*.1 $RPM_BUILD_ROOT%{_mandir}/man1
398 # these tools are not installed
399 %{__rm} $RPM_BUILD_ROOT%{_mandir}/man1/{FileCheck,llvm-build}.1
402 # Move documentation back to build directory
404 mv $RPM_BUILD_ROOT/moredocs .
405 %{__rm} -v moredocs/*.tar.gz
406 %{__rm} -v moredocs/ocamldoc/html/*.tar.gz
408 # and separate the apidoc
410 rm -rf apidoc clang-apidoc
411 mv moredocs/html/doxygen apidoc
412 cp -a tools/clang/docs/doxygen/html clang-apidoc
415 # And prepare Clang documentation
417 install -d clang-docs
418 for f in LICENSE.TXT NOTES.txt README.txt; do
419 ln tools/clang/$f clang-docs
422 # Get rid of erroneously installed example files.
423 %{__rm} -v $RPM_BUILD_ROOT%{_libdir}/*LLVMHello.*
425 echo '.so llvm-ar.1' > $RPM_BUILD_ROOT%{_mandir}/man1/llvm-ranlib.1
426 # llvm-prof has been removed before LLVM 3.4
427 %{__rm} $RPM_BUILD_ROOT%{_mandir}/man1/llvm-prof.1
429 # remove documentation makefiles:
430 # they require the build directory to work
431 rm -rf moredocs/examples
432 cp -a examples moredocs/examples
433 find moredocs/examples -name Makefile | xargs -0r rm -f
436 rm -rf $RPM_BUILD_ROOT
438 %post libs -p /sbin/ldconfig
439 %postun libs -p /sbin/ldconfig
441 %post -n clang -p /sbin/ldconfig
442 %postun -n clang -p /sbin/ldconfig
444 %post -n lldb -p /sbin/ldconfig
445 %postun -n lldb -p /sbin/ldconfig
448 %defattr(644,root,root,755)
449 %doc CREDITS.TXT LICENSE.TXT README.txt %{?with_tests:llvm-testlog.txt}
450 %attr(755,root,root) %{_bindir}/bugpoint
451 %attr(755,root,root) %{_bindir}/llc
452 %attr(755,root,root) %{_bindir}/lli
453 %attr(755,root,root) %{_bindir}/lli-child-target
454 %attr(755,root,root) %{_bindir}/llvm-ar
455 %attr(755,root,root) %{_bindir}/llvm-as
456 %attr(755,root,root) %{_bindir}/llvm-bcanalyzer
457 %attr(755,root,root) %{_bindir}/llvm-cov
458 %attr(755,root,root) %{_bindir}/llvm-diff
459 %attr(755,root,root) %{_bindir}/llvm-dis
460 %attr(755,root,root) %{_bindir}/llvm-dwarfdump
461 %attr(755,root,root) %{_bindir}/llvm-extract
462 %attr(755,root,root) %{_bindir}/llvm-link
463 %attr(755,root,root) %{_bindir}/llvm-mc
464 %attr(755,root,root) %{_bindir}/llvm-mcmarkup
465 %attr(755,root,root) %{_bindir}/llvm-nm
466 %attr(755,root,root) %{_bindir}/llvm-objdump
467 %attr(755,root,root) %{_bindir}/llvm-ranlib
468 %attr(755,root,root) %{_bindir}/llvm-readobj
469 %attr(755,root,root) %{_bindir}/llvm-rtdyld
470 %attr(755,root,root) %{_bindir}/llvm-size
471 %attr(755,root,root) %{_bindir}/llvm-stress
472 %attr(755,root,root) %{_bindir}/llvm-symbolizer
473 %attr(755,root,root) %{_bindir}/llvm-tblgen
474 %attr(755,root,root) %{_bindir}/macho-dump
475 %attr(755,root,root) %{_bindir}/opt
476 %{_mandir}/man1/bugpoint.1*
477 %{_mandir}/man1/lit.1*
478 %{_mandir}/man1/llc.1*
479 %{_mandir}/man1/lli.1*
480 %{_mandir}/man1/llvm-ar.1*
481 %{_mandir}/man1/llvm-as.1*
482 %{_mandir}/man1/llvm-bcanalyzer.1*
483 %{_mandir}/man1/llvm-cov.1*
484 %{_mandir}/man1/llvm-diff.1*
485 %{_mandir}/man1/llvm-dis.1*
486 %{_mandir}/man1/llvm-extract.1*
487 %{_mandir}/man1/llvm-link.1*
488 %{_mandir}/man1/llvm-nm.1*
489 %{_mandir}/man1/llvm-ranlib.1*
490 %{_mandir}/man1/llvm-readobj.1*
491 %{_mandir}/man1/llvm-stress.1*
492 %{_mandir}/man1/llvm-symbolizer.1*
493 %{_mandir}/man1/opt.1*
494 %{_mandir}/man1/tblgen.1*
497 %defattr(644,root,root,755)
498 %attr(755,root,root) %{_libdir}/libLLVM-%{version}.so
499 %attr(755,root,root) %{_libdir}/libLLVM-3.4.so
502 %defattr(644,root,root,755)
503 %attr(755,root,root) %{_bindir}/llvm-config
504 %{_libdir}/libLLVM*.a
506 %attr(755,root,root) %{_libdir}/BugpointPasses.so
507 %attr(755,root,root) %{_libdir}/libLTO.so
511 %{_includedir}/llvm-c
512 %{_mandir}/man1/llvm-config.1*
515 %defattr(644,root,root,755)
516 %doc moredocs/examples moredocs/html
520 %defattr(644,root,root,755)
525 %defattr(644,root,root,755)
526 %doc clang-docs/{LICENSE.TXT,NOTES.txt,README.txt} %{?with_tests:clang-testlog.txt}
527 %attr(755,root,root) %{_bindir}/c-index-test
528 %attr(755,root,root) %{_bindir}/clang
529 %attr(755,root,root) %{_bindir}/clang++
530 %attr(755,root,root) %{_bindir}/clang-check
531 %attr(755,root,root) %{_bindir}/clang-format
532 %attr(755,root,root) %{_bindir}/clang-tblgen
533 %attr(755,root,root) %{_libdir}/libclang.so
534 %dir %{_libdir}/clang
535 %dir %{_libdir}/clang/%{version}
536 %{_libdir}/clang/%{version}/include
538 %{_libdir}/clang/%{version}/lib
540 %{_mandir}/man1/clang.1*
542 %files -n clang-analyzer
543 %defattr(644,root,root,755)
544 %attr(755,root,root) %{_bindir}/scan-build
545 %attr(755,root,root) %{_bindir}/scan-view
546 %{_mandir}/man1/scan-build.1*
547 %dir %{_libdir}/clang-analyzer
549 %dir %{_libdir}/clang-analyzer/scan-build
550 %{_libdir}/clang-analyzer/scan-build/*.css
551 %{_libdir}/clang-analyzer/scan-build/*.js
552 %attr(755,root,root) %{_libdir}/clang-analyzer/scan-build/scan-build
553 %attr(755,root,root) %{_libdir}/clang-analyzer/scan-build/*-analyzer
555 %dir %{_libdir}/clang-analyzer/scan-view
556 %attr(755,root,root) %{_libdir}/clang-analyzer/scan-view/scan-view
557 %{_libdir}/clang-analyzer/scan-view/Resources
558 %{_libdir}/clang-analyzer/scan-view/*.py[co]
560 %files -n clang-devel
561 %defattr(644,root,root,755)
562 %{_libdir}/libclang*.a
564 %{_includedir}/clang-c
567 %defattr(644,root,root,755)
568 %doc tools/clang/docs/*.{css,html,png,txt}
571 %files -n clang-apidocs
572 %defattr(644,root,root,755)
578 %defattr(644,root,root,755)
579 %attr(755,root,root) %{_bindir}/lldb
580 %attr(755,root,root) %{_bindir}/lldb-platform
581 %attr(755,root,root) %{_libdir}/liblldb.so
584 %defattr(644,root,root,755)
585 %{_libdir}/liblldb*.a
591 %defattr(644,root,root,755)
592 %{_libdir}/ocaml/META.llvm*
593 %attr(755,root,root) %{_libdir}/ocaml/dllllvm*.so
594 %{_libdir}/ocaml/llvm*.cma
595 %{_libdir}/ocaml/llvm*.cmi
598 %defattr(644,root,root,755)
599 %{_libdir}/libllvm*.a
600 %{_libdir}/ocaml/libLLVM*.a
601 %{_libdir}/ocaml/libllvm*.a
602 %{_libdir}/ocaml/llvm*.a
603 %{_libdir}/ocaml/llvm*.cmx*
604 %{_libdir}/ocaml/llvm*.mli
607 %defattr(644,root,root,755)
608 %doc moredocs/ocamldoc/html/*