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

Revision 8758, 15.8 KB checked in by Takemikaduchi, 10 years ago (diff)

update or rebuild

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.3
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}/cfe-%{version}.src.tar.gz
18Source2:        http://llvm.org/releases/%{version}/compiler-rt-%{version}.src.tar.gz
19
20# multilib fixes
21Source10:        llvm-Config-config.h
22Source11:        llvm-Config-llvm-config.h
23
24# Data files should be installed with timestamps preserved
25Patch0:         llvm-2.6-timestamp.patch
26
27Patch11:        clang-hardfloat-hack.patch
28
29# hack the link flags for the shared libs for speed and memory usage
30Patch21:        llvm-3.2-symbolic-shlib.patch
31
32# Vine Patch
33Patch1000: clang-3.1-driver-ld.gold.patch
34Patch1001: clang-3.1-driver-lib64.patch
35Patch1002: clang-3.3-driver-vine.patch
36
37BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
38
39BuildRequires:  binutils-devel
40BuildRequires:  bison
41BuildRequires:  chrpath
42BuildRequires:  flex
43BuildRequires:  gcc-c++ >= 3.4
44BuildRequires:  groff
45BuildRequires:  libffi-devel
46BuildRequires:  libtool-ltdl-devel
47BuildRequires:  ocaml
48# for DejaGNU test suite
49BuildRequires:  dejagnu tcl python
50%if %{build_apidoc}
51BuildRequires:  doxygen graphviz
52%endif
53Requires:       llvm-libs = %{version}-%{release}
54
55# LLVM is not supported on PPC64
56# http://llvm.org/bugs/show_bug.cgi?id=3729
57ExcludeArch:    ppc64
58
59%description
60LLVM is a compiler infrastructure designed for compile-time,
61link-time, runtime, and idle-time optimization of programs from
62arbitrary programming languages.  The compiler infrastructure includes
63mirror sets of programming tools as well as libraries with equivalent
64functionality.
65
66
67%package devel
68Summary:        Libraries and header files for LLVM
69Summary(ja):    LLVM のライブラリおよびヘッダファイル
70Group:          Development/Languages
71Requires:       %{name} = %{version}-%{release}
72Requires:       libstdc++-devel
73Requires:       libffi-devel
74Provides:       llvm-static = %{version}-%{release}
75
76
77%description devel
78This package contains library and header files needed to develop new
79native programs that use the LLVM infrastructure.
80
81
82%package doc
83Summary:        Documentation for LLVM
84Summary(ja):    LLVM のドキュメント
85Group:          Documentation
86Requires:       %{name} = %{version}-%{release}
87
88%description doc
89Documentation for the LLVM compiler infrastructure.
90
91
92%package libs
93Summary:        LLVM shared libraries
94Summary(ja):    LLVM シェアードライブラリ
95Group:          System Environment/Libraries
96
97%description libs
98Shared libraries for the LLVM compiler infrastructure.
99
100
101%package -n clang
102Summary:        A C language family front-end for LLVM
103Summary(ja):    LLVM の C 言語用フロントエンド
104License:        NCSA
105Group:          Development/Languages
106Requires:       gcc
107%(rpm -q --qf 'Requires: %{name} = %{version}' libstdc++-devel)
108
109%description -n clang
110clang: noun
111    1. A loud, resonant, metallic sound.
112    2. The strident call of a crane or goose.
113    3. C-language family front-end toolkit.
114
115The goal of the Clang project is to create a new C, C++, Objective C
116and Objective C++ front-end for the LLVM compiler. Its tools are built
117as libraries and designed to be loosely-coupled and extensible.
118
119
120%package -n clang-devel
121Summary:        Header files for clang
122Summary(ja):    clang のヘッダファイル
123Group:          Development/Languages
124Requires:       clang = %{version}-%{release}
125
126%description -n clang-devel
127This package contains header files for the Clang compiler.
128
129
130%package -n clang-analyzer
131Summary:        A source code analysis framework
132Summary(ja):    ソースコー分析フレームワーク
133License:        NCSA
134Group:          Development/Languages
135Requires:       clang = %{version}-%{release}
136# not picked up automatically since files are currently not instaled
137# in standard Python hierarchies yet
138Requires:       python
139
140%description -n clang-analyzer
141The Clang Static Analyzer consists of both a source code analysis
142framework and a standalone tool that finds bugs in C and Objective-C
143programs. The standalone tool is invoked from the command-line, and is
144intended to run in tandem with a build of a project or code base.
145
146
147%package -n clang-doc
148Summary:        Documentation for Clang
149Summary(ja):    Clang のドキュメント
150Group:          Documentation
151Requires:       %{name} = %{version}-%{release}
152
153%description -n clang-doc
154Documentation for the Clang compiler front-end.
155
156
157%if %{build_apidoc}
158%package apidoc
159Summary:        API documentation for LLVM
160Summary(ja):    LLVM の API ドキュメント
161Group:          Development/Languages
162Requires:       %{name}-docs = %{version}-%{release}
163
164
165%description apidoc
166API documentation for the LLVM compiler infrastructure.
167%endif
168
169
170%package        ocaml
171Summary:        OCaml binding for LLVM
172Summary(ja):    LLVM の OCaml バインディング
173Group:          Development/Libraries
174Requires:       %{name} = %{version}-%{release}
175Requires:       ocaml
176
177%description    ocaml
178OCaml binding for LLVM.
179
180
181%package        ocaml-devel
182Summary:        Development files for %{name}-ocaml
183Summary(ja):    %{name}-ocaml の開発ファイル
184Group:          Development/Libraries
185Requires:       %{name}-devel = %{version}-%{release}
186Requires:       %{name}-ocaml = %{version}-%{release}
187Requires:       ocaml
188
189%description    ocaml-devel
190The %{name}-ocaml-devel package contains libraries and signature files
191for developing applications that use %{name}-ocaml.
192
193
194%package ocaml-doc
195Summary:        Documentation for %{name}-ocaml
196Summary(ja):    %{name}-ocaml のドキュメント
197Group:          Documentation
198Requires:       %{name}-ocaml = %{version}-%{release}
199
200%description ocaml-doc
201HTML documentation for LLVM's OCaml binding.
202
203
204
205%prep
206%setup -q -n llvm-%{version}.src -a1 -a2
207rm -f tools/clang
208mv cfe-%{version}.src tools/clang
209
210# llvm patches
211%patch0 -p1 -b .timestamp
212
213# arm hard float
214%patch11 -p1 -b .orig
215
216# fix llvm-config --libs
217%patch21 -p1 -b .orig
218
219%patch1000 -p1 -b .driver-ld.gold
220%ifarch x86_64
221%patch1001 -p1 -b .driver-lib64
222%endif
223%patch1002 -p1 -b .driver-vine
224
225# fix ld search path
226sed -i 's|/lib /usr/lib $lt_ld_extra|/%{_lib} %{_libdir} $lt_ld_extra|' \
227    ./configure
228   
229
230%build
231export CC=/usr/bin/gcc
232export 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%ifarch armv7hl armv7l
244  --with-cpu=cortex-a8 \
245  --with-tune=cortex-a8 \
246  --with-arch=armv7-a \
247  --with-float=hard \
248  --with-fpu=vfpv3-d16 \
249  --with-abi=aapcs-linux \
250%endif
251  --enable-targets=host \
252  --disable-assertions \
253  --enable-optimized \
254  --enable-jit \
255  --enable-libffi \
256  --enable-shared \
257  --enable-pic \
258  --with-c-include-dirs=%{_includedir}:$(echo %{_prefix}/lib/gcc/%{_target_cpu}*/%{gcc_version}/include) \
259  --with-binutils-include=%{_includedir} \
260  --enable-targets=x86,powerpc,arm,aarch64,cpp,nvptx \
261  --enable-experimental-targets=R600
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 %{SOURCE10} config.h
288mv llvm-config.h llvm-config-%{__isa_bits}.h
289cp -p %{SOURCE11} 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* Sun Jul 06 2014 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.3-2
471- rebuild with libffi-3.0.13
472
473* Mon Oct 28 2013 Daisuke SUZUKI <daisuke@linux.or.jp> 3.3-1
474- update to 3.3
475
476* Mon Dec 03 2012 Daisuke SUZUKI <daisuke@linux.or.jp> 3.1-2
477- ld.gold (patch1000,1001)
478- add /%{_lib} to ld search path
479- add support *-vine-linux gcc (patch1002)
480
481* Fri Nov 30 2012 Daisuke SUZUKI <daisuke@linux.or.jp> 3.1-1
482- update to 3.1
483
484* Tue Jan 24 2012 NAKAMURA Kenta <kenta@vinelinux.org> - 3.0-1
485- updated to 3.0 release
486
487* Sun Jan 15 2012 NAKAMURA Kenta <kenta@vinelinux.org> - 2.9-3
488- added patch 2-4 to support -O4 link-time optimization
489
490* Fri Sep  9 2011 MATSUBAYASHI Kohji <shaolin@vinelinux.org> - 2.9-2
491- disable -fno-var-tracking-assignments on ppc
492  (seems like gcc-4.4.5 still doesn't support this)
493
494* Thu Aug 25 2011 Daisuke SUZUKI <daisuke@linux.or.jp> 2.9-1
495- new upstream release
496- add BR: libffi-devel
497- add R: libffi-devel to -devel
498
499* Sun May 23 2010 Daisuke SUZUKI <daisuke@linux.or.jp> 2.7-1
500- initial build for Vine Linux
501
502* Sun May  2 2010 Michel Salim <salimma@fedoraproject.org> - 2.7-1
503- Update to final 2.7 release
504
505* Sun Mar 28 2010 Michel Salim <salimma@fedoraproject.org> - 2.7-0.1.pre1
506- Update to first 2.7 pre-release
507
508* Fri Sep 18 2009 Michel Salim <salimma@fedoraproject.org> - 2.6-0.6.pre2
509- Update to 2.6 pre-release2
510- -devel subpackage now virtually provides -static
511
512* Wed Sep  9 2009 Michel Salim <salimma@fedoraproject.org> - 2.6-0.5.pre1
513- Disable var tracking assignments on PPC
514
515* Wed Sep  9 2009 Michel Salim <salimma@fedoraproject.org> - 2.6-0.4.pre1
516- Don't adjust clang include dir; files there are noarch (bz#521893)
517- Enable clang unit tests
518- clang and clang-analyzer renamed; no longer depend on llvm at runtime
519
520* Mon Sep  7 2009 Michel Salim <salimma@fedoraproject.org> - 2.6-0.3.pre1
521- Package Clang's static analyzer tools
522
523* Mon Sep  7 2009 Michel Salim <salimma@fedoraproject.org> - 2.6-0.2.pre1
524- PIC is now enabled by default; explicitly disable on %%{ix86}
525
526* Mon Sep  7 2009 Michel Salim <salimma@fedoraproject.org> - 2.6-0.1.pre1
527- First 2.6 prerelease
528- Enable Clang front-end
529- Enable debuginfo generation
530
531* Sat Sep  5 2009 Michel Salim <salimma@fedoraproject.org> - 2.5-6
532- Disable assertions (needed by OpenGTL, bz#521261)
533- Align spec file with upstream build instructions
534- Enable unit tests
535
536* Sat Aug 22 2009 Michel Salim <salimma@fedoraproject.org> - 2.5-5
537- Only disable PIC on %%ix86; ppc actually needs it
538
539* Sat Aug 22 2009 Michel Salim <salimma@fedoraproject.org> - 2.5-4
540- Disable use of position-independent code on 32-bit platforms
541  (buggy in LLVM <= 2.5)
542
543* Sat Jul 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.5-3
544- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
545
546* Wed Mar  4 2009 Michel Salim <salimma@fedoraproject.org> - 2.5-2
547- Remove build scripts; they require the build directory to work
548
549* Wed Mar  4 2009 Michel Salim <salimma@fedoraproject.org> - 2.5-1
550- Update to 2.5
551- Package build scripts (bug #457881)
552
553* Tue Dec  2 2008 Michel Salim <salimma@fedoraproject.org> - 2.4-2
554- Patched build process for the OCaml binding
555
556* Tue Dec  2 2008 Michel Salim <salimma@fedoraproject.org> - 2.4-1
557- Update to 2.4
558- Package Ocaml binding
559
560* Wed Jun 18 2008 Bryan O'Sullivan <bos@serpentine.com> - 2.3-2
561- Add dependency on groff
562
563* Wed Jun 18 2008 Bryan O'Sullivan <bos@serpentine.com> - 2.3-1
564- LLVM 2.3
565
566* Thu May 29 2008 Tom "spot" Callaway <tcallawa@redhat.com> - 2.2-4
567- fix license tags
568
569* Wed Mar  5 2008 Bryan O'Sullivan <bos@serpentine.com> - 2.2-3
570- Fix compilation problems with gcc 4.3
571
572* Mon Feb 18 2008 Fedora Release Engineering <rel-eng@fedoraproject.org> - 2.2-2
573- Autorebuild for GCC 4.3
574
575* Sun Jan 20 2008 Bryan O'Sullivan <bos@serpentine.com> - 2.1-2
576- Fix review comments
577
578* Sun Jan 20 2008 Bryan O'Sullivan <bos@serpentine.com> - 2.1-1
579- Initial version
Note: See TracBrowser for help on using the repository browser.