1 |
< |
### RPM external gcc 4.1.2-CMS8 |
1 |
> |
### RPM external gcc 4.2.2 |
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 |
17 |
|
Source3: http://www.mpfr.org/mpfr-%{mpfrVersion}/mpfr-%{mpfrVersion}.tar.bz2 |
18 |
|
|
19 |
|
%define cpu %(echo %cmsplatf | cut -d_ -f2) |
20 |
+ |
%define gcc_major %(echo %realversion | cut -f1 -d.) |
21 |
|
%prep |
22 |
|
%setup -T -b 0 -n gcc-%realversion |
23 |
|
|
72 |
|
%endif |
73 |
|
|
74 |
|
# Build GMP/MPFR for GCC 4.x |
75 |
+ |
%define gcc4opts %{nil} |
76 |
+ |
%if "%gcc_major" == "4" |
77 |
|
cd ../gmp-%{gmpVersion} |
78 |
|
CC="gcc $CCOPTS" ./configure --prefix=%i/tmp/gmp --disable-shared |
79 |
|
make %makeprocesses |
82 |
|
cd ../mpfr-%{mpfrVersion} |
83 |
|
CC="gcc $CCOPTS" ./configure --prefix=%i/tmp/mpfr --with-gmp=%i/tmp/gmp --disable-shared |
84 |
|
make %makeprocesses |
85 |
+ |
make install |
86 |
+ |
%define gcc4opts --with-gmp=%i/tmp/gmp --with-mpfr=%i/tmp/mpfr |
87 |
+ |
%endif |
88 |
|
|
89 |
|
# Build the compilers |
90 |
|
cd ../gcc-%realversion |
93 |
|
CC="gcc $CCOPTS" \ |
94 |
|
../configure --prefix=%i \ |
95 |
|
--enable-languages=c,c++,`case %v in 3.*) echo f77;; *) echo fortran;; esac` \ |
96 |
< |
--with-gmp-dir=%_builddir/gmp-%{gmpVersion} \ |
91 |
< |
--with-mpfr-dir=%_builddir/mpfr-%{mpfrVersion} \ |
92 |
< |
--enable-shared |
96 |
> |
%gcc4opts --enable-shared |
97 |
|
|
98 |
|
make %makeprocesses bootstrap |
99 |
|
|
173 |
|
</tool> |
174 |
|
EOF_TOOLFILE |
175 |
|
;; |
176 |
< |
slc4_ia32_* ) |
176 |
> |
slc4_ia32_gcc345 ) |
177 |
|
cat << \EOF_TOOLFILE >%i/etc/scram.d/cxxcompiler |
178 |
|
<doc type=BuildSystem::ToolDoc version=1.1> |
179 |
|
<tool name=cxxcompiler version=%v type=compiler> |
233 |
|
<Flags FCO2Flag="-O2"> |
234 |
|
<Flags FCOPTIMISED="-O2"> |
235 |
|
<Flags FCDEBUGFLAG="-g"> |
236 |
< |
<Flags FCSHAREDFCOBJECTFLAGS="-fPIC"> |
236 |
> |
<Flags FCSHAREDOBJECTFLAGS="-fPIC"> |
237 |
> |
<Flags SCRAM_LANGUAGE_TYPE="FORTRAN"> |
238 |
> |
</tool> |
239 |
> |
EOF_TOOLFILE |
240 |
> |
;; |
241 |
> |
slc4_ia32_gcc4* ) |
242 |
> |
cat << \EOF_TOOLFILE >%i/etc/scram.d/cxxcompiler |
243 |
> |
<doc type=BuildSystem::ToolDoc version=1.1> |
244 |
> |
<tool name=cxxcompiler version=%v type=compiler> |
245 |
> |
<client> |
246 |
> |
<Environment name=GCC_BASE default="%i"></Environment> |
247 |
> |
<Environment name=GCCBINDIR default="$GCC_BASE/bin"></Environment> |
248 |
> |
<Environment name=CXX value="$GCCBINDIR/c++"></Environment> |
249 |
> |
</client> |
250 |
> |
<Flags SCRAM_COMPILER_NAME="gcc%compiler_ver"> |
251 |
> |
<Flags CCcompiler="gcc%compiler_ver_major"> |
252 |
> |
<Flags MODULEFLAGS="-shared"> |
253 |
> |
<Flags CXXDEBUGFLAG="-g"> |
254 |
> |
<Flags CPPDEFINES="GNU_GCC"> |
255 |
> |
<Flags CPPDEFINES="_GNU_SOURCE"> |
256 |
> |
<Flags CXXSHAREDOBJECTFLAGS="-fPIC"> |
257 |
> |
<Flags CXXFLAGS="-pedantic -ansi -pthread -pipe"> |
258 |
> |
<Flags CXXFLAGS="-O2"> |
259 |
> |
<Flags CXXFLAGS="-felide-constructors -fmessage-length=0 -ftemplate-depth-300"> |
260 |
> |
<Flags CXXFLAGS="-Wall -Wno-non-template-friend -Wno-long-long -Wimplicit -Wreturn-type -Wunused -Wparentheses"> |
261 |
> |
<Flags LDFLAGS="-Wl,-E"> |
262 |
> |
<Flags CXXSHAREDFLAGS="-Wl,-E"> |
263 |
> |
<Flags SHAREDSUFFIX="so"> |
264 |
> |
<Flags SCRAM_LANGUAGE_TYPE="C++"> |
265 |
> |
<Runtime name=LD_LIBRARY_PATH value="$GCC_BASE/lib" type=path> |
266 |
> |
<Runtime name=PATH value="$GCC_BASE/bin" type=path> |
267 |
> |
</tool> |
268 |
> |
EOF_TOOLFILE |
269 |
> |
cat << \EOF_TOOLFILE >%i/etc/scram.d/ccompiler |
270 |
> |
<doc type=BuildSystem::ToolDoc version=1.1> |
271 |
> |
<tool name=ccompiler version=%v type=compiler> |
272 |
> |
<client> |
273 |
> |
<Environment name=GCC_BASE default="%i"></Environment> |
274 |
> |
<Environment name=GCCBINDIR value="$GCC_BASE/bin"></Environment> |
275 |
> |
<Environment name=CC value="$GCCBINDIR/gcc"></Environment> |
276 |
> |
</client> |
277 |
> |
<Flags CDEBUGFLAG="-g"> |
278 |
> |
<Flags CSHAREDOBJECTFLAGS="-fPIC"> |
279 |
> |
<Flags CFLAGS="-pthread"> |
280 |
> |
<Flags CFLAGS="-O2"> |
281 |
> |
<Flags LDFLAGS="-Wl,-E"> |
282 |
> |
<Flags CSHAREDFLAGS="-Wl,-E"> |
283 |
> |
<Flags SCRAM_COMPILER_NAME="gcc%compiler_ver"> |
284 |
> |
<Flags SCRAM_LANGUAGE_TYPE="C"> |
285 |
> |
</tool> |
286 |
> |
EOF_TOOLFILE |
287 |
> |
cat << \EOF_TOOLFILE >%i/etc/scram.d/f77compiler |
288 |
> |
<doc type=BuildSystem::ToolDoc version=1.1> |
289 |
> |
<tool name=f77compiler version=%v type=compiler> |
290 |
> |
<lib name=gfortran> |
291 |
> |
<lib name=m> |
292 |
> |
<client> |
293 |
> |
<Environment name=G77_BASE default="%i"></Environment> |
294 |
> |
<Environment name=FC default="$G77_BASE/bin/gfortran"></Environment> |
295 |
> |
</client> |
296 |
> |
<Flags SCRAM_COMPILER_NAME="gcc%compiler_ver"> |
297 |
> |
<Flags FFLAGS="-fno-second-underscore -Wunused -Wuninitialized"> |
298 |
> |
<Flags FCO2Flag="-O2"> |
299 |
> |
<Flags FCOPTIMISED="-O2"> |
300 |
> |
<Flags FCDEBUGFLAG="-g"> |
301 |
> |
<Flags FCSHAREDOBJECTFLAGS="-fPIC"> |
302 |
|
<Flags SCRAM_LANGUAGE_TYPE="FORTRAN"> |
303 |
|
</tool> |
304 |
|
EOF_TOOLFILE |