ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/CMSDIST/gcc-toolfile.spec
Revision: 1.19
Committed: Thu Nov 12 17:37:21 2009 UTC (15 years, 5 months ago) by elmer
Branch: MAIN
CVS Tags: DAS_20100302_slc5_amd64_gcc434, DBS_20100226_slc5_amd64_gcc434, DBS_20100217_slc5_amd64_gcc434, FILEMOVER_20100217_slc5_amd64_gcc434, DAS_20100217_slc5_amd64_gcc434, DAS_20100216b_slc5_amd64_gcc434, DAS_20100216_slc5_amd64_gcc434, dg20100201-dbs3, FILEMOVER_20100201_slc5_amd64_gcc434, FILEMOVER_20100128b_slc5_amd64_gcc434, dg20100129-dbs3, dg20100128-dbs3, FILEMOVER_20100128_slc5_amd64_gcc434, DAS_20100127_slc5_amd64_gcc434, DAS_20100126_slc5_amd64_gcc434, FILEMOVER_20100122_slc5_amd64_gcc434, DAS_20100119_slc5_amd64_gcc434, DAS_20100115_slc5_amd64_gcc434, dg20100115-security, DBS_20100115_slc5_amd64_gcc434, dg20100112-security, DBS_20100112_slc5_amd64_gcc434, DBS_20100111_slc5_amd64_gcc434, dg20100111-security, dg20100107b-wmcore, dg20100107-wmcore, DAS_20100105_slc5_amd64_gcc434, DAS_20091221_slc5_amd64_gcc434, DAS_20091214_slc5_amd64_gcc434, dg20091211-couchdb, dg20091210-phedex, dg20091203c-comp-base, DD_20091208_slc5_amd64_gcc434, DAS_20091208_slc5_amd64_gcc434, FILEMOVER_20091208_slc5_amd64_gcc434, DBS_20091208_slc5_amd64_gcc434, CMSSW_3_4_0_pre7, eskFor340p7-slc5-gcc434, dg20091203b-comp-base, pe20091201a-for34X-slc5-gcc434, DQMCATTEST_0_0_1, pe20091130b-for34X-slc5-gcc434, pe20091130a-for34X-slc5-gcc434, pe20091120c-for34X-slc5-gcc434, CMSSW_3_4_0_pre6, pe20091120b-for34X-slc5-gcc434, pe20091120a-for34X-slc5-gcc434, pe20091119b-for34X-slc5-gcc434, pe20091119a-for34X-slc5-gcc434, eskFor340p6-slc5-gcc434, DAS_20091117, pe20091116a-for34X-slc5-gcc434, pe20091114a-for34X-slc5-gcc434, pe20091113c-for34X-slc5-gcc434
Changes since 1.18: +10 -2 lines
Log Message:
  Add -Wl,--hash-style=gnu to LDFLAGS for slc5 builds

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 eulisse 1.1 cat << \EOF_TOOLFILE >%i/etc/scram.d/cxxcompiler
29     <doc type=BuildSystem::ToolDoc version=1.1>
30     <tool name=cxxcompiler version=@GCC_VERSION@ type=compiler>
31     <client>
32     <Environment name=GCC_BASE default="@GCC_ROOT@"></Environment>
33     <Environment name=GCCBINDIR default="$GCC_BASE/bin"></Environment>
34     <Environment name=CXX value="$GCCBINDIR/c++"></Environment>
35     </client>
36     <Flags SCRAM_COMPILER_NAME="gcc@COMPILER_VERSION@">
37     <Flags CCcompiler="gcc@COMPILER_VERSION_MAJOR@">
38     <Flags MODULEFLAGS="-shared">
39     <Flags CXXDEBUGFLAG="-g">
40     <Flags CPPDEFINES="GNU_GCC">
41     <Flags CPPDEFINES="_GNU_SOURCE">
42     <Flags CXXSHAREDOBJECTFLAGS="-fPIC">
43     <Flags CXXFLAGS="-pedantic -ansi -pthread -pipe">
44 elmer 1.15 <Flags CXXFLAGS="@GXXOPT@">
45 eulisse 1.1 <Flags CXXFLAGS="-felide-constructors -fmessage-length=0 -ftemplate-depth-300">
46 elmer 1.11 <Flags CXXFLAGS="-Wall -Wno-non-template-friend -Wno-long-long -Wimplicit -Wreturn-type -Wunused -Wparentheses -Werror=array-bounds -Wno-deprecated">
47 elmer 1.19 <Flags LDFLAGS="@LDOPT@">
48 eulisse 1.1 <Flags CXXSHAREDFLAGS="-Wl,-E">
49     <Flags SHAREDSUFFIX="so">
50     <Flags SCRAM_LANGUAGE_TYPE="C++">
51 elmer 1.15 <Runtime name=LD_LIBRARY_PATH value="$GCC_BASE/@GXXLIB@" type=path>
52 elmer 1.7 <Runtime name=PATH value="$GCC_BASE/bin" type=path>
53     </tool>
54     EOF_TOOLFILE
55     cat << \EOF_TOOLFILE >%i/etc/scram.d/ccompiler
56     <doc type=BuildSystem::ToolDoc version=1.1>
57     <tool name=ccompiler version=@GCC_VERSION@ type=compiler>
58     <client>
59     <Environment name=GCC_BASE default="@GCC_ROOT@"></Environment>
60     <Environment name=GCCBINDIR value="$GCC_BASE/bin"></Environment>
61     <Environment name=CC value="$GCCBINDIR/gcc"></Environment>
62     </client>
63     <Flags CDEBUGFLAG="-g">
64     <Flags CSHAREDOBJECTFLAGS="-fPIC">
65     <Flags CFLAGS="-pthread">
66     <Flags CFLAGS="-O2">
67     <Flags LDFLAGS="-Wl,-E">
68     <Flags CSHAREDFLAGS="-Wl,-E">
69     <Flags SCRAM_COMPILER_NAME="gcc@COMPILER_VERSION@">
70     <Flags SCRAM_LANGUAGE_TYPE="C">
71     </tool>
72     EOF_TOOLFILE
73     cat << \EOF_TOOLFILE >%i/etc/scram.d/f77compiler
74     <doc type=BuildSystem::ToolDoc version=1.1>
75     <tool name=f77compiler version=@GCC_VERSION@ type=compiler>
76     <lib name=gfortran>
77     <lib name=m>
78     <client>
79     <Environment name=G77_BASE default="@GCC_ROOT@"></Environment>
80     <Environment name=FC default="$G77_BASE/bin/gfortran"></Environment>
81     </client>
82     <Flags SCRAM_COMPILER_NAME="gcc@COMPILER_VERSION@">
83 elmer 1.16 <Flags FFLAGS="-fno-second-underscore -Wunused -Wuninitialized -O2">
84 elmer 1.7 <Flags FCO2Flag="-O2">
85     <Flags FCOPTIMISED="-O2">
86     <Flags FCDEBUGFLAG="-g">
87     <Flags FCSHAREDOBJECTFLAGS="-fPIC">
88     <Flags SCRAM_LANGUAGE_TYPE="FORTRAN">
89     </tool>
90     EOF_TOOLFILE
91     ;;
92 elmer 1.13 osx104_ppc32_gcc40* | osx104_ia32_gcc40* | osx105* )
93 eulisse 1.1 cat << \EOF_TOOLFILE >%i/etc/scram.d/cxxcompiler
94     <doc type=BuildSystem::ToolDoc version=1.1>
95     <tool name=cxxcompiler version=@GCC_VERSION@ type=compiler>
96     <client>
97     <Environment name=GCC_BASE default="@GCC_ROOT@"></Environment>
98     <Environment name=GCCBINDIR default="$GCC_BASE/bin"></Environment>
99     <Environment name=CXX value="$GCCBINDIR/c++"></Environment>
100     </client>
101     <Flags SCRAM_COMPILER_NAME="gcc40">
102     <Flags CCcompiler="gcc40">
103     <Flags MODULEFLAGS=" ">
104     <Flags CXXDEBUGFLAG="-g">
105     <Flags CPPDEFINES="GNU_GCC">
106     <Flags CPPDEFINES="_GNU_SOURCE">
107     <Flags CXXSHAREDOBJECTFLAGS="-fPIC">
108     <Flags CXXFLAGS="-pedantic -ansi -pipe">
109     <Flags CXXFLAGS="-O2">
110     <Flags CXXFLAGS="-felide-constructors -fmessage-length=0 -ftemplate-depth-300">
111     <Flags CXXFLAGS="-Wall -Wno-non-template-friend -Wno-long-long -Wimplicit -Wreturn-type -Wunused -Wparentheses">
112     <Flags LDFLAGS=" ">
113     <Flags CXXSHAREDFLAGS="-dynamiclib -single_module">
114     <Flags SHAREDSUFFIX="dylib">
115     <Flags SCRAM_LANGUAGE_TYPE="C++">
116     <Runtime name=DYLD_LIBRARY_PATH value="$GCC_BASE/lib" type=path>
117     <Runtime name=PATH value="$GCC_BASE/bin" type=path>
118     </tool>
119     EOF_TOOLFILE
120     ;;
121     esac
122    
123 elmer 1.15 # Specific substitutions to the templates above (default case needed?)
124     case %cmsplatf in
125     slc4_ia32_gcc4* )
126 elmer 1.19 perl -p -i -e "s|\@LDOPT\@|-Wl,-E|g" %i/etc/scram.d/cxxcompiler
127 elmer 1.15 perl -p -i -e "s|\@GXXLIB\@|lib|g" %i/etc/scram.d/cxxcompiler
128     perl -p -i -e "s|\@GXXOPT\@|-O2 -fvisibility-inlines-hidden|g" %i/etc/scram.d/cxxcompiler
129     ;;
130 andreasp 1.17 slc5_ia32_gcc4* | slc5onl_ia32_gcc4* )
131 elmer 1.19 perl -p -i -e "s|\@LDOPT\@|-Wl,-E -Wl,--hash-style=gnu|g" %i/etc/scram.d/cxxcompiler
132 elmer 1.15 perl -p -i -e "s|\@GXXLIB\@|lib|g" %i/etc/scram.d/cxxcompiler
133     perl -p -i -e "s|\@GXXOPT\@|-O2|g" %i/etc/scram.d/cxxcompiler
134     ;;
135 elmer 1.19 slc4_amd64_gcc4* )
136     perl -p -i -e "s|\@LDOPT\@|-Wl,-E|g" %i/etc/scram.d/cxxcompiler
137     perl -p -i -e "s|\@GXXLIB\@|lib64|g" %i/etc/scram.d/cxxcompiler
138     perl -p -i -e "s|\@GXXOPT\@|-O2|g" %i/etc/scram.d/cxxcompiler
139     ;;
140     slc5_amd64_gcc4* )
141     perl -p -i -e "s|\@LDOPT\@|-Wl,-E -Wl,--hash-style=gnu|g" %i/etc/scram.d/cxxcompiler
142 elmer 1.15 perl -p -i -e "s|\@GXXLIB\@|lib64|g" %i/etc/scram.d/cxxcompiler
143     perl -p -i -e "s|\@GXXOPT\@|-O2|g" %i/etc/scram.d/cxxcompiler
144     ;;
145     esac
146    
147     # General substitutions
148 eulisse 1.1 perl -p -i -e "s|\@GCC_ROOT\@|$GCC_ROOT|g;
149     s|\@GCC_VERSION\@|$GCC_VERSION|g;
150     s|\@COMPILER_VERSION\@|$COMPILER_VERSION|g;
151     s|\@COMPILER_VERSION_MAJOR\@|$COMPILER_VERSION_MAJOR|g;
152     " %i/etc/scram.d/cxxcompiler \
153     %i/etc/scram.d/ccompiler \
154     %i/etc/scram.d/f77compiler
155     %post
156     %{relocateConfig}etc/scram.d/cxxcompiler
157     %{relocateConfig}etc/scram.d/ccompiler
158     %{relocateConfig}etc/scram.d/f77compiler