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

Comparing COMP/CMSDIST/gcc.spec (file contents):
Revision 1.13 by ratnik, Wed Apr 18 23:46:01 2007 UTC vs.
Revision 1.49 by eulisse, Fri May 29 08:46:10 2009 UTC

# Line 1 | Line 1
1 < ### RPM external gcc 3.4.5
2 < Requires: gcc-wrapper
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 < ## BUILDIF case $(uname):$(uname -p) in Linux:i*86 ) true ;; Linux:x86_64 ) true ;;  Linux:ppc64 ) false ;; Darwin:* ) false ;; * ) true ;; esac
6 < Source: ftp://ftp.fu-berlin.de/unix/gnu/%n/%n-%v/%n-%v.tar.bz2
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 < ## IMPORT gcc-wrapper
72 < # FIXME: --enable-__cxa_atexit can't be used with gcc 3.2.3 on RH 7.3,
73 < # enabling it causes qt's uic to die with segmentation violation half
74 < # way down the build of qt (projecsettings.ui or something like that;
75 < # not the first or only call to uic).  Disabling the flag removes the
76 < # issue, so clearly the option does not work correctly on this
77 < # platform combination.
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 --enable-gold
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  
19 if [ "`echo %v | cut -d. -f 1`" == "3" ]
20 then
21 ../configure --prefix=%i --enable-languages=c,c++,f77 \
22    --enable-shared # --enable-__cxa_atexit
23 else
24 ../configure --prefix=%i --enable-languages=c,c++ \
25    --enable-shared # --enable-__cxa_atexit
26 fi
117   make %makeprocesses bootstrap
118  
119   %install
120 < cd obj && make 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.
127 +
128   %post
129 < %{relocateConfig}lib/libg2c.la
130 < %{relocateConfig}lib/libstdc++.la
131 < %{relocateConfig}lib/libsupc++.la
132 < %if "%cpu" == "amd64"
133 < %{relocateConfig}lib64/libg2c.la
134 < %{relocateConfig}lib64/libstdc++.la
135 < %{relocateConfig}lib64/libsupc++.la
136 < %{relocateConfig}lib/32/libg2c.la
137 < %{relocateConfig}lib/32/libstdc++.la
138 < %{relocateConfig}lib/32/libsupc++.la
139 < %endif
129 > # %{relocateConfig}lib/libg2c.la
130 > # %{relocateConfig}lib/libstdc++.la
131 > # %{relocateConfig}lib/libsupc++.la
132 > # %if "%cpu" == "amd64"
133 > # %{relocateConfig}lib64/libg2c.la
134 > # %{relocateConfig}lib64/libstdc++.la
135 > # %{relocateConfig}lib64/libsupc++.la
136 > # %{relocateConfig}lib/32/libg2c.la
137 > # %{relocateConfig}lib/32/libstdc++.la
138 > # %{relocateConfig}lib/32/libsupc++.la
139 > # %endif
140 > # %if "%gcc4" == "true"
141 > # %{relocateConfig}lib/libgfortran.la
142 > # %{relocateConfig}lib/libgfortranbegin.la
143 > # %endif

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines