--- glibc-2.26-r4.ebuild.orig 2017-12-21 22:01:26.000000000 +0100 +++ glibc-2.26-r4.ebuild 2017-12-29 23:47:36.000000000 +0100 @@ -109,6 +109,14 @@ # the phases # +noncross_eprefix() { + is_crosscompile || echo "${EPREFIX}" +} + +cross_eprefix() { + is_crosscompile && echo "${EPREFIX}" +} + pkg_pretend() { # Make sure devpts is mounted correctly for use w/out setuid pt_chown check_devpts @@ -236,6 +244,8 @@ einfo "Done." fi + epatch "${FILESDIR}"/${PN}-2.25-case-insensitive-fs.patch + if just_headers ; then if [[ -e ports/sysdeps/mips/preconfigure ]] ; then # mips peeps like to screw with us. if building headers, @@ -398,9 +408,9 @@ $(use_enable profile) $(use_with gd) --with-headers=$(alt_build_headers) - --prefix="${EPREFIX}/usr" - --sysconfdir="${EPREFIX}/etc" - --localstatedir="${EPREFIX}/var" + --prefix="$(noncross_eprefix)/usr" + --sysconfdir="$(noncross_eprefix)/etc" + --localstatedir="$(noncross_eprefix)/var" --libdir='$(prefix)'/$(get_libdir) --mandir='$(prefix)'/share/man --infodir='$(prefix)'/share/info @@ -422,8 +432,8 @@ # There is no configure option for this and we need to export it # since the glibc build will re-run configure on itself - export libc_cv_rootsbindir="${EPREFIX}/sbin" - export libc_cv_slibdir="${EPREFIX}/$(get_libdir)" + export libc_cv_rootsbindir="$(noncross_eprefix)/sbin" + export libc_cv_slibdir="$(noncross_eprefix)/$(get_libdir)" # We take care of patching our binutils to use both hash styles, # and many people like to force gnu hash style only, so disable @@ -469,6 +479,8 @@ mkdir -p "${builddir}" cd "${builddir}" + export CC="$(tc-getCC ${CTARGET})" + if ! $CC -v >/dev/null ; then # if we don't have a compiler yet, we can't really test it now ... # hopefully they don't affect header generation, so let's hope for # the best here ... @@ -504,6 +516,8 @@ einfo " ${v}" export ${v} done + export CC="$(tc-getBUILD_CC)" + fi # Blow away some random CC settings that screw things up. #550192 if [[ -d ${S}/sysdeps/mips ]]; then @@ -531,7 +545,7 @@ --build=${CBUILD_OPT:-${CBUILD}} --host=${CTARGET_OPT:-${CTARGET}} --with-headers=$(alt_build_headers) - --prefix="${EPREFIX}/usr" + --prefix="$(noncross_eprefix)/usr" ${EXTRA_ECONF} ) @@ -543,7 +557,6 @@ # So forcing CC/CFLAGS is sane. set -- "${S}"/configure "${myconf[@]}" echo "$@" - CC="$(tc-getBUILD_CC)" \ CFLAGS="-O1 -pipe" \ CPPFLAGS="-U_FORTIFY_SOURCE" \ LDFLAGS="" \ @@ -599,7 +612,7 @@ local builddir=$(builddir nptl) cd "${builddir}" - emake install_root="${D}$(alt_prefix)" install || die + emake install_root="${D}$(cross_eprefix)$(alt_prefix)" install || die # This version (2.26) provides some compatibility libraries for the NIS/NIS+ support # which come without headers etc. Only needed for binary packages since the @@ -762,7 +775,7 @@ glibc_headers_install() { local builddir=$(builddir "headers") cd "${builddir}" - emake install_root="${D}$(alt_prefix)" install-headers + emake install_root="${D}$(cross_eprefix)$(alt_prefix)" install-headers insinto $(alt_headers)/gnu doins "${S}"/include/gnu/stubs.h