sys-boot/aboot: add basic cross-compilation support
authorSergei Trofimovich <slyfox@gentoo.org>
Wed, 18 Oct 2017 14:08:30 +0000 (15:08 +0100)
committerSergei Trofimovich <slyfox@gentoo.org>
Wed, 18 Oct 2017 14:08:38 +0000 (15:08 +0100)
Package-Manager: Portage-2.3.11, Repoman-2.3.3

sys-boot/aboot/aboot-1.0_pre20040408-r3.ebuild
sys-boot/aboot/files/aboot-respect-AR.patch [new file with mode: 0644]

index 9fcd14b1d0ff38f0ff00d708f438c792309d1209..ba13f7c301bc068f853a95d8de18b5b9c9551b6f 100644 (file)
@@ -1,7 +1,7 @@
-# Copyright 1999-2011 Gentoo Foundation
+# Copyright 1999-2017 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
-inherit eutils
+inherit eutils toolchain-funcs
 
 KERN_VER="2.6.22"
 
@@ -33,6 +33,7 @@ src_unpack() {
        epatch "${FILESDIR}/aboot-pt_note.patch"
        # Bug 364697
        epatch "${FILESDIR}/aboot-define_stat_only_in_userspace.patch"
+       epatch "${FILESDIR}"/aboot-respect-AR.patch
 
        # Modified patch from Debian to add netboot support
        epatch "${WORKDIR}"/aboot_gentoo.diff
@@ -40,7 +41,7 @@ src_unpack() {
 
 src_compile() {
        # too many problems with parallel building
-       emake -j1 || die "emake failed"
+       emake -j1 AR=$(tc-getAR) CC=$(tc-getCC) LD=$(tc-getLD) || die "emake failed"
 }
 
 src_install() {
diff --git a/sys-boot/aboot/files/aboot-respect-AR.patch b/sys-boot/aboot/files/aboot-respect-AR.patch
new file mode 100644 (file)
index 0000000..44e4a2a
--- /dev/null
@@ -0,0 +1,13 @@
+diff --git a/lib/Makefile b/lib/Makefile
+index e3a2247..c137b53 100644
+--- a/lib/Makefile
++++ b/lib/Makefile
+@@ -13,6 +13,6 @@ libaboot.a: vsprintf.o memcpy.o memset.o string.o _setjmp.o \
+       __remlu.o
+-      ar cru $@ $?
++      $(AR) cru $@ $?
+ else
+ libaboot.a: isolib.o
+-      ar cru $@ $?
++      $(AR) cru $@ $?
+ endif