Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1KJWgq-0008Av-19 for mharc-grub-devel@gnu.org; Thu, 17 Jul 2008 12:50:48 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KJWgo-00088x-MK for grub-devel@gnu.org; Thu, 17 Jul 2008 12:50:46 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KJWgn-00085z-1e for grub-devel@gnu.org; Thu, 17 Jul 2008 12:50:46 -0400 Received: from [199.232.76.173] (port=50293 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KJWgm-00085p-W1 for grub-devel@gnu.org; Thu, 17 Jul 2008 12:50:45 -0400 Received: from c60.cesmail.net ([216.154.195.49]:19447) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_ARCFOUR_SHA1:16) (Exim 4.60) (envelope-from ) id 1KJWgm-0004xB-G9 for grub-devel@gnu.org; Thu, 17 Jul 2008 12:50:44 -0400 Received: from unknown (HELO relay.cesmail.net) ([192.168.1.81]) by c60.cesmail.net with ESMTP; 17 Jul 2008 12:50:43 -0400 Received: from [192.168.0.21] (static-72-92-88-10.phlapa.fios.verizon.net [72.92.88.10]) by relay.cesmail.net (Postfix) with ESMTP id 15A2E4F1869 for ; Thu, 17 Jul 2008 12:50:43 -0400 (EDT) From: Pavel Roskin To: The development of GRUB 2 Content-Type: text/plain Date: Thu, 17 Jul 2008 12:50:42 -0400 Message-Id: <1216313442.16120.29.camel@dv> Mime-Version: 1.0 X-Mailer: Evolution 2.22.3.1 (2.22.3.1-1.fc9) Content-Transfer-Encoding: 7bit X-detected-kernel: by monty-python.gnu.org: Genre and OS details not recognized. Subject: [PATCH] Simplify target and platform checks X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Jul 2008 16:50:46 -0000 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