Add support for cross-compiling.
authorMike Frysinger <vapier@gentoo.org>
Thu, 13 Oct 2011 22:40:08 +0000 (22:40 +0000)
committerMike Frysinger <vapier@gentoo.org>
Thu, 13 Oct 2011 22:40:08 +0000 (22:40 +0000)
Package-Manager: portage-2.2.0_alpha65/cvs/Linux x86_64

dev-libs/elfutils/ChangeLog
dev-libs/elfutils/Manifest
dev-libs/elfutils/elfutils-0.152-r1.ebuild

index 3a3b0593bd874cc41be7c6e5d32f7471bf9f1d3d..6d93d4f6406b56525acab55446ca89c454416402 100644 (file)
@@ -1,6 +1,9 @@
 # ChangeLog for dev-libs/elfutils
 # Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/dev-libs/elfutils/ChangeLog,v 1.154 2011/10/05 02:28:02 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-libs/elfutils/ChangeLog,v 1.155 2011/10/13 22:40:08 vapier Exp $
+
+  13 Oct 2011; Mike Frysinger <vapier@gentoo.org> elfutils-0.152-r1.ebuild:
+  Add support for cross-compiling.
 
 *elfutils-0.152-r1 (05 Oct 2011)
 
index b55b139cf5b1a865f45ce7e654ac154d45cf6afe..445f3dc4c4a790ad1aa66116d2cf83c3d636179a 100644 (file)
@@ -18,14 +18,14 @@ EBUILD elfutils-0.148.ebuild 1875 RMD160 5cea3b243c204188fd00ac50c8f6a0b189c80a4
 EBUILD elfutils-0.149.ebuild 1722 RMD160 9e6760b31636c9338c1b3a03cfb6e3942d9aa164 SHA1 b784ab00542476a91ad30fe8531ae334fa172d0b SHA256 009c3f5de043cdcd3bcb8fe7ad922295e04ec06110ce1ba272ae58a25112f6e3
 EBUILD elfutils-0.150.ebuild 1748 RMD160 5b632aac813e2507b5ecbe997d9074a257872c90 SHA1 b029bc1d1f21df7fa929b0aec2151a152c8a76d5 SHA256 80bf8ba59a4dbe75d5ec4e5bef56febd7c600288f773cc0f397996f5c5f1e3fc
 EBUILD elfutils-0.151.ebuild 1748 RMD160 5f5a6b12bd9376ec8c4b0608b3471401bfe226ae SHA1 6654039c566905d1c9e51bbe5ae063373e13b605 SHA256 af61869db9596a30a9985b27b68b568ed724730ca3faefae373341c5f8bdc0b0
-EBUILD elfutils-0.152-r1.ebuild 1990 RMD160 2fa7d9b024496f04adf304f017b7135ea00f89ca SHA1 ac45fdf97e4c1c6256aa3275a42788e012a8fdf8 SHA256 89a5ce96a692863c607d150153a86475eb20137fc87791507f59ab8aca476654
+EBUILD elfutils-0.152-r1.ebuild 2717 RMD160 c358050b8a6930327ff655e632948c8b616cc1cf SHA1 02c04a5f3f8959e4cacd5c59df39fd5472074f53 SHA256 d4efc5f703eaacd386a8293445ae93c61d094ff0d2e069ff9a6c8d328a34e98f
 EBUILD elfutils-0.152.ebuild 1748 RMD160 276159137c4abbbbf81550486027e393d7f0f060 SHA1 fd1e41ce6c31cd7c0a2f8601e541fad377370b2e SHA256 fad62bce2ca23b765c33e0c2e975d86f0e5632b9eca34f8692ad6addcf747957
