]> git.pld-linux.org Git - packages/llvm.git/blob - llvm.spec
TODO added.
[packages/llvm.git] / llvm.spec
1 #
2 # TODO:
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>
5 #
6 # Conditional build:
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
10
11 %ifarch s390 s390x sparc64
12 # No ocaml on these arches
13 %undefine       with_ocaml
14 %endif
15
16 Summary:        The Low Level Virtual Machine (An Optimizing Compiler Infrastructure)
17 Summary(pl.UTF-8):      Niskopoziomowa maszyna wirtualna (infrastruktura kompilatora optymalizującego)
18 Name:           llvm
19 Version:        3.1
20 Release:        4
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
31 URL:            http://llvm.org/
32 BuildRequires:  autoconf >= 2.60
33 BuildRequires:  automake >= 1:1.9.6
34 BuildRequires:  bash
35 BuildRequires:  bison
36 BuildRequires:  flex
37 %if %{with apidocs}
38 BuildRequires:  doxygen
39 BuildRequires:  graphviz
40 %endif
41 %if %{with tests}
42 BuildRequires:  dejagnu
43 BuildRequires:  python
44 BuildRequires:  tcl-devel
45 %endif
46 BuildRequires:  groff
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
57 %endif
58 # LLVM is not supported on PPC64
59 # http://llvm.org/bugs/show_bug.cgi?id=3729
60 ExcludeArch:    ppc64
61 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
62
63 %define         _sysconfdir     /etc/%{name}
64
65 %define         specflags_ppc   -fno-var-tracking-assignments
66
67 # strip corrupts: $RPM_BUILD_ROOT/usr/lib64/llvm-gcc/bin/llvm-c++ ...
68 %define         _noautostrip    .*/\\(libmud.*\\.a\\|bin/llvm-.*\\|lib.*++\\.a\\)
69
70 %description
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
76 frontend.
77
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.
84
85 %package devel
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
91
92 %description devel
93 This package contains static libraries and header files needed to
94 develop new native programs that use the LLVM infrastructure.
95
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
99 infrastrukturę LLVM.
100
101 %package doc
102 Summary:        Documentation for LLVM
103 Summary(pl.UTF-8):      Dokumentacja do LLVM-a
104 Group:          Documentation
105 # does not require base
106
107 %description doc
108 Documentation for the LLVM compiler infrastructure.
109
110 %description doc -l pl.UTF-8
111 Dokumentacja do infrastruktury kompilatorów LLVM.
112
113 %package apidocs
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}
118
119 %description apidocs
120 API documentation for the LLVM compiler infrastructure.
121
122 %description apidocs -l pl.UTF-8
123 Dokumentacja API infrastruktury kompilatorów LLVM.
124
125 %package -n clang
126 Summary:        A C language family frontend for LLVM
127 Summary(pl.UTF-8):      Frontend LLVM-a do języków z rodziny C
128 License:        NCSA
129 Group:          Development/Languages
130
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.
134
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.
138
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
142 z rodziny C.
143
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
147 i rozszerzaniu.
148
149 %package -n clang-analyzer
150 Summary:        A source code analysis framework
151 Summary(pl.UTF-8):      Szkielet do analizy kodu źródłowego
152 License:        NCSA
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
157 Requires:       python
158
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.
164
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.
170
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}
176
177 %description -n clang-devel
178 This package contains header files for the Clang compiler.
179
180 %description -n clang-devel -l pl.UTF-8
181 Ten pakiet zawiera pliki nagłówkowe kompilatora Clang.
182
183 %package -n clang-doc
184 Summary:        Documentation for Clang
185 Summary(pl.UTF-8):      Dokumentacja do Clanga
186 Group:          Documentation
187 Requires:       %{name} = %{version}-%{release}
188
189 %description -n clang-doc
190 Documentation for the Clang compiler front-end.
191
192 %description -n clang-doc -l pl.UTF-8
193 Dokumentacja do frontendu kompilatora Clang.
194
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}
200
201 %description -n clang-apidocs
202 API documentation for the Clang compiler.
203
204 %description -n clang-apidocs -l pl.UTF-8
205 Dokumentacja API kompilatora Clang.
206
207 %package ocaml
208 Summary:        OCaml binding for LLVM
209 Summary(pl.UTF-8):      Wiązanie OCamla do LLVM-a
210 Group:          Libraries
211 Requires:       %{name} = %{version}-%{release}
212 %requires_eq    ocaml-runtime
213
214 %description ocaml
215 OCaml binding for LLVM.
216
217 %description ocaml -l pl.UTF-8
218 Wiązanie OCamla do LLVM-a.
219
220 %package ocaml-devel
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}
226
227 %description ocaml-devel
228 The llvm-ocaml-devel package contains libraries and signature files
229 for developing applications that use llvm-ocaml binding.
230
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.
234
235
236 %package ocaml-doc
237 Summary:        Documentation for LLVM's OCaml binding
238 Summary(pl.UTF-8):      Dokumentacja wiązania OCamla do LLVM-a
239 Group:          Documentation
240 Requires:       %{name}-ocaml = %{version}-%{release}
241
242 %description ocaml-doc
243 HTML documentation for LLVM's OCaml binding.
244
245 %description ocaml-doc -l pl.UTF-8
246 Dokumentacja HTML wiązania OCamla do LLVM-a.
247
248 %prep
249 %setup -q -a1 -n %{name}-%{version}.src
250 mv clang-*.* tools/clang
251 %patch0 -p1
252 %patch1 -p1
253 %patch2 -p1
254
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
258
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},
262 }'
263
264 install -d obj
265
266 %build
267 cd autoconf
268 %{__aclocal} -I m4
269 %{__autoconf} -o ../configure configure.ac
270 cd ..
271 %{__autoheader} -I autoconf -I autoconf/m4 autoconf/configure.ac
272
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
275 #
276 # bash specific 'test a < b'
277 cd obj
278 bash ../%configure \
279         --datadir=%{_datadir}/%{name}-%{version} \
280         --disable-assertions \
281 %ifarch %{ix86}
282         --disable-pic \
283 %endif
284         --disable-static \
285         --enable-bindings=%{?with_ocaml:ocaml}%{!?with_ocaml:none} \
286         --enable-debug-runtime \
287 %if %{with apidocs}
288         --enable-doxygen \
289 %endif
290         --enable-jit \
291         --enable-optimized \
292         --enable-shared \
293         --with-pic
294
295 %{__make} \
296         REQUIRES_RTTI=1 \
297         OPTIMIZE_OPTION="%{rpmcflags} %{rpmcppflags}"
298
299 %if %{with tests}
300 %{__make} check 2>&1 | tee llvm-testlog.txt
301 %{__make} -C tools/clang test 2>&1 | tee clang-testlog.txt
302 %endif
303
304 %install
305 rm -rf $RPM_BUILD_ROOT
306 %{__make} -C obj -j1 install \
307         PROJ_docsdir=/moredocs \
308         DESTDIR=$RPM_BUILD_ROOT
309
310 # Static analyzer not installed by default:
311 # http://clang-analyzer.llvm.org/installation#OtherPlatforms
312 install -d $RPM_BUILD_ROOT%{_libdir}/clang-analyzer
313 # create launchers
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
317 done
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
321
322 # Move documentation back to build directory
323 rm -rf moredocs
324 mv $RPM_BUILD_ROOT/moredocs .
325 %{__rm} -v moredocs/*.tar.gz
326 %{__rm} -v moredocs/ocamldoc/html/*.tar.gz
327
328 # and separate the apidoc
329 %if %{with apidocs}
330 rm -rf apidoc clang-apidoc
331 mv moredocs/html/doxygen apidoc
332 cp -a tools/clang/docs/doxygen/html clang-apidoc
333 %endif
334
335 # And prepare Clang documentation
336 rm -rf clang-docs
337 install -d clang-docs
338 for f in LICENSE.TXT NOTES.txt README.txt; do
339         ln tools/clang/$f clang-docs
340 done
341
342 # Get rid of erroneously installed example files.
343 %{__rm} -v $RPM_BUILD_ROOT%{_libdir}/*LLVMHello.*
344
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
350
351 %clean
352 rm -rf $RPM_BUILD_ROOT
353
354 %post   -p /sbin/ldconfig
355 %postun -p /sbin/ldconfig
356
357 %files
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*
405
406 %files devel
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
412 %ifarch %{x8664}
413 %attr(755,root,root) %{_libdir}/BugpointPasses.so
414 %attr(755,root,root) %{_libdir}/libLTO.so
415 %{_libdir}/libLTO.a
416 %endif
417 %{_includedir}/llvm
418 %{_includedir}/llvm-c
419 %{_mandir}/man1/llvm-config.1*
420
421 %files doc
422 %defattr(644,root,root,755)
423 %doc moredocs/examples moredocs/html
424
425 %if %{with apidocs}
426 %files apidocs
427 %defattr(644,root,root,755)
428 %doc apidoc/*
429 %endif
430
431 %files -n clang
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
438 %{_libdir}/clang
439 %{_mandir}/man1/clang.1*
440 %{_mandir}/man1/tblgen.1*
441
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
447
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
453
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]
458
459 %files -n clang-devel
460 %defattr(644,root,root,755)
461 %{_libdir}/libclang*.a
462 %{_includedir}/clang
463 %{_includedir}/clang-c
464
465 %files -n clang-doc
466 %defattr(644,root,root,755)
467 %doc tools/clang/docs/*.{css,html,png,txt}
468
469 %if %{with apidocs}
470 %files -n clang-apidocs
471 %defattr(644,root,root,755)
472 %doc clang-apidoc/*
473 %endif
474
475 %if %{with ocaml}
476 %files ocaml
477 %defattr(644,root,root,755)
478 %{_libdir}/ocaml/META.llvm
479 %{_libdir}/ocaml/llvm*.cma
480 %{_libdir}/ocaml/llvm*.cmi
481
482 %files ocaml-devel
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
490
491 %files ocaml-doc
492 %defattr(644,root,root,755)
493 %doc moredocs/ocamldoc/html/*
494 %endif
This page took 0.099736 seconds and 3 git commands to generate.