grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: RISC OS port


From: Timothy Baldwin
Subject: Re: RISC OS port
Date: Sat, 27 Nov 2004 18:21:25 +0000
User-agent: KMail/1.7

On Saturday 27 Nov 2004 01:36, I wrote:

> 1. Portability fixes and configure.ac changes.

Here they are. However cross-compiling is broken in that
the utilities are only built for the build system, without
this patch they are only built for the host system. Either
way, the result is not a complete installation.

I propose to solve this problem by running configure twice
when cross-compiling, once for the host, once for the build
system. This could be done by adding these make rules:

build/%: build/Makefile
 cd build && $(MAKE) $*
 touch $@

build/Makefile: $(srcdir)/configure
 cd build && $(srcdir)/configure --host=$(build) --target=$(host)

Define BUILD to "build/" when cross compiling or to ""
when not cross-compiling and prefix use of the utilites
in makefiles with $(BUILD).

Shall I do that?


diff -purN -x '*.mk' -x '*~' -x autom4te.cache -x configure -x '.#*' -x CVS 
grub2-submitted/commands/cmp.c grub2-arm/commands/cmp.c
--- grub2-submitted/commands/cmp.c 2004-04-04 14:46:00.000000000 +0100
+++ grub2-arm/commands/cmp.c 2004-11-26 21:46:02.000000000 +0000
@@ -1,4 +1,4 @@
-/* cmd.c - command to cmp an operating system */
+/* cmd.c - command to compare two files. */
 /*
  *  GRUB  --  GRand Unified Bootloader
  *  Copyright (C) 2003  Free Software Foundation, Inc.
diff -purN -x '*.mk' -x '*~' -x autom4te.cache -x configure -x '.#*' -x CVS 
grub2-submitted/configure.ac grub2-arm/configure.ac
--- grub2-submitted/configure.ac 2004-06-19 14:43:01.000000000 +0100
+++ grub2-arm/configure.ac 2004-11-26 21:46:02.000000000 +0000
@@ -23,12 +23,14 @@ AC_CANONICAL_HOST
 case "$host_cpu" in
   i[[3456]]86) host_cpu=i386 ;;
   powerpc) ;;
+  arm) ;;
   *) AC_MSG_ERROR([unsupported CPU type]) ;;
 esac
 
 case "$host_cpu"-"$host_vendor" in
   i386-*) host_vendor=pc ;;
   powerpc-*) host_vendor=ieee1275 ;;
+  arm-*) host_vendor=RISC_OS ;;
   *) AC_MSG_ERROR([unsupported machine type]) ;;
 esac
 
@@ -62,6 +64,15 @@ if test "x$default_CFLAGS" = xyes; then
     tmp_CFLAGS="$tmp_CFLAGS -O2 -fno-strength-reduce -fno-unroll-loops"
   fi
 
+  # C99.
+  AC_CACHE_CHECK([whether -std=gnu99 works], c99_flag, [
+    CFLAGS=-std=gnu99
+    AC_TRY_COMPILE(, , c99_flag=yes, c99_flag=no)
+  ])
+  if test "x$c99_flag" = xyes; then
+    tmp_CFLAGS="$tmp_CFLAGS -std=gnu99"
+  fi
+
   # Force no alignment to save space on i386.
   if test "x$host_cpu" = xi386; then
     AC_CACHE_CHECK([whether -falign-loops works], [falign_loop_flag], [
@@ -97,6 +108,10 @@ else
   AC_DEFINE([NESTED_FUNC_ATTR], [],[Catch gcc bug])
 fi
 
+if test "x$host_cpu" = xarm; then
+  AC_PATH_PROG(PERL, perl)
+fi
+
 AC_PROG_INSTALL
 AC_PROG_MAKE_SET
 AC_CHECK_TOOL(OBJCOPY, objcopy)
@@ -109,7 +124,7 @@ AC_CHECK_TOOL(LD, ld)
 AC_PATH_PROG(RUBY, ruby)
 
 # For cross-compiling.
-if test "x$build" = "x$host"; then
+if test "x$build" != "x$host"; then
   AC_CHECK_PROGS(BUILD_CC, [gcc egcs cc],
    [AC_MSG_ERROR([none of gcc, egcs and cc is found. set BUILD_CC manually.])])
 else
diff -purN -x '*.mk' -x '*~' -x autom4te.cache -x configure -x '.#*' -x CVS 
grub2-submitted/include/grub/disk.h grub2-arm/include/grub/disk.h
--- grub2-submitted/include/grub/disk.h 2004-10-02 11:28:45.000000000 +0100
+++ grub2-arm/include/grub/disk.h 2004-11-26 21:46:02.000000000 +0000
@@ -31,6 +31,7 @@ enum grub_disk_dev_id
   {
     GRUB_DISK_DEVICE_BIOSDISK_ID,
     GRUB_DISK_DEVICE_OFDISK_ID,
+    GRUB_DISK_DEVICE_FILECORE_ID,
   };
 
 struct grub_disk;
diff -purN -x '*.mk' -x '*~' -x autom4te.cache -x configure -x '.#*' -x CVS 
grub2-submitted/include/grub/err.h grub2-arm/include/grub/err.h
--- grub2-submitted/include/grub/err.h 2004-10-02 11:28:45.000000000 +0100
+++ grub2-arm/include/grub/err.h 2004-11-26 21:46:02.000000000 +0000
@@ -49,7 +49,10 @@ typedef enum
     GRUB_ERR_NO_KERNEL,
     GRUB_ERR_BAD_FONT,
     GRUB_ERR_NOT_IMPLEMENTED_YET,
-    GRUB_ERR_SYMLINK_LOOP
+    GRUB_ERR_SYMLINK_LOOP,
+    GRUB_ERR_FILE_CLOSE_ERROR,
+    GRUB_ERR_FILE_OPEN_ERROR,
+    GRUB_ERR_DIR_READ_ERROR
   }
 grub_err_t;
 
diff -purN -x '*.mk' -x '*~' -x autom4te.cache -x configure -x '.#*' -x CVS 
grub2-submitted/include/grub/misc.h grub2-arm/include/grub/misc.h
--- grub2-submitted/include/grub/misc.h 2004-11-19 00:55:52.000000000 +0000
+++ grub2-arm/include/grub/misc.h 2004-11-26 21:46:02.000000000 +0000
@@ -26,10 +26,11 @@
 #include <grub/symbol.h>
 #include <grub/err.h>
 
 /* XXX: If grub_memmove is too slow, we must implement grub_memcpy.  */
 #define grub_memcpy(d,s,n) grub_memmove ((d), (s), (n))
 
 void *EXPORT_FUNC(grub_memmove) (void *dest, const void *src, grub_size_t n);
