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.
This commit is contained in:
parent
2156d5ba73
commit
1f4147aaf0
8 changed files with 92 additions and 6 deletions
12
ChangeLog
12
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
|
||||
|
|
1
DISTLIST
1
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
|
||||
|
|
18
aclocal.m4
vendored
18
aclocal.m4
vendored
|
@ -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]
|
||||
])
|
||||
|
|
|
@ -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)
|
||||
|
|
29
configure
vendored
29
configure
vendored
|
@ -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"
|
||||
|
|
11
configure.ac
11
configure.ac
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
20
util/misc.c
20
util/misc.c
|
@ -43,6 +43,11 @@
|
|||
# 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)
|
||||
{
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue