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

Revision 7201, 15.6 KB checked in by daisuke, 12 years ago (diff)

llvm:

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