ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/CMSDIST/gcc-toolfile.spec
Revision: 1.46
Committed: Mon Dec 6 11:50:49 2010 UTC (14 years, 4 months ago) by muzaffar
Branch: MAIN
CVS Tags: CMSSW_3_10_1, smFor3101, CMSSW_3_10_0_pre9G493, sm110117, fwFor3100xdaq11b4online, smFor3110pre3, CMSSW_3_11_0_pre2, fwFor311pre2, CMSSW_3_10_0, smFor3100c, pe20101221a-for3100p9io, smFor3100b, smFor3100a, smFor3100, pe20101217b-for3100p9io, pe20101217a-for3100p9io, CMSSW_3_11_0_pre1, fwFor311pre1, smFor3100pre9G493, CMSSW_3_10_0_pre9r52706b, pe20101215-for3100p9r52706b, CMSSW_3_10_0_pre9, smFor3100pre9a, smFor3100pre9, CMSSW_3_10_0_pre8, smFor3100pre8, smFor310X-101207, smFor310X-101206b, smFor310X-101206ab
Changes since 1.45: +105 -164 lines
Log Message:
added -Wtype-limits in compiler cxxflags

File Contents

# User Rev Content
1 muzaffar 1.46 ### 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 muzaffar 1.46 GCC_PATH=`which gcc` || exit 1
16     GCC_ROOT=`echo $GCC_PATH | sed -e 's|/bin/gcc||'`
17     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 muzaffar 1.46 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 eulisse 1.1
23 muzaffar 1.46 # 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     case %cmsplatf in
27     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 muzaffar 1.46 <environment name="GCC_BASE" default="@GCC_ROOT@"/>
32     <environment name="GCCBINDIR" default="$GCC_BASE/bin"/>
33     <environment name="CXX" value="$GCCBINDIR/c++"/>
34 muzaffar 1.22 </client>
35 muzaffar 1.46 <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     <flags cxxflags="-Wall -Wno-non-template-friend -Wno-long-long -Wimplicit -Wreturn-type -Wunused -Wparentheses -Wtype-limits -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     <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 muzaffar 1.22 </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 muzaffar 1.46 <environment name="GCC_BASE" default="@GCC_ROOT@"/>
58     <environment name="GCCBINDIR" value="$GCC_BASE/bin"/>
59     <environment name="CC" value="$GCCBINDIR/gcc"/>
60 muzaffar 1.22 </client>
61 muzaffar 1.46 <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 muzaffar 1.22 </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 muzaffar 1.46 <environment name="G77_BASE" default="@GCC_ROOT@"/>
77     <environment name="FC" default="$G77_BASE/bin/gfortran"/>
78 muzaffar 1.22 </client>
79 muzaffar 1.46 <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     EOF_TOOLFILE
88     ;;
89     osx104_ppc32_gcc40* | osx104_ia32_gcc40* | osx10[56]* )
90     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     <flags CXXFLAGS="@OSXARCH@ -pedantic -ansi -pipe"/>
105     <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     <flags CXXSHAREDFLAGS="@OSXARCH@ -dynamiclib -single_module"/>
110     <flags SHAREDSUFFIX="dylib"/>
111     <flags SCRAM_LANGUAGE_TYPE="C++"/>
112     <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 elmer 1.7 EOF_TOOLFILE
116 muzaffar 1.46 ;;
117 eulisse 1.1 esac
118    
119 muzaffar 1.46 # Specific substitutions to the templates above (default case needed?)
120 elmer 1.15 case %cmsplatf in
121 muzaffar 1.46 slc5_ia32_gcc4* | slc5onl_ia32_gcc4* )
122     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 muzaffar 1.46 slc5_amd64_gcc4* )
127     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     perl -p -i -e "s|\@GXXOPT\@|-O2 -ftree-vectorize|g" %i/etc/scram.d/cxxcompiler.xml
130 dsr 1.24 ;;
131 muzaffar 1.46 osx*_ia32_gcc4* )
132     perl -p -i -e "s|\@OSXARCH\@|-arch i386|g" %i/etc/scram.d/cxxcompiler.xml
133 muzaffar 1.35 ;;
134 muzaffar 1.46 osx*_amd64_gcc4* )
135     perl -p -i -e "s|\@OSXARCH\@|-arch x86_64|g" %i/etc/scram.d/cxxcompiler.xml
136 eulisse 1.45 ;;
137 muzaffar 1.46 osx*_ppc32_gcc4* )
138     perl -p -i -e "s|\@OSXARCH\@|-arch ppc|g" %i/etc/scram.d/cxxcompiler.xml
139 dsr 1.24 ;;
140 elmer 1.15 esac
141    
142     # General substitutions
143 muzaffar 1.46 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     " %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.46 %{relocateConfig}etc/scram.d/cxxcompiler.xml
152     %{relocateConfig}etc/scram.d/ccompiler.xml
153     %{relocateConfig}etc/scram.d/f77compiler.xml