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_with tests # run tests
11 %ifarch s390 s390x sparc64
12 # No ocaml on these arches
16 Summary: The Low Level Virtual Machine (An Optimizing Compiler Infrastructure)
17 Summary(pl.UTF-8): Niskopoziomowa maszyna wirtualna (infrastruktura kompilatora optymalizującego)
21 License: University of Illinois/NCSA Open Source License
22 Group: Development/Languages
23 Source0: http://llvm.org/releases/%{version}/%{name}-%{version}.src.tar.gz
24 # Source0-md5: 16eaa7679f84113f65b12760fdfe4ee1
25 Source1: http://llvm.org/releases/%{version}/clang-%{version}.src.tar.gz
26 # Source1-md5: 59bf2d3120a3805f27cafda3823caaf8
27 Patch0: %{name}-config.patch
28 # Data files should be installed with timestamps preserved
29 Patch1: %{name}-2.6-timestamp.patch
30 Patch2: %{name}-pld.patch
32 BuildRequires: autoconf >= 2.60
33 BuildRequires: automake >= 1:1.9.6
38 BuildRequires: doxygen
39 BuildRequires: graphviz
42 BuildRequires: dejagnu
44 BuildRequires: tcl-devel
47 BuildRequires: libltdl-devel
48 BuildRequires: libtool >= 2:1.5.22
49 BuildRequires: libstdc++-devel >= 5:3.4
50 BuildRequires: ocaml-ocamldoc
51 BuildRequires: perl-base >= 1:5.6
52 BuildRequires: perl-tools-pod
53 BuildRequires: rpm-pythonprov
54 # gcc4 might be installed, but not current __cc
55 %if "%(echo %{cc_version} | cut -d. -f1,2)" < "3.4"
56 BuildRequires: __cc >= 3.4
58 # LLVM is not supported on PPC64
59 # http://llvm.org/bugs/show_bug.cgi?id=3729
61 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
63 %define _sysconfdir /etc/%{name}
65 %define specflags_ppc -fno-var-tracking-assignments
67 # strip corrupts: $RPM_BUILD_ROOT/usr/lib64/llvm-gcc/bin/llvm-c++ ...
68 %define _noautostrip .*/\\(libmud.*\\.a\\|bin/llvm-.*\\|lib.*++\\.a\\)
71 LLVM is a compiler infrastructure designed for compile-time,
72 link-time, runtime, and idle-time optimization of programs from
73 arbitrary programming languages. LLVM is written in C++ and has been
74 developed since 2000 at the University of Illinois and Apple. It
75 currently supports compilation of C and C++ programs using clang
78 %description -l pl.UTF-8
79 LLVM to infrastruktura kompilatora zaprojektowana do optymalizacji
80 czasu kompilowania, linkowania, działania i bezczynności programów w
81 dowolnych językach programowania. Jest napisana w C++, rozwijana od
82 roku 2000 przez Uniwersytet w Illinois i Apple. Aktualnie obsługuje
83 kompilację programów w C i C++ przy użyciu frontendu clang.
86 Summary: Static libraries and header files for LLVM
87 Summary(pl.UTF-8): Biblioteki statyczne i pliki nagłówkowe dla LLVM-a
88 Group: Development/Languages
89 Requires: %{name} = %{version}-%{release}
90 Requires: libstdc++-devel >= 6:3.4
93 This package contains static libraries and header files needed to
94 develop new native programs that use the LLVM infrastructure.
96 %description devel -l pl.UTF-8
97 Ten pakiet zawiera biblioteki statyczne oraz pliki nagłówkowe
98 potrzebne do tworzenia nowych programów natywnych wykorzystujących
102 Summary: Documentation for LLVM
103 Summary(pl.UTF-8): Dokumentacja do LLVM-a
105 # does not require base
108 Documentation for the LLVM compiler infrastructure.
110 %description doc -l pl.UTF-8
111 Dokumentacja do infrastruktury kompilatorów LLVM.
114 Summary: API documentation for LLVM
115 Summary(pl.UTF-8): Dokumentacja API LLVM-a
116 Group: Development/Languages
117 Requires: %{name}-doc = %{version}-%{release}
120 API documentation for the LLVM compiler infrastructure.
122 %description apidocs -l pl.UTF-8
123 Dokumentacja API infrastruktury kompilatorów LLVM.
126 Summary: A C language family frontend for LLVM
127 Summary(pl.UTF-8): Frontend LLVM-a do języków z rodziny C
129 Group: Development/Languages
131 %description -n clang
132 clang: noun 1. A loud, resonant, metallic sound. 2. The strident call
133 of a crane or goose. 3. C-language family front-end toolkit.
135 The goal of the Clang project is to create a new C, C++, Objective C
136 and Objective C++ front-end for the LLVM compiler. Its tools are built
137 as libraries and designed to be loosely-coupled and extendable.
139 %description -n clang -l pl.UTF-8
140 clang (z angielskiego): 1. głośny, rezonujący, metaliczny dźwięk; 2.
141 piskliwy odgłos żurawia lub gęsi; 3. narzędzia frontendowe dla języków
144 Celem projektu Clang jest utworzenie nowego frontendu dla kompilatora
145 LLVM do języków C, C++, Objective C i Objective C++. Narzędzia są
146 budowane jako biblioteki i zaprojektowane z myślą o swobodnym łączeniu
149 %package -n clang-analyzer
150 Summary: A source code analysis framework
151 Summary(pl.UTF-8): Szkielet do analizy kodu źródłowego
153 Group: Development/Languages
154 Requires: clang = %{version}-%{release}
155 # not picked up automatically since files are currently not instaled
156 # in standard Python hierarchies yet
159 %description -n clang-analyzer
160 The Clang Static Analyzer consists of both a source code analysis
161 framework and a standalone tool that finds bugs in C and Objective-C
162 programs. The standalone tool is invoked from the command-line, and is
163 intended to run in tandem with a build of a project or code base.
165 %description -n clang-analyzer -l pl.UTF-8
166 Clang Static Analyzer składa się ze szkieletu do analizy kodu
167 źródłowego oraz samodzielnego narzędzia znajdującego błędy w
168 programach w C i C++. Narzędzie jest wywoływane z linii poleceń, z
169 myślą o uruchamianiu wraz z kompilacją projektu lub kodu.
171 %package -n clang-devel
172 Summary: Header files for Clang
173 Summary(pl.UTF-8): Pliki nagłówkowe Clanga
174 Group: Development/Languages
175 Requires: clang = %{version}-%{release}
177 %description -n clang-devel
178 This package contains header files for the Clang compiler.
180 %description -n clang-devel -l pl.UTF-8
181 Ten pakiet zawiera pliki nagłówkowe kompilatora Clang.
183 %package -n clang-doc
184 Summary: Documentation for Clang
185 Summary(pl.UTF-8): Dokumentacja do Clanga
187 Requires: %{name} = %{version}-%{release}
189 %description -n clang-doc
190 Documentation for the Clang compiler front-end.
192 %description -n clang-doc -l pl.UTF-8
193 Dokumentacja do frontendu kompilatora Clang.
195 %package -n clang-apidocs
196 Summary: API documentation for Clang
197 Summary(pl.UTF-8): Dokumentacja API Clanga
198 Group: Development/Languages
199 Requires: clang-doc = %{version}-%{release}
201 %description -n clang-apidocs
202 API documentation for the Clang compiler.
204 %description -n clang-apidocs -l pl.UTF-8
205 Dokumentacja API kompilatora Clang.
208 Summary: OCaml binding for LLVM
209 Summary(pl.UTF-8): Wiązanie OCamla do LLVM-a
211 Requires: %{name} = %{version}-%{release}
212 %requires_eq ocaml-runtime
215 OCaml binding for LLVM.
217 %description ocaml -l pl.UTF-8
218 Wiązanie OCamla do LLVM-a.
221 Summary: Development files for LLVM OCaml binding
222 Summary(pl.UTF-8): Pliki programistyczne wiązania OCamla do LLVM-a
223 Group: Development/Libraries
224 Requires: %{name}-devel = %{version}-%{release}
225 Requires: %{name}-ocaml = %{version}-%{release}
227 %description ocaml-devel
228 The llvm-ocaml-devel package contains libraries and signature files
229 for developing applications that use llvm-ocaml binding.
231 %description ocaml-devel -l pl.UTF-8
232 Ten pakiet zawiera biblioteki i pliki sygnatur do tworzenia aplikacji
233 wykorzystujących wiązanie llvm-ocaml.
237 Summary: Documentation for LLVM's OCaml binding
238 Summary(pl.UTF-8): Dokumentacja wiązania OCamla do LLVM-a
240 Requires: %{name}-ocaml = %{version}-%{release}
242 %description ocaml-doc
243 HTML documentation for LLVM's OCaml binding.
245 %description ocaml-doc -l pl.UTF-8
246 Dokumentacja HTML wiązania OCamla do LLVM-a.
249 %setup -q -a1 -n %{name}-%{version}.src
250 mv clang-*.* tools/clang
255 # configure does not properly specify libdir
256 sed -i 's|(PROJ_prefix)/lib|(PROJ_prefix)/%{_lib}|g' Makefile.config.in
257 sed -i 's|(PROJ_prefix)/lib/|(PROJ_prefix)/%{_lib}/|g' tools/clang/lib/Headers/Makefile
259 grep -rl /usr/bin/env tools utils | xargs sed -i -e '1{
260 s,^#!.*bin/env python,#!%{__python},
261 s,^#!.*bin/env perl,#!%{__perl},
269 %{__autoconf} -o ../configure configure.ac
271 %{__autoheader} -I autoconf -I autoconf/m4 autoconf/configure.ac
273 # Disabling assertions now, rec. by pure and needed for OpenGTL
274 # TESTFIX no PIC on ix86: http://llvm.org/bugs/show_bug.cgi?id=3801
276 # bash specific 'test a < b'
279 --datadir=%{_datadir}/%{name}-%{version} \
280 --disable-assertions \
285 --enable-bindings=%{?with_ocaml:ocaml}%{!?with_ocaml:none} \
286 --enable-debug-runtime \
297 OPTIMIZE_OPTION="%{rpmcflags} %{rpmcppflags}"
300 %{__make} check 2>&1 | tee llvm-testlog.txt
301 %{__make} -C tools/clang test 2>&1 | tee clang-testlog.txt
305 rm -rf $RPM_BUILD_ROOT
306 %{__make} -C obj -j1 install \
307 PROJ_docsdir=/moredocs \
308 DESTDIR=$RPM_BUILD_ROOT
310 # Static analyzer not installed by default:
311 # http://clang-analyzer.llvm.org/installation#OtherPlatforms
312 install -d $RPM_BUILD_ROOT%{_libdir}/clang-analyzer
314 for f in scan-{build,view}; do
315 ln -s %{_libdir}/clang-analyzer/$f/$f $RPM_BUILD_ROOT%{_bindir}/$f
316 cp -pr tools/clang/tools/$f $RPM_BUILD_ROOT%{_libdir}/clang-analyzer
318 %py_comp $RPM_BUILD_ROOT%{_libdir}/clang-analyzer/scan-view
319 %py_ocomp $RPM_BUILD_ROOT%{_libdir}/clang-analyzer/scan-view
320 %py_postclean %{_libdir}/clang-analyzer/scan-view
322 # Move documentation back to build directory
324 mv $RPM_BUILD_ROOT/moredocs .
325 %{__rm} -v moredocs/*.tar.gz
326 %{__rm} -v moredocs/ocamldoc/html/*.tar.gz
328 # and separate the apidoc
330 rm -rf apidoc clang-apidoc
331 mv moredocs/html/doxygen apidoc
332 cp -a tools/clang/docs/doxygen/html clang-apidoc
335 # And prepare Clang documentation
337 install -d clang-docs
338 for f in LICENSE.TXT NOTES.txt README.txt; do
339 ln tools/clang/$f clang-docs
342 # Get rid of erroneously installed example files.
343 %{__rm} -v $RPM_BUILD_ROOT%{_libdir}/*LLVMHello.*
345 # remove documentation makefiles:
346 # they require the build directory to work
347 rm -rf moredocs/examples
348 cp -a examples moredocs/examples
349 find moredocs/examples -name Makefile | xargs -0r rm -f
352 rm -rf $RPM_BUILD_ROOT
354 %post -p /sbin/ldconfig
355 %postun -p /sbin/ldconfig
358 %defattr(644,root,root,755)
359 %doc CREDITS.TXT LICENSE.TXT README.txt %{?with_tests:llvm-testlog.txt}
360 %attr(755,root,root) %{_bindir}/bugpoint
361 %attr(755,root,root) %{_bindir}/llc
362 %attr(755,root,root) %{_bindir}/lli
363 %attr(755,root,root) %{_bindir}/llvm-ar
364 %attr(755,root,root) %{_bindir}/llvm-as
365 %attr(755,root,root) %{_bindir}/llvm-bcanalyzer
366 %attr(755,root,root) %{_bindir}/llvm-cov
367 %attr(755,root,root) %{_bindir}/llvm-diff
368 %attr(755,root,root) %{_bindir}/llvm-dis
369 %attr(755,root,root) %{_bindir}/llvm-dwarfdump
370 %attr(755,root,root) %{_bindir}/llvm-extract
371 %attr(755,root,root) %{_bindir}/llvm-ld
372 %attr(755,root,root) %{_bindir}/llvm-link
373 %attr(755,root,root) %{_bindir}/llvm-mc
374 %attr(755,root,root) %{_bindir}/llvm-nm
375 %attr(755,root,root) %{_bindir}/llvm-objdump
376 %attr(755,root,root) %{_bindir}/llvm-prof
377 %attr(755,root,root) %{_bindir}/llvm-ranlib
378 %attr(755,root,root) %{_bindir}/llvm-readobj
379 %attr(755,root,root) %{_bindir}/llvm-rtdyld
380 %attr(755,root,root) %{_bindir}/llvm-size
381 %attr(755,root,root) %{_bindir}/llvm-stress
382 %attr(755,root,root) %{_bindir}/llvm-stub
383 %attr(755,root,root) %{_bindir}/llvm-tblgen
384 %attr(755,root,root) %{_bindir}/macho-dump
385 %attr(755,root,root) %{_bindir}/opt
386 %attr(755,root,root) %{_libdir}/libLLVM-%{version}.so
387 %{_mandir}/man1/bugpoint.1*
388 %{_mandir}/man1/lit.1*
389 %{_mandir}/man1/llc.1*
390 %{_mandir}/man1/lli.1*
391 %{_mandir}/man1/llvm-ar.1*
392 %{_mandir}/man1/llvm-as.1*
393 %{_mandir}/man1/llvm-bcanalyzer.1*
394 %{_mandir}/man1/llvm-cov.1*
395 %{_mandir}/man1/llvm-diff.1*
396 %{_mandir}/man1/llvm-dis.1*
397 %{_mandir}/man1/llvm-extract.1*
398 %{_mandir}/man1/llvm-ld.1*
399 %{_mandir}/man1/llvm-link.1*
400 %{_mandir}/man1/llvm-nm.1*
401 %{_mandir}/man1/llvm-prof.1*
402 %{_mandir}/man1/llvm-ranlib.1*
403 %{_mandir}/man1/llvm-stress.1*
404 %{_mandir}/man1/opt.1*
407 %defattr(644,root,root,755)
408 %attr(755,root,root) %{_bindir}/llvm-config
409 %attr(755,root,root) %{_libdir}/libprofile_rt.so
410 %{_libdir}/libLLVM*.a
411 %{_libdir}/libprofile_rt.a
413 %attr(755,root,root) %{_libdir}/BugpointPasses.so
414 %attr(755,root,root) %{_libdir}/libLTO.so
418 %{_includedir}/llvm-c
419 %{_mandir}/man1/llvm-config.1*
422 %defattr(644,root,root,755)
423 %doc moredocs/examples moredocs/html
427 %defattr(644,root,root,755)
432 %defattr(644,root,root,755)
433 %doc clang-docs/{LICENSE.TXT,NOTES.txt,README.txt} %{?with_tests:clang-testlog.txt}
434 %attr(755,root,root) %{_bindir}/clang
435 %attr(755,root,root) %{_bindir}/clang++
436 %attr(755,root,root) %{_bindir}/clang-tblgen
437 %attr(755,root,root) %{_libdir}/libclang.so
439 %{_mandir}/man1/clang.1*
440 %{_mandir}/man1/tblgen.1*
442 %files -n clang-analyzer
443 %defattr(644,root,root,755)
444 %attr(755,root,root) %{_bindir}/scan-build
445 %attr(755,root,root) %{_bindir}/scan-view
446 %dir %{_libdir}/clang-analyzer
448 %dir %{_libdir}/clang-analyzer/scan-build
449 %{_libdir}/clang-analyzer/scan-build/*.css
450 %{_libdir}/clang-analyzer/scan-build/*.js
451 %attr(755,root,root) %{_libdir}/clang-analyzer/scan-build/scan-build
452 %attr(755,root,root) %{_libdir}/clang-analyzer/scan-build/*-analyzer
454 %dir %{_libdir}/clang-analyzer/scan-view
455 %attr(755,root,root) %{_libdir}/clang-analyzer/scan-view/scan-view
456 %{_libdir}/clang-analyzer/scan-view/Resources
457 %{_libdir}/clang-analyzer/scan-view/*.py[co]
459 %files -n clang-devel
460 %defattr(644,root,root,755)
461 %{_libdir}/libclang*.a
463 %{_includedir}/clang-c
466 %defattr(644,root,root,755)
467 %doc tools/clang/docs/*.{css,html,png,txt}
470 %files -n clang-apidocs
471 %defattr(644,root,root,755)
477 %defattr(644,root,root,755)
478 %{_libdir}/ocaml/META.llvm
479 %{_libdir}/ocaml/llvm*.cma
480 %{_libdir}/ocaml/llvm*.cmi
483 %defattr(644,root,root,755)
484 %{_libdir}/libllvm*.a
485 %{_libdir}/ocaml/libLLVM*.a
486 %{_libdir}/ocaml/libllvm*.a
487 %{_libdir}/ocaml/llvm*.a
488 %{_libdir}/ocaml/llvm*.cmx*
489 %{_libdir}/ocaml/llvm*.mli
492 %defattr(644,root,root,755)
493 %doc moredocs/ocamldoc/html/*