ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/CMSDIST/gcc.spec
Revision: 1.51
Committed: Thu Jun 11 20:57:42 2009 UTC (15 years, 10 months ago) by eulisse
Branch: MAIN
CVS Tags: apFor333v1-sl4igcc4, apFor333v0_sl4igcc4, pe20091110c-34X-slc4-gcc432, pe20091110c-for33X-slc4-gcc432, pe20091110b-for33X-slc4-gcc432, pe20091110a-for33X-slc4-gcc432, pe20091108c-34X-slc4-gcc432, pe20091108b-34X-slc4-gcc432, pe20091108a-34X-slc4-gcc432, pe20091106a-34X-slc4-gcc432, CMSSW_3_4_0_pre5-slc4-gcc432, CMSSW_3_4_0_pre4-slc4-gcc432, CMSSW_3_4_0_pre5-slc4_gcc432, dl091106, pe20091103d-34X-slc4-gcc432, pe20091103c-34X-slc4-gcc432, pe20091103b-slc4-gcc432, pe20091103a-slc4-gcc432, pe20091103a--slc4-gcc432, eskFor340p4, CMSSW_3_3_2-slc4-gcc432, apFor332v0_sl4igcc4, CMSSW_3_4_0_pre3, eskFor340p3, CMSSW_3_3_1-slc4-gcc432, pe20091022a-ports, pe20091021a-ports, CMSSW_3_4_0_pre2-432, CMSSW_3_4_0_pre1-432, CMSSW_3_3_0-432, pe20091008d-ports, CMSSW_3_3_0_pre6-432, pe20091006a-ports, PerfSuiteDB_20090930, pe20090929a-ports, ge20090929-amd64, ge20090929-ia32, ap20090929a-ports, CMSSW_3_3_0_pre5-432, pe20090925a-ports, pe20090924a-ports, pe20090923b-ports, pe20090923a-ports, pe20090922e-ports, pe20090922d-ports, pe20090922c-ports, pe20090922b-ports, pe20090922a-ports, ge20090922-ports, pe20090921d-ports, ge20090921-ports, pe20090921c-ports, PerfSuiteDB_20090916, pe20090912a-ports-xdaq, pe20090911a-ports-xdaq, pe20090910-fromDAS_20090709, pe20090907a-ports, apFor330pre2v0, PerfSuiteDB_20090904_almost_stable, pe20090904a-ports, PerfSuiteDB_20090904, pe20090903b-ports, pe20090903a-ports, PerfSuiteDB_20090901, forHEARTBEATr04, pe20090827a-ports, pe20090826a-ports, RPMVERIFY_0_2, forHEARTBEATr01, CMSSW_3_2_1-432, pe20090722b-31Xports-432, pe20090722a-31Xports-432, popcon_monitoring-V01-00-00, pe20090707c-31Xports-432, pe20090707b-31Xports-432, pe20090707a-31Xports-432, pe20090706b-31Xports-432, pe20090706a-31Xports-432, pe20090701a-31Xports-432
Changes since 1.50: +4 -2 lines
Log Message:
Works around hard link creation for binutils.

File Contents

