/[gentoo-x86]/sys-devel/gcc/gcc-3.2.2.ebuild
Gentoo

Diff of /sys-devel/gcc/gcc-3.2.2.ebuild

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.12 Revision 1.18
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: /var/cvsroot/gentoo-x86/sys-devel/gcc/Attic/gcc-3.2.2.ebuild,v 1.12 2003/03/09 03:23:08 azarah Exp $ 3# $Header: /var/cvsroot/gentoo-x86/sys-devel/gcc/Attic/gcc-3.2.2.ebuild,v 1.18 2003/08/24 08:40:43 azarah Exp $
4 4
5IUSE="static nls bootstrap java build" 5IUSE="static nls bootstrap java build"
6 6
7inherit eutils flag-o-matic libtool 7inherit eutils flag-o-matic libtool
8 8
82 82
83DESCRIPTION="The GNU Compiler Collection. Includes C/C++ and java compilers" 83DESCRIPTION="The GNU Compiler Collection. Includes C/C++ and java compilers"
84HOMEPAGE="http://www.gnu.org/software/gcc/gcc.html" 84HOMEPAGE="http://www.gnu.org/software/gcc/gcc.html"
85 85
86LICENSE="GPL-2 LGPL-2.1" 86LICENSE="GPL-2 LGPL-2.1"
87KEYWORDS="x86 ~ppc ~sparc alpha hppa arm mips" 87KEYWORDS="x86 ~ppc sparc alpha hppa arm mips"
88 88
89# Ok, this is a hairy one again, but lets assume that we 89# Ok, this is a hairy one again, but lets assume that we
90# are not cross compiling, than we want SLOT to only contain 90# are not cross compiling, than we want SLOT to only contain
91# $PV, as people upgrading to new gcc layout will not have 91# $PV, as people upgrading to new gcc layout will not have
92# their old gcc unmerged ... 92# their old gcc unmerged ...
96else 96else
97 SLOT="${CCHOST}-${MY_PV}" 97 SLOT="${CCHOST}-${MY_PV}"
98fi 98fi
99 99
100DEPEND="virtual/glibc 100DEPEND="virtual/glibc
101 mips? >=sys-devel/binutils-2.13.90.0.16 : >=sys-devel/binutils-2.13.90.0.18 101 !hppa? ( mips? >=sys-devel/binutils-2.13.90.0.16 : >=sys-devel/binutils-2.13.90.0.18 )
102 hppa? ( >=sys-devel/binutils-2.13.90.0.16 )
102 >=sys-devel/gcc-config-1.3.1 103 >=sys-devel/gcc-config-1.3.1
103 !build? ( >=sys-libs/ncurses-5.2-r2 104 !build? ( >=sys-libs/ncurses-5.2-r2
104 nls? ( sys-devel/gettext ) )" 105 nls? ( sys-devel/gettext ) )"
105 106
106RDEPEND="virtual/glibc 107RDEPEND="virtual/glibc
115# Hack used to patch Makefiles to install into the build dir 116# Hack used to patch Makefiles to install into the build dir
116FAKE_ROOT="" 117FAKE_ROOT=""
117 118
118chk_gcc_version() { 119chk_gcc_version() {
119 # This next bit is for updating libtool linker scripts ... 120 # This next bit is for updating libtool linker scripts ...
120 OLD_GCC_VERSION="`gcc -dumpversion`" 121 local OLD_GCC_VERSION="`gcc -dumpversion`"
122 local OLD_GCC_CHOST="$(gcc -v 2>&1 | egrep '^Reading specs' |\
123 sed -e 's:^.*/gcc-lib/\([^/]*\)/[0-9]\+.*$:\1:')"
121 124
122 if [ "${OLD_GCC_VERSION}" != "${MY_PV_FULL}" ] 125 if [ "${OLD_GCC_VERSION}" != "${MY_PV_FULL}" ]
123 then 126 then
124 echo "${OLD_GCC_VERSION}" > ${WORKDIR}/.oldgccversion 127 echo "${OLD_GCC_VERSION}" > "${WORKDIR}/.oldgccversion"
128 fi
129
130 if [ -n "${OLD_GCC_CHOST}" ]
131 then
132 if [ "${CHOST}" = "${CCHOST}" -a "${OLD_GCC_CHOST}" != "${CHOST}" ]
133 then
134 echo "${OLD_GCC_CHOST}" > "${WORKDIR}/.oldgccchost"
135 fi
125 fi 136 fi
126 137
127 # Did we check the version ? 138 # Did we check the version ?
128 touch ${WORKDIR}/.chkgccversion 139 touch "${WORKDIR}/.chkgccversion"
129} 140}
130 141
131src_unpack() { 142src_unpack() {
132 if [ -z "${SNAPSHOT}" ] 143 if [ -z "${SNAPSHOT}" ]
133 then 144 then
285 296
286 # Setup -j in MAKEOPTS 297 # Setup -j in MAKEOPTS
287 get_number_of_jobs 298 get_number_of_jobs
288 299
289 einfo "Building GCC..." 300 einfo "Building GCC..."
290 if [ -z "`use static`" ] 301 # Only build it static if we are just building the C frontend, else
302 # a lot of things break because there are not libstdc++.so ....
303 if [ -n "`use static`" -a "${gcc_lang}" = "c" ]
291 then 304 then
292 # Fix for our libtool-portage.patch 305 # Fix for our libtool-portage.patch
293 S="${WORKDIR}/build" \ 306 S="${WORKDIR}/build" \
294 emake bootstrap-lean \ 307 emake LDFLAGS="-static" bootstrap \
295 LIBPATH="${LIBPATH}" \ 308 LIBPATH="${LIBPATH}" \
296 BOOT_CFLAGS="${CFLAGS}" STAGE1_CFLAGS="-O" || die 309 BOOT_CFLAGS="${CFLAGS}" STAGE1_CFLAGS="-O" || die
297 # Above FLAGS optimize and speedup build, thanks 310 # Above FLAGS optimize and speedup build, thanks
298 # to Jeff Garzik <jgarzik@mandrakesoft.com> 311 # to Jeff Garzik <jgarzik@mandrakesoft.com>
299 else 312 else
313 # Fix for our libtool-portage.patch
300 S="${WORKDIR}/build" \ 314 S="${WORKDIR}/build" \
301 emake LDFLAGS=-static bootstrap \ 315 emake bootstrap-lean \
302 LIBPATH="${LIBPATH}" \ 316 LIBPATH="${LIBPATH}" \
303 BOOT_CFLAGS="${CFLAGS}" STAGE1_CFLAGS="-O" || die 317 BOOT_CFLAGS="${CFLAGS}" STAGE1_CFLAGS="-O" || die
304 fi 318 fi
305} 319}
306 320
432 then 446 then
433 rm -f ${D}${LOC}/lib/libiberty.a 447 rm -f ${D}${LOC}/lib/libiberty.a
434 fi 448 fi
435 449
436 cd ${S} 450 cd ${S}
437 if [ -z "`use build`" ] 451 if [ -z "`use build`" ]
438 then 452 then
439 cd ${S} 453 cd ${S}
440 docinto /${CCHOST} 454 docinto /${CCHOST}
441 dodoc COPYING COPYING.LIB ChangeLog FAQ GNATS MAINTAINERS README 455 dodoc COPYING COPYING.LIB ChangeLog FAQ GNATS MAINTAINERS README
442 docinto ${CCHOST}/html 456 docinto ${CCHOST}/html
443 dohtml *.html 457 dohtml *.html
448 dohtml doc/*.html 462 dohtml doc/*.html
449 cd ${S}/gcc 463 cd ${S}/gcc
450 docinto ${CCHOST}/gcc 464 docinto ${CCHOST}/gcc
451 dodoc ChangeLog* FSFChangeLog* LANGUAGES NEWS ONEWS README* SERVICE 465 dodoc ChangeLog* FSFChangeLog* LANGUAGES NEWS ONEWS README* SERVICE
452 cd ${S}/libf2c 466 cd ${S}/libf2c
453 docinto ${CCHOST}/libf2c 467 docinto ${CCHOST}/libf2c
454 dodoc ChangeLog README TODO *.netlib 468 dodoc ChangeLog README TODO *.netlib
455 cd ${S}/libffi 469 cd ${S}/libffi
456 docinto ${CCHOST}/libffi 470 docinto ${CCHOST}/libffi
457 dodoc ChangeLog* LICENSE README 471 dodoc ChangeLog* LICENSE README
458 cd ${S}/libiberty 472 cd ${S}/libiberty
459 docinto ${CCHOST}/libiberty 473 docinto ${CCHOST}/libiberty
460 dodoc ChangeLog COPYING.LIB README 474 dodoc ChangeLog COPYING.LIB README
461 cd ${S}/libobjc 475 cd ${S}/libobjc
462 docinto ${CCHOST}/libobjc 476 docinto ${CCHOST}/libobjc
463 dodoc ChangeLog README* THREADS* 477 dodoc ChangeLog README* THREADS*
464 cd ${S}/libstdc++-v3 478 cd ${S}/libstdc++-v3
465 docinto ${CCHOST}/libstdc++-v3 479 docinto ${CCHOST}/libstdc++-v3
466 dodoc ChangeLog* README 480 dodoc ChangeLog* README
467 docinto ${CCHOST}/libstdc++-v3/html 481 docinto ${CCHOST}/libstdc++-v3/html
468 dohtml -r -a css,diff,html,txt,xml docs/html/* 482 dohtml -r -a css,diff,html,txt,xml docs/html/*
469 cp -f docs/html/17_intro/[A-Z]* \ 483 cp -f docs/html/17_intro/[A-Z]* \
470 ${D}/usr/share/doc/${PF}/${DOCDESTTREE}/17_intro/ 484 ${D}/usr/share/doc/${PF}/${DOCDESTTREE}/17_intro/
471 485
472 if [ -n "`use java`" ] 486 if [ -n "`use java`" ]
473 then 487 then
474 cd ${S}/fastjar 488 cd ${S}/fastjar
475 docinto ${CCHOST}/fastjar 489 docinto ${CCHOST}/fastjar
476 dodoc AUTHORS CHANGES COPYING ChangeLog NEWS README 490 dodoc AUTHORS CHANGES COPYING ChangeLog NEWS README
477 cd ${S}/libjava 491 cd ${S}/libjava
478 docinto ${CCHOST}/libjava 492 docinto ${CCHOST}/libjava
479 dodoc ChangeLog* COPYING HACKING LIBGCJ_LICENSE NEWS README THANKS 493 dodoc ChangeLog* COPYING HACKING LIBGCJ_LICENSE NEWS README THANKS
480 fi 494 fi
481 else 495 else
482 rm -rf ${D}/usr/share/{man,info} 496 rm -rf ${D}/usr/share/{man,info}
483 fi 497 fi
484 498
485 # Rather install the script, else portage with changing $FILESDIR 499 # Rather install the script, else portage with changing $FILESDIR
486 # between binary and source package borks things .... 500 # between binary and source package borks things ....
487 insinto /lib/rcscripts/awk 501 insinto /lib/rcscripts/awk
488 doins ${FILESDIR}/awk/fixlafiles.awk 502 doins ${FILESDIR}/awk/fixlafiles.awk
489 exeinto /sbin 503 exeinto /sbin
490 doexe ${FILESDIR}/fix_libtool_files.sh 504 doexe ${FILESDIR}/fix_libtool_files.sh
491 505
492 # Fix ncurses b0rking 506 # Fix ncurses b0rking
493 find ${D}/ -name '*curses.h' -exec rm -f {} \; 507 find ${D}/ -name '*curses.h' -exec rm -f {} \;
494} 508}
495 509
496pkg_preinst() { 510pkg_preinst() {
497 511
498 if [ ! -f "${WORKDIR}/.chkgccversion" ] 512 if [ ! -f "${WORKDIR}/.chkgccversion" ]
499 then 513 then
500 chk_gcc_version 514 chk_gcc_version
501 fi 515 fi
516
517 # Make again sure that the linker "should" be able to locate
518 # libstdc++.so ...
519 export LD_LIBRARY_PATH="${LIBPATH}:${LD_LIBRARY_PATH}"
520 ${ROOT}/sbin/ldconfig
502} 521}
503 522
504pkg_postinst() { 523pkg_postinst() {
505 524
506 export LD_LIBRARY_PATH="${LIBPATH}:${LD_LIBRARY_PATH}" 525 export LD_LIBRARY_PATH="${LIBPATH}:${LD_LIBRARY_PATH}"
509 then 528 then
510 gcc-config --use-portage-chost ${CCHOST}-${MY_PV_FULL} 529 gcc-config --use-portage-chost ${CCHOST}-${MY_PV_FULL}
511 fi 530 fi
512 531
513 # Update libtool linker scripts to reference new gcc version ... 532 # Update libtool linker scripts to reference new gcc version ...
514 if [ -f ${WORKDIR}/.oldgccversion -a "${ROOT}" = "/" ] 533 if [ "${ROOT}" = "/" ] && \
534 [ -f "${WORKDIR}/.oldgccversion" -o -f "${WORKDIR}/.oldgccchost" ]
515 then 535 then
536 local OLD_GCC_VERSION=
537 local OLD_GCC_CHOST=
538
539 if [ -f "${WORKDIR}/.oldgccversion" ] && \
540 [ -n "$(cat "${WORKDIR}/.oldgccversion")" ]
541 then
516 OLD_GCC_VERSION="`cat ${WORKDIR}/.oldgccversion`" 542 OLD_GCC_VERSION="$(cat "${WORKDIR}/.oldgccversion")"
543 else
544 OLD_GCC_VERSION="${MY_PV_FULL}"
545 fi
546
547 if [ -f "${WORKDIR}/.oldgccchost" ] && \
548 [ -n "$(cat "${WORKDIR}/.oldgccchost")" ]
549 then
550 OLD_GCC_CHOST="--oldarch $(cat "${WORKDIR}/.oldgccchost")"
551 fi
517 552
518 /sbin/fix_libtool_files.sh ${OLD_GCC_VERSION} 553 /sbin/fix_libtool_files.sh ${OLD_GCC_VERSION} ${OLD_GCC_CHOST}
519 fi 554 fi
520 555
521 # Fix ncurses b0rking (if r5 isn't unmerged) 556 # Fix ncurses b0rking (if r5 isn't unmerged)
522 find ${ROOT}/usr/lib/gcc-lib -name '*curses.h' -exec rm -f {} \; 557 find ${ROOT}/usr/lib/gcc-lib -name '*curses.h' -exec rm -f {} \;
523} 558}

Legend:
Removed from v.1.12  
changed lines
  Added in v.1.18

  ViewVC Help
Powered by ViewVC 1.1.20