]>
Commit | Line | Data |
---|---|---|
bc88141a | 1 | # TODO |
9556f4c9 ER |
2 | #warning: Installed (but unpackaged) file(s) found: |
3 | # /usr/share/man/man1/lit.1.gz | |
bc88141a | 4 | # |
9556f4c9 ER |
5 | # Conditional build: |
6 | %bcond_without ocaml # ocaml binding | |
7 | %bcond_with apidocs # The doxygen docs are HUGE, so they are not built by default. | |
8 | %bcond_with tests # run tests | |
9 | ||
10 | %ifarch s390 s390x sparc64 | |
11 | # No ocaml on these arches | |
12 | %undefine with_ocaml | |
13 | %endif | |
14 | ||
aa11c230 | 15 | Summary: The Low Level Virtual Machine (An Optimizing Compiler Infrastructure) |
2326a99f | 16 | Summary(pl.UTF-8): Niskopoziomowa maszyna wirtualna (infrastruktura kompilatora optymalizującego) |
aa11c230 | 17 | Name: llvm |
a7973f21 | 18 | Version: 2.9 |
0acc46f3 | 19 | Release: 2 |
aa11c230 | 20 | License: University of Illinois/NCSA Open Source License |
21 | Group: Development/Languages | |
7e30fbbc | 22 | Source0: http://llvm.org/releases/%{version}/%{name}-%{version}.tgz |
a7973f21 | 23 | # Source0-md5: 793138412d2af2c7c7f54615f8943771 |
9556f4c9 | 24 | Source1: http://llvm.org/releases/%{version}/clang-%{version}.tgz |
a7973f21 | 25 | # Source1-md5: 634de18d04b7a4ded19ec4c17d23cfca |
d997b14b AM |
26 | # Data files should be installed with timestamps preserved |
27 | Patch3: %{name}-2.6-timestamp.patch | |
ce9cc204 | 28 | Patch4: %{name}-pld.patch |
2326a99f | 29 | URL: http://llvm.org/ |
bc88141a | 30 | BuildRequires: bash |
d997b14b | 31 | BuildRequires: bison |
d997b14b | 32 | BuildRequires: flex |
9556f4c9 ER |
33 | %if %{with apidocs} |
34 | BuildRequires: doxygen | |
d997b14b | 35 | BuildRequires: graphviz |
9556f4c9 ER |
36 | %endif |
37 | %if %{with tests} | |
38 | BuildRequires: dejagnu | |
39 | BuildRequires: python | |
40 | BuildRequires: tcl-devel | |
41 | %endif | |
d997b14b | 42 | BuildRequires: groff |
bc88141a | 43 | BuildRequires: libltdl-devel |
d997b14b AM |
44 | BuildRequires: libstdc++-devel >= 5:3.4 |
45 | BuildRequires: ocaml-ocamldoc | |
8c156e7d | 46 | BuildRequires: perl-tools-pod |
47 | BuildRequires: rpm-pythonprov | |
356a0bbd ER |
48 | # gcc4 might be installed, but not current __cc |
49 | %if "%(echo %{cc_version} | cut -d. -f1,2)" < "3.4" | |
50 | BuildRequires: __cc >= 3.4 | |
51 | %endif | |
9556f4c9 ER |
52 | # LLVM is not supported on PPC64 |
53 | # http://llvm.org/bugs/show_bug.cgi?id=3729 | |
54 | ExcludeArch: ppc64 | |
aa11c230 | 55 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
56 | ||
356a0bbd | 57 | %define _sysconfdir /etc/%{name} |
021b3c3d | 58 | |
9556f4c9 ER |
59 | %define specflags_ppc -fno-var-tracking-assignments |
60 | ||
6832a5c5 ER |
61 | # strip corrupts: $RPM_BUILD_ROOT/usr/lib64/llvm-gcc/bin/llvm-c++ ... |
62 | %define _noautostrip .*/\\(libmud.*\\.a\\|bin/llvm-.*\\|lib.*++\\.a\\) | |
63 | ||
aa11c230 | 64 | %description |
65 | LLVM is a compiler infrastructure designed for compile-time, | |
66 | link-time, runtime, and idle-time optimization of programs from | |
67 | arbitrary programming languages. LLVM is written in C++ and has been | |
68 | developed since 2000 at the University of Illinois and Apple. It | |
69 | currently supports compilation of C and C++ programs, using front-ends | |
70 | derived from GCC 4.0.1. A new front-end for the C family of languages | |
71 | is in development. The compiler infrastructure includes mirror sets of | |
72 | programming tools as well as libraries with equivalent functionality. | |
73 | ||
2326a99f JB |
74 | %description -l pl.UTF-8 |
75 | LLVM to infrastruktura kompilatora zaprojektowana do optymalizacji | |
76 | czasu kompilowania, linkowania, działania i bezczynności programów w | |
77 | dowolnych językach programowania. Jest napisana w C++, rozwijana od | |
78 | roku 2000 przez Uniwersytet w Illinois i Apple. Aktualnie obsługuje | |
79 | kompilację programów w C i C++ przy użyciu frontendów wywodzących się | |
80 | z GCC 4.0.1. W trakcie tworzenia jest nowy frontend do języków z | |
81 | rodziny C. Infrastruktura kompilatora zawiera lustrzane zestawy | |
82 | narzędzi programistycznych oraz biblioteki z odpowiadającą narzędziom | |
83 | funkcjonalnością. | |
84 | ||
bc88141a ER |
85 | %package devel |
86 | Summary: Libraries and header files for LLVM | |
87 | Group: Development/Languages | |
88 | Requires: %{name} = %{version}-%{release} | |
89 | Requires: libstdc++-devel >= 6:3.4 | |
90 | ||
91 | %description devel | |
92 | This package contains library and header files needed to develop new | |
93 | native programs that use the LLVM infrastructure. | |
94 | ||
9556f4c9 ER |
95 | %package doc |
96 | Summary: Documentation for LLVM | |
97 | Group: Documentation | |
98 | # does not require base | |
bc88141a | 99 | |
9556f4c9 ER |
100 | %description doc |
101 | Documentation for the LLVM compiler infrastructure. | |
bc88141a | 102 | |
9556f4c9 ER |
103 | %package apidocs |
104 | Summary: API documentation for LLVM | |
105 | Group: Development/Languages | |
106 | Requires: %{name}-doc = %{version}-%{release} | |
bc88141a | 107 | |
9556f4c9 ER |
108 | %description apidocs |
109 | API documentation for the LLVM compiler infrastructure. | |
bc88141a | 110 | |
d997b14b AM |
111 | %package -n clang |
112 | Summary: A C language family frontend for LLVM | |
113 | License: NCSA | |
114 | Group: Development/Languages | |
115 | ||
116 | %description -n clang | |
117 | clang: noun 1. A loud, resonant, metallic sound. 2. The strident call | |
118 | of a crane or goose. 3. C-language family front-end toolkit. | |
119 | ||
120 | The goal of the Clang project is to create a new C, C++, Objective C | |
121 | and Objective C++ front-end for the LLVM compiler. Its tools are built | |
122 | as libraries and designed to be loosely-coupled and extendable. | |
123 | ||
124 | %package -n clang-analyzer | |
125 | Summary: A source code analysis framework | |
126 | License: NCSA | |
127 | Group: Development/Languages | |
128 | Requires: clang = %{version}-%{release} | |
129 | # not picked up automatically since files are currently not instaled | |
130 | # in standard Python hierarchies yet | |
131 | Requires: python | |
132 | ||
133 | %description -n clang-analyzer | |
134 | The Clang Static Analyzer consists of both a source code analysis | |
135 | framework and a standalone tool that finds bugs in C and Objective-C | |
136 | programs. The standalone tool is invoked from the command-line, and is | |
137 | intended to run in tandem with a build of a project or code base. | |
138 | ||
9556f4c9 ER |
139 | %package -n clang-devel |
140 | Summary: Header files for clang | |
141 | Group: Development/Languages | |
142 | Requires: clang = %{version}-%{release} | |
143 | ||
144 | %description -n clang-devel | |
145 | This package contains header files for the Clang compiler. | |
146 | ||
147 | %package -n clang-doc | |
148 | Summary: Documentation for Clang | |
149 | Group: Documentation | |
150 | Requires: %{name} = %{version}-%{release} | |
151 | ||
152 | %description -n clang-doc | |
153 | Documentation for the Clang compiler front-end. | |
154 | ||
155 | %package -n clang-apidocs | |
156 | Summary: API documentation for Clang | |
157 | Group: Development/Languages | |
158 | Requires: clang-doc = %{version}-%{release} | |
159 | ||
160 | %description -n clang-apidocs | |
161 | API documentation for the Clang compiler. | |
162 | ||
163 | %package ocaml | |
164 | Summary: OCaml binding for LLVM | |
165 | Group: Development/Libraries | |
166 | Requires: %{name} = %{version}-%{release} | |
167 | %requires_eq ocaml-runtime | |
168 | ||
169 | %description ocaml | |
170 | OCaml binding for LLVM. | |
171 | ||
172 | %package ocaml-devel | |
173 | Summary: Development files for %{name}-ocaml | |
174 | Group: Development/Libraries | |
175 | Requires: %{name}-devel = %{version}-%{release} | |
176 | Requires: %{name}-ocaml = %{version}-%{release} | |
177 | ||
178 | %description ocaml-devel | |
179 | The llvm-ocaml-devel package contains libraries and signature files | |
180 | for developing applications that use llvm-ocaml. | |
181 | ||
182 | %package ocaml-doc | |
183 | Summary: Documentation for LLVM's OCaml binding | |
184 | Group: Documentation | |
185 | Requires: %{name}-ocaml = %{version}-%{release} | |
186 | ||
187 | %description ocaml-doc | |
188 | HTML documentation for LLVM's OCaml binding. | |
189 | ||
aa11c230 | 190 | %prep |
d997b14b AM |
191 | %setup -q -a1 |
192 | mv clang-*.* tools/clang | |
9556f4c9 | 193 | %patch3 -p1 |
ce9cc204 | 194 | %patch4 -p1 |
195 | ||
196 | sed -i 's|triplet-plox-here|%{_host}|' tools/clang/lib/Driver/ToolChains.cpp | |
9556f4c9 | 197 | |
19f21eee PS |
198 | # configure does not properly specify libdir |
199 | sed -i 's|(PROJ_prefix)/lib|(PROJ_prefix)/%{_lib}|g' Makefile.config.in | |
200 | ||
bacc8b96 ER |
201 | grep -rl /usr/bin/env tools utils | xargs sed -i -e '1{ |
202 | s,^#!.*bin/env python,#!%{__python}, | |
203 | s,^#!.*bin/env perl,#!%{__perl}, | |
204 | }' | |
205 | ||
9556f4c9 | 206 | install -d obj |
aa11c230 | 207 | |
208 | %build | |
d997b14b | 209 | # Disabling assertions now, rec. by pure and needed for OpenGTL |
9556f4c9 | 210 | # TESTFIX no PIC on ix86: http://llvm.org/bugs/show_bug.cgi?id=3801 |
d997b14b | 211 | # |
bc88141a | 212 | # bash specific 'test a < b' |
9556f4c9 | 213 | cd obj |
d997b14b | 214 | bash ../%configure \ |
bc88141a ER |
215 | --libdir=%{_libdir}/%{name} \ |
216 | --datadir=%{_datadir}/%{name}-%{version} \ | |
d997b14b AM |
217 | %ifarch %{ix86} |
218 | --enable-pic=no \ | |
9556f4c9 ER |
219 | %endif |
220 | %if %{with apidocs} | |
221 | --enable-doxygen \ | |
d997b14b | 222 | %endif |
bc88141a | 223 | --disable-static \ |
d997b14b | 224 | --disable-assertions \ |
bc88141a ER |
225 | --enable-debug-runtime \ |
226 | --enable-jit \ | |
aa11c230 | 227 | --enable-optimized \ |
bc88141a ER |
228 | --enable-shared \ |
229 | --with-pic | |
230 | ||
d997b14b | 231 | %{__make} \ |
0a0b7076 | 232 | REQUIRES_RTTI=1 \ |
d997b14b | 233 | OPTIMIZE_OPTION="%{rpmcflags} %{rpmcppflags}" |
aa11c230 | 234 | |
9556f4c9 ER |
235 | %if %{with test} |
236 | %{__make} check 2>&1 | tee llvm-testlog.txt | |
237 | %{__make} -C tools/clang test 2>&1 | tee clang-testlog.txt | |
238 | %endif | |
239 | ||
aa11c230 | 240 | %install |
241 | rm -rf $RPM_BUILD_ROOT | |
9556f4c9 | 242 | %{__make} -C obj -j1 install \ |
d997b14b | 243 | PROJ_docsdir=/moredocs \ |
aa11c230 | 244 | DESTDIR=$RPM_BUILD_ROOT |
245 | ||
d997b14b | 246 | # Static analyzer not installed by default: |
9556f4c9 ER |
247 | # http://clang-analyzer.llvm.org/installation#OtherPlatforms |
248 | install -d $RPM_BUILD_ROOT%{_libdir}/clang-analyzer | |
d997b14b AM |
249 | # create launchers |
250 | for f in scan-{build,view}; do | |
9556f4c9 ER |
251 | ln -s %{_libdir}/clang-analyzer/$f/$f $RPM_BUILD_ROOT%{_bindir}/$f |
252 | cp -pr tools/clang/tools/$f $RPM_BUILD_ROOT%{_libdir}/clang-analyzer | |
d997b14b AM |
253 | done |
254 | ||
d997b14b | 255 | # Move documentation back to build directory |
d997b14b AM |
256 | rm -rf moredocs |
257 | mv $RPM_BUILD_ROOT/moredocs . | |
9556f4c9 ER |
258 | rm -fv moredocs/*.tar.gz |
259 | rm -fv moredocs/ocamldoc/html/*.tar.gz | |
260 | ||
261 | # and separate the apidoc | |
262 | %if %{with apidocs} | |
263 | rm -rf apidoc clang-apidoc | |
264 | mv moredocs/html/doxygen apidoc | |
265 | cp -a tools/clang/docs/doxygen/html clang-apidoc | |
266 | %endif | |
d997b14b AM |
267 | |
268 | # And prepare Clang documentation | |
d997b14b | 269 | rm -rf clang-docs |
9556f4c9 | 270 | install -d clang-docs |
d997b14b | 271 | for f in LICENSE.TXT NOTES.txt README.txt TODO.txt; do |
9556f4c9 | 272 | ln tools/clang/$f clang-docs |
d997b14b | 273 | done |
021b3c3d | 274 | |
6832a5c5 | 275 | # Get rid of erroneously installed example files. |
19f21eee | 276 | rm -v $RPM_BUILD_ROOT%{_libdir}/*LLVMHello.* |
6832a5c5 | 277 | |
d997b14b | 278 | # FIXME file this bug |
19f21eee | 279 | sed -i 's,ABS_RUN_DIR/lib",ABS_RUN_DIR/%{_lib}",' \ |
d997b14b | 280 | $RPM_BUILD_ROOT%{_bindir}/llvm-config |
6832a5c5 | 281 | |
d997b14b AM |
282 | # remove documentation makefiles: |
283 | # they require the build directory to work | |
9556f4c9 ER |
284 | rm -rf moredocs/examples |
285 | cp -a examples moredocs/examples | |
286 | find moredocs/examples -name Makefile | xargs -0r rm -f | |
6832a5c5 | 287 | |
aa11c230 | 288 | %clean |
289 | rm -rf $RPM_BUILD_ROOT | |
290 | ||
2326a99f JB |
291 | %post -p /sbin/ldconfig |
292 | %postun -p /sbin/ldconfig | |
aa11c230 | 293 | |
294 | %files | |
295 | %defattr(644,root,root,755) | |
bc88141a | 296 | %doc CREDITS.TXT LICENSE.TXT README.txt |
9556f4c9 | 297 | %{?with_tests:%doc llvm-testlog.txt} |
a9beeab5 | 298 | %attr(755,root,root) %{_bindir}/bugpoint |
a9beeab5 JB |
299 | %attr(755,root,root) %{_bindir}/llc |
300 | %attr(755,root,root) %{_bindir}/lli | |
a9beeab5 | 301 | %attr(755,root,root) %{_bindir}/opt |
a8575aac | 302 | %attr(755,root,root) %{_bindir}/llvmc |
bc88141a | 303 | %attr(755,root,root) %{_bindir}/llvm-* |
a7973f21 | 304 | %attr(755,root,root) %{_bindir}/macho-dump |
bc88141a | 305 | %exclude %attr(755,root,root) %{_bindir}/llvm-config |
b3a27ca2 | 306 | %attr(755,root,root) %{_libdir}/libLLVM-*.*.so |
a9beeab5 | 307 | %{_mandir}/man1/bugpoint.1* |
a7973f21 | 308 | %{_mandir}/man1/lit.1* |
a9beeab5 JB |
309 | %{_mandir}/man1/llc.1* |
310 | %{_mandir}/man1/lli.1* | |
311 | %{_mandir}/man1/llvm-*.1* | |
a7973f21 | 312 | %{_mandir}/man1/llvmc.1* |
a9beeab5 JB |
313 | %{_mandir}/man1/llvmgcc.1* |
314 | %{_mandir}/man1/llvmgxx.1* | |
315 | %{_mandir}/man1/opt.1* | |
a8575aac | 316 | #%{_mandir}/man1/stkrc.1* |
bc88141a | 317 | |
bc88141a ER |
318 | %files devel |
319 | %defattr(644,root,root,755) | |
320 | %attr(755,root,root) %{_bindir}/llvm-config | |
321 | %{_includedir}/llvm | |
322 | %{_includedir}/llvm-c | |
19f21eee | 323 | %{_libdir}/lib*.a |
1655c8b5 PS |
324 | # x86-64 only .a/.so? |
325 | %ifarch %{x8664} | |
0a8510f2 | 326 | %attr(755,root,root) %{_libdir}/BugpointPasses.so |
19f21eee | 327 | %attr(755,root,root) %{_libdir}/libEnhancedDisassembly.so |
19f21eee | 328 | %attr(755,root,root) %{_libdir}/libLTO.so |
1655c8b5 PS |
329 | %endif |
330 | # | |
331 | %exclude %attr(755,root,root) %{_libdir}/libLLVM-*.*.so | |
b3a27ca2 | 332 | %exclude %attr(755,root,root) %{_libdir}/libclang.so |
a7973f21 | 333 | %attr(755,root,root) %{_libdir}/profile_rt.so |
bc88141a | 334 | |
9556f4c9 ER |
335 | %files doc |
336 | %defattr(644,root,root,755) | |
337 | %doc moredocs/examples moredocs/html | |
338 | ||
339 | %if %{with apidocs} | |
340 | %files apidocs | |
341 | %defattr(644,root,root,755) | |
342 | %doc apidoc/* | |
343 | %endif | |
344 | ||
d997b14b | 345 | %files -n clang |
bc88141a | 346 | %defattr(644,root,root,755) |
d997b14b | 347 | %doc clang-docs/* |
9556f4c9 | 348 | %{?with_tests:%doc clang-testlog.txt} |
d997b14b | 349 | %attr(755,root,root) %{_bindir}/clang* |
d997b14b | 350 | %attr(755,root,root) %{_bindir}/tblgen |
b3a27ca2 | 351 | %attr(755,root,root) %{_libdir}/libclang.so |
d997b14b | 352 | %{_prefix}/lib/clang |
d997b14b | 353 | %{_mandir}/man1/clang.1.* |
b3a27ca2 | 354 | %{_mandir}/man1/tblgen.1* |
d997b14b AM |
355 | |
356 | %files -n clang-analyzer | |
bc88141a | 357 | %defattr(644,root,root,755) |
d997b14b AM |
358 | %attr(755,root,root) %{_bindir}/scan-build |
359 | %attr(755,root,root) %{_bindir}/scan-view | |
ae49e501 | 360 | %dir %{_libdir}/clang-analyzer |
d997b14b | 361 | |
9556f4c9 ER |
362 | %dir %{_libdir}/clang-analyzer/scan-view |
363 | %attr(755,root,root) %{_libdir}/clang-analyzer/scan-view/scan-view | |
364 | %{_libdir}/clang-analyzer/scan-view/Resources | |
365 | %{_libdir}/clang-analyzer/scan-view/*.py | |
366 | ||
367 | %dir %{_libdir}/clang-analyzer/scan-build | |
368 | %{_libdir}/clang-analyzer/scan-build/*.css | |
369 | %{_libdir}/clang-analyzer/scan-build/*.js | |
370 | %attr(755,root,root) %{_libdir}/clang-analyzer/scan-build/scan-build | |
371 | %attr(755,root,root) %{_libdir}/clang-analyzer/scan-build/*-analyzer | |
372 | ||
373 | %files -n clang-devel | |
374 | %defattr(644,root,root,755) | |
375 | %{_includedir}/clang | |
376 | %{_includedir}/clang-c | |
377 | ||
378 | %files -n clang-doc | |
379 | %defattr(644,root,root,755) | |
380 | %doc tools/clang/docs/* | |
381 | ||
382 | %if %{with apidocs} | |
383 | %files -n clang-apidocs | |
384 | %defattr(644,root,root,755) | |
385 | %doc clang-apidoc/* | |
386 | %endif | |
387 | ||
388 | %if %{with ocaml} | |
d997b14b AM |
389 | %files ocaml |
390 | %defattr(644,root,root,755) | |
d997b14b AM |
391 | %{_libdir}/ocaml/*.cma |
392 | %{_libdir}/ocaml/*.cmi | |
393 | ||
394 | %files ocaml-devel | |
395 | %defattr(644,root,root,755) | |
396 | %{_libdir}/ocaml/*.a | |
397 | %{_libdir}/ocaml/*.cmx* | |
398 | %{_libdir}/ocaml/*.mli | |
9556f4c9 ER |
399 | |
400 | %files ocaml-doc | |
401 | %defattr(644,root,root,755) | |
402 | %doc moredocs/ocamldoc/html/* | |
403 | %endif |