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.26 by muzaffar, Mon Sep 3 15:28:45 2007 UTC

# Line 1 | Line 1
1 < ### RPM external gcc 3.4.5
2 < Requires: gcc-wrapper
1 > ### RPM external gcc 3.4.5-CMS8
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
5 < 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 > %define binutilsv 2.17
7 > Source1: http://ftp.gnu.org/gnu/binutils/binutils-%binutilsv.tar.bz2
8 >
9 > # If gcc version >= 4.0.0, we need two additional sources, for gmp and mpfr,
10 > # and we set the fortranCompiler macro (which is going to be used by the
11 > # --enable-languages option of gcc's configure) to gfortran.
12 > # Notice that we need to build those twice: once using the system compiler
13 > # and the using the newly built gcc.
14 > %define gmpVersion 4.2.1
15 > %define mpfrVersion 2.2.1
16 > Source2: ftp://ftp.gnu.org/gnu/gmp/gmp-%{gmpVersion}.tar.bz2
17 > Source3: http://www.mpfr.org/mpfr-%{mpfrVersion}/mpfr-%{mpfrVersion}.tar.bz2
18 >
19   %define cpu %(echo %cmsplatf | cut -d_ -f2)
20 + %prep
21 + %setup -T -b 0 -n gcc-%realversion
22 +
23 + %if "%cmsos" == "slc4_ia32"
24 + cat << \EOF_CONFIG_GCC >> gcc/config.gcc
25 + # CMS patch to include gcc/config/i386/t-cms when building gcc
26 + tm_file="$tm_file i386/cms.h"
27 + tmake_file="$tmake_file i386/t-cms"
28 + EOF_CONFIG_GCC
29 +
30 + cat << \EOF_CMS_H > gcc/config/i386/cms.h
31 + #undef ASM_SPEC
32 + #define ASM_SPEC  "%%{v:-V} %%{Qy:} %%{!Qn:-Qy} %%{n} %%{T} %%{Ym,*} %%{Yd,*} %%{Wa,*:%%*} --32"
33 + #undef CC1_SPEC
34 + #define CC1_SPEC  "%%(cc1_cpu) %%{profile:-p} -m32"
35 + #undef CC1PLUS_SPEC
36 + #define CC1PLUS_SPEC "-m32"
37 + #undef MULTILIB_DEFAULTS
38 + #define MULTILIB_DEFAULTS { "m32" }
39 + EOF_CMS_H
40 +
41 + cat << \EOF_T_CMS > gcc/config/i386/t-cms
42 + MULTILIB_OPTIONS = m32
43 + MULTILIB_DIRNAMES = ../lib
44 + MULTILIB_MATCHES = m32=m32
45 + EOF_T_CMS
46 + %endif
47 +
48 + %setup -D -T -b 1 -n binutils-%binutilsv
49 + %setup -D -T -b 2 -n gmp-%{gmpVersion}
50 + %setup -D -T -b 3 -n mpfr-%{mpfrVersion}
51 +
52   %build
53 < ## IMPORT gcc-wrapper
54 < # FIXME: --enable-__cxa_atexit can't be used with gcc 3.2.3 on RH 7.3,
55 < # enabling it causes qt's uic to die with segmentation violation half
56 < # way down the build of qt (projecsettings.ui or something like that;
57 < # not the first or only call to uic).  Disabling the flag removes the
58 < # issue, so clearly the option does not work correctly on this
59 < # platform combination.
53 > # Set special variables required to build 32-bit executables on 64-bit
54 > # systems.  Note that if the architecture is SLC4/IA32, we may be on a
55 > # 64-bit system and need to produce a 32-bit capable compiler, which
56 > # _itself_ is a 32-bit executable.
57 > case $(uname -m):%{cmsos} in
58 >  *:slc4_ia32 )
59 >    CCOPTS="-m32 -Wa,--32" ;;
60 >  * )
61 >    CCOPTS="" ;;
62 > esac
63 >
64 > # If requested, build our own binutils.  Currently the default is to use
65 > # the system binutils.
66 > %if "%{?use_external_binutils:set}" == "set"
67 > cd ../binutils-%{binutilsv}
68 > CC="gcc $CCOPTS" ./configure --prefix=%i
69 > make %makeprocesses
70 > make install
71 > %endif
72 >
73 > # Build GMP/MPFR for GCC 4.x
74 > cd ../gmp-%{gmpVersion}
75 > CC="gcc $CCOPTS" ./configure --prefix=%i/tmp/gmp --disable-shared
76 > make %makeprocesses
77 > make install
78 >
79 > cd ../mpfr-%{mpfrVersion}
80 > CC="gcc $CCOPTS" ./configure --prefix=%i/tmp/mpfr --with-gmp=%i/tmp/gmp --disable-shared
81 > make %makeprocesses
82 >
83 > # Build the compilers
84 > cd ../gcc-%realversion
85   mkdir -p obj
86   cd obj
87 + CC="gcc $CCOPTS" \
88 + ../configure --prefix=%i \
89 +  --enable-languages=c,c++,`case %v in 3.*) echo f77;; *) echo fortran;; esac` \
90 +  --with-gmp-dir=%_builddir/gmp-%{gmpVersion} \
91 +  --with-mpfr-dir=%_builddir/mpfr-%{mpfrVersion} \
92 +  --enable-shared
93  
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
94   make %makeprocesses bootstrap
95  
96   %install
97 < cd obj && make install
97 > cd %_builddir/gcc-%{realversion}/obj && make install
98   ln -s gcc %i/bin/cc
99 + 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 + </tool>
133 + EOF_TOOLFILE
134 + cat << \EOF_TOOLFILE >%i/etc/scram.d/ccompiler
135 + <doc type=BuildSystem::ToolDoc version=1.1>
136 + <tool name=ccompiler version=%v type=compiler>
137 + <client>
138 + <Environment name=GCC_BASE default="%i"></Environment>
139 + <Environment name=GCCBINDIR value="$GCC_BASE/bin"></Environment>
140 + <Environment name=CC value="$GCCBINDIR/gcc"></Environment>
141 + </client>
142 + <Flags CDEBUGFLAG="-g">
143 + <Flags CSHAREDOBJECTFLAGS="-fPIC">
144 + <Flags CFLAGS="-pthread">
145 + <Flags CFLAGS="-O2">
146 + <Flags LDFLAGS="-Wl,-E">
147 + <Flags CSHAREDFLAGS="-Wl,-E">
148 + <Flags SCRAM_COMPILER_NAME="gcc%compiler_ver">
149 + <Flags SCRAM_LANGUAGE_TYPE="C">
150 + </tool>
151 + EOF_TOOLFILE
152 + cat << \EOF_TOOLFILE >%i/etc/scram.d/f77compiler
153 + <doc type=BuildSystem::ToolDoc version=1.1>
154 + <tool name=f77compiler version=%v type=compiler>
155 + <lib name=g2c>
156 + <lib name=m>
157 + <client>
158 + <Environment name=G77_BASE default="%i"></Environment>
159 + <Environment name=FC default="$G77_BASE/bin/g77"></Environment>
160 + </client>
161 + <Flags SCRAM_COMPILER_NAME="gcc%compiler_ver">
162 + <Flags FFLAGS="-fno-second-underscore -Wno-globals -Wunused -Wuninitialized">
163 + <Flags FCO2Flag="-O2">
164 + <Flags FCOPTIMISED="-O2">
165 + <Flags FCDEBUGFLAG="-g">
166 + <Flags FCSHAREDFCOBJECTFLAGS="-fPIC">
167 + <Flags SCRAM_LANGUAGE_TYPE="FORTRAN">
168 + </tool>
169 + EOF_TOOLFILE
170 + ;;
171 + slc4_ia32_* )
172 + cat << \EOF_TOOLFILE >%i/etc/scram.d/cxxcompiler
173 + <doc type=BuildSystem::ToolDoc version=1.1>
174 + <tool name=cxxcompiler version=%v type=compiler>
175 + <client>
176 + <Environment name=GCC_BASE default="%i"></Environment>
177 + <Environment name=GCCBINDIR default="$GCC_BASE/bin"></Environment>
178 + <Environment name=CXX value="$GCCBINDIR/c++"></Environment>
179 + </client>
180 + <Flags SCRAM_COMPILER_NAME="gcc%compiler_ver">
181 + <Flags CCcompiler="gcc%compiler_ver_major">
182 + <Flags MODULEFLAGS="-shared">
183 + <Flags CXXDEBUGFLAG="-g">
184 + <Flags CPPDEFINES="GNU_GCC">
185 + <Flags CPPDEFINES="_GNU_SOURCE">
186 + <Flags CXXSHAREDOBJECTFLAGS="-fPIC">
187 + <Flags CXXFLAGS="-pedantic -ansi -pthread -pipe">
188 + <Flags CXXFLAGS="-O2">
189 + <Flags CXXFLAGS="-felide-constructors -fmessage-length=0 -ftemplate-depth-300">
190 + <Flags CXXFLAGS="-Wall -Wno-non-template-friend -Wno-long-long -Wimplicit -Wreturn-type -Wunused -Wparentheses">
191 + <Flags LDFLAGS="-Wl,-E">
192 + <Flags CXXSHAREDFLAGS="-Wl,-E">
193 + <Flags SHAREDSUFFIX="so">
194 + <Flags SCRAM_LANGUAGE_TYPE="C++">
195 + <Runtime name=LD_LIBRARY_PATH value="$GCC_BASE/lib" type=path>
196 + </tool>
197 + EOF_TOOLFILE
198 + cat << \EOF_TOOLFILE >%i/etc/scram.d/ccompiler
199 + <doc type=BuildSystem::ToolDoc version=1.1>
200 + <tool name=ccompiler version=%v type=compiler>
201 + <client>
202 + <Environment name=GCC_BASE default="%i"></Environment>
203 + <Environment name=GCCBINDIR value="$GCC_BASE/bin"></Environment>
204 + <Environment name=CC value="$GCCBINDIR/gcc"></Environment>
205 + </client>
206 + <Flags CDEBUGFLAG="-g">
207 + <Flags CSHAREDOBJECTFLAGS="-fPIC">
208 + <Flags CFLAGS="-pthread">
209 + <Flags CFLAGS="-O2">
210 + <Flags LDFLAGS="-Wl,-E">
211 + <Flags CSHAREDFLAGS="-Wl,-E">
212 + <Flags SCRAM_COMPILER_NAME="gcc%compiler_ver">
213 + <Flags SCRAM_LANGUAGE_TYPE="C">
214 + </tool>
215 + EOF_TOOLFILE
216 + cat << \EOF_TOOLFILE >%i/etc/scram.d/f77compiler
217 + <doc type=BuildSystem::ToolDoc version=1.1>
218 + <tool name=f77compiler version=%v type=compiler>
219 + <lib name=g2c>
220 + <lib name=m>
221 + <client>
222 + <Environment name=G77_BASE default="%i"></Environment>
223 + <Environment name=FC default="$G77_BASE/bin/g77"></Environment>
224 + </client>
225 + <Flags SCRAM_COMPILER_NAME="gcc%compiler_ver">
226 + <Flags FFLAGS="-fno-second-underscore -Wno-globals -Wunused -Wuninitialized">
227 + <Flags FCO2Flag="-O2">
228 + <Flags FCOPTIMISED="-O2">
229 + <Flags FCDEBUGFLAG="-g">
230 + <Flags FCSHAREDFCOBJECTFLAGS="-fPIC">
231 + <Flags SCRAM_LANGUAGE_TYPE="FORTRAN">
232 + </tool>
233 + EOF_TOOLFILE
234 + ;;
235 + slc4_amd64_* )
236 + cat << \EOF_TOOLFILE >%i/etc/scram.d/cxxcompiler
237 + <doc type=BuildSystem::ToolDoc version=1.1>
238 + <tool name=cxxcompiler version=%v type=compiler>
239 + <client>
240 + <Environment name=GCC_BASE default="%i"></Environment>
241 + <Environment name=GCCBINDIR default="$GCC_BASE/bin"></Environment>
242 + <Environment name=CXX value="$GCCBINDIR/c++"></Environment>
243 + </client>
244 + <Flags SCRAM_COMPILER_NAME="gcc%compiler_ver">
245 + <Flags CCcompiler="gcc%compiler_ver_major">
246 + <Flags MODULEFLAGS="-shared">
247 + <Flags CXXDEBUGFLAG="-g">
248 + <Flags CPPDEFINES="GNU_GCC">
249 + <Flags CPPDEFINES="_GNU_SOURCE">
250 + <Flags CXXSHAREDOBJECTFLAGS="-fPIC">
251 + <Flags CXXFLAGS="-pedantic -ansi -pthread -pipe">
252 + <Flags CXXFLAGS="-O2">
253 + <Flags CXXFLAGS="-felide-constructors -fmessage-length=0 -ftemplate-depth-300">
254 + <Flags CXXFLAGS="-Wall -Wno-non-template-friend -Wno-long-long -Wimplicit -Wreturn-type -Wunused -Wparentheses">
255 + <Flags LDFLAGS="-Wl,-E">
256 + <Flags CXXSHAREDFLAGS="-Wl,-E">
257 + <Flags SHAREDSUFFIX="so">
258 + <Flags SCRAM_LANGUAGE_TYPE="C++">
259 + <Runtime name=LD_LIBRARY_PATH value="$GCC_BASE/lib64" type=path>
260 + </tool>
261 + EOF_TOOLFILE
262 + cat << \EOF_TOOLFILE >%i/etc/scram.d/ccompiler
263 + <doc type=BuildSystem::ToolDoc version=1.1>
264 + <tool name=ccompiler version=%v type=compiler>
265 + <client>
266 + <Environment name=GCC_BASE default="%i"></Environment>
267 + <Environment name=GCCBINDIR value="$GCC_BASE/bin"></Environment>
268 + <Environment name=CC value="$GCCBINDIR/gcc"></Environment>
269 + </client>
270 + <Flags CDEBUGFLAG="-g">
271 + <Flags CSHAREDOBJECTFLAGS="-fPIC">
272 + <Flags CFLAGS="-pthread">
273 + <Flags CFLAGS="-O2">
274 + <Flags LDFLAGS="-Wl,-E">
275 + <Flags CSHAREDFLAGS="-Wl,-E">
276 + <Flags SCRAM_COMPILER_NAME="gcc%compiler_ver">
277 + <Flags SCRAM_LANGUAGE_TYPE="C">
278 + </tool>
279 + EOF_TOOLFILE
280 + cat << \EOF_TOOLFILE >%i/etc/scram.d/f77compiler
281 + <doc type=BuildSystem::ToolDoc version=1.1>
282 + <tool name=f77compiler version=%v type=compiler>
283 + <lib name=g2c>
284 + <lib name=m>
285 + <client>
286 + <Environment name=G77_BASE default="%i"></Environment>
287 + <Environment name=FC default="$G77_BASE/bin/g77"></Environment>
288 + </client>
289 + <Flags SCRAM_COMPILER_NAME="gcc%compiler_ver">
290 + <Flags FFLAGS="-fno-second-underscore -Wno-globals -Wunused -Wuninitialized">
291 + <Flags FCO2Flag="-O2">
292 + <Flags FCOPTIMISED="-O2">
293 + <Flags FCDEBUGFLAG="-g">
294 + <Flags FCSHAREDFCOBJECTFLAGS="-fPIC">
295 + <Flags SCRAM_LANGUAGE_TYPE="FORTRAN">
296 + </tool>
297 + EOF_TOOLFILE
298 + ;;
299 + osx104_ppc32_gcc40* )
300 + cat << \EOF_TOOLFILE >%i/etc/scram.d/cxxcompiler
301 + <doc type=BuildSystem::ToolDoc version=1.1>
302 + <tool name=cxxcompiler version=%v type=compiler>
303 + <client>
304 + <Environment name=GCC_BASE default="%i"></Environment>
305 + <Environment name=GCCBINDIR default="$GCC_BASE/bin"></Environment>
306 + <Environment name=CXX value="$GCCBINDIR/c++"></Environment>
307 + </client>
308 + <Flags SCRAM_COMPILER_NAME="gcc40">
309 + <Flags CCcompiler="gcc40">
310 + <Flags MODULEFLAGS=" ">
311 + <Flags CXXDEBUGFLAG="-g">
312 + <Flags CPPDEFINES="GNU_GCC">
313 + <Flags CPPDEFINES="_GNU_SOURCE">
314 + <Flags CXXSHAREDOBJECTFLAGS="-fPIC">
315 + <Flags CXXFLAGS="-pedantic -ansi -pipe">
316 + <Flags CXXFLAGS="-O2">
317 + <Flags CXXFLAGS="-felide-constructors -fmessage-length=0 -ftemplate-depth-300">
318 + <Flags CXXFLAGS="-Wall -Wno-non-template-friend -Wno-long-long -Wimplicit -Wreturn-type -Wunused -Wparentheses">
319 + <Flags LDFLAGS=" ">
320 + <Flags CXXSHAREDFLAGS="-dynamiclib -single_module">
321 + <Flags SHAREDSUFFIX="dylib">
322 + <Flags SCRAM_LANGUAGE_TYPE="C++">
323 + <Runtime name=DYLD_LIBRARY_PATH value="$GCC_BASE/lib" type=path>
324 + </tool>
325 + EOF_TOOLFILE
326 + ;;
327 + esac
328 +
329   %post
330 < %{relocateConfig}lib/libg2c.la
331 < %{relocateConfig}lib/libstdc++.la
332 < %{relocateConfig}lib/libsupc++.la
333 < %if "%cpu" == "amd64"
334 < %{relocateConfig}lib64/libg2c.la
335 < %{relocateConfig}lib64/libstdc++.la
336 < %{relocateConfig}lib64/libsupc++.la
337 < %{relocateConfig}lib/32/libg2c.la
338 < %{relocateConfig}lib/32/libstdc++.la
339 < %{relocateConfig}lib/32/libsupc++.la
340 < %endif
330 > # %{relocateConfig}lib/libg2c.la
331 > # %{relocateConfig}lib/libstdc++.la
332 > # %{relocateConfig}lib/libsupc++.la
333 > # %if "%cpu" == "amd64"
334 > # %{relocateConfig}lib64/libg2c.la
335 > # %{relocateConfig}lib64/libstdc++.la
336 > # %{relocateConfig}lib64/libsupc++.la
337 > # %{relocateConfig}lib/32/libg2c.la
338 > # %{relocateConfig}lib/32/libstdc++.la
339 > # %{relocateConfig}lib/32/libsupc++.la
340 > # %endif
341 > # %if "%gcc4" == "true"
342 > # %{relocateConfig}lib/libgfortran.la
343 > # %{relocateConfig}lib/libgfortranbegin.la
344 > # %endif
345 > %{relocateConfig}etc/scram.d/cxxcompiler
346 > %{relocateConfig}etc/scram.d/ccompiler
347 > %{relocateConfig}etc/scram.d/f77compiler

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines