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

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