All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pavel Roskin <proski@gnu.org>
To: The development of GRUB 2 <grub-devel@gnu.org>
Subject: [PATCH] Simplify target and platform checks
Date: Thu, 17 Jul 2008 12:50:42 -0400	[thread overview]
Message-ID: <1216313442.16120.29.camel@dv> (raw)

ChangeLog:

	* configure.ac: Default to efi platform for x86_64-apple.  Allow
	powerpc64 CPU, default to ieee1275 platform for it.  Split CPU
	adjustments from the rest, only do them if target is not
	explicitly given.  Merge other adjustments with the final sanity
	check.  Remove an extraneous check for supported CPU.  Be
	specific which CPU and which platform is not supported.

Index: configure.ac
===================================================================
--- configure.ac	(revision 1716)
+++ configure.ac	(working copy)
@@ -61,46 +61,37 @@
   case "$target_cpu"-"$target_vendor" in
     i386-apple) platform=efi ;;
     i386-*) platform=pc ;;
+    x86_64-apple) platform=efi ;;
     x86_64-*) platform=pc ;;
     powerpc-*) platform=ieee1275 ;;
+    powerpc64-*) platform=ieee1275 ;;
     sparc64-*) platform=ieee1275 ;;
-    *) AC_MSG_ERROR([unsupported machine type]) ;;
+    *) AC_MSG_ERROR([unsupported CPU: "$target_cpu"]) ;;
   esac
 else
   platform="$with_platform"
 fi
 
-case "$platform" in
-  linuxbios) platform=coreboot ;;
-esac
-
-if test "x$platform" = "xefi" ; then
-  case "$target_cpu" in
-    i386) ;;
-    x86_64) target_m64=1 ;;
-    *) AC_MSG_ERROR([unsupported CPU type for EFI]) ;;
+# Adjust CPU unless target was explicitly specified.
+if test -z "$target_alias"; then
+  case "$target_cpu"-"$platform" in
+    x86_64-efi) ;;
+    x86_64-*) target_cpu=i386 target_m32=1 ;;
+    powerpc64-ieee1275) target_cpu=powerpc target_m32=1 ;;
   esac
-else
-  case "$target_cpu" in
-    i386) ;;
-    x86_64) target_cpu=i386 target_m32=1 ;;
-    powerpc) ;;
-    powerpc64) target_cpu=powerpc target_m32=1;;
-    sparc64) ;;
-    *) AC_MSG_ERROR([unsupported CPU type]) ;;
-  esac
 fi
 
-# Sanity check.
+# Check if the platform is supported, make final adjustments.
 case "$target_cpu"-"$platform" in
   i386-efi) ;;
-  x86_64-efi) ;;
+  x86_64-efi) target_m64=1 ;;
   i386-pc) ;;
   i386-coreboot) ;;
+  i386-linuxbios) platform=coreboot ;;
   i386-ieee1275) ;;
   powerpc-ieee1275) ;;
   sparc64-ieee1275) ;;
-  *) AC_MSG_ERROR([unsupported machine type]) ;;
+  *) AC_MSG_ERROR([platform "$platform" is not supported for target CPU "$target_cpu"]) ;;
 esac
 
 AC_SUBST(target_cpu)

-- 
Regards,
Pavel Roskin



             reply	other threads:[~2008-07-17 16:50 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-17 16:50 Pavel Roskin [this message]
2008-07-17 17:03 ` [PATCH] Simplify target and platform checks Javier Martín
2008-07-17 18:15   ` Pavel Roskin
2008-07-19 15:17 ` Robert Millan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1216313442.16120.29.camel@dv \
    --to=proski@gnu.org \
    --cc=grub-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.