]> git.pld-linux.org Git - packages/llvm.git/blob - llvm.spec
- added r600 patch (R600 target support)
[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_without  man     # man pages
10 %bcond_with     tests   # run tests
11
12 %ifarch s390 s390x sparc64
13 # No ocaml on these arches
14 %undefine       with_ocaml
15 %endif
16
17 Summary:        The Low Level Virtual Machine (An Optimizing Compiler Infrastructure)
18 Summary(pl.UTF-8):      Niskopoziomowa maszyna wirtualna (infrastruktura kompilatora optymalizującego)
19 Name:           llvm
20 Version:        3.2
21 Release:        1
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:  71610289bbc819e3e15fdd562809a2d7
27 Source1:        http://llvm.org/releases/%{version}/clang-%{version}.src.tar.gz
28 # Source1-md5:  3896ef4334df08563b05d0848ba80582
29 Patch0:         %{name}-config.patch
30 # Data files should be installed with timestamps preserved
31 Patch1:         %{name}-2.6-timestamp.patch
32 Patch2:         %{name}-pld.patch
33 # R600 target support from git://people.freedesktop.org/~tstellar/llvm
34 Patch3:         %{name}-r600.patch
35 URL:            http://llvm.org/
36 BuildRequires:  autoconf >= 2.60
37 BuildRequires:  automake >= 1:1.9.6
38 BuildRequires:  bash
39 BuildRequires:  bison
40 BuildRequires:  flex
41 BuildRequires:  gcc >= 5:3.4
42 # gcc4 might be installed, but not current __cc
43 %if "%(echo %{cc_version} | cut -d. -f1,2)" < "3.4"
44 BuildRequires:  __cc >= 3.4
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 %{?with_man:BuildRequires:      sphinx-pdg}
55 %if %{with apidocs}
56 BuildRequires:  doxygen
57 BuildRequires:  graphviz
58 %endif
59 %if %{with tests}
60 BuildRequires:  dejagnu
61 BuildRequires:  python
62 BuildRequires:  tcl-devel
63 %endif
64 Requires:       %{name}-libs = %{version}-%{release}
65 # LLVM is not supported on PPC64
66 # http://llvm.org/bugs/show_bug.cgi?id=3729
67 ExcludeArch:    ppc64
68 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
69
70 %define         _sysconfdir     /etc/%{name}
71
72 %define         specflags_ppc   -fno-var-tracking-assignments
73
74 # strip corrupts: $RPM_BUILD_ROOT/usr/lib64/llvm-gcc/bin/llvm-c++ ...
75 %define         _noautostrip    .*/\\(libmud.*\\.a\\|bin/llvm-.*\\|lib.*++\\.a\\)
76
77 %description
78 LLVM is a compiler infrastructure designed for compile-time,
79 link-time, runtime, and idle-time optimization of programs from
80 arbitrary programming languages. LLVM is written in C++ and has been
81 developed since 2000 at the University of Illinois and Apple. It
82 currently supports compilation of C and C++ programs using clang
83 frontend.
84
85 %description -l pl.UTF-8
86 LLVM to infrastruktura kompilatora zaprojektowana do optymalizacji
87 czasu kompilowania, linkowania, działania i bezczynności programów w
88 dowolnych językach programowania. Jest napisana w C++, rozwijana od
89 roku 2000 przez Uniwersytet w Illinois i Apple. Aktualnie obsługuje
90 kompilację programów w C i C++ przy użyciu frontendu clang.
91
92 %package libs
93 Summary:        LLVM shared library
94 Summary(pl.UTF-8):      Biblioteka współdzielona LLVM-a
95 Group:          Libraries
96 Conflicts:      llvm < 3.2
97
98 %description libs
99 LLVM shared library.
100
101 %description libs -l pl.UTF-8
102 Biblioteka współdzielona LLVM-a.
103
104 %package devel
105 Summary:        Static libraries and header files for LLVM
106 Summary(pl.UTF-8):      Biblioteki statyczne i pliki nagłówkowe dla LLVM-a
107 Group:          Development/Languages
108 Requires:       %{name}-libs = %{version}-%{release}
109 Requires:       libstdc++-devel >= 6:3.4
110
111 %description devel
112 This package contains static libraries and header files needed to
113 develop new native programs that use the LLVM infrastructure.
114
115 %description devel -l pl.UTF-8
116 Ten pakiet zawiera biblioteki statyczne oraz pliki nagłówkowe
117 potrzebne do tworzenia nowych programów natywnych wykorzystujących
118 infrastrukturę LLVM.
119
120 %package doc
121 Summary:        Documentation for LLVM
122 Summary(pl.UTF-8):      Dokumentacja do LLVM-a
123 Group:          Documentation
124 # does not require base
125
126 %description doc
127 Documentation for the LLVM compiler infrastructure.
128
129 %description doc -l pl.UTF-8
130 Dokumentacja do infrastruktury kompilatorów LLVM.
131
132 %package apidocs
133 Summary:        API documentation for LLVM
134 Summary(pl.UTF-8):      Dokumentacja API LLVM-a
135 Group:          Development/Languages
136 Requires:       %{name}-doc = %{version}-%{release}
137
138 %description apidocs
139 API documentation for the LLVM compiler infrastructure.
140
141 %description apidocs -l pl.UTF-8
142 Dokumentacja API infrastruktury kompilatorów LLVM.
143
144 %package -n clang
145 Summary:        A C language family frontend for LLVM
146 Summary(pl.UTF-8):      Frontend LLVM-a do języków z rodziny C
147 License:        NCSA
148 Group:          Development/Languages
149 Requires:       %{name} = %{version}-%{release}
150
151 %description -n clang
152 clang: noun 1. A loud, resonant, metallic sound. 2. The strident call
153 of a crane or goose. 3. C-language family front-end toolkit.
154
155 The goal of the Clang project is to create a new C, C++, Objective C
156 and Objective C++ front-end for the LLVM compiler. Its tools are built
157 as libraries and designed to be loosely-coupled and extendable.
158
159 %description -n clang -l pl.UTF-8
160 clang (z angielskiego): 1. głośny, rezonujący, metaliczny dźwięk; 2.
161 piskliwy odgłos żurawia lub gęsi; 3. narzędzia frontendowe dla języków
162 z rodziny C.
163
164 Celem projektu Clang jest utworzenie nowego frontendu dla kompilatora
165 LLVM do języków C, C++, Objective C i Objective C++. Narzędzia są
166 budowane jako biblioteki i zaprojektowane z myślą o swobodnym łączeniu
167 i rozszerzaniu.
168
169 %package -n clang-analyzer
170 Summary:        A source code analysis framework
171 Summary(pl.UTF-8):      Szkielet do analizy kodu źródłowego
172 License:        NCSA
173 Group:          Development/Languages
174 Requires:       clang = %{version}-%{release}
175 # not picked up automatically since files are currently not instaled
176 # in standard Python hierarchies yet
177 Requires:       python
178
179 %description -n clang-analyzer
180 The Clang Static Analyzer consists of both a source code analysis
181 framework and a standalone tool that finds bugs in C and Objective-C
182 programs. The standalone tool is invoked from the command-line, and is
183 intended to run in tandem with a build of a project or code base.
184
185 %description -n clang-analyzer -l pl.UTF-8
186 Clang Static Analyzer składa się ze szkieletu do analizy kodu
187 źródłowego oraz samodzielnego narzędzia znajdującego błędy w
188 programach w C i C++. Narzędzie jest wywoływane z linii poleceń, z
189 myślą o uruchamianiu wraz z kompilacją projektu lub kodu.
190
191 %package -n clang-devel
192 Summary:        Header files for Clang
193 Summary(pl.UTF-8):      Pliki nagłówkowe Clanga
194 Group:          Development/Languages
195 Requires:       %{name}-devel = %{version}-%{release}
196 Requires:       clang = %{version}-%{release}
197
198 %description -n clang-devel
199 This package contains header files for the Clang compiler.
200
201 %description -n clang-devel -l pl.UTF-8
202 Ten pakiet zawiera pliki nagłówkowe kompilatora Clang.
203
204 %package -n clang-doc
205 Summary:        Documentation for Clang
206 Summary(pl.UTF-8):      Dokumentacja do Clanga
207 Group:          Documentation
208 Requires:       %{name} = %{version}-%{release}
209
210 %description -n clang-doc
211 Documentation for the Clang compiler front-end.
212
213 %description -n clang-doc -l pl.UTF-8
214 Dokumentacja do frontendu kompilatora Clang.
215
216 %package -n clang-apidocs
217 Summary:        API documentation for Clang
218 Summary(pl.UTF-8):      Dokumentacja API Clanga
219 Group:          Development/Languages
220 Requires:       clang-doc = %{version}-%{release}
221
222 %description -n clang-apidocs
223 API documentation for the Clang compiler.
224
225 %description -n clang-apidocs -l pl.UTF-8
226 Dokumentacja API kompilatora Clang.
227
228 %package ocaml
229 Summary:        OCaml binding for LLVM
230 Summary(pl.UTF-8):      Wiązanie OCamla do LLVM-a
231 Group:          Libraries
232 Requires:       %{name} = %{version}-%{release}
233 %requires_eq    ocaml-runtime
234
235 %description ocaml
236 OCaml binding for LLVM.
237
238 %description ocaml -l pl.UTF-8
239 Wiązanie OCamla do LLVM-a.
240
241 %package ocaml-devel
242 Summary:        Development files for LLVM OCaml binding
243 Summary(pl.UTF-8):      Pliki programistyczne wiązania OCamla do LLVM-a
244 Group:          Development/Libraries
245 Requires:       %{name}-devel = %{version}-%{release}
246 Requires:       %{name}-ocaml = %{version}-%{release}
247
248 %description ocaml-devel
249 The llvm-ocaml-devel package contains libraries and signature files
250 for developing applications that use llvm-ocaml binding.
251
252 %description ocaml-devel -l pl.UTF-8
253 Ten pakiet zawiera biblioteki i pliki sygnatur do tworzenia aplikacji
254 wykorzystujących wiązanie llvm-ocaml.
255
256 %package ocaml-doc
257 Summary:        Documentation for LLVM's OCaml binding
258 Summary(pl.UTF-8):      Dokumentacja wiązania OCamla do LLVM-a
259 Group:          Documentation
260 Requires:       %{name}-ocaml = %{version}-%{release}
261
262 %description ocaml-doc
263 HTML documentation for LLVM's OCaml binding.
264
265 %description ocaml-doc -l pl.UTF-8
266 Dokumentacja HTML wiązania OCamla do LLVM-a.
267
268 %prep
269 %setup -q -a1 -n %{name}-%{version}.src
270 mv clang-*.* tools/clang
271 %patch0 -p1
272 %patch1 -p1
273 %patch2 -p1
274 %patch3 -p1
275
276 # configure does not properly specify libdir
277 sed -i 's|(PROJ_prefix)/lib|(PROJ_prefix)/%{_lib}|g' Makefile.config.in
278 sed -i 's|(PROJ_prefix)/lib/|(PROJ_prefix)/%{_lib}/|g' tools/clang/lib/Headers/Makefile
279
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},
283 }'
284
285 install -d obj
286
287 %build
288 cd autoconf
289 %{__aclocal} -I m4
290 %{__autoconf} -o ../configure configure.ac
291 cd ..
292 %{__autoheader} -I autoconf -I autoconf/m4 autoconf/configure.ac
293
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
296 #
297 # bash specific 'test a < b'
298 cd obj
299 bash ../%configure \
300         --datadir=%{_datadir}/%{name}-%{version} \
301         --disable-assertions \
302 %ifarch %{ix86}
303         --disable-pic \
304 %endif
305         --disable-static \
306         --enable-bindings=%{?with_ocaml:ocaml}%{!?with_ocaml:none} \
307         --enable-debug-runtime \
308 %if %{with apidocs}
309         --enable-doxygen \
310 %endif
311         --enable-experimental-targets=R600 \
312         --enable-jit \
313         --enable-optimized \
314         --enable-shared \
315         --with-pic
316
317 %{__make} \
318         REQUIRES_RTTI=1 \
319         OPTIMIZE_OPTION="%{rpmcflags} %{rpmcppflags}"
320
321 %if %{with tests}
322 %{__make} check 2>&1 | tee llvm-testlog.txt
323 %{__make} -C tools/clang test 2>&1 | tee clang-testlog.txt
324 %endif
325
326 cd ..
327
328 %if %{with man}
329 %{__make} -C docs -f Makefile.sphinx man
330 %endif
331
332 %install
333 rm -rf $RPM_BUILD_ROOT
334 %{__make} -C obj -j1 install \
335         PROJ_docsdir=/moredocs \
336         DESTDIR=$RPM_BUILD_ROOT
337
338 # Static analyzer not installed by default:
339 # http://clang-analyzer.llvm.org/installation#OtherPlatforms
340 install -d $RPM_BUILD_ROOT%{_libdir}/clang-analyzer
341 # create launchers
342 for f in scan-{build,view}; do
343         ln -s %{_libdir}/clang-analyzer/$f/$f $RPM_BUILD_ROOT%{_bindir}/$f
344         cp -pr tools/clang/tools/$f $RPM_BUILD_ROOT%{_libdir}/clang-analyzer
345 done
346 %{__mv} $RPM_BUILD_ROOT%{_libdir}/clang-analyzer/scan-build/scan-build.1 $RPM_BUILD_ROOT%{_mandir}/man1
347 %py_comp $RPM_BUILD_ROOT%{_libdir}/clang-analyzer/scan-view
348 %py_ocomp $RPM_BUILD_ROOT%{_libdir}/clang-analyzer/scan-view
349 %py_postclean %{_libdir}/clang-analyzer/scan-view
350
351 %if %{with man}
352 install -d $RPM_BUILD_ROOT%{_mandir}/man1
353 cp -p docs/_build/man/*.1 $RPM_BUILD_ROOT%{_mandir}/man1
354 # these tools are not installed
355 %{__rm} $RPM_BUILD_ROOT%{_mandir}/man1/{FileCheck,llvm-build}.1
356 %endif
357
358 # Move documentation back to build directory
359 rm -rf moredocs
360 mv $RPM_BUILD_ROOT/moredocs .
361 %{__rm} -v moredocs/*.tar.gz
362 %{__rm} -v moredocs/ocamldoc/html/*.tar.gz
363
364 # and separate the apidoc
365 %if %{with apidocs}
366 rm -rf apidoc clang-apidoc
367 mv moredocs/html/doxygen apidoc
368 cp -a tools/clang/docs/doxygen/html clang-apidoc
369 %endif
370
371 # And prepare Clang documentation
372 rm -rf clang-docs
373 install -d clang-docs
374 for f in LICENSE.TXT NOTES.txt README.txt; do
375         ln tools/clang/$f clang-docs
376 done
377
378 # Get rid of erroneously installed example files.
379 %{__rm} -v $RPM_BUILD_ROOT%{_libdir}/*LLVMHello.*
380
381 # remove documentation makefiles:
382 # they require the build directory to work
383 rm -rf moredocs/examples
384 cp -a examples moredocs/examples
385 find moredocs/examples -name Makefile | xargs -0r rm -f
386
387 %clean
388 rm -rf $RPM_BUILD_ROOT
389
390 %post   libs -p /sbin/ldconfig
391 %postun libs -p /sbin/ldconfig
392
393 %files
394 %defattr(644,root,root,755)
395 %doc CREDITS.TXT LICENSE.TXT README.txt %{?with_tests:llvm-testlog.txt}
396 %attr(755,root,root) %{_bindir}/bugpoint
397 %attr(755,root,root) %{_bindir}/llc
398 %attr(755,root,root) %{_bindir}/lli
399 %attr(755,root,root) %{_bindir}/llvm-ar
400 %attr(755,root,root) %{_bindir}/llvm-as
401 %attr(755,root,root) %{_bindir}/llvm-bcanalyzer
402 %attr(755,root,root) %{_bindir}/llvm-cov
403 %attr(755,root,root) %{_bindir}/llvm-diff
404 %attr(755,root,root) %{_bindir}/llvm-dis
405 %attr(755,root,root) %{_bindir}/llvm-dwarfdump
406 %attr(755,root,root) %{_bindir}/llvm-extract
407 %attr(755,root,root) %{_bindir}/llvm-link
408 %attr(755,root,root) %{_bindir}/llvm-mc
409 %attr(755,root,root) %{_bindir}/llvm-mcmarkup
410 %attr(755,root,root) %{_bindir}/llvm-nm
411 %attr(755,root,root) %{_bindir}/llvm-objdump
412 %attr(755,root,root) %{_bindir}/llvm-prof
413 %attr(755,root,root) %{_bindir}/llvm-ranlib
414 %attr(755,root,root) %{_bindir}/llvm-readobj
415 %attr(755,root,root) %{_bindir}/llvm-rtdyld
416 %attr(755,root,root) %{_bindir}/llvm-size
417 %attr(755,root,root) %{_bindir}/llvm-stress
418 %attr(755,root,root) %{_bindir}/llvm-tblgen
419 %attr(755,root,root) %{_bindir}/macho-dump
420 %attr(755,root,root) %{_bindir}/opt
421 %{_mandir}/man1/bugpoint.1*
422 %{_mandir}/man1/lit.1*
423 %{_mandir}/man1/llc.1*
424 %{_mandir}/man1/lli.1*
425 %{_mandir}/man1/llvm-ar.1*
426 %{_mandir}/man1/llvm-as.1*
427 %{_mandir}/man1/llvm-bcanalyzer.1*
428 %{_mandir}/man1/llvm-cov.1*
429 %{_mandir}/man1/llvm-diff.1*
430 %{_mandir}/man1/llvm-dis.1*
431 %{_mandir}/man1/llvm-extract.1*
432 %{_mandir}/man1/llvm-link.1*
433 %{_mandir}/man1/llvm-nm.1*
434 %{_mandir}/man1/llvm-prof.1*
435 %{_mandir}/man1/llvm-ranlib.1*
436 %{_mandir}/man1/llvm-stress.1*
437 %{_mandir}/man1/opt.1*
438 %{_mandir}/man1/tblgen.1*
439
440 %files libs
441 %defattr(644,root,root,755)
442 %attr(755,root,root) %{_libdir}/libLLVM-%{version}svn.so
443
444 %files devel
445 %defattr(644,root,root,755)
446 %attr(755,root,root) %{_bindir}/llvm-config
447 %attr(755,root,root) %{_libdir}/libprofile_rt.so
448 %{_libdir}/libLLVM*.a
449 %{_libdir}/libprofile_rt.a
450 %ifarch %{x8664}
451 %attr(755,root,root) %{_libdir}/BugpointPasses.so
452 %attr(755,root,root) %{_libdir}/libLTO.so
453 %{_libdir}/libLTO.a
454 %endif
455 %{_includedir}/llvm
456 %{_includedir}/llvm-c
457 %{_mandir}/man1/llvm-config.1*
458
459 %files doc
460 %defattr(644,root,root,755)
461 %doc moredocs/examples moredocs/html
462
463 %if %{with apidocs}
464 %files apidocs
465 %defattr(644,root,root,755)
466 %doc apidoc/*
467 %endif
468
469 %files -n clang
470 %defattr(644,root,root,755)
471 %doc clang-docs/{LICENSE.TXT,NOTES.txt,README.txt} %{?with_tests:clang-testlog.txt}
472 %attr(755,root,root) %{_bindir}/c-index-test
473 %attr(755,root,root) %{_bindir}/clang
474 %attr(755,root,root) %{_bindir}/clang++
475 %attr(755,root,root) %{_bindir}/clang-check
476 %attr(755,root,root) %{_bindir}/clang-tblgen
477 %attr(755,root,root) %{_libdir}/libclang.so
478 %{_libdir}/clang
479 %{_mandir}/man1/clang.1*
480
481 %files -n clang-analyzer
482 %defattr(644,root,root,755)
483 %attr(755,root,root) %{_bindir}/scan-build
484 %attr(755,root,root) %{_bindir}/scan-view
485 %{_mandir}/man1/scan-build.1*
486 %dir %{_libdir}/clang-analyzer
487
488 %dir %{_libdir}/clang-analyzer/scan-build
489 %{_libdir}/clang-analyzer/scan-build/*.css
490 %{_libdir}/clang-analyzer/scan-build/*.js
491 %attr(755,root,root) %{_libdir}/clang-analyzer/scan-build/scan-build
492 %attr(755,root,root) %{_libdir}/clang-analyzer/scan-build/*-analyzer
493
494 %dir %{_libdir}/clang-analyzer/scan-view
495 %attr(755,root,root) %{_libdir}/clang-analyzer/scan-view/scan-view
496 %{_libdir}/clang-analyzer/scan-view/Resources
497 %{_libdir}/clang-analyzer/scan-view/*.py[co]
498
499 %files -n clang-devel
500 %defattr(644,root,root,755)
501 %{_libdir}/libclang*.a
502 %{_includedir}/clang
503 %{_includedir}/clang-c
504
505 %files -n clang-doc
506 %defattr(644,root,root,755)
507 %doc tools/clang/docs/*.{css,html,png,txt}
508
509 %if %{with apidocs}
510 %files -n clang-apidocs
511 %defattr(644,root,root,755)
512 %doc clang-apidoc/*
513 %endif
514
515 %if %{with ocaml}
516 %files ocaml
517 %defattr(644,root,root,755)
518 %{_libdir}/ocaml/META.llvm
519 %{_libdir}/ocaml/llvm*.cma
520 %{_libdir}/ocaml/llvm*.cmi
521
522 %files ocaml-devel
523 %defattr(644,root,root,755)
524 %{_libdir}/libllvm*.a
525 %{_libdir}/ocaml/libLLVM*.a
526 %{_libdir}/ocaml/libllvm*.a
527 %{_libdir}/ocaml/llvm*.a
528 %{_libdir}/ocaml/llvm*.cmx*
529 %{_libdir}/ocaml/llvm*.mli
530
531 %files ocaml-doc
532 %defattr(644,root,root,755)
533 %doc moredocs/ocamldoc/html/*
534 %endif
This page took 0.066055 seconds and 4 git commands to generate.