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