-MISC ChangeLog 20569 RMD160 24f16acda74e714f76b7f36b4bb30482f4b374bf SHA1 b91242912a190810b6d2b565d0c40dc25f13464c SHA256 207539cd83002a44f82647270276852ed6bb46777aa04ebbb407ac9caa3606e8
+MISC ChangeLog 20681 RMD160 36534b59dfbea6ac93e0d6930cc00c627b7ff263 SHA1 26f7cffa6755bdc3f3ed2787a6ef90beaa3a5aff SHA256 8f193952ccab094e28692c7d09199f51a49a91c69205bbf66cc4f1aec46b00f8
 MISC metadata.xml 281 RMD160 2e23c1850f32822e50d0905b2e36ba1e22c004b2 SHA1 8f2ea427f9a348676d948018d621bea51f0f8740 SHA256 2418a06fe1c33bf09a8cad2a5b582a9a5b4c2d3315e74f67e3b10c4d76f53736
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.18 (GNU/Linux)
 
-iF4EAREIAAYFAk6LwJgACgkQaC/OocHi7JY8jAD9GOlm9m1TJbIg1tyF4QRgcOfN
-pGRz//mlQovXN4Rg+voA/2x+iaGkEAXpc0TAcj9tzfYoEk0vDnvYprcjmDIWziRC
-=awmr
+iF4EAREIAAYFAk6XaM8ACgkQaC/OocHi7JZcVwEAihTDpZrRS0gVkqnuzxCRbnHO
+IC9TLI5Ozc3bQdBdV8IA/iY0pRF4T3SJNxsFXa1S5D1XzrsU/62xAADqsndMNbRm
+=DYha
 -----END PGP SIGNATURE-----
index 8d50071ba1688de04f8b61af30c17ab64fc77d70..0b250b0c01aa4c6a44c7ee33473294170c6915f7 100644 (file)
@@ -1,10 +1,10 @@
 # Copyright 1999-2011 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/dev-libs/elfutils/elfutils-0.152-r1.ebuild,v 1.1 2011/10/05 02:28:02 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-libs/elfutils/elfutils-0.152-r1.ebuild,v 1.2 2011/10/13 22:40:08 vapier Exp $
 
 EAPI="3"
 
-inherit eutils
+inherit eutils toolchain-funcs
 
 DESCRIPTION="Libraries/utilities to handle ELF objects (drop in replacement for libelf)"
 HOMEPAGE="https://fedorahosted.org/elfutils/"
@@ -36,15 +36,48 @@ src_prepare() {
        use test || sed -i -e 's: tests::' Makefile.in #226349
        # some patches touch both configure and configure.ac
        find -type f -exec touch -r configure {} +
+       mkdir -p ${CBUILD} ${CHOST}
+}
+
+econf_build() {
+       CFLAGS=${BUILD_CFLAGS:--O1 -pipe} \
+       CXXFLAGS=${BUILD_CXXFLAGS:--O1 -pipe} \
+       CPPFLAGS=${BUILD_CPPFLAGS} \
+       LDFLAGS=${BUILD_LDFLAGS} \
+       CC=$(tc-getBUILD_CC) \
+       LD=$(tc-getBUILD_LD) \
+       econf --host=${CBUILD} "$@"
 }
 
 src_configure() {
+       ECONF_SOURCE=${S}
+
+       if tc-is-cross-compiler ; then
+               pushd ${CBUILD} >/dev/null
+               econf_build --disable-nls --without-{zlib,bzlib,lzma}
+               popd >/dev/null
+       fi
+
+       pushd ${CHOST} >/dev/null
        econf \
                $(use_enable nls) \
                --program-prefix="eu-" \
                $(use_with zlib) \
                $(use_with bzip2 bzlib) \
                $(use_with lzma)
+       popd >/dev/null
+}
+
+src_compile() {
+       if tc-is-cross-compiler ; then
+               pushd ${CBUILD} >/dev/null
+               emake -C lib || die
+               emake -C libcpu || die
+               popd >/dev/null
+               ln ${CBUILD}/libcpu/i386_gendis ${CHOST}/libcpu/ || die
+       fi
+
+       emake -C ${CHOST} || die
 }
 
 src_test() {
@@ -54,6 +87,6 @@ src_test() {
 }
 
 src_install() {
-       emake DESTDIR="${D}" install || die
+       emake -C ${CHOST} DESTDIR="${D}" install || die
        dodoc AUTHORS ChangeLog NEWS NOTES README THANKS TODO
 }