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

Revision 7197, 15.2 KB checked in by daisuke, 12 years ago (diff)

llvm: update to 3.1

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