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}.tgz
20 # Source0-md5: 793138412d2af2c7c7f54615f8943771
21 Source1: http://llvm.org/releases/%{version}/clang-%{version}.tgz
22 # Source1-md5: 634de18d04b7a4ded19ec4c17d23cfca
23 # Data files should be installed with timestamps preserved
24 Patch3: %{name}-2.6-timestamp.patch
25 Patch4: %{name}-pld.patch
31 BuildRequires: doxygen
32 BuildRequires: graphviz
35 BuildRequires: dejagnu
37 BuildRequires: tcl-devel
40 BuildRequires: libltdl-devel
41 BuildRequires: libstdc++-devel >= 5:3.4
42 BuildRequires: ocaml-ocamldoc
43 BuildRequires: perl-base >= 1:5.6
44 BuildRequires: perl-tools-pod
45 BuildRequires: rpm-pythonprov
46 # gcc4 might be installed, but not current __cc
47 %if "%(echo %{cc_version} | cut -d. -f1,2)" < "3.4"
48 BuildRequires: __cc >= 3.4
50 # LLVM is not supported on PPC64
51 # http://llvm.org/bugs/show_bug.cgi?id=3729
53 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
55 %define _sysconfdir /etc/%{name}
57 %define specflags_ppc -fno-var-tracking-assignments
59 # strip corrupts: $RPM_BUILD_ROOT/usr/lib64/llvm-gcc/bin/llvm-c++ ...
60 %define _noautostrip .*/\\(libmud.*\\.a\\|bin/llvm-.*\\|lib.*++\\.a\\)
63 LLVM is a compiler infrastructure designed for compile-time,
64 link-time, runtime, and idle-time optimization of programs from
65 arbitrary programming languages. LLVM is written in C++ and has been
66 developed since 2000 at the University of Illinois and Apple. It
67 currently supports compilation of C and C++ programs using clang
70 %description -l pl.UTF-8
71 LLVM to infrastruktura kompilatora zaprojektowana do optymalizacji
72 czasu kompilowania, linkowania, działania i bezczynności programów w
73 dowolnych językach programowania. Jest napisana w C++, rozwijana od
74 roku 2000 przez Uniwersytet w Illinois i Apple. Aktualnie obsługuje
75 kompilację programów w C i C++ przy użyciu frontendu clang.
78 Summary: Static libraries and header files for LLVM
79 Summary(pl.UTF-8): Biblioteki statyczne i pliki nagłówkowe dla LLVM-a
80 Group: Development/Languages
81 Requires: %{name} = %{version}-%{release}
82 Requires: libstdc++-devel >= 6:3.4
85 This package contains static libraries and header files needed to
86 develop new native programs that use the LLVM infrastructure.
88 %description devel -l pl.UTF-8
89 Ten pakiet zawiera biblioteki statyczne oraz pliki nagłówkowe
90 potrzebne do tworzenia nowych programów natywnych wykorzystujących
94 Summary: Documentation for LLVM
95 Summary(pl.UTF-8): Dokumentacja do LLVM-a
97 # does not require base
100 Documentation for the LLVM compiler infrastructure.
102 %description doc -l pl.UTF-8
103 Dokumentacja do infrastruktury kompilatorów LLVM.
106 Summary: API documentation for LLVM
107 Summary(pl.UTF-8): Dokumentacja API LLVM-a
108 Group: Development/Languages
109 Requires: %{name}-doc = %{version}-%{release}
112 API documentation for the LLVM compiler infrastructure.
114 %description apidocs -l pl.UTF-8
115 Dokumentacja API infrastruktury kompilatorów LLVM.
118 Summary: A C language family frontend for LLVM
119 Summary(pl.UTF-8): Frontend LLVM-a do języków z rodziny C
121 Group: Development/Languages
123 %description -n clang
124 clang: noun 1. A loud, resonant, metallic sound. 2. The strident call
125 of a crane or goose. 3. C-language family front-end toolkit.
127 The goal of the Clang project is to create a new C, C++, Objective C
128 and Objective C++ front-end for the LLVM compiler. Its tools are built
129 as libraries and designed to be loosely-coupled and extendable.
131 %description -n clang -l pl.UTF-8
132 clang (z angielskiego): 1. głośny, rezonujący, metaliczny dźwięk; 2.
133 piskliwy odgłos żurawia lub gęsi; 3. narzędzia frontendowe dla języków
136 Celem projektu Clang jest utworzenie nowego frontendu dla kompilatora
137 LLVM do języków C, C++, Objective C i Objective C++. Narzędzia są
138 budowane jako biblioteki i zaprojektowane z myślą o swobodnym łączeniu
141 %package -n clang-analyzer
142 Summary: A source code analysis framework
143 Summary(pl.UTF-8): Szkielet do analizy kodu źródłowego
145 Group: Development/Languages
146 Requires: clang = %{version}-%{release}
147 # not picked up automatically since files are currently not instaled
148 # in standard Python hierarchies yet
151 %description -n clang-analyzer
152 The Clang Static Analyzer consists of both a source code analysis
153 framework and a standalone tool that finds bugs in C and Objective-C
154 programs. The standalone tool is invoked from the command-line, and is
155 intended to run in tandem with a build of a project or code base.
157 %description -n clang-analyzer -l pl.UTF-8
158 Clang Static Analyzer składa się ze szkieletu do analizy kodu
159 źródłowego oraz samodzielnego narzędzia znajdującego błędy w
160 programach w C i C++. Narzędzie jest wywoływane z linii poleceń, z
161 myślą o uruchamianiu wraz z kompilacją projektu lub kodu.
163 %package -n clang-devel
164 Summary: Header files for Clang
165 Summary(pl.UTF-8): Pliki nagłówkowe Clanga
166 Group: Development/Languages
167 Requires: clang = %{version}-%{release}
169 %description -n clang-devel
170 This package contains header files for the Clang compiler.
172 %description -n clang-devel -l pl.UTF-8
173 Ten pakiet zawiera pliki nagłówkowe kompilatora Clang.
175 %package -n clang-doc
176 Summary: Documentation for Clang
177 Summary(pl.UTF-8): Dokumentacja do Clanga
179 Requires: %{name} = %{version}-%{release}
181 %description -n clang-doc
182 Documentation for the Clang compiler front-end.
184 %description -n clang-doc -l pl.UTF-8
185 Dokumentacja do frontendu kompilatora Clang.
187 %package -n clang-apidocs
188 Summary: API documentation for Clang
189 Summary(pl.UTF-8): Dokumentacja API Clanga
190 Group: Development/Languages
191 Requires: clang-doc = %{version}-%{release}
193 %description -n clang-apidocs
194 API documentation for the Clang compiler.
196 %description -n clang-apidocs -l pl.UTF-8
197 Dokumentacja API kompilatora Clang.
200 Summary: OCaml binding for LLVM
201 Summary(pl.UTF-8): Wiązanie OCamla do LLVM-a
203 Requires: %{name} = %{version}-%{release}
204 %requires_eq ocaml-runtime
207 OCaml binding for LLVM.
209 %description ocaml -l pl.UTF-8
210 Wiązanie OCamla do LLVM-a.
213 Summary: Development files for LLVM OCaml binding
214 Summary(pl.UTF-8): Pliki programistyczne wiązania OCamla do LLVM-a
215 Group: Development/Libraries
216 Requires: %{name}-devel = %{version}-%{release}
217 Requires: %{name}-ocaml = %{version}-%{release}
219 %description ocaml-devel
220 The llvm-ocaml-devel package contains libraries and signature files
221 for developing applications that use llvm-ocaml binding.
223 %description ocaml-devel -l pl.UTF-8
224 Ten pakiet zawiera biblioteki i pliki sygnatur do tworzenia aplikacji
225 wykorzystujących wiązanie llvm-ocaml.
229 Summary: Documentation for LLVM's OCaml binding
230 Summary(pl.UTF-8): Dokumentacja wiązania OCamla do LLVM-a
232 Requires: %{name}-ocaml = %{version}-%{release}
234 %description ocaml-doc
235 HTML documentation for LLVM's OCaml binding.
237 %description ocaml-doc -l pl.UTF-8
238 Dokumentacja HTML wiązania OCamla do LLVM-a.
242 mv clang-*.* tools/clang
246 sed -i 's|triplet-plox-here|%{_host}|' tools/clang/lib/Driver/ToolChains.cpp
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} \
274 --disable-assertions \
275 --enable-debug-runtime \
283 OPTIMIZE_OPTION="%{rpmcflags} %{rpmcppflags}"
286 %{__make} check 2>&1 | tee llvm-testlog.txt
287 %{__make} -C tools/clang test 2>&1 | tee clang-testlog.txt
291 rm -rf $RPM_BUILD_ROOT
292 %{__make} -C obj -j1 install \
293 PROJ_docsdir=/moredocs \
294 DESTDIR=$RPM_BUILD_ROOT
296 # Static analyzer not installed by default:
297 # http://clang-analyzer.llvm.org/installation#OtherPlatforms
298 install -d $RPM_BUILD_ROOT%{_libdir}/clang-analyzer
300 for f in scan-{build,view}; do
301 ln -s %{_libdir}/clang-analyzer/$f/$f $RPM_BUILD_ROOT%{_bindir}/$f
302 cp -pr tools/clang/tools/$f $RPM_BUILD_ROOT%{_libdir}/clang-analyzer
304 %py_comp $RPM_BUILD_ROOT%{_libdir}/clang-analyzer/scan-view
305 %py_ocomp $RPM_BUILD_ROOT%{_libdir}/clang-analyzer/scan-view
306 %py_postclean %{_libdir}/clang-analyzer/scan-view
308 # Move documentation back to build directory
310 mv $RPM_BUILD_ROOT/moredocs .
311 rm -fv moredocs/*.tar.gz
312 rm -fv moredocs/ocamldoc/html/*.tar.gz
314 # and separate the apidoc
316 rm -rf apidoc clang-apidoc
317 mv moredocs/html/doxygen apidoc
318 cp -a tools/clang/docs/doxygen/html clang-apidoc
321 # And prepare Clang documentation
323 install -d clang-docs
324 for f in LICENSE.TXT NOTES.txt README.txt TODO.txt; do
325 ln tools/clang/$f clang-docs
328 # Get rid of erroneously installed example files.
329 rm -v $RPM_BUILD_ROOT%{_libdir}/*LLVMHello.*
331 # FIXME file this bug
332 sed -i 's,ABS_RUN_DIR/lib",ABS_RUN_DIR/%{_lib}",' \
333 $RPM_BUILD_ROOT%{_bindir}/llvm-config
335 # remove documentation makefiles:
336 # they require the build directory to work
337 rm -rf moredocs/examples
338 cp -a examples moredocs/examples
339 find moredocs/examples -name Makefile | xargs -0r rm -f
342 rm -rf $RPM_BUILD_ROOT
344 %post -p /sbin/ldconfig
345 %postun -p /sbin/ldconfig
348 %defattr(644,root,root,755)
349 %doc CREDITS.TXT LICENSE.TXT README.txt %{?with_tests:llvm-testlog.txt}
350 %attr(755,root,root) %{_bindir}/bugpoint
351 %attr(755,root,root) %{_bindir}/llc
352 %attr(755,root,root) %{_bindir}/lli
353 %attr(755,root,root) %{_bindir}/llvmc
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-diff
358 %attr(755,root,root) %{_bindir}/llvm-dis
359 %attr(755,root,root) %{_bindir}/llvm-extract
360 %attr(755,root,root) %{_bindir}/llvm-ld
361 %attr(755,root,root) %{_bindir}/llvm-link
362 %attr(755,root,root) %{_bindir}/llvm-mc
363 %attr(755,root,root) %{_bindir}/llvm-nm
364 %attr(755,root,root) %{_bindir}/llvm-objdump
365 %attr(755,root,root) %{_bindir}/llvm-prof
366 %attr(755,root,root) %{_bindir}/llvm-ranlib
367 %attr(755,root,root) %{_bindir}/llvm-stub
368 %attr(755,root,root) %{_bindir}/macho-dump
369 %attr(755,root,root) %{_bindir}/opt
370 %attr(755,root,root) %{_libdir}/libLLVM-%{version}.so
371 %{_mandir}/man1/bugpoint.1*
372 %{_mandir}/man1/lit.1*
373 %{_mandir}/man1/llc.1*
374 %{_mandir}/man1/lli.1*
375 %{_mandir}/man1/llvm-ar.1*
376 %{_mandir}/man1/llvm-as.1*
377 %{_mandir}/man1/llvm-bcanalyzer.1*
378 %{_mandir}/man1/llvm-diff.1*
379 %{_mandir}/man1/llvm-dis.1*
380 %{_mandir}/man1/llvm-extract.1*
381 %{_mandir}/man1/llvm-ld.1*
382 %{_mandir}/man1/llvm-link.1*
383 %{_mandir}/man1/llvm-nm.1*
384 %{_mandir}/man1/llvm-prof.1*
385 %{_mandir}/man1/llvm-ranlib.1*
386 %{_mandir}/man1/llvmc.1*
387 %{_mandir}/man1/llvmgcc.1*
388 %{_mandir}/man1/llvmgxx.1*
389 %{_mandir}/man1/opt.1*
392 %defattr(644,root,root,755)
393 %attr(755,root,root) %{_bindir}/llvm-config
394 %attr(755,root,root) %{_libdir}/profile_rt.so
395 %{_libdir}/libCompilerDriver.a
396 %{_libdir}/libLLVM*.a
397 %{_libdir}/libllvm*.a
399 %attr(755,root,root) %{_libdir}/BugpointPasses.so
400 %attr(755,root,root) %{_libdir}/libEnhancedDisassembly.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,TODO.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}/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/llvm*.cma
467 %{_libdir}/ocaml/llvm*.cmi
470 %defattr(644,root,root,755)
471 %{_libdir}/ocaml/libLLVM*.a
472 %{_libdir}/ocaml/libllvm*.a
473 %{_libdir}/ocaml/llvm*.a
474 %{_libdir}/ocaml/llvm*.cmx*
475 %{_libdir}/ocaml/llvm*.mli
478 %defattr(644,root,root,755)
479 %doc moredocs/ocamldoc/html/*