* [PATCH] Simplify target and platform checks
@ 2008-07-17 16:50 Pavel Roskin
2008-07-17 17:03 ` Javier Martín
2008-07-19 15:17 ` Robert Millan
0 siblings, 2 replies; 4+ messages in thread
From: Pavel Roskin @ 2008-07-17 16:50 UTC (permalink / raw)
To: The development of GRUB 2
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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] Simplify target and platform checks
2008-07-17 16:50 [PATCH] Simplify target and platform checks Pavel Roskin
@ 2008-07-17 17:03 ` Javier Martín
2008-07-17 18:15 ` Pavel Roskin
2008-07-19 15:17 ` Robert Millan
1 sibling, 1 reply; 4+ messages in thread
From: Javier Martín @ 2008-07-17 17:03 UTC (permalink / raw)
To: The development of GRUB 2
[-- Attachment #1: Type: text/plain, Size: 2621 bytes --]
El jue, 17-07-2008 a las 12:50 -0400, Pavel Roskin escribió:
> 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)
>
Confirmed to work on amd64 PC with Ubuntu Hardy (default system type
from config.guess is x86_64-unknown-linux-gnu)
[-- Attachment #2: Esta parte del mensaje está firmada digitalmente --]
[-- Type: application/pgp-signature, Size: 827 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] Simplify target and platform checks
2008-07-17 17:03 ` Javier Martín
@ 2008-07-17 18:15 ` Pavel Roskin
0 siblings, 0 replies; 4+ messages in thread
From: Pavel Roskin @ 2008-07-17 18:15 UTC (permalink / raw)
To: The development of GRUB 2
On Thu, 2008-07-17 at 19:03 +0200, Javier Martín wrote:
> Confirmed to work on amd64 PC with Ubuntu Hardy (default system type
> from config.guess is x86_64-unknown-linux-gnu)
Thanks. Applied.
--
Regards,
Pavel Roskin
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] Simplify target and platform checks
2008-07-17 16:50 [PATCH] Simplify target and platform checks Pavel Roskin
2008-07-17 17:03 ` Javier Martín
@ 2008-07-19 15:17 ` Robert Millan
1 sibling, 0 replies; 4+ messages in thread
From: Robert Millan @ 2008-07-19 15:17 UTC (permalink / raw)
To: The development of GRUB 2
Thanks, this was really needed. I hope it's less of a mess now.
On Thu, Jul 17, 2008 at 12:50:42PM -0400, Pavel Roskin wrote:
> 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
>
>
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> http://lists.gnu.org/mailman/listinfo/grub-devel
>
--
Robert Millan
<GPLv2> I know my rights; I want my phone call!
<DRM> What good is a phone call… if you are unable to speak?
(as seen on /.)
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2008-07-19 15:18 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-17 16:50 [PATCH] Simplify target and platform checks Pavel Roskin
2008-07-17 17:03 ` Javier Martín
2008-07-17 18:15 ` Pavel Roskin
2008-07-19 15:17 ` Robert Millan
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.