ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/CMSDIST/gcc.spec
Revision: 1.91
Committed: Tue Oct 11 15:07:57 2011 UTC (13 years, 6 months ago) by lat
Branch: MAIN
CVS Tags: bld_1366393047_das_slc5_amd64_gcc461, bld_1366387004_das_slc5_amd64_gcc461, bld_1366383107_das_slc5_amd64_gcc461, bld_1366320846_das_slc5_amd64_gcc461, bld_1366318481_das_slc5_amd64_gcc461, bld_1366310647_das_slc5_amd64_gcc461, bld_1366297091_das_slc5_amd64_gcc461, bld_1366294257_wmagent-dev_slc5_amd64_gcc461, bld_1366231053_das_slc5_amd64_gcc461, bld_1366227545_das_slc5_amd64_gcc461, bld_1366220453_wmagent-dev_slc5_amd64_gcc461, bld_1366217887_das_slc5_amd64_gcc461, bld_1366212554_das_slc5_amd64_gcc461, bld_1366142291_das_slc5_amd64_gcc461, bld_1366137469_das_slc5_amd64_gcc461, bld_1366136287_das_slc5_amd64_gcc461, bld_1366133845_das_slc5_amd64_gcc461, bld_1366130037_das_slc5_amd64_gcc461, bld_1365873495_das_slc5_amd64_gcc461, bld_1365864253_das_slc5_amd64_gcc461, bld_1365813474_das_slc5_amd64_gcc461, bld_1365801108_wmagent-dev_slc5_amd64_gcc461, bld_1365798254_das_slc5_amd64_gcc461, bld_1365756543_cmsweb_slc5_amd64_gcc461, bld_1365755645_cmsweb_slc5_amd64_gcc461, bld_1365754910_das_slc5_amd64_gcc461, HG1304e, bld_1365639925_das_slc5_amd64_gcc461, bld_1365189699_wmagent-dev_slc5_amd64_gcc461, bld_1365145423_cmsweb_slc5_amd64_gcc461, bld_1365144485_cmsweb_slc5_amd64_gcc461, HG1304d, bld_1365103387_wmagent-dev_osx106_amd64_gcc461, bld_1365103080_wmagent-dev_slc5_amd64_gcc461, bld_1365093891_cmsweb_slc5_amd64_gcc461, bld_1365092930_cmsweb_slc5_amd64_gcc461, HG1304c, bld_1365018384_wmagent-dev_slc5_amd64_gcc461, bld_1365016270_reqmon_slc5_amd64_gcc461, bld_1364985624_wmagent-dev_slc5_amd64_gcc461, bld_1364978618_wmagent-dev_slc5_amd64_gcc461, bld_1364915341_reqmgr_slc5_amd64_gcc461, bld_1364898638_wmagent-dev_slc5_amd64_gcc461, bld_1364871746_workqueue_slc5_amd64_gcc461, bld_1364871746_reqmon_slc5_amd64_gcc461, bld_1364855420_wmagent-dev_slc5_amd64_gcc461, bld_1364477498_cmsweb_slc6_amd64_gcc461, bld_1364476037_cmsweb_slc5_amd64_gcc461, HG1304b, bld_1363878515_cmsfomon_slc5_amd64_gcc461, bld_1363813148_das_slc5_amd64_gcc461, bld_1363704737_wmagent-dev_slc5_amd64_gcc461, bld_1363641809_das_slc5_amd64_gcc461, bld_1363625610_cmsweb_slc6_amd64_gcc461, bld_1363624908_wmagent-dev_osx106_amd64_gcc461, bld_1363624533_cmsweb_slc5_amd64_gcc461, HG1304a, bld_1363270485_cmsweb_slc5_amd64_gcc461, bld_1363269753_cmsweb_slc6_amd64_gcc461, bld_1363269703_cmsweb_slc5_amd64_gcc461, HG1303g, bld_1363186195_das_slc5_amd64_gcc461, HG1304a-rc2, HG1304a-rc, bld_1363027772_wmagent-dev_slc5_amd64_gcc461, bld_1362998090_cmsweb_slc5_amd64_gcc461, bld_1362996978_cmsweb_slc5_amd64_gcc461, bld_1362996936_cmsweb_slc6_amd64_gcc461, HG1303f, bld_1362587917_t0_slc5_amd64_gcc461, bld_1362587831_cmsweb_slc5_amd64_gcc461, bld_1362587049_cmsweb_slc6_amd64_gcc461, bld_1362586958_cmsweb_slc5_amd64_gcc461, HG1303e, bld_1362581633_cmsfomon_slc5_amd64_gcc461, bld_1362435765_wmagent-dev_slc5_amd64_gcc461, bld_1362396410_cmsfomon_slc5_amd64_gcc461, bld_1362396027_cmsweb_slc5_amd64_gcc461, bld_1362395773_cmsweb_slc6_amd64_gcc461, bld_1362395102_cmsweb_slc5_amd64_gcc461, bld_1362394999_cmsweb_slc6_amd64_gcc461, HG1303d, bld_1362152615_cmsweb_slc6_amd64_gcc461, bld_1362145756_cmsweb_slc5_amd64_gcc461, bld_1362144996_cmsweb_slc6_amd64_gcc461, bld_1362144848_cmsweb_slc5_amd64_gcc461, HG1303c, bld_1362086646_wmagent-dev_slc5_amd64_gcc461, bld_1362086247_reqmgr_slc5_amd64_gcc461, bld_1362086050_reqmon_slc5_amd64_gcc461, bld_1362084017_reqmgr_slc5_amd64_gcc461, bld_1362083830_reqmon_slc5_amd64_gcc461, bld_1362083383_wmagent-dev_slc5_amd64_gcc461, bld_1362024059_reqmon_slc5_amd64_gcc461, bld_1362024059_reqmgr_slc5_amd64_gcc461, bld_1362004165_wmagent-dev_slc5_amd64_gcc461, TW20130226a, bld_1361806174_wmagent-dev_slc5_amd64_gcc461, bld_1361804419_das_slc5_amd64_gcc461, bld_1361717845_cmsweb_slc6_amd64_gcc461, bld_1361549332_cmsweb_slc5_amd64_gcc461, bld_1361547565_cmsweb_slc6_amd64_gcc461, bld_1361547434_cmsweb_slc5_amd64_gcc461, HG1303b, bld_1361397493_wmagent-dev_slc5_amd64_gcc461, bld_1361396969_reqmon_slc5_amd64_gcc461, bld_1361371766_wmagent-dev_slc5_amd64_gcc461, bld_1361357725_dbs3-combined_slc5_amd64_gcc461, bld_1361302144_wmagent-dev_slc5_amd64_gcc461, bld_1361299482_das_slc5_amd64_gcc461, TW20130219c, bld_1361287535_das_slc5_amd64_gcc461, TW20130219a, bld_1361214804_filemover_slc5_amd64_gcc461, bld_1361213027_filemover_slc5_amd64_gcc461, bld_1361206184_das_slc5_amd64_gcc461, bld_1361127238_das_slc5_amd64_gcc461, bld_1361126134_cmsweb_slc6_amd64_gcc461, bld_1361059173_das_slc5_amd64_gcc461, bld_1360871999_das_slc5_amd64_gcc461, TW20130214a, TW20120214a, TW20130213a, bld_1360761050_cmsweb_slc6_amd64_gcc461, bld_1360754590_cmsweb_slc5_amd64_gcc461, HG1303a, bld_1360703803_das_slc5_amd64_gcc461, bld_1360687341_das_slc5_amd64_gcc461, bld_1360615563_reqmon_slc5_amd64_gcc461, bld_1360609706_das_slc5_amd64_gcc461, bld_1360363549_das_slc5_amd64_gcc461, bld_1360363450_couchskel_slc5_amd64_gcc461, bld_1360360484_das_slc5_amd64_gcc461, bld_1360063178_wmagent-dev_slc5_amd64_gcc461, bld_1359544500_cmsweb_slc5_amd64_gcc461, bld_1359543827_cmsweb_slc5_amd64_gcc461, HG1302c, bld_1359499778_reqmgr_slc5_amd64_gcc461, bld_1359499619_t0_reqmon_slc5_amd64_gcc461, bld_1359499209_wmagent-dev_slc5_amd64_gcc461, bld_1359365022_wmagent-dev_osx106_amd64_gcc461, bld_1359155636_workqueue_slc5_amd64_gcc461, bld_1359155118_workqueue_slc5_amd64_gcc461, bld_1359153985_reqmgr_slc5_amd64_gcc461, bld_1359151331_reqmon_slc5_amd64_gcc461, bld_1359151331_workqueue_slc5_amd64_gcc461, bld_1359151315_t0_reqmon_slc5_amd64_gcc461, bld_1359150370_wmagent-dev_slc5_amd64_gcc461, bld_1359148765_wmagent-dev_slc5_amd64_gcc461, bld_1359023285_cmsweb_slc5_amd64_gcc461, bld_1359021253_cmsweb_slc5_amd64_gcc461, HG1302b, bld_1358971407_t0_reqmon_slc5_amd64_gcc461, bld_1358958881_das_slc5_amd64_gcc461, bld_1358954381_wmagent-dev_slc5_amd64_gcc461, bld_1358742470_t0wmstats_slc5_amd64_gcc461, bld_1355848536_PHEDEX-combined-agents_slc5_amd64_gcc461, bld_1355846563_PHEDEX-combined-agents_slc5_amd64_gcc461, HG1302a, HG1212d, HG1212c, HG1212b, TW20121226a, HG1212a, bld_1352811218_cmsfomon_slc5_amd64_gcc461, HG1211g, bld_1351773793_cmsweb_osx106_amd64_gcc461, bld_1351772993_cmsweb_osx106_amd64_gcc461, HG1211f, HG1211e, TW20121025a, TW20121024a, HG1211d, HG1211c, bld_1350485088_PHEDEX-lifecycle_slc5_amd64_gcc461, TW20121015a, bld_1350043664_T0DataSvc_slc5_amd64_gcc461, HG1211b, HG1211a, HG1210f, HG1210e, HG1210d, HG1211diego, HG1210c, HG1210b, TW20120914a, TW20120913b, TW20120913a, TW20120829b, TW20120829a, HG1210a, T020120827, HG1208e, HG1208d, HG1208c, HG1207d, TW20120727a, TW20120726a, TW20120725a, HG1208a, TW20120724c, TW20120724b, TW20120724a, TW20120720a, TW20120719a, TW20120718a, HG1207c, TW20120704c, TW20120704b, TW20120704a, TW20120702c, TW20120702b, TW20120702a, TW20120621c, TW20120621a, TW20120620a, HG1207b, HG1207a, HG1206d, TW20120607a, TW20120606a, HG1206c, HG1206b, bld_1337784158_cmsweb-analytics_slc5_amd64_gcc461, bld_1337783687_cmsweb-analytics_slc5_amd64_gcc461, HG1206a, HG1205g, HG1205f, HG1205e, HG1205d, bld_1335521675_crabhb_slc5_amd64_gcc461, HG1205c, TW20120428p, TW20120421b, TW20120421a, bld_1334854417_PHEDEX-combined-agents_slc5_amd64_gcc461, HG1205b, bld_1334681121_PHEDEX-combined-agents_slc5_amd64_gcc461, TW20120417a, TW20120416a, HG1205a, TW20120410b, TW20120410a, HG1204h, HG1204g, TW20120327b, TW20120327a, TW20120326a, HG1204f, TW20120322a, HG1203i, HG1204e, TW20120321c, TW20120321b, TW20120321a, HG1204d, TW20120320b, TW20120320a, dieHG1204d, TW20120319k, TW20120319j, TW20120319i, TW20120319h, TW20120319g, TW20120319f, TW20120319e, TW20120319d, TW20120319c, TW20120319b, TW20120319a, HG1204c, TW20120313a, HG1204b, TW20120309h, TW20120309g, TW20120309f, TW20120309e, TW20120309d, TW20120309c, TW20120309b, TW20120309a, HG1204a, TW20120308b, TW20120308a, TW20120307a, HG1203h, TW20120305b, HG1203g, HG1203f, HG1203e, HG1203d, HG1203c, HG1203b, TW20120216b, TW20120216a, HG1201d, HG1203a, TW20120210a, TW20120209a, TW20120207b, TW20120207a, HG1201c, bld_1328198772_crab_slc5_amd64_gcc461, TW20120130b, TW20120130a, TW20120127b, TW20120127a, TW20120125a, bld_1327424666_crab-client3_slc5_amd64_gcc461, HG1201b, bld_1327416353_crab-server3_slc5_amd64_gcc461, bld_1327397075_cmsbuilder_slc5_amd64_gcc461, TW20120123a, TW20120120a, TW20120119b, TW20120119a, bld_1326980038_cmsbuild_slc5_amd64_gcc461, TW20120118a, bld_1326280382_cmsBuilder_slc5_amd64_gcc461, bld_1326274893_cmsBuilder_slc5_amd64_gcc461, bld_1326273864_asyncstageout_slc5_amd64_gcc461, bld_1324281658_cmsweb_osx106_amd64_gcc461, HG1201a, HG1112d, bld_1323333807_CmsTC_slc5_amd64_gcc461, HG1112c, TW20111129e, TW20111129d, TW20111129c, TW20111129a, TW20111128c, TW20111128b, TW20111128a, HG1112b, TW20111122a, TW20111120a, TW20111118c, TW20111118b, TW20111118a, HG1111e, bld_1321455789_happyface_slc5_amd64_gcc461, bld_1321454935_happyface_slc5_amd64_gcc461, TW20111115d, TW20111115c, TW20111115b, TW20111115a, HG1112a, TW20111103a, TW20111101e, TW20111101d, TW20111101c, TW20111101b, TW20111101a, TW20111028a, bld_1319551575_PHEDEX-combined-agents_slc5_amd64_gcc461, HG1111d, TW20111017d, TW20111017c, TW20111017b, TW20111017a, TW20111016a, TW20111015a, TW20111014a, HG1111c, HG1111c-bootstrap-gcc461, LT20111012a-461, LT20111012a
Changes since 1.90: +0 -6 lines
Log Message:
Undo fixincludes removal; SLC5 C99 compilation actually requires the fix.
This implies SL5 products cannot be used to compile on SL6 (or Ubuntu, or ...).

