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 ocaml # ocaml binding
8 %bcond_with apidocs # The doxygen docs are HUGE, so they are not built by default.
9 %bcond_without man # man pages
10 %bcond_with tests # run tests
12 %ifarch s390 s390x sparc64
13 # No ocaml on these arches
17 Summary: The Low Level Virtual Machine (An Optimizing Compiler Infrastructure)
18 Summary(pl.UTF-8): Niskopoziomowa maszyna wirtualna (infrastruktura kompilatora optymalizującego)
22 License: University of Illinois/NCSA Open Source License
23 Group: Development/Languages
24 #Source0Download: http://llvm.org/releases/download.html
25 Source0: http://llvm.org/releases/%{version}/%{name}-%{version}.src.tar.gz
26 # Source0-md5: 40564e1dc390f9844f1711c08b08e391
27 Source1: http://llvm.org/releases/%{version}/cfe-%{version}.src.tar.gz
28 # Source1-md5: 8284891e3e311829b8e44ac813d0c9ef
29 Patch0: %{name}-config.patch
30 # Data files should be installed with timestamps preserved
31 Patch1: %{name}-2.6-timestamp.patch
32 Patch2: %{name}-tld.patch
34 BuildRequires: autoconf >= 2.60
35 BuildRequires: automake >= 1:1.9.6
39 BuildRequires: gcc >= 5:3.4
40 # gcc4 might be installed, but not current __cc
41 %if "%(echo %{cc_version} | cut -d. -f1,2)" < "3.4"
42 BuildRequires: __cc >= 3.4
45 BuildRequires: libltdl-devel
46 BuildRequires: libtool >= 2:1.5.22
47 BuildRequires: libstdc++-devel >= 5:3.4
48 BuildRequires: ocaml-ocamldoc
49 BuildRequires: perl-base >= 1:5.6
50 BuildRequires: perl-tools-pod
51 BuildRequires: rpm-pythonprov
52 %{?with_man:BuildRequires: sphinx-pdg}
54 BuildRequires: doxygen
55 BuildRequires: graphviz
58 BuildRequires: dejagnu
60 BuildRequires: tcl-devel
62 Requires: %{name}-libs = %{version}-%{release}
63 # LLVM is not supported on PPC64
64 # http://llvm.org/bugs/show_bug.cgi?id=3729
66 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
68 %define _sysconfdir /etc/%{name}
70 %define specflags_ppc -fno-var-tracking-assignments
72 # strip corrupts: $RPM_BUILD_ROOT/usr/lib64/llvm-gcc/bin/llvm-c++ ...
73 %define _noautostrip .*/\\(libmud.*\\.a\\|bin/llvm-.*\\|lib.*++\\.a\\)
76 LLVM is a compiler infrastructure designed for compile-time,
77 link-time, runtime, and idle-time optimization of programs from
78 arbitrary programming languages. LLVM is written in C++ and has been
79 developed since 2000 at the University of Illinois and Apple. It
80 currently supports compilation of C and C++ programs using clang
83 %description -l pl.UTF-8
84 LLVM to infrastruktura kompilatora zaprojektowana do optymalizacji
85 czasu kompilowania, linkowania, działania i bezczynności programów w
86 dowolnych językach programowania. Jest napisana w C++, rozwijana od
87 roku 2000 przez Uniwersytet w Illinois i Apple. Aktualnie obsługuje
88 kompilację programów w C i C++ przy użyciu frontendu clang.
91 Summary: LLVM shared library
92 Summary(pl.UTF-8): Biblioteka współdzielona LLVM-a
99 %description libs -l pl.UTF-8
100 Biblioteka współdzielona LLVM-a.
103 Summary: Static libraries and header files for LLVM
104 Summary(pl.UTF-8): Biblioteki statyczne i pliki nagłówkowe dla LLVM-a
105 Group: Development/Languages
106 Requires: %{name}-libs = %{version}-%{release}
107 Requires: libstdc++-devel >= 6:3.4
110 This package contains static libraries and header files needed to
111 develop new native programs that use the LLVM infrastructure.
113 %description devel -l pl.UTF-8
114 Ten pakiet zawiera biblioteki statyczne oraz pliki nagłówkowe
115 potrzebne do tworzenia nowych programów natywnych wykorzystujących
119 Summary: Documentation for LLVM
120 Summary(pl.UTF-8): Dokumentacja do LLVM-a
122 # does not require base
125 Documentation for the LLVM compiler infrastructure.
127 %description doc -l pl.UTF-8
128 Dokumentacja do infrastruktury kompilatorów LLVM.
131 Summary: API documentation for LLVM
132 Summary(pl.UTF-8): Dokumentacja API LLVM-a
133 Group: Development/Languages
134 Requires: %{name}-doc = %{version}-%{release}
137 API documentation for the LLVM compiler infrastructure.
139 %description apidocs -l pl.UTF-8
140 Dokumentacja API infrastruktury kompilatorów LLVM.
143 Summary: A C language family frontend for LLVM
144 Summary(pl.UTF-8): Frontend LLVM-a do języków z rodziny C
146 Group: Development/Languages
147 Requires: %{name} = %{version}-%{release}
149 %description -n clang
150 clang: noun 1. A loud, resonant, metallic sound. 2. The strident call
151 of a crane or goose. 3. C-language family front-end toolkit.
153 The goal of the Clang project is to create a new C, C++, Objective C
154 and Objective C++ front-end for the LLVM compiler. Its tools are built
155 as libraries and designed to be loosely-coupled and extendable.
157 %description -n clang -l pl.UTF-8
158 clang (z angielskiego): 1. głośny, rezonujący, metaliczny dźwięk; 2.
159 piskliwy odgłos żurawia lub gęsi; 3. narzędzia frontendowe dla języków
162 Celem projektu Clang jest utworzenie nowego frontendu dla kompilatora
163 LLVM do języków C, C++, Objective C i Objective C++. Narzędzia są
164 budowane jako biblioteki i zaprojektowane z myślą o swobodnym łączeniu
167 %package -n clang-analyzer
168 Summary: A source code analysis framework
169 Summary(pl.UTF-8): Szkielet do analizy kodu źródłowego
171 Group: Development/Languages
172 Requires: clang = %{version}-%{release}
173 # not picked up automatically since files are currently not instaled
174 # in standard Python hierarchies yet
177 %description -n clang-analyzer
178 The Clang Static Analyzer consists of both a source code analysis
179 framework and a standalone tool that finds bugs in C and Objective-C
180 programs. The standalone tool is invoked from the command-line, and is
181 intended to run in tandem with a build of a project or code base.
183 %description -n clang-analyzer -l pl.UTF-8
184 Clang Static Analyzer składa się ze szkieletu do analizy kodu
185 źródłowego oraz samodzielnego narzędzia znajdującego błędy w
186 programach w C i C++. Narzędzie jest wywoływane z linii poleceń, z
187 myślą o uruchamianiu wraz z kompilacją projektu lub kodu.
189 %package -n clang-devel
190 Summary: Header files for Clang
191 Summary(pl.UTF-8): Pliki nagłówkowe Clanga
192 Group: Development/Languages
193 Requires: %{name}-devel = %{version}-%{release}
194 Requires: clang = %{version}-%{release}
196 %description -n clang-devel
197 This package contains header files for the Clang compiler.
199 %description -n clang-devel -l pl.UTF-8
200 Ten pakiet zawiera pliki nagłówkowe kompilatora Clang.
202 %package -n clang-doc
203 Summary: Documentation for Clang
204 Summary(pl.UTF-8): Dokumentacja do Clanga
206 Requires: %{name} = %{version}-%{release}
208 %description -n clang-doc
209 Documentation for the Clang compiler front-end.
211 %description -n clang-doc -l pl.UTF-8
212 Dokumentacja do frontendu kompilatora Clang.
214 %package -n clang-apidocs
215 Summary: API documentation for Clang
216 Summary(pl.UTF-8): Dokumentacja API Clanga
217 Group: Development/Languages
218 Requires: clang-doc = %{version}-%{release}
220 %description -n clang-apidocs
221 API documentation for the Clang compiler.
223 %description -n clang-apidocs -l pl.UTF-8
224 Dokumentacja API kompilatora Clang.
227 Summary: OCaml binding for LLVM
228 Summary(pl.UTF-8): Wiązanie OCamla do LLVM-a
230 Requires: %{name} = %{version}-%{release}
231 %requires_eq ocaml-runtime
234 OCaml binding for LLVM.
236 %description ocaml -l pl.UTF-8
237 Wiązanie OCamla do LLVM-a.
240 Summary: Development files for LLVM OCaml binding
241 Summary(pl.UTF-8): Pliki programistyczne wiązania OCamla do LLVM-a
242 Group: Development/Libraries
243 Requires: %{name}-devel = %{version}-%{release}
244 Requires: %{name}-ocaml = %{version}-%{release}
246 %description ocaml-devel
247 The llvm-ocaml-devel package contains libraries and signature files
248 for developing applications that use llvm-ocaml binding.
250 %description ocaml-devel -l pl.UTF-8
251 Ten pakiet zawiera biblioteki i pliki sygnatur do tworzenia aplikacji
252 wykorzystujących wiązanie llvm-ocaml.
255 Summary: Documentation for LLVM's OCaml binding
256 Summary(pl.UTF-8): Dokumentacja wiązania OCamla do LLVM-a
258 Requires: %{name}-ocaml = %{version}-%{release}
260 %description ocaml-doc
261 HTML documentation for LLVM's OCaml binding.
263 %description ocaml-doc -l pl.UTF-8
264 Dokumentacja HTML wiązania OCamla do LLVM-a.
267 %setup -q -a1 -n %{name}-%{version}.src
268 mv cfe-%{version}.src tools/clang
273 # configure does not properly specify libdir
274 %{__sed} -i 's|(PROJ_prefix)/lib|(PROJ_prefix)/%{_lib}|g' Makefile.config.in
275 %{__sed} -i 's|/lib/|/%{_lib}/|' lib/Support/Unix/Path.inc
277 %{__sed} -i 's|(PROJ_prefix)/lib/|(PROJ_prefix)/%{_lib}/|g' tools/clang/lib/Headers/Makefile
278 %{__sed} -i 's|"lib"|"%{_lib}"|' tools/clang/lib/Driver/Driver.cpp
280 grep -rl /usr/bin/env tools utils | xargs sed -i -e '1{
281 s,^#!.*bin/env python,#!%{__python},
282 s,^#!.*bin/env perl,#!%{__perl},
290 %{__autoconf} -o ../configure configure.ac
292 %{__autoheader} -I autoconf -I autoconf/m4 autoconf/configure.ac
294 # Disabling assertions now, rec. by pure and needed for OpenGTL
295 # TESTFIX no PIC on ix86: http://llvm.org/bugs/show_bug.cgi?id=3801
297 # bash specific 'test a < b'
300 --datadir=%{_datadir}/%{name}-%{version} \
301 --disable-assertions \
306 --enable-bindings=%{?with_ocaml:ocaml}%{!?with_ocaml:none} \
307 --enable-debug-runtime \
311 --enable-experimental-targets=R600 \
320 OPTIMIZE_OPTION="%{rpmcflags} %{rpmcppflags}"
323 %{__make} check 2>&1 | tee llvm-testlog.txt
324 %{__make} -C tools/clang test 2>&1 | tee clang-testlog.txt
330 %{__make} -C docs -f Makefile.sphinx man
334 rm -rf $RPM_BUILD_ROOT
335 %{__make} -C obj -j1 install \
336 PROJ_docsdir=/moredocs \
337 DESTDIR=$RPM_BUILD_ROOT
339 # Static analyzer not installed by default:
340 # http://clang-analyzer.llvm.org/installation#OtherPlatforms
341 install -d $RPM_BUILD_ROOT%{_libdir}/clang-analyzer
343 for f in scan-{build,view}; do
344 ln -s %{_libdir}/clang-analyzer/$f/$f $RPM_BUILD_ROOT%{_bindir}/$f
345 cp -pr tools/clang/tools/$f $RPM_BUILD_ROOT%{_libdir}/clang-analyzer
347 %{__mv} $RPM_BUILD_ROOT%{_libdir}/clang-analyzer/scan-build/scan-build.1 $RPM_BUILD_ROOT%{_mandir}/man1
348 %py_comp $RPM_BUILD_ROOT%{_libdir}/clang-analyzer/scan-view
349 %py_ocomp $RPM_BUILD_ROOT%{_libdir}/clang-analyzer/scan-view
350 %py_postclean %{_libdir}/clang-analyzer/scan-view
353 install -d $RPM_BUILD_ROOT%{_mandir}/man1
354 cp -p docs/_build/man/*.1 $RPM_BUILD_ROOT%{_mandir}/man1
355 # these tools are not installed
356 %{__rm} $RPM_BUILD_ROOT%{_mandir}/man1/{FileCheck,llvm-build}.1
359 # Move documentation back to build directory
361 mv $RPM_BUILD_ROOT/moredocs .
362 %{__rm} -v moredocs/*.tar.gz
363 %{__rm} -v moredocs/ocamldoc/html/*.tar.gz
365 # and separate the apidoc
367 rm -rf apidoc clang-apidoc
368 mv moredocs/html/doxygen apidoc
369 cp -a tools/clang/docs/doxygen/html clang-apidoc
372 # And prepare Clang documentation
374 install -d clang-docs
375 for f in LICENSE.TXT NOTES.txt README.txt; do
376 ln tools/clang/$f clang-docs
379 # Get rid of erroneously installed example files.
380 %{__rm} -v $RPM_BUILD_ROOT%{_libdir}/*LLVMHello.*
382 # remove documentation makefiles:
383 # they require the build directory to work
384 rm -rf moredocs/examples
385 cp -a examples moredocs/examples
386 find moredocs/examples -name Makefile | xargs -0r rm -f
389 rm -rf $RPM_BUILD_ROOT
391 %post libs -p /sbin/ldconfig
392 %postun libs -p /sbin/ldconfig
395 %defattr(644,root,root,755)
396 %doc CREDITS.TXT LICENSE.TXT README.txt %{?with_tests:llvm-testlog.txt}
397 %attr(755,root,root) %{_bindir}/bugpoint
398 %attr(755,root,root) %{_bindir}/llc
399 %attr(755,root,root) %{_bindir}/lli
400 %attr(755,root,root) %{_bindir}/llvm-ar
401 %attr(755,root,root) %{_bindir}/llvm-as
402 %attr(755,root,root) %{_bindir}/llvm-bcanalyzer
403 %attr(755,root,root) %{_bindir}/llvm-cov
404 %attr(755,root,root) %{_bindir}/llvm-diff
405 %attr(755,root,root) %{_bindir}/llvm-dis
406 %attr(755,root,root) %{_bindir}/llvm-dwarfdump
407 %attr(755,root,root) %{_bindir}/llvm-extract
408 %attr(755,root,root) %{_bindir}/llvm-link
409 %attr(755,root,root) %{_bindir}/llvm-mc
410 %attr(755,root,root) %{_bindir}/llvm-mcmarkup
411 %attr(755,root,root) %{_bindir}/llvm-nm
412 %attr(755,root,root) %{_bindir}/llvm-objdump
413 %attr(755,root,root) %{_bindir}/llvm-prof
414 %attr(755,root,root) %{_bindir}/llvm-ranlib
415 %attr(755,root,root) %{_bindir}/llvm-readobj
416 %attr(755,root,root) %{_bindir}/llvm-rtdyld
417 %attr(755,root,root) %{_bindir}/llvm-size
418 %attr(755,root,root) %{_bindir}/llvm-stress
419 %attr(755,root,root) %{_bindir}/llvm-symbolizer
420 %attr(755,root,root) %{_bindir}/llvm-tblgen
421 %attr(755,root,root) %{_bindir}/macho-dump
422 %attr(755,root,root) %{_bindir}/opt
423 %{_mandir}/man1/bugpoint.1*
424 %{_mandir}/man1/lit.1*
425 %{_mandir}/man1/llc.1*
426 %{_mandir}/man1/lli.1*
427 %{_mandir}/man1/llvm-ar.1*
428 %{_mandir}/man1/llvm-as.1*
429 %{_mandir}/man1/llvm-bcanalyzer.1*
430 %{_mandir}/man1/llvm-cov.1*
431 %{_mandir}/man1/llvm-diff.1*
432 %{_mandir}/man1/llvm-dis.1*
433 %{_mandir}/man1/llvm-extract.1*
434 %{_mandir}/man1/llvm-link.1*
435 %{_mandir}/man1/llvm-nm.1*
436 %{_mandir}/man1/llvm-prof.1*
437 %{_mandir}/man1/llvm-ranlib.1*
438 %{_mandir}/man1/llvm-readobj.1*
439 %{_mandir}/man1/llvm-stress.1*
440 %{_mandir}/man1/llvm-symbolizer.1*
441 %{_mandir}/man1/opt.1*
442 %{_mandir}/man1/tblgen.1*
445 %defattr(644,root,root,755)
446 %attr(755,root,root) %{_libdir}/libLLVM-%{version}.so
449 %defattr(644,root,root,755)
450 %attr(755,root,root) %{_bindir}/llvm-config
451 %attr(755,root,root) %{_libdir}/libprofile_rt.so
452 %{_libdir}/libLLVM*.a
453 %{_libdir}/libprofile_rt.a
455 %attr(755,root,root) %{_libdir}/BugpointPasses.so
456 %attr(755,root,root) %{_libdir}/libLTO.so
460 %{_includedir}/llvm-c
461 %{_mandir}/man1/llvm-config.1*
464 %defattr(644,root,root,755)
465 %doc moredocs/examples moredocs/html
469 %defattr(644,root,root,755)
474 %defattr(644,root,root,755)
475 %doc clang-docs/{LICENSE.TXT,NOTES.txt,README.txt} %{?with_tests:clang-testlog.txt}
476 %attr(755,root,root) %{_bindir}/c-index-test
477 %attr(755,root,root) %{_bindir}/clang
478 %attr(755,root,root) %{_bindir}/clang++
479 %attr(755,root,root) %{_bindir}/clang-check
480 %attr(755,root,root) %{_bindir}/clang-format
481 %attr(755,root,root) %{_bindir}/clang-tblgen
482 %attr(755,root,root) %{_libdir}/libclang.so
484 %{_mandir}/man1/clang.1*
486 %files -n clang-analyzer
487 %defattr(644,root,root,755)
488 %attr(755,root,root) %{_bindir}/scan-build
489 %attr(755,root,root) %{_bindir}/scan-view
490 %{_mandir}/man1/scan-build.1*
491 %dir %{_libdir}/clang-analyzer
493 %dir %{_libdir}/clang-analyzer/scan-build
494 %{_libdir}/clang-analyzer/scan-build/*.css
495 %{_libdir}/clang-analyzer/scan-build/*.js
496 %attr(755,root,root) %{_libdir}/clang-analyzer/scan-build/scan-build
497 %attr(755,root,root) %{_libdir}/clang-analyzer/scan-build/*-analyzer
499 %dir %{_libdir}/clang-analyzer/scan-view
500 %attr(755,root,root) %{_libdir}/clang-analyzer/scan-view/scan-view
501 %{_libdir}/clang-analyzer/scan-view/Resources
502 %{_libdir}/clang-analyzer/scan-view/*.py[co]
504 %files -n clang-devel
505 %defattr(644,root,root,755)
506 %{_libdir}/libclang*.a
508 %{_includedir}/clang-c
511 %defattr(644,root,root,755)
512 %doc tools/clang/docs/*.{css,html,png,txt}
515 %files -n clang-apidocs
516 %defattr(644,root,root,755)
522 %defattr(644,root,root,755)
523 %{_libdir}/ocaml/META.llvm
524 %{_libdir}/ocaml/llvm*.cma
525 %{_libdir}/ocaml/llvm*.cmi
528 %defattr(644,root,root,755)
529 %{_libdir}/libllvm*.a
530 %{_libdir}/ocaml/libLLVM*.a
531 %{_libdir}/ocaml/libllvm*.a
532 %{_libdir}/ocaml/llvm*.a
533 %{_libdir}/ocaml/llvm*.cmx*
534 %{_libdir}/ocaml/llvm*.mli
537 %defattr(644,root,root,755)
538 %doc moredocs/ocamldoc/html/*