]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
2009-03-21 Bean <bean123ch@gmail.com>
authorbean <bean@localhost>
Sat, 21 Mar 2009 07:48:28 +0000 (07:48 +0000)
committerbean <bean@localhost>
Sat, 21 Mar 2009 07:48:28 +0000 (07:48 +0000)
* util/hostdisk.c (read_device_map): Use grub_util_get_disk_size
instead of stat in mingw environment.

* util/misc.c (grub_millisleep): Use Sleep in mingw environment.

* aclocal.m4 (grub_CHECK_LINK_DIR): New function.

* configure.ac: Use grub_CHECK_LINK_DIR to determine whether to use
AC_CONFIG_LINKS.

ChangeLog
DISTLIST
aclocal.m4
conf/powerpc-ieee1275.mk
configure
configure.ac
util/hostdisk.c
util/misc.c

index 24423989830212558c0728dfbb3e07f8d345d673..8e2da3e1402d2ed932b9c5423b5c67ad1e87d78c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2009-03-21  Bean  <bean123ch@gmail.com>
+
+       * util/hostdisk.c (read_device_map): Use grub_util_get_disk_size
+       instead of stat in mingw environment.
+
+       * util/misc.c (grub_millisleep): Use Sleep in mingw environment.
+
+       * aclocal.m4 (grub_CHECK_LINK_DIR): New function.
+
+       * configure.ac: Use grub_CHECK_LINK_DIR to determine whether to use
+       AC_CONFIG_LINKS.
+
 2009-03-21  Bean  <bean123ch@gmail.com>
 
        * fs/ext2.c (grub_ext2_mount): Change errno to GRUB_ERR_BAD_FS for
index fbe6aef5b11fc6e76dee54a0f6191ca500026e1e..a6d9d204ee2f67e68c11d6280b3c40f4ac07e830 100644 (file)
--- a/DISTLIST
+++ b/DISTLIST
@@ -392,6 +392,7 @@ loader/i386/linux.c
 loader/i386/multiboot.c
 loader/i386/multiboot_elfxx.c
 loader/i386/efi/linux.c
+loader/i386/efi/loadbios.c
 loader/i386/ieee1275/linux.c
 loader/i386/pc/chainloader.c
 loader/i386/pc/chainloader_normal.c
index 1dd5ffb3f2c57d2c0cb3ce768089cf599a849f62..3c72ca9ec546fe7acfb5e231a8e999639c73c9ed 100644 (file)
@@ -448,3 +448,21 @@ else
   AC_MSG_RESULT([no])
 [fi]
 ])
+
+dnl Check if ln can handle directories properly (mingw).
+AC_DEFUN(grub_CHECK_LINK_DIR,[
+AC_MSG_CHECKING([whether ln can handle directories properly])
+[mkdir testdir 2>/dev/null
+case $srcdir in
+[\\/$]* | ?:[\\/]* ) reldir=$srcdir/include/grub/util ;;
+    *) reldir=../$srcdir/include/grub/util ;;
+esac
+if ln -s $reldir testdir/util 2>/dev/null ; then]
+  AC_MSG_RESULT([yes])
+  [link_dir=yes
+else
+  link_dir=no]
+  AC_MSG_RESULT([no])
+[fi
+rm -rf testdir]
+])
index 11e932a7db6fdbbc92d816ba68a7c7f79e135dba..436c2bf398b8046c327d189b7e1a8d3c66e4a811 100644 (file)
@@ -17,7 +17,7 @@ DEFSYMFILES += kernel_syms.lst
 kernel_elf_HEADERS = arg.h boot.h cache.h device.h disk.h dl.h elf.h elfload.h \
        env.h err.h file.h fs.h kernel.h misc.h mm.h net.h parser.h rescue.h \
        symbol.h term.h time.h types.h powerpc/libgcc.h loader.h partition.h \
-       pc_partition.h ieee1275/ieee1275.h machine/kernel.h
+       pc_partition.h ieee1275/ieee1275.h machine/kernel.h handler.h
 
 symlist.c: $(addprefix include/grub/,$(kernel_elf_HEADERS)) config.h gensymlist.sh
        /bin/sh gensymlist.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1)
