]> git.pld-linux.org Git - packages/llvm.git/blob - llvm.spec
- gcc builds, packages
[packages/llvm.git] / llvm.spec
1 # TODO
2 # - gcc/c++ packages: http://cvs.fedoraproject.org/viewvc/rpms/llvm/devel/llvm.spec?revision=HEAD&view=markup
3 # - test gcc pkgs and all
4 #
5 # Conditional build:
6 %bcond_with             ocaml   # build without OCaml bindings
7 %bcond_without          gcc             # build without gcc
8 #
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)
13 Name:           llvm
14 Version:        2.3
15 Release:        0.1
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
23 URL:            http://llvm.org/
24 BuildRequires:  bash
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
31 %endif
32 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
33
34 %define         _sysconfdir     /etc/%{name}
35
36 # strip corrupts: $RPM_BUILD_ROOT/usr/lib64/llvm-gcc/bin/llvm-c++ ...
37 %define         _noautostrip    .*/\\(libmud.*\\.a\\|bin/llvm-.*\\|lib.*++\\.a\\)
38
39 %description
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.
48
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
58 funkcjonalnością.
59
60 %package doc
61 Summary:        Documentation for LLVM
62 Group:          Documentation
63 Requires:       %{name} = %{version}-%{release}
64
65 %description doc
66 Documentation for the LLVM compiler infrastructure.
67
68 %package devel
69 Summary:        Libraries and header files for LLVM
70 Group:          Development/Languages
71 Requires:       %{name} = %{version}-%{release}
72 Requires:       libstdc++-devel >= 6:3.4
73
74 %description devel
75 This package contains library and header files needed to develop new
76 native programs that use the LLVM infrastructure.
77
78 %package gcc
79 Summary:        C compiler for LLVM
80 License:        GPL+
81 Group:          Development/Languages
82 Requires:       %{name} = %{version}-%{release}
83
84 %description gcc
85 C compiler for LLVM.
86
87 %package gcc-c++
88 Summary:        C++ compiler for LLVM
89 License:        GPL+
90 Group:          Development/Languages
91 Requires:       %{name}-gcc = %{version}-%{release}
92
93 %description gcc-c++
94 C++ compiler for LLVM.
95
96 %package ocaml
97 Summary:        OCaml binding for LLVM
98 Group:          Development/Libraries
99 Requires:       %{name} = %{version}-%{release}
100 %requires_eq    ocaml-runtime
101
102 %description    ocaml
103 OCaml binding for LLVM.
104
105 %package ocaml-devel
106 Summary:        Development files for %{name}-ocaml
107 Group:          Development/Libraries
108 Requires:       %{name}-devel = %{version}-%{release}
109 Requires:       %{name}-ocaml = %{version}-%{release}
110
111 %description ocaml-devel
112 The %{name}-ocaml-devel package contains libraries and signature files
113 for developing applications that use %{name}-ocaml.
114
115 %prep
116 %setup -q %{?with_gcc:-a1}
117 %patch0 -p0
118
119 %build
120 # bash specific 'test a < b'
121 bash %configure \
122         --libdir=%{_libdir}/%{name} \
123         --datadir=%{_datadir}/%{name}-%{version} \
124         --enable-bindings=%{!?with_ocaml:no}%{?with_ocaml:ocaml} \
125         --disable-static \
126         --enable-assertions \
127         --enable-debug-runtime \
128         --enable-jit \
129         --enable-optimized \
130         --enable-shared \
131         --with-pic
132
133 %{__make} OPTIMIZE_OPTION="%{rpmcflags}"
134
135 %if %{with gcc}
136 # Build llvm-gcc.
137
138 export PATH=%{_builddir}/%{?buildsubdir}/Release/bin:$PATH
139
140 install -d llvm-gcc%{lgcc_vertar}-%{version}.source/build
141 cd llvm-gcc%{lgcc_vertar}-%{version}.source/build
142 ../configure \
143         --host=%{_host} \
144         --build=%{_build} \
145         --target=%{_target_platform} \
146         --prefix=%{_libdir}/llvm-gcc \
147         --libdir=%{_libdir}/llvm-gcc/%{_lib} \
148         --enable-threads \
149         --disable-nls \
150 %ifarch %{x8664}
151         --disable-multilib \
152         --disable-shared \
153 %endif
154         --enable-languages=c,c++ \
155         --enable-llvm=%{_builddir}/%{?buildsubdir} \
156         --program-prefix=llvm-
157
158 %{__make} LLVM_VERSION_INFO=%{version}
159 %endif
160
161 %install
162 rm -rf $RPM_BUILD_ROOT
163
164 %{__make} install \
165         DESTDIR=$RPM_BUILD_ROOT
166
167 find $RPM_BUILD_ROOT -name .dir | xargs rm -fv
168
169 # Get rid of erroneously installed example files.
170 rm $RPM_BUILD_ROOT%{_libdir}/%{name}/LLVMHello.*
171
172 %if %{with gcc}
173 # Install llvm-gcc.
174
175 %{__make} -C llvm-gcc%{lgcc_vertar}-%{version}.source/build install \
176         DESTDIR=$RPM_BUILD_ROOT
177
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 {} \;
181 cd ../bin
182 ln llvm-c++ llvm-gcc llvm-g++ $RPM_BUILD_ROOT%{_bindir}
183 rm llvm-cpp llvm-gccbug llvm-gcov %{_target_platform}-gcc*
184 cd ..
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
188
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
194 %endif
195
196 %clean
197 rm -rf $RPM_BUILD_ROOT
198
199 %post   -p /sbin/ldconfig
200 %postun -p /sbin/ldconfig
201
202 %files
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*
223
224 %files doc
225 %defattr(644,root,root,755)
226 %doc docs/*.{html,css} docs/img examples
227
228 %files devel
229 %defattr(644,root,root,755)
230 %attr(755,root,root) %{_bindir}/llvm-config
231 %{_includedir}/llvm
232 %{_includedir}/llvm-c
233 %{_libdir}/llvm/LLVM*.o
234 %{_libdir}/llvm/libLLVM*.a
235
236 %if %{with gcc}
237 %files gcc
238 %defattr(644,root,root,755)
239 #%attr(755,root,root) %{_bindir}/llvm2cpp
240 #%attr(755,root,root) %{_bindir}/llvmc
241 #%dir %{_sysconfdir}
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.*
263
264 %files gcc-c++
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++.*
275 %endif
This page took 0.046889 seconds and 4 git commands to generate.