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