1 |
|
### RPM external llvm 2.5 |
2 |
+ |
## NOCOMPILER |
3 |
+ |
## INITENV +PATH LD_LIBRARY_PATH %i/lib64 |
4 |
+ |
|
5 |
|
Source0: http://llvm.org/releases/%realversion/%n-gcc-4.2-%realversion.source.tar.gz |
6 |
|
Source1: http://llvm.org/releases/%realversion/%n-%realversion.tar.gz |
7 |
|
%define gmpVersion 4.2.1 |
8 |
|
%define mpfrVersion 2.2.1 |
9 |
+ |
%define tmpgccVersion 4.2.2 |
10 |
|
Source2: ftp://ftp.gnu.org/gnu/gmp/gmp-%{gmpVersion}.tar.bz2 |
11 |
|
Source3: http://www.mpfr.org/mpfr-%{mpfrVersion}/mpfr-%{mpfrVersion}.tar.bz2 |
12 |
+ |
Source4: ftp://ftp.fu-berlin.de/unix/gnu/gcc/gcc-%tmpgccVersion/gcc-%tmpgccVersion.tar.bz2 |
13 |
|
|
14 |
|
%prep |
15 |
|
%setup -T -b 0 -n llvm-gcc4.2-%realversion.source |
42 |
|
%setup -D -T -b 1 -n llvm-%realversion |
43 |
|
%setup -D -T -b 2 -n gmp-%{gmpVersion} |
44 |
|
%setup -D -T -b 3 -n mpfr-%{mpfrVersion} |
45 |
+ |
%setup -D -T -b 4 -n gcc-%{tmpgccVersion} |
46 |
|
|
47 |
|
%build |
48 |
|
%define gcc4opts %{nil} |
57 |
|
make install |
58 |
|
%define gcc4opts --with-gmp=%i/tmp/gmp --with-mpfr=%i/tmp/mpfr |
59 |
|
|
60 |
< |
# Build llvm |
61 |
< |
cd .. |
60 |
> |
# build a temporary gcc (c,c++ only) to use for the build |
61 |
> |
cd ../gcc-%tmpgccVersion |
62 |
> |
mkdir -p obj |
63 |
> |
cd obj |
64 |
> |
CC="gcc $CCOPTS" \ |
65 |
> |
../configure --prefix=%i/tmp/gcc \ |
66 |
> |
--enable-languages=c,c++ %gcc4opts --enable-shared |
67 |
> |
make %makeprocesses bootstrap |
68 |
> |
make install |
69 |
> |
find %i/tmp/gcc/lib %i/tmp/gcc/lib32 %i/tmp/gcc/lib64 -name '*.la' -exec rm -f {} \; || true |
70 |
> |
|
71 |
> |
|
72 |
> |
# Build llvm using the temp gcc |
73 |
> |
export CC=%i/tmp/gcc/bin/gcc |
74 |
> |
export CXX=%i/tmp/gcc/bin/g++ |
75 |
> |
export PATH=%i/tmp/gcc/bin:$PATH |
76 |
> |
export LD_LIBRARY_PATH=%i/tmp/gcc/lib64:%i/tmp/gcc/lib:$LD_LIBRARY_PATH |
77 |
> |
export GCC_VERSION=%{tmpgccVersion} |
78 |
> |
export GCC_ROOT=%i/tmp/gcc |
79 |
> |
export GCC_REVISION=1 |
80 |
> |
cd ../.. |
81 |
|
mkdir llvm-objects |
82 |
|
cd llvm-objects |
83 |
|
../llvm-%realversion/configure --prefix=%i --enable-optimized |
91 |
|
make install |
92 |
|
|
93 |
|
%install |
94 |
+ |
# Clean up the temporary builds of mpfr and gmp (which had only .a libs) |
95 |
+ |
# and gcc (which should no longer be needed) |
96 |
+ |
rm -fR %i/tmp |
97 |
|
# Fix up a perl path |
98 |
|
perl -p -i -e 's|^#!.*perl(.*)|#!/usr/bin/env perl$1|' %i/bin/llvm-config |
99 |
|
# SCRAM ToolBox toolfile |