source: projects/specs/trunk/l/llvm/llvm-vl.spec @ 5555

Revision 5555, 15.1 KB checked in by kenta, 12 years ago (diff)

llvm: updated to 3.0 release

Line 
1# Build options:
2#
3# --with doxygen
4#   The doxygen docs are HUGE, so they are not built by default.
5%define build_apidoc %{?_with_doxygen:1}%{!?_with_doxygen:0}
6
7Name:           llvm
8Version:        3.0
9Release:        1%{?_dist_release}
10Summary:        The Low Level Virtual Machine
11Summary(ja):    LLVM - 低レベルバーチャルマシン
12
13Group:          Development/Languages
14License:        NCSA
15URL:            http://llvm.org/
16Source0:        http://llvm.org/releases/%{version}/llvm-%{version}.tar.gz
17Source1:        http://llvm.org/releases/%{version}/clang-%{version}.tar.gz
18# multilib fixes
19Source2:        llvm-Config-config.h
20Source3:        llvm-Config-llvm-config.h
21
22# Data files should be installed with timestamps preserved
23Patch0:         llvm-2.6-timestamp.patch
24# workaround for http://llvm.org/bugs/show_bug.cgi?id=11177
25Patch1:         llvm-3.0-fix11177.patch
26# fix bug 9798 - Linker flags fail / can't find crtbegin.o
27# http://llvm.org/bugs/show_bug.cgi?id=9798
28Patch2:         clang-3.0-fix9798.patch
29# Vine Patch
30Patch3:         llvm-3.0-fixLLVMgold.patch     
31Patch4:         clang-3.0-driver-ld.gold.patch
32Patch5:         clang-3.0-driver-lib64.patch
33
34BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
35
36BuildRequires:  binutils-devel
37BuildRequires:  bison
38BuildRequires:  chrpath
39BuildRequires:  flex
40BuildRequires:  gcc-c++ >= 3.4
41BuildRequires:  groff
42BuildRequires:  libffi-devel
43BuildRequires:  libtool-ltdl-devel
44BuildRequires:  ocaml
45# for DejaGNU test suite
46BuildRequires:  dejagnu tcl python
47%if %{build_apidoc}
48BuildRequires:  doxygen graphviz
49%endif
50Requires:       llvm-libs = %{version}-%{release}
51
52# LLVM is not supported on PPC64
53# http://llvm.org/bugs/show_bug.cgi?id=3729
54ExcludeArch:    ppc64
55
56%description
57LLVM is a compiler infrastructure designed for compile-time,
58link-time, runtime, and idle-time optimization of programs from
59arbitrary programming languages.  The compiler infrastructure includes
60mirror sets of programming tools as well as libraries with equivalent
61functionality.
62
63
64%package devel
65Summary:        Libraries and header files for LLVM
66Summary(ja):    LLVM のライブラリおよびヘッダファイル
67Group:          Development/Languages
68Requires:       %{name} = %{version}-%{release}
69Requires:       libstdc++-devel
70Requires:       libffi-devel
71Provides:       llvm-static = %{version}-%{release}
72
73
74%description devel
75This package contains library and header files needed to develop new
76native programs that use the LLVM infrastructure.
77
78
79%package doc
80Summary:        Documentation for LLVM
81Summary(ja):    LLVM のドキュメント
82Group:          Documentation
83Requires:       %{name} = %{version}-%{release}
84
85%description doc
86Documentation for the LLVM compiler infrastructure.
87
88
89%package libs
90Summary:        LLVM shared libraries
91Summary(ja):    LLVM シェアードライブラリ
92Group:          System Environment/Libraries
93
94%description libs
95Shared libraries for the LLVM compiler infrastructure.
96
97
98%package -n clang
99Summary:        A C language family front-end for LLVM
100Summary(ja):    LLVM の C 言語用フロントエンド
101License:        NCSA
102Group:          Development/Languages
103
104%description -n clang
105clang: noun
106    1. A loud, resonant, metallic sound.
107    2. The strident call of a crane or goose.
108    3. C-language family front-end toolkit.
109
110The goal of the Clang project is to create a new C, C++, Objective C
111and Objective C++ front-end for the LLVM compiler. Its tools are built
112as libraries and designed to be loosely-coupled and extensible.
113
114
115%package -n clang-devel
116Summary:        Header files for clang
117Summary(ja):    clang のヘッダファイル
118Group:          Development/Languages
119Requires:       clang = %{version}-%{release}
120
121%description -n clang-devel
122This package contains header files for the Clang compiler.
123
124
125%package -n clang-analyzer
126Summary:        A source code analysis framework
127Summary(ja):    ソースコー分析フレームワーク
128License:        NCSA
129Group:          Development/Languages
130Requires:       clang = %{version}-%{release}
131# not picked up automatically since files are currently not instaled
132# in standard Python hierarchies yet
133Requires:       python
134
135%description -n clang-analyzer
136The Clang Static Analyzer consists of both a source code analysis
137framework and a standalone tool that finds bugs in C and Objective-C
138programs. The standalone tool is invoked from the command-line, and is
139intended to run in tandem with a build of a project or code base.
140
141
142%package -n clang-doc
143Summary:        Documentation for Clang
144Summary(ja):    Clang のドキュメント
145Group:          Documentation
146Requires:       %{name} = %{version}-%{release}
147
148%description -n clang-doc
149Documentation for the Clang compiler front-end.
150
151
152%if %{build_apidoc}
153%package apidoc
154Summary:        API documentation for LLVM
155Summary(ja):    LLVM の API ドキュメント
156Group:          Development/Languages
157Requires:       %{name}-docs = %{version}-%{release}
158
159
160%description apidoc
161API documentation for the LLVM compiler infrastructure.
162%endif
163
164
165%package        ocaml
166Summary:        OCaml binding for LLVM
167Summary(ja):    LLVM の OCaml バインディング
168Group:          Development/Libraries
169Requires:       %{name} = %{version}-%{release}
170Requires:       ocaml
171
172%description    ocaml
173OCaml binding for LLVM.
174
175
176%package        ocaml-devel
177Summary:        Development files for %{name}-ocaml
178Summary(ja):    %{name}-ocaml の開発ファイル
179Group:          Development/Libraries
180Requires:       %{name}-devel = %{version}-%{release}
181Requires:       %{name}-ocaml = %{version}-%{release}
182Requires:       ocaml
183
184%description    ocaml-devel
185The %{name}-ocaml-devel package contains libraries and signature files
186for developing applications that use %{name}-ocaml.
187
188
189%package ocaml-doc
190Summary:        Documentation for %{name}-ocaml
191Summary(ja):    %{name}-ocaml のドキュメント
192Group:          Documentation
193Requires:       %{name}-ocaml = %{version}-%{release}
194
195%description ocaml-doc
196HTML documentation for LLVM's OCaml binding.
197
198
199
200%prep
201%setup -q -n llvm-%{version}.src -a1 %{?_with_gcc:-a2}
202mv clang-%{version}.src tools/clang
203
204# llvm patches
205%patch0 -p1 -b .timestamp
206%patch1 -p1 -b .fix11177
207%patch3 -p1 -b .fixLLVMgold
208
209# clang patches
210pushd tools/clang
211%patch2 -p1 -b .fix9798
212%patch4 -p1 -b .ldgold
213%ifarch x86_64
214%patch5 -p1 -b .lib64
215%endif
216popd
217
218# Encoding fix
219#(cd tools/clang/docs && \
220#    iconv -f ISO88591 -t UTF8 BlockImplementation.txt \
221#    -o BlockImplementation.txt)
222
223
224%build
225# explicitly supply CC and CXX when running 'configure'
226# http://llvm.org/bugs/show_bug.cgi?id=9472
227export CC=/usr/bin/gcc; export CXX=/usr/bin/g++
228
229# Disabling assertions now, rec. by pure and needed for OpenGTL
230# TESTFIX no PIC on ix86: http://llvm.org/bugs/show_bug.cgi?id=3801
231%configure \
232  --prefix=%{_prefix} \
233  --libdir=%{_libdir}/%{name} \
234  --datadir=%{_libdir}/%{name} \
235%if %{?_with_doxygen:1}%{!?_with_doxygen:0}
236  --enable-doxygen \
237%endif
238  --enable-targets=host \
239  --disable-assertions \
240  --enable-jit \
241  --enable-libffi \
242  --enable-shared \
243  --with-binutils-include=%{_includedir} --enable-pic \
244#  --with-c-include-dirs=%{_includedir}:$(find %{_prefix}/lib/gcc/*/* \
245#      -maxdepth 0 -type d)/include \
246#%if %{__isa_bits} == 64
247#  --with-cxx-include-32bit-dir=32 \
248#%endif
249#  --with-cxx-include-root=$(find %{_includedir}/c++/* -maxdepth 0 -type d) \
250#  --with-cxx-include-arch=%{_target_cpu}-%{_vendor}-%{_os}
251 
252
253# FIXME file this
254# configure does not properly specify libdir
255sed -i 's|(PROJ_prefix)/lib|(PROJ_prefix)/%{_lib}/%{name}|g' Makefile.config
256
257make %{_smp_mflags} REQUIRES_RTTI=1 \
258  OPTIMIZE_OPTION="%{optflags}"
259
260
261%install
262rm -rf %{buildroot}
263
264make install DESTDIR=%{buildroot} \
265     PROJ_docsdir=/moredocs
266
267# multilib fixes
268mv %{buildroot}%{_bindir}/llvm-config{,-%{__isa_bits}}
269
270pushd %{buildroot}%{_includedir}/llvm/Config
271mv config.h config-%{__isa_bits}.h
272cp -p %{SOURCE2} config.h
273mv llvm-config.h llvm-config-%{__isa_bits}.h
274cp -p %{SOURCE3} llvm-config.h
275popd
276
277# Create ld.so.conf.d entry
278mkdir -p %{buildroot}%{_sysconfdir}/ld.so.conf.d
279cat >> %{buildroot}%{_sysconfdir}/ld.so.conf.d/llvm-%{_arch}.conf << EOF
280%{_libdir}/llvm
281EOF
282
283# Static analyzer not installed by default:
284# http://clang-analyzer.llvm.org/installation#OtherPlatforms
285mkdir -p %{buildroot}%{_libdir}/clang-analyzer
286# create launchers
287for f in scan-{build,view}; do
288  ln -s %{_libdir}/clang-analyzer/$f/$f %{buildroot}%{_bindir}/$f
289done
290
291(cd tools/clang/tools && cp -pr scan-{build,view} \
292 %{buildroot}%{_libdir}/clang-analyzer/)
293
294
295# Move documentation back to build directory
296#
297pwd
298mv %{buildroot}/moredocs .
299rm -f moredocs/*.tar.gz
300rm -f moredocs/ocamldoc/html/*.tar.gz
301
302# and separate the apidoc
303%if %{build_apidoc}
304mv moredocs/html/doxygen apidoc
305mv tools/clang/docs/doxygen/html clang-apidoc
306%endif
307
308# And prepare Clang documentation
309#
310mkdir clang-docs
311for f in LICENSE.TXT NOTES.txt README.txt; do
312  ln tools/clang/$f clang-docs/
313done
314rm -rf tools/clang/docs/{doxygen*,Makefile*,*.graffle,tools}
315
316
317#find %%{buildroot} -name .dir -print0 | xargs -0r rm -f
318file %{buildroot}/%{_bindir}/* | awk -F: '$2~/ELF/{print $1}' | xargs -r chrpath -d
319file %{buildroot}/%{_libdir}/llvm/*.so | awk -F: '$2~/ELF/{print $1}' | xargs -r chrpath -d
320#chrpath -d %%{buildroot}/%%{_libexecdir}/clang-cc
321
322# Get rid of erroneously installed example files.
323rm %{buildroot}%{_libdir}/%{name}/*LLVMHello.*
324
325# FIXME file this bug
326sed -i 's,ABS_RUN_DIR/lib",ABS_RUN_DIR/%{_lib}/%{name}",' \
327  %{buildroot}%{_bindir}/llvm-config-%{__isa_bits}
328
329chmod -x %{buildroot}%{_libdir}/%{name}/*.a
330
331# remove documentation makefiles:
332# they require the build directory to work
333find examples -name 'Makefile' | xargs -0r rm -f
334
335
336%check
337make check 2>&1 | tee ../llvm-testlog.txt
338make -C tools/clang/test 2>&1 | tee ../llvm-testlog.txt
339
340
341%clean
342rm -rf %{buildroot}
343
344
345%post libs -p /sbin/ldconfig
346%post -n clang -p /sbin/ldconfig
347
348
349%postun libs -p /sbin/ldconfig
350%postun -n clang -p /sbin/ldconfig
351
352
353%posttrans devel
354# link llvm-config to the platform-specific file;
355# use ISA bits as priority so that 64-bit is preferred
356# over 32-bit if both are installed
357alternatives \
358  --install \
359  %{_bindir}/llvm-config \
360  llvm-config \
361  %{_bindir}/llvm-config-%{__isa_bits} \
362  %{__isa_bits}
363
364%postun devel
365if [ $1 -eq 0 ]; then
366  alternatives --remove llvm-config \
367    %{_bindir}/llvm-config-%{__isa_bits}
368fi
369exit 0
370
371
372%files
373%defattr(-,root,root,-)
374%doc CREDITS.TXT LICENSE.TXT README.txt
375%{_bindir}/bugpoint
376%{_bindir}/llc
377%{_bindir}/lli
378%exclude %{_bindir}/llvm-config-%{__isa_bits}
379%{_bindir}/llvm*
380%{_bindir}/macho-dump
381%{_bindir}/opt
382%exclude %{_mandir}/man1/clang.1.*
383%doc %{_mandir}/man1/*.1.*
384
385%files devel
386%defattr(-,root,root,-)
387%{_bindir}/llvm-config-%{__isa_bits}
388%{_includedir}/%{name}
389%{_includedir}/%{name}-c
390%{_libdir}/%{name}/*.a
391
392%files libs
393%defattr(-,root,root,-)
394%config(noreplace) %{_sysconfdir}/ld.so.conf.d/llvm-%{_arch}.conf
395%dir %{_libdir}/%{name}
396%exclude %{_libdir}/%{name}/libclang.so
397%{_libdir}/%{name}/*.so
398
399%files -n clang
400%defattr(-,root,root,-)
401%doc clang-docs/*
402%{_bindir}/clang*
403%{_libdir}/%{name}/libclang.so
404%{_prefix}/lib/clang
405%doc %{_mandir}/man1/clang.1.*
406
407%files -n clang-devel
408%defattr(-,root,root,-)
409%{_includedir}/clang
410%{_includedir}/clang-c
411
412%files -n clang-analyzer
413%defattr(-,root,root,-)
414%{_bindir}/scan-build
415%{_bindir}/scan-view
416%{_libdir}/clang-analyzer
417
418%files -n clang-doc
419%defattr(-,root,root,-)
420%doc tools/clang/docs/*
421
422%files doc
423%defattr(-,root,root,-)
424%doc examples moredocs/html
425
426%files ocaml
427%defattr(-,root,root,-)
428%{_libdir}/ocaml/*.cma
429%{_libdir}/ocaml/*.cmi
430
431%files ocaml-devel
432%defattr(-,root,root,-)
433%{_libdir}/ocaml/*.a
434%{_libdir}/ocaml/*.cmx*
435%{_libdir}/ocaml/*.mli
436
437%files ocaml-doc
438%defattr(-,root,root,-)
439%doc moredocs/ocamldoc/html/*
440
441%if 0%{?_with_doxygen}
442%files apidoc
443%defattr(-,root,root,-)
444%doc apidoc/*
445
446%files -n clang-apidoc
447%defattr(-,root,root,-)
448%doc clang-apidoc/*
449%endif
450
451
452%changelog
453* Tue Jan 24 2012 NAKAMURA Kenta <kenta@vinelinux.org> - 3.0-1
454- updated to 3.0 release
455
456* Sun Jan 15 2012 NAKAMURA Kenta <kenta@vinelinux.org> - 2.9-3
457- added patch 2-4 to support -O4 link-time optimization
458
459* Fri Sep  9 2011 MATSUBAYASHI Kohji <shaolin@vinelinux.org> - 2.9-2
460- disable -fno-var-tracking-assignments on ppc
461  (seems like gcc-4.4.5 still doesn't support this)
462
463* Thu Aug 25 2011 Daisuke SUZUKI <daisuke@linux.or.jp> 2.9-1
464- new upstream release
465- add BR: libffi-devel
466- add R: libffi-devel to -devel
467
468* Sun May 23 2010 Daisuke SUZUKI <daisuke@linux.or.jp> 2.7-1
469- initial build for Vine Linux
470
471* Sun May  2 2010 Michel Salim <salimma@fedoraproject.org> - 2.7-1
472- Update to final 2.7 release
473
474* Sun Mar 28 2010 Michel Salim <salimma@fedoraproject.org> - 2.7-0.1.pre1
475- Update to first 2.7 pre-release
476
477* Fri Sep 18 2009 Michel Salim <salimma@fedoraproject.org> - 2.6-0.6.pre2
478- Update to 2.6 pre-release2
479- -devel subpackage now virtually provides -static
480
481* Wed Sep  9 2009 Michel Salim <salimma@fedoraproject.org> - 2.6-0.5.pre1
482- Disable var tracking assignments on PPC
483
484* Wed Sep  9 2009 Michel Salim <salimma@fedoraproject.org> - 2.6-0.4.pre1
485- Don't adjust clang include dir; files there are noarch (bz#521893)
486- Enable clang unit tests
487- clang and clang-analyzer renamed; no longer depend on llvm at runtime
488
489* Mon Sep  7 2009 Michel Salim <salimma@fedoraproject.org> - 2.6-0.3.pre1
490- Package Clang's static analyzer tools
491
492* Mon Sep  7 2009 Michel Salim <salimma@fedoraproject.org> - 2.6-0.2.pre1
493- PIC is now enabled by default; explicitly disable on %%{ix86}
494
495* Mon Sep  7 2009 Michel Salim <salimma@fedoraproject.org> - 2.6-0.1.pre1
496- First 2.6 prerelease
497- Enable Clang front-end
498- Enable debuginfo generation
499
500* Sat Sep  5 2009 Michel Salim <salimma@fedoraproject.org> - 2.5-6
501- Disable assertions (needed by OpenGTL, bz#521261)
502- Align spec file with upstream build instructions
503- Enable unit tests
504
505* Sat Aug 22 2009 Michel Salim <salimma@fedoraproject.org> - 2.5-5
506- Only disable PIC on %%ix86; ppc actually needs it
507
508* Sat Aug 22 2009 Michel Salim <salimma@fedoraproject.org> - 2.5-4
509- Disable use of position-independent code on 32-bit platforms
510  (buggy in LLVM <= 2.5)
511
512* Sat Jul 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.5-3
513- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
514
515* Wed Mar  4 2009 Michel Salim <salimma@fedoraproject.org> - 2.5-2
516- Remove build scripts; they require the build directory to work
517
518* Wed Mar  4 2009 Michel Salim <salimma@fedoraproject.org> - 2.5-1
519- Update to 2.5
520- Package build scripts (bug #457881)
521
522* Tue Dec  2 2008 Michel Salim <salimma@fedoraproject.org> - 2.4-2
523- Patched build process for the OCaml binding
524
525* Tue Dec  2 2008 Michel Salim <salimma@fedoraproject.org> - 2.4-1
526- Update to 2.4
527- Package Ocaml binding
528
529* Wed Jun 18 2008 Bryan O'Sullivan <bos@serpentine.com> - 2.3-2
530- Add dependency on groff
531
532* Wed Jun 18 2008 Bryan O'Sullivan <bos@serpentine.com> - 2.3-1
533- LLVM 2.3
534
535* Thu May 29 2008 Tom "spot" Callaway <tcallawa@redhat.com> - 2.2-4
536- fix license tags
537
538* Wed Mar  5 2008 Bryan O'Sullivan <bos@serpentine.com> - 2.2-3
539- Fix compilation problems with gcc 4.3
540
541* Mon Feb 18 2008 Fedora Release Engineering <rel-eng@fedoraproject.org> - 2.2-2
542- Autorebuild for GCC 4.3
543
544* Sun Jan 20 2008 Bryan O'Sullivan <bos@serpentine.com> - 2.1-2
545- Fix review comments
546
547* Sun Jan 20 2008 Bryan O'Sullivan <bos@serpentine.com> - 2.1-1
548- Initial version
Note: See TracBrowser for help on using the repository browser.