diff options
Diffstat (limited to 'sys-boot/grub/grub-2.00_beta2.ebuild')
-rw-r--r-- | sys-boot/grub/grub-2.00_beta2.ebuild | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/sys-boot/grub/grub-2.00_beta2.ebuild b/sys-boot/grub/grub-2.00_beta2.ebuild index a5f46fc6b51c..350490500b89 100644 --- a/sys-boot/grub/grub-2.00_beta2.ebuild +++ b/sys-boot/grub/grub-2.00_beta2.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-boot/grub/grub-2.00_beta2.ebuild,v 1.1 2012/03/11 17:48:52 floppym Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-boot/grub/grub-2.00_beta2.ebuild,v 1.2 2012/03/17 07:58:43 floppym Exp $ EAPI=4 @@ -122,15 +122,27 @@ grub_src_configure() { [[ -z ${platform} ]] && die "${FUNCNAME} [platform]" - # check if we have to specify the target (EFI) - # or just append correct --with-platform - if [[ ${platform} == efi-32 ]]; then - # Build 32-bit EFI on 64-bit system - target="--target=i386" - fi + # Used below for efi cross-building + tc-export CC NM OBJCOPY STRIP + unset TARGET_CC TARGET_CFLAGS TARGET_CPPFLAGS case ${platform} in - efi-*) with_platform="--with-platform=${platform%-*}" ;; + efi-32) + if [[ ${CHOST} == x86_64* ]]; then + target="--target=i386" + export TARGET_CC="${CC}" + fi + with_platform="--with-platform=efi" + ;; + efi-64) + if [[ ${CHOST} == i?86* ]]; then + target="--target=x86_64" + export TARGET_CC="${CC}" + export TARGET_CFLAGS="-march=x86-64" + export TARGET_CPPFLAGS="-march=x86-64" + fi + with_platform="--with-platform=efi" + ;; guessed) ;; *) with_platform="--with-platform=${platform}" ;; esac |