index 89b564ae3f568bcc68030a56d5cbc509fd645594..f77ebf83942426a9b224c7034fa014d97e9de8da 100644 (file)
--- a/configure
+++ b/configure
@@ -8859,8 +8859,35 @@ fi
 
 
 # Output files.
-ac_config_links="$ac_config_links include/grub/cpu:include/grub/$target_cpu include/grub/machine:include/grub/$target_cpu/$platform"
 
+{ echo "$as_me:$LINENO: checking whether ln can handle directories properly" >&5
+echo $ECHO_N "checking whether ln can handle directories properly... $ECHO_C" >&6; }
+mkdir testdir 2>/dev/null
+case $srcdir in
+[\\/$]* | ?:[\\/]* ) reldir=$srcdir/include/grub/util ;;
+    *) reldir=../$srcdir/include/grub/util ;;
+esac
+if ln -s $reldir testdir/util 2>/dev/null ; then
+  { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+  link_dir=yes
+else
+  link_dir=no
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+rm -rf testdir
+
+if test x"$link_dir" = xyes ; then
+  ac_config_links="$ac_config_links include/grub/cpu:include/grub/$target_cpu include/grub/machine:include/grub/$target_cpu/$platform"
+
+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
+  rm -rf include/grub/machine
+  cp -rp $srcdir/include/grub/$target_cpu/$platform include/grub/machine 2>/dev/null
+fi
 ac_config_files="$ac_config_files Makefile gensymlist.sh genkernsyms.sh"
 
 ac_config_files="$ac_config_files stamp-h"
index 134e0a33990ffa3e169c9de03fdf634c500252d2..d9f182d4a9ef482c71257dc4bc3735befde4e9d6 100644 (file)
@@ -474,8 +474,17 @@ AC_SUBST([freetype_cflags])
 AC_SUBST([freetype_libs])
 
 # Output files.
-AC_CONFIG_LINKS([include/grub/cpu:include/grub/$target_cpu
+grub_CHECK_LINK_DIR
+if test x"$link_dir" = xyes ; then
+  AC_CONFIG_LINKS([include/grub/cpu:include/grub/$target_cpu
        include/grub/machine:include/grub/$target_cpu/$platform])
+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
+  rm -rf include/grub/machine
+  cp -rp $srcdir/include/grub/$target_cpu/$platform include/grub/machine 2>/dev/null
+fi
 AC_CONFIG_FILES([Makefile gensymlist.sh genkernsyms.sh])
 AC_CONFIG_FILES([stamp-h], [echo timestamp > stamp-h])
 AC_OUTPUT
index 67a1233af7e1f9ba0c6acc1cb804e51e7d3ec048..bea3fb98f7512a4037395e940841666677b1b65d 100644 (file)
@@ -555,7 +555,12 @@ read_device_map (const char *dev_map)
        e++;
       *e = '\0';
 
+#ifdef __MINGW32__
+      (void) st;
+      if (grub_util_get_disk_size (p) == -1LL)
+#else
       if (stat (p, &st) == -1)
+#endif
        {
          free (map[drive].drive);
          map[drive].drive = NULL;
index 8d7d0808b5804fcf2e55901d6859bfbb902ff28c..64c35fd9f9e5abcd96b160a5df297c36666568fc 100644 (file)
 # include <malloc.h>
 #endif
 
+#ifdef __MINGW32__
+#include <windows.h>
+#include <winioctl.h>
+#endif
+
 char *progname = 0;
 int verbosity = 0;
 
@@ -311,6 +316,16 @@ grub_get_time_ms (void)
   return (tv.tv_sec * 1000 + tv.tv_usec / 1000);
 }
 
+#ifdef __MINGW32__
+
+void
+grub_millisleep (grub_uint32_t ms)
+{
+  Sleep (ms);
+}
+
+#else
+
 void
 grub_millisleep (grub_uint32_t ms)
 {
@@ -321,6 +336,8 @@ grub_millisleep (grub_uint32_t ms)
   nanosleep (&ts, NULL);
 }
 
+#endif
+
 void 
 grub_arch_sync_caches (void *address __attribute__ ((unused)),
                       grub_size_t len __attribute__ ((unused)))
@@ -349,9 +366,6 @@ asprintf (char **buf, const char *fmt, ...)
 
 #ifdef __MINGW32__
 
-#include <windows.h>
-#include <winioctl.h>
-
 void sync (void)
 {
 }