diff options
Diffstat (limited to 'sys-boot/gnu-efi')
-rw-r--r-- | sys-boot/gnu-efi/gnu-efi-3.0.3.ebuild | 55 |
1 files changed, 37 insertions, 18 deletions
diff --git a/sys-boot/gnu-efi/gnu-efi-3.0.3.ebuild b/sys-boot/gnu-efi/gnu-efi-3.0.3.ebuild index f79b3b2961d5..9c6a09fcff1d 100644 --- a/sys-boot/gnu-efi/gnu-efi-3.0.3.ebuild +++ b/sys-boot/gnu-efi/gnu-efi-3.0.3.ebuild @@ -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 } |