Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 18034 | Differences between
and this patch

Collapse All | Expand All

(-)/usr/portage/sys-devel/gcc/gcc-3.2.2-r1.ebuild (-51 / +172 lines)
Lines 1-14 Link Here
1
# Copyright 1999-2003 Gentoo Technologies, Inc.
1
# Copyright 1999-2003 Gentoo Technologies, Inc.
2
# Distributed under the terms of the GNU General Public License v2
2
# Distributed under the terms of the GNU General Public License v2
3
# $Header: /home/cvsroot/gentoo-x86/sys-devel/gcc/gcc-3.2.2-r1.ebuild,v 1.6 2003/03/24 21:31:26 azarah Exp $
3
# $Header: /home/cvsroot/gentoo-x86/sys-devel/gcc/gcc-3.2.2-r1.ebuild,v 1.4 2003/03/09 03:23:08 azarah Exp $
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 ${MY_PV}
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
	if cross-build
303
	then
304
		gcc_lang="c,c++"
305
	fi
306
	
249
	# In general gcc does not like optimization, and add -O2 where
307
	# In general gcc does not like optimization, and add -O2 where
250
	# it is safe.
308
	# it is safe.
251
	export CFLAGS="${CFLAGS//-O?}"
309
	export CFLAGS="${CFLAGS//-O?}"
Lines 263-274 Link Here
263
		--datadir=${DATAPATH} \
321
		--datadir=${DATAPATH} \
264
		--mandir=${DATAPATH}/man \
322
		--mandir=${DATAPATH}/man \
265
		--infodir=${DATAPATH}/info \
323
		--infodir=${DATAPATH}/info \
266
		--enable-shared \
324
		--build=${CBUILD} \
267
		--host=${CHOST} \
325
		--host=${CHOST} \
268
		--target=${CCHOST} \
326
		--target=${CCHOST} \
269
		--with-system-zlib \
327
		--with-system-zlib \
270
		--enable-languages=${gcc_lang} \
328
		--enable-languages=${gcc_lang} \
271
		--enable-threads=posix \
272
		--enable-long-long \
329
		--enable-long-long \
273
		--disable-checking \
330
		--disable-checking \
274
		--enable-cstdio=stdio \
331
		--enable-cstdio=stdio \
Lines 291-311 Link Here
291
	get_number_of_jobs
348
	get_number_of_jobs
292
349
293
	einfo "Building GCC..."
350
	einfo "Building GCC..."
294
	# Only build it static if we are just building the C frontend, else
351
	if [ -z "`use static`" ]
295
	# a lot of things break because there are not libstdc++.so ....
296
	if [ -n "`use static`" -a "${gcc_lang}" = "c" ]
297
	then
352
	then
353
		# So far I have only been able to build a tool
354
		# chain or cross compile with a simple make.
355
		# The build fails with the bootstrap line below.
356
		# Aiken 11/03/2003
357
		if cross-target || cross-build
358
		then
359
			make
360
		else
361
298
		# Fix for our libtool-portage.patch
362
		# Fix for our libtool-portage.patch
299
		S="${WORKDIR}/build" \
363
		S="${WORKDIR}/build" \
300
		emake LDFLAGS="-static" bootstrap \
364
		emake bootstrap-lean \
301
			LIBPATH="${LIBPATH}" \
365
			LIBPATH="${LIBPATH}" \
302
			BOOT_CFLAGS="${CFLAGS}" STAGE1_CFLAGS="-O" || die
366
			BOOT_CFLAGS="${CFLAGS}" STAGE1_CFLAGS="-O" || die
303
		# Above FLAGS optimize and speedup build, thanks
367
		# Above FLAGS optimize and speedup build, thanks
304
		# to Jeff Garzik <jgarzik@mandrakesoft.com>
368
		# to Jeff Garzik <jgarzik@mandrakesoft.com>
369
		fi
305
	else
370
	else
306
		# Fix for our libtool-portage.patch
307
		S="${WORKDIR}/build" \
371
		S="${WORKDIR}/build" \
308
		emake bootstrap-lean \
372
		emake LDFLAGS=-static bootstrap \
309
			LIBPATH="${LIBPATH}" \
373
			LIBPATH="${LIBPATH}" \
310
			BOOT_CFLAGS="${CFLAGS}" STAGE1_CFLAGS="-O" || die
374
			BOOT_CFLAGS="${CFLAGS}" STAGE1_CFLAGS="-O" || die
311
	fi
375
	fi
Lines 334-342 Link Here
334
		infodir=${D}${DATAPATH}/info \
398
		infodir=${D}${DATAPATH}/info \
335
		LIBPATH="${LIBPATH}" \
399
		LIBPATH="${LIBPATH}" \
336
		FAKE_ROOT="${D}" \
400
		FAKE_ROOT="${D}" \
337
		install || die
401
		install || die "Install failed."
338
	
402
	
