]>
Commit | Line | Data |
---|---|---|
bc88141a ER |
1 | # TODO |
2 | # - gcc/c++ packages: http://cvs.fedoraproject.org/viewvc/rpms/llvm/devel/llvm.spec?revision=HEAD&view=markup | |
3 | # | |
4 | # Conditional build: | |
5 | %bcond_with ocaml # build without OCaml bindings | |
6 | %bcond_with gcc # build without gcc | |
7 | # | |
8 | %define lgcc_version 4.2 | |
aa11c230 | 9 | Summary: The Low Level Virtual Machine (An Optimizing Compiler Infrastructure) |
2326a99f | 10 | Summary(pl.UTF-8): Niskopoziomowa maszyna wirtualna (infrastruktura kompilatora optymalizującego) |
aa11c230 | 11 | Name: llvm |
633c6443 | 12 | Version: 2.3 |
aa11c230 | 13 | Release: 0.1 |
14 | License: University of Illinois/NCSA Open Source License | |
15 | Group: Development/Languages | |
aa11c230 | 16 | Source0: http://llvm.org/releases/%{version}/%{name}-%{version}.tar.gz |
633c6443 | 17 | # Source0-md5: 17254d72863b7fa005f3fb327aea3439 |
bc88141a ER |
18 | Source1: http://llvm.org/releases/%{version}/%{name}-gcc-%{lgcc_version}-%{version}.source.tar.gz |
19 | # Source1-md5: 18aa4f8226ddab58af2f12cff135470d | |
aa11c230 | 20 | Patch0: %{name}-dirs.patch |
2326a99f | 21 | URL: http://llvm.org/ |
bc88141a | 22 | BuildRequires: bash |
2326a99f | 23 | BuildRequires: gcc >= 5:3.4 |
bc88141a ER |
24 | BuildRequires: libltdl-devel |
25 | %{?with_ocaml:BuildRequires: ocaml} | |
356a0bbd ER |
26 | # gcc4 might be installed, but not current __cc |
27 | %if "%(echo %{cc_version} | cut -d. -f1,2)" < "3.4" | |
28 | BuildRequires: __cc >= 3.4 | |
29 | %endif | |
aa11c230 | 30 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
31 | ||
356a0bbd | 32 | %define _sysconfdir /etc/%{name} |
021b3c3d | 33 | |
aa11c230 | 34 | %description |
35 | LLVM is a compiler infrastructure designed for compile-time, | |
36 | link-time, runtime, and idle-time optimization of programs from | |
37 | arbitrary programming languages. LLVM is written in C++ and has been | |
38 | developed since 2000 at the University of Illinois and Apple. It | |
39 | currently supports compilation of C and C++ programs, using front-ends | |
40 | derived from GCC 4.0.1. A new front-end for the C family of languages | |
41 | is in development. The compiler infrastructure includes mirror sets of | |
42 | programming tools as well as libraries with equivalent functionality. | |
43 | ||
2326a99f JB |
44 | %description -l pl.UTF-8 |
45 | LLVM to infrastruktura kompilatora zaprojektowana do optymalizacji | |
46 | czasu kompilowania, linkowania, działania i bezczynności programów w | |
47 | dowolnych językach programowania. Jest napisana w C++, rozwijana od | |
48 | roku 2000 przez Uniwersytet w Illinois i Apple. Aktualnie obsługuje | |
49 | kompilację programów w C i C++ przy użyciu frontendów wywodzących się | |
50 | z GCC 4.0.1. W trakcie tworzenia jest nowy frontend do języków z | |
51 | rodziny C. Infrastruktura kompilatora zawiera lustrzane zestawy | |
52 | narzędzi programistycznych oraz biblioteki z odpowiadającą narzędziom | |
53 | funkcjonalnością. | |
54 | ||
bc88141a ER |
55 | %package doc |
56 | Summary: Documentation for LLVM | |
57 | Group: Documentation | |
58 | Requires: %{name} = %{version}-%{release} | |
59 | ||
60 | %description doc | |
61 | Documentation for the LLVM compiler infrastructure. | |
62 | ||
63 | %package devel | |
64 | Summary: Libraries and header files for LLVM | |
65 | Group: Development/Languages | |
66 | Requires: %{name} = %{version}-%{release} | |
67 | Requires: libstdc++-devel >= 6:3.4 | |
68 | ||
69 | %description devel | |
70 | This package contains library and header files needed to develop new | |
71 | native programs that use the LLVM infrastructure. | |
72 | ||
73 | %package gcc | |
74 | Summary: C compiler for LLVM | |
75 | License: GPL+ | |
76 | Group: Development/Languages | |
77 | Requires: %{name} = %{version}-%{release} | |
78 | ||
79 | %description gcc | |
80 | C compiler for LLVM. | |
81 | ||
82 | %package gcc-c++ | |
83 | Summary: C++ compiler for LLVM | |
84 | License: GPL+ | |
85 | Group: Development/Languages | |
86 | Requires: %{name}-gcc = %{version}-%{release} | |
87 | ||
88 | %description gcc-c++ | |
89 | C++ compiler for LLVM. | |
90 | ||
91 | %package ocaml | |
92 | Summary: OCaml binding for LLVM | |
93 | Group: Development/Libraries | |
94 | Requires: %{name} = %{version}-%{release} | |
95 | %requires_eq ocaml-runtime | |
96 | ||
97 | %description ocaml | |
98 | OCaml binding for LLVM. | |
99 | ||
100 | %package ocaml-devel | |
101 | Summary: Development files for %{name}-ocaml | |
102 | Group: Development/Libraries | |
103 | Requires: %{name}-devel = %{version}-%{release} | |
104 | Requires: %{name}-ocaml = %{version}-%{release} | |
105 | ||
106 | %description ocaml-devel | |
107 | The %{name}-ocaml-devel package contains libraries and signature files | |
108 | for developing applications that use %{name}-ocaml. | |
109 | ||
aa11c230 | 110 | %prep |
bc88141a | 111 | %setup -q %{?with_gcc:-a1} |
aa11c230 | 112 | %patch0 -p0 |
113 | ||
114 | %build | |
bc88141a ER |
115 | # bash specific 'test a < b' |
116 | bash %configure \ | |
117 | --libdir=%{_libdir}/%{name} \ | |
118 | --datadir=%{_datadir}/%{name}-%{version} \ | |
119 | --enable-bindings=%{!?with_ocaml:no}%{?with_ocaml:ocaml} \ | |
120 | --disable-static \ | |
121 | --enable-assertions \ | |
122 | --enable-debug-runtime \ | |
123 | --enable-jit \ | |
aa11c230 | 124 | --enable-optimized \ |
bc88141a ER |
125 | --enable-shared \ |
126 | --with-pic | |
127 | ||
128 | %{__make} OPTIMIZE_OPTION="%{rpmcflags}" | |
129 | ||
130 | %if %{with gcc} | |
131 | # Build llvm-gcc. | |
aa11c230 | 132 | |
bc88141a ER |
133 | export PATH=%{_builddir}/%{?buildsubdir}/Release/bin:$PATH |
134 | ||
135 | install -d llvm-gcc%{lgcc_version}-%{version}.source/build | |
136 | cd llvm-gcc%{lgcc_version}-%{version}.source/build | |
137 | ../configure \ | |
138 | --host=%{_host} \ | |
139 | --build=%{_build} \ | |
140 | --target=%{_target_platform} \ | |
141 | --prefix=%{_libdir}/llvm-gcc \ | |
142 | --libdir=%{_libdir}/llvm-gcc/%{_lib} \ | |
143 | --enable-threads \ | |
144 | --disable-nls \ | |
145 | %ifarch %{x8664} | |
146 | --disable-multilib \ | |
147 | --disable-shared \ | |
148 | %endif | |
149 | --enable-languages=c,c++ \ | |
150 | --enable-llvm=%{_builddir}/%{?buildsubdir} \ | |
151 | --program-prefix=llvm- | |
152 | ||
153 | %{__make} LLVM_VERSION_INFO=%{version} | |
154 | %endif | |
aa11c230 | 155 | |
156 | %install | |
157 | rm -rf $RPM_BUILD_ROOT | |
158 | ||
159 | %{__make} install \ | |
160 | DESTDIR=$RPM_BUILD_ROOT | |
161 | ||
bc88141a | 162 | find $RPM_BUILD_ROOT -name .dir | xargs rm -fv |
021b3c3d | 163 | |
aa11c230 | 164 | %clean |
165 | rm -rf $RPM_BUILD_ROOT | |
166 | ||
2326a99f JB |
167 | %post -p /sbin/ldconfig |
168 | %postun -p /sbin/ldconfig | |
aa11c230 | 169 | |
170 | %files | |
171 | %defattr(644,root,root,755) | |
bc88141a | 172 | %doc CREDITS.TXT LICENSE.TXT README.txt |
a9beeab5 JB |
173 | %attr(755,root,root) %{_bindir}/bugpoint |
174 | %attr(755,root,root) %{_bindir}/gccas | |
175 | %attr(755,root,root) %{_bindir}/gccld | |
176 | %attr(755,root,root) %{_bindir}/llc | |
177 | %attr(755,root,root) %{_bindir}/lli | |
a9beeab5 | 178 | %attr(755,root,root) %{_bindir}/opt |
bc88141a ER |
179 | %attr(755,root,root) %{_bindir}/llvmc2 |
180 | %attr(755,root,root) %{_bindir}/llvm-* | |
181 | %exclude %attr(755,root,root) %{_bindir}/llvm-config | |
a9beeab5 JB |
182 | %{_mandir}/man1/bugpoint.1* |
183 | %{_mandir}/man1/llc.1* | |
184 | %{_mandir}/man1/lli.1* | |
185 | %{_mandir}/man1/llvm-*.1* | |
a9beeab5 JB |
186 | %{_mandir}/man1/llvmgcc.1* |
187 | %{_mandir}/man1/llvmgxx.1* | |
188 | %{_mandir}/man1/opt.1* | |
189 | %{_mandir}/man1/stkrc.1* | |
190 | %{_mandir}/man1/tblgen.1* | |
bc88141a ER |
191 | |
192 | %files doc | |
193 | %defattr(644,root,root,755) | |
194 | %doc docs/*.{html,css} docs/img examples | |
195 | ||
196 | %files devel | |
197 | %defattr(644,root,root,755) | |
198 | %attr(755,root,root) %{_bindir}/llvm-config | |
199 | %{_includedir}/llvm | |
200 | %{_includedir}/llvm-c | |
201 | %{_libdir}/LLVM*.o | |
202 | %{_libdir}/libLLVM*.a | |
203 | # just example? | |
204 | %attr(755,root,root) %{_libdir}/LLVMHello.so* | |
205 | %{_libdir}/LLVMHello.la | |
206 | ||
207 | %if %{with gcc} | |
208 | %files gcc | |
209 | %defattr(644,root,root,755) | |
210 | %attr(755,root,root) %{_bindir}/llvm2cpp | |
211 | %attr(755,root,root) %{_bindir}/llvmc | |
212 | %dir %{_sysconfdir} | |
213 | %verify(not md5 mtime size) %config(noreplace) %{_sysconfdir}/c | |
214 | %verify(not md5 mtime size) %config(noreplace) %{_sysconfdir}/cpp | |
215 | %verify(not md5 mtime size) %config(noreplace) %{_sysconfdir}/ll | |
216 | %verify(not md5 mtime size) %config(noreplace) %{_sysconfdir}/st | |
217 | %{_mandir}/man1/llvm2cpp.1* | |
218 | %{_mandir}/man1/llvmc.1* | |
219 | ||
220 | %files gcc-c++ | |
221 | %defattr(644,root,root,755) | |
222 | %verify(not md5 mtime size) %config(noreplace) %{_sysconfdir}/c++ | |
223 | %verify(not md5 mtime size) %config(noreplace) %{_sysconfdir}/cxx | |
224 | %endif |