# User Rev Content
1 elmer 1.48 ### RPM external gcc 4.3.2
2 eulisse 1.46 ## BUILDIF case `uname`:`uname -p` in Linux:i*86 ) true ;; Linux:x86_64 ) true ;; Linux:ppc64 ) false ;; Darwin:* ) false ;; * ) true ;; esac
3 eulisse 1.3 ## INITENV +PATH LD_LIBRARY_PATH %i/lib/32
4 eulisse 1.16 ## INITENV +PATH LD_LIBRARY_PATH %i/lib64
5 dlange 1.17 Source0: ftp://ftp.fu-berlin.de/unix/gnu/%n/%n-%realversion/%n-%realversion.tar.bz2
6 eulisse 1.46 %if "%(echo %cmsos | cut -f2 -d_)" == "amd64"
7     %define binutilsv 2.19.1
8     Source3: http://ftp.gnu.org/gnu/binutils/binutils-%binutilsv.tar.bz2
9     %endif
10    
11 eulisse 1.18
12     # If gcc version >= 4.0.0, we need two additional sources, for gmp and mpfr,
13     # and we set the fortranCompiler macro (which is going to be used by the
14     # --enable-languages option of gcc's configure) to gfortran.
15     # Notice that we need to build those twice: once using the system compiler
16     # and the using the newly built gcc.
17 elmer 1.44 %define gmpVersion 4.2.4
18     %define mpfrVersion 2.3.2
19 eulisse 1.46 Source1: ftp://ftp.gnu.org/gnu/gmp/gmp-%{gmpVersion}.tar.bz2
20     Source2: http://www.mpfr.org/mpfr-%{mpfrVersion}/mpfr-%{mpfrVersion}.tar.bz2
21 eulisse 1.49 Patch0: binutils-2.19.1-fix-gold
22 eulisse 1.18
23 eulisse 1.11 %define cpu %(echo %cmsplatf | cut -d_ -f2)
24 eulisse 1.31 %define gcc_major %(echo %realversion | cut -f1 -d.)
25 eulisse 1.16 %prep
26 dlange 1.17 %setup -T -b 0 -n gcc-%realversion
27 dlange 1.15
28 elmer 1.43 case %cmsos in
29     "slc4_ia32" | "slc5_ia32" )
30 eulisse 1.16 cat << \EOF_CONFIG_GCC >> gcc/config.gcc
31     # CMS patch to include gcc/config/i386/t-cms when building gcc
32     tm_file="$tm_file i386/cms.h"
33     tmake_file="$tmake_file i386/t-cms"
34     EOF_CONFIG_GCC
35    
36     cat << \EOF_CMS_H > gcc/config/i386/cms.h
37 eulisse 1.20 #undef ASM_SPEC
38 eulisse 1.16 #define ASM_SPEC "%%{v:-V} %%{Qy:} %%{!Qn:-Qy} %%{n} %%{T} %%{Ym,*} %%{Yd,*} %%{Wa,*:%%*} --32"
39 eulisse 1.20 #undef CC1_SPEC
40 eulisse 1.16 #define CC1_SPEC "%%(cc1_cpu) %%{profile:-p} -m32"
41 eulisse 1.20 #undef CC1PLUS_SPEC
42 eulisse 1.16 #define CC1PLUS_SPEC "-m32"
43 eulisse 1.20 #undef MULTILIB_DEFAULTS
44 eulisse 1.16 #define MULTILIB_DEFAULTS { "m32" }
45     EOF_CMS_H
46    
47     cat << \EOF_T_CMS > gcc/config/i386/t-cms
48     MULTILIB_OPTIONS = m32
49     MULTILIB_DIRNAMES = ../lib
50     MULTILIB_MATCHES = m32=m32
51     EOF_T_CMS
52 elmer 1.43 ;;
53     esac
54 dlange 1.15
55 eulisse 1.46 %if "%{?binutilsv:set}" == "set"
56     %setup -D -T -b 3 -n binutils-%binutilsv
57 eulisse 1.49 %patch0 -p1
58 eulisse 1.47 case %cmsos in
59     slc*_amd64 )
60     # This patches the default linker script to align stuff at 4096 kB boundaries rather
61     # than the default 2MB (MAXPAGESIZE value for x86_64 architecture).
62     perl -p -i -e 's|\$[{]MAXPAGESIZE[}]|4096|g;s|\$[{]SEGMENT_SIZE[}]|4096|g' ld/scripttempl/elf.sc
63     ;;
64     esac
65 eulisse 1.46 %endif
66    
67     %setup -D -T -b 1 -n gmp-%{gmpVersion}
68     %setup -D -T -b 2 -n mpfr-%{mpfrVersion}
69 eulisse 1.18
70 argiro 1.1 %build
71 eulisse 1.20 # Set special variables required to build 32-bit executables on 64-bit
72     # systems. Note that if the architecture is SLC4/IA32, we may be on a
73     # 64-bit system and need to produce a 32-bit capable compiler, which
74     # _itself_ is a 32-bit executable.
75     case $(uname -m):%{cmsos} in
76     *:slc4_ia32 )
77     CCOPTS="-m32 -Wa,--32" ;;
78 elmer 1.43 *:slc5_ia32 )
79     CCOPTS="-m32 -Wa,--32" ;;
80 eulisse 1.20 * )
81     CCOPTS="" ;;
82     esac
83     # If requested, build our own binutils. Currently the default is to use
84     # the system binutils.
85 eulisse 1.46 %if "%{?binutilsv:set}" == "set"
86 eulisse 1.20 cd ../binutils-%{binutilsv}
87 eulisse 1.50 CC="gcc $CCOPTS" ./configure --prefix=%i
88 eulisse 1.20 make %makeprocesses
89 eulisse 1.51 perl -p -i -e 's|LN = ln|LN = cp -p|;s|ln ([^-])|cp -p $1|g' `find . -name Makefile`
90 eulisse 1.20 make install
91 eulisse 1.18 %endif
92 eulisse 1.16
93 eulisse 1.20 # Build GMP/MPFR for GCC 4.x
94 eulisse 1.31 %define gcc4opts %{nil}
95     %if "%gcc_major" == "4"
96 eulisse 1.19 cd ../gmp-%{gmpVersion}
97 eulisse 1.20 CC="gcc $CCOPTS" ./configure --prefix=%i/tmp/gmp --disable-shared
98 eulisse 1.19 make %makeprocesses
99 eulisse 1.20 make install
100 eulisse 1.19
101     cd ../mpfr-%{mpfrVersion}
102 eulisse 1.20 CC="gcc $CCOPTS" ./configure --prefix=%i/tmp/mpfr --with-gmp=%i/tmp/gmp --disable-shared
103 eulisse 1.19 make %makeprocesses
104 eulisse 1.31 make install
105     %define gcc4opts --with-gmp=%i/tmp/gmp --with-mpfr=%i/tmp/mpfr
106     %endif
107 eulisse 1.19
108 eulisse 1.20 # Build the compilers
109 elmer 1.21 cd ../gcc-%realversion
110 eulisse 1.18 mkdir -p obj
111     cd obj
112 eulisse 1.51
113 eulisse 1.20 CC="gcc $CCOPTS" \
114     ../configure --prefix=%i \
115     --enable-languages=c,c++,`case %v in 3.*) echo f77;; *) echo fortran;; esac` \
116 eulisse 1.31 %gcc4opts --enable-shared
117 eulisse 1.18
118     make %makeprocesses bootstrap
119 eulisse 1.16
120 argiro 1.1 %install
121 eulisse 1.51 cd %_builddir/gcc-%{realversion}/obj && make install
122    
123 argiro 1.1 ln -s gcc %i/bin/cc
124 eulisse 1.20 find %i/lib %i/lib32 %i/lib64 -name '*.la' -exec rm -f {} \; || true
125    
126 eulisse 1.40 # SCRAM ToolBox toolfile is now geneated by the gcc-toolfile.spec
127     # so that everything works even in the case "--use-system-compiler"
128     # option is specified.