commit:     0475287b1eb40bb052bb2c5e5ac5da1019e165e5
Author:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
AuthorDate: Wed Jun 29 02:25:59 2016 +0000
Commit:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Wed Jun 29 02:25:59 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0475287b

sys-boot/grub: refactor platform logic

Package-Manager: portage-2.3.0_p7

 sys-boot/grub/grub-2.02_beta3-r1.ebuild | 29 +++++++++++++----------------
 sys-boot/grub/grub-9999-r1.ebuild       | 29 +++++++++++++----------------
 2 files changed, 26 insertions(+), 32 deletions(-)

diff --git a/sys-boot/grub/grub-2.02_beta3-r1.ebuild 
b/sys-boot/grub/grub-2.02_beta3-r1.ebuild
index fd6f5f2..51efcb7 100644
--- a/sys-boot/grub/grub-2.02_beta3-r1.ebuild
+++ b/sys-boot/grub/grub-2.02_beta3-r1.ebuild
@@ -168,26 +168,23 @@ grub_configure() {
        local platform
 
        case ${MULTIBUILD_VARIANT} in
-               efi-32)
-                       platform=efi
+               efi*) platform=efi ;;
+               xen*) platform=xen ;;
+               guessed) ;;
+               *) platform=${MULTIBUILD_VARIANT} ;;
+       esac
+
+       case ${MULTIBUILD_VARIANT} in
+               *-32)
                        if [[ ${CTARGET:-${CHOST}} == x86_64* ]]; then
-                               local CTARGET=${CTARGET:-i386}
+                               local CTARGET=i386
                        fi ;;
-               efi-64)
-                       platform=efi
+               *-64)
                        if [[ ${CTARGET:-${CHOST}} == i?86* ]]; then
-                               local CTARGET=${CTARGET:-x86_64}
-                               local TARGET_CFLAGS="-Os -march=x86-64 
${TARGET_CFLAGS}"
-                               local TARGET_CPPFLAGS="-march=x86-64 
${TARGET_CPPFLAGS}"
-                               export TARGET_CFLAGS TARGET_CPPFLAGS
-                       fi ;;
-               xen-32)
-                       platform=xen
-                       if [[ ${CHOST} == x86_64* ]]; then
-                               local CTARGET=i386
+                               local CTARGET=x86_64
+                               local -x TARGET_CFLAGS="-Os -march=x86-64 
${TARGET_CFLAGS}"
+                               local -x TARGET_CPPFLAGS="-march=x86-64 
${TARGET_CPPFLAGS}"
                        fi ;;
-               guessed) ;;
-               *)      platform=${MULTIBUILD_VARIANT} ;;
        esac
 
        local myeconfargs=(

diff --git a/sys-boot/grub/grub-9999-r1.ebuild 
b/sys-boot/grub/grub-9999-r1.ebuild
index b0c7084..ad57624 100644
--- a/sys-boot/grub/grub-9999-r1.ebuild
+++ b/sys-boot/grub/grub-9999-r1.ebuild
@@ -169,26 +169,23 @@ grub_configure() {
        local platform
 
        case ${MULTIBUILD_VARIANT} in
-               efi-32)
-                       platform=efi
+               efi*) platform=efi ;;
+               xen*) platform=xen ;;
+               guessed) ;;
+               *) platform=${MULTIBUILD_VARIANT} ;;
+       esac
+
+       case ${MULTIBUILD_VARIANT} in
+               *-32)
                        if [[ ${CTARGET:-${CHOST}} == x86_64* ]]; then
-                               local CTARGET=${CTARGET:-i386}
+                               local CTARGET=i386
                        fi ;;
-               efi-64)
-                       platform=efi
+               *-64)
                        if [[ ${CTARGET:-${CHOST}} == i?86* ]]; then
-                               local CTARGET=${CTARGET:-x86_64}
-                               local TARGET_CFLAGS="-Os -march=x86-64 
${TARGET_CFLAGS}"
-                               local TARGET_CPPFLAGS="-march=x86-64 
${TARGET_CPPFLAGS}"
-                               export TARGET_CFLAGS TARGET_CPPFLAGS
-                       fi ;;
-               xen-32)
-                       platform=xen
-                       if [[ ${CHOST} == x86_64* ]]; then
-                               local CTARGET=i386
+                               local CTARGET=x86_64
+                               local -x TARGET_CFLAGS="-Os -march=x86-64 
${TARGET_CFLAGS}"
+                               local -x TARGET_CPPFLAGS="-march=x86-64 
${TARGET_CPPFLAGS}"
                        fi ;;
-               guessed) ;;
-               *)      platform=${MULTIBUILD_VARIANT} ;;
        esac
 
        local myeconfargs=(

Reply via email to