mirror of
https://github.com/gentoo-mirror/gentoo.git
synced 2026-08-05 12:38:09 -07:00
sys-boot/gnu-efi: Support building ia32 EFI libs on amd64
Package-Manager: portage-2.2.20
This commit is contained in:
@@ -13,7 +13,7 @@ SRC_URI="mirror://sourceforge/gnu-efi/${P}.tar.bz2"
|
||||
LICENSE="GPL-2"
|
||||
SLOT="0"
|
||||
KEYWORDS="-* ~amd64 ~ia64 ~x86"
|
||||
IUSE=""
|
||||
IUSE="abi_x86_32 abi_x86_64"
|
||||
|
||||
DEPEND="sys-apps/pciutils"
|
||||
RDEPEND=""
|
||||
@@ -21,29 +21,48 @@ RDEPEND=""
|
||||
# These objects get run early boot (i.e. not inside of Linux),
|
||||
# so doing these QA checks on them doesn't make sense.
|
||||
QA_EXECSTACK="usr/*/lib*efi.a:* usr/*/crt*.o"
|
||||
RESTRICT="strip"
|
||||
|
||||
_emake() {
|
||||
emake \
|
||||
prefix=${CHOST}- \
|
||||
ARCH=${iarch} \
|
||||
PREFIX="${EPREFIX}/usr" \
|
||||
LIBDIR='$(PREFIX)/'"$(get_libdir)" \
|
||||
"$@"
|
||||
efimake() {
|
||||
local arch=
|
||||
case ${CHOST} in
|
||||
arm*) arch=arm ;;
|
||||
aarch64*) arch=aarch64 ;;
|
||||
ia64*) arch=ia64 ;;
|
||||
i?86*) arch=ia32 ;;
|
||||
x86_64*) arch=x86_64 ;;
|
||||
*) die "Unknown CHOST" ;;
|
||||
esac
|
||||
|
||||
local args=(
|
||||
ARCH="${arch}"
|
||||
HOSTCC="${BUILD_CC}"
|
||||
CC="${CC}"
|
||||
AS="${AS}"
|
||||
LD="${LD}"
|
||||
AR="${AR}"
|
||||
PREFIX="${EPREFIX}/usr"
|
||||
LIBDIR='$(PREFIX)'/$(get_libdir)
|
||||
)
|
||||
emake -j1 "${args[@]}" "$@"
|
||||
}
|
||||
|
||||
src_compile() {
|
||||
case ${ARCH} in
|
||||
ia64) iarch=ia64 ;;
|
||||
x86) iarch=ia32 ;;
|
||||
amd64) iarch=x86_64 ;;
|
||||
*) die "unknown architecture: $ARCH" ;;
|
||||
esac
|
||||
# The lib subdir uses unsafe archive targets, and
|
||||
# the apps subdir needs gnuefi subdir
|
||||
_emake -j1
|
||||
tc-export BUILD_CC AR AS CC LD
|
||||
if [[ ${CHOST} == x86_64* ]]; then
|
||||
use abi_x86_32 && CHOST=i686 ABI=x86 efimake
|
||||
use abi_x86_64 && efimake
|
||||
else
|
||||
efimake
|
||||
fi
|
||||
}
|
||||
|
||||
src_install() {
|
||||
_emake install PREFIX=/usr INSTALLROOT="${D}"
|
||||
if [[ ${CHOST} == x86_64* ]]; then
|
||||
use abi_x86_32 && CHOST=i686 ABI=x86 efimake INSTALLROOT="${D}" install
|
||||
use abi_x86_64 && efimake INSTALLROOT="${D}" install
|
||||
else
|
||||
efimake INSTALLROOT="${D}" install
|
||||
fi
|
||||
dodoc README* ChangeLog
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user