3 %bcond_without ocaml # ocaml binding
4 %bcond_with apidocs # The doxygen docs are HUGE, so they are not built by default.
5 %bcond_with tests # run tests
7 %ifarch s390 s390x sparc64
8 # No ocaml on these arches
12 Summary: The Low Level Virtual Machine (An Optimizing Compiler Infrastructure)
13 Summary(pl.UTF-8): Niskopoziomowa maszyna wirtualna (infrastruktura kompilatora optymalizującego)
17 License: University of Illinois/NCSA Open Source License
18 Group: Development/Languages
19 Source0: http://llvm.org/releases/%{version}/%{name}-%{version}.tar.gz
20 # Source0-md5: a8e5f5f1c1adebae7b4a654c376a6005
21 Source1: http://llvm.org/releases/%{version}/clang-%{version}.tar.gz
22 # Source1-md5: 43350706ae6cf05d0068885792ea0591
23 # Data files should be installed with timestamps preserved
24 Patch3: %{name}-2.6-timestamp.patch
25 Patch4: %{name}-pld.patch
26 Patch5: %{name}-bug11177.patch
32 BuildRequires: doxygen
33 BuildRequires: graphviz
36 BuildRequires: dejagnu
38 BuildRequires: tcl-devel
41 BuildRequires: libltdl-devel
42 BuildRequires: libstdc++-devel >= 5:3.4
43 BuildRequires: ocaml-ocamldoc
44 BuildRequires: perl-base >= 1:5.6
45 BuildRequires: perl-tools-pod
46 BuildRequires: rpm-pythonprov
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
51 # LLVM is not supported on PPC64
52 # http://llvm.org/bugs/show_bug.cgi?id=3729
54 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
56 %define _sysconfdir /etc/%{name}
58 %define specflags_ppc -fno-var-tracking-assignments
60 # strip corrupts: $RPM_BUILD_ROOT/usr/lib64/llvm-gcc/bin/llvm-c++ ...
61 %define _noautostrip .*/\\(libmud.*\\.a\\|bin/llvm-.*\\|lib.*++\\.a\\)
64 LLVM is a compiler infrastructure designed for compile-time,
65 link-time, runtime, and idle-time optimization of programs from
66 arbitrary programming languages. LLVM is written in C++ and has been
67 developed since 2000 at the University of Illinois and Apple. It
68 currently supports compilation of C and C++ programs using clang
71 %description -l pl.UTF-8
72 LLVM to infrastruktura kompilatora zaprojektowana do optymalizacji
73 czasu kompilowania, linkowania, działania i bezczynności programów w
74 dowolnych językach programowania. Jest napisana w C++, rozwijana od
75 roku 2000 przez Uniwersytet w Illinois i Apple. Aktualnie obsługuje
76 kompilację programów w C i C++ przy użyciu frontendu clang.
79 Summary: Static libraries and header files for LLVM
80 Summary(pl.UTF-8): Biblioteki statyczne i pliki nagłówkowe dla LLVM-a
81 Group: Development/Languages
82 Requires: %{name} = %{version}-%{release}
83 Requires: libstdc++-devel >= 6:3.4
86 This package contains static libraries and header files needed to
87 develop new native programs that use the LLVM infrastructure.
89 %description devel -l pl.UTF-8
90 Ten pakiet zawiera biblioteki statyczne oraz pliki nagłówkowe
91 potrzebne do tworzenia nowych programów natywnych wykorzystujących
95 Summary: Documentation for LLVM
96 Summary(pl.UTF-8): Dokumentacja do LLVM-a
98 # does not require base
101 Documentation for the LLVM compiler infrastructure.
103 %description doc -l pl.UTF-8
104 Dokumentacja do infrastruktury kompilatorów LLVM.
107 Summary: API documentation for LLVM
108 Summary(pl.UTF-8): Dokumentacja API LLVM-a
109 Group: Development/Languages
110 Requires: %{name}-doc = %{version}-%{release}
113 API documentation for the LLVM compiler infrastructure.
115 %description apidocs -l pl.UTF-8
116 Dokumentacja API infrastruktury kompilatorów LLVM.
119 Summary: A C language family frontend for LLVM
120 Summary(pl.UTF-8): Frontend LLVM-a do języków z rodziny C
122 Group: Development/Languages
124 %description -n clang
125 clang: noun 1. A loud, resonant, metallic sound. 2. The strident call
126 of a crane or goose. 3. C-language family front-end toolkit.
128 The goal of the Clang project is to create a new C, C++, Objective C
129 and Objective C++ front-end for the LLVM compiler. Its tools are built
130 as libraries and designed to be loosely-coupled and extendable.
132 %description -n clang -l pl.UTF-8
133 clang (z angielskiego): 1. głośny, rezonujący, metaliczny dźwięk; 2.
134 piskliwy odgłos żurawia lub gęsi; 3. narzędzia frontendowe dla języków
137 Celem projektu Clang jest utworzenie nowego frontendu dla kompilatora
138 LLVM do języków C, C++, Objective C i Objective C++. Narzędzia są
139 budowane jako biblioteki i zaprojektowane z myślą o swobodnym łączeniu
142 %package -n clang-analyzer
143 Summary: A source code analysis framework
144 Summary(pl.UTF-8): Szkielet do analizy kodu źródłowego
146 Group: Development/Languages
147 Requires: clang = %{version}-%{release}
148 # not picked up automatically since files are currently not instaled
149 # in standard Python hierarchies yet
152 %description -n clang-analyzer
153 The Clang Static Analyzer consists of both a source code analysis
154 framework and a standalone tool that finds bugs in C and Objective-C
155 programs. The standalone tool is invoked from the command-line, and is
156 intended to run in tandem with a build of a project or code base.
158 %description -n clang-analyzer -l pl.UTF-8
159 Clang Static Analyzer składa się ze szkieletu do analizy kodu
160 źródłowego oraz samodzielnego narzędzia znajdującego błędy w
161 programach w C i C++. Narzędzie jest wywoływane z linii poleceń, z
162 myślą o uruchamianiu wraz z kompilacją projektu lub kodu.
164 %package -n clang-devel
165 Summary: Header files for Clang
166 Summary(pl.UTF-8): Pliki nagłówkowe Clanga
167 Group: Development/Languages
168 Requires: clang = %{version}-%{release}
170 %description -n clang-devel
171 This package contains header files for the Clang compiler.
173 %description -n clang-devel -l pl.UTF-8
174 Ten pakiet zawiera pliki nagłówkowe kompilatora Clang.
176 %package -n clang-doc
177 Summary: Documentation for Clang
178 Summary(pl.UTF-8): Dokumentacja do Clanga
180 Requires: %{name} = %{version}-%{release}
182 %description -n clang-doc
183 Documentation for the Clang compiler front-end.
185 %description -n clang-doc -l pl.UTF-8
186 Dokumentacja do frontendu kompilatora Clang.
188 %package -n clang-apidocs
189 Summary: API documentation for Clang
190 Summary(pl.UTF-8): Dokumentacja API Clanga
191 Group: Development/Languages
192 Requires: clang-doc = %{version}-%{release}
194 %description -n clang-apidocs
195 API documentation for the Clang compiler.
197 %description -n clang-apidocs -l pl.UTF-8
198 Dokumentacja API kompilatora Clang.
201 Summary: OCaml binding for LLVM
202 Summary(pl.UTF-8): Wiązanie OCamla do LLVM-a
204 Requires: %{name} = %{version}-%{release}
205 %requires_eq ocaml-runtime
208 OCaml binding for LLVM.
210 %description ocaml -l pl.UTF-8
211 Wiązanie OCamla do LLVM-a.
214 Summary: Development files for LLVM OCaml binding
215 Summary(pl.UTF-8): Pliki programistyczne wiązania OCamla do LLVM-a
216 Group: Development/Libraries
217 Requires: %{name}-devel = %{version}-%{release}
218 Requires: %{name}-ocaml = %{version}-%{release}
220 %description ocaml-devel
221 The llvm-ocaml-devel package contains libraries and signature files
222 for developing applications that use llvm-ocaml binding.
224 %description ocaml-devel -l pl.UTF-8
225 Ten pakiet zawiera biblioteki i pliki sygnatur do tworzenia aplikacji
226 wykorzystujących wiązanie llvm-ocaml.
230 Summary: Documentation for LLVM's OCaml binding
231 Summary(pl.UTF-8): Dokumentacja wiązania OCamla do LLVM-a
233 Requires: %{name}-ocaml = %{version}-%{release}
235 %description ocaml-doc
236 HTML documentation for LLVM's OCaml binding.
238 %description ocaml-doc -l pl.UTF-8
239 Dokumentacja HTML wiązania OCamla do LLVM-a.
242 %setup -q -a1 -n %{name}-%{version}.src
243 mv clang-*.* tools/clang
248 # configure does not properly specify libdir
249 sed -i 's|(PROJ_prefix)/lib|(PROJ_prefix)/%{_lib}|g' Makefile.config.in
251 grep -rl /usr/bin/env tools utils | xargs sed -i -e '1{
252 s,^#!.*bin/env python,#!%{__python},
253 s,^#!.*bin/env perl,#!%{__perl},
259 # Disabling assertions now, rec. by pure and needed for OpenGTL
260 # TESTFIX no PIC on ix86: http://llvm.org/bugs/show_bug.cgi?id=3801
262 # bash specific 'test a < b'
265 --libdir=%{_libdir}/%{name} \
266 --datadir=%{_datadir}/%{name}-%{version} \
267 --disable-assertions \
272 --enable-bindings=%{?with_ocaml:ocaml}%{!?with_ocaml:none} \
273 --enable-debug-runtime \
284 OPTIMIZE_OPTION="%{rpmcflags} %{rpmcppflags}"
287 %{__make} check 2>&1 | tee llvm-testlog.txt
288 %{__make} -C tools/clang test 2>&1 | tee clang-testlog.txt
292 rm -rf $RPM_BUILD_ROOT
293 %{__make} -C obj -j1 install \
294 PROJ_docsdir=/moredocs \
295 DESTDIR=$RPM_BUILD_ROOT
297 # Static analyzer not installed by default:
298 # http://clang-analyzer.llvm.org/installation#OtherPlatforms
299 install -d $RPM_BUILD_ROOT%{_libdir}/clang-analyzer
301 for f in scan-{build,view}; do
302 ln -s %{_libdir}/clang-analyzer/$f/$f $RPM_BUILD_ROOT%{_bindir}/$f
303 cp -pr tools/clang/tools/$f $RPM_BUILD_ROOT%{_libdir}/clang-analyzer
305 %py_comp $RPM_BUILD_ROOT%{_libdir}/clang-analyzer/scan-view
306 %py_ocomp $RPM_BUILD_ROOT%{_libdir}/clang-analyzer/scan-view
307 %py_postclean %{_libdir}/clang-analyzer/scan-view
309 # Move documentation back to build directory
311 mv $RPM_BUILD_ROOT/moredocs .
312 rm -fv moredocs/*.tar.gz
313 rm -fv moredocs/ocamldoc/html/*.tar.gz
315 # and separate the apidoc
317 rm -rf apidoc clang-apidoc
318 mv moredocs/html/doxygen apidoc
319 cp -a tools/clang/docs/doxygen/html clang-apidoc
322 # And prepare Clang documentation
324 install -d clang-docs
325 for f in LICENSE.TXT NOTES.txt README.txt; do
326 ln tools/clang/$f clang-docs
329 # Get rid of erroneously installed example files.
330 rm -v $RPM_BUILD_ROOT%{_libdir}/*LLVMHello.*
332 # FIXME file this bug
333 sed -i 's,ABS_RUN_DIR/lib",ABS_RUN_DIR/%{_lib}",' \
334 $RPM_BUILD_ROOT%{_bindir}/llvm-config
336 # remove documentation makefiles:
337 # they require the build directory to work
338 rm -rf moredocs/examples
339 cp -a examples moredocs/examples
340 find moredocs/examples -name Makefile | xargs -0r rm -f
343 rm -rf $RPM_BUILD_ROOT
345 %post -p /sbin/ldconfig
346 %postun -p /sbin/ldconfig
349 %defattr(644,root,root,755)
350 %doc CREDITS.TXT LICENSE.TXT README.txt %{?with_tests:llvm-testlog.txt}
351 %attr(755,root,root) %{_bindir}/bugpoint
352 %attr(755,root,root) %{_bindir}/llc
353 %attr(755,root,root) %{_bindir}/lli
354 %attr(755,root,root) %{_bindir}/llvm-ar
355 %attr(755,root,root) %{_bindir}/llvm-as
356 %attr(755,root,root) %{_bindir}/llvm-bcanalyzer
357 %attr(755,root,root) %{_bindir}/llvm-cov
358 %attr(755,root,root) %{_bindir}/llvm-diff
359 %attr(755,root,root) %{_bindir}/llvm-dis
360 %attr(755,root,root) %{_bindir}/llvm-dwarfdump
361 %attr(755,root,root) %{_bindir}/llvm-extract
362 %attr(755,root,root) %{_bindir}/llvm-ld
363 %attr(755,root,root) %{_bindir}/llvm-link
364 %attr(755,root,root) %{_bindir}/llvm-mc
365 %attr(755,root,root) %{_bindir}/llvm-nm
366 %attr(755,root,root) %{_bindir}/llvm-objdump
367 %attr(755,root,root) %{_bindir}/llvm-prof
368 %attr(755,root,root) %{_bindir}/llvm-ranlib
369 %attr(755,root,root) %{_bindir}/llvm-rtdyld
370 %attr(755,root,root) %{_bindir}/llvm-size
371 %attr(755,root,root) %{_bindir}/llvm-stub
372 %attr(755,root,root) %{_bindir}/llvm-tblgen
373 %attr(755,root,root) %{_bindir}/macho-dump
374 %attr(755,root,root) %{_bindir}/opt
375 %attr(755,root,root) %{_libdir}/libLLVM-%{version}.so
376 %{_mandir}/man1/bugpoint.1*
377 %{_mandir}/man1/lit.1*
378 %{_mandir}/man1/llc.1*
379 %{_mandir}/man1/lli.1*
380 %{_mandir}/man1/llvm-ar.1*
381 %{_mandir}/man1/llvm-as.1*
382 %{_mandir}/man1/llvm-bcanalyzer.1*
383 %{_mandir}/man1/llvm-diff.1*
384 %{_mandir}/man1/llvm-dis.1*
385 %{_mandir}/man1/llvm-extract.1*
386 %{_mandir}/man1/llvm-ld.1*
387 %{_mandir}/man1/llvm-link.1*
388 %{_mandir}/man1/llvm-nm.1*
389 %{_mandir}/man1/llvm-prof.1*
390 %{_mandir}/man1/llvm-ranlib.1*
391 %{_mandir}/man1/opt.1*
394 %defattr(644,root,root,755)
395 %attr(755,root,root) %{_bindir}/llvm-config
396 %attr(755,root,root) %{_libdir}/libprofile_rt.so
397 %{_libdir}/libLLVM*.a
398 %{_libdir}/libprofile_rt.a
400 %attr(755,root,root) %{_libdir}/BugpointPasses.so
401 %attr(755,root,root) %{_libdir}/libLTO.so
402 %{_libdir}/libEnhancedDisassembly.a
406 %{_includedir}/llvm-c
407 %{_mandir}/man1/llvm-config.1*
410 %defattr(644,root,root,755)
411 %doc moredocs/examples moredocs/html
415 %defattr(644,root,root,755)
420 %defattr(644,root,root,755)
421 %doc clang-docs/{LICENSE.TXT,NOTES.txt,README.txt} %{?with_tests:clang-testlog.txt}
422 %attr(755,root,root) %{_bindir}/clang
423 %attr(755,root,root) %{_bindir}/clang++
424 %attr(755,root,root) %{_bindir}/clang-tblgen
425 %attr(755,root,root) %{_libdir}/libclang.so
427 %{_mandir}/man1/clang.1*
428 %{_mandir}/man1/tblgen.1*
430 %files -n clang-analyzer
431 %defattr(644,root,root,755)
432 %attr(755,root,root) %{_bindir}/scan-build
433 %attr(755,root,root) %{_bindir}/scan-view
434 %dir %{_libdir}/clang-analyzer
436 %dir %{_libdir}/clang-analyzer/scan-build
437 %{_libdir}/clang-analyzer/scan-build/*.css
438 %{_libdir}/clang-analyzer/scan-build/*.js
439 %attr(755,root,root) %{_libdir}/clang-analyzer/scan-build/scan-build
440 %attr(755,root,root) %{_libdir}/clang-analyzer/scan-build/*-analyzer
442 %dir %{_libdir}/clang-analyzer/scan-view
443 %attr(755,root,root) %{_libdir}/clang-analyzer/scan-view/scan-view
444 %{_libdir}/clang-analyzer/scan-view/Resources
445 %{_libdir}/clang-analyzer/scan-view/*.py[co]
447 %files -n clang-devel
448 %defattr(644,root,root,755)
449 %{_libdir}/libclang*.a
451 %{_includedir}/clang-c
454 %defattr(644,root,root,755)
455 %doc tools/clang/docs/*.{css,html,png,txt}
458 %files -n clang-apidocs
459 %defattr(644,root,root,755)
465 %defattr(644,root,root,755)
466 %{_libdir}/ocaml/META.llvm
467 %{_libdir}/ocaml/llvm*.cma
468 %{_libdir}/ocaml/llvm*.cmi
471 %defattr(644,root,root,755)
472 %{_libdir}/libllvm*.a
473 %{_libdir}/ocaml/libLLVM*.a
474 %{_libdir}/ocaml/libllvm*.a
475 %{_libdir}/ocaml/llvm*.a
476 %{_libdir}/ocaml/llvm*.cmx*
477 %{_libdir}/ocaml/llvm*.mli
480 %defattr(644,root,root,755)
481 %doc moredocs/ocamldoc/html/*