ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/CMSDIST/gcc-toolfile.spec
Revision: 1.22
Committed: Tue Jan 12 13:59:38 2010 UTC (15 years, 3 months ago) by muzaffar
Branch: MAIN
CVS Tags: FRONTEND_CONF_3_30_20100724, FRONTEND_CONF_3_29_20100723, CMSSW_3_5_7_hltpatch4, apFor357hltp4v0, DQMGUI_5_2_1, CMSSW_3_5_8_patch4, apFor358p4v3, apFor358p4v2, apFor358p4v1, apFor358p4v0, DQMGUI_5_2_0, CMSSW_3_5_8_patch3, apFor358p3v0, CMSSW_3_5_8_patch2, apFor358p2v0, CMSSW_3_5_8_patch1, apFor358p1v1, apFor358p1v0, CMSSW_3_5_7_onlpatch2_ONLINE, CMSSW_3_5_8, CMSSW_3_5_7_onlpatch1_ONLINE, CMSSW_3_5_7_ONLINE, apFor358v0, CMSSW_3_5_4_onlpatch4_ONLINE, fwFor357online, CMSSW_3_5_7, apFor357v2, apFor357v1, apFor357v0, CMSSW_3_5_6_patch1, for356p1, CMSSW_3_5_4_patch2, CMSSW_3_5_6, for356, for354p2, dsr20100326fwlite355, CMSSW_3_5_5, CMSSW_3_5_4_onlpatch3_ONLINE, apFor355v0, CMSSW_3_5_4_patch1, for354patch1, CMSSW_3_5_4_onlpatch2_ONLINE, CMSSW_3_5_4_onlpatch1_ONLINE, CMSSW_3_5_4_ONLINE, DQMGUI_5_1_8, fwFor354onl, CMSSW_3_5_4, apFor354v0, CMSSW_3_5_3_ONLINE, fwFor353onl, CMSSW_3_5_3, apFor353v0, sm100302a-for35X, CMSSW_3_5_2_patch2, apFor352p2v0, CMSSW_3_5_2_patch1, apFor352p1v0, fwFor352onl, CMSSW_3_5_1_onlpatch1_ONLINE, CMSSW_3_5_2, apFor352v0, apFor351p2v0, CMSSW_3_5_1_patch1, for351patch1, CMSSW_3_5_1_ONLINE, FRONTEND_CONF_3_24_20100217, dsr20100216fwlite350, CMSSW_3_5_1, pe20100216b-for36Xmin, pe20100216a-for36X, apFor351v0, ge20100215-rootqt-r522, ge20100215-rootqt-pre5r526, CMSSW_3_5_0_pre5r526, ge20100212-boost, ge20100112-boost, DQMGUI_5_1_7b, CMSSW_3_5_0_patch1, for350patch1, T0Mon_100204_2, CMSSW_3_5_0_ONLINE, fwFor350online, CMSSW_3_5_0, apFor350v0, pe20100205a-for35X, pe20100204a-for35X, CMSSW_3_5_0_pre5_ONLINE, for350p5-onl-slc5, pe20100131c-for35Xr526, pe20100131b-for35Xr526, pe20100131a-for35Xr526, CMSSW_3_5_0_pre5g493, pe20100130b-for35Xg493, pe20100130-for35Xg493, CMSSW_3_5_0_pre5, for350p4-onl-slc5, pe20100129a-for35X, CMSSW_3_5_0_pre4, apFor350pre5v0, sm100128a, sm100128, apFor350pre4v0, pe20100127e-for35X, pe20100127d-for35X, pe20100127c-for35X, sm100127-onl35x, pe20100127b-for35X, pe20100127a-for35X, pe20100124a-for35X, ap20100123a-for35X, CMSSW_3_5_0_pre3, apFor350pre3v0, pe20100113a-for35X, sm20100113a-for35X, sm20100113-for35X, pe20100112b-for35X, sm20100112a-for35X, sm20100112-for35X
Changes since 1.21: +100 -104 lines
Log Message:
converted scram toolfiles to xml format

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 andreasp 1.17 slc4_ia32_gcc4* | slc5_ia32_gcc4* | slc4_amd64_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     <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 -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     </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 elmer 1.13 osx104_ppc32_gcc40* | osx104_ia32_gcc40* | osx105* )
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     <flags CXXFLAGS="-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="-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     </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     slc4_ia32_gcc4* )
122 muzaffar 1.22 perl -p -i -e "s|\@LDOPT\@|-Wl,-E|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 -fvisibility-inlines-hidden|g" %i/etc/scram.d/cxxcompiler.xml
125 elmer 1.15 ;;
126 andreasp 1.17 slc5_ia32_gcc4* | slc5onl_ia32_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\@|lib|g" %i/etc/scram.d/cxxcompiler.xml
129     perl -p -i -e "s|\@GXXOPT\@|-O2|g" %i/etc/scram.d/cxxcompiler.xml
130 elmer 1.15 ;;
131 elmer 1.19 slc4_amd64_gcc4* )
132 muzaffar 1.22 perl -p -i -e "s|\@LDOPT\@|-Wl,-E|g" %i/etc/scram.d/cxxcompiler.xml
133     perl -p -i -e "s|\@GXXLIB\@|lib64|g" %i/etc/scram.d/cxxcompiler.xml
134     perl -p -i -e "s|\@GXXOPT\@|-O2|g" %i/etc/scram.d/cxxcompiler.xml
135 elmer 1.19 ;;
136     slc5_amd64_gcc4* )
137 muzaffar 1.22 perl -p -i -e "s|\@LDOPT\@|-Wl,-E -Wl,--hash-style=gnu|g" %i/etc/scram.d/cxxcompiler.xml
138     perl -p -i -e "s|\@GXXLIB\@|lib64|g" %i/etc/scram.d/cxxcompiler.xml
139     perl -p -i -e "s|\@GXXOPT\@|-O2|g" %i/etc/scram.d/cxxcompiler.xml
140 elmer 1.15 ;;
141     esac
142    
143     # General substitutions
144 eulisse 1.1 perl -p -i -e "s|\@GCC_ROOT\@|$GCC_ROOT|g;
145     s|\@GCC_VERSION\@|$GCC_VERSION|g;
146     s|\@COMPILER_VERSION\@|$COMPILER_VERSION|g;
147     s|\@COMPILER_VERSION_MAJOR\@|$COMPILER_VERSION_MAJOR|g;
148 muzaffar 1.22 " %i/etc/scram.d/cxxcompiler.xml \
149     %i/etc/scram.d/ccompiler.xml \
150     %i/etc/scram.d/f77compiler.xml
151 eulisse 1.1 %post
152 muzaffar 1.22 %{relocateConfig}etc/scram.d/cxxcompiler.xml
153     %{relocateConfig}etc/scram.d/ccompiler.xml
154     %{relocateConfig}etc/scram.d/f77compiler.xml