+void *EXPORT_FUNC(memcpy) (void *dest, const void *src, grub_size_t n);
 char *EXPORT_FUNC(grub_strcpy) (char *dest, const char *src);
 char *EXPORT_FUNC(grub_strncpy) (char *dest, const char *src, int c);
 char *EXPORT_FUNC(grub_stpcpy) (char *dest, const char *src);
@@ -53,6 +56,7 @@ unsigned long EXPORT_FUNC(grub_strtoul) 
 char *EXPORT_FUNC(grub_strdup) (const char *s);
 char *EXPORT_FUNC(grub_strndup) (const char *s, grub_size_t n);
 void *EXPORT_FUNC(grub_memset) (void *s, int c, grub_size_t n);
+void *EXPORT_FUNC(memset) (void *s, int c, grub_size_t n);
 grub_size_t EXPORT_FUNC(grub_strlen) (const char *s);
 int EXPORT_FUNC(grub_printf) (const char *fmt, ...) __attribute__ ((format 
(printf, 1, 2)));
 int EXPORT_FUNC(grub_vprintf) (const char *fmt, va_list args);
diff -purN -x '*.mk' -x '*~' -x autom4te.cache -x configure -x '.#*' -x CVS 
grub2-submitted/include/grub/symbol.h grub2-arm/include/grub/symbol.h
--- grub2-submitted/include/grub/symbol.h 2004-06-19 14:43:01.000000000 +0100
+++ grub2-arm/include/grub/symbol.h 2004-11-26 21:46:02.000000000 +0000
@@ -29,8 +29,8 @@
 # define EXT_C(sym) sym
 #endif
 
-#define FUNCTION(x) .globl EXT_C(x) ; .type EXT_C(x), @function ; EXT_C(x):
-#define VARIABLE(x) .globl EXT_C(x) ; .type EXT_C(x), @object ; EXT_C(x):
+#define FUNCTION(x) .globl EXT_C(x) ; .type EXT_C(x), "function" ; EXT_C(x):
+#define VARIABLE(x) .globl EXT_C(x) ; .type EXT_C(x), "object" ; EXT_C(x):
 
 /* Mark an exported symbol.  */
 #define EXPORT_FUNC(x) x
diff -purN -x '*.mk' -x '*~' -x autom4te.cache -x configure -x '.#*' -x CVS 
grub2-submitted/kern/misc.c grub2-arm/kern/misc.c
--- grub2-submitted/kern/misc.c 2004-11-19 00:55:52.000000000 +0000
+++ grub2-arm/kern/misc.c 2004-11-26 21:46:02.000000000 +0000
@@ -45,8 +45,10 @@ grub_memmove (void *dest, const void *sr
   
   return dest;
 }
+
 void *memmove (void *dest, const void *src, grub_size_t n)
   __attribute__ ((alias ("grub_memmove")));
+
 /* GCC emits references to memcpy() for struct copies etc.  */
 void *memcpy (void *dest, const void *src, grub_size_t n)
   __attribute__ ((alias ("grub_memmove")));
@@ -294,7 +296,7 @@ grub_strtoul (const char *str, char **en
        str += 2;
      }
  }
-      else if (str[1] >= '0' && str[1] <= '7')
+      else if (base == 0 && str[1] >= '0' && str[1] <= '7')
  base = 8;
     }
   
diff -purN -x '*.mk' -x '*~' -x autom4te.cache -x configure -x '.#*' -x CVS 
grub2-submitted/Makefile.in grub2-arm/Makefile.in
--- grub2-submitted/Makefile.in 2004-10-02 11:28:45.000000000 +0100
+++ grub2-arm/Makefile.in 2004-11-26 21:46:02.000000000 +0000
@@ -66,6 +66,7 @@ STRIP = @STRIP@
 NM = @NM@
 LD = @LD@
 RUBY = @RUBY@
+PERL = @PERL@
 
 ### General variables.
 


-- 
Member AFFS, WYLUG, SWP (UK), ANL, RESPECT, Leeds SA, Leeds Anti-war coalition
No to software patents!    Victory to the iraqi resistance!

Attachment: pgpZSWhBW70t4.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]