ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/CMSDIST/gcc.spec
Revision: 1.50
Committed: Fri Jun 5 08:57:57 2009 UTC (15 years, 10 months ago) by eulisse
Branch: MAIN
CVS Tags: CMSSW_3_3_3_onlpatch5_ONLINE, CMSSW_3_3_3_onlpatch4_ONLINE, CMSSW_3_3_3_onlpatch2_ONLINE, CMSSW_3_3_3_onlpatch3_ONLINE, CMSSW_3_3_3_ONLINE, fw20091114b, fw20091114a, fw20091114, CMSSW_3_3_2_onlpatch2_ONLINE, CMSSW_3_3_2_ONLINE, CMSSW_3_3_2_onlpatch1_ONLINE, CMSSW_3_3_0_onlpatch2_ONLINE, CMSSW_3_2_7_onlpatch6_ONLINE, for330op2, for327op6, CMSSW_3_3_0_onlpatch1_ONLINE, CMSSW_3_2_7_onlpatch5_ONLINE, CMSSW_3_2_7_onlpatch4_ONLINE, sm327op4, CMSSW_3_3_0_ONLINE, sm091013a, sm091012c, sm091012b, sm091012a, CMSSW_3_2_7_onlpatch3_ONLINE, sm091007a, CMSSW_3_2_7_onlpatch2_ONLINE, sm090928a, CMSSW_3_2_7_onlpatch1_ONLINE, CMSSW_3_2_7_ONLINE, sm090923a, sm090922a, CMSSW_3_2_1_onlpatch6_ONLINE, sm090829a, CMSSW_3_2_1_onlpatch5_ONLINE, sm090826a, CMSSW_3_2_1_onlpatch4_ONLINE, sm090818a, CMSSW_3_2_4_ONLINE, sm090813e, sm090813d, sm090813c, sm090813b, sm090813a, CMSSW_3_2_1_onlpatch3_ONLINE, sm090810a, CMSSW_3_2_1_onlpatch2_ONLINE, sm090806a, CMSSW_3_2_1_onlpatch1_ONLINE, apFor321onlp1v1, apFor321onlp1v0, CMSSW_3_2_1_ONLINE, sm090721b, sm090721a, sm090720b, sm090720a, apFor320onlv1, CMSSW_3_1_1_onlpatch3_ONLINE, sm090716a, CMSSW_3_1_1_onlpatch2_ONLINE, sm090715c, sm090715b, sm090715a, CMSSW_3_ONLINE_BOOTSTRAP, sm090709a, CMSSW_3_1_1_onlpatch1_ONLINE, sm090708g, CMSSW_3_1_1_ONLINE, sm090708f, sm090708e, sm090708d, sm090708c, sm090708b, CMSSW_3_1_0_ONLINE2, sm090708a, CMSSW_3_1_0_onlpatch1_ONLINE, sm090703a, CMSSW_3_1_0_ONLINE, sm090701b, sm090701a, CMSSW_3_1_0_pre10_ONLINE, sm090621b, sm090621a, sm090620b, sm090620a, sm090619e, sm090619d, sm090619c, sm090619b, sm090619a, sm090618a, CMSSW_3_1_0_pre10-432, pe20090616a-31Xports-432, pe20090615a-31Xports-432, pe20090611c-31Xports-432, pe20090611b-31Xports-432, pe20090611a-31Xports-432, pe20090610d-31Xports-432, pe20090610c-31Xports-432, pe20090610b-31Xports-432, pe20090610a-31Xports-432
Changes since 1.49: +1 -18 lines
Log Message:
Clean up of gcc.spec

* Remove gold support in case we are using our own binutils since
  it completely replaces the old linker.
* Remove commented code.

File Contents