339
	[ -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
340
	
410
	
341
	dodir /lib /usr/bin
411
	dodir /lib /usr/bin
342
	dodir /etc/env.d/gcc
412
	dodir /etc/env.d/gcc
Lines 408-420 Link Here
408
		[ -f ${D}${STDCXX_INCDIR}/cxxabi.h ] && \
478
		[ -f ${D}${STDCXX_INCDIR}/cxxabi.h ] && \
409
			mv -f ${D}${STDCXX_INCDIR}/cxxabi.h ${D}${LIBPATH}/include/
479
			mv -f ${D}${STDCXX_INCDIR}/cxxabi.h ${D}${LIBPATH}/include/
410
480
411
		# These should be symlinks
481
		#  Aiken 14/03/2003
412
		cd ${D}${BINPATH}
482
		if ! cross-target
413
		rm -f ${CCHOST}-{gcc,g++,c++,g77}
483
		then
414
		[ -f gcc ] && ln -sf gcc ${CCHOST}-gcc
484
			# These should be symlinks
415
		[ -f g++ ] && ln -sf g++ ${CCHOST}-g++
485
			cd ${D}${BINPATH}
416
		[ -f g++ ] && ln -sf g++ ${CCHOST}-c++
486
			rm -f ${CCHOST}-{gcc,g++,c++,g77}
417
		[ -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
418
	fi
502
	fi
419
503
420
	# This one comes with binutils
504
	# This one comes with binutils
Lines 424-431 Link Here
424
	fi
508
	fi
425
509
426
	cd ${S}
510
	cd ${S}
427
    if [ -z "`use build`" ]
511
	if [ -z "`use build`" ]
428
    then
512
	then
429
		cd ${S}
513
		cd ${S}
430
		docinto /${CCHOST}
514
		docinto /${CCHOST}
431
		dodoc COPYING COPYING.LIB ChangeLog FAQ GNATS MAINTAINERS README
515
		dodoc COPYING COPYING.LIB ChangeLog FAQ GNATS MAINTAINERS README
Lines 440-456 Link Here
440
		docinto ${CCHOST}/gcc
524
		docinto ${CCHOST}/gcc
441
		dodoc ChangeLog* FSFChangeLog* LANGUAGES NEWS ONEWS README* SERVICE
525
		dodoc ChangeLog* FSFChangeLog* LANGUAGES NEWS ONEWS README* SERVICE
442
		cd ${S}/libf2c
526
		cd ${S}/libf2c
443
	    docinto ${CCHOST}/libf2c
527
		docinto ${CCHOST}/libf2c
444
	    dodoc ChangeLog README TODO *.netlib
528
		dodoc ChangeLog README TODO *.netlib
445
		cd ${S}/libffi
529
		cd ${S}/libffi
446
	    docinto ${CCHOST}/libffi
530
		docinto ${CCHOST}/libffi
447
	    dodoc ChangeLog* LICENSE README
531
		dodoc ChangeLog* LICENSE README
448
	    cd ${S}/libiberty
532
		cd ${S}/libiberty
449
	    docinto ${CCHOST}/libiberty
533
		docinto ${CCHOST}/libiberty
450
	    dodoc ChangeLog COPYING.LIB README
534
		dodoc ChangeLog COPYING.LIB README
451
	    cd ${S}/libobjc
535
		cd ${S}/libobjc
452
	    docinto ${CCHOST}/libobjc
536
		docinto ${CCHOST}/libobjc
453
	    dodoc ChangeLog README* THREADS*
537
		dodoc ChangeLog README* THREADS*
454
		cd ${S}/libstdc++-v3
538
		cd ${S}/libstdc++-v3
455
		docinto ${CCHOST}/libstdc++-v3
539
		docinto ${CCHOST}/libstdc++-v3
456
		dodoc ChangeLog* README
540
		dodoc ChangeLog* README
Lines 472-486 Link Here
472
        rm -rf ${D}/usr/share/{man,info}
556
        rm -rf ${D}/usr/share/{man,info}
473
	fi
557
	fi
474
558
475
	# Rather install the script, else portage with changing $FILESDIR
559
	# I don't think we need these when installing a cross compiler.
476
	# between binary and source package borks things ....
560
	# We are installing a new compiler not upgrading an existing one.
477
	insinto /lib/rcscripts/awk
561
	# They will still get installed if the system gcc is upgraded.
478
	doins ${FILESDIR}/awk/fixlafiles.awk
562
	#   Aiken 11/03/2003
479
	exeinto /sbin
563
	if ! cross-target
480
	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
481
589
482
    # Fix ncurses b0rking
590
		# This is a work around for the cross compiler not being
483
    find ${D}/ -name '*curses.h' -exec rm -f {} \;
591
		# able to find libgcc_s.* when compiling a package.
592
		# Creating sym links to a directory that the
593
		# $CCHOST-ld will search.
594
		# 06/04/2003
595
		if [ -z "`use build`" ]
596
		then
597
			cd ${D}
598
			# should already exist
599
			mkdir -p usr/${CCHOST}/lib
600
			cd usr/${CCHOST}/lib
601
			for x in ../../lib/gcc-lib/${CCHOST}/${PV}/lib*
602
			do
603
				echo ${x}
604
				ln -sf ${x}
605
			done
606
		fi
607
	fi
608
609
#	die "This is a debugging die."
484
}
610
}
485
611
486
pkg_preinst() {
612
pkg_preinst() {
Lines 489-499 Link Here
489
	then
615
	then
490
		chk_gcc_version
616
		chk_gcc_version
491
	fi
617
	fi
492
493
	# Make again sure that the linker "should" be able to locate
494
	# libstdc++.so ...
495
	export LD_LIBRARY_PATH="${LIBPATH}:${LD_LIBRARY_PATH}"
496
	${ROOT}/sbin/ldconfig
497
}
618
}
498
619
499
pkg_postinst() {
620
pkg_postinst() {

Return to bug 18034