ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/CMSDIST/llvm.spec
(Generate patch)

Comparing COMP/CMSDIST/llvm.spec (file contents):
Revision 1.3 by elmer, Fri Sep 11 15:56:42 2009 UTC vs.
Revision 1.6 by eulisse, Thu Jan 20 10:09:40 2011 UTC

# Line 1 | Line 1
1 < ### RPM external llvm 2.5
2 < ## NOCOMPILER
1 > ### RPM external llvm 2.8
2   ## INITENV +PATH LD_LIBRARY_PATH %i/lib64
3  
4 < Source0: http://llvm.org/releases/%realversion/%n-gcc-4.2-%realversion.source.tar.gz
5 < 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
4 > Source0: http://llvm.org/releases/%realversion/llvm-%realversion.tgz
5 > Source1: http://llvm.org/releases/%realversion/clang-%realversion.tgz
6  
7   %prep
8 < %setup -T -b 0 -n llvm-gcc4.2-%realversion.source
9 <
10 < %if "%cmsos" == "slc4_ia32"
11 < cat << \EOF_CONFIG_GCC >> gcc/config.gcc
19 < # CMS patch to include gcc/config/i386/t-cms when building gcc
20 < tm_file="$tm_file i386/cms.h"
21 < tmake_file="$tmake_file i386/t-cms"
22 < EOF_CONFIG_GCC
23 <
24 < cat << \EOF_CMS_H > gcc/config/i386/cms.h
25 < #undef ASM_SPEC
26 < #define ASM_SPEC  "%%{v:-V} %%{Qy:} %%{!Qn:-Qy} %%{n} %%{T} %%{Ym,*} %%{Yd,*} %%{Wa,*:%%*} --32"
27 < #undef CC1_SPEC
28 < #define CC1_SPEC  "%%(cc1_cpu) %%{profile:-p} -m32"
29 < #undef CC1PLUS_SPEC
30 < #define CC1PLUS_SPEC "-m32"
31 < #undef MULTILIB_DEFAULTS
32 < #define MULTILIB_DEFAULTS { "m32" }
33 < EOF_CMS_H
34 <
35 < cat << \EOF_T_CMS > gcc/config/i386/t-cms
36 < MULTILIB_OPTIONS = m32
37 < MULTILIB_DIRNAMES = ../lib
38 < MULTILIB_MATCHES = m32=m32
39 < EOF_T_CMS
40 < %endif
41 <
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}
8 > %setup -T -b0 -n llvm-%realversion
9 > %setup -T -D -a1 -c -n llvm-%realversion/tools
10 > mv clang-%realversion clang
11 > %setup -T -D -n llvm-%realversion
12  
13   %build
14 < %define gcc4opts %{nil}
15 < # Build GMP/MPFR for GCC 4.x
50 < cd ../gmp-%{gmpVersion}
51 < CC="gcc $CCOPTS" ./configure --prefix=%i/tmp/gmp --disable-shared
14 > mkdir objs ; cd objs
15 > ../configure --prefix=%i --enable-optimized
16   make %makeprocesses
53 make install
54 cd ../mpfr-%{mpfrVersion}
55 CC="gcc $CCOPTS" ./configure --prefix=%i/tmp/mpfr --with-gmp=%i/tmp/gmp --disable-shared
56 make %makeprocesses
57 make install
58 %define gcc4opts --with-gmp=%i/tmp/gmp --with-mpfr=%i/tmp/mpfr
59
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
84 make %makeprocesses
85 make install
86 # Build the llvm-gcc front-end
87 cd ../llvm-gcc4.2-%realversion.source
88 ./configure --prefix=%i %gcc4opts --enable-llvm=`pwd`/../llvm-objects --enable-languages=c,c++
89 rm GNUmakefile
90 make %makeprocesses
91 make install
17  
18   %install
19 < # Clean up the temporary builds of mpfr and gmp (which had only .a libs)
20 < # and gcc (which should no longer be needed)
96 < rm -fR %i/tmp
19 > cd objs
20 > make install
21   # Fix up a perl path
22   perl -p -i -e 's|^#!.*perl(.*)|#!/usr/bin/env perl$1|' %i/bin/llvm-config
99 # SCRAM ToolBox toolfile
100 mkdir -p %i/etc/scram.d
101 cat << \EOF_TOOLFILE >%i/etc/scram.d/%n
102 <doc type=BuildSystem::ToolDoc version=1.0>
103 <Tool name=%n version=%v>
104 <lib name=z>
105 <client>
106 <Environment name=ZLIB_BASE default="%i"></Environment>
107 <Environment name=INCLUDE default="$ZLIB_BASE/include"></Environment>
108 <Environment name=LIBDIR  default="$ZLIB_BASE/lib"></Environment>
109 </client>
110 </Tool>
111 EOF_TOOLFILE
112
113 %post
114 %{relocateConfig}etc/scram.d/%n

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines