2 # - gcc/c++ packages: http://cvs.fedoraproject.org/viewvc/rpms/llvm/devel/llvm.spec?revision=HEAD&view=markup
3 # - test gcc pkgs and all
6 %bcond_with ocaml # build without OCaml bindings
7 %bcond_without gcc # build without gcc
9 %define lgcc_vertar 4.2
10 %define lgcc_version 4.2.1
11 Summary: The Low Level Virtual Machine (An Optimizing Compiler Infrastructure)
12 Summary(pl.UTF-8): Niskopoziomowa maszyna wirtualna (infrastruktura kompilatora optymalizującego)
16 License: University of Illinois/NCSA Open Source License
17 Group: Development/Languages
18 Source0: http://llvm.org/releases/%{version}/%{name}-%{version}.tar.gz
19 # Source0-md5: 17254d72863b7fa005f3fb327aea3439
20 Source1: http://llvm.org/releases/%{version}/%{name}-gcc-%{lgcc_vertar}-%{version}.source.tar.gz
21 # Source1-md5: 18aa4f8226ddab58af2f12cff135470d
22 Patch0: %{name}-dirs.patch
25 BuildRequires: gcc >= 5:3.4
26 BuildRequires: libltdl-devel
27 %{?with_ocaml:BuildRequires: ocaml}
28 # gcc4 might be installed, but not current __cc
29 %if "%(echo %{cc_version} | cut -d. -f1,2)" < "3.4"
30 BuildRequires: __cc >= 3.4
32 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
34 %define _sysconfdir /etc/%{name}
36 # strip corrupts: $RPM_BUILD_ROOT/usr/lib64/llvm-gcc/bin/llvm-c++ ...
37 %define _noautostrip .*/\\(libmud.*\\.a\\|bin/llvm-.*\\|lib.*++\\.a\\)
40 LLVM is a compiler infrastructure designed for compile-time,
41 link-time, runtime, and idle-time optimization of programs from
42 arbitrary programming languages. LLVM is written in C++ and has been
43 developed since 2000 at the University of Illinois and Apple. It
44 currently supports compilation of C and C++ programs, using front-ends
45 derived from GCC 4.0.1. A new front-end for the C family of languages
46 is in development. The compiler infrastructure includes mirror sets of
47 programming tools as well as libraries with equivalent functionality.
49 %description -l pl.UTF-8
50 LLVM to infrastruktura kompilatora zaprojektowana do optymalizacji
51 czasu kompilowania, linkowania, działania i bezczynności programów w
52 dowolnych językach programowania. Jest napisana w C++, rozwijana od
53 roku 2000 przez Uniwersytet w Illinois i Apple. Aktualnie obsługuje
54 kompilację programów w C i C++ przy użyciu frontendów wywodzących się
55 z GCC 4.0.1. W trakcie tworzenia jest nowy frontend do języków z
56 rodziny C. Infrastruktura kompilatora zawiera lustrzane zestawy
57 narzędzi programistycznych oraz biblioteki z odpowiadającą narzędziom
61 Summary: Documentation for LLVM
63 Requires: %{name} = %{version}-%{release}
66 Documentation for the LLVM compiler infrastructure.
69 Summary: Libraries and header files for LLVM
70 Group: Development/Languages
71 Requires: %{name} = %{version}-%{release}
72 Requires: libstdc++-devel >= 6:3.4
75 This package contains library and header files needed to develop new
76 native programs that use the LLVM infrastructure.
79 Summary: C compiler for LLVM
81 Group: Development/Languages
82 Requires: %{name} = %{version}-%{release}
88 Summary: C++ compiler for LLVM
90 Group: Development/Languages
91 Requires: %{name}-gcc = %{version}-%{release}
94 C++ compiler for LLVM.
97 Summary: OCaml binding for LLVM
98 Group: Development/Libraries
99 Requires: %{name} = %{version}-%{release}
100 %requires_eq ocaml-runtime
103 OCaml binding for LLVM.
106 Summary: Development files for %{name}-ocaml
107 Group: Development/Libraries
108 Requires: %{name}-devel = %{version}-%{release}
109 Requires: %{name}-ocaml = %{version}-%{release}
111 %description ocaml-devel
112 The %{name}-ocaml-devel package contains libraries and signature files
113 for developing applications that use %{name}-ocaml.
116 %setup -q %{?with_gcc:-a1}
120 # bash specific 'test a < b'
122 --libdir=%{_libdir}/%{name} \
123 --datadir=%{_datadir}/%{name}-%{version} \
124 --enable-bindings=%{!?with_ocaml:no}%{?with_ocaml:ocaml} \
126 --enable-assertions \
127 --enable-debug-runtime \
133 %{__make} OPTIMIZE_OPTION="%{rpmcflags}"
138 export PATH=%{_builddir}/%{?buildsubdir}/Release/bin:$PATH
140 install -d llvm-gcc%{lgcc_vertar}-%{version}.source/build
141 cd llvm-gcc%{lgcc_vertar}-%{version}.source/build
145 --target=%{_target_platform} \
146 --prefix=%{_libdir}/llvm-gcc \
147 --libdir=%{_libdir}/llvm-gcc/%{_lib} \
154 --enable-languages=c,c++ \
155 --enable-llvm=%{_builddir}/%{?buildsubdir} \
156 --program-prefix=llvm-
158 %{__make} LLVM_VERSION_INFO=%{version}
162 rm -rf $RPM_BUILD_ROOT
165 DESTDIR=$RPM_BUILD_ROOT
167 find $RPM_BUILD_ROOT -name .dir | xargs rm -fv
169 # Get rid of erroneously installed example files.
170 rm $RPM_BUILD_ROOT%{_libdir}/%{name}/LLVMHello.*
175 %{__make} -C llvm-gcc%{lgcc_vertar}-%{version}.source/build install \
176 DESTDIR=$RPM_BUILD_ROOT
178 cd $RPM_BUILD_ROOT%{_libdir}/llvm-gcc/%{_lib}
179 find . -name '*.la' -print0 | xargs -0r rm
180 find . -name '*.a' -exec $RPM_BUILD_ROOT%{_bindir}/llvm-ranlib {} \;
182 ln llvm-c++ llvm-gcc llvm-g++ $RPM_BUILD_ROOT%{_bindir}
183 rm llvm-cpp llvm-gccbug llvm-gcov %{_target_platform}-gcc*
185 mv man/man1/llvm-gcc.1 man/man1/llvm-g++.1 $RPM_BUILD_ROOT%{_mandir}/man1
186 rm -r info man %{_lib}/libiberty.a
187 rm -r libexec/gcc/%{_target_platform}/%{lgcc_version}/install-tools
189 rm -r $RPM_BUILD_ROOT%{_libdir}/llvm-gcc/%{_lib}/gcc/%{_target_platform}/%{lgcc_version}/install-tools
190 rm -f $RPM_BUILD_ROOT%{_libdir}/llvm-gcc/%{_lib}/libgomp.a
191 rm -f $RPM_BUILD_ROOT%{_libdir}/llvm-gcc/%{_lib}/libgomp.spec
192 rm -f $RPM_BUILD_ROOT%{_libdir}/llvm-gcc/%{_lib}/libssp.a
193 rm -f $RPM_BUILD_ROOT%{_libdir}/llvm-gcc/%{_lib}/libssp_nonshared.a
197 rm -rf $RPM_BUILD_ROOT
199 %post -p /sbin/ldconfig
200 %postun -p /sbin/ldconfig
203 %defattr(644,root,root,755)
204 %doc CREDITS.TXT LICENSE.TXT README.txt
205 %attr(755,root,root) %{_bindir}/bugpoint
206 %attr(755,root,root) %{_bindir}/gccas
207 %attr(755,root,root) %{_bindir}/gccld
208 %attr(755,root,root) %{_bindir}/llc
209 %attr(755,root,root) %{_bindir}/lli
210 %attr(755,root,root) %{_bindir}/opt
211 %attr(755,root,root) %{_bindir}/llvmc2
212 %attr(755,root,root) %{_bindir}/llvm-*
213 %exclude %attr(755,root,root) %{_bindir}/llvm-config
214 %{_mandir}/man1/bugpoint.1*
215 %{_mandir}/man1/llc.1*
216 %{_mandir}/man1/lli.1*
217 %{_mandir}/man1/llvm-*.1*
218 %{_mandir}/man1/llvmgcc.1*
219 %{_mandir}/man1/llvmgxx.1*
220 %{_mandir}/man1/opt.1*
221 %{_mandir}/man1/stkrc.1*
222 %{_mandir}/man1/tblgen.1*
225 %defattr(644,root,root,755)
226 %doc docs/*.{html,css} docs/img examples
229 %defattr(644,root,root,755)
230 %attr(755,root,root) %{_bindir}/llvm-config
232 %{_includedir}/llvm-c
233 %{_libdir}/llvm/LLVM*.o
234 %{_libdir}/llvm/libLLVM*.a
238 %defattr(644,root,root,755)
239 #%attr(755,root,root) %{_bindir}/llvm2cpp
240 #%attr(755,root,root) %{_bindir}/llvmc
242 #%verify(not md5 mtime size) %config(noreplace) %{_sysconfdir}/c
243 #%verify(not md5 mtime size) %config(noreplace) %{_sysconfdir}/cpp
244 #%verify(not md5 mtime size) %config(noreplace) %{_sysconfdir}/ll
245 #%verify(not md5 mtime size) %config(noreplace) %{_sysconfdir}/st
246 #%{_mandir}/man1/llvm2cpp.1*
247 #%{_mandir}/man1/llvmc.1*
248 %attr(755,root,root) %{_bindir}/llvm-gcc
249 %dir %{_libdir}/llvm-gcc
250 %dir %{_libdir}/llvm-gcc/bin
251 %dir %{_libdir}/llvm-gcc/include
252 %dir %{_libdir}/llvm-gcc/%{_lib}
253 %dir %{_libdir}/llvm-gcc/libexec
254 %dir %{_libdir}/llvm-gcc/libexec/gcc
255 %dir %{_libdir}/llvm-gcc/libexec/gcc/%{_target_platform}/%{lgcc_version}
256 %{_libdir}/llvm-gcc/%{_lib}/gcc
257 %{_libdir}/llvm-gcc/%{_lib}/libmudflap*.a
258 %{_libdir}/llvm-gcc/bin/%{_target_platform}-llvm-gcc
259 %{_libdir}/llvm-gcc/bin/llvm-gcc
260 %{_libdir}/llvm-gcc/libexec/gcc/%{_target_platform}/%{lgcc_version}/cc1
261 %{_libdir}/llvm-gcc/libexec/gcc/%{_target_platform}/%{lgcc_version}/collect2
262 %{_mandir}/man1/llvm-gcc.*
265 %defattr(644,root,root,755)
266 #%verify(not md5 mtime size) %config(noreplace) %{_sysconfdir}/c++
267 #%verify(not md5 mtime size) %config(noreplace) %{_sysconfdir}/cxx
268 %attr(755,root,root) %{_bindir}/llvm-[cg]++
269 %{_libdir}/llvm-gcc/%{_lib}/lib*++.a
270 %{_libdir}/llvm-gcc/bin/%{_target_platform}-llvm-[cg]++
271 %{_libdir}/llvm-gcc/bin/llvm-[cg]++
272 %{_libdir}/llvm-gcc/include/c++
273 %{_libdir}/llvm-gcc/libexec/gcc/%{_target_platform}/%{lgcc_version}/cc1plus
274 %{_mandir}/man1/llvm-g++.*