# Content
1 ### RPM external gcc 4.3.2
2 ## BUILDIF case `uname`:`uname -p` in Linux:i*86 ) true ;; Linux:x86_64 ) true ;; Linux:ppc64 ) false ;; Darwin:* ) false ;; * ) true ;; esac
3 ## INITENV +PATH LD_LIBRARY_PATH %i/lib/32
4 ## INITENV +PATH LD_LIBRARY_PATH %i/lib64
5 Source0: ftp://ftp.fu-berlin.de/unix/gnu/%n/%n-%realversion/%n-%realversion.tar.bz2
6 %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
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 %define gmpVersion 4.2.4
18 %define mpfrVersion 2.3.2
19 Source1: ftp://ftp.gnu.org/gnu/gmp/gmp-%{gmpVersion}.tar.bz2
20 Source2: http://www.mpfr.org/mpfr-%{mpfrVersion}/mpfr-%{mpfrVersion}.tar.bz2
21 Patch0: binutils-2.19.1-fix-gold
22
23 %define cpu %(echo %cmsplatf | cut -d_ -f2)
24 %define gcc_major %(echo %realversion | cut -f1 -d.)
25 %prep
26 %setup -T -b 0 -n gcc-%realversion
27
28 case %cmsos in
29 "slc4_ia32" | "slc5_ia32" )
30 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 #undef ASM_SPEC
38 #define ASM_SPEC "%%{v:-V} %%{Qy:} %%{!Qn:-Qy} %%{n} %%{T} %%{Ym,*} %%{Yd,*} %%{Wa,*:%%*} --32"
39 #undef CC1_SPEC
40 #define CC1_SPEC "%%(cc1_cpu) %%{profile:-p} -m32"
41 #undef CC1PLUS_SPEC
42 #define CC1PLUS_SPEC "-m32"
43 #undef MULTILIB_DEFAULTS
44 #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 ;;
53 esac
54
55 %if "%{?binutilsv:set}" == "set"
56 %setup -D -T -b 3 -n binutils-%binutilsv
57 %patch0 -p1
58 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 %endif
66
67 %setup -D -T -b 1 -n gmp-%{gmpVersion}
68 %setup -D -T -b 2 -n mpfr-%{mpfrVersion}
69
70 %build
71 # 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 *:slc5_ia32 )
79 CCOPTS="-m32 -Wa,--32" ;;
80 * )
81 CCOPTS="" ;;
82 esac
83
84 # If requested, build our own binutils. Currently the default is to use
85 # the system binutils.
86 %if "%{?binutilsv:set}" == "set"
87 cd ../binutils-%{binutilsv}
88 CC="gcc $CCOPTS" ./configure --prefix=%i
89 make %makeprocesses
90 make install
91 %endif
92
93 # Build GMP/MPFR for GCC 4.x
94 %define gcc4opts %{nil}
95 %if "%gcc_major" == "4"
96 cd ../gmp-%{gmpVersion}
97 CC="gcc $CCOPTS" ./configure --prefix=%i/tmp/gmp --disable-shared
98 make %makeprocesses
99 make install
100
101 cd ../mpfr-%{mpfrVersion}
102 CC="gcc $CCOPTS" ./configure --prefix=%i/tmp/mpfr --with-gmp=%i/tmp/gmp --disable-shared
103 make %makeprocesses
104 make install
105 %define gcc4opts --with-gmp=%i/tmp/gmp --with-mpfr=%i/tmp/mpfr
106 %endif
107
108 # Build the compilers
109 cd ../gcc-%realversion
110 mkdir -p obj
111 cd obj
112 CC="gcc $CCOPTS" \
113 ../configure --prefix=%i \
114 --enable-languages=c,c++,`case %v in 3.*) echo f77;; *) echo fortran;; esac` \
115 %gcc4opts --enable-shared
116
117 make %makeprocesses bootstrap
118
119 %install
120 cd %_builddir/gcc-%{realversion}/obj && make install
121 ln -s gcc %i/bin/cc
122 find %i/lib %i/lib32 %i/lib64 -name '*.la' -exec rm -f {} \; || true
123
124 # SCRAM ToolBox toolfile is now geneated by the gcc-toolfile.spec
125 # so that everything works even in the case "--use-system-compiler"
126 # option is specified.