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

Revision 5424, 15.0 KB checked in by kenta, 12 years ago (diff)

llvm: added patch 2-4 (bts #1209)

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