ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/CMSDIST/gcc-toolfile.spec
Revision: 1.26
Committed: Sun Mar 21 07:49:09 2010 UTC (15 years, 1 month ago) by elmer
Branch: MAIN
CVS Tags: ebFor363slhc3p1, CMSSW_3_9_9_patch1, apFor399p1v0, CMSSW_3_9_9, apFor399v0, CMSSW_3_6_3_SLHC3, ebFor363slhc3, CMSSW_3_9_8_patch2, apFor398p2v0, ebFor363slhc2, CMSSW_3_9_8_patch1, apFor398p1v0, CMSSW_3_9_8, apFor398v0, CMSSW_3_6_3_SLHC1_patch3, ebFor363slhc1pat3, CMSSW_3_6_3_SLHC1_patch2, smFor398a, smFor398, ebFor363slhc1pat2, CMSSW_3_8_7_patch2, sjgFor387p2b, sjgFor387p2, CMSSW_3_9_7, apFor397v0, CMSSW_3_9_6, apFor396v0, CMSSW_3_8_7_patch1, CMSSW_3_9_5_patch2, apFor395p2v0, smFor310X-101206a, smFor310X-101206, pe20101206-for3100pre7r52706b, CMSSW_3_10_0_pre7g494c1, CMSSW_3_9_5_patch1, apFor395p1v0, smFor3100pre7G494C1a, pe20101203-root52706b, DQMGUI_5_3_2, dsr20101201fwlite387, CMSSW_3_10_0_pre7io, azFor3100pre7io-a, smFor3100pre7io-a, azFor3100pre7io-Updated, smFor3100pre7G494C1, azFor3100pre7io, smFor3100pre7io, CMSSW_3_10_0_pre7, smFor3100pre7, smFor310X-101130, CMSSW_3_8_7, smFor310X-101129, dsr20101129fwlite394, CMSSW_3_9_5, CMSSW_3_10_0_pre6, smFor3100pre6, apFor395v0, sjg101126b, sjg101126a, CMSSW_3_9_4, smFor310X-101123, apFor394v0, smFor39X-101123, for310X-101122a, CMSSW_3_8_6_patch2, sjgFor386p2, for310X-101122, sjg101122b, sjg101122a, CMSSW_3_10_0_pre5, azFor3100p5, CMSSW_3_9_3, apFor393v0, CMSSW_3_10_0_pre4r52706, pe20101112b-for3100p4r52706, pe20101112-for3100p4r52706, smFor310X-101111, CMSSW_3_9_2_patch5, CMSSW_3_10_0_pre4, CMSSW_3_9_2_patch4, azFor3100pre4-Updated, azFor3100pre4, smFor392p4, CMSSW_3_8_6_patch1, sjgFor386p1, CMSSW_3_9_2_patch3, apFor392p3v0, CMSSW_3_9_2_patch2, apFor392p2v0, smFor310-101106, CMSSW_3_9_2_patch1, apFor392p1v0, smFor310-101104, CMSSW_3_9_2, apFor392v0, sjgFor392, CMSSW_3_10_0_pre3, CMSSW_3_8_6, azFor3100p3a, smFor386a, azFor3100p3, CMSSW_3_9_1_patch1, smFor391patch1, CMSSW_3_9_1, smFor391, apFor391v1, apFor391v0, ebFor363slhc1pat1v0, smFor386, CMSSW_3_10_0_pre2, smFor3100pre2, CMSSW_3_8_5_patch3, apFor385p3v0, CMSSW_3_10_0_pre1, smFor3100pre1, CMSSW_3_8_5_patch2, sjgFor385p2, CMSSW_3_8_5_patch1, sjgFor385p1, eskFor3XYpreZ, CMSSW_3_9_0, apFor390v0, CMSSW_3_9_0_pre7, CMSSW_3_8_4_patch4, sjfFor384p4, apFor390pre7v0, sm39Xtoolconf-101007, CMSSW_3_8_5, sjgFor385, sm39Xtoolconf-101005, DQMGUI_5_3_1, CMSSW_3_9_0_pre6, apFor390pre6v0, smFor390pre6toolconf-101001, CMSSW_3_8_4_patch3, sjgFor384patch3v3, sjgFor384patch3v2, sjgFor384patch3, smFor390pre6toolconf-100929, smFor390pre6toolconf, smFor385toolconf, sm100928a, CMSSW_3_9_0_pre5, apFor390pre5v0, CMSSW_3_8_4_patch2, bhFor384p2, CMSSW_3_8_4_patch1, bhFor384p1, CMSSW_3_9_0_pre4, CMSSW_3_8_4, bhFor384, apFor390pre4v0, CMSSW_3_8_3, pe20100912-for39X, bhFor383, apFor383v1, apFor383v0, CMSSW_3_8_2_patch1, bhFor382p1, CMSSW_3_6_3_SLHC1, fc20100901b, fc20100901a, CMSSW_3_9_0_pre3, sm100901a, CMSSW_3_8_1_patch4, bhFor381patch4, sm390p3toolconf, CMSSW_3_8_2, bhFor382, sm39XPoolLess, sm100823a, CMSSW_3_8_1_patch3, smFor381patch3, pe20100819a-for390p2r52704, CMSSW_3_6_1_patch7, pe20100817a-for390p2r52704, smFor361patch7, dsr20100816fwlite381, dsr20100816fwlite371, CMSSW_3_9_0_pre2, for390pre2, dsr20100812fwlite371, CMSSW_3_6_3_hltpatch4, CMSSW_3_8_1_patch2, bhFor381p2, for390p2tools1, for390pre2tools, CMSSW_3_8_1_patch1, bhFor381patch1, CMSSW_3_7_1, CMSSW_3_8_1, bhFor381, fw371, dsr20100805fwlite363, CMSSW_3_8_0_patch2, bhFor380patch2, smFor363patch2, CMSSW_3_9_0_pre1, apFor390pre1v0, pe20100727a-for39X, CMSSW_3_8_0_patch1, bhFor380patch1, CMSSW_3_8_0, bhFor380, CMSSW_3_6_1_patch6, apFor361p6v0, CMSSW_3_8_0_pre8, bhFor380pre8, CMSSW_3_6_3_patch1, apFor363p1v0, CMSSW_3_8_0_pre7, bhFor380pre7, CMSSW_3_7_0_patch4, CMSSW_3_8_0_pre6, smFor370patch4, CMSSW_3_7_0_patch3, bhFor380pre6, CMSSW_3_8_0_pre5ssl, pe20100624b-for38Xssl, pe20100624a-for38Xssl, CMSSW_3_8_0_pre5, CMSSW_3_6_1_patch5, smFor370patch3, pe20100623a-for38Xssl, smFor361patch5, apFor380pre5v0, CMSSW_3_8_0_pre4catfix, bhFor380pre4catfix, bhFor380pre4_cat_fix, CMSSW_3_8_0_pre4, bhFor380pre4, CMSSW_3_8_0_pre3, bhFor380pre3, CMSSW_3_6_3, apFor363v0, pe20100612a-gcc45-from380p2, CMSSW_3_8_0_pre2, CMSSW_3_7_0_patch2, smFor370p2, bhFor380_pre2, pe20100606a-for38X, CMSSW_3_6_2, CMSSW_3_7_0_patch1, smFor370patch1, apFor362v1, apFor362v0, CMSSW_3_8_0_pre1, apFor380pre1v0, CMSSW_3_6_1_patch4, apFor361p4v0, CMSSW_3_7_0, smFor370, dsr20100526fwlite361, CMSSW_3_6_1_patch3, apFor361p3v0, CMSSW_3_7_0_pre5g493ref04, CMSSW_3_6_1_patch2, apFor361p2v0, ge20100521b-new-rpm, ge20100521-new-rpm, pe20100521-for37X-newG4, DQMGUI_5_2_1c, pe20100519a-for37X, ge20100519-new-apt, CMSSW_3_7_0_pre5, smFor370pre5, CMSSW_3_6_1_patch1, apFor361p1v2, apFor361p1v1, apFor361p1v0, CMSSW_3_7_0_pre4, sm370pre4, sm100511a, pe20100511b-for37X, pe20100511a-for37X, sm100511, CMSSW_3_6_1, pe20100510b-for37X, pe20100510a-for37X, apFor361v1, apFor361v0, sm100507pftrack, fw360online_test2, fw360online_test1, sm100506, sm100505a, sm100505, CMSSW_3_7_0_pre3, for370pre3, CMSSW_3_6_0_patch2, apFor360p2v0, CMSSW_3_6_0_patch1, apFor360p1v2, apFor360p1v1, apFor360p1v0, CMSSW_3_7_0_pre2, for370pre2, ge20100427-rpm-on-linux, ge20100422-rpm-4-8-0, CMSSW_3_7_0_pre1, smFor370pre1, pe20100420a-for37X, pe20100419b-for37X, pe20100419a-for37X, pe20100419a-for36X-37X, pe20100419a-gcc45-from360, CMSSW_3_6_0, pe20100416a-for36X, pe20100414b-gcc45-from360p6, pe20100414-gcc45-from360p6, pe20100410-gcc45-from360p6, CMSSW_3_6_0_pre6, pe20100409b-for36X, pe20100409a-for36X, CMSSW_3_6_0_pre5io, pe20100408a-for36Xio, CMSSW_3_6_0_pre5, pe20100401a-for36X, pe20100330a-for36X, pe20100329a-for36X, dsr20100326fwlite355osx, CMSSW_3_6_0_pre4, pe20100324a-for36X, pe20100321a-for36X
Changes since 1.25: +1 -1 lines
Log Message:
Change several additional compiler warnings into errors for slc5 builds:
-Werror=format -Werror=sign-compare -Werror=write-strings -Werror=strict-overflow

