Permalink
Browse files

FL-507: move refined gcc-4.6.4 to current/stable

  • Loading branch information...
1 parent 663b08f commit ee7dfa243fbcc4425df40c407b17c3603c009380 @angryvincent angryvincent committed Jul 11, 2013
@@ -7,6 +7,6 @@
# For next toolchain upgrade
>sys-libs/glibc-2.15-r4
>sys-kernel/linux-headers-3.4-r2
->sys-devel/gcc-4.6.3
+>sys-devel/gcc-4.6.4
>sys-devel/binutils-2.22-r1
@@ -1,8 +1,8 @@
DIST ecj-4.3.jar 1377431 SHA256 9de193ea393ed50d868b730bad6916f7a8ef4ba80216f8606d3e1a0dd886e74b
DIST ecj-4.5.jar 1470676 SHA256 98fd128f1d374d9e42fd9d4836bdd249c6d511ebc6c0df17fbc1b9df96c3d781 SHA512 d4e1bf7538ace56e3d69fa91da5bbd16c272923b4de0a9d8dee23ea2b75f9f38c603de72fc4061df49285c450b63f3df211cee5270e9fffc5447445d1a9c9e4e WHIRLPOOL db54206cfd5eba935e707b8d36ebac40f3c4ed3c1f06ede794288cbdd9c7da9d90c0898e8c98b383af276ea4c1b40c861ebd9e1fc1dce712946184321339d3ad
-DIST gcc-4.1.2-patches-1.3.tar.bz2 50790 SHA256 5fbb55d7f7cc136404d7c9375c3912acdcd49588b1d79f21e358efbc303665a3
-DIST gcc-4.1.2-uclibc-patches-1.0.tar.bz2 20980 SHA256 c6ed88711a727ed11847c9b9f1cef7023037bc80c0840eda5fca6d60fa02e35a
-DIST gcc-4.1.2.tar.bz2 39707720 SHA256 cfc0efbcc6fcde0d416a32dfb246c9df022515a312683fac412578c4fd09a9bc
+DIST gcc-4.1.2-patches-1.3.tar.bz2 50790 SHA256 5fbb55d7f7cc136404d7c9375c3912acdcd49588b1d79f21e358efbc303665a3 SHA512 6978eb1eb0ac02e0ca62bb1632b6745710abb746f5d8bb5b76699b7d7925fa1862a9a98db9feaf196635d18b98013d6be52d50aafff9963074e65500d8a405a9 WHIRLPOOL a43ed95267879fe3a836602da86dfbf8d3122a637f1e75daaa249d0ab3118243b5553de21deb412180801763609191de0a1a310c263a1c2a2454e47a7e0b33c2
+DIST gcc-4.1.2-uclibc-patches-1.0.tar.bz2 20980 SHA256 c6ed88711a727ed11847c9b9f1cef7023037bc80c0840eda5fca6d60fa02e35a SHA512 57789f4236a3085136afa83be3cef677bd813afd258d67bfdbecd2058f497cd459366d5515044c0208ab753946dc951dac6a3889752ca6dae836d837c22ce33b WHIRLPOOL 6a0eee923be11ad415eed56f4acc11480747aff92d97baf083526866d3c7eb63ca1fe51375fa70b9223f863a25e4487ebe9ce9da2acf1bbf6b55c6ad2d1a7010
+DIST gcc-4.1.2.tar.bz2 39707720 SHA256 cfc0efbcc6fcde0d416a32dfb246c9df022515a312683fac412578c4fd09a9bc SHA512 b97d3b72a3b0355611d5090b2c715b7a774f0e466a89326a0226c2809d12dfafb2d7c5a7af54bd5e00c135bbb6596f535e1a484740f7f1f691e8a57e6f0425cc WHIRLPOOL 5822040f7e96919bb906ce55e0bd19c4c85b3a47ce73f0a4b6d0da62ce9d7651b6cbeb6199dafc38582b206a98126e3efec8d54cc58c7f303ca708c9261bec57
DIST gcc-4.3.3-patches-1.2.tar.bz2 78206 SHA256 7bdd062b969fab934d4aff3f1e7cdd06d60d8bddd1ab25d2fe617e41df3aa51a
DIST gcc-4.3.3-piepatches-v10.1.5.tar.bz2 6036 SHA256 7e7a799f9066ab5948ea7ac73b0cb75c91bfa9231bf618bdc0e132e40d6d88d5
DIST gcc-4.3.3-specs-0.9.4.tar.bz2 1515 SHA256 1cfade221d3873e34bb4719297f0eb811e712d7f095a85dc9e2508e53ffe1cec
@@ -27,6 +27,7 @@ DIST gcc-4.6.3-patches-1.6.tar.bz2 17072 SHA256 9ea15c9e289de83954ee5c2ae374a7a5
DIST gcc-4.6.3-piepatches-v0.5.2.tar.bz2 15002 SHA256 6606d47a8bbaa9cba0dd3b022cbf6ed14325b8560dd17f7601dbaa4697df3691 SHA512 21ec5bcd43ec0075f8885ef6f567fd9ffd0a64f4c4f9340262900b91a8f22f73a22cd320d6c5a9211083a0a4d21f61ff42e4d9368b5768b395d6ec1b17fc47eb WHIRLPOOL f38666e7c47d9e10b96a22b85c90659800ecfa86d7cf9d5ff69385dc5584fc6ea4b90265ec62d8066adab63a647c1a4bd0f0d1cc69057fcc08c4aa6856cd5766
DIST gcc-4.6.3-uclibc-patches-1.0.tar.bz2 3023 SHA256 4219a3582c5f98bf8437bfc3feb8c264f8aabd8078caaddef46dd38be33f089f SHA512 e0763dc7f3f94cb9ba6e34233d1a2fa6913918a5100dd029ae76b3b086529b8fafae3086dc22f3294f7d378e5548294264cb2faa80866e8a1ecc666bf60fe010 WHIRLPOOL 1744810d5928b1869929ebd608e1d817e4bcb4f666647bc873e9bdb41c65833a40745e58de5ef4beb98ef4ac539c8560733100a3bbee280c76525ee518ae88c8
DIST gcc-4.6.3.tar.bz2 71999439 SHA256 e8f5853d4eec2f5ebaf8a72ae4d53c436aacf98153b2499f8635b48c4718a093 SHA512 efedecc1a6d1c36eb91cbecfae9a4414d01051e99965de8a284d1164df3cad13fa99a6dd5a4ceaa03ef63a66884eaf729b49d602ac82088f788bab045ce1eb26 WHIRLPOOL a50059cc5ec5bcf7c7d7108e38087c2168ff0c6817d06b709be901a87007f84cd231ebae0752cdc94fa99c93ecd30ba810d3213aba9f3639292b1e831818ec0c
+DIST gcc-4.6.4.tar.bz2 72006076 SHA256 35af16afa0b67af9b8eb15cafb76d2bc5f568540552522f5dc2c88dd45d977e8 SHA512 b5a5395782e0b9e61cda052f6e00c8575d1aa0b7e8db9e34c06e4e45f12ff37b436018536b7fa69a04a4235b5b368895652e3ed8fab2fe11763f9782ed9161dc WHIRLPOOL ab1b035f43aec669640b36037e65ae0edceb3b13b1ce4f7900aeff5ee06686dc2d66c3dd81156f53c4e9a9a806e4becd4462f72a6c4ad7e646b632c10c23356c
DIST gcc-4.7.2-patches-1.5.tar.bz2 40393 SHA256 31c9590aff8c41ca5f704b2b85bfd45e1c60796e3004f9ea7b4b0544cc4b876d SHA512 ca941b897ac480ff4e1d144a34a66cdbbb94d7178b2246dad9430599c903d2b30423db428884bf47f542632602aa0e0390cb5f75c7c1a812ea373dc0934194cd WHIRLPOOL 517f1f8f74fe334acab24ad6f68b50d16625b3aea7805b1bb3e8a1d255a8703dab07e4cd2031c7e0e181de4cd4a3d8c6ef4f5ed10264285d28fa9a68ba74f68f
DIST gcc-4.7.2-piepatches-v0.5.5.tar.bz2 15347 SHA256 ea7b7f7af30569f98b3cd37459b257e8bc96ef4691841779b28e93a96764a8c1 SHA512 1e3d20c38af31953b3a82c3f2204b9cc73a8bc9c80f3b3300106d1f1b6d299eb5ae5f67839fdcc690b4b8510d400053f431a1ef4850c9a4d2ca25db68daf35b6 WHIRLPOOL a22e77f63306fab350749b0778002e0cf610e300ef960631013aa545569385faa9ed1787fcdec5cf0dec89ed7dc4c9dc3d7dec28bbdb9665c0c957ba6dfa67de
DIST gcc-4.7.2-uclibc-patches-1.0.tar.bz2 3022 SHA256 507e2c9b7004122a6cf5409825f7c06da8fc63e1a77dc03f7a6ed2a7888a9311 SHA512 43018bef164fd1c4c2ab4e72f13d92044dfde65d6286046a761433d1a7bbc0ff1b4b0bcd770e07b6d4a17daf6dd974c9ec8f7a3e4d631f4af554b77bb1688206 WHIRLPOOL c08aed61480b1eab6b86356ecfff7fbb592820f6498f4fbed9161e859fa257aececd5e9ceb83495a8a0bb4c6f6f457f4c9125a079757324b84dc48e81cb2af14
@@ -36,3 +37,6 @@ DIST gcc-4.8.0-piepatches-v0.5.5.tar.bz2 14278 SHA256 644727a87c372c9e371b823a43
DIST gcc-4.8.0-uclibc-patches-1.0.tar.bz2 3010 SHA256 0300927d938d5d0baccf7cc63d6be71dbb73a5c9d1efaf9f06bace87d7267dcd SHA512 25b82b0860c14b876920a18257b6348161b768e9583eabb5179ed3a3d924bb74fef615ad458beff6c89bc4d0cf723bbd9702cd8bca9e73b60adc82c196def382 WHIRLPOOL 5ae9e33dc382c7d1816d92d0a6b55191f922dec9f023bab0bcb51cbb0ce267c27874670ddc484144c122a204319b55a7dbe0f10c6a13e6390c4015f134d8b712
DIST gcc-4.8.0.tar.bz2 86663646 SHA256 b037fe5132b71ecad2ea7141ec92292b5d32427bf90fd90cde432b1d5abacc2c SHA512 8a59f1a67e557eb719961a217bdb6a05b4b3abfc792f4bddee536c46fc3cc8472126e0f7531fa473acfce525a59bbd581ade97d068caf7308dfb2296f8861826 WHIRLPOOL ad966de5e75c817ea4aec9076a16198e91108e1e67c413bda839235692cbd1626e85a5e76206b8889884790d4d282650662a3e0b024893a3422bf0bfc04b46a2
DIST gdc-0.24-src.tar.bz2 1012099 SHA256 cc6a97c76c9e6db31e76ff97014d24b3d43e21f018a3c6218e3fb2a4500fc79a
+DIST gmp-5.1.1.tar.xz 1812988 SHA256 4bd64d782fdeb61aeed45b434fca5246d66baa9de76f87cba30c38460d8834c2 SHA512 4cc3307411eb2144e87b791ee2f52e0020711638f911dfa3cc5929a57eda5ac7d9ca10c1c0bb75c96afc7ff7a9c6ad165bc87409b036c562867b4e5da15ba571 WHIRLPOOL 8a7afe06d530a15edb75a0c37c8497d1ab209dfeffebd44aecfcfe6b75586c182384cfdf8ea9b696ce968aed04944ec7c1c271730b65c34b2e3504d26565240e
+DIST mpc-1.0.1.tar.gz 624125 SHA256 ed5a815cfea525dc778df0cb37468b9c1b554aaf30d9328b1431ca705b7400ff SHA512 fa381e75999bba626ba08d73225285b03c6d2f6cca87881b28829925d1624eaed1c9b544f75e7281cf5d8dcdd7831025a4eafc05f88f13375f9e08239a8a9303 WHIRLPOOL ddc857d361b10c7702e2a6bfec3ecb8538f80ae22a41097caaad6f767f035e2a4af2317fe9685a93c6f3d9bcdb0982db042eeb073f7b0e71a72500a5ef07630c
+DIST mpfr-3.1.2.tar.xz 1074388 SHA256 399d0f47ef6608cc01d29ed1b99c7faff36d9994c45f36f41ba250147100453b SHA512 8d594206afb2637ed39ad564d42c8c4d02b042b95925f5c6ec891e5cb87f7155195559c7ff477256a088ecaaa3c2b0d35a9d11a74ed526a1080d49b2950e5587 WHIRLPOOL 1e391888d9cecc71617e99eb841cafac536e703b12d46a53fdcf773cc2654c98ca6bde2358f997c8b7bfd832bdb0c395b224df8a460a8fb5b4ad6f2c2e092b17
@@ -0,0 +1,21 @@
+diff -urN gcc-4.6.4/libgcc/Makefile.in gcc-4.6.4-fixed/libgcc/Makefile.in
+--- gcc-4.6.4/libgcc/Makefile.in 2013-04-24 00:12:29.213242770 +0000
++++ gcc-4.6.4-fixed/libgcc/Makefile.in 2013-04-24 01:19:14.909313041 +0000
+@@ -945,7 +945,7 @@
+
+ $(subst @multilib_dir@,$(MULTIDIR),$(subst \
+ @shlib_base_name@,libunwind,$(subst \
+- @shlib_slibdir_qual@,$(MULTIOSSUBDIR),$(SHLIBUNWIND_INSTALL))))
++ @shlib_slibdir_qual@,$(MULTISUBDIR),$(SHLIBUNWIND_INSTALL))))
+
+ install-shared:
+ $(mkinstalldirs) $(DESTDIR)$(inst_libdir)
+@@ -956,7 +956,7 @@
+
+ $(subst @multilib_dir@,$(MULTIDIR),$(subst \
+ @shlib_base_name@,libgcc_s,$(subst \
+- @shlib_slibdir_qual@,$(MULTIOSSUBDIR),$(SHLIB_INSTALL))))
++ @shlib_slibdir_qual@,$(MULTISUBDIR),$(SHLIB_INSTALL))))
+
+ install-leaf: $(install-shared) $(install-libunwind)
+ $(mkinstalldirs) $(DESTDIR)$(inst_libdir)
@@ -0,0 +1,322 @@
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+inherit multilib
+
+# Ebuild notes:
+#
+# This is a simplified Funtoo gcc ebuild. It has been designed to have a reduced dependency
+# footprint, so that libgmp, mpfr and mpc are built as part of the gcc build process and
+# are not external dependencies. This makes upgrading these dependencies easier and
+# improves upgradability of Funtoo Linux systems, and solves various thorny build issues.
+#
+# Also, this gcc ebuild no longer uses toolchain.eclass which improves the maintainability
+# of the ebuild itself as it is less complex.
+#
+# -- Daniel Robbins, Apr 19, 2013.
+
+# Note: multi-stage bootstrapping is currently not being performed.
+
+RESTRICT="strip"
+FEATURES=${FEATURES/multilib-strict/}
+
+IUSE="ada cxx fortran f77 f95 objc objc++ openmp" # languages
+IUSE="$IUSE multislot nls nptl vanilla doc multilib altivec libssp" # other stuff
+
+# USE Notes:
+#
+# x86/amd64 architecture support only (for now).
+# mudflap is enabled by default.
+# lto is disabled by default.
+# test is not currently supported.
+# objc-gc is enabled by default when objc is enabled.
+# gcj is not currently supported by this ebuild.
+# hardened is not currently supported by this ebuild.
+# graphite is not currently supported by this ebuild.
+# multislot is a good USE flag to set when testing this ebuild.
+# It allows this gcc to co-exist along identical x.y versions.
+
+if use multislot; then
+ SLOT="${PV}"
+else
+ SLOT="${PV%.*}"
+fi
+
+PATCH_VER="1.6"
+GMP_VER="5.1.1"
+MPFR_VER="3.1.2"
+MPC_VER="1.0.1"
+GCC_A="gcc-${PV}.tar.bz2"
+
+SRC_URI="mirror://gnu/gcc/gcc-${PV}/${GCC_A}"
+SRC_URI="$SRC_URI http://www.multiprecision.org/mpc/download/mpc-${MPC_VER}.tar.gz"
+SRC_URI="$SRC_URI http://www.mpfr.org/mpfr-${MPFR_VER}/mpfr-${MPFR_VER}.tar.xz"
+SRC_URI="$SRC_URI mirror://gnu/gmp/gmp-${GMP_VER}.tar.xz"
+
+DESCRIPTION="The GNU Compiler Collection"
+
+LICENSE="GPL-3 LGPL-3 || ( GPL-3 libgcc libstdc++ gcc-runtime-library-exception-3.1 ) FDL-1.2"
+KEYWORDS="*"
+
+RDEPEND="sys-libs/zlib nls? ( sys-devel/gettext ) virtual/libiconv"
+DEPEND="${RDEPEND} >=sys-devel/bison-1.875 >=sys-devel/flex-2.5.4 elibc_glibc? ( >=sys-libs/glibc-2.8 ) >=sys-devel/binutils-2.18"
+PDEPEND=">=sys-devel/gcc-config-1.5 elibc_glibc? ( >=sys-libs/glibc-2.8 )"
+
+pkg_setup() {
+ unset GCC_SPECS # we don't want to use the installed compiler's specs to build gcc!
+ unset LANGUAGES #265283
+ PREFIX=/usr
+ CTARGET=$CHOST
+ GCC_BRANCH_VER=${SLOT}
+ GCC_CONFIG_VER=${PV}
+ DATAPATH=${PREFIX}/share/gcc-data/${CTARGET}/${GCC_CONFIG_VER}
+ BINPATH=${PREFIX}/${CTARGET}/gcc-bin/${GCC_CONFIG_VER}
+ LIBPATH=${PREFIX}/lib/gcc/${CTARGET}/${GCC_CONFIG_VER}
+ STDCXX_INCDIR=${LIBPATH}/include/g++-v${GCC_BRANCH_VER}
+}
+
+src_unpack() {
+ unpack $GCC_A
+ ( unpack mpc-${MPC_VER}.tar.gz && mv ${WORKDIR}/mpc-${MPC_VER} ${S}/mpc ) || die "mpc setup fail"
+ ( unpack mpfr-${MPFR_VER}.tar.xz && mv ${WORKDIR}/mpfr-${MPFR_VER} ${S}/mpfr ) || die "mpfr setup fail"
+ ( unpack gmp-${GMP_VER}.tar.xz && mv ${WORKDIR}/gmp-${GMP_VER} ${S}/gmp ) || die "gmp setup fail"
+ cd $S
+
+ mkdir ${WORKDIR}/objdir
+}
+
+src_prepare() {
+ # For some reason, when upgrading gcc, the gcc Makefile will install stuff
+ # like crtbegin.o into a subdirectory based on the name of the currently-installed
+ # gcc version, rather than *our* gcc version. Manually fix this:
+
+ sed -i -e "s/^version :=.*/version := ${GCC_CONFIG_VER}/" ${S}/libgcc/Makefile.in || die
+
+ # The following patch allows pie/ssp specs to be changed via environment
+ # variable, which is needed for gcc-config to allow switching of compilers:
+
+ [[ ${CHOST} == ${CTARGET} ]] && cat "${FILESDIR}"/gcc-spec-env.patch | patch -p1 || die "patch fail"
+
+ # We use --enable-version-specific-libs with ./configure. This
+ # option is designed to place all our libraries into a sub-directory
+ # rather than /usr/lib*. However, this option, even through 4.8.0,
+ # does not work 100% correctly without a small fix for
+ # libgcc_s.so. See: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32415.
+ # So, we apply a small patch to get this working:
+
+ cat "${FILESDIR}"/gcc-4.6.4-fix-libgcc-s-path-with-vsrl.patch | patch -p1 || die "patch fail"
+}
+
+src_configure() {
+ # Determine language support:
+ local confgcc
+ local GCC_LANG="c"
+ use cxx && GCC_LANG+=",c++" && confgcc+=" --enable-libstdcxx-time"
+ if use objc; then
+ GCC_LANG+=",objc"
+ confgcc+=" --enable-objc-gc"
+ use objcxx && GCC_LANG+=",obj-c++"
+ fi
+ use fortran && GCC_LANG+=",fortran" || confgcc+=" --disable-libquadmath"
+ use f77 && GCC_LANG+=",f77"
+ use f95 && GCC_LANG+=",f95"
+ use ada && GCC_LANG+=",ada"
+ confgcc+=" $(use_enable openmp libgomp)"
+ confgcc+=" --enable-languages=${GCC_LANG} --disable-libgcj"
+
+ use libssp || export gcc_cv_libc_provides_ssp=yes
+
+ cd ${WORKDIR}/objdir && ../gcc-${PV}/configure \
+ $(use_enable libssp) \
+ $(use_enable multilib) \
+ --enable-version-specific-runtime-libs \
+ --enable-libmudflap \
+ --prefix=${PREFIX} \
+ --bindir=${BINPATH} \
+ --includedir=${LIBPATH}/include \
+ --datadir=${DATAPATH} \
+ --mandir=${DATAPATH}/man \
+ --infodir=${DATAPATH}/info \
+ --with-gxx-include-dir=${STDCXX_INCDIR} \
+ --host=$CHOST \
+ --target=$CTARGET \
+ --disable-ppl \
+ --disable-cloog \
+ --with-system-zlib \
+ --enable-obsolete \
+ --disable-werror \
+ --enable-secureplt \
+ --disable-lto \
+ --with-bugurl=http://bugs.funtoo.org \
+ --with-pkgversion="Funtoo ${PVR}" \
+ --with-mpfr-include=${S}/mpfr/src \
+ --with-mpfr-lib=${WORKDIR}/objdir/mpfr/src/.libs \
+ $confgcc \
+ || die "configure fail"
+
+ # The --with-mpfr* lines above are used so that gcc-4.6.4 can find mpfr-3.1.2.
+ # It can find 2.4.2 with no problem automatically but needs help with newer versions
+ # due to mpfr dir structure changes. We look for includes in the source directory,
+ # and libraries in the build (objdir) directory.
+}
+
+src_compile() {
+ cd $WORKDIR/objdir
+ unset ABI
+ emake LIBPATH="${LIBPATH}" || die "compile fail"
+}
+
+create_gcc_env_entry() {
+ dodir /etc/env.d/gcc
+ local gcc_envd_base="/etc/env.d/gcc/${CTARGET}-${GCC_CONFIG_VER}"
+ local gcc_envd_file="${D}${gcc_envd_base}"
+ cat <<-EOF > ${gcc_envd_file}
+ GCC_PATH="${BINPATH}"
+ LDPATH="${LIBPATH}:${LIBPATH}/32"
+ MANPATH="${DATAPATH}/man"
+ INFOPATH="${DATAPATH}/info"
+ STDCXX_INCDIR="${STDCXX_INCDIR##*/}"
+ EOF
+}
+
+linkify_compiler_binaries() {
+ dodir /usr/bin
+ cd "${D}"${BINPATH}
+ # Ugh: we really need to auto-detect this list.
+ # It's constantly out of date.
+ for x in cpp gcc g++ c++ gcov g77 gcj gcjh gfortran gccgo ; do
+ # For some reason, g77 gets made instead of ${CTARGET}-g77...
+ # this should take care of that
+ [[ -f ${x} ]] && mv ${x} ${CTARGET}-${x}
+
+ if [[ -f ${CTARGET}-${x} ]] ; then
+ ln -sf ${CTARGET}-${x} ${x}
+ dosym ${BINPATH}/${CTARGET}-${x} /usr/bin/${x}-${GCC_CONFIG_VER}
+ # Create version-ed symlinks
+ dosym ${BINPATH}/${CTARGET}-${x} /usr/bin/${CTARGET}-${x}-${GCC_CONFIG_VER}
+ fi
+
+ if [[ -f ${CTARGET}-${x}-${GCC_CONFIG_VER} ]] ; then
+ rm -f ${CTARGET}-${x}-${GCC_CONFIG_VER}
+ ln -sf ${CTARGET}-${x} ${CTARGET}-${x}-${GCC_CONFIG_VER}
+ fi
+ done
+}
+
+tasteful_stripping() {
+ # Now do the fun stripping stuff
+ env RESTRICT="" CHOST=${CHOST} prepstrip "${D}${BINPATH}"
+ env RESTRICT="" CHOST=${CTARGET} prepstrip "${D}${LIBPATH}"
+ # gcc used to install helper binaries in lib/ but then moved to libexec/
+ [[ -d ${D}${PREFIX}/libexec/gcc ]] && \
+ env RESTRICT="" CHOST=${CHOST} prepstrip "${D}${PREFIX}/libexec/gcc/${CTARGET}/${GCC_CONFIG_VER}"
+}
+
+doc_cleanups() {
+ local cxx_mandir=$(find "${WORKDIR}/objdir/${CTARGET}/libstdc++-v3" -name man)
+ if [[ -d ${cxx_mandir} ]] ; then
+ # clean bogus manpages #113902
+ find "${cxx_mandir}" -name '*_build_*' -exec rm {} \;
+ cp -r "${cxx_mandir}"/man? "${D}/${DATAPATH}"/man/
+ fi
+ has noinfo ${FEATURES} \
+ && rm -r "${D}/${DATAPATH}"/info \
+ || prepinfo "${DATAPATH}"
+ has noman ${FEATURES} \
+ && rm -r "${D}/${DATAPATH}"/man \
+ || prepman "${DATAPATH}"
+}
+
+src_install() {
+ S=$WORKDIR/objdir; cd $S
+
+# PRE-MAKE INSTALL SECTION:
+
+ # from toolchain eclass:
+ # Do allow symlinks in private gcc include dir as this can break the build
+ find gcc/include*/ -type l -delete
+
+ # Remove generated headers, as they can cause things to break
+ # (ncurses, openssl, etc).
+ while read x; do
+ grep -q 'It has been auto-edited by fixincludes from' "${x}" \
+ && echo "Removing auto-generated header: $x" \
+ && rm -f "${x}"
+ done < <(find gcc/include*/ -name '*.h')
+
+# MAKE INSTALL SECTION:
+
+ make -j1 DESTDIR="${D}" install || die
+
+# POST MAKE INSTALL SECTION:
+
+ # Basic sanity check
+ local EXEEXT
+ eval $(grep ^EXEEXT= "${WORKDIR}"/objdir/gcc/config.log)
+ [[ -r ${D}${BINPATH}/gcc${EXEEXT} ]] || die "gcc not found in ${D}"
+
+# GENTOO ENV SETUP
+
+ dodir /etc/env.d/gcc
+ create_gcc_env_entry
+
+# CLEANUPS:
+
+ # Punt some tools which are really only useful while building gcc
+ find "${D}" -name install-tools -prune -type d -exec rm -rf "{}" \;
+ # This one comes with binutils
+ find "${D}" -name libiberty.a -delete
+ # prune empty dirs left behind
+ find "${D}" -depth -type d -delete 2>/dev/null
+ # ownership fix:
+ chown -R root:0 "${D}"${LIBPATH} 2>/dev/null
+ find "${D}/${LIBPATH}" -name libstdc++.la -type f -exec rm "{}" \;
+ find "${D}/${LIBPATH}" -name "*.py" -type f -exec rm "{}" \;
+
+ linkify_compiler_binaries
+ tasteful_stripping
+ doc_cleanups
+ exeinto "${DATAPATH}"
+ doexe "${FILESDIR}"/c{89,99} || die
+
+ # Don't scan .gox files for executable stacks - false positives
+ export QA_EXECSTACK="usr/lib*/go/*/*.gox"
+ export QA_WX_LOAD="usr/lib*/go/*/*.gox"
+}
+
+pkg_postinst() {
+
+ # Here, we will auto-enable the new compiler if none is currently enabled, or
+ # if this is an _._.x upgrade to an already-installed compiler.
+
+ # One exception is if multislot is enabled in USE, which allows ie. 4.6.9
+ # and 4.6.10 to exist alongside one another. In this case, the user must
+ # enable this compiler manually.
+
+ local do_config="yes"
+ curr_gcc_config=$(env -i ROOT="${ROOT}" gcc-config -c ${CTARGET} 2>/dev/null)
+ if [ -n "$curr_gcc_config" ]; then
+ CURR_GCC_CONFIG_VER=$(gcc-config -S ${curr_gcc_config} | awk '{print $2}')
+ if [ "${CURR_GCC_CONFIG_VER%%.*}" != "${GCC_CONFIG_VER%%.*}" ]; then
+ # major versions don't match, don't run gcc-config
+ do_config="no"
+ fi
+ use multislot && do_config="no"
+ fi
+ if [ "$do_config" == "yes" ]; then
+ gcc-config ${CTARGET}-${GCC_CONFIG_VER}
+ else
+ einfo "This does not appear to be a regular upgrade of gcc, so"
+ einfo "gcc ${GCC_CONFIG_VER} will not be automatically enabled as the"
+ einfo "default system compiler."
+ echo
+ einfo "If you would like to make ${GCC_CONFIG_VER} the default system"
+ einfo "compiler, then perform the following steps as root:"
+ echo
+ einfo "gcc-config ${CTARGET}-${GCC_CONFIG_VER}"
+ einfo "source /etc/profile"
+ echo
+ ebeep
+ fi
+}

0 comments on commit ee7dfa2

Please sign in to comment.