1 |
< |
### RPM external gcc 4.1.2-CMS8 |
1 |
> |
### RPM external gcc 4.6.1 |
2 |
|
## INITENV +PATH LD_LIBRARY_PATH %i/lib/32 |
3 |
|
## INITENV +PATH LD_LIBRARY_PATH %i/lib64 |
4 |
– |
## BUILDIF case $(uname):$(uname -p) in Linux:i*86 ) true ;; Linux:x86_64 ) true ;; Linux:ppc64 ) false ;; Darwin:* ) false ;; * ) true ;; esac |
4 |
|
Source0: ftp://ftp.fu-berlin.de/unix/gnu/%n/%n-%realversion/%n-%realversion.tar.bz2 |
5 |
< |
%define binutilsv 2.17 |
6 |
< |
Source1: http://ftp.gnu.org/gnu/binutils/binutils-%binutilsv.tar.bz2 |
5 |
> |
# For gcc version >= 4.0.0, a number of additional sources are needed. |
6 |
> |
%define gmpVersion 5.0.2 |
7 |
> |
%define mpfrVersion 3.0.1 |
8 |
> |
%define mpcVersion 0.9 |
9 |
> |
Source1: ftp://ftp.gnu.org/gnu/gmp/gmp-%{gmpVersion}.tar.bz2 |
10 |
> |
Source2: http://www.mpfr.org/mpfr-%{mpfrVersion}/mpfr-%{mpfrVersion}.tar.bz2 |
11 |
> |
Source3: http://www.multiprecision.org/mpc/download/mpc-%{mpcVersion}.tar.gz |
12 |
> |
|
13 |
> |
# For gcc 4.5+ we need the additional tools ppl and cloog. |
14 |
> |
%define gcc_45plus %(echo %realversion | sed -e 's|4[.][5-9].*|true|') |
15 |
> |
%if "%{gcc_45plus}" == "true" |
16 |
> |
%define pplVersion 0.11.2 |
17 |
> |
%define cloogVersion 0.16.2 |
18 |
> |
Source4: http://www.cs.unipr.it/ppl/Download/ftp/releases/%{pplVersion}/ppl-%{pplVersion}.tar.bz2 |
19 |
> |
Source5: ftp://gcc.gnu.org/pub/gcc/infrastructure/cloog-%{cloogVersion}.tar.gz |
20 |
> |
%endif |
21 |
> |
|
22 |
> |
# On 64bit Scientific Linux build our own binutils. |
23 |
> |
%define use_custom_binutils %(echo %cmsos | sed -e 's|slc[0-9]*_amd64|true|') |
24 |
> |
%if "%use_custom_binutils" == "true" |
25 |
> |
%define bisonVersion 2.4 |
26 |
> |
Source6: http://ftp.gnu.org/gnu/bison/bison-%{bisonVersion}.tar.bz2 |
27 |
> |
%define binutilsv 2.21.1 |
28 |
> |
Source7: http://ftp.gnu.org/gnu/binutils/binutils-%binutilsv.tar.bz2 |
29 |
> |
#Source7: http://cmsrep.cern.ch/cmssw/binutils-mirror/binutils-%binutilsv.tar.bz2 |
30 |
> |
#Source7: http://www.kernel.org/pub/linux/devel/binutils/binutils-%binutilsv.tar.bz2 |
31 |
> |
%endif |
32 |
|
|
33 |
< |
# If gcc version >= 4.0.0, we need two additional sources, for gmp and mpfr, |
34 |
< |
# and we set the fortranCompiler macro (which is going to be used by the |
35 |
< |
# --enable-languages option of gcc's configure) to gfortran. |
36 |
< |
# Notice that we need to build those twice: once using the system compiler |
37 |
< |
# and the using the newly built gcc. |
38 |
< |
%define gmpVersion 4.2.1 |
39 |
< |
%define mpfrVersion 2.2.1 |
40 |
< |
Source2: ftp://ftp.gnu.org/gnu/gmp/gmp-%{gmpVersion}.tar.bz2 |
41 |
< |
Source3: http://www.mpfr.org/mpfr-%{mpfrVersion}/mpfr-%{mpfrVersion}.tar.bz2 |
33 |
> |
# gcc 4.5+ link time optimization support requires libelf to work. However |
34 |
> |
# also rpm requires it. In order to have to duplicate dependencies we |
35 |
> |
# build it in gcc and we pick it up from there also for rpm. Notice that |
36 |
> |
# libelf does not work on Macosx however this is not a problem until |
37 |
> |
# we use the system compiler there. |
38 |
> |
%define isslc %(echo %cmsos | sed -e 's|slc.*|true|') |
39 |
> |
%define elfutilsVersion 0.131 |
40 |
> |
%if "%isslc" == "true" |
41 |
> |
Source8: ftp://sources.redhat.com/pub/systemtap/elfutils/elfutils-%{elfutilsVersion}.tar.gz |
42 |
> |
%endif |
43 |
> |
Patch0: gcc-4.6.1-ignore-arch-flags-macosx |
44 |
> |
# See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49540 |
45 |
> |
Patch1: gcc-4.6.1-fix-gfortran-regression |
46 |
|
|
19 |
– |
%define cpu %(echo %cmsplatf | cut -d_ -f2) |
47 |
|
%prep |
48 |
< |
%setup -T -b 0 -n gcc-%realversion |
48 |
> |
echo "use_custom_binutils: %use_custom_binutils" |
49 |
> |
%setup -T -b 0 -n gcc-%realversion |
50 |
> |
# Get the macosx build to accept -arch, -F options like the official Apple one. |
51 |
> |
# Notice that patch command have to stay on a single line. |
52 |
> |
case %cmsos in |
53 |
> |
osx*) |
54 |
> |
%patch0 -p1 |
55 |
> |
;; |
56 |
> |
esac |
57 |
> |
%patch1 -p0 |
58 |
|
|
59 |
< |
%if "%cmsos" == "slc4_ia32" |
59 |
> |
case %cmsos in |
60 |
> |
slc*_amd64 ) |
61 |
> |
# Hack needed to align sections to 4096 bytes rather than 2MB on 64bit linux |
62 |
> |
# architectures. This is done to reduce the amount of address space wasted by |
63 |
> |
# relocating many libraries. This was done with a linker script before, but |
64 |
> |
# this approach seems to be more correct. |
65 |
|
cat << \EOF_CONFIG_GCC >> gcc/config.gcc |
66 |
|
# CMS patch to include gcc/config/i386/t-cms when building gcc |
67 |
|
tm_file="$tm_file i386/cms.h" |
27 |
– |
tmake_file="$tmake_file i386/t-cms" |
68 |
|
EOF_CONFIG_GCC |
69 |
|
|
70 |
|
cat << \EOF_CMS_H > gcc/config/i386/cms.h |
71 |
< |
#undef ASM_SPEC |
72 |
< |
#define ASM_SPEC "%%{v:-V} %%{Qy:} %%{!Qn:-Qy} %%{n} %%{T} %%{Ym,*} %%{Yd,*} %%{Wa,*:%%*} --32" |
73 |
< |
#undef CC1_SPEC |
74 |
< |
#define CC1_SPEC "%%(cc1_cpu) %%{profile:-p} -m32" |
75 |
< |
#undef CC1PLUS_SPEC |
76 |
< |
#define CC1PLUS_SPEC "-m32" |
77 |
< |
#undef MULTILIB_DEFAULTS |
78 |
< |
#define MULTILIB_DEFAULTS { "m32" } |
71 |
> |
#undef LINK_SPEC |
72 |
> |
#define LINK_SPEC "%{" SPEC_64 ":-m elf_x86_64} %{" SPEC_32 ":-m elf_i386} \ |
73 |
> |
%{shared:-shared} \ |
74 |
> |
%{!shared: \ |
75 |
> |
%{!static: \ |
76 |
> |
%{rdynamic:-export-dynamic} \ |
77 |
> |
%{" SPEC_32 ":%{!dynamic-linker:-dynamic-linker " LINUX_DYNAMIC_LINKER32 "}} \ |
78 |
> |
%{" SPEC_64 ":%{!dynamic-linker:-dynamic-linker " LINUX_DYNAMIC_LINKER64 "}}} \ |
79 |
> |
%{static:-static}} -z common-page-size=4096 -z max-page-size=4096" |
80 |
|
EOF_CMS_H |
81 |
+ |
;; |
82 |
+ |
esac |
83 |
|
|
84 |
< |
cat << \EOF_T_CMS > gcc/config/i386/t-cms |
85 |
< |
MULTILIB_OPTIONS = m32 |
86 |
< |
MULTILIB_DIRNAMES = ../lib |
44 |
< |
MULTILIB_MATCHES = m32=m32 |
45 |
< |
EOF_T_CMS |
84 |
> |
%if "%{use_custom_binutils}" == "true" |
85 |
> |
%setup -D -T -b 6 -n bison-%{bisonVersion} |
86 |
> |
%setup -D -T -b 7 -n binutils-%binutilsv |
87 |
|
%endif |
88 |
|
|
89 |
< |
%setup -D -T -b 1 -n binutils-%binutilsv |
90 |
< |
%setup -D -T -b 2 -n gmp-%{gmpVersion} |
91 |
< |
%setup -D -T -b 3 -n mpfr-%{mpfrVersion} |
89 |
> |
# These are required for any gcc 4.x build. |
90 |
> |
%setup -D -T -b 1 -n gmp-%{gmpVersion} |
91 |
> |
%setup -D -T -b 2 -n mpfr-%{mpfrVersion} |
92 |
> |
%setup -D -T -b 3 -n mpc-%{mpcVersion} |
93 |
> |
|
94 |
> |
# For gcc 4.5 and later we also need the following. |
95 |
> |
%if "%gcc_45plus" == "true" |
96 |
> |
%setup -D -T -b 4 -n ppl-%{pplVersion} |
97 |
> |
%setup -D -T -b 5 -n cloog-%{cloogVersion} |
98 |
> |
%endif |
99 |
> |
|
100 |
> |
# These are required by rpm as well, but only on linux. |
101 |
> |
%if "%isslc" == "true" |
102 |
> |
%setup -D -T -b 8 -n elfutils-%{elfutilsVersion} |
103 |
> |
%endif |
104 |
|
|
105 |
|
%build |
106 |
< |
# Set special variables required to build 32-bit executables on 64-bit |
107 |
< |
# systems. Note that if the architecture is SLC4/IA32, we may be on a |
108 |
< |
# 64-bit system and need to produce a 32-bit capable compiler, which |
109 |
< |
# _itself_ is a 32-bit executable. |
110 |
< |
case $(uname -m):%{cmsos} in |
111 |
< |
*:slc4_ia32 ) |
112 |
< |
CCOPTS="-m32 -Wa,--32" ;; |
113 |
< |
* ) |
114 |
< |
CCOPTS="" ;; |
106 |
> |
# On mac we need to use gcc-proper, not gcc-llvm |
107 |
> |
case %{cmsos} in |
108 |
> |
osx*) |
109 |
> |
CC=/usr/bin/gcc-4.2 |
110 |
> |
CXX=/usr/bin/c++-4.2 |
111 |
> |
CPP=/usr/bin/cpp-4.2 |
112 |
> |
ADDITIONAL_LANGUAGES=,objc,obj-c++ |
113 |
> |
|
114 |
> |
# Apparently must emulate apple compiler even if we build |
115 |
> |
# full chain ourselves, as things come in via system libs. |
116 |
> |
# - http://newartisans.com/2009/10/a-c-gotcha-on-snow-leopard/ |
117 |
> |
# - http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41645 |
118 |
> |
# - http://trac.macports.org/ticket/25205 (and 22234) |
119 |
> |
CONF_GCC_OS_SPEC=--enable-fully-dynamic-string |
120 |
> |
;; |
121 |
> |
*) |
122 |
> |
CC=gcc |
123 |
> |
CXX=c++ |
124 |
> |
CPP=cpp |
125 |
> |
CONF_GCC_OS_SPEC= |
126 |
> |
;; |
127 |
|
esac |
128 |
|
|
129 |
< |
# If requested, build our own binutils. Currently the default is to use |
130 |
< |
# the system binutils. |
131 |
< |
%if "%{?use_external_binutils:set}" == "set" |
132 |
< |
cd ../binutils-%{binutilsv} |
133 |
< |
CC="gcc $CCOPTS" ./configure --prefix=%i |
134 |
< |
make %makeprocesses |
135 |
< |
make install |
136 |
< |
%endif |
129 |
> |
CC="$CC -fPIC" |
130 |
> |
CXX="$CXX -fPIC" |
131 |
> |
|
132 |
> |
# Whenever we build custom binutils we also enable the new linker "gold". |
133 |
> |
# We do so only if we are using the new gcc 4.5+ |
134 |
> |
if [ "X%use_custom_binutils:%gcc_45plus" = Xtrue:true ] ; then |
135 |
> |
CONF_BINUTILS_OPTS="--enable-gold=default --enable-lto --enable-plugins --enable-threads" |
136 |
> |
CONF_GCC_WITH_LTO="--enable-gold=yes --enable-lto --with-build-config=bootstrap-lto" |
137 |
> |
fi |
138 |
> |
|
139 |
> |
# Build libelf. |
140 |
> |
if [ "X%isslc" = Xtrue ]; then |
141 |
> |
cd ../elfutils-%{elfutilsVersion} |
142 |
> |
./configure --disable-static --prefix=%i CC="$CC" CXX="$CXX" CPP="$CPP" |
143 |
> |
make %makeprocesses |
144 |
> |
make install |
145 |
> |
fi |
146 |
> |
|
147 |
> |
# If requested, build our own binutils. Currently the default is to use the |
148 |
> |
# system binutils on 32bit platforms and our own on 64 bit ones. |
149 |
> |
# FIXME: Notice that this copy is actually built using the system compiler, so |
150 |
> |
# we chances are we will need to rebuild it later on to make sure they get |
151 |
> |
# linked against our libstdc++ (required by gold). |
152 |
> |
if [ "X%use_custom_binutils" = Xtrue ] |
153 |
> |
then |
154 |
> |
cd ../bison-%{bisonVersion} |
155 |
> |
CC="$CC" ./configure --prefix=%i/tmp/bison |
156 |
> |
make %makeprocesses |
157 |
> |
make install |
158 |
> |
export PATH=%i/tmp/bison/bin:$PATH |
159 |
> |
cd ../binutils-%{binutilsv} |
160 |
> |
# Try to avoid dependency on makeinfo by forcing make not |
161 |
> |
# to build the documentation. |
162 |
> |
perl -p -i -e 's|SUBDIRS = .*|SUBDIRS =|' bfd/Makefile.in binutils/Makefile.in gas/Makefile.in |
163 |
> |
perl -p -i -e 's|all: info|all:|' etc/Makefile.in |
164 |
> |
perl -p -i -e 's|TEXINFOS =.*|TEXINFOS =|;s|INFO_DEPS =.*|INFO_DEPS =|' gprof/Makefile.in |
165 |
> |
perl -p -i -e 's|man_MANS =.*|man_MANS =|' gprof/Makefile.in |
166 |
> |
perl -p -i -e 's|INFO_DEPS =.*|INFO_DEPS =|' ld/Makefile.in |
167 |
> |
perl -p -i -e 's|INFOFILES =.*|INFOFILES =|' etc/Makefile.in |
168 |
> |
perl -p -i -e 's|DVIFILES =.*|DVIFILES =|' etc/Makefile.in |
169 |
> |
perl -p -i -e 's|PDFFILES =.*|PDFFILES =|' etc/Makefile.in |
170 |
> |
perl -p -i -e 's|HTMLFILES =.*|HTMLFILES =|' etc/Makefile.in |
171 |
> |
|
172 |
> |
./configure --disable-static --prefix=%i ${CONF_BINUTILS_OPTS} --disable-werror \ |
173 |
> |
CC="$CC" CXX="$CXX" CPP="$CPP" CFLAGS="-I%i/include" \ |
174 |
> |
CXXFLAGS="-I%i/include" LDFLAGS="-L%i/lib" |
175 |
> |
make %makeprocesses |
176 |
> |
find . -name Makefile -exec perl -p -i -e 's|LN = ln|LN = cp -p|;s|ln ([^-])|cp -p $1|g' {} \; |
177 |
> |
make install |
178 |
> |
which ld |
179 |
> |
fi |
180 |
|
|
181 |
< |
# Build GMP/MPFR for GCC 4.x |
181 |
> |
# Build GMP/MPFR/MPC |
182 |
|
cd ../gmp-%{gmpVersion} |
183 |
< |
CC="gcc $CCOPTS" ./configure --prefix=%i/tmp/gmp --disable-shared |
183 |
> |
./configure --disable-static --prefix=%i --enable-shared --disable-static --enable-cxx CC="$CC" CXX="$CXX" CPP="$CPP" |
184 |
|
make %makeprocesses |
185 |
|
make install |
186 |
|
|
187 |
|
cd ../mpfr-%{mpfrVersion} |
188 |
< |
CC="gcc $CCOPTS" ./configure --prefix=%i/tmp/mpfr --with-gmp=%i/tmp/gmp --disable-shared |
188 |
> |
./configure --disable-static --prefix=%i --with-gmp=%i CC="$CC" CXX="$CXX" CPP="$CPP" |
189 |
|
make %makeprocesses |
190 |
+ |
make install |
191 |
+ |
|
192 |
+ |
cd ../mpc-%{mpcVersion} |
193 |
+ |
./configure --disable-static --prefix=%i --with-gmp=%i --with-mpfr=%i CC="$CC" CXX="$CXX" CPP="$CPP" |
194 |
+ |
make %makeprocesses |
195 |
+ |
make install |
196 |
+ |
CONF_GCC_VERSION_OPTS="--with-gmp=%i --with-mpfr=%i --with-mpc=%i" |
197 |
+ |
|
198 |
+ |
# Build additional stuff for gcc 4.5+ |
199 |
+ |
if [ "X%gcc_45plus" = Xtrue ]; then |
200 |
+ |
cd ../ppl-%{pplVersion} |
201 |
+ |
./configure --disable-static --prefix=%i CC="$CC" CXX="$CXX" CPP="$CPP" |
202 |
+ |
make %makeprocesses |
203 |
+ |
make install |
204 |
+ |
|
205 |
+ |
cd ../cloog-%{cloogVersion} |
206 |
+ |
./configure --disable-static --prefix=%i --with-ppl=%i --with-gmp-prefix=%i CC="$CC" CXX="$CXX" CPP="$CPP" |
207 |
+ |
make %makeprocesses |
208 |
+ |
make install |
209 |
+ |
|
210 |
+ |
CONF_GCC_VERSION_OPTS="$CONF_GCC_VERSION_OPTS --with-ppl=%i --with-cloog=%i --enable-cloog-backend=isl" |
211 |
+ |
fi |
212 |
|
|
213 |
|
# Build the compilers |
214 |
|
cd ../gcc-%realversion |
215 |
|
mkdir -p obj |
216 |
|
cd obj |
217 |
< |
CC="gcc $CCOPTS" \ |
218 |
< |
../configure --prefix=%i \ |
219 |
< |
--enable-languages=c,c++,`case %v in 3.*) echo f77;; *) echo fortran;; esac` \ |
220 |
< |
--with-gmp-dir=%_builddir/gmp-%{gmpVersion} \ |
221 |
< |
--with-mpfr-dir=%_builddir/mpfr-%{mpfrVersion} \ |
92 |
< |
--enable-shared |
217 |
> |
export LD_LIBRARY_PATH=%i/lib64:%i/lib:$LD_LIBRARY_PATH |
218 |
> |
../configure --prefix=%i --disable-multilib --disable-nls \ |
219 |
> |
--enable-languages=c,c++,fortran$ADDITIONAL_LANGUAGES \ |
220 |
> |
$CONF_GCC_OS_SPEC $CONF_GCC_WITH_LTO $CONF_GCC_VERSION_OPTS \ |
221 |
> |
--enable-shared CC="$CC" CXX="$CXX" CPP="$CPP" |
222 |
|
|
223 |
|
make %makeprocesses bootstrap |
224 |
+ |
make install |
225 |
|
|
226 |
|
%install |
227 |
< |
cd %_builddir/gcc-%{realversion}/obj && make install |
228 |
< |
ln -s gcc %i/bin/cc |
229 |
< |
find %i/lib %i/lib32 %i/lib64 -name '*.la' -exec rm -f {} \; || true |
100 |
< |
|
101 |
< |
# SCRAM ToolBox toolfile |
102 |
< |
%define compiler_ver %(echo %realversion | sed -e "s|\\.||g") |
103 |
< |
%define compiler_ver_major %(echo %realversion | sed -e "s|\\..*||") |
104 |
< |
mkdir -p %i/etc/scram.d |
105 |
< |
case %cmsplatf in |
106 |
< |
slc3* ) |
107 |
< |
cat << \EOF_TOOLFILE >%i/etc/scram.d/cxxcompiler |
108 |
< |
<doc type=BuildSystem::ToolDoc version=1.1> |
109 |
< |
<tool name=cxxcompiler version=%v type=compiler> |
110 |
< |
<client> |
111 |
< |
<Environment name=GCC_BASE default="%i"></Environment> |
112 |
< |
<Environment name=GCCBINDIR default="$GCC_BASE/bin"></Environment> |
113 |
< |
<Environment name=CXX value="$GCCBINDIR/c++"></Environment> |
114 |
< |
</client> |
115 |
< |
<Flags SCRAM_COMPILER_NAME="gcc%compiler_ver"> |
116 |
< |
<Flags CCcompiler="gcc%compiler_ver_major"> |
117 |
< |
<Flags MODULEFLAGS="-shared"> |
118 |
< |
<Flags CXXDEBUGFLAG="-g"> |
119 |
< |
<Flags CPPDEFINES="GNU_GCC"> |
120 |
< |
<Flags CPPDEFINES="_GNU_SOURCE"> |
121 |
< |
<Flags CXXSHAREDOBJECTFLAGS="-fPIC"> |
122 |
< |
<Flags CXXFLAGS="-pedantic -ansi -pthread -pipe"> |
123 |
< |
<Flags CXXFLAGS="-O2"> |
124 |
< |
<Flags CXXFLAGS="-felide-constructors -fmessage-length=0 -ftemplate-depth-300"> |
125 |
< |
<Flags CXXFLAGS="-Wall -Wno-non-template-friend -Wno-long-long -Wimplicit -Wreturn-type -Wunused -Wparentheses"> |
126 |
< |
<Flags LDFLAGS="-Wl,-E"> |
127 |
< |
<Flags CXXSHAREDFLAGS="-Wl,-E"> |
128 |
< |
<Flags SHAREDSUFFIX="so"> |
129 |
< |
<Flags SCRAM_LANGUAGE_TYPE="C++"> |
130 |
< |
<Runtime name=GCC_EXEC_PREFIX default="$GCC_BASE/lib/gcc-lib/"> |
131 |
< |
<Runtime name=LD_LIBRARY_PATH value="$GCC_BASE/lib" type=path> |
132 |
< |
<Runtime name=PATH value="$GCC_BASE/bin" type=path> |
133 |
< |
</tool> |
134 |
< |
EOF_TOOLFILE |
135 |
< |
cat << \EOF_TOOLFILE >%i/etc/scram.d/ccompiler |
136 |
< |
<doc type=BuildSystem::ToolDoc version=1.1> |
137 |
< |
<tool name=ccompiler version=%v type=compiler> |
138 |
< |
<client> |
139 |
< |
<Environment name=GCC_BASE default="%i"></Environment> |
140 |
< |
<Environment name=GCCBINDIR value="$GCC_BASE/bin"></Environment> |
141 |
< |
<Environment name=CC value="$GCCBINDIR/gcc"></Environment> |
142 |
< |
</client> |
143 |
< |
<Flags CDEBUGFLAG="-g"> |
144 |
< |
<Flags CSHAREDOBJECTFLAGS="-fPIC"> |
145 |
< |
<Flags CFLAGS="-pthread"> |
146 |
< |
<Flags CFLAGS="-O2"> |
147 |
< |
<Flags LDFLAGS="-Wl,-E"> |
148 |
< |
<Flags CSHAREDFLAGS="-Wl,-E"> |
149 |
< |
<Flags SCRAM_COMPILER_NAME="gcc%compiler_ver"> |
150 |
< |
<Flags SCRAM_LANGUAGE_TYPE="C"> |
151 |
< |
</tool> |
152 |
< |
EOF_TOOLFILE |
153 |
< |
cat << \EOF_TOOLFILE >%i/etc/scram.d/f77compiler |
154 |
< |
<doc type=BuildSystem::ToolDoc version=1.1> |
155 |
< |
<tool name=f77compiler version=%v type=compiler> |
156 |
< |
<lib name=g2c> |
157 |
< |
<lib name=m> |
158 |
< |
<client> |
159 |
< |
<Environment name=G77_BASE default="%i"></Environment> |
160 |
< |
<Environment name=FC default="$G77_BASE/bin/g77"></Environment> |
161 |
< |
</client> |
162 |
< |
<Flags SCRAM_COMPILER_NAME="gcc%compiler_ver"> |
163 |
< |
<Flags FFLAGS="-fno-second-underscore -Wno-globals -Wunused -Wuninitialized"> |
164 |
< |
<Flags FCO2Flag="-O2"> |
165 |
< |
<Flags FCOPTIMISED="-O2"> |
166 |
< |
<Flags FCDEBUGFLAG="-g"> |
167 |
< |
<Flags FCSHAREDFCOBJECTFLAGS="-fPIC"> |
168 |
< |
<Flags SCRAM_LANGUAGE_TYPE="FORTRAN"> |
169 |
< |
</tool> |
170 |
< |
EOF_TOOLFILE |
171 |
< |
;; |
172 |
< |
slc4_ia32_* ) |
173 |
< |
cat << \EOF_TOOLFILE >%i/etc/scram.d/cxxcompiler |
174 |
< |
<doc type=BuildSystem::ToolDoc version=1.1> |
175 |
< |
<tool name=cxxcompiler version=%v type=compiler> |
176 |
< |
<client> |
177 |
< |
<Environment name=GCC_BASE default="%i"></Environment> |
178 |
< |
<Environment name=GCCBINDIR default="$GCC_BASE/bin"></Environment> |
179 |
< |
<Environment name=CXX value="$GCCBINDIR/c++"></Environment> |
180 |
< |
</client> |
181 |
< |
<Flags SCRAM_COMPILER_NAME="gcc%compiler_ver"> |
182 |
< |
<Flags CCcompiler="gcc%compiler_ver_major"> |
183 |
< |
<Flags MODULEFLAGS="-shared"> |
184 |
< |
<Flags CXXDEBUGFLAG="-g"> |
185 |
< |
<Flags CPPDEFINES="GNU_GCC"> |
186 |
< |
<Flags CPPDEFINES="_GNU_SOURCE"> |
187 |
< |
<Flags CXXSHAREDOBJECTFLAGS="-fPIC"> |
188 |
< |
<Flags CXXFLAGS="-pedantic -ansi -pthread -pipe"> |
189 |
< |
<Flags CXXFLAGS="-O2"> |
190 |
< |
<Flags CXXFLAGS="-felide-constructors -fmessage-length=0 -ftemplate-depth-300"> |
191 |
< |
<Flags CXXFLAGS="-Wall -Wno-non-template-friend -Wno-long-long -Wimplicit -Wreturn-type -Wunused -Wparentheses"> |
192 |
< |
<Flags LDFLAGS="-Wl,-E"> |
193 |
< |
<Flags CXXSHAREDFLAGS="-Wl,-E"> |
194 |
< |
<Flags SHAREDSUFFIX="so"> |
195 |
< |
<Flags SCRAM_LANGUAGE_TYPE="C++"> |
196 |
< |
<Runtime name=LD_LIBRARY_PATH value="$GCC_BASE/lib" type=path> |
197 |
< |
<Runtime name=PATH value="$GCC_BASE/bin" type=path> |
198 |
< |
</tool> |
199 |
< |
EOF_TOOLFILE |
200 |
< |
cat << \EOF_TOOLFILE >%i/etc/scram.d/ccompiler |
201 |
< |
<doc type=BuildSystem::ToolDoc version=1.1> |
202 |
< |
<tool name=ccompiler version=%v type=compiler> |
203 |
< |
<client> |
204 |
< |
<Environment name=GCC_BASE default="%i"></Environment> |
205 |
< |
<Environment name=GCCBINDIR value="$GCC_BASE/bin"></Environment> |
206 |
< |
<Environment name=CC value="$GCCBINDIR/gcc"></Environment> |
207 |
< |
</client> |
208 |
< |
<Flags CDEBUGFLAG="-g"> |
209 |
< |
<Flags CSHAREDOBJECTFLAGS="-fPIC"> |
210 |
< |
<Flags CFLAGS="-pthread"> |
211 |
< |
<Flags CFLAGS="-O2"> |
212 |
< |
<Flags LDFLAGS="-Wl,-E"> |
213 |
< |
<Flags CSHAREDFLAGS="-Wl,-E"> |
214 |
< |
<Flags SCRAM_COMPILER_NAME="gcc%compiler_ver"> |
215 |
< |
<Flags SCRAM_LANGUAGE_TYPE="C"> |
216 |
< |
</tool> |
217 |
< |
EOF_TOOLFILE |
218 |
< |
cat << \EOF_TOOLFILE >%i/etc/scram.d/f77compiler |
219 |
< |
<doc type=BuildSystem::ToolDoc version=1.1> |
220 |
< |
<tool name=f77compiler version=%v type=compiler> |
221 |
< |
<lib name=g2c> |
222 |
< |
<lib name=m> |
223 |
< |
<client> |
224 |
< |
<Environment name=G77_BASE default="%i"></Environment> |
225 |
< |
<Environment name=FC default="$G77_BASE/bin/g77"></Environment> |
226 |
< |
</client> |
227 |
< |
<Flags SCRAM_COMPILER_NAME="gcc%compiler_ver"> |
228 |
< |
<Flags FFLAGS="-fno-second-underscore -Wno-globals -Wunused -Wuninitialized"> |
229 |
< |
<Flags FCO2Flag="-O2"> |
230 |
< |
<Flags FCOPTIMISED="-O2"> |
231 |
< |
<Flags FCDEBUGFLAG="-g"> |
232 |
< |
<Flags FCSHAREDFCOBJECTFLAGS="-fPIC"> |
233 |
< |
<Flags SCRAM_LANGUAGE_TYPE="FORTRAN"> |
234 |
< |
</tool> |
235 |
< |
EOF_TOOLFILE |
236 |
< |
;; |
237 |
< |
slc4_amd64_* ) |
238 |
< |
cat << \EOF_TOOLFILE >%i/etc/scram.d/cxxcompiler |
239 |
< |
<doc type=BuildSystem::ToolDoc version=1.1> |
240 |
< |
<tool name=cxxcompiler version=%v type=compiler> |
241 |
< |
<client> |
242 |
< |
<Environment name=GCC_BASE default="%i"></Environment> |
243 |
< |
<Environment name=GCCBINDIR default="$GCC_BASE/bin"></Environment> |
244 |
< |
<Environment name=CXX value="$GCCBINDIR/c++"></Environment> |
245 |
< |
</client> |
246 |
< |
<Flags SCRAM_COMPILER_NAME="gcc%compiler_ver"> |
247 |
< |
<Flags CCcompiler="gcc%compiler_ver_major"> |
248 |
< |
<Flags MODULEFLAGS="-shared"> |
249 |
< |
<Flags CXXDEBUGFLAG="-g"> |
250 |
< |
<Flags CPPDEFINES="GNU_GCC"> |
251 |
< |
<Flags CPPDEFINES="_GNU_SOURCE"> |
252 |
< |
<Flags CXXSHAREDOBJECTFLAGS="-fPIC"> |
253 |
< |
<Flags CXXFLAGS="-pedantic -ansi -pthread -pipe"> |
254 |
< |
<Flags CXXFLAGS="-O2"> |
255 |
< |
<Flags CXXFLAGS="-felide-constructors -fmessage-length=0 -ftemplate-depth-300"> |
256 |
< |
<Flags CXXFLAGS="-Wall -Wno-non-template-friend -Wno-long-long -Wimplicit -Wreturn-type -Wunused -Wparentheses"> |
257 |
< |
<Flags LDFLAGS="-Wl,-E"> |
258 |
< |
<Flags CXXSHAREDFLAGS="-Wl,-E"> |
259 |
< |
<Flags SHAREDSUFFIX="so"> |
260 |
< |
<Flags SCRAM_LANGUAGE_TYPE="C++"> |
261 |
< |
<Runtime name=LD_LIBRARY_PATH value="$GCC_BASE/lib64" type=path> |
262 |
< |
<Runtime name=PATH value="$GCC_BASE/bin" type=path> |
263 |
< |
</tool> |
264 |
< |
EOF_TOOLFILE |
265 |
< |
cat << \EOF_TOOLFILE >%i/etc/scram.d/ccompiler |
266 |
< |
<doc type=BuildSystem::ToolDoc version=1.1> |
267 |
< |
<tool name=ccompiler version=%v type=compiler> |
268 |
< |
<client> |
269 |
< |
<Environment name=GCC_BASE default="%i"></Environment> |
270 |
< |
<Environment name=GCCBINDIR value="$GCC_BASE/bin"></Environment> |
271 |
< |
<Environment name=CC value="$GCCBINDIR/gcc"></Environment> |
272 |
< |
</client> |
273 |
< |
<Flags CDEBUGFLAG="-g"> |
274 |
< |
<Flags CSHAREDOBJECTFLAGS="-fPIC"> |
275 |
< |
<Flags CFLAGS="-pthread"> |
276 |
< |
<Flags CFLAGS="-O2"> |
277 |
< |
<Flags LDFLAGS="-Wl,-E"> |
278 |
< |
<Flags CSHAREDFLAGS="-Wl,-E"> |
279 |
< |
<Flags SCRAM_COMPILER_NAME="gcc%compiler_ver"> |
280 |
< |
<Flags SCRAM_LANGUAGE_TYPE="C"> |
281 |
< |
</tool> |
282 |
< |
EOF_TOOLFILE |
283 |
< |
cat << \EOF_TOOLFILE >%i/etc/scram.d/f77compiler |
284 |
< |
<doc type=BuildSystem::ToolDoc version=1.1> |
285 |
< |
<tool name=f77compiler version=%v type=compiler> |
286 |
< |
<lib name=g2c> |
287 |
< |
<lib name=m> |
288 |
< |
<client> |
289 |
< |
<Environment name=G77_BASE default="%i"></Environment> |
290 |
< |
<Environment name=FC default="$G77_BASE/bin/g77"></Environment> |
291 |
< |
</client> |
292 |
< |
<Flags SCRAM_COMPILER_NAME="gcc%compiler_ver"> |
293 |
< |
<Flags FFLAGS="-fno-second-underscore -Wno-globals -Wunused -Wuninitialized"> |
294 |
< |
<Flags FCO2Flag="-O2"> |
295 |
< |
<Flags FCOPTIMISED="-O2"> |
296 |
< |
<Flags FCDEBUGFLAG="-g"> |
297 |
< |
<Flags FCSHAREDFCOBJECTFLAGS="-fPIC"> |
298 |
< |
<Flags SCRAM_LANGUAGE_TYPE="FORTRAN"> |
299 |
< |
</tool> |
300 |
< |
EOF_TOOLFILE |
301 |
< |
;; |
302 |
< |
osx104_ppc32_gcc40* ) |
303 |
< |
cat << \EOF_TOOLFILE >%i/etc/scram.d/cxxcompiler |
304 |
< |
<doc type=BuildSystem::ToolDoc version=1.1> |
305 |
< |
<tool name=cxxcompiler version=%v type=compiler> |
306 |
< |
<client> |
307 |
< |
<Environment name=GCC_BASE default="%i"></Environment> |
308 |
< |
<Environment name=GCCBINDIR default="$GCC_BASE/bin"></Environment> |
309 |
< |
<Environment name=CXX value="$GCCBINDIR/c++"></Environment> |
310 |
< |
</client> |
311 |
< |
<Flags SCRAM_COMPILER_NAME="gcc40"> |
312 |
< |
<Flags CCcompiler="gcc40"> |
313 |
< |
<Flags MODULEFLAGS=" "> |
314 |
< |
<Flags CXXDEBUGFLAG="-g"> |
315 |
< |
<Flags CPPDEFINES="GNU_GCC"> |
316 |
< |
<Flags CPPDEFINES="_GNU_SOURCE"> |
317 |
< |
<Flags CXXSHAREDOBJECTFLAGS="-fPIC"> |
318 |
< |
<Flags CXXFLAGS="-pedantic -ansi -pipe"> |
319 |
< |
<Flags CXXFLAGS="-O2"> |
320 |
< |
<Flags CXXFLAGS="-felide-constructors -fmessage-length=0 -ftemplate-depth-300"> |
321 |
< |
<Flags CXXFLAGS="-Wall -Wno-non-template-friend -Wno-long-long -Wimplicit -Wreturn-type -Wunused -Wparentheses"> |
322 |
< |
<Flags LDFLAGS=" "> |
323 |
< |
<Flags CXXSHAREDFLAGS="-dynamiclib -single_module"> |
324 |
< |
<Flags SHAREDSUFFIX="dylib"> |
325 |
< |
<Flags SCRAM_LANGUAGE_TYPE="C++"> |
326 |
< |
<Runtime name=DYLD_LIBRARY_PATH value="$GCC_BASE/lib" type=path> |
327 |
< |
<Runtime name=PATH value="$GCC_BASE/bin" type=path> |
328 |
< |
</tool> |
329 |
< |
EOF_TOOLFILE |
330 |
< |
;; |
227 |
> |
case %{cmsos} in |
228 |
> |
osx*) STRIP_DYNAMIC="strip -x" ;; |
229 |
> |
*) STRIP_DYNAMIC="strip" ;; |
230 |
|
esac |
231 |
|
|
232 |
< |
%post |
233 |
< |
# %{relocateConfig}lib/libg2c.la |
234 |
< |
# %{relocateConfig}lib/libstdc++.la |
235 |
< |
# %{relocateConfig}lib/libsupc++.la |
236 |
< |
# %if "%cpu" == "amd64" |
237 |
< |
# %{relocateConfig}lib64/libg2c.la |
238 |
< |
# %{relocateConfig}lib64/libstdc++.la |
239 |
< |
# %{relocateConfig}lib64/libsupc++.la |
240 |
< |
# %{relocateConfig}lib/32/libg2c.la |
241 |
< |
# %{relocateConfig}lib/32/libstdc++.la |
242 |
< |
# %{relocateConfig}lib/32/libsupc++.la |
243 |
< |
# %endif |
244 |
< |
# %if "%gcc4" == "true" |
245 |
< |
# %{relocateConfig}lib/libgfortran.la |
246 |
< |
# %{relocateConfig}lib/libgfortranbegin.la |
247 |
< |
# %endif |
248 |
< |
%{relocateConfig}etc/scram.d/cxxcompiler |
249 |
< |
%{relocateConfig}etc/scram.d/ccompiler |
250 |
< |
%{relocateConfig}etc/scram.d/f77compiler |
232 |
> |
cd %_builddir/gcc-%{realversion}/obj && make install |
233 |
> |
|
234 |
> |
ln -s gcc %i/bin/cc |
235 |
> |
find %i/lib %i/lib64 -name '*.la' -exec rm -f {} \; || true |
236 |
> |
|
237 |
> |
# Remove unneeded documentation. |
238 |
> |
rm -rf %i/share/{man,info,doc,locale} |
239 |
> |
# Strip things people will most likely never debug themself. |
240 |
> |
find %i/libexec -name cc1 -exec strip {} \; |
241 |
> |
find %i/libexec -name cc1plus -exec strip {} \; |
242 |
> |
find %i/libexec -name f951 -exec strip {} \; |
243 |
> |
find %i/libexec -name lto1 -exec strip {} \; |
244 |
> |
find %i/libexec -name collect2 -exec strip {} \; |
245 |
> |
find %i/bin -type f -exec file {} \; | grep executable | grep -v make-debug-archive | sed -e 's|:.*||' | xargs -n1 strip |
246 |
> |
if [ "X%use_custom_binutils" = Xtrue ]; then |
247 |
> |
find %i/x86_64*/bin -type f -exec strip {} \; |
248 |
> |
else :; fi |
249 |
> |
$STRIP_DYNAMIC %i/lib/libmpfr* |
250 |
> |
$STRIP_DYNAMIC %i/lib/libppl* |
251 |
> |
$STRIP_DYNAMIC %i/lib/libgmp* |
252 |
> |
$STRIP_DYNAMIC %i/lib/libcloog* |
253 |
> |
# Remove temporary bison installation |
254 |
> |
rm -rf %i/tmp |
255 |
> |
# Remove unneeded archive libraries. |
256 |
> |
rm -rf %i/lib/libstdc++.a %i/lib/libsupc++.a |
257 |
> |
# This avoids having a dependency on the system pkg-config. |
258 |
> |
rm -rf %i/lib/pkg-config |
259 |
> |
|
260 |
> |
# SCRAM ToolBox toolfile is now geneated by the gcc-toolfile.spec |
261 |
> |
# so that everything works even in the case "--use-system-compiler" |
262 |
> |
# option is specified. |