diff --git a/configure.ac b/configure.ac index f13cac52a..abfcf92e7 100644 --- a/configure.ac +++ b/configure.ac @@ -46,7 +46,16 @@ AC_ARG_PROGRAM case "$target_cpu" in i[[3456]]86) target_cpu=i386 ;; sparc) target_cpu=sparc64 ;; - mipsel) target_cpu=mips ;; + mipsel) + target_cpu=mips; + TARGET_CFLAGS="$TARGET_CFLAGS -DGRUB_CPU_MIPSEL=1"; + CFLAGS="$CFLAGS -DGRUB_CPU_MIPSEL=1"; + ;; + mips) + target_cpu=mips; + TARGET_CFLAGS="$TARGET_CFLAGS -DGRUB_CPU_MIPS=1"; + CFLAGS="$CFLAGS -DGRUB_CPU_MIPS=1"; + ;; esac # Specify the platform (such as firmware). diff --git a/include/grub/mips/types.h b/include/grub/mips/types.h index aed597451..fe09afa3e 100644 --- a/include/grub/mips/types.h +++ b/include/grub/mips/types.h @@ -25,12 +25,14 @@ /* The size of long. */ #define GRUB_TARGET_SIZEOF_LONG 4 -#ifdef __MIPSEL__ +#ifdef GRUB_CPU_MIPSEL /* mipsEL is little-endian. */ #undef GRUB_TARGET_WORDS_BIGENDIAN -#else +#elif defined (GRUB_CPU_MIPS) /* mips is big-endian. */ #define GRUB_TARGET_WORDS_BIGENDIAN +#elif !defined (GRUB_SYMBOL_GENERATOR) +#error Neither GRUB_CPU_MIPS nor GRUB_CPU_MIPSEL is defined #endif #endif /* ! GRUB_TYPES_CPU_HEADER */