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.4 by elmer, Fri Sep 11 16:57:11 2009 UTC vs.
Revision 1.8 by elmer, Wed Jan 26 15:27:15 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
4 ## INITENV SET GCC_ROOT %i
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
8 < %define gmpVersion 4.2.1
9 < %define mpfrVersion 2.2.1
10 < %define tmpgccVersion 4.2.2
11 < Source2: ftp://ftp.gnu.org/gnu/gmp/gmp-%{gmpVersion}.tar.bz2
12 < Source3: http://www.mpfr.org/mpfr-%{mpfrVersion}/mpfr-%{mpfrVersion}.tar.bz2
13 < 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
20 < # CMS patch to include gcc/config/i386/t-cms when building gcc
21 < tm_file="$tm_file i386/cms.h"
22 < tmake_file="$tmake_file i386/t-cms"
23 < EOF_CONFIG_GCC
24 <
25 < cat << \EOF_CMS_H > gcc/config/i386/cms.h
26 < #undef ASM_SPEC
27 < #define ASM_SPEC  "%%{v:-V} %%{Qy:} %%{!Qn:-Qy} %%{n} %%{T} %%{Ym,*} %%{Yd,*} %%{Wa,*:%%*} --32"
28 < #undef CC1_SPEC
29 < #define CC1_SPEC  "%%(cc1_cpu) %%{profile:-p} -m32"
30 < #undef CC1PLUS_SPEC
31 < #define CC1PLUS_SPEC "-m32"
32 < #undef MULTILIB_DEFAULTS
33 < #define MULTILIB_DEFAULTS { "m32" }
34 < EOF_CMS_H
35 <
36 < cat << \EOF_T_CMS > gcc/config/i386/t-cms
37 < MULTILIB_OPTIONS = m32
38 < MULTILIB_DIRNAMES = ../lib
39 < MULTILIB_MATCHES = m32=m32
40 < EOF_T_CMS
41 < %endif
42 <
43 < %setup -D -T -b 1 -n llvm-%realversion
44 < %setup -D -T -b 2 -n gmp-%{gmpVersion}
45 < %setup -D -T -b 3 -n mpfr-%{mpfrVersion}
46 < %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
51 < cd ../gmp-%{gmpVersion}
52 < CC="gcc $CCOPTS" ./configure --prefix=%i/tmp/gmp --disable-shared
53 < make %makeprocesses
54 < make install
55 < cd ../mpfr-%{mpfrVersion}
56 < CC="gcc $CCOPTS" ./configure --prefix=%i/tmp/mpfr --with-gmp=%i/tmp/gmp --disable-shared
57 < make %makeprocesses
58 < make install
59 < %define gcc4opts --with-gmp=%i/tmp/gmp --with-mpfr=%i/tmp/mpfr
60 <
61 < # build a temporary gcc (c,c++ only) to use for the build
62 < cd ../gcc-%tmpgccVersion
63 < mkdir -p obj
64 < cd obj
65 < CC="gcc $CCOPTS" \
66 < ../configure --prefix=%i/tmp/gcc \
67 <  --enable-languages=c,c++ %gcc4opts --enable-shared
68 < make %makeprocesses bootstrap
69 < make install
70 < find %i/tmp/gcc/lib %i/tmp/gcc/lib32 %i/tmp/gcc/lib64 -name '*.la' -exec rm -f {} \; || true
71 <
72 <
73 < # Build llvm using the temp gcc
74 < export CC=%i/tmp/gcc/bin/gcc
75 < export CXX=%i/tmp/gcc/bin/g++
76 < export PATH=%i/tmp/gcc/bin:$PATH
77 < export LD_LIBRARY_PATH=%i/tmp/gcc/lib64:%i/tmp/gcc/lib:$LD_LIBRARY_PATH
78 < export GCC_VERSION=%{tmpgccVersion}
79 < export GCC_ROOT=%i/tmp/gcc
80 < export GCC_REVISION=1
81 < cd ../..
82 < mkdir llvm-objects
83 < cd llvm-objects
84 < ../llvm-%realversion/configure --prefix=%i --enable-optimized
85 < make %makeprocesses
86 < make install
87 < # Build the llvm-gcc front-end
88 < cd ../llvm-gcc4.2-%realversion.source
89 < ./configure --prefix=%i %gcc4opts --enable-llvm=`pwd`/../llvm-objects --enable-languages=c,c++
90 < rm GNUmakefile
14 > mkdir objs ; cd objs
15 > ../configure --prefix=%i --enable-optimized
16   make %makeprocesses
92 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)
97 < 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
100 # SCRAM ToolBox toolfile
101 mkdir -p %i/etc/scram.d
102 cat << \EOF_TOOLFILE >%i/etc/scram.d/%n
103 <doc type=BuildSystem::ToolDoc version=1.0>
104 <Tool name=%n version=%v>
105 <lib name=z>
106 <client>
107 <Environment name=ZLIB_BASE default="%i"></Environment>
108 <Environment name=INCLUDE default="$ZLIB_BASE/include"></Environment>
109 <Environment name=LIBDIR  default="$ZLIB_BASE/lib"></Environment>
110 </client>
111 </Tool>
112 EOF_TOOLFILE
23  
24 < %post
25 < %{relocateConfig}etc/scram.d/%n
24 > case %cmsos in
25 >  osx*)
26 >    #Fix up install names for some of the libraries.
27 >    for x in BugpointPasses.dylib profile_rt.dylib LLVMHello.dylib
28 >    do
29 >      install_name_tool -change $x lib$x -id lib$x %i/lib/lib$x
30 >    done
31 >  ;;
32 > esac
33 >

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines