Lines 4-14
Link Here
|
4 |
|
4 |
|
5 |
IUSE="static nls bootstrap java build" |
5 |
IUSE="static nls bootstrap java build" |
6 |
|
6 |
|
7 |
inherit eutils flag-o-matic libtool |
7 |
inherit eutils flag-o-matic libtool crosscompile |
8 |
|
8 |
|
9 |
# Compile problems with these (bug #6641 among others)... |
9 |
# Compile problems with these (bug #6641 among others)... |
10 |
filter-flags "-fno-exceptions -fomit-frame-pointer" |
10 |
filter-flags "-fno-exceptions -fomit-frame-pointer" |
11 |
|
11 |
|
|
|
12 |
# Having these set for the local machine will/can fail |
13 |
# during the build process because part of the build |
14 |
# is for the target machine. |
15 |
# Aiken 11/03/2003 |
16 |
if cross-target |
17 |
then |
18 |
filter-flags "-march -mcpu" |
19 |
fi |
20 |
|
12 |
# Recently there has been a lot of stability problem in Gentoo-land. Many |
21 |
# Recently there has been a lot of stability problem in Gentoo-land. Many |
13 |
# things can be the cause to this, but I believe that it is due to gcc3 |
22 |
# things can be the cause to this, but I believe that it is due to gcc3 |
14 |
# still having issues with optimizations, or with it not filtering bad |
23 |
# still having issues with optimizations, or with it not filtering bad |
Lines 85-108
Link Here
|
85 |
HOMEPAGE="http://www.gnu.org/software/gcc/gcc.html" |
94 |
HOMEPAGE="http://www.gnu.org/software/gcc/gcc.html" |
86 |
|
95 |
|
87 |
LICENSE="GPL-2 LGPL-2.1" |
96 |
LICENSE="GPL-2 LGPL-2.1" |
88 |
KEYWORDS="~x86 ~ppc ~sparc ~alpha ~hppa ~arm ~mips" |
97 |
KEYWORDS="x86 ~ppc ~sparc ~alpha ~hppa ~arm ~mips" |
|
|
98 |
|
99 |
# Removed the following because SLOT if done in |
100 |
# crosscompile eclass. |
101 |
# Aiken 11/03/2003 |
89 |
|
102 |
|
90 |
# Ok, this is a hairy one again, but lets assume that we |
103 |
# Ok, this is a hairy one again, but lets assume that we |
91 |
# are not cross compiling, than we want SLOT to only contain |
104 |
# are not cross compiling, than we want SLOT to only contain |
92 |
# $PV, as people upgrading to new gcc layout will not have |
105 |
# $PV, as people upgrading to new gcc layout will not have |
93 |
# their old gcc unmerged ... |
106 |
# their old gcc unmerged ... |
94 |
if [ "${CHOST}" == "${CCHOST}" ] |
107 |
#if [ "${CHOST}" == "${CCHOST}" ] |
|
|
108 |
#then |
109 |
# SLOT="${MY_PV}" |
110 |
#else |
111 |
# SLOT="${CCHOST}-${MY_PV}" |
112 |
#fi |
113 |
|
114 |
cross-check 3.2.2 |
115 |
|
116 |
# I am changing the DEPEND depending on whether we are doing a tool chain |
117 |
# or not. If I am building a cross compile too chain I DON'T want it |
118 |
# changing software versions of the host. I already have the host setup |
119 |
# how I want. By the time I get to here I also have the cross binutils I |
120 |
# want. |
121 |
# Aiken 12/03/2003 |
122 |
if ! cross-target |
95 |
then |
123 |
then |
96 |
SLOT="${MY_PV}" |
|
|
97 |
else |
98 |
SLOT="${CCHOST}-${MY_PV}" |
99 |
fi |
100 |
|
101 |
DEPEND="virtual/glibc |
124 |
DEPEND="virtual/glibc |
102 |
mips? >=sys-devel/binutils-2.13.90.0.16 : >=sys-devel/binutils-2.13.90.0.18 |
125 |
mips? >=sys-devel/binutils-2.13.90.0.16 : >=sys-devel/binutils-2.13.90.0.18 |
103 |
>=sys-devel/gcc-config-1.3.1 |
126 |
>=sys-devel/gcc-config-1.3.1 |
104 |
!build? ( >=sys-libs/ncurses-5.2-r2 |
127 |
!build? ( >=sys-libs/ncurses-5.2-r2 |
105 |
nls? ( sys-devel/gettext ) )" |
128 |
nls? ( sys-devel/gettext ) )" |
|
|
129 |
else |
130 |
DEPEND="" |
131 |
fi |
106 |
|
132 |
|
107 |
RDEPEND="virtual/glibc |
133 |
RDEPEND="virtual/glibc |
108 |
>=sys-devel/gcc-config-1.3.1 |
134 |
>=sys-devel/gcc-config-1.3.1 |
Lines 222-227
Link Here
|
222 |
|
248 |
|
223 |
rm -f ${x}.orig |
249 |
rm -f ${x}.orig |
224 |
done |
250 |
done |
|
|
251 |
|
252 |
# Apply patches only when creating a cross compiler and |
253 |
# only when building the 1st stage. |
254 |
# Aiken 12/03/2003 |
255 |
if cross-target && [ "`use build`" ] |
256 |
then |
257 |
cd ${S} |
258 |
patch -p0 < ${FILESDIR}/gcc-3.2-crossppc.diff || die |
259 |
patch -p0 < ${FILESDIR}/gcc-3.2.2-cross-x86.diff || die |
260 |
patch -p0 < ${FILESDIR}/gcc-3.2.2-cross-alpha.diff || die |
261 |
fi |
225 |
} |
262 |
} |
226 |
|
263 |
|
227 |
src_compile() { |
264 |
src_compile() { |
Lines 246-251
Link Here
|
246 |
gcc_lang="${gcc_lang},java" |
283 |
gcc_lang="${gcc_lang},java" |
247 |
fi |
284 |
fi |
248 |
|
285 |
|
|
|
286 |
# Aiken 11/03/2003 |
287 |
if cross-target && [ "`use build`" ] |
288 |
then |
289 |
# cross 1st stage |
290 |
myconf="${myconf} --disable-shared --disable-threads" |
291 |
else |
292 |
myconf="${myconf} --enable-shared --enable-threads=posix" |
293 |
fi |
294 |
|
295 |
# At the moment only do c and c++ for the cross tool chain |
296 |
# Aiken 12/03/2003 |
297 |
if cross-target && [ -z "`use build`" ] |
298 |
then |
299 |
gcc_lang="c,c++" |
300 |
fi |
301 |
|
302 |
echo gcc_lang = ${gcc_lang} |
303 |
echo myconf = ${myconf} |
304 |
echo CBUILD = ${CBUILD} |
305 |
echo CHOST = ${CHOST} |
306 |
echo CCHOST = ${CCHOST} |
307 |
echo CFLAGS = ${CFLAGS} |
308 |
echo CXXFLAGS = ${CXXFLAGS} |
309 |
# die |
310 |
|
249 |
# In general gcc does not like optimization, and add -O2 where |
311 |
# In general gcc does not like optimization, and add -O2 where |
250 |
# it is safe. |
312 |
# it is safe. |
251 |
export CFLAGS="${CFLAGS//-O?}" |
313 |
export CFLAGS="${CFLAGS//-O?}" |
Lines 263-274
Link Here
|
263 |
--datadir=${DATAPATH} \ |
325 |
--datadir=${DATAPATH} \ |
264 |
--mandir=${DATAPATH}/man \ |
326 |
--mandir=${DATAPATH}/man \ |
265 |
--infodir=${DATAPATH}/info \ |
327 |
--infodir=${DATAPATH}/info \ |
266 |
--enable-shared \ |
|
|
267 |
--host=${CHOST} \ |
328 |
--host=${CHOST} \ |
268 |
--target=${CCHOST} \ |
329 |
--target=${CCHOST} \ |
269 |
--with-system-zlib \ |
330 |
--with-system-zlib \ |
270 |
--enable-languages=${gcc_lang} \ |
331 |
--enable-languages=${gcc_lang} \ |
271 |
--enable-threads=posix \ |
|
|
272 |
--enable-long-long \ |
332 |
--enable-long-long \ |
273 |
--disable-checking \ |
333 |
--disable-checking \ |
274 |
--enable-cstdio=stdio \ |
334 |
--enable-cstdio=stdio \ |
Lines 293-298
Link Here
|
293 |
einfo "Building GCC..." |
353 |
einfo "Building GCC..." |
294 |
if [ -z "`use static`" ] |
354 |
if [ -z "`use static`" ] |
295 |
then |
355 |
then |
|
|
356 |
# Aiken 11/03/2003 |
357 |
if cross-target |
358 |
then |
359 |
make |
360 |
else |
361 |
|
296 |
# Fix for our libtool-portage.patch |
362 |
# Fix for our libtool-portage.patch |
297 |
S="${WORKDIR}/build" \ |
363 |
S="${WORKDIR}/build" \ |
298 |
emake bootstrap-lean \ |
364 |
emake bootstrap-lean \ |
Lines 300-305
Link Here
|
300 |
BOOT_CFLAGS="${CFLAGS}" STAGE1_CFLAGS="-O" || die |
366 |
BOOT_CFLAGS="${CFLAGS}" STAGE1_CFLAGS="-O" || die |
301 |
# Above FLAGS optimize and speedup build, thanks |
367 |
# Above FLAGS optimize and speedup build, thanks |
302 |
# to Jeff Garzik <jgarzik@mandrakesoft.com> |
368 |
# to Jeff Garzik <jgarzik@mandrakesoft.com> |
|
|
369 |
fi |
303 |
else |
370 |
else |
304 |
S="${WORKDIR}/build" \ |
371 |
S="${WORKDIR}/build" \ |
305 |
emake LDFLAGS=-static bootstrap \ |
372 |
emake LDFLAGS=-static bootstrap \ |
Lines 333-339
Link Here
|
333 |
FAKE_ROOT="${D}" \ |
400 |
FAKE_ROOT="${D}" \ |
334 |
install || die |
401 |
install || die |
335 |
|
402 |
|
336 |
[ -r ${D}${BINPATH}/gcc ] || die "gcc not found in ${D}" |
403 |
# Aiken 11/03/2003 |
|
|
404 |
if cross-target |
405 |
then |
406 |
[ -r ${D}${BINPATH}/${CCHOST}-gcc ] || die "${CCHOST}-gcc not found in ${D}" |
407 |
else |
408 |
[ -r ${D}${BINPATH}/gcc ] || die "gcc not found in ${D}" |
409 |
fi |
337 |
|
410 |
|
338 |
dodir /lib /usr/bin |
411 |
dodir /lib /usr/bin |
339 |
dodir /etc/env.d/gcc |
412 |
dodir /etc/env.d/gcc |
Lines 405-417
Link Here
|
405 |
[ -f ${D}${STDCXX_INCDIR}/cxxabi.h ] && \ |
478 |
[ -f ${D}${STDCXX_INCDIR}/cxxabi.h ] && \ |
406 |
mv -f ${D}${STDCXX_INCDIR}/cxxabi.h ${D}${LIBPATH}/include/ |
479 |
mv -f ${D}${STDCXX_INCDIR}/cxxabi.h ${D}${LIBPATH}/include/ |
407 |
|
480 |
|
408 |
# These should be symlinks |
481 |
# Aiken 14/03/2003 |
409 |
cd ${D}${BINPATH} |
482 |
if ! cross-target |
410 |
rm -f ${CCHOST}-{gcc,g++,c++,g77} |
483 |
then |
411 |
[ -f gcc ] && ln -sf gcc ${CCHOST}-gcc |
484 |
# These should be symlinks |
412 |
[ -f g++ ] && ln -sf g++ ${CCHOST}-g++ |
485 |
cd ${D}${BINPATH} |
413 |
[ -f g++ ] && ln -sf g++ ${CCHOST}-c++ |
486 |
rm -f ${CCHOST}-{gcc,g++,c++,g77} |
414 |
[ -f g77 ] && ln -sf g77 ${CCHOST}-g77 |
487 |
[ -f gcc ] && ln -sf gcc ${CCHOST}-gcc |
|
|
488 |
[ -f g++ ] && ln -sf g++ ${CCHOST}-g++ |
489 |
[ -f g++ ] && ln -sf g++ ${CCHOST}-c++ |
490 |
[ -f g77 ] && ln -sf g77 ${CCHOST}-g77 |
491 |
else |
492 |
# A cross compiler will be called ${CCHOST}-xxx |
493 |
# Create sym links so the short names also exist. |
494 |
# This allows gcc-config to change the compiler. |
495 |
cd ${D}${BINPATH} |
496 |
for x in ${CCHOST}* |
497 |
do |
498 |
NAME=`echo $x | awk -F '-' '{print $5}'` |
499 |
ln -sf $x $NAME |
500 |
done |
501 |
fi |
415 |
fi |
502 |
fi |
416 |
|
503 |
|
417 |
# This one comes with binutils |
504 |
# This one comes with binutils |
Lines 421-428
Link Here
|
421 |
fi |
508 |
fi |
422 |
|
509 |
|
423 |
cd ${S} |
510 |
cd ${S} |
424 |
if [ -z "`use build`" ] |
511 |
if [ -z "`use build`" ] |
425 |
then |
512 |
then |
426 |
cd ${S} |
513 |
cd ${S} |
427 |
docinto /${CCHOST} |
514 |
docinto /${CCHOST} |
428 |
dodoc COPYING COPYING.LIB ChangeLog FAQ GNATS MAINTAINERS README |
515 |
dodoc COPYING COPYING.LIB ChangeLog FAQ GNATS MAINTAINERS README |
Lines 469-483
Link Here
|
469 |
rm -rf ${D}/usr/share/{man,info} |
556 |
rm -rf ${D}/usr/share/{man,info} |
470 |
fi |
557 |
fi |
471 |
|
558 |
|
472 |
# Rather install the script, else portage with changing $FILESDIR |
559 |
# I don't think we need these when installing a cross compiler. |
473 |
# between binary and source package borks things .... |
560 |
# We are installing a new compiler not upgrading an existing one. |
474 |
insinto /lib/rcscripts/awk |
561 |
# They will still get installed if the system gcc is upgraded. |
475 |
doins ${FILESDIR}/awk/fixlafiles.awk |
562 |
# Aiken 11/03/2003 |
476 |
exeinto /sbin |
563 |
if ! cross-target |
477 |
doexe ${FILESDIR}/fix_libtool_files.sh |
564 |
then |
|
|
565 |
# Rather install the script, else portage with changing $FILESDIR |
566 |
# between binary and source package borks things .... |
567 |
insinto /lib/rcscripts/awk |
568 |
doins ${FILESDIR}/awk/fixlafiles.awk |
569 |
exeinto /sbin |
570 |
doexe ${FILESDIR}/fix_libtool_files.sh |
571 |
fi |
572 |
|
573 |
# Fix ncurses b0rking |
574 |
find ${D}/ -name '*curses.h' -exec rm -f {} \; |
575 |
|
576 |
if cross-target |
577 |
then |
578 |
# I like having a cross compiler available at any time. |
579 |
# Create sym links in /usr/bin so this happens. |
580 |
# |
581 |
# Aiken 11/03/2003 |
582 |
cd ${D} |
583 |
mkdir -p usr/bin |
584 |
cd usr/bin |
585 |
for x in ../${CCHOST}/gcc-bin/${MY_PV}/${CCHOST}* |
586 |
do |
587 |
ln -sf ${x} |
588 |
done |
589 |
fi |
478 |
|
590 |
|
479 |
# Fix ncurses b0rking |
591 |
# die "This is a debugging die." |
480 |
find ${D}/ -name '*curses.h' -exec rm -f {} \; |
|
|
481 |
} |
592 |
} |
482 |
|
593 |
|
483 |
pkg_preinst() { |
594 |
pkg_preinst() { |