allow both endiannesses coexist.
* configure.ac: proparate target_cpu=mipsel rather than resetting to
mips. All conditions adjusted.
* tests/util/grub-shell-tester.in: Remove gratuitious target_cpu
variable.
* util/grub-install.in: Adjust conditions to take renaming into account.
* util/grub-mkimage.c (image_targets): Likewise. New target
mips-qemu_mips-elf for bigendian mips.
+2011-05-17 Vladimir Serbinenko <phcoder@gmail.com>
+
+ Use mipsel- rather than mips- in directories involving mipsel ports to
+ allow both endiannesses coexist.
+
+ * configure.ac: proparate target_cpu=mipsel rather than resetting to
+ mips. All conditions adjusted.
+ * tests/util/grub-shell-tester.in: Remove gratuitious target_cpu
+ variable.
+ * util/grub-install.in: Adjust conditions to take renaming into account.
+ * util/grub-mkimage.c (image_targets): Likewise. New target
+ mips-qemu_mips-elf for bigendian mips.
+
2011-05-17 Vladimir Serbinenko <phcoder@gmail.com>
Avoid unnecessary copying on MIPS.
amd64) target_cpu=x86_64 ;;
sparc) target_cpu=sparc64 ;;
mipsel|mips64el)
- target_cpu=mips;
+ target_cpu=mipsel;
machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_CPU_MIPSEL=1";
;;
mips|mips64)
powerpc-*) platform=ieee1275 ;;
powerpc64-*) platform=ieee1275 ;;
sparc64-*) platform=ieee1275 ;;
- mips-*) platform=loongson ;;
+ mipsel-*) platform=loongson ;;
+ mips-*) platform=arc ;;
ia64-*) platform=efi ;;
*) AC_MSG_ERROR([unsupported CPU: "$target_cpu"]) ;;
esac
ia64-efi) ;;
mips-qemu_mips) ;;
mips-qemu-mips) platform=qemu_mips;;
- mips-yeeloong) platform=loongson ;;
- mips-fuloong) platform=loongson ;;
- mips-loongson) ;;
mips-arc) ;;
+ mipsel-qemu_mips) ;;
+ mipsel-qemu-mips) platform=qemu_mips;;
+ mipsel-yeeloong) platform=loongson ;;
+ mipsel-fuloong) platform=loongson ;;
+ mipsel-loongson) ;;
*-emu) ;;
*) AC_MSG_ERROR([platform "$platform" is not supported for target CPU "$target_cpu"]) ;;
esac
arc) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_ARC=1" ;;
esac
case "$target_cpu" in
- mips) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_MIPS=1" ;;
+ mips |mipsel) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_MIPS=1" ;;
sparc64) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_SPARC64=1" ;;
esac
-machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE=`echo ${target_cpu}_$platform | sed y,abcdefghijklmnopqrstuvwxyz,ABCDEFGHIJKLMNOPQRSTUVWXYZ,`"
+if test x${target_cpu} = xmipsel ; then
+ machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE=`echo mips_$platform | sed y,abcdefghijklmnopqrstuvwxyz,ABCDEFGHIJKLMNOPQRSTUVWXYZ,`"
+else
+ machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE=`echo ${target_cpu}_$platform | sed y,abcdefghijklmnopqrstuvwxyz,ABCDEFGHIJKLMNOPQRSTUVWXYZ,`"
+fi
HOST_CPPFLAGS="$HOST_CPPFLAGS $machine_CPPFLAGS"
TARGET_CPPFLAGS="$TARGET_CPPFLAGS $machine_CPPFLAGS"
TARGET_CFLAGS="$TARGET_CFLAGS -fno-dwarf2-cfi-asm"
fi
-if test "${target_cpu}-${platform}" = mips-loongson; then
+if test "${target_cpu}-${platform}" = mipsel-loongson; then
AC_CACHE_CHECK([whether -march=loongson2f works], [grub_cv_cc_march_loongson2f], [
SAVE_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -march=loongson2f"
AM_CONDITIONAL([COND_i386_coreboot], [test x$target_cpu = xi386 -a x$platform = xcoreboot])
AM_CONDITIONAL([COND_i386_multiboot], [test x$target_cpu = xi386 -a x$platform = xmultiboot])
AM_CONDITIONAL([COND_x86_64_efi], [test x$target_cpu = xx86_64 -a x$platform = xefi])
-AM_CONDITIONAL([COND_mips_loongson], [test x$target_cpu = xmips -a x$platform = xloongson])
-AM_CONDITIONAL([COND_mips_qemu_mips], [test x$target_cpu = xmips -a x$platform = xqemu_mips])
+AM_CONDITIONAL([COND_mips_loongson], [test x$target_cpu = xmipsel -a x$platform = xloongson])
+AM_CONDITIONAL([COND_mips_qemu_mips], [test "(" x$target_cpu = xmips -o x$target_cpu = xmipsel ")" -a x$platform = xqemu_mips])
AM_CONDITIONAL([COND_mips_arc], [test x$target_cpu = xmips -a x$platform = xarc])
AM_CONDITIONAL([COND_sparc64_ieee1275], [test x$target_cpu = xsparc64 -a x$platform = xieee1275])
AM_CONDITIONAL([COND_powerpc_ieee1275], [test x$target_cpu = xpowerpc -a x$platform = xieee1275])
-AM_CONDITIONAL([COND_mips], [test x$target_cpu = xmips])
+AM_CONDITIONAL([COND_mips], [test x$target_cpu = xmips -o x$target_cpu = xmipsel])
AM_CONDITIONAL([COND_HOST_HURD], [test x$host_kernel = xhurd])
AM_CONDITIONAL([COND_HOST_LINUX], [test x$host_kernel = xlinux])
AM_CONDITIONAL([COND_CYGWIN], [test x$host_os = xcygwin])
# Output files.
+cpudir="${target_cpu}"
+if test x${cpudir} = xmipsel; then
+ cpudir=mips;
+fi
grub_CHECK_LINK_DIR
if test x"$link_dir" = xyes ; then
- AC_CONFIG_LINKS([include/grub/cpu:include/grub/$target_cpu])
+ AC_CONFIG_LINKS([include/grub/cpu:include/grub/$cpudir])
if test "$platform" != emu ; then
- AC_CONFIG_LINKS([include/grub/machine:include/grub/$target_cpu/$platform])
+ AC_CONFIG_LINKS([include/grub/machine:include/grub/$cpudir/$platform])
fi
else
mkdir -p include/grub 2>/dev/null
rm -rf include/grub/cpu
- cp -rp $srcdir/include/grub/$target_cpu include/grub/cpu 2>/dev/null
+ cp -rp $srcdir/include/grub/$cpudir include/grub/cpu 2>/dev/null
if test "$platform" != emu ; then
rm -rf include/grub/machine
- cp -rp $srcdir/include/grub/$target_cpu/$platform include/grub/machine 2>/dev/null
+ cp -rp $srcdir/include/grub/$cpudir/$platform include/grub/machine 2>/dev/null
fi
fi
PACKAGE_NAME=@PACKAGE_NAME@
PACKAGE_TARNAME=@PACKAGE_TARNAME@
PACKAGE_VERSION=@PACKAGE_VERSION@
-target_cpu=@target_cpu@
# Force build directory components
PATH=${builddir}:$PATH
case "${target_cpu}-${platform}" in
sparc64-ieee1275) mkimage_target=sparc64-ieee1275-raw ;;
- mips-loongson) mkimage_target=mipsel-loongson-elf ;;
+ mipsel-loongson) mkimage_target=mipsel-loongson-elf ;;
*) mkimage_target="${target_cpu}-${platform}" ;;
esac
case "${target_cpu}-${platform}" in
i386-efi | x86_64-efi) imgext=efi ;;
- mips-loongson | i386-coreboot | i386-multiboot | i386-ieee1275 \
+ mipsel-loongson | i386-coreboot | i386-multiboot | i386-ieee1275 \
| powerpc-ieee1275) imgext=elf ;;
*) imgext=img ;;
esac
"$grub_mkimage" ${config_opt} -d "${pkglibdir}" -O ${mkimage_target} --output="${grubdir}/core.${imgext}" --prefix="${prefix_drive}${relative_grubdir}" $modules || exit 1
# Backward-compatibility kludges
-if [ "${target_cpu}-${platform}" = "mips-loongson" ]; then
+if [ "${target_cpu}-${platform}" = "mipsel-loongson" ]; then
cp "${grubdir}/core.${imgext}" "${bootdir}"/grub.elf
elif [ "${target_cpu}-${platform}" = "i386-ieee1275" ] || [ "${target_cpu}-${platform}" = "powerpc-ieee1275" ]; then
cp "${grubdir}/core.${imgext}" "${grubdir}/grub"
.elf_target = EM_X86_64,
},
{
- .dirname = "mips-loongson",
+ .dirname = "mipsel-loongson",
.names = { "mipsel-yeeloong-flash", NULL },
.voidp_sizeof = 4,
.bigendian = 0,
.default_compression = COMPRESSION_NONE
},
{
- .dirname = "mips-loongson",
+ .dirname = "mipsel-loongson",
.names = { "mipsel-fuloong-flash", NULL },
.voidp_sizeof = 4,
.bigendian = 0,
.default_compression = COMPRESSION_NONE
},
{
- .dirname = "mips-loongson",
+ .dirname = "mipsel-loongson",
.names = { "mipsel-loongson-elf", "mipsel-yeeloong-elf",
"mipsel-fuloong-elf", NULL },
.voidp_sizeof = 4,
.default_compression = COMPRESSION_NONE
},
{
- .dirname = "mips-qemu_mips",
+ .dirname = "mipsel-qemu_mips",
.names = { "mipsel-qemu_mips-elf", NULL },
.voidp_sizeof = 4,
.bigendian = 0,
.link_align = GRUB_KERNEL_MIPS_QEMU_MIPS_LINK_ALIGN,
.default_compression = COMPRESSION_NONE
},
+ {
+ .dirname = "mips-qemu_mips",
+ .names = { "mips-qemu_mips-elf", NULL },
+ .voidp_sizeof = 4,
+ .bigendian = 1,
+ .id = IMAGE_LOONGSON_ELF,
+ .flags = PLATFORM_FLAGS_DECOMPRESSORS,
+ .prefix = GRUB_KERNEL_MIPS_QEMU_MIPS_PREFIX,
+ .prefix_end = GRUB_KERNEL_MIPS_QEMU_MIPS_PREFIX_END,
+ .raw_size = 0,
+ .total_module_size = GRUB_KERNEL_MIPS_QEMU_MIPS_TOTAL_MODULE_SIZE,
+ .compressed_size = TARGET_NO_FIELD,
+ .kernel_image_size = TARGET_NO_FIELD,
+ .section_align = 1,
+ .vaddr_offset = 0,
+ .install_dos_part = TARGET_NO_FIELD,
+ .install_bsd_part = TARGET_NO_FIELD,
+ .link_addr = GRUB_KERNEL_MIPS_QEMU_MIPS_LINK_ADDR,
+ .elf_target = EM_MIPS,
+ .link_align = GRUB_KERNEL_MIPS_QEMU_MIPS_LINK_ALIGN,
+ .default_compression = COMPRESSION_NONE
+ },
};
#define grub_target_to_host32(x) (grub_target_to_host32_real (image_target, (x)))