File Contents

# User Rev Content
1 lat 1.89 ### RPM external gcc 4.6.1
2 eulisse 1.16 ## INITENV +PATH LD_LIBRARY_PATH %i/lib64
3 elmer 1.76 Source0: ftp://ftp.fu-berlin.de/unix/gnu/%n/%n-%realversion/%n-%realversion.tar.bz2
4 eulisse 1.83
5     %define keep_archives true
6    
7 elmer 1.70 # For gcc version >= 4.0.0, a number of additional sources are needed.
8 eulisse 1.77 %define gmpVersion 5.0.2
9     %define mpfrVersion 3.0.1
10     %define mpcVersion 0.9
11 eulisse 1.46 Source1: ftp://ftp.gnu.org/gnu/gmp/gmp-%{gmpVersion}.tar.bz2
12     Source2: http://www.mpfr.org/mpfr-%{mpfrVersion}/mpfr-%{mpfrVersion}.tar.bz2
13 elmer 1.56 Source3: http://www.multiprecision.org/mpc/download/mpc-%{mpcVersion}.tar.gz
14 eulisse 1.63
15     # For gcc 4.5+ we need the additional tools ppl and cloog.
16     %define gcc_45plus %(echo %realversion | sed -e 's|4[.][5-9].*|true|')
17     %if "%{gcc_45plus}" == "true"
18 eulisse 1.77 %define pplVersion 0.11.2
19     %define cloogVersion 0.16.2
20 lat 1.87 Source4: http://bugseng.com/products/ppl/download/ftp/releases/%{pplVersion}/ppl-%{pplVersion}.tar.bz2
21 elmer 1.67 Source5: ftp://gcc.gnu.org/pub/gcc/infrastructure/cloog-%{cloogVersion}.tar.gz
22 eulisse 1.63 %endif
23 eulisse 1.18
24 eulisse 1.63 # On 64bit Scientific Linux build our own binutils.
25     %define use_custom_binutils %(echo %cmsos | sed -e 's|slc[0-9]*_amd64|true|')
26     %if "%use_custom_binutils" == "true"
27     %define bisonVersion 2.4
28 elmer 1.60 Source6: http://ftp.gnu.org/gnu/bison/bison-%{bisonVersion}.tar.bz2
29 lat 1.80 %define binutilsv 2.21.1
30     Source7: http://ftp.gnu.org/gnu/binutils/binutils-%binutilsv.tar.bz2
31     #Source7: http://cmsrep.cern.ch/cmssw/binutils-mirror/binutils-%binutilsv.tar.bz2
32     #Source7: http://www.kernel.org/pub/linux/devel/binutils/binutils-%binutilsv.tar.bz2
33 elmer 1.57 %endif
34    
35 eulisse 1.65 # gcc 4.5+ link time optimization support requires libelf to work. However
36     # also rpm requires it. In order to have to duplicate dependencies we
37     # build it in gcc and we pick it up from there also for rpm. Notice that
38     # libelf does not work on Macosx however this is not a problem until
39     # we use the system compiler there.
40     %define isslc %(echo %cmsos | sed -e 's|slc.*|true|')
41 eulisse 1.84 %define elfutilsVersion 0.152
42 eulisse 1.65 %if "%isslc" == "true"
43 eulisse 1.84 Source8: https://fedorahosted.org/releases/e/l/elfutils/%{elfutilsVersion}/elfutils-%{elfutilsVersion}.tar.bz2
44 eulisse 1.65 %endif
45 eulisse 1.77 Patch0: gcc-4.6.1-ignore-arch-flags-macosx
46 eulisse 1.78 # See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49540
47     Patch1: gcc-4.6.1-fix-gfortran-regression
48 eulisse 1.85 Patch2: gcc-4.6.1-elfutils-portability
49 eulisse 1.65
50 eulisse 1.16 %prep
51 eulisse 1.63 echo "use_custom_binutils: %use_custom_binutils"
52     %setup -T -b 0 -n gcc-%realversion
53 lat 1.88 %if "%gcc_45plus" == "true"
54 eulisse 1.77 # Get the macosx build to accept -arch, -F options like the official Apple one.
55     # Notice that patch command have to stay on a single line.
56     case %cmsos in
57     osx*)
58     %patch0 -p1
59     ;;
60     esac
61 eulisse 1.78 %patch1 -p0
62 lat 1.88 %endif
63 dlange 1.15
64 elmer 1.43 case %cmsos in
65 eulisse 1.62 slc*_amd64 )
66 eulisse 1.63 # Hack needed to align sections to 4096 bytes rather than 2MB on 64bit linux
67     # architectures. This is done to reduce the amount of address space wasted by
68     # relocating many libraries. This was done with a linker script before, but
69     # this approach seems to be more correct.
70 eulisse 1.62 cat << \EOF_CONFIG_GCC >> gcc/config.gcc
71     # CMS patch to include gcc/config/i386/t-cms when building gcc
72     tm_file="$tm_file i386/cms.h"
73     EOF_CONFIG_GCC
74    
75     cat << \EOF_CMS_H > gcc/config/i386/cms.h
76     #undef LINK_SPEC
77     #define LINK_SPEC "%{" SPEC_64 ":-m elf_x86_64} %{" SPEC_32 ":-m elf_i386} \
78     %{shared:-shared} \
79     %{!shared: \
80     %{!static: \
81     %{rdynamic:-export-dynamic} \
82     %{" SPEC_32 ":%{!dynamic-linker:-dynamic-linker " LINUX_DYNAMIC_LINKER32 "}} \
83     %{" SPEC_64 ":%{!dynamic-linker:-dynamic-linker " LINUX_DYNAMIC_LINKER64 "}}} \
84     %{static:-static}} -z common-page-size=4096 -z max-page-size=4096"
85     EOF_CMS_H
86     ;;
87 elmer 1.43 esac
88 dlange 1.15
89 eulisse 1.63 %if "%{use_custom_binutils}" == "true"
90 elmer 1.60 %setup -D -T -b 6 -n bison-%{bisonVersion}
91     %setup -D -T -b 7 -n binutils-%binutilsv
92 eulisse 1.46 %endif
93    
94 eulisse 1.63 # These are required for any gcc 4.x build.
95 eulisse 1.46 %setup -D -T -b 1 -n gmp-%{gmpVersion}
96     %setup -D -T -b 2 -n mpfr-%{mpfrVersion}
97 elmer 1.56 %setup -D -T -b 3 -n mpc-%{mpcVersion}
98 eulisse 1.63
99     # For gcc 4.5 and later we also need the following.
100     %if "%gcc_45plus" == "true"
101 elmer 1.57 %setup -D -T -b 4 -n ppl-%{pplVersion}
102 elmer 1.67 %setup -D -T -b 5 -n cloog-%{cloogVersion}
103 eulisse 1.63 %endif
104 eulisse 1.65
105     # These are required by rpm as well, but only on linux.
106     %if "%isslc" == "true"
107     %setup -D -T -b 8 -n elfutils-%{elfutilsVersion}
108 eulisse 1.85 %patch2 -p1
109 eulisse 1.65 %endif
110    
111 eulisse 1.63 %build
112 eulisse 1.77 # On mac we need to use gcc-proper, not gcc-llvm
113 eulisse 1.63 case %{cmsos} in
114 eulisse 1.77 osx*)
115     CC=/usr/bin/gcc-4.2
116     CXX=/usr/bin/c++-4.2
117     CPP=/usr/bin/cpp-4.2
118     ADDITIONAL_LANGUAGES=,objc,obj-c++
119 lat 1.80
120     # Apparently must emulate apple compiler even if we build
121     # full chain ourselves, as things come in via system libs.
122     # - http://newartisans.com/2009/10/a-c-gotcha-on-snow-leopard/
123     # - http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41645
124     # - http://trac.macports.org/ticket/25205 (and 22234)
125     CONF_GCC_OS_SPEC=--enable-fully-dynamic-string
126 eulisse 1.77 ;;
127 eulisse 1.63 *)
128 eulisse 1.77 CC=gcc
129     CXX=c++
130     CPP=cpp
131 lat 1.80 CONF_GCC_OS_SPEC=
132 eulisse 1.77 ;;
133 eulisse 1.20 esac
134 eulisse 1.59
135 eulisse 1.77 CC="$CC -fPIC"
136     CXX="$CXX -fPIC"
137    
138 eulisse 1.63 # Whenever we build custom binutils we also enable the new linker "gold".
139     # We do so only if we are using the new gcc 4.5+
140     if [ "X%use_custom_binutils:%gcc_45plus" = Xtrue:true ] ; then
141 elmer 1.75 CONF_BINUTILS_OPTS="--enable-gold=default --enable-lto --enable-plugins --enable-threads"
142 lat 1.86 CONF_GCC_WITH_LTO="--enable-gold=yes --enable-lto" # --with-build-config=bootstrap-lto
143 eulisse 1.63 fi
144    
145 eulisse 1.65 # Build libelf.
146     if [ "X%isslc" = Xtrue ]; then
147     cd ../elfutils-%{elfutilsVersion}
148 eulisse 1.79 ./configure --disable-static --prefix=%i CC="$CC" CXX="$CXX" CPP="$CPP"
149 eulisse 1.65 make %makeprocesses
150     make install
151     fi
152    
153 eulisse 1.63 # If requested, build our own binutils. Currently the default is to use the
154     # system binutils on 32bit platforms and our own on 64 bit ones.
155     # FIXME: Notice that this copy is actually built using the system compiler, so
156     # we chances are we will need to rebuild it later on to make sure they get
157     # linked against our libstdc++ (required by gold).
158     if [ "X%use_custom_binutils" = Xtrue ]
159     then
160     cd ../bison-%{bisonVersion}
161 eulisse 1.77 CC="$CC" ./configure --prefix=%i/tmp/bison
162 eulisse 1.63 make %makeprocesses
163     make install
164     export PATH=%i/tmp/bison/bin:$PATH
165     cd ../binutils-%{binutilsv}
166 eulisse 1.74 # Try to avoid dependency on makeinfo by forcing make not
167     # to build the documentation.
168     perl -p -i -e 's|SUBDIRS = .*|SUBDIRS =|' bfd/Makefile.in binutils/Makefile.in gas/Makefile.in
169 eulisse 1.73 perl -p -i -e 's|all: info|all:|' etc/Makefile.in
170 eulisse 1.74 perl -p -i -e 's|TEXINFOS =.*|TEXINFOS =|;s|INFO_DEPS =.*|INFO_DEPS =|' gprof/Makefile.in
171     perl -p -i -e 's|man_MANS =.*|man_MANS =|' gprof/Makefile.in
172     perl -p -i -e 's|INFO_DEPS =.*|INFO_DEPS =|' ld/Makefile.in
173     perl -p -i -e 's|INFOFILES =.*|INFOFILES =|' etc/Makefile.in
174     perl -p -i -e 's|DVIFILES =.*|DVIFILES =|' etc/Makefile.in
175     perl -p -i -e 's|PDFFILES =.*|PDFFILES =|' etc/Makefile.in
176     perl -p -i -e 's|HTMLFILES =.*|HTMLFILES =|' etc/Makefile.in
177 eulisse 1.73
178 eulisse 1.79 ./configure --disable-static --prefix=%i ${CONF_BINUTILS_OPTS} --disable-werror \
179 eulisse 1.77 CC="$CC" CXX="$CXX" CPP="$CPP" CFLAGS="-I%i/include" \
180 eulisse 1.65 CXXFLAGS="-I%i/include" LDFLAGS="-L%i/lib"
181 eulisse 1.63 make %makeprocesses
182     find . -name Makefile -exec perl -p -i -e 's|LN = ln|LN = cp -p|;s|ln ([^-])|cp -p $1|g' {} \;
183     make install
184     which ld
185     fi
186 eulisse 1.16
187 eulisse 1.63 # Build GMP/MPFR/MPC
188 eulisse 1.19 cd ../gmp-%{gmpVersion}
189 eulisse 1.79 ./configure --disable-static --prefix=%i --enable-shared --disable-static --enable-cxx CC="$CC" CXX="$CXX" CPP="$CPP"
190 eulisse 1.19 make %makeprocesses
191 eulisse 1.20 make install
192 eulisse 1.19
193     cd ../mpfr-%{mpfrVersion}
194 eulisse 1.79 ./configure --disable-static --prefix=%i --with-gmp=%i CC="$CC" CXX="$CXX" CPP="$CPP"
195 eulisse 1.19 make %makeprocesses
196 eulisse 1.31 make install
197 elmer 1.56
198     cd ../mpc-%{mpcVersion}
199 eulisse 1.79 ./configure --disable-static --prefix=%i --with-gmp=%i --with-mpfr=%i CC="$CC" CXX="$CXX" CPP="$CPP"
200 elmer 1.56 make %makeprocesses
201     make install
202 eulisse 1.63 CONF_GCC_VERSION_OPTS="--with-gmp=%i --with-mpfr=%i --with-mpc=%i"
203 elmer 1.56
204 eulisse 1.63 # Build additional stuff for gcc 4.5+
205     if [ "X%gcc_45plus" = Xtrue ]; then
206     cd ../ppl-%{pplVersion}
207 eulisse 1.84 ./configure --disable-static --with-gmp-prefix=%i --with-cxxflags="-I%i/include" --enable-interfaces=c --prefix=%i CC="$CC" CXX="$CXX" CPP="$CPP" LDFLAGS="-L%i/lib"
208 eulisse 1.63 make %makeprocesses
209     make install
210    
211 elmer 1.67 cd ../cloog-%{cloogVersion}
212 eulisse 1.79 ./configure --disable-static --prefix=%i --with-ppl=%i --with-gmp-prefix=%i CC="$CC" CXX="$CXX" CPP="$CPP"
213 eulisse 1.63 make %makeprocesses
214     make install
215 elmer 1.57
216 elmer 1.67 CONF_GCC_VERSION_OPTS="$CONF_GCC_VERSION_OPTS --with-ppl=%i --with-cloog=%i --enable-cloog-backend=isl"
217 eulisse 1.63 fi
218 eulisse 1.19
219 eulisse 1.20 # Build the compilers
220 elmer 1.58 cd ../gcc-%realversion
221 eulisse 1.18 mkdir -p obj
222     cd obj
223 eulisse 1.59 export LD_LIBRARY_PATH=%i/lib64:%i/lib:$LD_LIBRARY_PATH
224 lat 1.80 ../configure --prefix=%i --disable-multilib --disable-nls \
225 eulisse 1.77 --enable-languages=c,c++,fortran$ADDITIONAL_LANGUAGES \
226 lat 1.80 $CONF_GCC_OS_SPEC $CONF_GCC_WITH_LTO $CONF_GCC_VERSION_OPTS \
227     --enable-shared CC="$CC" CXX="$CXX" CPP="$CPP"
228 eulisse 1.18
229     make %makeprocesses bootstrap
230 eulisse 1.63 make install
231 eulisse 1.16
232 argiro 1.1 %install
233 elmer 1.58 cd %_builddir/gcc-%{realversion}/obj && make install
234 eulisse 1.51
235 argiro 1.1 ln -s gcc %i/bin/cc
236 eulisse 1.77 find %i/lib %i/lib64 -name '*.la' -exec rm -f {} \; || true
237 eulisse 1.79
238 eulisse 1.83 # Remove unneeded documentation, temporary areas, unneeded files.
239     %define drop_files %i/share/{man,info,doc,locale} %i/tmp %i/lib*/{libstdc++.a,libsupc++.a}
240 eulisse 1.79 # Strip things people will most likely never debug themself.
241 eulisse 1.83 %define more_strip %i/bin/*{c++,g++,gcc,gfortran,gcov,ppl,cloog,cpp}*
242 lat 1.86 %define strip_files %i/libexec/*/*/*/{cc1,cc1plus,f951,lto1,collect2} %i/x86_64*/bin %i/lib/lib{mpfr,ppl,gmp,cloog}* %more_strip
243 eulisse 1.83 %define keep_archives yes
244 eulisse 1.79 # This avoids having a dependency on the system pkg-config.
245     rm -rf %i/lib/pkg-config