]> git.pld-linux.org Git - packages/llvm.git/blame - llvm.spec
TODO added.
[packages/llvm.git] / llvm.spec
CommitLineData
bc88141a 1#
d015c902
PS
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#
9556f4c9
ER
6# Conditional build:
7%bcond_without ocaml # ocaml binding
8132e62b
JB
8%bcond_with apidocs # The doxygen docs are HUGE, so they are not built by default.
9%bcond_with tests # run tests
9556f4c9
ER
10
11%ifarch s390 s390x sparc64
12# No ocaml on these arches
13%undefine with_ocaml
14%endif
15
aa11c230 16Summary: The Low Level Virtual Machine (An Optimizing Compiler Infrastructure)
2326a99f 17Summary(pl.UTF-8): Niskopoziomowa maszyna wirtualna (infrastruktura kompilatora optymalizującego)
aa11c230 18Name: llvm
f981d747 19Version: 3.1
493e5485 20Release: 4
aa11c230 21License: University of Illinois/NCSA Open Source License
22Group: Development/Languages
f981d747
PS
23Source0: http://llvm.org/releases/%{version}/%{name}-%{version}.src.tar.gz
24# Source0-md5: 16eaa7679f84113f65b12760fdfe4ee1
25Source1: http://llvm.org/releases/%{version}/clang-%{version}.src.tar.gz
26# Source1-md5: 59bf2d3120a3805f27cafda3823caaf8
ebde279d 27Patch0: %{name}-config.patch
d997b14b 28# Data files should be installed with timestamps preserved
ebde279d
JB
29Patch1: %{name}-2.6-timestamp.patch
30Patch2: %{name}-pld.patch
2326a99f 31URL: http://llvm.org/
ebde279d
JB
32BuildRequires: autoconf >= 2.60
33BuildRequires: automake >= 1:1.9.6
bc88141a 34BuildRequires: bash
d997b14b 35BuildRequires: bison
d997b14b 36BuildRequires: flex
9556f4c9
ER
37%if %{with apidocs}
38BuildRequires: doxygen
d997b14b 39BuildRequires: graphviz
9556f4c9
ER
40%endif
41%if %{with tests}
42BuildRequires: dejagnu
43BuildRequires: python
44BuildRequires: tcl-devel
45%endif
d997b14b 46BuildRequires: groff
bc88141a 47BuildRequires: libltdl-devel
ebde279d 48BuildRequires: libtool >= 2:1.5.22
d997b14b
AM
49BuildRequires: libstdc++-devel >= 5:3.4
50BuildRequires: ocaml-ocamldoc
8132e62b 51BuildRequires: perl-base >= 1:5.6
8c156e7d 52BuildRequires: perl-tools-pod
53BuildRequires: rpm-pythonprov
356a0bbd
ER
54# gcc4 might be installed, but not current __cc
55%if "%(echo %{cc_version} | cut -d. -f1,2)" < "3.4"
56BuildRequires: __cc >= 3.4
57%endif
9556f4c9
ER
58# LLVM is not supported on PPC64
59# http://llvm.org/bugs/show_bug.cgi?id=3729
60ExcludeArch: ppc64
aa11c230 61BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
62
356a0bbd 63%define _sysconfdir /etc/%{name}
021b3c3d 64
9556f4c9
ER
65%define specflags_ppc -fno-var-tracking-assignments
66
6832a5c5
ER
67# strip corrupts: $RPM_BUILD_ROOT/usr/lib64/llvm-gcc/bin/llvm-c++ ...
68%define _noautostrip .*/\\(libmud.*\\.a\\|bin/llvm-.*\\|lib.*++\\.a\\)
69
aa11c230 70%description
71LLVM is a compiler infrastructure designed for compile-time,
72link-time, runtime, and idle-time optimization of programs from
73arbitrary programming languages. LLVM is written in C++ and has been
74developed since 2000 at the University of Illinois and Apple. It
621ec11f
JB
75currently supports compilation of C and C++ programs using clang
76frontend.
aa11c230 77
2326a99f
JB
78%description -l pl.UTF-8
79LLVM to infrastruktura kompilatora zaprojektowana do optymalizacji
80czasu kompilowania, linkowania, działania i bezczynności programów w
81dowolnych językach programowania. Jest napisana w C++, rozwijana od
82roku 2000 przez Uniwersytet w Illinois i Apple. Aktualnie obsługuje
621ec11f 83kompilację programów w C i C++ przy użyciu frontendu clang.
2326a99f 84
bc88141a 85%package devel
621ec11f
JB
86Summary: Static libraries and header files for LLVM
87Summary(pl.UTF-8): Biblioteki statyczne i pliki nagłówkowe dla LLVM-a
bc88141a
ER
88Group: Development/Languages
89Requires: %{name} = %{version}-%{release}
90Requires: libstdc++-devel >= 6:3.4
91
92%description devel
621ec11f
JB
93This package contains static libraries and header files needed to
94develop new native programs that use the LLVM infrastructure.
95
96%description devel -l pl.UTF-8
97Ten pakiet zawiera biblioteki statyczne oraz pliki nagłówkowe
98potrzebne do tworzenia nowych programów natywnych wykorzystujących
99infrastrukturę LLVM.
bc88141a 100
9556f4c9
ER
101%package doc
102Summary: Documentation for LLVM
621ec11f 103Summary(pl.UTF-8): Dokumentacja do LLVM-a
9556f4c9
ER
104Group: Documentation
105# does not require base
bc88141a 106
9556f4c9
ER
107%description doc
108Documentation for the LLVM compiler infrastructure.
bc88141a 109
621ec11f
JB
110%description doc -l pl.UTF-8
111Dokumentacja do infrastruktury kompilatorów LLVM.
112
9556f4c9
ER
113%package apidocs
114Summary: API documentation for LLVM
621ec11f 115Summary(pl.UTF-8): Dokumentacja API LLVM-a
9556f4c9
ER
116Group: Development/Languages
117Requires: %{name}-doc = %{version}-%{release}
bc88141a 118
9556f4c9
ER
119%description apidocs
120API documentation for the LLVM compiler infrastructure.
bc88141a 121
621ec11f
JB
122%description apidocs -l pl.UTF-8
123Dokumentacja API infrastruktury kompilatorów LLVM.
124
d997b14b
AM
125%package -n clang
126Summary: A C language family frontend for LLVM
621ec11f 127Summary(pl.UTF-8): Frontend LLVM-a do języków z rodziny C
d997b14b
AM
128License: NCSA
129Group: Development/Languages
130
131%description -n clang
132clang: noun 1. A loud, resonant, metallic sound. 2. The strident call
133of a crane or goose. 3. C-language family front-end toolkit.
134
135The goal of the Clang project is to create a new C, C++, Objective C
136and Objective C++ front-end for the LLVM compiler. Its tools are built
137as libraries and designed to be loosely-coupled and extendable.
138
621ec11f
JB
139%description -n clang -l pl.UTF-8
140clang (z angielskiego): 1. głośny, rezonujący, metaliczny dźwięk; 2.
141piskliwy odgłos żurawia lub gęsi; 3. narzędzia frontendowe dla języków
142z rodziny C.
143
144Celem projektu Clang jest utworzenie nowego frontendu dla kompilatora
145LLVM do języków C, C++, Objective C i Objective C++. Narzędzia są
146budowane jako biblioteki i zaprojektowane z myślą o swobodnym łączeniu
147i rozszerzaniu.
148
d997b14b
AM
149%package -n clang-analyzer
150Summary: A source code analysis framework
621ec11f 151Summary(pl.UTF-8): Szkielet do analizy kodu źródłowego
d997b14b
AM
152License: NCSA
153Group: Development/Languages
154Requires: clang = %{version}-%{release}
155# not picked up automatically since files are currently not instaled
156# in standard Python hierarchies yet
157Requires: python
158
159%description -n clang-analyzer
160The Clang Static Analyzer consists of both a source code analysis
161framework and a standalone tool that finds bugs in C and Objective-C
162programs. The standalone tool is invoked from the command-line, and is
163intended to run in tandem with a build of a project or code base.
164
621ec11f
JB
165%description -n clang-analyzer -l pl.UTF-8
166Clang Static Analyzer składa się ze szkieletu do analizy kodu
167źródłowego oraz samodzielnego narzędzia znajdującego błędy w
168programach w C i C++. Narzędzie jest wywoływane z linii poleceń, z
169myślą o uruchamianiu wraz z kompilacją projektu lub kodu.
170
9556f4c9 171%package -n clang-devel
621ec11f
JB
172Summary: Header files for Clang
173Summary(pl.UTF-8): Pliki nagłówkowe Clanga
9556f4c9
ER
174Group: Development/Languages
175Requires: clang = %{version}-%{release}
176
177%description -n clang-devel
178This package contains header files for the Clang compiler.
179
621ec11f
JB
180%description -n clang-devel -l pl.UTF-8
181Ten pakiet zawiera pliki nagłówkowe kompilatora Clang.
182
9556f4c9
ER
183%package -n clang-doc
184Summary: Documentation for Clang
621ec11f 185Summary(pl.UTF-8): Dokumentacja do Clanga
9556f4c9
ER
186Group: Documentation
187Requires: %{name} = %{version}-%{release}
188
189%description -n clang-doc
190Documentation for the Clang compiler front-end.
191
621ec11f
JB
192%description -n clang-doc -l pl.UTF-8
193Dokumentacja do frontendu kompilatora Clang.
194
9556f4c9
ER
195%package -n clang-apidocs
196Summary: API documentation for Clang
621ec11f 197Summary(pl.UTF-8): Dokumentacja API Clanga
9556f4c9
ER
198Group: Development/Languages
199Requires: clang-doc = %{version}-%{release}
200
201%description -n clang-apidocs
202API documentation for the Clang compiler.
203
621ec11f
JB
204%description -n clang-apidocs -l pl.UTF-8
205Dokumentacja API kompilatora Clang.
206
9556f4c9
ER
207%package ocaml
208Summary: OCaml binding for LLVM
621ec11f
JB
209Summary(pl.UTF-8): Wiązanie OCamla do LLVM-a
210Group: Libraries
9556f4c9
ER
211Requires: %{name} = %{version}-%{release}
212%requires_eq ocaml-runtime
213
621ec11f 214%description ocaml
9556f4c9
ER
215OCaml binding for LLVM.
216
621ec11f
JB
217%description ocaml -l pl.UTF-8
218Wiązanie OCamla do LLVM-a.
219
9556f4c9 220%package ocaml-devel
621ec11f
JB
221Summary: Development files for LLVM OCaml binding
222Summary(pl.UTF-8): Pliki programistyczne wiązania OCamla do LLVM-a
9556f4c9
ER
223Group: Development/Libraries
224Requires: %{name}-devel = %{version}-%{release}
225Requires: %{name}-ocaml = %{version}-%{release}
226
227%description ocaml-devel
228The llvm-ocaml-devel package contains libraries and signature files
621ec11f
JB
229for developing applications that use llvm-ocaml binding.
230
231%description ocaml-devel -l pl.UTF-8
232Ten pakiet zawiera biblioteki i pliki sygnatur do tworzenia aplikacji
233wykorzystujących wiązanie llvm-ocaml.
234
9556f4c9
ER
235
236%package ocaml-doc
237Summary: Documentation for LLVM's OCaml binding
621ec11f 238Summary(pl.UTF-8): Dokumentacja wiązania OCamla do LLVM-a
9556f4c9
ER
239Group: Documentation
240Requires: %{name}-ocaml = %{version}-%{release}
241
242%description ocaml-doc
243HTML documentation for LLVM's OCaml binding.
244
621ec11f
JB
245%description ocaml-doc -l pl.UTF-8
246Dokumentacja HTML wiązania OCamla do LLVM-a.
247
aa11c230 248%prep
827664e9 249%setup -q -a1 -n %{name}-%{version}.src
d997b14b 250mv clang-*.* tools/clang
ebde279d
JB
251%patch0 -p1
252%patch1 -p1
253%patch2 -p1
ce9cc204 254
19f21eee
PS
255# configure does not properly specify libdir
256sed -i 's|(PROJ_prefix)/lib|(PROJ_prefix)/%{_lib}|g' Makefile.config.in
493e5485 257sed -i 's|(PROJ_prefix)/lib/|(PROJ_prefix)/%{_lib}/|g' tools/clang/lib/Headers/Makefile
19f21eee 258
bacc8b96
ER
259grep -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
9556f4c9 264install -d obj
aa11c230 265
266%build
ebde279d
JB
267cd autoconf
268%{__aclocal} -I m4
269%{__autoconf} -o ../configure configure.ac
270cd ..
271%{__autoheader} -I autoconf -I autoconf/m4 autoconf/configure.ac
272
d997b14b 273# Disabling assertions now, rec. by pure and needed for OpenGTL
9556f4c9 274# TESTFIX no PIC on ix86: http://llvm.org/bugs/show_bug.cgi?id=3801
d997b14b 275#
bc88141a 276# bash specific 'test a < b'
9556f4c9 277cd obj
d997b14b 278bash ../%configure \
bc88141a 279 --datadir=%{_datadir}/%{name}-%{version} \
632f3287 280 --disable-assertions \
d997b14b 281%ifarch %{ix86}
632f3287 282 --disable-pic \
9556f4c9 283%endif
632f3287
JB
284 --disable-static \
285 --enable-bindings=%{?with_ocaml:ocaml}%{!?with_ocaml:none} \
286 --enable-debug-runtime \
9556f4c9
ER
287%if %{with apidocs}
288 --enable-doxygen \
d997b14b 289%endif
bc88141a 290 --enable-jit \
aa11c230 291 --enable-optimized \
bc88141a
ER
292 --enable-shared \
293 --with-pic
294
d997b14b 295%{__make} \
0a0b7076 296 REQUIRES_RTTI=1 \
d997b14b 297 OPTIMIZE_OPTION="%{rpmcflags} %{rpmcppflags}"
aa11c230 298
827664e9 299%if %{with tests}
9556f4c9
ER
300%{__make} check 2>&1 | tee llvm-testlog.txt
301%{__make} -C tools/clang test 2>&1 | tee clang-testlog.txt
302%endif
303
aa11c230 304%install
305rm -rf $RPM_BUILD_ROOT
9556f4c9 306%{__make} -C obj -j1 install \
d997b14b 307 PROJ_docsdir=/moredocs \
aa11c230 308 DESTDIR=$RPM_BUILD_ROOT
309
d997b14b 310# Static analyzer not installed by default:
9556f4c9
ER
311# http://clang-analyzer.llvm.org/installation#OtherPlatforms
312install -d $RPM_BUILD_ROOT%{_libdir}/clang-analyzer
d997b14b
AM
313# create launchers
314for f in scan-{build,view}; do
9556f4c9
ER
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
d997b14b 317done
8132e62b
JB
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
d997b14b 321
d997b14b 322# Move documentation back to build directory
d997b14b
AM
323rm -rf moredocs
324mv $RPM_BUILD_ROOT/moredocs .
ebde279d
JB
325%{__rm} -v moredocs/*.tar.gz
326%{__rm} -v moredocs/ocamldoc/html/*.tar.gz
9556f4c9
ER
327
328# and separate the apidoc
329%if %{with apidocs}
330rm -rf apidoc clang-apidoc
331mv moredocs/html/doxygen apidoc
332cp -a tools/clang/docs/doxygen/html clang-apidoc
333%endif
d997b14b
AM
334
335# And prepare Clang documentation
d997b14b 336rm -rf clang-docs
9556f4c9 337install -d clang-docs
827664e9 338for f in LICENSE.TXT NOTES.txt README.txt; do
9556f4c9 339 ln tools/clang/$f clang-docs
d997b14b 340done
021b3c3d 341
6832a5c5 342# Get rid of erroneously installed example files.
ebde279d 343%{__rm} -v $RPM_BUILD_ROOT%{_libdir}/*LLVMHello.*
6832a5c5 344
d997b14b
AM
345# remove documentation makefiles:
346# they require the build directory to work
9556f4c9
ER
347rm -rf moredocs/examples
348cp -a examples moredocs/examples
349find moredocs/examples -name Makefile | xargs -0r rm -f
6832a5c5 350
aa11c230 351%clean
352rm -rf $RPM_BUILD_ROOT
353
2326a99f
JB
354%post -p /sbin/ldconfig
355%postun -p /sbin/ldconfig
aa11c230 356
357%files
358%defattr(644,root,root,755)
8132e62b 359%doc CREDITS.TXT LICENSE.TXT README.txt %{?with_tests:llvm-testlog.txt}
a9beeab5 360%attr(755,root,root) %{_bindir}/bugpoint
a9beeab5
JB
361%attr(755,root,root) %{_bindir}/llc
362%attr(755,root,root) %{_bindir}/lli
8132e62b
JB
363%attr(755,root,root) %{_bindir}/llvm-ar
364%attr(755,root,root) %{_bindir}/llvm-as
365%attr(755,root,root) %{_bindir}/llvm-bcanalyzer
827664e9 366%attr(755,root,root) %{_bindir}/llvm-cov
8132e62b
JB
367%attr(755,root,root) %{_bindir}/llvm-diff
368%attr(755,root,root) %{_bindir}/llvm-dis
827664e9 369%attr(755,root,root) %{_bindir}/llvm-dwarfdump
8132e62b
JB
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
f981d747 378%attr(755,root,root) %{_bindir}/llvm-readobj
827664e9
PS
379%attr(755,root,root) %{_bindir}/llvm-rtdyld
380%attr(755,root,root) %{_bindir}/llvm-size
f981d747 381%attr(755,root,root) %{_bindir}/llvm-stress
8132e62b 382%attr(755,root,root) %{_bindir}/llvm-stub
827664e9 383%attr(755,root,root) %{_bindir}/llvm-tblgen
a7973f21 384%attr(755,root,root) %{_bindir}/macho-dump
8132e62b
JB
385%attr(755,root,root) %{_bindir}/opt
386%attr(755,root,root) %{_libdir}/libLLVM-%{version}.so
a9beeab5 387%{_mandir}/man1/bugpoint.1*
a7973f21 388%{_mandir}/man1/lit.1*
a9beeab5
JB
389%{_mandir}/man1/llc.1*
390%{_mandir}/man1/lli.1*
8132e62b
JB
391%{_mandir}/man1/llvm-ar.1*
392%{_mandir}/man1/llvm-as.1*
393%{_mandir}/man1/llvm-bcanalyzer.1*
f981d747 394%{_mandir}/man1/llvm-cov.1*
8132e62b
JB
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*
f981d747 403%{_mandir}/man1/llvm-stress.1*
a9beeab5 404%{_mandir}/man1/opt.1*
bc88141a 405
bc88141a
ER
406%files devel
407%defattr(644,root,root,755)
408%attr(755,root,root) %{_bindir}/llvm-config
827664e9 409%attr(755,root,root) %{_libdir}/libprofile_rt.so
8132e62b 410%{_libdir}/libLLVM*.a
827664e9 411%{_libdir}/libprofile_rt.a
1655c8b5 412%ifarch %{x8664}
0a8510f2 413%attr(755,root,root) %{_libdir}/BugpointPasses.so
19f21eee 414%attr(755,root,root) %{_libdir}/libLTO.so
8132e62b 415%{_libdir}/libLTO.a
1655c8b5 416%endif
8132e62b
JB
417%{_includedir}/llvm
418%{_includedir}/llvm-c
419%{_mandir}/man1/llvm-config.1*
bc88141a 420
9556f4c9
ER
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
d997b14b 431%files -n clang
bc88141a 432%defattr(644,root,root,755)
827664e9 433%doc clang-docs/{LICENSE.TXT,NOTES.txt,README.txt} %{?with_tests:clang-testlog.txt}
8132e62b
JB
434%attr(755,root,root) %{_bindir}/clang
435%attr(755,root,root) %{_bindir}/clang++
827664e9 436%attr(755,root,root) %{_bindir}/clang-tblgen
b3a27ca2 437%attr(755,root,root) %{_libdir}/libclang.so
493e5485 438%{_libdir}/clang
8132e62b 439%{_mandir}/man1/clang.1*
b3a27ca2 440%{_mandir}/man1/tblgen.1*
d997b14b
AM
441
442%files -n clang-analyzer
bc88141a 443%defattr(644,root,root,755)
d997b14b
AM
444%attr(755,root,root) %{_bindir}/scan-build
445%attr(755,root,root) %{_bindir}/scan-view
ae49e501 446%dir %{_libdir}/clang-analyzer
d997b14b 447
9556f4c9
ER
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
8132e62b
JB
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
9556f4c9
ER
459%files -n clang-devel
460%defattr(644,root,root,755)
8132e62b 461%{_libdir}/libclang*.a
9556f4c9
ER
462%{_includedir}/clang
463%{_includedir}/clang-c
464
465%files -n clang-doc
466%defattr(644,root,root,755)
8132e62b 467%doc tools/clang/docs/*.{css,html,png,txt}
9556f4c9
ER
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}
d997b14b
AM
476%files ocaml
477%defattr(644,root,root,755)
bc8a0b58 478%{_libdir}/ocaml/META.llvm
8132e62b
JB
479%{_libdir}/ocaml/llvm*.cma
480%{_libdir}/ocaml/llvm*.cmi
d997b14b
AM
481
482%files ocaml-devel
483%defattr(644,root,root,755)
bc8a0b58 484%{_libdir}/libllvm*.a
8132e62b
JB
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
9556f4c9
ER
490
491%files ocaml-doc
492%defattr(644,root,root,755)
493%doc moredocs/ocamldoc/html/*
494%endif
This page took 0.146085 seconds and 4 git commands to generate.