Contents of /branches/magellan-next/core/gcc/gcc-4.5.1-r1.smage2
Parent Directory | Revision Log
Revision 5837 -
(show annotations)
(download)
Mon Aug 16 22:21:33 2010 UTC (13 years, 9 months ago) by niro
File size: 6064 byte(s)
Mon Aug 16 22:21:33 2010 UTC (13 years, 9 months ago) by niro
File size: 6064 byte(s)
auto added: ver bump to 4.5.1-r1
1 | # $Id: gcc-4.3.4-r4.smage2 5620 2010-07-15 17:04:00Z niro $ |
2 | |
3 | PNAME="gcc" |
4 | PVER="4.5.1" |
5 | PBUILD="r1" |
6 | |
7 | PCATEGORIE="sys-dev" |
8 | STATE="unstable" |
9 | |
10 | HOMEPAGE="http://www.gnu.org/software/gcc/gcc.html" |
11 | |
12 | SDEPEND="== sys-libs/libstdc++-${PVER} |
13 | >= sys-dev/binutils-2.20 |
14 | >= virtual/glibc |
15 | >= dev-libs/gmp-5.0.1 |
16 | >= dev-libs/mpfr-3.0.0 |
17 | >= dev-libs/mpc-0.8.2 |
18 | >= dev-libs/ppl-0.10.2 |
19 | >= dev-libs/cloog-ppl-0.15.9 |
20 | >= virtual/kernel-headers" |
21 | |
22 | SPLIT_PACKAGES="libstdc++ gcc" |
23 | |
24 | SRCFILE="${PNAME}-${PVER}.tar.bz2" |
25 | SRCDIR="${BUILDDIR}/${PNAME}-${PVER}" |
26 | |
27 | # languages to build into gcc |
28 | MyLanguages=c,c++ |
29 | |
30 | sminclude mtools cleanutils libtool |
31 | |
32 | SRC_URI=( |
33 | gnu://${PNAME}/${PNAME}-${PVER}/${SRCFILE} |
34 | mirror://${PNAME}/${SRCFILE} |
35 | mirror://${PNAME}/${PNAME}-${PVER}-no-fixincludes.patch |
36 | ) |
37 | |
38 | UP2DATE="updatecmd \"http://ftp.gnu.org/gnu/${PNAME}/?C=M;O=A\" | sed -n 's/.*${PNAME}-\(.*\)\//\1/;$ p'" |
39 | |
40 | # gcc don't like strong CFLAGS |
41 | export CFLAGS="${CFLAGS//-O?} -O2" |
42 | export CXXFLAGS="${CFLAGS}" |
43 | |
44 | # check for crosscompile or export default CHOST |
45 | if [[ -z ${CCHOST} ]] |
46 | then |
47 | # no crosscompile defined |
48 | export CCHOST=${CHOST} |
49 | else |
50 | # use crosscompile host |
51 | export CCHOST=${CCHOST} |
52 | fi |
53 | |
54 | split_info_gcc() |
55 | { |
56 | DESCRIPTION="Modern C/C++ compiler written by the GNU people." |
57 | DEPEND="== sys-libs/libstdc++-${PVER} |
58 | >= sys-dev/binutils-2.20 |
59 | >= virtual/glibc |
60 | >= dev-libs/gmp-5.0.1 |
61 | >= dev-libs/mpfr-3.0.0 |
62 | >= dev-libs/mpc-0.8.2 |
63 | >= dev-libs/ppl-0.10.2 |
64 | >= dev-libs/cloog-ppl-0.15.9" |
65 | } |
66 | |
67 | split_info_libstdc++() |
68 | { |
69 | DESCRIPTION="Standard GNU C and C++ libraries." |
70 | DEPEND=">= sys-apps/base-files-0.1" |
71 | PCATEGORIE="sys-libs" |
72 | } |
73 | |
74 | src_prepare() |
75 | { |
76 | munpack ${SRCFILE} || die |
77 | cd ${SRCDIR} |
78 | |
79 | # generic fixes |
80 | mpatch ${PNAME}-${PVER}-no-fixincludes.patch || die |
81 | |
82 | # suppress installation of libiberty, as we will be |
83 | # using the one from binutils |
84 | sed -i 's/install_to_$(INSTALL_DEST) //' libiberty/Makefile.in || die |
85 | |
86 | install -d ${SRCDIR}/build || die |
87 | cd ${SRCDIR}/build |
88 | } |
89 | |
90 | src_compile() |
91 | { |
92 | cd ${SRCDIR}/build |
93 | |
94 | local myconf |
95 | |
96 | # you better off when not using distcc to compile |
97 | # your new compiler :) maybe not all are the same |
98 | export SMAGE_USE_DISTCC=false |
99 | |
100 | # Straight from the GCC install doc: |
101 | # "GCC has code to correctly determine the correct value for target |
102 | # for nearly all native systems. Therefore, we highly recommend you |
103 | # not provide a configure target when configuring a native compiler." |
104 | if [[ ${CHOST} != ${CCHOST} ]] |
105 | then |
106 | myconf+=" --target=${CCHOST}" |
107 | fi |
108 | |
109 | # gcc >= 4.3 has now configure flags for uri and version - yeah! |
110 | AR=ar \ |
111 | ../configure \ |
112 | --with-bugurl="http://bugs.magellan-linux.de/" \ |
113 | --with-pkgversion="Magellan-Linux" \ |
114 | --build=${CHOST} \ |
115 | --host=${CHOST} \ |
116 | --prefix=/usr \ |
117 | --mandir=/usr/share/man \ |
118 | --infodir=/usr/share/info \ |
119 | --libdir=/usr/$(mlibdir) \ |
120 | --libexecdir=/usr/$(mlibdir) \ |
121 | --enable-shared \ |
122 | --enable-threads=posix \ |
123 | --enable-__cxa_atexit \ |
124 | --enable-clocale=gnu \ |
125 | --disable-checking \ |
126 | --with-system-zlib \ |
127 | --enable-long-long \ |
128 | --enable-cstdio=stdio \ |
129 | --enable-languages=${MyLanguages} \ |
130 | --disable-libstdcxx-pch \ |
131 | ${myconf} \ |
132 | || die |
133 | |
134 | # parallel builds seems to break sometimes on x86_64 |
135 | local myopts |
136 | [[ ${ARCH} = x86_64 ]] && myopts=-j1 |
137 | |
138 | mmake ${myopts} bootstrap-lean || die |
139 | } |
140 | |
141 | src_install() |
142 | { |
143 | cd ${SRCDIR}/build |
144 | minstalldir /$(mlibdir) || die |
145 | |
146 | make DESTDIR=${BINDIR} install || die |
147 | |
148 | # versionize all bins and symlink them |
149 | for bin in $(find ${BINDIR}/usr/bin -type f) |
150 | do |
151 | echo ${bin} |
152 | mv ${bin} ${bin}-${PVER} || die |
153 | ln -snf $(basename ${bin}-${PVER}) ${bin} || die |
154 | done |
155 | |
156 | mlink ../usr/bin/cpp-${PVER} /$(mlibdir)/cpp || die |
157 | # this one is needed on multilib systems. |
158 | # rpcgen may not find the cpp compiler correctly if not in /lib/cpp |
159 | if [[ $(mlibdir) != lib ]] |
160 | then |
161 | minstalldir /lib || die |
162 | mlink ../usr/bin/cpp-${PVER} /lib/cpp || die |
163 | fi |
164 | mlink gcc-${PVER} /usr/bin/cc || die |
165 | |
166 | # deletes libstdc++ && libgcc_s |
167 | rm ${BINDIR}/usr/$(mlibdir)/{libgcc_s*.*,libstdc++*.*,libssp*.*,libgomp*.*} || die |
168 | if [[ $(mlibdir) != lib ]] && [[ -d ${BINDIR}/usr/lib ]] |
169 | then |
170 | rm ${BINDIR}/usr/lib/{libgcc_s*.*,libstdc++*.*,libssp*.*,libgomp*.*} || die |
171 | fi |
172 | |
173 | # fix all .la files |
174 | # the contain invalid libpathes and they are not needed |
175 | local la |
176 | for la in $(find ${BINDIR} -name \*.la) |
177 | do |
178 | fix_la_file ${la} || die ${la} |
179 | done |
180 | } |
181 | |
182 | src_install_gcc() |
183 | { |
184 | cd ${SRCDIR}/build |
185 | minstalldir /$(mlibdir) || die |
186 | |
187 | # install all targets |
188 | make DESTDIR=${BINDIR} install || die |
189 | |
190 | # versionize all bins and symlink them |
191 | for bin in $(find ${BINDIR}/usr/bin -type f) |
192 | do |
193 | echo ${bin} |
194 | mv ${bin} ${bin}-${PVER} || die |
195 | ln -snf $(basename ${bin}-${PVER}) ${bin} || die |
196 | done |
197 | |
198 | mlink ../usr/bin/cpp-${PVER} /$(mlibdir)/cpp || die |
199 | # this one is needed on multilib systems. |
200 | # rpcgen may not find the cpp compiler correctly if not in /lib/cpp |
201 | if [[ $(mlibdir) != lib ]] |
202 | then |
203 | minstalldir /lib || die |
204 | mlink ../usr/bin/cpp-${PVER} /lib/cpp || die |
205 | fi |
206 | mlink gcc-${PVER} /usr/bin/cc || die |
207 | |
208 | # deletes libstdc++ && libgcc_s && libssp && libgomp |
209 | rm ${BINDIR}/usr/$(mlibdir)/{libgcc_s*.*,libstdc++*.*,libssp*.*,libgomp*.*} || die |
210 | if [[ $(mlibdir) != lib ]] && [[ -d ${BINDIR}/usr/lib ]] |
211 | then |
212 | rm ${BINDIR}/usr/lib/{libgcc_s*.*,libstdc++*.*,libssp*.*,libgomp*.*} || die |
213 | fi |
214 | |
215 | # fix all .la files |
216 | # they may contain invalid libpathes which are not needed |
217 | local la |
218 | for la in $(find ${BINDIR} -name \*.la) |
219 | do |
220 | fix_la_file ${la} || die ${la} |
221 | done |
222 | } |
223 | |
224 | src_install_libstdc++() |
225 | { |
226 | cd ${SRCDIR}/build |
227 | minstalldir /$(mlibdir) || die |
228 | |
229 | local target |
230 | for target in libstdc++-v3 libgcc libssp libgomp |
231 | do |
232 | make DESTDIR=${BINDIR} install-target-${target} || die |
233 | done |
234 | |
235 | # cleanup, only keep the libs, everything else get provided by the gcc-package |
236 | zapmost ${BINDIR}/usr/$(mlibdir) libgcc_s*.* libstdc++*.* libssp*.* libgomp*.* || die |
237 | # multilib as well |
238 | if [[ $(mlibdir) != lib ]] && [[ -d ${BINDIR}/usr/lib ]] |
239 | then |
240 | zapmost ${BINDIR}/usr/lib libgcc_s*.* libstdc++*.* libssp*.* libgomp*.* || die |
241 | fi |
242 | |
243 | # clean up everything else |
244 | zapmost ${BINDIR} usr/$(mlibdir) $([[ $(mlibdir) != lib ]] && echo "usr/lib") || die |
245 | } |