summaryrefslogtreecommitdiff
path: root/sys-libs/glibc/glibc-2.29-r2.ebuild
diff options
context:
space:
mode:
Diffstat (limited to 'sys-libs/glibc/glibc-2.29-r2.ebuild')
-rw-r--r--sys-libs/glibc/glibc-2.29-r2.ebuild36
1 files changed, 24 insertions, 12 deletions
diff --git a/sys-libs/glibc/glibc-2.29-r2.ebuild b/sys-libs/glibc/glibc-2.29-r2.ebuild
index ad6fed1c1662..a9ed33739e85 100644
--- a/sys-libs/glibc/glibc-2.29-r2.ebuild
+++ b/sys-libs/glibc/glibc-2.29-r2.ebuild
@@ -20,7 +20,7 @@ if [[ ${PV} == 9999* ]]; then
EGIT_REPO_URI="https://sourceware.org/git/glibc.git"
inherit git-r3
else
- KEYWORDS="alpha amd64 arm arm64 ~hppa ia64 ~m68k ~mips ppc ppc64 ~riscv ~s390 ~sh ~sparc x86"
+ KEYWORDS="alpha amd64 arm arm64 ~hppa ia64 m68k ~mips ppc ppc64 ~riscv s390 sh ~sparc x86"
SRC_URI="mirror://gnu/glibc/${P}.tar.xz"
fi
@@ -125,6 +125,18 @@ alt_prefix() {
is_crosscompile && echo /usr/${CTARGET}
}
+# This prefix is applicable to CHOST when building against this
+# glibc. It is baked into the library at configure time.
+host_eprefix() {
+ is_crosscompile || echo "${EPREFIX}"
+}
+
+# This prefix is applicable to CBUILD when building against this
+# glibc. It determines the destination path at install time.
+build_eprefix() {
+ is_crosscompile && echo "${EPREFIX}"
+}
+
# We need to be able to set alternative headers for compiling for non-native
# platform. Will also become useful for testing kernel-headers without screwing
# up the whole system.
@@ -134,7 +146,7 @@ alt_headers() {
alt_build_headers() {
if [[ -z ${ALT_BUILD_HEADERS} ]] ; then
- ALT_BUILD_HEADERS="${EPREFIX}$(alt_headers)"
+ ALT_BUILD_HEADERS="$(host_eprefix)$(alt_headers)"
if tc-is-cross-compiler ; then
ALT_BUILD_HEADERS=${SYSROOT}$(alt_headers)
if [[ ! -e ${ALT_BUILD_HEADERS}/linux/version.h ]] ; then
@@ -578,7 +590,7 @@ eend_KV() {
get_kheader_version() {
printf '#include <linux/version.h>\nLINUX_VERSION_CODE\n' | \
- $(tc-getCPP ${CTARGET}) -I "${EPREFIX}/$(alt_build_headers)" - | \
+ $(tc-getCPP ${CTARGET}) -I "$(build_eprefix)$(alt_build_headers)" - | \
tail -n 1
}
@@ -602,7 +614,7 @@ sanity_prechecks() {
if has_version ">${CATEGORY}/${P}-r10000" ; then
eerror "Sanity check to keep you from breaking your system:"
eerror " Downgrading glibc is not supported and a sure way to destruction."
- die "Aborting to save your system."
+ [[ ${I_ALLOW_TO_BREAK_MY_SYSTEM} = yes ]] || die "Aborting to save your system."
fi
if ! do_run_test '#include <unistd.h>\n#include <sys/syscall.h>\nint main(){return syscall(1000)!=-1;}\n' ; then
@@ -892,9 +904,9 @@ glibc_do_configure() {
$(use_enable profile)
$(use_with gd)
--with-headers=$(alt_build_headers)
- --prefix="${EPREFIX}/usr"
- --sysconfdir="${EPREFIX}/etc"
- --localstatedir="${EPREFIX}/var"
+ --prefix="$(host_eprefix)/usr"
+ --sysconfdir="$(host_eprefix)/etc"
+ --localstatedir="$(host_eprefix)/var"
--libdir='$(prefix)'/$(get_libdir)
--mandir='$(prefix)'/share/man
--infodir='$(prefix)'/share/info
@@ -916,8 +928,8 @@ glibc_do_configure() {
# 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="$(host_eprefix)/sbin"
+ export libc_cv_slibdir="$(host_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
@@ -1046,7 +1058,7 @@ glibc_headers_configure() {
--build=${CBUILD_OPT:-${CBUILD}}
--host=${CTARGET_OPT:-${CTARGET}}
--with-headers=$(alt_build_headers)
- --prefix="${EPREFIX}/usr"
+ --prefix="$(host_eprefix)/usr"
${EXTRA_ECONF}
)
@@ -1136,7 +1148,7 @@ glibc_do_src_install() {
local builddir=$(builddir nptl)
cd "${builddir}"
- emake install_root="${D}$(alt_prefix)" install || die
+ emake install_root="${D}$(build_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
@@ -1320,7 +1332,7 @@ glibc_do_src_install() {
glibc_headers_install() {
local builddir=$(builddir "headers")
cd "${builddir}"
- emake install_root="${D}$(alt_prefix)" install-headers
+ emake install_root="${D}$(build_eprefix)$(alt_prefix)" install-headers
insinto $(alt_headers)/gnu
doins "${S}"/include/gnu/stubs.h