File Contents

# User Rev Content
1 muzaffar 1.18 ### RPM cms gcc-toolfile 10.0
2 eulisse 1.1
3     # gcc has a separate spec file for the generating a
4     # toolfile because gcc.spec could be not build because of the
5     # "--use-system-compiler" option.
6    
7     Source: none
8    
9     %prep
10     %build
11     %install
12     mkdir -p %i/etc/scram.d
13     if [ "X$GCC_ROOT" = X ]
14     then
15     GCC_PATH=`which gcc` || exit 1
16     GCC_ROOT=`echo $GCC_PATH | sed -e 's|/bin/gcc||'`
17 eulisse 1.3 GCC_VERSION=`gcc -v 2>&1 | grep "gcc version" | sed 's|[^0-9]*\([0-9].[0-9].[0-9]\).*|\1|'` || exit 1
18 eulisse 1.1 fi
19    
20     COMPILER_VERSION=`echo %cmsplatf | sed -e 's|.*gcc\([0-9]*\).*|\1|'`
21     COMPILER_VERSION_MAJOR=`echo %cmsplatf | sed -e 's|.*gcc\([0-9]\).*|\1|'`
22    
23 elmer 1.15 # Generate general template for the tool files. Note that on top of
24     # this template there are some additional cmsplatf-dependent substitutions
25     # and some overall general substitutions below
26 eulisse 1.1 case %cmsplatf in
27 elmer 1.25 slc5_ia32_gcc4* | slc5_amd64_gcc4* | slc5onl_ia32_gcc4* )
28 muzaffar 1.22 cat << \EOF_TOOLFILE >%i/etc/scram.d/cxxcompiler.xml
29     <tool name="cxxcompiler" version="@GCC_VERSION@" type="compiler">
30     <client>
31     <environment name="GCC_BASE" default="@GCC_ROOT@"/>
32     <environment name="GCCBINDIR" default="$GCC_BASE/bin"/>
33     <environment name="CXX" value="$GCCBINDIR/c++"/>
34     </client>
35     <flags scram_compiler_name="gcc@COMPILER_VERSION@"/>
36     <flags cccompiler="gcc@COMPILER_VERSION_MAJOR@"/>
37     <flags moduleflags="-shared"/>
38     <flags cxxdebugflag="-g"/>
39     <flags cppdefines="GNU_GCC"/>
40     <flags cppdefines="_GNU_SOURCE"/>
41     <flags cxxsharedobjectflags="-fPIC"/>
42     <flags cxxflags="-pedantic -ansi -pthread -pipe"/>
43     <flags cxxflags="@GXXOPT@"/>
44     <flags cxxflags="-felide-constructors -fmessage-length=0 -ftemplate-depth-300"/>
45 elmer 1.26 <flags cxxflags="-Wall -Wno-non-template-friend -Wno-long-long -Wimplicit -Wreturn-type -Wunused -Wparentheses -Werror=array-bounds -Wno-deprecated -Werror=overflow -Werror=return-type -Werror=format-contains-nul -Werror=missing-braces -Werror=unused-value -Werror=address -Werror=format -Werror=sign-compare -Werror=write-strings -Werror=strict-overflow -fdiagnostics-show-option"/>
46 muzaffar 1.22 <flags ldflags="@LDOPT@"/>
47     <flags cxxsharedflags="-Wl,-E"/>
48     <flags sharedsuffix="so"/>
49     <flags scram_language_type="C++"/>
50     <runtime name="LD_LIBRARY_PATH" value="$GCC_BASE/@GXXLIB@" type="path"/>
51     <runtime name="PATH" value="$GCC_BASE/bin" type="path"/>
52     </tool>
53 elmer 1.7 EOF_TOOLFILE
54 muzaffar 1.22 cat << \EOF_TOOLFILE >%i/etc/scram.d/ccompiler.xml
55     <tool name="ccompiler" version="@GCC_VERSION@" type="compiler">
56     <client>
57     <environment name="GCC_BASE" default="@GCC_ROOT@"/>
58     <environment name="GCCBINDIR" value="$GCC_BASE/bin"/>
59     <environment name="CC" value="$GCCBINDIR/gcc"/>
60     </client>
61     <flags cdebugflag="-g"/>
62     <flags csharedobjectflags="-fPIC"/>
63     <flags cflags="-pthread"/>
64     <flags cflags="-O2"/>
65     <flags ldflags="-Wl,-E"/>
66     <flags csharedflags="-Wl,-E"/>
67     <flags scram_compiler_name="gcc@COMPILER_VERSION@"/>
68     <flags scram_language_type="C"/>
69     </tool>
70 elmer 1.7 EOF_TOOLFILE
71 muzaffar 1.22 cat << \EOF_TOOLFILE >%i/etc/scram.d/f77compiler.xml
72     <tool name="f77compiler" version="@GCC_VERSION@" type="compiler">
73     <lib name="gfortran"/>
74     <lib name="m"/>
75     <client>
76     <environment name="G77_BASE" default="@GCC_ROOT@"/>
77     <environment name="FC" default="$G77_BASE/bin/gfortran"/>
78     </client>
79     <flags scram_compiler_name="gcc@COMPILER_VERSION@"/>
80     <flags fflags="-fno-second-underscore -Wunused -Wuninitialized -O2"/>
81     <flags fco2flag="-O2"/>
82     <flags fcoptimised="-O2"/>
83     <flags fcdebugflag="-g"/>
84     <flags fcsharedobjectflags="-fPIC"/>
85     <flags scram_language_type="FORTRAN"/>
86     </tool>
87 elmer 1.7 EOF_TOOLFILE
88     ;;
89 dsr 1.24 osx104_ppc32_gcc40* | osx104_ia32_gcc40* | osx10[56]* )
90 muzaffar 1.22 cat << \EOF_TOOLFILE >%i/etc/scram.d/cxxcompiler.xml
91     <tool name="cxxcompiler" version="@GCC_VERSION@" type="compiler">
92     <client>
93     <environment name="GCC_BASE" default="@GCC_ROOT@"/>
94     <environment name="GCCBINDIR" default="$GCC_BASE/bin"/>
95     <environment name="CXX" value="$GCCBINDIR/c++"/>
96     </client>
97     <flags SCRAM_COMPILER_NAME="gcc40"/>
98     <flags CCcompiler="gcc40"/>
99     <flags MODULEFLAGS=" "/>
100     <flags CXXDEBUGFLAG="-g"/>
101     <flags CPPDEFINES="GNU_GCC"/>
102     <flags CPPDEFINES="_GNU_SOURCE"/>
103     <flags CXXSHAREDOBJECTFLAGS="-fPIC"/>
104 dsr 1.24 <flags CXXFLAGS="@OSXARCH@ -pedantic -ansi -pipe"/>
105 muzaffar 1.22 <flags CXXFLAGS="-O2"/>
106     <flags CXXFLAGS="-felide-constructors -fmessage-length=0 -ftemplate-depth-300"/>
107     <flags CXXFLAGS="-Wall -Wno-non-template-friend -Wno-long-long -Wimplicit -Wreturn-type -Wunused -Wparentheses"/>
108     <flags LDFLAGS=" "/>
109 dsr 1.24 <flags CXXSHAREDFLAGS="@OSXARCH@ -dynamiclib -single_module"/>
110 muzaffar 1.22 <flags SHAREDSUFFIX="dylib"/>
111     <flags SCRAM_LANGUAGE_TYPE="C++"/>
112 dsr 1.23 <runtime name="DYLD_LIBRARY_PATH" value="$GCC_BASE/lib" type="path"/>
113     <runtime name="PATH" value="$GCC_BASE/bin" type="path"/>
114 muzaffar 1.22 </tool>
115 eulisse 1.1 EOF_TOOLFILE
116     ;;
117     esac
118    
119 elmer 1.15 # Specific substitutions to the templates above (default case needed?)
120     case %cmsplatf in
121 andreasp 1.17 slc5_ia32_gcc4* | slc5onl_ia32_gcc4* )
122 muzaffar 1.22 perl -p -i -e "s|\@LDOPT\@|-Wl,-E -Wl,--hash-style=gnu|g" %i/etc/scram.d/cxxcompiler.xml
123     perl -p -i -e "s|\@GXXLIB\@|lib|g" %i/etc/scram.d/cxxcompiler.xml
124     perl -p -i -e "s|\@GXXOPT\@|-O2|g" %i/etc/scram.d/cxxcompiler.xml
125 elmer 1.15 ;;
126 elmer 1.19 slc5_amd64_gcc4* )
127 muzaffar 1.22 perl -p -i -e "s|\@LDOPT\@|-Wl,-E -Wl,--hash-style=gnu|g" %i/etc/scram.d/cxxcompiler.xml
128     perl -p -i -e "s|\@GXXLIB\@|lib64|g" %i/etc/scram.d/cxxcompiler.xml
129 elmer 1.25 perl -p -i -e "s|\@GXXOPT\@|-O2 -ftree-vectorize|g" %i/etc/scram.d/cxxcompiler.xml
130 elmer 1.15 ;;
131 dsr 1.24 osx*_ia32_gcc4* )
132     perl -p -i -e "s|\@OSXARCH\@|-arch i386|g" %i/etc/scram.d/cxxcompiler.xml
133     ;;
134     osx*_amd64_gcc4* )
135     perl -p -i -e "s|\@OSXARCH\@|-arch x86_64|g" %i/etc/scram.d/cxxcompiler.xml
136     ;;
137     osx*_ppc32_gcc4* )
138     perl -p -i -e "s|\@OSXARCH\@|-arch ppc|g" %i/etc/scram.d/cxxcompiler.xml
139     ;;
140 elmer 1.15 esac
141    
142     # General substitutions
143 eulisse 1.1 perl -p -i -e "s|\@GCC_ROOT\@|$GCC_ROOT|g;
144     s|\@GCC_VERSION\@|$GCC_VERSION|g;
145     s|\@COMPILER_VERSION\@|$COMPILER_VERSION|g;
146     s|\@COMPILER_VERSION_MAJOR\@|$COMPILER_VERSION_MAJOR|g;
147 muzaffar 1.22 " %i/etc/scram.d/cxxcompiler.xml \
148     %i/etc/scram.d/ccompiler.xml \
149     %i/etc/scram.d/f77compiler.xml
150 eulisse 1.1 %post
151 muzaffar 1.22 %{relocateConfig}etc/scram.d/cxxcompiler.xml
152     %{relocateConfig}etc/scram.d/ccompiler.xml
153     %{relocateConfig}etc/scram.d/f77compiler.xml