From 3bc1b2daabb9b07a9c08bca386005d96f07147fe Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Fri, 20 Dec 2013 14:02:27 +0000 Subject: [PATCH 1/2] Fix various build problems on GNU/Hurd. * grub-core/osdep/unix/getroot.c (strip_extra_slashes): Move inside !defined (__GNU__). (xgetcwd): Likewise. * include/grub/emu/hostdisk.h (grub_util_hurd_get_disk_info) [__GNU__]: Add prototype. * util/getroot.c (grub_util_biosdisk_get_grub_dev) [__GNU__]: Format long int using %ld rather than %d. --- ChangeLog | 12 ++++++++++++ grub-core/osdep/unix/getroot.c | 2 +- include/grub/emu/hostdisk.h | 6 ++++++ util/getroot.c | 4 ++-- 4 files changed, 21 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index f7adf9bdf..724ac7cb9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2013-12-20 Colin Watson + + Fix various build problems on GNU/Hurd. + + * grub-core/osdep/unix/getroot.c (strip_extra_slashes): Move inside + !defined (__GNU__). + (xgetcwd): Likewise. + * include/grub/emu/hostdisk.h (grub_util_hurd_get_disk_info) + [__GNU__]: Add prototype. + * util/getroot.c (grub_util_biosdisk_get_grub_dev) [__GNU__]: Format + long int using %ld rather than %d. + 2013-12-18 Vladimir Serbinenko * configure.ac: Set version to 2.02~beta1. diff --git a/grub-core/osdep/unix/getroot.c b/grub-core/osdep/unix/getroot.c index 260465844..3e40d9942 100644 --- a/grub-core/osdep/unix/getroot.c +++ b/grub-core/osdep/unix/getroot.c @@ -116,6 +116,7 @@ #include #endif +#if !defined (__GNU__) static void strip_extra_slashes (char *dir) { @@ -155,7 +156,6 @@ xgetcwd (void) return path; } -#if !defined (__GNU__) char ** grub_util_find_root_devices_from_poolname (char *poolname) { diff --git a/include/grub/emu/hostdisk.h b/include/grub/emu/hostdisk.h index ba0034d5f..8aa5403cd 100644 --- a/include/grub/emu/hostdisk.h +++ b/include/grub/emu/hostdisk.h @@ -75,6 +75,12 @@ grub_hostdisk_find_partition_start_os (const char *dev); void grub_hostdisk_flush_initial_buffer (const char *os_dev); +#ifdef __GNU__ +int +grub_util_hurd_get_disk_info (const char *dev, grub_uint32_t *secsize, grub_disk_addr_t *offset, + grub_disk_addr_t *size, char **parent); +#endif + struct grub_util_hostdisk_data { char *dev; diff --git a/util/getroot.c b/util/getroot.c index d71c9e858..57162632c 100644 --- a/util/getroot.c +++ b/util/getroot.c @@ -363,9 +363,9 @@ grub_util_biosdisk_get_grub_dev (const char *os_dev) char *t; t = dri; if (*q >= 'a' && *q <= 'g') - dri = xasprintf ("%s,%d,%d", t, n, *q - 'a' + 1); + dri = xasprintf ("%s,%ld,%d", t, n, *q - 'a' + 1); else - dri = xasprintf ("%s,%d", t, n); + dri = xasprintf ("%s,%ld", t, n); free (t); } } From d642d7619719af3e7185b5f88a821d8abb1e55a0 Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Fri, 20 Dec 2013 16:09:43 +0000 Subject: [PATCH 2/2] Be more verbose about some configure failures. --- ChangeLog | 4 ++++ configure.ac | 30 +++++++++++++++++++----------- 2 files changed, 23 insertions(+), 11 deletions(-) diff --git a/ChangeLog b/ChangeLog index 724ac7cb9..4bc407e18 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2013-12-20 Colin Watson + + Be more verbose about some configure failures. + 2013-12-20 Colin Watson Fix various build problems on GNU/Hurd. diff --git a/configure.ac b/configure.ac index 5e5c9769a..b00fd9469 100644 --- a/configure.ac +++ b/configure.ac @@ -745,7 +745,7 @@ if test x"$efiemu_excuse" = x ; then fi fi if test x"$enable_efiemu" = xyes && test x"$efiemu_excuse" != x ; then - AC_MSG_ERROR([efiemu runtime was explicitly requested but can't be compiled]) + AC_MSG_ERROR([efiemu runtime was explicitly requested but can't be compiled ($efiemu_excuse)]) fi if test x"$efiemu_excuse" = x ; then enable_efiemu=yes @@ -1144,7 +1144,7 @@ AC_CHECK_LIB([usb], [usb_claim_interface], [LIBUSB="-lusb"], [grub_emu_usb_excuse=["need libusb headers"]]) [fi] if test x"$enable_grub_emu_usb" = xyes && test x"$grub_emu_usb_excuse" != x ; then - AC_MSG_ERROR([USB support for grub-emu was explicitly requested but can't be compiled]) + AC_MSG_ERROR([USB support for grub-emu was explicitly requested but can't be compiled ($grub_emu_usb_excuse)]) fi if test x"$grub_emu_usb_excuse" = x ; then enable_grub_emu_usb=yes @@ -1169,7 +1169,7 @@ AC_CHECK_LIB([SDL], [SDL_Init], [LIBSDL="-lSDL"], [fi] if test x"enable_grub_emu_sdl" = xyes && test x"$grub_emu_sdl_excuse" != x ; then - AC_MSG_ERROR([SDL support for grub-emu was explicitely requested but can't be compiled]) + AC_MSG_ERROR([SDL support for grub-emu was explicitely requested but can't be compiled ($grub_emu_sdl_excuse)]) fi if test x"$grub_emu_sdl_excuse" = x ; then enable_grub_emu_sdl=yes @@ -1249,7 +1249,7 @@ if test x"$grub_mkfont_excuse" = x ; then fi if test x"$enable_grub_mkfont" = xyes && test x"$grub_mkfont_excuse" != x ; then - AC_MSG_ERROR([grub-mkfont was explicitly requested but can't be compiled]) + AC_MSG_ERROR([grub-mkfont was explicitly requested but can't be compiled ($grub_mkfont_excuse)]) fi if test x"$grub_mkfont_excuse" = x ; then enable_grub_mkfont=yes @@ -1308,7 +1308,7 @@ if test x"$grub_build_mkfont_excuse" = x ; then fi if test x"$enable_build_grub_mkfont" = xyes && test x"$grub_build_mkfont_excuse" != x ; then - AC_MSG_ERROR([build-grub-mkfont was explicitly requested but can't be compiled]) + AC_MSG_ERROR([build-grub-mkfont was explicitly requested but can't be compiled ($grub_build_mkfont_excuse)]) fi if test x"$grub_build_mkfont_excuse" = x ; then enable_build_grub_mkfont=yes @@ -1316,7 +1316,11 @@ else enable_build_grub_mkfont=no fi if test x"$enable_build_grub_mkfont" = xno && ( test "x$platform" = xqemu || test "x$platform" = xloongson || test "x$platform" = xqemu_mips || test "x$target_cpu"-"$platform" = xpowerpc-ieee1275 || test "x$platform" = xcoreboot ); then - AC_MSG_ERROR([qemu, powerpc-ieee1275, coreboot and loongson ports needs build-time grub-mkfont]) + if test x"$grub_build_mkfont_excuse" = x ; then + AC_MSG_ERROR([qemu, powerpc-ieee1275, coreboot and loongson ports needs build-time grub-mkfont]) + else + AC_MSG_ERROR([qemu, powerpc-ieee1275, coreboot and loongson ports needs build-time grub-mkfont ($grub_build_mkfont_excuse)]) + fi fi AC_SUBST([build_freetype_cflags]) @@ -1359,7 +1363,7 @@ if test x"$starfield_excuse" = x; then fi if test x"$enable_grub_themes" = xyes && test x"$starfield_excuse" != x; then - AC_MSG_ERROR([themes were explicitly requested but requirements are not satisfied]) + AC_MSG_ERROR([themes were explicitly requested but requirements are not satisfied ($starfield_excuse)]) fi AC_SUBST([DJVU_FONT_SOURCE]) @@ -1385,7 +1389,11 @@ if test x"$enable_build_grub_mkfont" = xno ; then fi if test "x$FONT_SOURCE" = x && ( test "x$platform" = xqemu || test "x$platform" = xloongson || test "x$platform" = xqemu_mips || test "x$target_cpu"-"$platform" = xpowerpc-ieee1275 || test "x$platform" = xcoreboot ); then - AC_MSG_ERROR([qemu, powerpc-ieee1275, coreboot and loongson ports need unifont]) + if test x"$grub_build_mkfont_excuse" = x ; then + AC_MSG_ERROR([qemu, powerpc-ieee1275, coreboot and loongson ports need unifont]) + else + AC_MSG_ERROR([qemu, powerpc-ieee1275, coreboot and loongson ports need unifont ($grub_build_mkfont_excuse)]) + fi fi AC_SUBST([FONT_SOURCE]) @@ -1417,7 +1425,7 @@ if test x"$grub_mount_excuse" = x ; then fi if test x"$enable_grub_mount" = xyes && test x"$grub_mount_excuse" != x ; then - AC_MSG_ERROR([grub-mount was explicitly requested but can't be compiled]) + AC_MSG_ERROR([grub-mount was explicitly requested but can't be compiled ($grub_mount_excuse)]) fi if test x"$grub_mount_excuse" = x ; then enable_grub_mount=yes @@ -1485,7 +1493,7 @@ AC_CHECK_HEADER([lzma.h], [], [liblzma_excuse="need lzma header"]) fi if test x"$enable_liblzma" = xyes && test x"$liblzma_excuse" != x ; then - AC_MSG_ERROR([liblzma support was explicitly requested but requirements are not satisfied]) + AC_MSG_ERROR([liblzma support was explicitly requested but requirements are not satisfied ($liblzma_excuse)]) fi @@ -1522,7 +1530,7 @@ if test x"$libzfs_excuse" = x ; then fi if test x"$enable_libzfs" = xyes && test x"$libzfs_excuse" != x ; then - AC_MSG_ERROR([libzfs support was explicitly requested but requirements are not satisfied]) + AC_MSG_ERROR([libzfs support was explicitly requested but requirements are not satisfied ($libzfs_excuse)]) fi if test x"$libzfs_excuse" = x ; then