]> git.proxmox.com Git - grub2.git/commitdiff
* New upstream release.
authorotavio <otavio@localhost>
Mon, 5 Jun 2006 14:43:33 +0000 (14:43 +0000)
committerotavio <otavio@localhost>
Mon, 5 Jun 2006 14:43:33 +0000 (14:43 +0000)
  - Fix powerpc building. Closes: #370259

debian/changelog
debian/patches/00_cvs-sync.patch [deleted file]

index 489a0b8656f08f05469a7b016d2ca11d8f29e0df..ebb8a9a95602f25ff831a5919657f1a9d11e5d5f 100644 (file)
@@ -1,6 +1,7 @@
-grub2 (1.93-2) UNRELEASED; urgency=low
+grub2 (1.94-1) UNRELEASED; urgency=low
 
-  * Sync with CVS due 20060605. Closes: #370259
+  * New upstream release.
+    - Fix powerpc building. Closes: #370259
   * Leave CDBS set debhelper compatibility level.
   * Allow amd64 build to happen. Closes: #364956
 
diff --git a/debian/patches/00_cvs-sync.patch b/debian/patches/00_cvs-sync.patch
deleted file mode 100644 (file)
index d70967f..0000000
+++ /dev/null
@@ -1,41498 +0,0 @@
-Index: ChangeLog
-===================================================================
-RCS file: /cvsroot/grub/grub2/ChangeLog,v
-retrieving revision 1.225
-retrieving revision 1.279
-diff -u -r1.225 -r1.279
---- ChangeLog  10 Mar 2006 22:27:24 -0000      1.225
-+++ ChangeLog  4 Jun 2006 15:56:53 -0000       1.279
-@@ -1,3 +1,1713 @@
-+2006-06-04  Yoshinori K. Okuji  <okuji@enbug.org>
-+
-+      Clean up the code to support 64-bit addressing in disks and
-+      files. This change is not enough for filesystems yet.
-+      
-+      * util/i386/pc/grub-setup.c (struct boot_blocklist): Change the
-+      type of "start" to grub_uint64_t.
-+      (setup): Change the types of KERNEL_SECTOR and FIRST_SECTOR to
-+      grub_disk_addr_t * and grub_disk_addr_t. Fix the format string in
-+      save_first_sector and save_blocklists. Use grub_le_to_cpu64 to
-+      convert addresses.
-+
-+      * util/i386/pc/biosdisk.c (open_device): Change the type of SECTOR
-+      to grub_disk_addr_t.
-+
-+      * partmap/gpt.c (gpt_partition_map_iterate): Fix the format
-+      string.
-+
-+      * partmap/pc.c (pc_partition_map_iterate): Likewise.
-+
-+      * partmap/amiga.c (amiga_partition_map_iterate): Cast RDSK.MAGIC
-+      to char *.
-+
-+      * normal/script.c (grub_script_parse): Remove unused MEMFREE.
-+
-+      * normal/parser.y (YYLTYPE_IS_TRIVIAL): New macro.
-+
-+      * normal/lexer.c (grub_script_yyerror): Specify unused to LEX.
-+
-+      * loader/i386/pc/multiboot.c (grub_multiboot_load_elf64): Cast -1
-+      to grub_off_t, to detect an error from grub_file_seek.
-+      (grub_multiboot_load_elf32): Likewise.
-+
-+      * kern/misc.c (grub_strtoul): Use grub_strtoull. Return the
-+      maximum unsigned long value when an overflow is detected.
-+      (grub_strtoull): New function.
-+      (grub_divmod64): Likewise.
-+      (grub_lltoa): use grub_divmod64.
-+
-+      * kern/fs.c (struct grub_fs_block): Change the type of "offset" to
-+      grub_disk_addr_t.
-+      (grub_fs_blocklist_open): Increase P if P is not NULL to advance
-+      the pointer to next character. Use grub_strtoull instead of
-+      grub_strtoul.
-+      (grub_fs_blocklist_read): Change the types of SECTOR, OFFSET and
-+      SIZE to grub_disk_addr_t, grub_off_t and grub_size_t,
-+      respectively.
-+
-+      * kern/file.c (grub_file_read): Prevent an oveflow of LEN, as the
-+      return value is signed.
-+      (grub_file_seek): Change the type of OLD to grub_off_t. Do not
-+      test if OFFSET is less than zero, as OFFSET is unsigned now.
-+
-+      * kern/disk.c (struct grub_disk_cache): Change the type of
-+      "sector" to grub_disk_addr_t.
-+      (grub_disk_cache_get_index): Change the type of SECTOR to
-+      grub_disk_addr_t. Calculate the hash with SECTOR casted to
-+      unsigned after shifting.
-+      (grub_disk_cache_invalidate): Change the type of SECTOR to
-+      grub_disk_addr_t.
-+      (grub_disk_cache_unlock): Likewise.
-+      (grub_disk_cache_store): Likewise.
-+      (grub_disk_check_range): Change the types of SECTOR, OFFSET, SIZE,
-+      START and LEN to grub_disk_addr_t *, grub_off_t *, grub_size_t,
-+      grub_disk_addr_t and grub_uint64_t, respectively.
-+      (grub_disk_read): Use an unsigned variable REAL_OFFSET for the
-+      body, as the value of OFFSET is tweaked by
-+      grub_disk_check_range. Change the types of START_SECTOR, LEN and
-+      POS to grub_disk_addr_t, grub_size_t and grub_size_t,
-+      respectively.
-+      (grub_disk_write): Use an unsigned variable REAL_OFFSET for the
-+      body, as the value of OFFSET is tweaked by
-+      grub_disk_check_range. Change the types of LEN and N to
-+      grub_size_t.
-+
-+      * io/gzio.c (struct grub_gzio): Change the types of "data_offset"
-+      and "saved_offset" to grub_off_t.
-+      (test_header): Cast BUF to char *.
-+      (get_byte): Cast GZIO->DATA_OFFSET to grub_off_t. Cast GZIO->INBUF
-+      to char *.
-+      (grub_gzio_read): Change the types of OFFSET and SIZE to
-+      grub_off_t and grub_size_t, respectively.
-+
-+      * include/grub/i386/pc/boot.h (GRUB_BOOT_MACHINE_FORCE_LBA):
-+      Removed.
-+      (GRUB_BOOT_MACHINE_BOOT_DRIVE): Changed to 0x4c.
-+      (GRUB_BOOT_MACHINE_KERNEL_ADDRESS): Changed to 0x40.
-+      (GRUB_BOOT_MACHINE_KERNEL_SEGMENT): Changed to 0x42.
-+      (GRUB_BOOT_MACHINE_DRIVE_CHECK): Changed to 0x4e.
-+      (GRUB_BOOT_MACHINE_LIST_SIZE): Increased to 12.
-+
-+      * include/grub/types.h (grub_off_t): Unconditionally set to
-+      grub_uint64_t.
-+      (grub_disk_addr_t): Changed to grub_uint64_t.
-+
-+      * include/grub/partition.h (struct grub_partition): Change the
-+      types of "start", "len" and "offset" to grub_disk_addr_t,
-+      grub_uint64_t and grub_disk_addr_t, respectively.
-+      (grub_partition_get_start): Return grub_disk_addr_t.
-+      (grub_partition_get_len): Return grub_uint64_t.
-+
-+      * include/grub/misc.h (grub_strtoull): New prototype.
-+      (grub_divmod64): Likewise.
-+
-+      * include/grub/fshelp.h (grub_fshelp_read_file): Change the types
-+      of SECTOR, LEN and FILESIZE to grub_disk_addr_t, grub_size_t and
-+      grub_off_t, respectively.
-+      All callers and references changed.
-+
-+      * include/grub/fs.h (struct grub_fs): Change the type of LEN to
-+      grub_size_t in "read".
-+      All callers and references changed.
-+
-+      * include/grub/file.h (struct grub_file): Change the types of
-+      "offset" and "size" to grub_off_t and grub_off_t,
-+      respectively. Change the type of SECTOR to grub_disk_addr_t in
-+      "read_hook".
-+      (grub_file_read): Change the type of LEN to grub_size_t.
-+      (grub_file_seek): Return grub_off_t. Change the type of OFFSET to
-+      grub_off_t.
-+      (grub_file_size): Return grub_off_t.
-+      (grub_file_tell): Likewise.
-+      All callers and references changed.
-+
-+      * include/grub/disk.h (struct grub_disk_dev): Change the types of
-+      SECTOR and SIZE to grub_disk_addr_t and grub_size_t in "read" and
-+      "write".
-+      (struct grub_disk): Change the type of "total_sectors" to
-+      grub_uint64_t. Change the type of SECTOR to grub_disk_addr_t in
-+      "read_hook". 
-+      (grub_disk_read): Change the types of SECTOR, OFFSET and SIZE to
-+      grub_disk_addr_t, grub_off_t and grub_size_t, respectively.
-+      (grub_disk_write): Likewise.
-+      All callers and references changed.
-+
-+      * fs/iso9660.c (grub_iso9660_susp_iterate): Cast parameters to
-+      char * for grub_strncmp to silence gcc.
-+      (grub_iso9660_mount): Likewise.
-+      (grub_iso9660_mount): Likewise.
-+      (grub_iso9660_read_symlink): Likewise. Also, remove the nonsense
-+      return statement.
-+      (grub_iso9660_iterate_dir): Likewise.
-+      (grub_iso9660_label): Cast DATA->VOLDESC.VOLNAME to char *.
-+
-+      * fs/hfs.c (grub_hfs_read_file): Change the types of SECTOR and
-+      LEN to grub_disk_addr_t and grub_size_t, respectively.
-+
-+      * fs/hfsplus.c (grub_hfsplus_read_file): Likewise.
-+
-+      * fs/jfs.c (grub_jfs_read_file): Likewise.
-+
-+      * fs/minix.c (grub_jfs_read_file): Likewise.
-+
-+      * fs/sfs.c (grub_jfs_read_file): Likewise.
-+
-+      * fs/ufs.c (grub_jfs_read_file): Likewise.
-+
-+      * fs/xfs.c (grub_jfs_read_file): Likewise.
-+
-+      * fs/fat.c (grub_fat_read_data): Change the types of SECTOR, LEN
-+      and SIZE to grub_disk_addr_t, grub_size_t and grub_size_t,
-+      respectively.
-+
-+      * fs/ext2.c (grub_ext2_read_block): When an error happens, set
-+      BLKNR to -1 instead of returning GRUB_ERRNO.
-+      (grub_ext2_read_file): Change the types of SECTOR and
-+      LEN to grub_disk_addr_t and grub_size_t, respectively.
-+
-+      * fs/affs.c (grub_affs_read_file): Change the types of SECTOR and
-+      LEN to grub_disk_addr_t and grub_size_t, respectively.
-+
-+      * font/manager.c (grub_font_get_glyph): Cast BITMAP to char * for
-+      grub_file_read.
-+
-+      * disk/ieee1275/ofdisk.c (grub_ofdisk_read): Fix the format
-+      string. Do not cast SECTOR explicitly.
-+
-+      * disk/i386/pc/biosdisk.c (grub_biosdisk_open): Change the type of
-+      TOTAL_SECTORS to grub_uint64_t. Do not mask DRP->TOTAL_SECTORS.
-+      (grub_biosdisk_rw): Change the types of SECTOR and SIZE to
-+      grub_disk_addr_t and grub_size_t, respectively. If the sector is
-+      over 2TB and LBA mode is not supported, raise an error.
-+      (get_safe_sectors): New function.
-+      (grub_biosdisk_read): Use get_safe_sectors.
-+      (grub_biosdisk_write): Likewise.
-+
-+      * disk/efi/efidisk.c (grub_efidisk_read): Fix the format string.
-+      (grub_efidisk_write): Likewise.
-+
-+      * disk/loopback.c (delete_loopback): Cosmetic changes.
-+      (grub_cmd_loopback): Likewise. Also, test NEWDEV->FILENAME
-+      correctly.
-+      (grub_loopback_open): Likewise.
-+      (grub_loopback_read): Likewise. Also, change the type of POS to
-+      grub_off_t, and fix the usage of grub_memset.
-+
-+      * commands/i386/pc/play.c: Include grub/machine/time.h.
-+
-+      * commands/ls.c (grub_ls_list_files): Use "llu" instead of "d" to
-+      print FILE->SIZE.
-+
-+      * commands/configfile.c: Include grub/env.h.
-+
-+      * commands/cmp.c (grub_cmd_cmp): Do not use ERR, but use
-+      GRUB_ERRNO directly instead. Change the type of POS to
-+      grub_off_t. Follow the coding standard.
-+
-+      * commands/blocklist.c: Include grub/partition.h.
-+      (grub_cmd_blocklist): Return an error if the underlying device is
-+      not a disk. Take the starting sector of a partition into account,
-+      if a partition is used.
-+
-+      * boot/i386/pc/diskboot.S (bootloop): Adapted to the new offset of
-+      a length field.
-+      (lba_mode): Support 64-bit addresses.
-+      (chs_mode): Likewise.
-+      (copy_buffer): Adapted to the new offsets of a length field and a
-+      segment field.
-+      (blocklist_default_start): Allocate 64-bit space.
-+
-+      * boot/i386/pc/boot.S (force_lba): Removed.
-+      (boot_drive): Moved to under KERNEL_SECTOR.
-+      (kernel_sector): Moved to under KENREL_SEGMENT. Allocate 64-bit
-+      space.
-+      (real_start): Set %si earlier. Remove code for FORCE_LBA, since it
-+      is useless.
-+      (lba_mode): Refactored to support a 64-bit address. More size
-+      optimization.
-+      (setup_sectors): Likewise.
-+
-+2006-06-04  Yoshinori K. Okuji  <okuji@enbug.org>
-+
-+      * DISTLIST: Added include/grub/i386/linux.h. Removed
-+      include/grub/i386/pc/linux.h
-+
-+      * configure.ac (AC_INIT): Bumped to 1.94.
-+
-+      * config.guess: Updated from gnulib.
-+      * config.sub: Likewise.
-+      * install-sh: Likewise.
-+      * mkinstalldirs: Likewise.
-+
-+2006-06-02  Yoshinori K. Okuji  <okuji@enbug.org>
-+
-+      * conf/common.rmk (grub_modules_init.lst): Depended on
-+      grub_emu_SOURCES, excluding grub_emu_init.c, instead of
-+      MODSRCFILES.
-+
-+      * genmk.rb (PModule::rule): Reverted the previous change.
-+
-+2006-06-02  Yoshinori K. Okuji  <okuji@enbug.org>
-+
-+      * conf/common.rmk (grub_modules_init.lst): Depends on
-+      $(MODSRCFILES). Grep only the files in $(MODSRCFILES). Make sure
-+      that the target does not exist before producing.
-+      (grub_modules_init.h): Remove the target before generating.
-+      (grub_emu_init.c): Likewise.
-+
-+      * genmk.rb (PModule::rule): Add source files into MODSRCFILES.
-+
-+2006-05-31  Jeroen Dekkers  <jeroen@dekkers.cx>
-+
-+      * configure.ac: Don't set host_m32 for x86_64. Also reset LIBS
-+      for the target-specific tests. Make sure that we also have the
-+      up-to-date target variables for those tests.
-+
-+2006-05-31  Yoshinori K. Okuji  <okuji@enbug.org>
-+
-+      * genmk.rb (Image::rule): Prefix CFLAGS or ASFLAGS with TARGET_.
-+      (PModule::rule): Likewise.
-+
-+2006-05-31  Yoshinori K. Okuji  <okuji@enbug.org>
-+
-+      * genmk.rb (Image::rule): Set FLAG to CFLAGS or ASFLAGS instead of
-+      TARGET_CFLAGS or TARGET_ASFLAGS. There is no reason why
-+      target-specific flags should be prefixed.
-+      (PModule::rule): Likewise.
-+
-+2006-05-30  Yoshinori K. Okuji  <okuji@enbug.org>
-+
-+      * configure.ac (CMP): Check if cmp is available explicitly.
-+
-+2006-05-29  Yoshinori K. Okuji  <okuji@enbug.org>
-+
-+      * util/powerpc/ieee1275/grub-install.in (host_cpu): Removed.
-+      (target_cpu): New variable.
-+      (pkglibdir): Use target_cpu instead of host_cpu.
-+      
-+      * util/i386/pc/grub-install.in (host_cpu): Removed.
-+      (target_cpu): New variable.
-+      (pkglibdir): Use target_cpu instead of host_cpu.
-+
-+      * util/genmoddep.c: Removed.
-+      
-+      * kern/efi/mm.c (filter_memory_map): Use GRUB_CPU_SIZEOF_VOID_P
-+      instead of GRUB_HOST_SIZEOF_VOID_P.
-+      * kern/dl.c: Likewise.
-+
-+      * include/grub/i386/types.h (GRUB_HOST_SIZEOF_VOID_P): Renamed to
-+      ...
-+      (GRUB_TARGET_SIZEOF_VOID_P): ... this.
-+      (GRUB_HOST_SIZEOF_LONG): Renamed to ...
-+      (GRUB_TARGET_SIZEOF_LONG): ... this.
-+      (GRUB_HOST_WORDS_BIGENDIAN): Renamed to ...
-+      (GRUB_TARGET_WORDS_BIGENDIAN): ... this.
-+      * include/grub/powerpc/types.h (GRUB_HOST_SIZEOF_VOID_P): Renamed
-+      to ...
-+      (GRUB_TARGET_SIZEOF_VOID_P): ... this.
-+      (GRUB_HOST_SIZEOF_LONG): Renamed to ...
-+      (GRUB_TARGET_SIZEOF_LONG): ... this.
-+      (GRUB_HOST_WORDS_BIGENDIAN): Renamed to ...
-+      (GRUB_TARGET_WORDS_BIGENDIAN): ... this.
-+      * include/grub/sparc64/types.h (GRUB_HOST_SIZEOF_VOID_P): Renamed
-+      to ...
-+      (GRUB_TARGET_SIZEOF_VOID_P): ... this.
-+      (GRUB_HOST_SIZEOF_LONG): Renamed to ...
-+      (GRUB_TARGET_SIZEOF_LONG): ... this.
-+      (GRUB_HOST_WORDS_BIGENDIAN): Renamed to ...
-+      (GRUB_TARGET_WORDS_BIGENDIAN): ... this.
-+
-+      * include/grub/types.h [!GRUB_UTIL] (GRUB_CPU_SIZEOF_VOID_P): Use
-+      GRUB_TARGET_SIZEOF_VOID_P instead of GRUB_HOST_SIZEOF_VOID_P.
-+      [!GRUB_UTIL] (GRUB_CPU_SIZEOF_LONG): Use GRUB_TARGET_SIZEOF_LONG
-+      instead of GRUB_HOST_SIZEOF_LONG.
-+      [!GRUB_UTIL]: Refer to GRUB_TARGET_WORDS_BIGENDIAN instead of
-+      GRUB_HOST_WORDS_BIGENDIAN to define or undefine
-+      GRUB_CPU_WORDS_BIGENDIAN.
-+      Refer to SIZEOF_VOID_P instead of GRUB_HOST_SIZEOF_VOID_P to
-+      define grub_host_addr_t, grub_host_off_t, grub_host_size_t and
-+      grub_host_ssize_t.
-+
-+      * conf/i386-efi.rmk (noinst_UTILITIES): Removed.
-+      (genmoddep_SOURCES): Likewise.
-+      * conf/i386-pc.rmk (noinst_UTILITIES): Likewise.
-+      (genmoddep_SOURCES): Likewise.
-+      * conf/conf/powerpc-ieee1275.rmk (noinst_UTILITIES): Likewise.
-+      (genmoddep_SOURCES): Likewise.
-+      * conf/conf/conf/sparc64-ieee1275.rmk (noinst_UTILITIES):
-+      Likewise.
-+      (genmoddep_SOURCES): Likewise.
-+
-+      * genmoddep.awk: New file.
-+
-+      * genmk.rb (Image::rule): Use TARGET_CC, TARGET_CPPFLAGS,
-+      TARGET_CFLAGS, TARGET_ASFLAGS and TARGET_LDFLAGS instead of CC,
-+      CPPFLAGS, CFLAGS, ASFLAGS and LDFLAGS, respectively.
-+      (PModule::rule): Likewise.
-+      (Program::rule): Likewise.
-+      (Utility::rule): Use CC, CPPFLAGS, CFLAGS and LDFLAGS instead of
-+      BUILD_CC, BUILD_CPPFLAGS, BUILD_CFLAGS and BUILD_LDFLAGS,
-+      respectively.
-+
-+      * configure.ac: Rewritten intensively to use host and target
-+      instead of build and host, respectively.
-+
-+      * Makefile.in (pkglibdir): Use target_cpu instead of host_cpu.
-+      (host_cpu): Removed.
-+      (target_cpu): New variable.
-+      (CPPFLAGS): Added @CPPFLAGS@ and -DGRUB_LIBDIR=\"$(pkglibdir)\".
-+      (BUILD_CC): Removed.
-+      (BUILD_CFLAGS): Likewise.
-+      (BUILD_CPPFLAGS): Likewise.
-+      (TARGET_CC): New variable.
-+      (TARGET_CFLAGS): Likewise.
-+      (TARGET_CPPFLAGS): Likewise.
-+      (TARGET_LDFLAGS): Likewise.
-+      (AWK): Likewise.
-+      (include): Use target_cpu instead of host_cpu.
-+      (moddep.lst:): Use genmoddep.awk instead of genmoddep.
-+      
-+      * DISTLIST: Added genmoddep.awk. Removed util/genmoddep.c.
-+
-+2006-05-29  Vesa Jaaskelainen  <chaac@nic.fi>
-+
-+      * include/grub/script.h (grub_script_cmdif): Renamed field 'bool' to
-+      'exec_to_evaluate'.  Renamed field 'true' to 'exec_on_true'.  Renamed
-+      field 'false' to 'exec_on_false'.
-+      (grub_script_create_cmdif): Renamed argument names to reflect above
-+      changes.
-+
-+      * normal/execute.c (grub_script_execute_cmdif): Likewise.
-+
-+      * normal/script.c (grub_script_create_cmdif): Likewise.
-+
-+2006-05-28  Yoshinori K. Okuji  <okuji@enbug.org>
-+
-+      * fs/hfsplus.c (grub_hfsplus_btree_recoffset): Moved to near the
-+      top.
-+      (grub_hfsplus_btree_recptr): Likewise.
-+      (grub_hfsplus_find_block): Do not take RETRY any longer. Use
-+      FILEBLOCK both to pass a block number and store next block
-+      number.
-+      (grub_hfsplus_read_block): Rewritten heavily to support an extent
-+      overflow file correctly. Specify errors appropriately, because
-+      fshelp expects that GRUB_ERRNO is set when fails. Reuse
-+      grub_hfsplus_btree_recptr to get the pointer to a found key.
-+      (grub_hfsplus_btree_search): Return 1 instead of 0 when no match
-+      is found.
-+
-+      * conf/i386-efi.rmk (pkgdata_MODULES): Added _linux.mod and
-+      linux.mod.
-+      (_linux_mod_SOURCES): New variable.
-+      (_linux_mod_CFLAGS): Likewise.
-+      (_linux_mod_LDFLAGS): Likewise.
-+      (linux_mod_SOURCES): Likewise.
-+      (linux_mod_CFLAGS): Likewise.
-+      (linux_mod_LDFLAGS): Likewise.
-+
-+      * DISTLIST: Added loader/i386/efi/linux.c,
-+      loader/i386/efi/linux_normal.c and
-+      include/grub/i386/efi/loader.h.
-+
-+      * loader/i386/efi/linux.c: New file.
-+      * loader/i386/efi/linux_normal.c: Likewise.
-+      * include/grub/i386/efi/loader.h: Likewise.
-+
-+2006-05-27  Yoshinori K. Okuji  <okuji@enbug.org>
-+
-+      * commands/blocklist.c: New file.
-+
-+      * DISTLIST: Added commands/blocklist.c.
-+
-+      * term/efi/console.c (grub_console_highlight_color): Use a lighter
-+      color for the background, and a darker color for the foreground.
-+      (grub_console_checkkey): Return READ_KEY.
-+      (grub_console_cls): Set the background to
-+      GRUB_EFI_BACKGROUND_BLACK temporarily to clean out the screen.
-+
-+      * kern/efi/efi.c (grub_efi_exit_boot_services): New function.
-+
-+      * include/grub/i386/linux.h (struct linux_kernel_params): Fixed
-+      the size of "padding5", "hd0_drive_info" and "hd1_drive_info".
-+
-+      * include/grub/efi/efi.h (grub_efi_exit_boot_services): New
-+      prototype.
-+
-+      * include/grub/efi/api.h (GRUB_EFI_TEXT_ATTR): Do not shift
-+      BG. The spec is wrong again.
-+
-+      * include/grub/normal.h [GRUB_UTIL] (grub_blocklist_init): New
-+      prototype.
-+      [GRUB_UTIL] (grub_blocklist_fini): Likewise.
-+
-+      * conf/i386-pc.rmk (grub_emu_SOURCES): Added
-+      commands/blocklist.c.
-+      * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Likewise.
-+      
-+      * conf/common.rmk (pkgdata_MODULES): Added blocklist.mod.
-+      (blocklist_mod_SOURCES): New variable.
-+      (blocklist_mod_CFLAGS): Likewise.
-+      (blocklist_mod_LDFLAGS): Likewise.
-+
-+2006-05-20  Yoshinori K. Okuji  <okuji@enbug.org>
-+
-+      * boot/i386/pc/boot.S (real_start): Set %si earlier to eliminate
-+      duplication.
-+      (lba_mode): Use %eax more intensively to reduce the code size.
-+
-+2006-05-20  Marco Gerards  <marco@gnu.org>
-+
-+      * normal/lexer.c (grub_script_yylex): Don't filter out newlines.
-+
-+      * normal/parser.y (commandblock): Defined as <cmd>.  A subroutine
-+      for `menuentry'.
-+      (script): Accept leading newlines.
-+      (newlines): New rule to describe 0 or more newlines.
-+      (commands): Accept `command' with trailing newline.  Fixed the
-+      order in which arguments were passed to `grub_script_add_cmd'.
-+      Accept commands separated by newlines.
-+      (function): Changed to accept newlines.
-+      (menuentry) Rewritten.
-+
-+      * normal/script.c (grub_script_create_cmdmenu): Add new entries in
-+      front of the list, instead of to the end.
-+
-+2006-05-19  Yoshinori K. Okuji  <okuji@enbug.org>
-+
-+      * util/i386/pc/grub-install.in (bindir): New variable.
-+      (grub_mkimage): Use BINDIR instead of SBINDIR. Reported by Lee
-+      Shaver <lbgwjl@gmail.com>.
-+
-+2006-05-14  Yoshinori K. Okuji  <okuji@enbug.org>
-+
-+      * kern/i386/pc/startup.S: Include grub/cpu/linux.h instead of
-+      grub/machine/linux.h
-+      * loader/i386/pc/linux.c: Likewise.
-+
-+      * include/grub/i386/pc/linux.h: Moved to ...
-+      * include/grub/i386/linux.h: ... here.
-+
-+      * include/grub/i386/linux.h (struct linux_kernel_params): New
-+      struct.
-+      
-+2006-05-09  Vesa Jaaskelainen  <chaac@nic.fi>
-+
-+      * video/i386/pc/vbe.c (grub_video_vbe_fill_rect): Corrected bounds
-+      checking.
-+      (grub_video_vbe_blit_glyph): Likewise.
-+      (grub_video_vbe_blit_bitmap): Likewise.
-+      (grub_video_vbe_blit_render_target): Likewise.
-+
-+2006-05-09  Yoshinori K. Okuji  <okuji@enbug.org>
-+
-+      * configure.ac (--with-platform): Properly quote the square
-+      brackets.
-+
-+2006-05-08  Marco Gerards  <marco@gnu.org>
-+
-+      * conf/powerpc-ieee1275.rmk (grubof_HEADERS): Renamed from
-+      this...
-+      (kernel_elf_HEADERS): ...to this.  Updated all users.
-+      (grubof_symlist.c): Renamed from this...
-+      (kernel_elf_symlist.c): ...to this.  Updated all users.
-+      (pkgdata_PROGRAMS): Changed `grubof' to `kernel.elf'.
-+      (grubof_SOURCES): Renamed from this...
-+      (kernel_elf_SOURCES): ...to this.
-+      (grubof_HEADERS): Renamed from this...
-+      (kernel_elf_HEADERS): ...to this.
-+      (grubof_CFLAGS): Renamed from this...
-+      (kernel_elf_CFLAGS): ...to this.
-+      (grubof_ASFLAGS): Renamed from this...
-+      (kernel_elf_ASFLAGS): ...to this.
-+      (grubof_LDFLAGS): Renamed from this...
-+      (kernel_elf_LDFLAGS): ...to this.
-+
-+      * conf/sparc64-ieee1275.rmk (grubof_HEADERS): Renamed from
-+      this...
-+      (kernel_elf_HEADERS): ...to this.  Updated all users.
-+      (grubof_symlist.c): Renamed from this...
-+      (kernel_elf_symlist.c): ...to this.  Updated all users.
-+      (pkgdata_PROGRAMS): Changed `grubof' to `kernel.elf'.
-+      (grubof_SOURCES): Renamed from this...
-+      (kernel_elf_SOURCES): ...to this.
-+      (grubof_HEADERS): Renamed from this...
-+      (kernel_elf_HEADERS): ...to this.
-+      (grubof_CFLAGS): Renamed from this...
-+      (kernel_elf_CFLAGS): ...to this.
-+      (grubof_ASFLAGS): Renamed from this...
-+      (kernel_elf_ASFLAGS): ...to this.
-+      (grubof_LDFLAGS): Renamed from this...
-+      (kernel_elf_LDFLAGS): ...to this.
-+
-+      * util/powerpc/ieee1275/grub-mkimage.c (add_segments): Use
-+      `kernel.elf' instead of `grubof'.
-+
-+2006-05-08  Yoshinori K. Okuji  <okuji@enbug.org>
-+
-+      Add --with-platform to configure. Use pkglibdir instead of
-+      pkgdatadir. This is reported by Roger Leigh.
-+
-+      * util/powerpc/ieee1275/grub-install.in (datadir): Removed.
-+      (host_vendor): Likewise.
-+      (host_os): Likewise.
-+      (pkgdatadir): Likewise.
-+      (platform): New variable.
-+      (pkglibdir): Likewise.
-+      Use PKGLIBDIR instead of PKGDATADIR.
-+      
-+      * util/i386/pc/grub-install.in (datadir): Removed.
-+      (host_vendor): Likewise.
-+      (host_os): Likewise.
-+      (pkgdatadir): Likewise.
-+      (platform): New variable.
-+      (pkglibdir): Likewise.
-+      Use PKGLIBDIR instead of PKGDATADIR.
-+
-+      * util/powerpc/ieee1275/grub-mkimage.c (usage): Use GRUB_LIBDIR
-+      instead of GRUB_DATADIR.
-+      (main): Likewise.
-+      * util/i386/pc/grub-mkimage.c (usage): Likewise.
-+      (main): Likewise.
-+      * util/i386/efi/grub-mkimage.c (usage): Likewise.
-+      (main): Likewise.
-+
-+      * configure.ac (--with-platform): New option.
-+      Use PLATFORM instead of HOST_VENDOR to specify a platform.
-+
-+      * Makefile.in: Include a makefile based on PLATFORM instead of
-+      HOST_VENDOR.
-+      (pkgdatadir): Not appended by the machine type.
-+      (pkglibdir): Appended by the machine type.
-+      (host_vendor): Removed.
-+      (platform): New variable.
-+      (BUILD_CPPFLAGS): Specify GRUB_LIBDIR instead of GRUB_DATADIR.
-+      (install-local): Use PKGLIBDIR instead of PKGDATADIR.
-+      (uninstall): Likewise.
-+
-+2006-05-07  Yoshinori K. Okuji  <okuji@enbug.org>
-+
-+      Use the environment context in the menu. Remove the commands
-+      "default" and "timeout", and use variables instead.
-+      
-+      * normal/menu.c: Include grub/env.h.
-+      (print_entry): Cast TITLE to silence gcc.
-+      (get_timeout): New function.
-+      (set_timeout): Likewise.
-+      (get_entry_number): Likewise.
-+      (run_menu): Use a default entry, a fallback entry and a timeout
-+      in the environment variables "default", "fallback" and
-+      "timeout". Also, tweak the default entry if it is not within the
-+      current menu entries.
-+      (grub_menu_run): Use a fallback entry in the environment variable
-+      "fallback".
-+
-+      * normal/main.c (read_config_file): Do not initialize
-+      NEWMENU->DEFAULT_ENTRY, NEWMENU->FALLBACK_ENTRY or
-+      NEWMENU->TIMEOUT.
-+      (grub_normal_execute): Use a data slot to store the menu.
-+
-+      * include/grub/normal.h (struct grub_menu): Removed default_entry,
-+      fallback_entry and timeout.
-+      (struct grub_menu_list): Removed.
-+      (grub_menu_list_t): Likewise.
-+      (struct grub_context): Likewise.
-+      (grub_context_t): Likewise.
-+      (grub_context_get): Likewise.
-+      (grub_context_get_current_menu): Likewise.
-+      (grub_context_push_menu): Likewise.
-+      (grub_context_pop_menu): Likewise.
-+      (grub_default_init): Likewise.
-+      (grub_default_fini): Likewise.
-+      (grub_timeout_init): Likewise.
-+      (grub_timeout_fini): Likewise.
-+
-+      * conf/sparc64-ieee1275.rmk (pkgdata_MODULES): Removed default.mod
-+      and timeout.mod.
-+      (normal_mod_SOURCES): Removed normal/context.c.
-+
-+      * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Removed
-+      commands/default.c, commands/timeout.c and normal/context.c.
-+      (normal_mod_SOURCES): Removed normal/context.c.
-+
-+      * conf/i386-pc.rmk (grub_emu_SOURCES): Removed commands/default.c,
-+      commands/timeout.c and normal/context.c.
-+      (normal_mod_SOURCES): Removed normal/context.c.
-+
-+      * conf/i386-efi.rmk (grub_emu_SOURCES): Removed
-+      commands/default.c, commands/timeout.c and normal/context.c.
-+      (normal_mod_SOURCES): Removed normal/context.c.
-+
-+      * conf/common.rmk (pkgdata_MODULES): Removed default.mod and
-+      timeout.mod.
-+      (default_mod_SOURCES): Removed.
-+      (default_mod_CFLAGS): Likewise.
-+      (default_mod_LDFLAGS): Likewise.
-+      (timeout_mod_SOURCES): Removed.
-+      (timeout_mod_CFLAGS): Likewise.
-+      (timeout_mod_LDFLAGS): Likewise.
-+
-+      * DISTLIST: Removed commands/default.c, commands/timeout.c and
-+      normal/context.c.
-+
-+      * commands/default.c: Removed.
-+      * commands/timeout.c: Likewise.
-+      * normal/context.c: Likewise.
-+
-+2006-05-07  Vesa Jaaskelainen  <chaac@nic.fi>
-+
-+      * kern/i386/pc/startup.S (grub_exit): Added missing .code32 tag.
-+
-+2006-05-02  Yoshinori K. Okuji  <okuji@enbug.org>
-+
-+      * kern/env.c (struct grub_env_context): Removed "sorted". Renamed
-+      "next" to "prev" for readability.
-+      (struct grub_env_sorted_var): New struct.
-+      (grub_env_context): Renamed to ...
-+      (initial_context): ... this.
-+      (grub_env_var_context): Renamed to ...
-+      (current_context): ... this.
-+      (grub_env_find): Look only at CURRENT_CONTEXT.
-+      (grub_env_context_open): Rewritten to copy exported variables from
-+      previous context.
-+      (grub_env_context_close): Rewritten according to the new
-+      scheme. Also, add an assertion to prevent the initial context from
-+      removed.
-+      (grub_env_insert): Removed the code for the sorted list.
-+      (grub_env_remove): Likewise.
-+      (grub_env_export): Simply mark the variable with
-+      GRUB_ENV_VAR_GLOBAL.
-+      (grub_env_set): A cosmetic change for naming consistency.
-+      (grub_env_get): Likewise.
-+      (grub_env_unset): Likewise.
-+      (grub_env_iterate): Rewritten to sort variables within this
-+      function.
-+      (grub_register_variable_hook): Fixed for naming consistency. Call
-+      grub_env_find again, only if NAME is not found at the first time.
-+      (mangle_data_slot_name): New function.
-+      (grub_env_set_data_slot): Likewise.
-+      (grub_env_get_data_slot): Likewise.
-+      (grub_env_unset_data_slot): Likewise.
-+
-+      * include/grub/env.h (grub_env_var_type): New enum.
-+      (GRUB_ENV_VAR_LOCAL): New constant.
-+      (GRUB_ENV_VAR_GLOBAL): Likewise.
-+      (GRUB_ENV_VAR_DATA): Likewise.
-+      (struct grub_env_var): Removed "sort_next" and "sort_prevp". Added
-+      "type".
-+      (grub_env_set): Replace VAR with NAME for consistency.
-+      (grub_register_variable_hook): Likewise.
-+      (grub_env_export): Specify the name of the argument.
-+      (grub_env_set_data_slot): New prototype.
-+      (grub_env_get_data_slot): Likewise.
-+      (grub_env_unset_data_slot): Likewise.
-+
-+2006-04-30  Yoshinori K. Okuji  <okuji@enbug.org>
-+
-+      Extend the loader so that GRUB can accept a loader which comes
-+      back to GRUB when a loaded image exits. Also, this change adds
-+      support for a chainloader on EFI.
-+      
-+      * term/efi/console.c: Include grub/misc.h.
-+      (grub_console_checkkey): Display a scan code on the top for
-+      debugging. This will be removed once the EFI port gets stable.
-+      Correct the scan code mapping.
-+
-+      * kern/efi/mm.c (sort_memory_map): Sort in a descending order to
-+      allocate memory from larger regions, in order to reduce the number
-+      of allocated regions. Otherwise, the MacOSX loader panics.
-+      (filter_memory_map): Avoid less than 1MB for compatibility with
-+      other loaders.
-+      (add_memory_regions): Allocate from the tail of a region, if
-+      possible, to avoid allocating a region near to 1MB, for the MacOSX
-+      loader.
-+
-+      * kern/efi/init.c (grub_efi_set_prefix): Specify
-+      GRUB_EFI_IMAGE_HANDLE to grub_efi_get_loaded_image.
-+
-+      * kern/efi/efi.c (grub_efi_get_loaded_image): Accept a new
-+      argument IMAGE_HANDLE and specify it to get a loaded image.
-+      (grub_arch_modules_addr): Specify GRUB_EFI_IMAGE_HANDLE to
-+      grub_efi_get_loaded_image.
-+      (grub_efi_get_filename): Divide the legnth by the size of
-+      grub_efi_char16_t.
-+      (grub_efi_get_device_path): New function.
-+      (grub_efi_print_device_path): Print End Device Path nodes. Divide
-+      the length by the size of grub_efi_char16_t for a file path device
-+      path node.
-+
-+      * kern/loader.c (grub_loader_noreturn): New variable.
-+      (grub_loader_set): Accept a new argument NORETURN. Set
-+      GRUB_LOADER_NORETURN to NORETURN.
-+      All callers changed.
-+      (grub_loader_boot): If GRUB_LOADER_NORETURN is false, do not call
-+      grub_machine_fini.
-+
-+      * include/grub/efi/efi.h (grub_efi_get_device_path): New
-+      prototype.
-+      (grub_efi_get_loaded_image): Take an argument to specify an image
-+      handle.
-+
-+      * include/grub/loader.h (grub_loader_set): Added one more argument
-+      NORETURN.
-+
-+      * disk/efi/efidisk.c (make_devices): Use grub_efi_get_device_path
-+      instead of grub_efi_open_protocol.
-+      (grub_efidisk_get_device_name): Likewise.
-+      (grub_efidisk_close): Print a newline.
-+      (grub_efidisk_get_device_handle): Fixed to use
-+      GRUB_EFI_DEVICE_PATH_SUBTYPE instead of
-+      GRUB_EFI_DEVICE_PATH_TYPE.
-+
-+      * disk/efi/efidisk.c (device_path_guid): Moved to ...
-+      * kern/efi/efi.c (device_path_guid): ... here.
-+
-+      * conf/i386-efi.rmk (pkgdata_MODULES): Added _chain.mod and
-+      chain.mod.
-+      (kernel_mod_HEADERS): Added efi/disk.h.
-+      (_chain_mod_SOURCES): New variable.
-+      (_chain_mod_CFLAGS): Likewise.
-+      (_chain_mod_LDFLAGS): Likewise.
-+      (chain_mod_SOURCES): Likewise.
-+      (chain_mod_CFLAGS): Likewise.
-+      (chain_mod_LDFLAGS): Likewise.
-+
-+      * DISTLIST: Added include/grub/efi/chainloader.h,
-+      loader/efi/chainloader.c and loader/efi/chainloader_normal.c.
-+
-+      * include/grub/efi/chainloader.h: New file.
-+      * loader/efi/chainloader.c: Likewise.
-+      * loader/efi/chainloader_normal.c: Likewise.
-+
-+2006-04-30  Marco Gerards  <marco@gnu.org>
-+
-+      * commands/configfile.c (grub_cmd_source): New function.
-+      (GRUB_MOD_INIT): Register the commands `source' and `.'.
-+      (GRUB_MOD_FINI): De-register the commands `source' and `.'.
-+
-+2006-04-30  Marco Gerards  <marco@gnu.org>
-+
-+      * normal/execute.c (grub_script_execute_cmd): Change the return
-+      type to `grub_err_t'.  Correctly return the error.
-+      (grub_script_execute_cmdline): In case a command line is not a
-+      command or a function, try to interpret it as an assignment.
-+
-+2006-04-30  Yoshinori K. Okuji  <okuji@enbug.org>
-+
-+      * fs/hfsplus.c (grub_hfsplus_read_block): Fixed a memory leak.
-+      (grub_hfsplus_iterate_dir): Reordered to skip unknown nodes. Also,
-+      skip a node whose name is obviously invalid as UTF-16,
-+      i.e. contains a NUL character. Stop the iteration when the last
-+      directory entry is found. Instead of using the return value of
-+      grub_hfsplus_btree_iterate_node, store the value in RET and use
-+      it, because the iterator can be stopped by the last directory
-+      entry.
-+
-+2006-04-30  Marco Gerards  <marco@gnu.org>
-+
-+      * include/grub/env.h (grub_env_export): New prototype.  Reported
-+      by Jan C. Kleinsorge <jan.kleinsorge@udo.edu>.
-+
-+2006-04-30  Marco Gerards  <marco@gnu.org>
-+
-+      * fs/hfsplus.c (grub_hfsplus_iterate_dir): Correctly calculate the
-+      size of the extents in a catalog file record.
-+
-+2006-04-29  Marco Gerards  <marco@gnu.org>
-+
-+      * commands/configfile.c (grub_cmd_configfile): Execute the
-+      configfile within its own context.
-+
-+      * include/grub/env.h (grub_env_context_open): New prototype.
-+      (grub_env_context_close): Likewise.
-+
-+      * kern/env.c (grub_env): Removed.
-+      (grub_env_sorted): Likewise.
-+      (grub_env_context): New variable.
-+      (grub_env_var_context): Likewise.
-+      (grub_env_find): Search both the active context and the global
-+      context.
-+      (grub_env_context_open): New function.
-+      (grub_env_context_close): Likewise.
-+      (grub_env_insert): Likewise.
-+      (grub_env_remove): Likewise.
-+      (grub_env_export): Likewise.
-+      (grub_env_set): Changed to use helper functions to avoid code
-+      duplication.
-+      (grub_env_iterate): Rewritten so both the current context and the
-+      global context are being used.
-+
-+      * normal/command.c (export_command): New function.
-+      (grub_command_init): Register the `export' function.
-+
-+2006-04-26  Yoshinori K. Okuji  <okuji@enbug.org>
-+
-+      * util/i386/pc/grub-mkimage.c (compress_kernel): Cast arguments
-+      explicitly to suppress gcc's warnings.
-+      * fs/fat.c (grub_fat_find_dir): Likewise.
-+      (grub_fat_label): Likewise.
-+      * fs/xfs.c (grub_xfs_read_inode): Likewise.
-+      (grub_xfs_mount): Likewise.
-+      (grub_xfs_label): Likewise.
-+      * fs/affs.c (grub_affs_mount): Likewise.
-+      (grub_affs_label): Likewise.
-+      (grub_affs_iterate_dir): Likewise.
-+      * fs/sfs.c (grub_sfs_mount): Likewise.
-+      (grub_sfs_iterate_dir): Likewise.
-+      * fs/ufs.c (grub_ufs_lookup_symlink): Likewise.
-+      * fs/hfs.c (grub_hfs_mount): Likewise.
-+      (grub_hfs_cmp_catkeys): Likewise.
-+      (grub_hfs_find_dir): Likewise.
-+      (grub_hfs_dir): Likewise.
-+      (grub_hfs_label): Likewise.
-+      * fs/jfs.c (grub_jfs_mount): Likewise.
-+      (grub_jfs_opendir): Likewise.
-+      (grub_jfs_getent): Likewise.
-+      (grub_jfs_lookup_symlink): Likewise.
-+      (grub_jfs_label): Likewise.
-+      * fs/hfsplus.c (grub_hfsplus_cmp_catkey): Likewise.
-+      (grub_hfsplus_iterate_dir): Likewise.
-+      (grub_hfsplus_btree_iterate_node): Made static.
-+
-+      * util/grub-emu.c (prefix): New variable.
-+      (grub_machine_set_prefix): New function.
-+      (main): Do not set the environment variable "prefix" here. Only
-+      set PREFIX, which is used later by grub_machine_set_prefix.
-+
-+      * include/grub/video.h: Do not include grub/symbol.h.
-+      (grub_video_register): Not exported. This symbol is not defined in
-+      the kernel.
-+      (grub_video_unregister): Likewise.
-+      (grub_video_iterate): Likewise.
-+      (grub_video_setup): Likewise.
-+      (grub_video_restore): Likewise.
-+      (grub_video_get_info): Likewise.
-+      (grub_video_get_blit_format): Likewise.
-+      (grub_video_set_palette): Likewise.
-+      (grub_video_get_palette): Likewise.
-+      (grub_video_set_viewport): Likewise.
-+      (grub_video_get_viewport): Likewise.
-+      (grub_video_map_color): Likewise.
-+      (grub_video_map_rgb): Likewise.
-+      (grub_video_map_rgba): Likewise.
-+      (grub_video_fill_rect): Likewise.
-+      (grub_video_blit_glyph): Likewise.
-+      (grub_video_blit_bitmap): Likewise.
-+      (grub_video_blit_render_target): Likewise.
-+      (grub_video_scroll): Likewise.
-+      (grub_video_swap_buffers): Likewise.
-+      (grub_video_create_render_target): Likewise.
-+      (grub_video_delete_render_target): Likewise.
-+      (grub_video_set_active_render_target): Likewise.
-+
-+      * include/grub/symbol.h [GRUB_SYMBOL_GENERATOR] (EXPORT_FUNC):
-+      Undefined.
-+      [GRUB_SYMBOL_GENERATOR] (EXPORT_VAR): Likewise.
-+
-+      * conf/sparc64-ieee1275.rmk (grubof_symlist.c): Depended on
-+      config.h. Use gensymlist.sh instead of $(srcdir)/gensymlist.sh.
-+      (kernel_syms.lst): Depended on config.h. Use genkernsyms.sh
-+      instead of $(srcdir)/genkernsyms.sh.
-+
-+      * conf/powerpc-ieee1275.rmk (grubof_symlist.c): Depended on
-+      config.h. Use gensymlist.sh instead of $(srcdir)/gensymlist.sh.
-+      (kernel_syms.lst): Depended on config.h. Use genkernsyms.sh
-+      instead of $(srcdir)/genkernsyms.sh.
-+
-+      * conf/i386-pc.rmk (symlist.c): Depended on config.h. Use
-+      gensymlist.sh instead of $(srcdir)/gensymlist.sh.
-+      (kernel_syms.lst): Depended on config.h. Use genkernsyms.sh
-+      instead of $(srcdir)/genkernsyms.sh.
-+
-+      * conf/i386-efi.rmk (symlist.c): Depended on config.h. Use
-+      gensymlist.sh instead of $(srcdir)/gensymlist.sh.
-+      (kernel_syms.lst): Depended on config.h. Use genkernsyms.sh
-+      instead of $(srcdir)/genkernsyms.sh.
-+
-+      * configure.ac (AC_CONFIG_FILES): Added gensymlist.sh and
-+      genkernsyms.sh.
-+
-+      * Makefile.in (DISTCLEANFILES): Added gensymlist.sh and
-+      genkernsyms.sh.
-+      (gensymlist.sh): New target.
-+      (genkernsyms.sh): Likewise.
-+
-+      * DISTLIST: Removed genkernsyms.sh and gensymlist.sh. Added
-+      genkernsyms.sh.in and gensymlist.sh.in.
-+
-+      * genkernsyms.sh: Removed.
-+      * gensymlist.sh: Likewise.
-+      
-+      * genkernsyms.sh.in: New file.
-+      * gensymlist.sh.in: Likewise.
-+
-+2006-04-25  Hollis Blanchard  <hollis@penguinppc.org>
-+
-+      * kern/powerpc/ieee1275/init.c (grub_machine_set_prefix): Do not
-+      clobber "prefix", since we may have already set it manually.
-+
-+2006-04-25  Hollis Blanchard  <hollis@penguinppc.org>
-+
-+      * kern/misc.c (abort): New alias for grub_abort.
-+
-+2006-04-25  Yoshinori K. Okuji  <okuji@enbug.org>
-+
-+      A new machine-specific function "grub_machine_set_prefix" is
-+      defined. This is called after loading modules, so that a prefix
-+      initialization can use modules. Also, this change adds an
-+      intensive debugging feature for the memory manager via the
-+      configure option "--enable-mm-debug".
-+      
-+      * partmap/gpt.c (gpt_partition_map_iterate): Add one more into
-+      PART.LEN.
-+
-+      * kern/sparc64/ieee1275/init.c (abort): Removed.
-+      (grub_stop): Likewise.
-+      (grub_exit): New function.
-+      (grub_set_prefix): Renamed to ...
-+      (grub_machine_set_prefix): ... this.
-+      (grub_machine_init): Do not call grub_set_prefix.
-+
-+      * kern/powerpc/ieee1275/init.c (grub_set_prefix): Renamed to ...
-+      (grub_machine_set_prefix): ... this.
-+      (grub_machine_init): Do not call grub_set_prefix.
-+
-+      * kern/i386/pc/init.c (grub_machine_set_prefix): New function.
-+      (grub_machine_init): Do not set the prefix here.
-+
-+      * kern/i386/efi/init.c (grub_machine_set_prefix): New function.
-+
-+      * kern/efi/init.c: Include grub/mm.h.
-+      (grub_efi_set_prefix): New function.
-+
-+      * kern/efi/efi.c (grub_exit): Call grub_efi_fini.
-+      (grub_efi_get_filename): New function.
-+      (grub_print_device_path): Renamed to ...
-+      (grub_efi_print_device_path): ... this.
-+
-+      * kern/mm.c [MM_DEBUG] (grub_malloc): Undefined.
-+      [MM_DEBUG] (grub_realloc): Likewise.
-+      [MM_DEBUG] (grub_free): Likewise.
-+      [MM_DEBUG] (grub_memalign): Likewise.
-+      [MM_DEBUG] (grub_mm_debug): New variable.
-+      [MM_DEBUG] (grub_debug_malloc): New function.
-+      [MM_DEBUG] (grub_debug_free): New function.
-+      [MM_DEBUG] (grub_debug_realloc): New function.
-+      [MM_DEBUG] (grub_debug_memalign): New function.
-+
-+      * kern/misc.c (grub_abort): Print a newline to distinguish
-+      the message.
-+
-+      * kern/main.c (grub_main): Call grub_machine_set_prefix and
-+      grub_set_root_dev after loading modules. This is necessary when
-+      setting a prefix depends on modules.
-+
-+      * include/grub/efi/efi.h (grub_print_device_path): Renamed to ...
-+      (grub_efi_print_device_path): ... this.
-+      (grub_efi_get_filename): New prototype.
-+      (grub_efi_set_prefix): Likewise.
-+
-+      * include/grub/efi/disk.h: Include grub/efi/api.h, grub/symbol.h
-+      and grub/disk.h.
-+      (grub_efidisk_get_device_handle): New prototype.
-+      (grub_efidisk_get_device_name): Likewise.
-+
-+      * include/grub/mm.h: Include config.h.
-+      (MM_DEBUG): Removed.
-+      [MM_DEBUG && !GRUB_UTIL] (grub_mm_debug): New prototype.
-+      [MM_DEBUG && !GRUB_UTIL] (grub_malloc): New macro.
-+      [MM_DEBUG && !GRUB_UTIL] (grub_realloc): Likewise.
-+      [MM_DEBUG && !GRUB_UTIL] (grub_memalign): Likewise.
-+      [MM_DEBUG && !GRUB_UTIL] (grub_free): Likewise.
-+      [MM_DEBUG && !GRUB_UTIL] (grub_debug_malloc): New prototype.
-+      [MM_DEBUG && !GRUB_UTIL] (grub_debug_realloc): New prototype.
-+      [MM_DEBUG && !GRUB_UTIL] (grub_debug_memalign): New prototype.
-+      [MM_DEBUG && !GRUB_UTIL] (grub_debug_free): New prototype.
-+
-+      * include/grub/kernel.h (grub_machine_set_prefix): New prototype.
-+
-+      * disk/efi/efidisk.c: Include grub/partition.h.
-+      (iterate_child_devices): New function.
-+      (add_device): First, compare only last device path nodes, so that
-+      devices are sorted by the types.
-+      (grub_efidisk_get_device_handle): New function.
-+      (grub_efidisk_get_device_name): Likewise.
-+
-+      * configure.ac (--enable-mm-debug): New option to enable the
-+      memory manager debugging feature. This makes the binary much
-+      bigger, so is disabled by default.
-+
-+2006-04-23  Yoshinori K. Okuji  <okuji@enbug.org>
-+
-+      Use grub_abort instead of grub_stop, and grub_exit must be
-+      define in each architecture now. Also, this change adds support
-+      for EFI disks.
-+      
-+      * util/i386/pc/grub-probefs.c: Include grub/term.h.
-+      (grub_getkey): New function.
-+      (grub_term_get_current): Likewise.
-+
-+      * util/i386/pc/grub-setup.c: Include grub/term.h.
-+      (grub_getkey): New function.
-+      (grub_term_get_current): Likewise.
-+
-+      * util/misc.c (grub_stop): Renamed to ...
-+      (grub_exit): ... this.
-+
-+      * kern/powerpc/ieee1275/init.c (abort): Renamed to ...
-+      (grub_exit): ... this.
-+      (grub_machine_init): Use grub_abort instead of abort.
-+      (grub_stop): Removed.
-+
-+      * kern/powerpc/ieee1275/cmain.c (cmain): Use grub_abort instead of
-+      abort.
-+
-+      * kern/i386/pc/startup.S (grub_exit): New function.
-+      (cold_reboot): New label.
-+
-+      * kern/efi/init.c: Include grub/efi/disk.h and grub/env.h.
-+      (grub_efi_init): Call grub_efidisk_init.
-+      (grub_efi_fini): Call grub_efidisk_fini.
-+
-+      * kern/efi/efi.c: Include grub/mm.h.
-+      (grub_efi_console_control_guid): Renamed to ...
-+      (console_control_guid): ... this.
-+      (grub_efi_loaded_image_guid): Renamed to ...
-+      (loaded_image_guid): ... this.
-+      (grub_efi_locate_handle): New function.
-+      (grub_efi_open_protocol): Likewise.
-+      (grub_efi_set_text_mode): Use CONSOLE_CONTROL_GUID instead of
-+      GRUB_EFI_CONSOLE_CONTROL_GUID.
-+      (grub_efi_exit): Removed.
-+      (grub_stop): Likewise.
-+      (grub_efi_get_loaded_image): Use grub_efi_open_protocol.
-+      (grub_exit): New function.
-+      (grub_print_device_path): Likewise.
-+
-+      * kern/rescue.c (grub_rescue_cmd_exit): New function.
-+      (grub_enter_rescue_mode): Register "exit".
-+
-+      * kern/misc.c (grub_real_dprintf): A cosmetic change.
-+      (grub_abort): New function.
-+
-+      * kern/err.c (grub_fatal): Use grub_abort instead of grub_stop.
-+
-+      * include/grub/sparc64/ieee1275/kernel.h (abort): Removed.
-+
-+      * include/grub/powerpc/ieee1275/kernel.h (abort): Removed.
-+
-+      * include/grub/efi/efi.h (grub_efi_exit): Removed.
-+      (grub_print_device_path): New prototype.
-+      (grub_efi_locate_handle): Likewise.
-+      (grub_efi_open_protocol): Likewise.
-+
-+      * include/grub/efi/disk.h (grub_efidisk_fini): New file.
-+      * disk/efi/efidisk.c: Likewise.
-+
-+      * DISTLIST: Added disk/efi/efidisk.c and include/grub/efi/disk.h.
-+
-+      * include/grub/efi/console_control.h
-+      (GRUB_EFI_CONSOLE_CONTROL_GUID): Use an array for the last 8 bytes.
-+
-+      * include/grub/efi/api.h (GRUB_EFI_LOADED_IMAGE_GUID): Specify the
-+      last 8 bytes as an array.
-+      (GRUB_EFI_DISK_IO_GUID): New macro.
-+      (GRUB_EFI_BLOCK_IO_GUID): Likewise.
-+      (GRUB_EFI_DEVICE_PATH_GUID): Likewise.
-+      (grub_efi_ipv6_address_t): Change the type to grub_uint16_t from
-+      grub_uint8_t.
-+      (struct grub_efi_guid): Use an array to specify the last 8 bytes.
-+      (struct grub_efi_device_path): Rename the member "sub_type" to
-+      "subtype".
-+      (GRUB_EFI_DEVICE_PATH_TYPE): New macro.
-+      (GRUB_EFI_DEVICE_PATH_SUBTYPE): Likewise.
-+      (GRUB_EFI_DEVICE_PATH_LENGTH): Likewise.
-+      (GRUB_EFI_END_DEVICE_PATH_TYPE): Likewise.
-+      (GRUB_EFI_END_ENTIRE_DEVICE_PATH_SUBTYPE): Likewise.
-+      (GRUB_EFI_END_THIS_DEVICE_PATH_SUBTYPE): Likewise.
-+      (GRUB_EFI_END_ENTIRE_DEVICE_PATH): Likewise.
-+      (GRUB_EFI_NEXT_DEVICE_PATH): Likewise.
-+      (GRUB_EFI_HARDWARE_DEVICE_PATH_TYPE): Likewise.
-+      (GRUB_EFI_PCI_DEVICE_PATH_SUBTYPE): Likewise.
-+      (struct grub_efi_pci_device_path): New structure.
-+      (grub_efi_pci_device_path_t): New type.
-+      (GRUB_EFI_PCCARD_DEVICE_PATH_SUBTYPE): New macro.
-+      (struct grub_efi_pccard_device_path): New structure.
-+      (grub_efi_pccard_device_path_t): New type.
-+      (GRUB_EFI_MEMORY_MAPPED_DEVICE_PATH_SUBTYPE): New macro.
-+      (struct grub_efi_memory_mapped_device_path): New structure.
-+      (grub_efi_memory_mapped_device_path_t): New type.
-+      (GRUB_EFI_VENDOR_DEVICE_PATH_SUBTYPE): New macro.
-+      (struct grub_efi_vendor_device_path): New structure.
-+      (grub_efi_vendor_device_path_t): New type.
-+      (GRUB_EFI_CONTROLLER_DEVICE_PATH_SUBTYPE): New macro.
-+      (struct grub_efi_controller_device_path): New structure.
-+      (grub_efi_controller_device_path_t): New type.
-+      (GRUB_EFI_ACPI_DEVICE_PATH_TYPE): New macro.
-+      (GRUB_EFI_ACPI_DEVICE_PATH_SUBTYPE): Likewise.
-+      (struct grub_efi_acpi_device_path): New structure.
-+      (grub_efi_acpi_device_path_t): New type.
-+      (GRUB_EFI_EXPANDED_ACPI_DEVICE_PATH_SUBTYPE): New macro.
-+      (struct grub_efi_expanded_acpi_device_path): New structure.
-+      (grub_efi_expanded_acpi_device_path_t): New type.
-+      (GRUB_EFI_EXPANDED_ACPI_HIDSTR): New macro.
-+      (GRUB_EFI_EXPANDED_ACPI_UIDSTR): Likewise.
-+      (GRUB_EFI_EXPANDED_ACPI_CIDSTR): Likewise.
-+      (GRUB_EFI_MESSAGING_DEVICE_PATH_TYPE): Likewise.
-+      (GRUB_EFI_ATAPI_DEVICE_PATH_SUBTYPE): Likewise.
-+      (struct grub_efi_atapi_device_path): New structure.
-+      (grub_efi_atapi_device_path_t): New type.
-+      (GRUB_EFI_FIBRE_CHANNEL_DEVICE_PATH_SUBTYPE): New macro.
-+      (struct grub_efi_fibre_channel_device_path): New structure.
-+      (grub_efi_fibre_channel_device_path_t): New type.
-+      (GRUB_EFI_1394_DEVICE_PATH_SUBTYPE): New macro.
-+      (struct grub_efi_1394_device_path): New structure.
-+      (grub_efi_1394_device_path_t): New type.
-+      (GRUB_EFI_USB_DEVICE_PATH_SUBTYPE): New macro.
-+      (struct grub_efi_usb_device_path): New structure.
-+      (grub_efi_usb_device_path_t): New type.
-+      (GRUB_EFI_USB_CLASS_DEVICE_PATH_SUBTYPE): New macro.
-+      (struct grub_efi_usb_class_device_path): New structure.
-+      (grub_efi_usb_class_device_path_t): New type.
-+      (GRUB_EFI_I2O_DEVICE_PATH_SUBTYPE): New macro.
-+      (struct grub_efi_i2o_device_path): New structure.
-+      (grub_efi_i2o_device_path_t): New type.
-+      (GRUB_EFI_MAC_ADDRESS_DEVICE_PATH_SUBTYPE): New macro.
-+      (struct grub_efi_mac_address_device_path): New structure.
-+      (grub_efi_mac_address_device_path_t): New type.
-+      (GRUB_EFI_IPV4_DEVICE_PATH_SUBTYPE): New macro.
-+      (struct grub_efi_ipv4_device_path): New structure.
-+      (grub_efi_ipv4_device_path_t): New type.
-+      (GRUB_EFI_IPV6_DEVICE_PATH_SUBTYPE): New macro.
-+      (struct grub_efi_ipv6_device_path): New structure.
-+      (grub_efi_ipv6_device_path_t): New type.
-+      (GRUB_EFI_INFINIBAND_DEVICE_PATH_SUBTYPE): New macro.
-+      (struct grub_efi_infiniband_device_path): New structure.
-+      (grub_efi_infiniband_device_path_t): New type.
-+      (GRUB_EFI_UART_DEVICE_PATH_SUBTYPE): New macro.
-+      (struct grub_efi_uart_device_path): New structure.
-+      (grub_efi_uart_device_path_t): New type.
-+      (GRUB_EFI_VENDOR_MESSAGING_DEVICE_PATH_SUBTYPE): New macro.
-+      (struct grub_efi_vendor_messaging_device_path): New structure.
-+      (grub_efi_vendor_messaging_device_path_t): New type.
-+      (GRUB_EFI_MEDIA_DEVICE_PATH_TYPE): New macro.
-+      (GRUB_EFI_HARD_DRIVE_DEVICE_PATH_SUBTYPE): Likewise.
-+      (struct grub_efi_hard_drive_device_path): New structure.
-+      (grub_efi_hard_drive_device_path_t): New type.
-+      (GRUB_EFI_CDROM_DEVICE_PATH_SUBTYPE): New macro.
-+      (struct grub_efi_cdrom_device_path): New structure.
-+      (grub_efi_cdrom_device_path_t): New type.
-+      (GRUB_EFI_VENDOR_MEDIA_DEVICE_PATH_SUBTYPE): New macro.
-+      (struct grub_efi_vendor_media_device_path): New structure.
-+      (grub_efi_vendor_media_device_path_t): New type.
-+      (GRUB_EFI_FILE_PATH_DEVICE_PATH_SUBTYPE): New macro.
-+      (struct grub_efi_file_path_device_path): New structure.
-+      (grub_efi_file_path_device_path_t): New type.
-+      (GRUB_EFI_PROTOCOL_DEVICE_PATH_SUBTYPE): New macro.
-+      (struct grub_efi_protocol_device_path): New structure.
-+      (grub_efi_protocol_device_path_t): New type.
-+      (GRUB_EFI_BIOS_DEVICE_PATH_TYPE): New macro.
-+      (GRUB_EFI_BIOS_DEVICE_PATH_SUBTYPE): Likewise.
-+      (struct grub_efi_bios_device_path): New structure.
-+      (grub_efi_bios_device_path_t): New type.
-+      (struct grub_efi_disk_io): New structure.
-+      (grub_efi_disk_io_t): New type.
-+      (struct grub_efi_block_io_media): New structure.
-+      (grub_efi_block_io_media_t): New type.
-+      (struct grub_efi_block_io): New structure.
-+      (grub_efi_block_io_t): New type.
-+
-+      * include/grub/misc.h (grub_stop): Removed.
-+      (grub_exit): New prototype.
-+      (grub_abort): Likewise.
-+
-+      * include/grub/disk.h (enum grub_disk_dev_id): Added
-+      GRUB_DISK_DEVICE_EFIDISK_ID.
-+
-+      * conf/i386-efi.rmk (kernel_mod_SOURCES): Added
-+      disk/efi/efidisk.c.
-+      (kernel_syms.lst): Remove the target if an error occurs.
-+
-+2006-04-22  Yoshinori K. Okuji  <okuji@enbug.org>
-+
-+      * kern/misc.c (grub_lltoa): Rewritten the decimal conversion part,
-+      as it was simply too buggy.
-+
-+2006-04-21  Yoshinori K. Okuji  <okuji@enbug.org>
-+
-+      * kern/misc.c (grub_lltoa): New function.
-+      (grub_vsprintf): Added support for the long long suffix,
-+      i.e. "ll".
-+
-+2006-04-20  Hollis Blanchard  <hollis@penguinppc.org>
-+
-+      * Makefile.in (LDFLAGS): Add variable.
-+      (LD): Remove variable.
-+      * configure.ac: Add -m32 to LDFLAGS.
-+      * genmk.rb (PModule#rule): Use $(CC) instead of $(LD).
-+      * conf/powerpc-ieee1275.rmk (COMMON_LDFLAGS): Add variable.
-+      (grubof_LDFLAGS): Use $(COMMON_LDFLAGS).
-+      (_linux_mod_LDFLAGS, linux_mod_LDFLAGS, normal_mod_LDFLAGS,
-+      suspend_mod_LDFLAGS, reboot_mod_LDFLAGS, halt_mod_LDFLAGS): New
-+      variables.
-+      * conf/sparc64-ieee1275.rmk (COMMON_LDFLAGS): Add -nostdlib.
-+      * conf/i386-pc.rmk (COMMON_LDFLAGS): Add -nostdlib.
-+      * conf/i386-efi.rmk (COMMON_LDFLAGS): Add -nostdlib.
-+
-+2006-04-20  Vesa Jaaskelainen  <chaac@nic.fi>
-+
-+      * term/gfxterm.c (grub_gfxterm_getcharwidth): Fixed character
-+      length for unknown glyph.
-+
-+2006-04-20  Yoshinori K. Okuji  <okuji@enbug.org>
-+
-+      Add support for pre-loaded modules into the EFI port.
-+      
-+      * util/i386/efi/grub-mkimage.c (make_mods_section): Rewritten
-+      completely. Accept one more argument DIR. The caller has changed.
-+
-+      * kern/i386/efi/init.c (grub_arch_modules_addr): Removed.
-+
-+      * kern/efi/efi.c: Include grub/efi/pe32.h and grub/kernel.h.
-+      (grub_efi_loaded_image_guid): New variable.
-+      (grub_efi_get_loaded_image): New function.
-+      (grub_arch_modules_addr): Likewise.
-+
-+      * include/grub/efi/efi.h (grub_efi_get_loaded_image): New
-+      prototype.
-+
-+      * include/grub/efi/api.h (GRUB_EFI_LOADED_IMAGE_GUID): New macro.
-+      (struct grub_efi_loaded_image): New structure.
-+      (grub_efi_loaded_image_t): New type.
-+
-+2006-04-20  Yoshinori K. Okuji  <okuji@enbug.org>
-+      
-+      * loader/i386/pc/linux.c (grub_rescue_cmd_linux): Compare the file
-+      size with GRUB_OS_AREA_SIZE as grub_size_t instead of
-+      grub_ssize_t. Reported by Jeff Chua <jeff84@silk.corp.fedex.com>.
-+
-+2006-04-19  Roger Leigh  <rleigh@whinlatter.ukfsn.org>
-+
-+      * DISTLIST: Added `util/powerpc/ieee1275/grub-install.in'.
-+
-+2006-04-19  Yoshinori K. Okuji  <okuji@enbug.org>
-+
-+      * DISTLIST: Added include/grub/efi/console.h,
-+      include/grub/efi/time.h, include/grub/i386/efi/kernel.h,
-+      kern/efi/init.c, kern/efi/mm.c, and term/efi/console.c.
-+
-+      * include/grub/efi/console.h: New file.
-+      * include/grub/efi/time.h: Likewise.
-+      * include/grub/i386/efi/kernel.h: Likewise.
-+      * kern/efi/init.c: Likewise.
-+      * kern/efi/mm.c: Likewise.
-+      * term/efi/console.c: Likewise.
-+      
-+      * kern/i386/efi/init.c: Do not include grub/machine/time.h.
-+      (grub_stop): Removed.
-+      (grub_get_rtc): Likewise.
-+      (grub_machine_init): Simply call grub_efi_init.
-+      (grub_machine_fini): Call grub_efi_fini.
-+
-+      * kern/efi/efi.c: Include grub/machine/time.h and grub/term.h.
-+      (grub_efi_output_string): Removed.
-+      (grub_efi_stall): New function.
-+      (grub_stop): Likewise.
-+      (grub_get_rtc): Likewise.
-+
-+      * include/grub/efi/efi.h (grub_efi_output_string): Removed.
-+      (grub_efi_stall): New prototype.
-+      (grub_efi_allocate_pages): Likewise.
-+      (grub_efi_free_pages): Likewise.
-+      (grub_efi_get_memory_map): Likewise.
-+      (grub_efi_mm_init): Likewise.
-+      (grub_efi_mm_fini): Likewise.
-+      (grub_efi_init): Likewise.
-+      (grub_efi_fini): Likewise.
-+
-+      * include/grub/i386/efi/time.h: Do not include
-+      grub/symbol.h. Include grub/efi/time.h.
-+      (GRUB_TICKS_PER_SECOND): Removed.
-+      (grub_get_rtc): Likewise.
-+
-+      * include/grub/efi/api.h (struct grub_efi_memory_descriptor):
-+      Added padding. The EFI spec is buggy.
-+      (GRUB_EFI_BLACK): New macro.
-+      (GRUB_EFI_BLUE): Likewise.
-+      (GRUB_EFI_GREEN): Likewise.
-+      (GRUB_EFI_CYAN): Likewise.
-+      (GRUB_EFI_RED): Likewise.
-+      (GRUB_EFI_MAGENTA): Likewise.
-+      (GRUB_EFI_BROWN): Likewise.
-+      (GRUB_EFI_LIGHTGRAY): Likewise.
-+      (GRUB_EFI_BRIGHT): Likewise.
-+      (GRUB_EFI_DARKGRAY): Likewise.
-+      (GRUB_EFI_LIGHTBLUE): Likewise.
-+      (GRUB_EFI_LIGHTGREEN): Likewise.
-+      (GRUB_EFI_LIGHTCYAN): Likewise.
-+      (GRUB_EFI_LIGHTRED): Likewise.
-+      (GRUB_EFI_LIGHTMAGENTA): Likewise.
-+      (GRUB_EFI_YELLOW): Likewise.
-+      (GRUB_EFI_WHITE): Likewise.
-+      (GRUB_EFI_BACKGROUND_BLACK): Likewise.
-+      (GRUB_EFI_BACKGROUND_BLUE): Likewise.
-+      (GRUB_EFI_BACKGROUND_GREEN): Likewise.
-+      (GRUB_EFI_BACKGROUND_CYAN): Likewise.
-+      (GRUB_EFI_BACKGROUND_RED): Likewise.
-+      (GRUB_EFI_BACKGROUND_MAGENTA): Likewise.
-+      (GRUB_EFI_BACKGROUND_BROWN): Likewise.
-+      (GRUB_EFI_BACKGROUND_LIGHTGRAY): Likewise.
-+      (GRUB_EFI_TEXT_ATTR): Likewise.
-+
-+      * conf/i386-efi.rmk (kernel_mod_SOURCES): Added kern/efi/efi.c,
-+      kern/efi/init.c, kern/efi/mm.c, and term/efi/console.c.
-+      (kernel_mod_HEADERS): Added efi/time.h.
-+
-+2006-04-18  Yoshinori K. Okuji  <okuji@enbug.org>
-+
-+      * DISTLIST: Added conf/i386-efi.mk, conf/i386-efi.rmk,
-+      include/grub/efi/api.h, include/grub/efi/console_control.h,
-+      include/grub/efi/efi.h, include/grub/efi/pe32.h,
-+      include/grub/i386/efi/time.h, kern/efi/efi.c,
-+      kern/i386/efi/init.c, kern/i386/efi/startup.S,
-+      and util/i386/efi/grub-mkimage.c.
-+
-+      * Makefile.in (RMKFILES): Added i386-efi.rmk.
-+
-+      * genmk.rb (PModule#rule): Do not export symbols if
-+      #{prefix}_EXPORTS is set to "no".
-+
-+      * conf/i386-efi.mk: New file.
-+      * conf/i386-efi.rmk: Likewise.
-+      * include/grub/efi/api.h: Likewise.
-+      * include/grub/efi/console_control.h: Likewise.
-+      * include/grub/efi/efi.h: Likewise.
-+      * include/grub/efi/pe32.h: Likewise.
-+      * include/grub/i386/efi/time.h: Likewise.
-+      * kern/efi/efi.c: Likewise.
-+      * kern/i386/efi/init.c: Likewise.
-+      * kern/i386/efi/startup.S: Likewise.
-+      * util/i386/efi/grub-mkimage.c: Likewise.
-+
-+2006-04-17  Marco Gerards  <marco@gnu.org>
-+
-+      * include/grub/script.h: Include <grub/parser.h> and
-+      "grub_script.tab.h".
-+      (struct grub_lexer_param): New struct.
-+      (struct grub_parser_param): Likewise.
-+      (grub_script_create_arglist): Pass the state in an argument.
-+      (grub_script_add_arglist): Likewise.
-+      (grub_script_create_cmdline): Likewise.
-+      (grub_script_create_cmdblock): Likewise.
-+      (grub_script_create_cmdif): Likewise.
-+      (grub_script_create_cmdmenu): Likewise.
-+      (grub_script_add_cmd): Likewise.
-+      (grub_script_arg_add): Likewise.
-+      (grub_script_lexer_ref): Likewise.
-+      (grub_script_lexer_deref): Likewise.
-+      (grub_script_lexer_record_start): Likewise.
-+      (grub_script_lexer_record_stop): Likewise.
-+      (grub_script_mem_record): Likewise.
-+      (grub_script_mem_record_stop): Likewise.
-+      (grub_script_malloc): Likewise.
-+      (grub_script_yylex): Likewise.
-+      (grub_script_yyparse): Likewise.
-+      (grub_script_yyerror): Likewise.
-+      (grub_script_yylex): Likewise.
-+      (grub_script_lexer_init): Return the state.
-+
-+      * normal/lexer.c (grub_script_lexer_state): Removed variable.
-+      (grub_script_lexer_done): Likewise.
-+      (grub_script_lexer_getline): Likewise.
-+      (grub_script_lexer_refs): Likewise.
-+      (script): Likewise.
-+      (newscript): Likewise.
-+      (record): Likewise.
-+      (recording): Likewise.
-+      (recordpos): Likewise.
-+      (recordlen): Likewise.
-+      (grub_script_lexer_init): Return the state instead of setting
-+      global variables.
-+      (grub_script_lexer_ref): Use the newly added argument for state
-+      instead of globals.
-+      (grub_script_lexer_deref): Likewise.
-+      (grub_script_lexer_record_start): Likewise.
-+      (grub_script_lexer_record_stop): Likewise.
-+      (recordchar): Likewise.
-+      (nextchar): Likewise.
-+      (grub_script_yylex2): Likewise.
-+      (grub_script_yylex): Likewise.
-+      (grub_script_yyerror): Likewise.
-+
-+      * normal/parser.y (func_mem): Removed variable.
-+      (menu_entry): Likewise.
-+      (err): Likewise.
-+      (%lex-param): New parser option.
-+      (%parse-param): Likewise.
-+      (script): Always return the AST.
-+      (argument): Pass the state around.
-+      (arguments): Likewise.
-+      (grubcmd): Likewise.
-+      (commands): Likewise.
-+      (function): Likewise.
-+      (menuentry): Likewise.
-+      (if_statement): Likewise.
-+      (if): Likewise.
-+
-+      * normal/script.c (grub_script_memused): Removed variable.
-+      (grub_script_parsed): Likewise.
-+      (grub_script_malloc): Added a state argument.  Use that instead of
-+      global variables.
-+      (grub_script_mem_record): Likewise.
-+      (grub_script_mem_record_stop): Likewise.
-+      (grub_script_arg_add): Likewise.
-+      (grub_script_add_arglist): Likewise.
-+      (grub_script_create_cmdline): Likewise.
-+      (grub_script_create_cmdif): Likewise.
-+      (grub_script_create_cmdmenu): Likewise.
-+      (grub_script_add_cmd): Likewise.
-+      (grub_script_parse): Setup the state before calling the parser.
-+      
-+2006-04-16  Marco Gerards  <marco@gnu.org>
-+
-+      * normal/command.c (grub_command_init): Remove the title command.
-+
-+      * normal/lexer.c (grub_script_yylex): Renamed from this...
-+      (grub_script_yylex2): ... to this.
-+      (grub_script_yylex): New function.  Temporary
-+      introduced to filter some tokens.
-+      (grub_script_yyerror): Print a newline.
-+
-+      * normal/main.c (read_config_file): Output information about the
-+      lines that contain errors.  Wait for a key after all lines have
-+      been processed.  Don't return an empty menu.
-+
-+      * normal/parser.y (func_mem): Don't initialize.
-+      (menu_entry): Likewise.
-+      (err): New variable.
-+      (script): Don't return anything when an error was encountered.
-+      (ws, returns): Removed rules.
-+      (argument): Disabled concatenated variable support.
-+      (arguments): Remove explicit separators.
-+      (grubcmd): Likewise.
-+      (function): Likewise.
-+      (menuentry): Likewise.
-+      (if): Likewise.
-+      (commands): Likewise.  Add error handling.
-+
-+      * normal/script.c (grub_script_create_cmdline): If
-+      `grub_script_parsed' is 0, assume the parser encountered an error.
-+
-+2006-04-02  Yoshinori K. Okuji  <okuji@enbug.org>
-+
-+      * configure.ac: Add support for EFI. Fix the typo
-+      BUILD_LDDFLAGS. Restore the LDFLAGS after testing.
-+
-+2006-04-01  Vesa Jaaskelainen  <chaac@nic.fi>
-+
-+      * util/unifont2pff.rb: Removed unnecessary byte ordering.  Now
-+      foreign multibyte characters should be shown correctly.
-+
-+2006-04-01  Vesa Jaaskelainen  <chaac@nic.fi>
-+
-+      * normal/main.c (grub_normal_menu_addentry): Fixed menu size
-+      calculation.
-+      (read_config_file): Made it to close file before returning.
-+
-+2006-03-31  Vesa Jaaskelainen  <chaac@nic.fi>
-+
-+      * DISTLIST: Added include/grub/i386/pc/vbeblit.h,
-+      include/grub/i386/pc/vbefill.h, video/i386/pc/vbeblit.c,
-+      video/i386/pc/vbefill.c.
-+
-+      * conf/i386-pc.rmk (vbe_mod_SOURCES): Added video/i386/pc/vbeblit.c,
-+      video/i386/pc/vbefill.c.
-+
-+      * include/grub/video.h (grub_video_blit_format): New enum.
-+      (grub_video_mode_info): Added new member blit_format.
-+      (grub_video_get_blit_format): New function prototype.
-+
-+      * include/grub/i386/pc/vbe.h (grub_video_vbe_get_video_ptr): New
-+      function prototype.
-+      (grub_video_vbe_map_rgb): Likewise.
-+      (grub_video_vbe_unmap_color): Likewise.
-+
-+      * include/grub/i386/pc/vbeblit.h: New file.
-+
-+      * include/grub/i386/pc/vbefill.h: New file.
-+
-+      * video/video.c (grub_video_get_blit_format): New function.
-+      (grub_video_vbe_get_video_ptr): Re-declared as non-static.
-+      (grub_video_vbe_map_rgb): Likewise.
-+      (grub_video_vbe_unmap_color): Likewise.
-+
-+      * video/i386/pc/vbe.c (grub_video_vbe_fill_rect): Changed to use more
-+      optimized fills.
-+      (grub_video_vbe_blit_render_target): Changed to use more optimized
-+      blits.
-+      (grub_video_vbe_setup): Added detection for optimized settings.
-+      (grub_video_vbe_create_render_target): Likewise.
-+
-+      * video/i386/pc/vbeblit.c: New file.
-+
-+      * video/i386/pc/vbefill.c: New file.
-+
-+2006-03-30  Vesa Jaaskelainen  <chaac@nic.fi>
-+
-+      * font/manager.c (grub_font_get_glyph): Removed font fixup from
-+      here...
-+
-+      * util/unifont2pff.rb: ... and moved it to here.  Improved argument
-+      parsing to support both hex and dec ranges.  If filename was missing
-+      show usage information.
-+
-+2006-03-14  Vesa Jaaskelainen  <chaac@nic.fi>
-+
-+      * DISTLIST: Added include/grub/video.h, term/gfxterm.c,
-+      video/video.c, commands/videotest.c.  Removed term/i386/pc/vesafb.c.
-+
-+      * conf/i386-pc.rmk (pkgdata_MODULES): Added video.mod,
-+      gfxterm.mod, videotest.mod.  Removed vga.mod, vesafb.mod.
-+      (video_mod_SOURCES): Added.
-+      (video_mod_CFLAGS): Likewise.
-+      (video_mod_LDFLAGS): Likewise.
-+      (gfxterm_mod_SOURCES): Likewise.
-+      (gfxterm_mod_CFLAGS): Likewise.
-+      (gfxterm_mod_LDFLAGS): Likewise.
-+      (videotest_mod_SOURCES): Likewise.
-+      (videotest_mod_CFLAGS): Likewise.
-+      (videotest_mod_LDFLAGS): Likewise.
-+      (vesafb_mod_SOURCES): Removed.
-+      (vesafb_mod_CFLAGS): Likewise.
-+      (vesafb_mod_LDFLAGS): Likewise.
-+      (vga_mod_SOURCES): Likewise.
-+      (vga_mod_CFLAGS): Likewise.
-+      (vga_mod_LDFLAGS): Likewise.
-+
-+      * commands/videotest.c: New file.
-+
-+      * font/manager.c (fill_with_default_glyph): Modified to use
-+      grub_font_glyph.
-+      (grub_font_get_glyph): Likewise.
-+      (fontmanager): Renamed from this...
-+      (font_manager): ... to this.
-+
-+      * include/grub/font.h (grub_font_glyph): Added new structure.
-+      (grub_font_get_glyph): Modified to use grub_font_glyph.
-+
-+      * include/grub/misc.h (grub_abs): Added as inline function.
-+
-+      * include/grub/video.h: New file.
-+
-+      * include/grub/i386/pc/vbe.h (GRUB_VBE_STATUS_OK): New macro.
-+      (GRUB_VBE_MEMORY_MODEL_PACKED_PIXEL): Likewise.
-+      (GRUB_VBE_MEMORY_MODEL_DIRECT_COLOR): Likewise.
-+      (grub_vbe_get_controller_info): Renamed from this...
-+      (grub_vbe_bios_get_controller_info): ... to this.
-+      (grub_vbe_get_mode_info): Renamed from this...
-+      (grub_vbe_bios_get_mode_info): ... to this.
-+      (grub_vbe_set_mode): Renamed from this...
-+      (grub_vbe_bios_set_mode): ... to this.
-+      (grub_vbe_get_mode): Renamed from this...
-+      (grub_vbe_bios_get_mode): ... to this.
-+      (grub_vbe_set_memory_window): Renamed from this...
-+      (grub_vbe_bios_set_memory_window): ... to this.
-+      (grub_vbe_get_memory_window): Renamed from this...
-+      (grub_vbe_bios_get_memory_window): ... to this.
-+      (grub_vbe_set_scanline_length): Renamed from this...
-+      (grub_vbe_set_scanline_length): ... to this.
-+      (grub_vbe_get_scanline_length): Renamed from this...
-+      (grub_vbe_bios_get_scanline_length): ... to this.
-+      (grub_vbe_set_display_start): Renamed from this...
-+      (grub_vbe_bios_set_display_start): ... to this.
-+      (grub_vbe_get_display_start): Renamed from this...
-+      (grub_vbe_bios_get_display_start): ... to this.
-+      (grub_vbe_set_palette_data): Renamed from this...
-+      (grub_vbe_bios_set_palette_data): ... to this.
-+      (grub_vbe_set_pixel_rgb): Removed.
-+      (grub_vbe_set_pixel_index): Likewise.
-+
-+      * kern/i386/pc/startup.S (grub_vbe_get_controller_info): Renamed
-+      from this...
-+      (grub_vbe_bios_get_controller_info): ... to this.
-+      (grub_vbe_get_mode_info): Renamed from this...
-+      (grub_vbe_bios_get_mode_info): ... to this.
-+      (grub_vbe_set_mode): Renamed from this...
-+      (grub_vbe_bios_set_mode): ... to this.
-+      (grub_vbe_get_mode): Renamed from this...
-+      (grub_vbe_bios_get_mode): ... to this.
-+      (grub_vbe_set_memory_window): Renamed from this...
-+      (grub_vbe_bios_set_memory_window): ... to this.
-+      (grub_vbe_get_memory_window): Renamed from this...
-+      (grub_vbe_bios_get_memory_window): ... to this.
-+      (grub_vbe_set_scanline_length): Renamed from this...
-+      (grub_vbe_set_scanline_length): ... to this.
-+      (grub_vbe_get_scanline_length): Renamed from this...
-+      (grub_vbe_bios_get_scanline_length): ... to this.
-+      (grub_vbe_set_display_start): Renamed from this...
-+      (grub_vbe_bios_set_display_start): ... to this.
-+      (grub_vbe_get_display_start): Renamed from this...
-+      (grub_vbe_bios_get_display_start): ... to this.
-+      (grub_vbe_set_palette_data): Renamed from this...
-+      (grub_vbe_bios_set_palette_data): ... to this.
-+      (grub_vbe_bios_get_controller_info): Fixed problem with registers
-+      getting corrupted after calling it.  Added more pushes and pops.
-+      (grub_vbe_bios_set_mode): Likewise.
-+      (grub_vbe_bios_get_mode): Likewise.
-+      (grub_vbe_bios_get_memory_window): Likewise.
-+      (grub_vbe_bios_set_scanline_length): Likewise.
-+      (grub_vbe_bios_get_scanline_length): Likewise.
-+      (grub_vbe_bios_get_display_start): Likewise.
-+      (grub_vbe_bios_set_palette_data): Likewise.
-+
-+      * normal/cmdline.c (cl_set_pos): Refresh the screen.
-+      (cl_insert): Likewise.
-+      (cl_delete): Likewise.
-+
-+      * term/gfxterm.c: New file.
-+
-+      * term/i386/pc/vesafb.c: Removed file.
-+
-+      * video/video.c: New file.
-+
-+      * video/i386/pc/vbe.c (real2pm): Added new function.
-+      (grub_video_vbe_draw_pixel): Likewise.
-+      (grub_video_vbe_get_video_ptr): Likewise.
-+      (grub_video_vbe_get_pixel): Likewise
-+      (grub_video_vbe_init): Likewise.
-+      (grub_video_vbe_fini): Likewise.
-+      (grub_video_vbe_setup): Likewise.
-+      (grub_video_vbe_get_info): Likewise.
-+      (grub_video_vbe_set_palette): Likewise.
-+      (grub_video_vbe_get_palette): Likewise.
-+      (grub_video_vbe_set_viewport): Likewise.
-+      (grub_video_vbe_get_viewport): Likewise.
-+      (grub_video_vbe_map_color): Likewise.
-+      (grub_video_vbe_map_rgb): Likewise.
-+      (grub_video_vbe_map_rgba): Likewise.
-+      (grub_video_vbe_unmap_color): Likewise.
-+      (grub_video_vbe_fill_rect): Likewise.
-+      (grub_video_vbe_blit_glyph): Likewise.
-+      (grub_video_vbe_blit_bitmap): Likewise.
-+      (grub_video_vbe_blit_render_target): Likewise.
-+      (grub_video_vbe_scroll): Likewise.
-+      (grub_video_vbe_swap_buffers): Likewise.
-+      (grub_video_vbe_create_render_target): Likewise.
-+      (grub_video_vbe_delete_render_target): Likewise.
-+      (grub_video_vbe_set_active_render_target): Likewise.
-+      (grub_vbe_set_pixel_rgb): Remove function.
-+      (grub_vbe_set_pixel_index): Likewise.
-+      (index_color_mode): Remove static variable.
-+      (active_mode): Likewise.
-+      (framebuffer): Likewise.
-+      (bytes_per_scan_line): Likewise.
-+      (grub_video_vbe_adapter): Added new static variable.
-+      (framebuffer): Likewise.
-+      (render_target): Likewise.
-+      (initial_mode): Likewise.
-+      (mode_in_use): Likewise.
-+      (mode_list): Likewise.
-+
- 2006-03-10  Marco Gerards  <marco@gnu.org>
-       * configure.ac (AC_INIT): Bumped to 1.93.
-Index: DISTLIST
-===================================================================
-RCS file: /cvsroot/grub/grub2/DISTLIST,v
-retrieving revision 1.23
-retrieving revision 1.36
-diff -u -r1.23 -r1.36
---- DISTLIST   10 Mar 2006 22:27:24 -0000      1.23
-+++ DISTLIST   4 Jun 2006 12:59:19 -0000       1.36
-@@ -20,10 +20,11 @@
- genfslist.sh
- geninitheader.sh
- geninit.sh
--genkernsyms.sh
-+genkernsyms.sh.in
- genmk.rb
-+genmoddep.awk
- genmodsrc.sh
--gensymlist.sh
-+gensymlist.sh.in
- install-sh
- mkinstalldirs
- stamp-h.in
-@@ -31,16 +32,16 @@
- boot/i386/pc/diskboot.S
- boot/i386/pc/pxeboot.S
- commands/boot.c
-+commands/blocklist.c
- commands/cat.c
- commands/cmp.c
- commands/configfile.c
--commands/default.c
- commands/help.c
- commands/ls.c
- commands/search.c
- commands/terminal.c
- commands/test.c
--commands/timeout.c
-+commands/videotest.c
- commands/i386/pc/halt.c
- commands/i386/pc/play.c
- commands/i386/pc/reboot.c
-@@ -51,6 +52,8 @@
- commands/ieee1275/suspend.c
- conf/common.mk
- conf/common.rmk
-+conf/i386-efi.mk
-+conf/i386-efi.rmk
- conf/i386-pc.mk
- conf/i386-pc.rmk
- conf/powerpc-ieee1275.mk
-@@ -58,6 +61,7 @@
- conf/sparc64-ieee1275.mk
- conf/sparc64-ieee1275.rmk
- disk/loopback.c
-+disk/efi/efidisk.c
- disk/i386/pc/biosdisk.c
- disk/ieee1275/ofdisk.c
- font/manager.c
-@@ -107,21 +111,35 @@
- include/grub/terminfo.h
- include/grub/tparm.h
- include/grub/types.h
-+include/grub/video.h
-+include/grub/efi/api.h
-+include/grub/efi/chainloader.h
-+include/grub/efi/console.h
-+include/grub/efi/console_control.h
-+include/grub/efi/disk.h
-+include/grub/efi/efi.h
-+include/grub/efi/pe32.h
-+include/grub/efi/time.h
-+include/grub/i386/linux.h
- include/grub/i386/setjmp.h
- include/grub/i386/types.h
-+include/grub/i386/efi/kernel.h
-+include/grub/i386/efi/loader.h
-+include/grub/i386/efi/time.h
- include/grub/i386/pc/biosdisk.h
- include/grub/i386/pc/boot.h
- include/grub/i386/pc/chainloader.h
- include/grub/i386/pc/console.h
- include/grub/i386/pc/init.h
- include/grub/i386/pc/kernel.h
--include/grub/i386/pc/linux.h
- include/grub/i386/pc/loader.h
- include/grub/i386/pc/memory.h
- include/grub/i386/pc/multiboot.h
- include/grub/i386/pc/serial.h
- include/grub/i386/pc/time.h
- include/grub/i386/pc/vbe.h
-+include/grub/i386/pc/vbeblit.h
-+include/grub/i386/pc/vbefill.h
- include/grub/i386/pc/vga.h
- include/grub/i386/pc/util/biosdisk.h
- include/grub/ieee1275/ieee1275.h
-@@ -162,7 +180,12 @@
- kern/partition.c
- kern/rescue.c
- kern/term.c
-+kern/efi/init.c
-+kern/efi/efi.c
-+kern/efi/mm.c
- kern/i386/dl.c
-+kern/i386/efi/init.c
-+kern/i386/efi/startup.S
- kern/i386/pc/init.c
- kern/i386/pc/lzo1x.S
- kern/i386/pc/startup.S
-@@ -177,6 +200,10 @@
- kern/sparc64/dl.c
- kern/sparc64/ieee1275/init.c
- kern/sparc64/ieee1275/openfw.c
-+loader/efi/chainloader.c
-+loader/efi/chainloader_normal.c
-+loader/i386/efi/linux.c
-+loader/i386/efi/linux_normal.c
- loader/i386/pc/chainloader.c
- loader/i386/pc/chainloader_normal.c
- loader/i386/pc/linux.c
-@@ -189,7 +216,6 @@
- normal/cmdline.c
- normal/command.c
- normal/completion.c
--normal/context.c
- normal/execute.c
- normal/function.c
- normal/lexer.c
-@@ -209,17 +235,19 @@
- partmap/sun.c
- term/terminfo.c
- term/tparm.c
-+term/gfxterm.c
-+term/efi/console.c
- term/i386/pc/console.c
- term/i386/pc/serial.c
- term/i386/pc/vesafb.c
- term/i386/pc/vga.c
- term/ieee1275/ofconsole.c
- util/console.c
--util/genmoddep.c
- util/grub-emu.c
- util/misc.c
- util/resolve.c
- util/unifont2pff.rb
-+util/i386/efi/grub-mkimage.c
- util/i386/pc/biosdisk.c
- util/i386/pc/getroot.c
- util/i386/pc/grub-install.in
-@@ -228,6 +256,10 @@
- util/i386/pc/grub-probefs.c
- util/i386/pc/grub-setup.c
- util/i386/pc/misc.c
-+util/powerpc/ieee1275/grub-install.in
- util/powerpc/ieee1275/grub-mkimage.c
- util/powerpc/ieee1275/misc.c
-+video/video.c
- video/i386/pc/vbe.c
-+video/i386/pc/vbeblit.c
-+video/i386/pc/vbefill.c
-Index: Makefile.in
-===================================================================
-RCS file: /cvsroot/grub/grub2/Makefile.in,v
-retrieving revision 1.17
-retrieving revision 1.22
-diff -u -r1.17 -r1.22
---- Makefile.in        3 Jan 2006 17:58:02 -0000       1.17
-+++ Makefile.in        28 May 2006 23:01:43 -0000      1.22
-@@ -1,6 +1,6 @@
- # -*- makefile -*-
- #
--# Copyright (C) 1994,1995,1996,1997,1998,1999,2000,2001,2002,2004,2005 Free Software Foundation, Inc.
-+# Copyright (C) 1994,1995,1996,1997,1998,1999,2000,2001,2002,2004,2005,2006 Free Software Foundation, Inc.
- #
- # This Makefile.in is free software; the author
- # gives unlimited permission to copy and/or distribute it,
-@@ -34,8 +34,8 @@
- infodir = @infodir@
- mandir = @mandir@
- includedir = @includedir@
--pkgdatadir = $(datadir)/@PACKAGE_TARNAME@/$(host_cpu)-$(host_vendor)
--pkglibdir = $(libdir)/@PACKAGE_TARNAME@
-+pkgdatadir = $(datadir)/@PACKAGE_TARNAME@
-+pkglibdir = $(libdir)/@PACKAGE_TARNAME@/$(target_cpu)-$(platform)
- PACKAGE_NAME = @PACKAGE_NAME@
- PACKAGE_TARNAME = @PACKAGE_TARNAME@
-@@ -43,8 +43,8 @@
- PACKAGE_STRING = @PACKAGE_STRING@
- PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
--host_cpu = @host_cpu@
--host_vendor = @host_vendor@
-+target_cpu = @target_cpu@
-+platform = @platform@
- INSTALL = @INSTALL@
- INSTALL_PROGRAM = @INSTALL_PROGRAM@
-@@ -56,16 +56,19 @@
- CC = @CC@
- CFLAGS = @CFLAGS@
--CPPFLAGS = -I. -Iinclude -I$(srcdir)/include -Wall -W
--BUILD_CC = @BUILD_CC@
--BUILD_CFLAGS = -g -O2
--BUILD_CPPFLAGS = -I. -Iinclude -I$(srcdir)/include -Wall -W \
--      -DGRUB_DATADIR=\"$(pkgdatadir)\"
-+LDFLAGS = @LDFLAGS@
-+CPPFLAGS = @CPPFLAGS@ -I. -Iinclude -I$(srcdir)/include -Wall -W \
-+       -DGRUB_LIBDIR=\"$(pkglibdir)\"
-+TARGET_CC = @TARGET_CC@
-+TARGET_CFLAGS = @TARGET_CFLAGS@
-+TARGET_CPPFLAGS = @TARGET_CPPFLAGS@ -I. -Iinclude -I$(srcdir)/include \
-+      -Wall -W
-+TARGET_LDFLAGS = @TARGET_LDFLAGS@
- OBJCOPY = @OBJCOPY@
- STRIP = @STRIP@
- NM = @NM@
--LD = @LD@
- RUBY = @RUBY@
-+AWK = @AWK@
- LIBCURSES = @LIBCURSES@
- LIBLZO = @LIBLZO@
- YACC = @YACC@
-@@ -73,7 +76,7 @@
- ### General variables.
- RMKFILES = $(addprefix conf/,common.rmk i386-pc.rmk powerpc-ieee1275.rmk \
--      sparc64-ieee1275.rmk)
-+      sparc64-ieee1275.rmk i386-efi.rmk)
- MKFILES = $(patsubst %.rmk,%.mk,$(RMKFILES))
- DATA = $(pkgdata_IMAGES) $(pkgdata_MODULES) $(pkgdata_PROGRAMS) \
-@@ -84,7 +87,8 @@
- CLEANFILES =
- MOSTLYCLEANFILES = 
- DISTCLEANFILES = config.status config.cache config.log config.h \
--      Makefile stamp-h include/grub/cpu include/grub/machine
-+      Makefile stamp-h include/grub/cpu include/grub/machine \
-+      gensymlist.sh genkernsyms.sh
- MAINTAINER_CLEANFILES = $(srcdir)/configure $(addprefix $(srcdir)/,$(MKFILES))
- # The default target.
-@@ -98,14 +102,15 @@
-         $(RUBY) $(srcdir)/genmk.rb < $< > $@; \
-       fi
--include $(srcdir)/conf/$(host_cpu)-$(host_vendor).mk
-+include $(srcdir)/conf/$(target_cpu)-$(platform).mk
- ### General targets.
- CLEANFILES += moddep.lst command.lst fs.lst
- pkgdata_DATA += moddep.lst command.lst fs.lst
--moddep.lst: $(DEFSYMFILES) $(UNDSYMFILES) genmoddep
--      cat $(DEFSYMFILES) /dev/null | ./genmoddep $(UNDSYMFILES) > $@ \
-+moddep.lst: $(DEFSYMFILES) $(UNDSYMFILES) genmoddep.awk
-+      cat $(DEFSYMFILES) /dev/null \
-+        | $(AWK) -f $(srcdir)/genmoddep.awk $(UNDSYMFILES) > $@ \
-         || (rm -f $@; exit 1)
- command.lst: $(COMMANDFILES)
-@@ -119,12 +124,12 @@
- install: install-local
- install-local: all
--      $(mkinstalldirs) $(DESTDIR)$(pkgdatadir)
-+      $(mkinstalldirs) $(DESTDIR)$(pkglibdir)
-       @list='$(DATA)'; \
-       for file in $$list; do \
-         if test -f "$$file"; then dir=; else dir="$(srcdir)"; fi; \
-         dest="`echo $$file | sed 's,.*/,,'`"; \
--        $(INSTALL_DATA) $$dir$$file $(DESTDIR)$(pkgdatadir)/$$dest; \
-+        $(INSTALL_DATA) $$dir$$file $(DESTDIR)$(pkglibdir)/$$dest; \
-       done
-       $(mkinstalldirs) $(DESTDIR)$(bindir)
-       @list='$(bin_UTILITIES)'; for file in $$list; do \
-@@ -151,7 +156,7 @@
-       @list='$(DATA)'; \
-       for file in $$list; do \
-         dest="`echo $$file | sed 's,.*/,,'`"; \
--        rm -f $(DESTDIR)$(pkgdatadir)/$$dest; \
-+        rm -f $(DESTDIR)$(pkglibdir)/$$dest; \
-       done
-       @list='$(bin_UTILITIES)'; for file in $$list; do \
-         dest="`echo $$file | sed 's,.*/,,'`"; \
-@@ -250,6 +255,12 @@
- config.status: configure
-       ./config.status --recheck
-+gensymlist.sh: gensymlist.sh.in config.status
-+      ./config.status
-+
-+genkernsyms.sh: genkernsyms.sh.in config.status
-+      ./config.status
-+
- .PHONY: all install install-strip uninstall clean mostlyclean distclean
- .PHONY: maintainer-clean info dvi dist check
-Index: NEWS
-===================================================================
-RCS file: /cvsroot/grub/grub2/NEWS,v
-retrieving revision 1.21
-retrieving revision 1.24
-diff -u -r1.21 -r1.24
---- NEWS       10 Mar 2006 22:27:24 -0000      1.21
-+++ NEWS       4 Jun 2006 12:59:19 -0000       1.24
-@@ -1,3 +1,30 @@
-+New in 1.94 - 2006-06-04:
-+
-+* Fix several serious bugs in HFS+.
-+
-+* Add experimental EFI support. Chainloading and Linux loading are
-+  supported at the moment.
-+
-+* Add a new command "blocklist" to show a block list.
-+
-+* Use --with-platform to specify a boot environment. For now, efi,
-+  ieee1275 and pc are supported.
-+
-+* Use the filename "kernel.elf" instead of "grubof" on ieee1275.
-+
-+* Install GRUB into pkglibdir instead of pkgdatadir.
-+
-+* Support environmental variables. You can export variables by the
-+  command "export".
-+
-+* Remove the commands "default" and "timeout". They are now variables.
-+
-+* Add the commands "source" and "." to include a file.
-+
-+* Implement experimental Video API and a new terminal "gfxterm" based
-+  on the Video API.
-+
-+
- New in 1.93 - 2006-03-10:
- * Add support for the HFS+ wrapper.
-@@ -6,6 +33,7 @@
- * Menu entries are now scriptable.
-+
- New in 1.92 - 2005-12-25:
- * Add support for GPT partition table format.
-Index: README
-===================================================================
-RCS file: /cvsroot/grub/grub2/README,v
-retrieving revision 1.5
-retrieving revision 1.6
-diff -u -r1.5 -r1.6
---- README     7 Aug 2005 14:59:56 -0000       1.5
-+++ README     2 Apr 2006 08:59:23 -0000       1.6
-@@ -11,4 +11,4 @@
- The URL is <http://www.gnu.org/software/grub/grub.html>.
- For now, there is not much documentation yet. Please look at the GRUB
--Wiki <http://www.autistici.org/grub/> for testing procedures.
-+Wiki <http://grub.enbug.org> for testing procedures.
-Index: THANKS
-===================================================================
-RCS file: /cvsroot/grub/grub2/THANKS,v
-retrieving revision 1.11
-retrieving revision 1.12
-diff -u -r1.11 -r1.12
---- THANKS     3 Sep 2005 16:54:26 -0000       1.11
-+++ THANKS     8 May 2006 19:29:10 -0000       1.12
-@@ -14,6 +14,7 @@
- NIIBE Yutaka <gniibe@m17n.org>
- Omniflux <omniflux@omniflux.com>
- Robert Bihlmeyer <robbe@orcus.priv.at>
-+Roger Leigh <rleigh@whinlatter.ukfsn.org>
- Ruslan Nikolaev <nruslan@mail.com>
- Timothy Baldwin <T.E.Baldwin99@members.leeds.ac.uk>
- Tomas Ebenlendr <ebik@ucw.cz>
-Index: config.guess
-===================================================================
-RCS file: /cvsroot/grub/grub2/config.guess,v
-retrieving revision 1.2
-retrieving revision 1.3
-diff -u -r1.2 -r1.3
---- config.guess       6 Aug 2005 15:50:05 -0000       1.2
-+++ config.guess       4 Jun 2006 12:59:19 -0000       1.3
-@@ -1,9 +1,10 @@
- #! /bin/sh
- # Attempt to guess a canonical system name.
- #   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
--#   2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
-+#   2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation,
-+#   Inc.
--timestamp='2005-08-03'
-+timestamp='2006-05-13'
- # This file is free software; you can redistribute it and/or modify it
- # under the terms of the GNU General Public License as published by
-@@ -106,7 +107,7 @@
- trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
- trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
- : ${TMPDIR=/tmp} ;
-- { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
-+ { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
-  { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
-  { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
-  { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
-@@ -206,6 +207,9 @@
-     *:ekkoBSD:*:*)
-       echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
-       exit ;;
-+    *:SolidBSD:*:*)
-+      echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
-+      exit ;;
-     macppc:MirBSD:*:*)
-       echo powerppc-unknown-mirbsd${UNAME_RELEASE}
-       exit ;;
-@@ -764,7 +768,14 @@
-       echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
-       exit ;;
-     *:FreeBSD:*:*)
--      echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
-+      case ${UNAME_MACHINE} in
-+          pc98)
-+              echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
-+          amd64)
-+              echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
-+          *)
-+              echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
-+      esac
-       exit ;;
-     i*:CYGWIN*:*)
-       echo ${UNAME_MACHINE}-pc-cygwin
-@@ -779,8 +790,11 @@
-     i*:PW*:*)
-       echo ${UNAME_MACHINE}-pc-pw32
-       exit ;;
--    x86:Interix*:[34]*)
--      echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//'
-+    x86:Interix*:[345]*)
-+      echo i586-pc-interix${UNAME_RELEASE}
-+      exit ;;
-+    EM64T:Interix*:[345]*)
-+      echo x86_64-unknown-interix${UNAME_RELEASE}
-       exit ;;
-     [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
-       echo i${UNAME_MACHINE}-pc-mks
-@@ -851,7 +865,11 @@
-       #endif
-       #endif
- EOF
--      eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
-+      eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
-+          /^CPU/{
-+              s: ::g
-+              p
-+          }'`"
-       test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
-       ;;
-     mips64:Linux:*:*)
-@@ -870,7 +888,11 @@
-       #endif
-       #endif
- EOF
--      eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
-+      eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
-+          /^CPU/{
-+              s: ::g
-+              p
-+          }'`"
-       test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
-       ;;
-     or32:Linux:*:*)
-@@ -919,6 +941,9 @@
-     sparc:Linux:*:* | sparc64:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-gnu
-       exit ;;
-+    vax:Linux:*:*)
-+      echo ${UNAME_MACHINE}-dec-linux-gnu
-+      exit ;;
-     x86_64:Linux:*:*)
-       echo x86_64-unknown-linux-gnu
-       exit ;;
-@@ -964,7 +989,7 @@
-       LIBC=gnulibc1
-       # endif
-       #else
--      #ifdef __INTEL_COMPILER
-+      #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC)
-       LIBC=gnu
-       #else
-       LIBC=gnuaout
-@@ -974,7 +999,11 @@
-       LIBC=dietlibc
-       #endif
- EOF
--      eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
-+      eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
-+          /^LIBC/{
-+              s: ::g
-+              p
-+          }'`"
-       test x"${LIBC}" != x && {
-               echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
-               exit
-@@ -1185,7 +1214,6 @@
-     *:Darwin:*:*)
-       UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
-       case $UNAME_PROCESSOR in
--          *86) UNAME_PROCESSOR=i686 ;;
-           unknown) UNAME_PROCESSOR=powerpc ;;
-       esac
-       echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
-@@ -1264,6 +1292,9 @@
-     i*86:skyos:*:*)
-       echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
-       exit ;;
-+    i*86:rdos:*:*)
-+      echo ${UNAME_MACHINE}-pc-rdos
-+      exit ;;
- esac
- #echo '(No uname command or uname output not recognized.)' 1>&2
-Index: config.h.in
-===================================================================
-RCS file: /cvsroot/grub/grub2/config.h.in,v
-retrieving revision 1.7
-retrieving revision 1.10
-diff -u -r1.7 -r1.10
---- config.h.in        8 Aug 2005 23:15:21 -0000       1.7
-+++ config.h.in        4 Jun 2006 12:59:19 -0000       1.10
-@@ -61,6 +61,9 @@
- /* Define to 1 if you have the <unistd.h> header file. */
- #undef HAVE_UNISTD_H
-+/* Define to 1 if you enable memory manager debugging. */
-+#undef MM_DEBUG
-+
- /* Catch gcc bug */
- #undef NESTED_FUNC_ATTR
-Index: config.sub
-===================================================================
-RCS file: /cvsroot/grub/grub2/config.sub,v
-retrieving revision 1.2
-retrieving revision 1.3
-diff -u -r1.2 -r1.3
---- config.sub 6 Aug 2005 15:50:05 -0000       1.2
-+++ config.sub 4 Jun 2006 12:59:19 -0000       1.3
-@@ -1,9 +1,10 @@
- #! /bin/sh
- # Configuration validation subroutine script.
- #   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
--#   2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
-+#   2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation,
-+#   Inc.
--timestamp='2005-07-08'
-+timestamp='2006-05-13'
- # This file is (in principle) common to ALL GNU software.
- # The presence of a machine in this file suggests that SOME GNU software
-@@ -119,8 +120,9 @@
- # Here we must recognize all the valid KERNEL-OS combinations.
- maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
- case $maybe_os in
--  nto-qnx* | linux-gnu* | linux-dietlibc | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | \
--  kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*)
-+  nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
-+  uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
-+  storm-chaos* | os2-emx* | rtmk-nova*)
-     os=-$maybe_os
-     basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
-     ;;
-@@ -171,6 +173,10 @@
-       -hiux*)
-               os=-hiuxwe2
-               ;;
-+      -sco6)
-+              os=-sco5v6
-+              basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
-+              ;;
-       -sco5)
-               os=-sco3.2v5
-               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
-@@ -187,6 +193,10 @@
-               # Don't forget version if it is 3.2v4 or newer.
-               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
-               ;;
-+      -sco5v6*)
-+              # Don't forget version if it is 3.2v4 or newer.
-+              basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
-+              ;;
-       -sco*)
-               os=-sco3.2v2
-               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
-@@ -239,7 +249,8 @@
-       | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
-       | i370 | i860 | i960 | ia64 \
-       | ip2k | iq2000 \
--      | m32r | m32rle | m68000 | m68k | m88k | maxq | mcore \
-+      | m32c | m32r | m32rle | m68000 | m68k | m88k \
-+      | maxq | mb | microblaze | mcore \
-       | mips | mipsbe | mipseb | mipsel | mipsle \
-       | mips16 \
-       | mips64 | mips64el \
-@@ -257,18 +268,19 @@
-       | mipsisa64sr71k | mipsisa64sr71kel \
-       | mipstx39 | mipstx39el \
-       | mn10200 | mn10300 \
--      | ms1 \
-+      | mt \
-       | msp430 \
-+      | nios | nios2 \
-       | ns16k | ns32k \
-       | or32 \
-       | pdp10 | pdp11 | pj | pjl \
-       | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
-       | pyramid \
--      | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \
-+      | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
-       | sh64 | sh64le \
--      | sparc | sparc64 | sparc64b | sparc86x | sparclet | sparclite \
--      | sparcv8 | sparcv9 | sparcv9b \
--      | strongarm \
-+      | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
-+      | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
-+      | spu | strongarm \
-       | tahoe | thumb | tic4x | tic80 | tron \
-       | v850 | v850e \
-       | we32k \
-@@ -276,9 +288,6 @@
-       | z8k)
-               basic_machine=$basic_machine-unknown
-               ;;
--      m32c)
--              basic_machine=$basic_machine-unknown
--              ;;
-       m6811 | m68hc11 | m6812 | m68hc12)
-               # Motorola 68HC11/12.
-               basic_machine=$basic_machine-unknown
-@@ -286,6 +295,9 @@
-               ;;
-       m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
-               ;;
-+      ms1)
-+              basic_machine=mt-unknown
-+              ;;
-       # We use `pc' rather than `unknown'
-       # because (1) that's what they normally are, and
-@@ -316,7 +328,7 @@
-       | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
-       | i*86-* | i860-* | i960-* | ia64-* \
-       | ip2k-* | iq2000-* \
--      | m32r-* | m32rle-* \
-+      | m32c-* | m32r-* | m32rle-* \
-       | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
-       | m88110-* | m88k-* | maxq-* | mcore-* \
-       | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
-@@ -336,19 +348,20 @@
-       | mipsisa64sr71k-* | mipsisa64sr71kel-* \
-       | mipstx39-* | mipstx39el-* \
-       | mmix-* \
--      | ms1-* \
-+      | mt-* \
-       | msp430-* \
-+      | nios-* | nios2-* \
-       | none-* | np1-* | ns16k-* | ns32k-* \
-       | orion-* \
-       | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
-       | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
-       | pyramid-* \
-       | romp-* | rs6000-* \
--      | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | shbe-* \
-+      | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
-       | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
--      | sparc-* | sparc64-* | sparc64b-* | sparc86x-* | sparclet-* \
-+      | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
-       | sparclite-* \
--      | sparcv8-* | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \
-+      | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
-       | tahoe-* | thumb-* \
-       | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
-       | tron-* \
-@@ -359,8 +372,6 @@
-       | ymp-* \
-       | z8k-*)
-               ;;
--      m32c-*)
--              ;;
-       # Recognize the various machine names and aliases which stand
-       # for a CPU type and a company and sometimes even an OS.
-       386bsd)
-@@ -696,6 +707,9 @@
-               basic_machine=i386-pc
-               os=-msdos
-               ;;
-+      ms1-*)
-+              basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
-+              ;;
-       mvs)
-               basic_machine=i370-ibm
-               os=-mvs
-@@ -803,6 +817,12 @@
-       pc532 | pc532-*)
-               basic_machine=ns32k-pc532
-               ;;
-+      pc98)
-+              basic_machine=i386-pc
-+              ;;
-+      pc98-*)
-+              basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
-+              ;;
-       pentium | p5 | k5 | k6 | nexgen | viac3)
-               basic_machine=i586-pc
-               ;;
-@@ -859,6 +879,10 @@
-               basic_machine=i586-unknown
-               os=-pw32
-               ;;
-+      rdos)
-+              basic_machine=i386-pc
-+              os=-rdos
-+              ;;
-       rom68k)
-               basic_machine=m68k-rom68k
-               os=-coff
-@@ -1101,7 +1125,7 @@
-       sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele)
-               basic_machine=sh-unknown
-               ;;
--      sparc | sparcv8 | sparcv9 | sparcv9b)
-+      sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
-               basic_machine=sparc-sun
-               ;;
-       cydra)
-@@ -1174,21 +1198,23 @@
-             | -aos* \
-             | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
-             | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
--            | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* | -openbsd* \
-+            | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
-+            | -openbsd* | -solidbsd* \
-             | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
-             | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
-             | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
-             | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
-             | -chorusos* | -chorusrdb* \
-             | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
--            | -mingw32* | -linux-gnu* | -linux-uclibc* | -uxpv* | -beos* | -mpeix* | -udk* \
-+            | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
-+            | -uxpv* | -beos* | -mpeix* | -udk* \
-             | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
-             | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
-             | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
-             | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
-             | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
-             | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
--            | -skyos* | -haiku*)
-+            | -skyos* | -haiku* | -rdos*)
-       # Remember, each alternative MUST END IN *, to match a version number.
-               ;;
-       -qnx*)
-@@ -1340,6 +1366,9 @@
- # system, and we'll never get to this point.
- case $basic_machine in
-+        spu-*)
-+              os=-elf
-+              ;;
-       *-acorn)
-               os=-riscix1.2
-               ;;
-@@ -1349,9 +1378,9 @@
-       arm*-semi)
-               os=-aout
-               ;;
--    c4x-* | tic4x-*)
--        os=-coff
--        ;;
-+        c4x-* | tic4x-*)
-+              os=-coff
-+              ;;
-       # This must come before the *-dec entry.
-       pdp10-*)
-               os=-tops20
-Index: configure
-===================================================================
-RCS file: /cvsroot/grub/grub2/configure,v
-retrieving revision 1.30
-retrieving revision 1.40
-diff -u -r1.30 -r1.40
---- configure  10 Mar 2006 22:27:24 -0000      1.30
-+++ configure  4 Jun 2006 12:59:19 -0000       1.40
-@@ -1,6 +1,6 @@
- #! /bin/sh
- # Guess values for system-dependent variables and create Makefiles.
--# Generated by GNU Autoconf 2.59 for GRUB 1.93.
-+# Generated by GNU Autoconf 2.59 for GRUB 1.94.
- #
- # Report bugs to <bug-grub@gnu.org>.
- #
-@@ -269,8 +269,8 @@
- # Identity of this package.
- PACKAGE_NAME='GRUB'
- PACKAGE_TARNAME='grub'
--PACKAGE_VERSION='1.93'
--PACKAGE_STRING='GRUB 1.93'
-+PACKAGE_VERSION='1.94'
-+PACKAGE_STRING='GRUB 1.94'
- PACKAGE_BUGREPORT='bug-grub@gnu.org'
- ac_unique_file="include/grub/dl.h"
-@@ -311,7 +311,7 @@
- # include <unistd.h>
- #endif"
--ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT YACC INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA SET_MAKE OBJCOPY ac_ct_OBJCOPY STRIP ac_ct_STRIP NM ac_ct_NM LD ac_ct_LD RUBY BUILD_CC CPP EGREP LIBLZO LIBCURSES LIBOBJS LTLIBOBJS'
-+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os platform CMP YACC INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA AWK SET_MAKE RUBY CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP EGREP LIBLZO LIBCURSES TARGET_CC ac_ct_TARGET_CC OBJCOPY ac_ct_OBJCOPY STRIP ac_ct_STRIP NM ac_ct_NM TARGET_CFLAGS TARGET_CPPFLAGS TARGET_LDFLAGS LIBOBJS LTLIBOBJS'
- ac_subst_files=''
- # Initialize some variables set by options.
-@@ -780,7 +780,7 @@
-   # Omit some internal or obsolete options to make the list less imposing.
-   # This message is too long to be a string in the A/UX 3.1 sh.
-   cat <<_ACEOF
--\`configure' configures GRUB 1.93 to adapt to many kinds of systems.
-+\`configure' configures GRUB 1.94 to adapt to many kinds of systems.
- Usage: $0 [OPTION]... [VAR=VALUE]...
-@@ -836,12 +836,13 @@
- System types:
-   --build=BUILD     configure for building on BUILD [guessed]
-   --host=HOST       cross-compile to build programs to run on HOST [BUILD]
-+  --target=TARGET   configure for building compilers for TARGET [HOST]
- _ACEOF
- fi
- if test -n "$ac_init_help"; then
-   case $ac_init_help in
--     short | recursive ) echo "Configuration of GRUB 1.93:";;
-+     short | recursive ) echo "Configuration of GRUB 1.94:";;
-    esac
-   cat <<\_ACEOF
-@@ -849,6 +850,13 @@
-   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
-   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
-   --disable-largefile     omit support for large files
-+  --enable-mm-debug       include memory manger debugging
-+
-+Optional Packages:
-+  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
-+  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
-+  --with-platform=PLATFORM
-+                          select the host platform [guessed]
- Some influential environment variables:
-   CC          C compiler command
-@@ -951,14 +959,14 @@
-     else
-       echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
-     fi
--    cd "$ac_popdir"
-+    cd $ac_popdir
-   done
- fi
- test -n "$ac_init_help" && exit 0
- if $ac_init_version; then
-   cat <<\_ACEOF
--GRUB configure 1.93
-+GRUB configure 1.94
- generated by GNU Autoconf 2.59
- Copyright (C) 2003 Free Software Foundation, Inc.
-@@ -972,7 +980,7 @@
- This file contains any messages produced by compilers while
- running configure, to aid debugging if configure makes a mistake.
--It was created by GRUB $as_me 1.93, which was
-+It was created by GRUB $as_me 1.94, which was
- generated by GNU Autoconf 2.59.  Invocation command line was
-   $ $0 $@
-@@ -1313,7 +1321,7 @@
-           ac_config_headers="$ac_config_headers config.h"
--# Checks for build and host systems.
-+# Checks for host and target systems.
- ac_aux_dir=
- for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
-   if test -f $ac_dir/install-sh; then
-@@ -1393,22 +1401,79 @@
- host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
-+echo "$as_me:$LINENO: checking target system type" >&5
-+echo $ECHO_N "checking target system type... $ECHO_C" >&6
-+if test "${ac_cv_target+set}" = set; then
-+  echo $ECHO_N "(cached) $ECHO_C" >&6
-+else
-+  ac_cv_target_alias=$target_alias
-+test "x$ac_cv_target_alias" = "x" &&
-+  ac_cv_target_alias=$ac_cv_host_alias
-+ac_cv_target=`$ac_config_sub $ac_cv_target_alias` ||
-+  { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_target_alias failed" >&5
-+echo "$as_me: error: $ac_config_sub $ac_cv_target_alias failed" >&2;}
-+   { (exit 1); exit 1; }; }
-+
-+fi
-+echo "$as_me:$LINENO: result: $ac_cv_target" >&5
-+echo "${ECHO_T}$ac_cv_target" >&6
-+target=$ac_cv_target
-+target_cpu=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
-+target_vendor=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
-+target_os=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
-+
-+
-+# The aliases save the names the user supplied, while $host etc.
-+# will get canonicalized.
-+test -n "$target_alias" &&
-+  test "$program_prefix$program_suffix$program_transform_name" = \
-+    NONENONEs,x,x, &&
-+  program_prefix=${target_alias}-
- case "$host_cpu" in
--  i[3456]86) host_cpu=i386 ;;
--  x86_64) host_cpu=i386 biarch32=1 ;;
-+  powerpc64) host_m32=1 ;;
-+esac
-+
-+case "$target_cpu" in
-+  i[3456]86) target_cpu=i386 ;;
-+  x86_64) target_cpu=i386 target_m32=1 ;;
-   powerpc) ;;
--  powerpc64) host_cpu=powerpc biarch32=1;;
-+  powerpc64) target_cpu=powerpc target_m32=1;;
-   sparc64) ;;
-   *) { { echo "$as_me:$LINENO: error: unsupported CPU type" >&5
- echo "$as_me: error: unsupported CPU type" >&2;}
-    { (exit 1); exit 1; }; } ;;
- esac
--case "$host_cpu"-"$host_vendor" in
--  i386-*) host_vendor=pc ;;
--  powerpc-*) host_vendor=ieee1275 ;;
--  sparc64-*) host_vendor=ieee1275 ;;
-+# Specify the platform (such as firmware).
-+
-+# Check whether --with-platform or --without-platform was given.
-+if test "${with_platform+set}" = set; then
-+  withval="$with_platform"
-+
-+fi;
-+
-+# Guess the platform if not specified.
-+if test "x$with_platform" = x; then
-+  case "$target_cpu"-"$target_vendor" in
-+    i386-apple) platform=efi ;;
-+    i386-*) platform=pc ;;
-+    powerpc-*) platform=ieee1275 ;;
-+    sparc64-*) platform=ieee1275 ;;
-+    *) { { echo "$as_me:$LINENO: error: unsupported machine type" >&5
-+echo "$as_me: error: unsupported machine type" >&2;}
-+   { (exit 1); exit 1; }; } ;;
-+  esac
-+else
-+  platform="$with_platform"
-+fi
-+
-+# Sanity check.
-+case "$target_cpu"-"$platform" in
-+  i386-efi) ;;
-+  i386-pc) ;;
-+  powerpc-ieee1275) ;;
-+  sparc64-ieee1275) ;;
-   *) { { echo "$as_me:$LINENO: error: unsupported machine type" >&5
- echo "$as_me: error: unsupported machine type" >&2;}
-    { (exit 1); exit 1; }; } ;;
-@@ -1417,26 +1482,23 @@
--# Checks for programs.
--if test "x$CFLAGS" = x; then
--  default_CFLAGS=yes
--fi
-+#
-+# Checks for build programs.
-+#
--ac_ext=c
--ac_cpp='$CPP $CPPFLAGS'
--ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
--ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
--ac_compiler_gnu=$ac_cv_c_compiler_gnu
--if test -n "$ac_tool_prefix"; then
--  # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
--set dummy ${ac_tool_prefix}gcc; ac_word=$2
-+# Although cmp is listed in the GNU Coding Standards as a command which
-+# can used directly, OpenBSD lacks cmp in the default installation.
-+for ac_prog in cmp
-+do
-+  # Extract the first word of "$ac_prog", so it can be a program name with args.
-+set dummy $ac_prog; ac_word=$2
- echo "$as_me:$LINENO: checking for $ac_word" >&5
- echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
--if test "${ac_cv_prog_CC+set}" = set; then
-+if test "${ac_cv_prog_CMP+set}" = set; then
-   echo $ECHO_N "(cached) $ECHO_C" >&6
- else
--  if test -n "$CC"; then
--  ac_cv_prog_CC="$CC" # Let the user override the test.
-+  if test -n "$CMP"; then
-+  ac_cv_prog_CMP="$CMP" # Let the user override the test.
- else
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
- for as_dir in $PATH
-@@ -1445,7 +1507,7 @@
-   test -z "$as_dir" && as_dir=.
-   for ac_exec_ext in '' $ac_executable_extensions; do
-   if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
--    ac_cv_prog_CC="${ac_tool_prefix}gcc"
-+    ac_cv_prog_CMP="$ac_prog"
-     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-     break 2
-   fi
-@@ -1454,27 +1516,35 @@
- fi
- fi
--CC=$ac_cv_prog_CC
--if test -n "$CC"; then
--  echo "$as_me:$LINENO: result: $CC" >&5
--echo "${ECHO_T}$CC" >&6
-+CMP=$ac_cv_prog_CMP
-+if test -n "$CMP"; then
-+  echo "$as_me:$LINENO: result: $CMP" >&5
-+echo "${ECHO_T}$CMP" >&6
- else
-   echo "$as_me:$LINENO: result: no" >&5
- echo "${ECHO_T}no" >&6
- fi
-+  test -n "$CMP" && break
-+done
-+
-+if test "x$CMP" = x; then
-+  { { echo "$as_me:$LINENO: error: cmp is not found" >&5
-+echo "$as_me: error: cmp is not found" >&2;}
-+   { (exit 1); exit 1; }; }
- fi
--if test -z "$ac_cv_prog_CC"; then
--  ac_ct_CC=$CC
--  # Extract the first word of "gcc", so it can be a program name with args.
--set dummy gcc; ac_word=$2
-+
-+for ac_prog in bison
-+do
-+  # Extract the first word of "$ac_prog", so it can be a program name with args.
-+set dummy $ac_prog; ac_word=$2
- echo "$as_me:$LINENO: checking for $ac_word" >&5
- echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
--if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
-+if test "${ac_cv_prog_YACC+set}" = set; then
-   echo $ECHO_N "(cached) $ECHO_C" >&6
- else
--  if test -n "$ac_ct_CC"; then
--  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
-+  if test -n "$YACC"; then
-+  ac_cv_prog_YACC="$YACC" # Let the user override the test.
- else
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
- for as_dir in $PATH
-@@ -1483,7 +1553,7 @@
-   test -z "$as_dir" && as_dir=.
-   for ac_exec_ext in '' $ac_executable_extensions; do
-   if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
--    ac_cv_prog_ac_ct_CC="gcc"
-+    ac_cv_prog_YACC="$ac_prog"
-     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-     break 2
-   fi
-@@ -1492,31 +1562,114 @@
- fi
- fi
--ac_ct_CC=$ac_cv_prog_ac_ct_CC
--if test -n "$ac_ct_CC"; then
--  echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
--echo "${ECHO_T}$ac_ct_CC" >&6
-+YACC=$ac_cv_prog_YACC
-+if test -n "$YACC"; then
-+  echo "$as_me:$LINENO: result: $YACC" >&5
-+echo "${ECHO_T}$YACC" >&6
- else
-   echo "$as_me:$LINENO: result: no" >&5
- echo "${ECHO_T}no" >&6
- fi
--  CC=$ac_ct_CC
-+  test -n "$YACC" && break
-+done
-+
-+if test "x$YACC" = x; then
-+  { { echo "$as_me:$LINENO: error: bison is not found" >&5
-+echo "$as_me: error: bison is not found" >&2;}
-+   { (exit 1); exit 1; }; }
-+fi
-+
-+# Find a good install program.  We prefer a C program (faster),
-+# so one script is as good as another.  But avoid the broken or
-+# incompatible versions:
-+# SysV /etc/install, /usr/sbin/install
-+# SunOS /usr/etc/install
-+# IRIX /sbin/install
-+# AIX /bin/install
-+# AmigaOS /C/install, which installs bootblocks on floppy discs
-+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
-+# AFS /usr/afsws/bin/install, which mishandles nonexistent args
-+# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
-+# OS/2's system install, which has a completely different semantic
-+# ./install, which can be erroneously created by make from ./install.sh.
-+echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
-+echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6
-+if test -z "$INSTALL"; then
-+if test "${ac_cv_path_install+set}" = set; then
-+  echo $ECHO_N "(cached) $ECHO_C" >&6
- else
--  CC="$ac_cv_prog_CC"
-+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-+for as_dir in $PATH
-+do
-+  IFS=$as_save_IFS
-+  test -z "$as_dir" && as_dir=.
-+  # Account for people who put trailing slashes in PATH elements.
-+case $as_dir/ in
-+  ./ | .// | /cC/* | \
-+  /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
-+  ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \
-+  /usr/ucb/* ) ;;
-+  *)
-+    # OSF1 and SCO ODT 3.0 have their own names for install.
-+    # Don't use installbsd from OSF since it installs stuff as root
-+    # by default.
-+    for ac_prog in ginstall scoinst install; do
-+      for ac_exec_ext in '' $ac_executable_extensions; do
-+      if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
-+        if test $ac_prog = install &&
-+          grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
-+          # AIX install.  It has an incompatible calling convention.
-+          :
-+        elif test $ac_prog = install &&
-+          grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
-+          # program-specific install script used by HP pwplus--don't use.
-+          :
-+        else
-+          ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
-+          break 3
-+        fi
-+      fi
-+      done
-+    done
-+    ;;
-+esac
-+done
-+
-+
-+fi
-+  if test "${ac_cv_path_install+set}" = set; then
-+    INSTALL=$ac_cv_path_install
-+  else
-+    # As a last resort, use the slow shell script.  We don't cache a
-+    # path for INSTALL within a source directory, because that will
-+    # break other packages using the cache if that directory is
-+    # removed, or if the path is relative.
-+    INSTALL=$ac_install_sh
-+  fi
- fi
-+echo "$as_me:$LINENO: result: $INSTALL" >&5
-+echo "${ECHO_T}$INSTALL" >&6
--if test -z "$CC"; then
--  if test -n "$ac_tool_prefix"; then
--  # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
--set dummy ${ac_tool_prefix}cc; ac_word=$2
-+# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
-+# It thinks the first close brace ends the variable substitution.
-+test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
-+
-+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
-+
-+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
-+
-+for ac_prog in gawk mawk nawk awk
-+do
-+  # Extract the first word of "$ac_prog", so it can be a program name with args.
-+set dummy $ac_prog; ac_word=$2
- echo "$as_me:$LINENO: checking for $ac_word" >&5
- echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
--if test "${ac_cv_prog_CC+set}" = set; then
-+if test "${ac_cv_prog_AWK+set}" = set; then
-   echo $ECHO_N "(cached) $ECHO_C" >&6
- else
--  if test -n "$CC"; then
--  ac_cv_prog_CC="$CC" # Let the user override the test.
-+  if test -n "$AWK"; then
-+  ac_cv_prog_AWK="$AWK" # Let the user override the test.
- else
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
- for as_dir in $PATH
-@@ -1525,7 +1678,7 @@
-   test -z "$as_dir" && as_dir=.
-   for ac_exec_ext in '' $ac_executable_extensions; do
-   if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
--    ac_cv_prog_CC="${ac_tool_prefix}cc"
-+    ac_cv_prog_AWK="$ac_prog"
-     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-     break 2
-   fi
-@@ -1534,62 +1687,101 @@
- fi
- fi
--CC=$ac_cv_prog_CC
--if test -n "$CC"; then
--  echo "$as_me:$LINENO: result: $CC" >&5
--echo "${ECHO_T}$CC" >&6
-+AWK=$ac_cv_prog_AWK
-+if test -n "$AWK"; then
-+  echo "$as_me:$LINENO: result: $AWK" >&5
-+echo "${ECHO_T}$AWK" >&6
- else
-   echo "$as_me:$LINENO: result: no" >&5
- echo "${ECHO_T}no" >&6
- fi
-+  test -n "$AWK" && break
-+done
-+
-+echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
-+echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6
-+set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'`
-+if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
-+  echo $ECHO_N "(cached) $ECHO_C" >&6
-+else
-+  cat >conftest.make <<\_ACEOF
-+all:
-+      @echo 'ac_maketemp="$(MAKE)"'
-+_ACEOF
-+# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
-+eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
-+if test -n "$ac_maketemp"; then
-+  eval ac_cv_prog_make_${ac_make}_set=yes
-+else
-+  eval ac_cv_prog_make_${ac_make}_set=no
- fi
--if test -z "$ac_cv_prog_CC"; then
--  ac_ct_CC=$CC
--  # Extract the first word of "cc", so it can be a program name with args.
--set dummy cc; ac_word=$2
-+rm -f conftest.make
-+fi
-+if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
-+  echo "$as_me:$LINENO: result: yes" >&5
-+echo "${ECHO_T}yes" >&6
-+  SET_MAKE=
-+else
-+  echo "$as_me:$LINENO: result: no" >&5
-+echo "${ECHO_T}no" >&6
-+  SET_MAKE="MAKE=${MAKE-make}"
-+fi
-+
-+
-+# This is not a "must".
-+# Extract the first word of "ruby", so it can be a program name with args.
-+set dummy ruby; ac_word=$2
- echo "$as_me:$LINENO: checking for $ac_word" >&5
- echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
--if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
-+if test "${ac_cv_path_RUBY+set}" = set; then
-   echo $ECHO_N "(cached) $ECHO_C" >&6
- else
--  if test -n "$ac_ct_CC"; then
--  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
--else
--as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-+  case $RUBY in
-+  [\\/]* | ?:[\\/]*)
-+  ac_cv_path_RUBY="$RUBY" # Let the user override the test with a path.
-+  ;;
-+  *)
-+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
- for as_dir in $PATH
- do
-   IFS=$as_save_IFS
-   test -z "$as_dir" && as_dir=.
-   for ac_exec_ext in '' $ac_executable_extensions; do
-   if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
--    ac_cv_prog_ac_ct_CC="cc"
-+    ac_cv_path_RUBY="$as_dir/$ac_word$ac_exec_ext"
-     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-     break 2
-   fi
- done
- done
-+  ;;
-+esac
- fi
--fi
--ac_ct_CC=$ac_cv_prog_ac_ct_CC
--if test -n "$ac_ct_CC"; then
--  echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
--echo "${ECHO_T}$ac_ct_CC" >&6
-+RUBY=$ac_cv_path_RUBY
-+
-+if test -n "$RUBY"; then
-+  echo "$as_me:$LINENO: result: $RUBY" >&5
-+echo "${ECHO_T}$RUBY" >&6
- else
-   echo "$as_me:$LINENO: result: no" >&5
- echo "${ECHO_T}no" >&6
- fi
--  CC=$ac_ct_CC
--else
--  CC="$ac_cv_prog_CC"
--fi
--fi
--if test -z "$CC"; then
--  # Extract the first word of "cc", so it can be a program name with args.
--set dummy cc; ac_word=$2
-+#
-+# Checks for host programs.
-+#
-+
-+ac_ext=c
-+ac_cpp='$CPP $CPPFLAGS'
-+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-+ac_compiler_gnu=$ac_cv_c_compiler_gnu
-+if test -n "$ac_tool_prefix"; then
-+  # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
-+set dummy ${ac_tool_prefix}gcc; ac_word=$2
- echo "$as_me:$LINENO: checking for $ac_word" >&5
- echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
- if test "${ac_cv_prog_CC+set}" = set; then
-@@ -1598,7 +1790,6 @@
-   if test -n "$CC"; then
-   ac_cv_prog_CC="$CC" # Let the user override the test.
- else
--  ac_prog_rejected=no
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
- for as_dir in $PATH
- do
-@@ -1606,11 +1797,172 @@
-   test -z "$as_dir" && as_dir=.
-   for ac_exec_ext in '' $ac_executable_extensions; do
-   if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
--    if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
--       ac_prog_rejected=yes
--       continue
--     fi
--    ac_cv_prog_CC="cc"
-+    ac_cv_prog_CC="${ac_tool_prefix}gcc"
-+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-+    break 2
-+  fi
-+done
-+done
-+
-+fi
-+fi
-+CC=$ac_cv_prog_CC
-+if test -n "$CC"; then
-+  echo "$as_me:$LINENO: result: $CC" >&5
-+echo "${ECHO_T}$CC" >&6
-+else
-+  echo "$as_me:$LINENO: result: no" >&5
-+echo "${ECHO_T}no" >&6
-+fi
-+
-+fi
-+if test -z "$ac_cv_prog_CC"; then
-+  ac_ct_CC=$CC
-+  # Extract the first word of "gcc", so it can be a program name with args.
-+set dummy gcc; ac_word=$2
-+echo "$as_me:$LINENO: checking for $ac_word" >&5
-+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
-+  echo $ECHO_N "(cached) $ECHO_C" >&6
-+else
-+  if test -n "$ac_ct_CC"; then
-+  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
-+else
-+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-+for as_dir in $PATH
-+do
-+  IFS=$as_save_IFS
-+  test -z "$as_dir" && as_dir=.
-+  for ac_exec_ext in '' $ac_executable_extensions; do
-+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-+    ac_cv_prog_ac_ct_CC="gcc"
-+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-+    break 2
-+  fi
-+done
-+done
-+
-+fi
-+fi
-+ac_ct_CC=$ac_cv_prog_ac_ct_CC
-+if test -n "$ac_ct_CC"; then
-+  echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
-+echo "${ECHO_T}$ac_ct_CC" >&6
-+else
-+  echo "$as_me:$LINENO: result: no" >&5
-+echo "${ECHO_T}no" >&6
-+fi
-+
-+  CC=$ac_ct_CC
-+else
-+  CC="$ac_cv_prog_CC"
-+fi
-+
-+if test -z "$CC"; then
-+  if test -n "$ac_tool_prefix"; then
-+  # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
-+set dummy ${ac_tool_prefix}cc; ac_word=$2
-+echo "$as_me:$LINENO: checking for $ac_word" >&5
-+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-+if test "${ac_cv_prog_CC+set}" = set; then
-+  echo $ECHO_N "(cached) $ECHO_C" >&6
-+else
-+  if test -n "$CC"; then
-+  ac_cv_prog_CC="$CC" # Let the user override the test.
-+else
-+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-+for as_dir in $PATH
-+do
-+  IFS=$as_save_IFS
-+  test -z "$as_dir" && as_dir=.
-+  for ac_exec_ext in '' $ac_executable_extensions; do
-+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-+    ac_cv_prog_CC="${ac_tool_prefix}cc"
-+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-+    break 2
-+  fi
-+done
-+done
-+
-+fi
-+fi
-+CC=$ac_cv_prog_CC
-+if test -n "$CC"; then
-+  echo "$as_me:$LINENO: result: $CC" >&5
-+echo "${ECHO_T}$CC" >&6
-+else
-+  echo "$as_me:$LINENO: result: no" >&5
-+echo "${ECHO_T}no" >&6
-+fi
-+
-+fi
-+if test -z "$ac_cv_prog_CC"; then
-+  ac_ct_CC=$CC
-+  # Extract the first word of "cc", so it can be a program name with args.
-+set dummy cc; ac_word=$2
-+echo "$as_me:$LINENO: checking for $ac_word" >&5
-+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
-+  echo $ECHO_N "(cached) $ECHO_C" >&6
-+else
-+  if test -n "$ac_ct_CC"; then
-+  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
-+else
-+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-+for as_dir in $PATH
-+do
-+  IFS=$as_save_IFS
-+  test -z "$as_dir" && as_dir=.
-+  for ac_exec_ext in '' $ac_executable_extensions; do
-+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-+    ac_cv_prog_ac_ct_CC="cc"
-+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-+    break 2
-+  fi
-+done
-+done
-+
-+fi
-+fi
-+ac_ct_CC=$ac_cv_prog_ac_ct_CC
-+if test -n "$ac_ct_CC"; then
-+  echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
-+echo "${ECHO_T}$ac_ct_CC" >&6
-+else
-+  echo "$as_me:$LINENO: result: no" >&5
-+echo "${ECHO_T}no" >&6
-+fi
-+
-+  CC=$ac_ct_CC
-+else
-+  CC="$ac_cv_prog_CC"
-+fi
-+
-+fi
-+if test -z "$CC"; then
-+  # Extract the first word of "cc", so it can be a program name with args.
-+set dummy cc; ac_word=$2
-+echo "$as_me:$LINENO: checking for $ac_word" >&5
-+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-+if test "${ac_cv_prog_CC+set}" = set; then
-+  echo $ECHO_N "(cached) $ECHO_C" >&6
-+else
-+  if test -n "$CC"; then
-+  ac_cv_prog_CC="$CC" # Let the user override the test.
-+else
-+  ac_prog_rejected=no
-+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-+for as_dir in $PATH
-+do
-+  IFS=$as_save_IFS
-+  test -z "$as_dir" && as_dir=.
-+  for ac_exec_ext in '' $ac_executable_extensions; do
-+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-+    if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
-+       ac_prog_rejected=yes
-+       continue
-+     fi
-+    ac_cv_prog_CC="cc"
-     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-     break 2
-   fi
-@@ -1990,7 +2342,8 @@
-   cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } &&
--       { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
-+       { ac_try='test -z "$ac_c_werror_flag"
-+                       || test ! -s conftest.err'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-@@ -2048,7 +2401,8 @@
-   cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } &&
--       { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
-+       { ac_try='test -z "$ac_c_werror_flag"
-+                       || test ! -s conftest.err'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-@@ -2164,7 +2518,8 @@
-   cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } &&
--       { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
-+       { ac_try='test -z "$ac_c_werror_flag"
-+                       || test ! -s conftest.err'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-@@ -2218,7 +2573,8 @@
-   cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } &&
--       { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
-+       { ac_try='test -z "$ac_c_werror_flag"
-+                       || test ! -s conftest.err'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-@@ -2263,7 +2619,8 @@
-   cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } &&
--       { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
-+       { ac_try='test -z "$ac_c_werror_flag"
-+                       || test ! -s conftest.err'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-@@ -2307,7 +2664,8 @@
-   cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } &&
--       { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
-+       { ac_try='test -z "$ac_c_werror_flag"
-+                       || test ! -s conftest.err'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-@@ -2346,52 +2704,10 @@
- ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
- ac_compiler_gnu=$ac_cv_c_compiler_gnu
--
--for ac_prog in bison
--do
--  # Extract the first word of "$ac_prog", so it can be a program name with args.
--set dummy $ac_prog; ac_word=$2
--echo "$as_me:$LINENO: checking for $ac_word" >&5
--echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
--if test "${ac_cv_prog_YACC+set}" = set; then
--  echo $ECHO_N "(cached) $ECHO_C" >&6
--else
--  if test -n "$YACC"; then
--  ac_cv_prog_YACC="$YACC" # Let the user override the test.
--else
--as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
--for as_dir in $PATH
--do
--  IFS=$as_save_IFS
--  test -z "$as_dir" && as_dir=.
--  for ac_exec_ext in '' $ac_executable_extensions; do
--  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
--    ac_cv_prog_YACC="$ac_prog"
--    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
--    break 2
--  fi
--done
--done
--
--fi
--fi
--YACC=$ac_cv_prog_YACC
--if test -n "$YACC"; then
--  echo "$as_me:$LINENO: result: $YACC" >&5
--echo "${ECHO_T}$YACC" >&6
--else
--  echo "$as_me:$LINENO: result: no" >&5
--echo "${ECHO_T}no" >&6
--fi
--
--  test -n "$YACC" && break
--done
--
--if test "x$YACC" = x; then
--  { { echo "$as_me:$LINENO: error: Could not find bison." >&5
--echo "$as_me: error: Could not find bison." >&2;}
-+# Must be GCC.
-+test "x$GCC" = xyes || { { echo "$as_me:$LINENO: error: GCC is required" >&5
-+echo "$as_me: error: GCC is required" >&2;}
-    { (exit 1); exit 1; }; }
--fi
- # Check whether --enable-largefile or --disable-largefile was given.
-@@ -2444,7 +2760,8 @@
-   cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } &&
--       { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
-+       { ac_try='test -z "$ac_c_werror_flag"
-+                       || test ! -s conftest.err'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-@@ -2473,7 +2790,8 @@
-   cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } &&
--       { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
-+       { ac_try='test -z "$ac_c_werror_flag"
-+                       || test ! -s conftest.err'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-@@ -2543,7 +2861,8 @@
-   cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } &&
--       { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
-+       { ac_try='test -z "$ac_c_werror_flag"
-+                       || test ! -s conftest.err'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-@@ -2595,7 +2914,8 @@
-   cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } &&
--       { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
-+       { ac_try='test -z "$ac_c_werror_flag"
-+                       || test ! -s conftest.err'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-@@ -2666,7 +2986,8 @@
-   cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } &&
--       { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
-+       { ac_try='test -z "$ac_c_werror_flag"
-+                       || test ! -s conftest.err'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-@@ -2718,7 +3039,8 @@
-   cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } &&
--       { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
-+       { ac_try='test -z "$ac_c_werror_flag"
-+                       || test ! -s conftest.err'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-@@ -2753,34 +3075,28 @@
- fi
--# Must be GCC.
--test "x$GCC" = xyes || { { echo "$as_me:$LINENO: error: GCC is required" >&5
--echo "$as_me: error: GCC is required" >&2;}
--   { (exit 1); exit 1; }; }
--
--if test "x$default_CFLAGS" = xyes; then
--  # debug flags.
--  tmp_CFLAGS="-Wall -W -Wshadow -Wpointer-arith -Wmissing-prototypes \
--              -Wundef -Wstrict-prototypes -g"
--
--  # optimization flags.
--  echo "$as_me:$LINENO: checking whether optimization for size works" >&5
--echo $ECHO_N "checking whether optimization for size works... $ECHO_C" >&6
--if test "${size_flag+set}" = set; then
-+# Identify characteristics of the host architecture.
-+echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5
-+echo $ECHO_N "checking whether byte ordering is bigendian... $ECHO_C" >&6
-+if test "${ac_cv_c_bigendian+set}" = set; then
-   echo $ECHO_N "(cached) $ECHO_C" >&6
- else
--
--    CFLAGS=-Os
--    cat >conftest.$ac_ext <<_ACEOF
-+  # See if sys/param.h defines the BYTE_ORDER macro.
-+cat >conftest.$ac_ext <<_ACEOF
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
- cat >>conftest.$ac_ext <<_ACEOF
- /* end confdefs.h.  */
-+#include <sys/types.h>
-+#include <sys/param.h>
- int
- main ()
- {
-+#if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
-+ bogus endian macros
-+#endif
-   ;
-   return 0;
-@@ -2795,7 +3111,8 @@
-   cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } &&
--       { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
-+       { ac_try='test -z "$ac_c_werror_flag"
-+                       || test ! -s conftest.err'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-@@ -2807,43 +3124,22 @@
-   ac_status=$?
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); }; }; then
--  size_flag=yes
--else
--  echo "$as_me: failed program was:" >&5
--sed 's/^/| /' conftest.$ac_ext >&5
--
--size_flag=no
--fi
--rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
--
--fi
--echo "$as_me:$LINENO: result: $size_flag" >&5
--echo "${ECHO_T}$size_flag" >&6
--  if test "x$size_flag" = xyes; then
--    tmp_CFLAGS="$tmp_CFLAGS -Os"
--  else
--    tmp_CFLAGS="$tmp_CFLAGS -O2 -fno-strength-reduce -fno-unroll-loops"
--  fi
--
--  # Force no alignment to save space on i386.
--  if test "x$host_cpu" = xi386; then
--    echo "$as_me:$LINENO: checking whether -falign-loops works" >&5
--echo $ECHO_N "checking whether -falign-loops works... $ECHO_C" >&6
--if test "${falign_loop_flag+set}" = set; then
--  echo $ECHO_N "(cached) $ECHO_C" >&6
--else
--
--      CFLAGS="-falign-loops=1"
--      cat >conftest.$ac_ext <<_ACEOF
--/* confdefs.h.  */
--_ACEOF
--cat confdefs.h >>conftest.$ac_ext
--cat >>conftest.$ac_ext <<_ACEOF
--/* end confdefs.h.  */
-+  # It does; now see whether it defined to BIG_ENDIAN or not.
-+cat >conftest.$ac_ext <<_ACEOF
-+/* confdefs.h.  */
-+_ACEOF
-+cat confdefs.h >>conftest.$ac_ext
-+cat >>conftest.$ac_ext <<_ACEOF
-+/* end confdefs.h.  */
-+#include <sys/types.h>
-+#include <sys/param.h>
- int
- main ()
- {
-+#if BYTE_ORDER != BIG_ENDIAN
-+ not big endian
-+#endif
-   ;
-   return 0;
-@@ -2858,7 +3154,8 @@
-   cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } &&
--       { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
-+       { ac_try='test -z "$ac_c_werror_flag"
-+                       || test ! -s conftest.err'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-@@ -2870,146 +3167,81 @@
-   ac_status=$?
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); }; }; then
--  falign_loop_flag=yes
-+  ac_cv_c_bigendian=yes
- else
-   echo "$as_me: failed program was:" >&5
- sed 's/^/| /' conftest.$ac_ext >&5
--falign_loop_flag=no
-+ac_cv_c_bigendian=no
- fi
- rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
--
--fi
--echo "$as_me:$LINENO: result: $falign_loop_flag" >&5
--echo "${ECHO_T}$falign_loop_flag" >&6
--
--    if test "x$falign_loop_flag" = xyes; then
--      tmp_CFLAGS="$tmp_CFLAGS -falign-jumps=1 -falign-loops=1 -falign-functions=1"
--    else
--      tmp_CFLAGS="$tmp_CFLAGS -malign-jumps=1 -malign-loops=1 -malign-functions=1"
--    fi
--  fi
--
--  if test "x$biarch32" = x1; then
--    tmp_CFLAGS="$tmp_CFLAGS -m32"
--  fi
--
--  CFLAGS="$tmp_CFLAGS"
--fi
--
--
--# Defined in aclocal.m4.
--
--echo "$as_me:$LINENO: checking if C symbols get an underscore after compilation" >&5
--echo $ECHO_N "checking if C symbols get an underscore after compilation... $ECHO_C" >&6
--if test "${grub_cv_asm_uscore+set}" = set; then
--  echo $ECHO_N "(cached) $ECHO_C" >&6
--else
--  cat > conftest.c <<\EOF
--int
--func (int *list)
--{
--  *list = 0;
--  return *list;
--}
--EOF
--
--if { ac_try='${CC-cc} ${CFLAGS} -S conftest.c'
--  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
--  (eval $ac_try) 2>&5
--  ac_status=$?
--  echo "$as_me:$LINENO: \$? = $ac_status" >&5
--  (exit $ac_status); }; } && test -s conftest.s; then
--  true
--else
--  { { echo "$as_me:$LINENO: error: ${CC-cc} failed to produce assembly code" >&5
--echo "$as_me: error: ${CC-cc} failed to produce assembly code" >&2;}
--   { (exit 1); exit 1; }; }
--fi
--
--if grep _func conftest.s >/dev/null 2>&1; then
--  grub_cv_asm_uscore=yes
- else
--  grub_cv_asm_uscore=no
--fi
--
--rm -f conftest*
--fi
--
--
--if test "x$grub_cv_asm_uscore" = xyes; then
--
--cat >>confdefs.h <<_ACEOF
--#define HAVE_ASM_USCORE $grub_cv_asm_uscore
--_ACEOF
--
--fi
--
--echo "$as_me:$LINENO: result: $grub_cv_asm_uscore" >&5
--echo "${ECHO_T}$grub_cv_asm_uscore" >&6
--
--if test "x$host_cpu" = xi386; then
-+  echo "$as_me: failed program was:" >&5
-+sed 's/^/| /' conftest.$ac_ext >&5
--echo "$as_me:$LINENO: checking if start is defined by the compiler" >&5
--echo $ECHO_N "checking if start is defined by the compiler... $ECHO_C" >&6
--if test "${grub_cv_check_start_symbol+set}" = set; then
--  echo $ECHO_N "(cached) $ECHO_C" >&6
--else
-+# It does not; compile a test program.
-+if test "$cross_compiling" = yes; then
-+  # try to guess the endianness by grepping values into an object file
-+  ac_cv_c_bigendian=unknown
-   cat >conftest.$ac_ext <<_ACEOF
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
- cat >>conftest.$ac_ext <<_ACEOF
- /* end confdefs.h.  */
--
-+short ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
-+short ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
-+void _ascii () { char *s = (char *) ascii_mm; s = (char *) ascii_ii; }
-+short ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
-+short ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
-+void _ebcdic () { char *s = (char *) ebcdic_mm; s = (char *) ebcdic_ii; }
- int
- main ()
- {
--asm ("incl start")
-+ _ascii (); _ebcdic ();
-   ;
-   return 0;
- }
- _ACEOF
--rm -f conftest.$ac_objext conftest$ac_exeext
--if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
--  (eval $ac_link) 2>conftest.er1
-+rm -f conftest.$ac_objext
-+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-+  (eval $ac_compile) 2>conftest.er1
-   ac_status=$?
-   grep -v '^ *+' conftest.er1 >conftest.err
-   rm -f conftest.er1
-   cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } &&
--       { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
-+       { ac_try='test -z "$ac_c_werror_flag"
-+                       || test ! -s conftest.err'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); }; } &&
--       { ac_try='test -s conftest$ac_exeext'
-+       { ac_try='test -s conftest.$ac_objext'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); }; }; then
--  grub_cv_check_start_symbol=yes
-+  if grep BIGenDianSyS conftest.$ac_objext >/dev/null ; then
-+  ac_cv_c_bigendian=yes
-+fi
-+if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then
-+  if test "$ac_cv_c_bigendian" = unknown; then
-+    ac_cv_c_bigendian=no
-+  else
-+    # finding both strings is unlikely to happen, but who knows?
-+    ac_cv_c_bigendian=unknown
-+  fi
-+fi
- else
-   echo "$as_me: failed program was:" >&5
- sed 's/^/| /' conftest.$ac_ext >&5
--grub_cv_check_start_symbol=no
--fi
--rm -f conftest.err conftest.$ac_objext \
--      conftest$ac_exeext conftest.$ac_ext
- fi
--
--
--echo "$as_me:$LINENO: result: $grub_cv_check_start_symbol" >&5
--echo "${ECHO_T}$grub_cv_check_start_symbol" >&6
--
--echo "$as_me:$LINENO: checking if _start is defined by the compiler" >&5
--echo $ECHO_N "checking if _start is defined by the compiler... $ECHO_C" >&6
--if test "${grub_cv_check_uscore_start_symbol+set}" = set; then
--  echo $ECHO_N "(cached) $ECHO_C" >&6
-+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
- else
-   cat >conftest.$ac_ext <<_ACEOF
- /* confdefs.h.  */
-@@ -3017,186 +3249,316 @@
- cat confdefs.h >>conftest.$ac_ext
- cat >>conftest.$ac_ext <<_ACEOF
- /* end confdefs.h.  */
--
- int
- main ()
- {
--asm ("incl _start")
--  ;
--  return 0;
-+  /* Are we little or big endian?  From Harbison&Steele.  */
-+  union
-+  {
-+    long l;
-+    char c[sizeof (long)];
-+  } u;
-+  u.l = 1;
-+  exit (u.c[sizeof (long) - 1] == 1);
- }
- _ACEOF
--rm -f conftest.$ac_objext conftest$ac_exeext
-+rm -f conftest$ac_exeext
- if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
--  (eval $ac_link) 2>conftest.er1
--  ac_status=$?
--  grep -v '^ *+' conftest.er1 >conftest.err
--  rm -f conftest.er1
--  cat conftest.err >&5
--  echo "$as_me:$LINENO: \$? = $ac_status" >&5
--  (exit $ac_status); } &&
--       { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
--  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
--  (eval $ac_try) 2>&5
-+  (eval $ac_link) 2>&5
-   ac_status=$?
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
--  (exit $ac_status); }; } &&
--       { ac_try='test -s conftest$ac_exeext'
-+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); }; }; then
--  grub_cv_check_uscore_start_symbol=yes
-+  ac_cv_c_bigendian=no
- else
--  echo "$as_me: failed program was:" >&5
-+  echo "$as_me: program exited with status $ac_status" >&5
-+echo "$as_me: failed program was:" >&5
- sed 's/^/| /' conftest.$ac_ext >&5
--grub_cv_check_uscore_start_symbol=no
-+( exit $ac_status )
-+ac_cv_c_bigendian=yes
- fi
--rm -f conftest.err conftest.$ac_objext \
--      conftest$ac_exeext conftest.$ac_ext
-+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
- fi
-+fi
-+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-+fi
-+echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5
-+echo "${ECHO_T}$ac_cv_c_bigendian" >&6
-+case $ac_cv_c_bigendian in
-+  yes)
--
--echo "$as_me:$LINENO: result: $grub_cv_check_uscore_start_symbol" >&5
--echo "${ECHO_T}$grub_cv_check_uscore_start_symbol" >&6
--
--
--
--
--if test "x$grub_cv_check_start_symbol" = xyes; then
--  cat >>confdefs.h <<\_ACEOF
--#define START_SYMBOL start
--_ACEOF
--
--elif test "x$grub_cv_check_uscore_start_symbol" = xyes; then
--  cat >>confdefs.h <<\_ACEOF
--#define START_SYMBOL _start
-+cat >>confdefs.h <<\_ACEOF
-+#define WORDS_BIGENDIAN 1
- _ACEOF
-+ ;;
-+  no)
-+     ;;
-+  *)
-+    { { echo "$as_me:$LINENO: error: unknown endianness
-+presetting ac_cv_c_bigendian=no (or yes) will help" >&5
-+echo "$as_me: error: unknown endianness
-+presetting ac_cv_c_bigendian=no (or yes) will help" >&2;}
-+   { (exit 1); exit 1; }; } ;;
-+esac
--else
--  { { echo "$as_me:$LINENO: error: neither start nor _start is defined" >&5
--echo "$as_me: error: neither start nor _start is defined" >&2;}
--   { (exit 1); exit 1; }; }
-+ac_ext=c
-+ac_cpp='$CPP $CPPFLAGS'
-+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-+ac_compiler_gnu=$ac_cv_c_compiler_gnu
-+echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
-+echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
-+# On Suns, sometimes $CPP names a directory.
-+if test -n "$CPP" && test -d "$CPP"; then
-+  CPP=
- fi
--
--
--echo "$as_me:$LINENO: checking if __bss_start is defined by the compiler" >&5
--echo $ECHO_N "checking if __bss_start is defined by the compiler... $ECHO_C" >&6
--if test "${grub_cv_check_uscore_uscore_bss_start_symbol+set}" = set; then
-+if test -z "$CPP"; then
-+  if test "${ac_cv_prog_CPP+set}" = set; then
-   echo $ECHO_N "(cached) $ECHO_C" >&6
- else
-+      # Double quotes because CPP needs to be expanded
-+    for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
-+    do
-+      ac_preproc_ok=false
-+for ac_c_preproc_warn_flag in '' yes
-+do
-+  # Use a header file that comes with gcc, so configuring glibc
-+  # with a fresh cross-compiler works.
-+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-+  # <limits.h> exists even on freestanding compilers.
-+  # On the NeXT, cc -E runs the code through the compiler's parser,
-+  # not just through cpp. "Syntax error" is here to catch this case.
-   cat >conftest.$ac_ext <<_ACEOF
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
- cat >>conftest.$ac_ext <<_ACEOF
- /* end confdefs.h.  */
--
--int
--main ()
--{
--asm ("incl __bss_start")
--  ;
--  return 0;
--}
-+#ifdef __STDC__
-+# include <limits.h>
-+#else
-+# include <assert.h>
-+#endif
-+                   Syntax error
- _ACEOF
--rm -f conftest.$ac_objext conftest$ac_exeext
--if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
--  (eval $ac_link) 2>conftest.er1
-+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
-   ac_status=$?
-   grep -v '^ *+' conftest.er1 >conftest.err
-   rm -f conftest.er1
-   cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
--  (exit $ac_status); } &&
--       { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
--  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
--  (eval $ac_try) 2>&5
--  ac_status=$?
--  echo "$as_me:$LINENO: \$? = $ac_status" >&5
--  (exit $ac_status); }; } &&
--       { ac_try='test -s conftest$ac_exeext'
--  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
--  (eval $ac_try) 2>&5
-+  (exit $ac_status); } >/dev/null; then
-+  if test -s conftest.err; then
-+    ac_cpp_err=$ac_c_preproc_warn_flag
-+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
-+  else
-+    ac_cpp_err=
-+  fi
-+else
-+  ac_cpp_err=yes
-+fi
-+if test -z "$ac_cpp_err"; then
-+  :
-+else
-+  echo "$as_me: failed program was:" >&5
-+sed 's/^/| /' conftest.$ac_ext >&5
-+
-+  # Broken: fails on valid input.
-+continue
-+fi
-+rm -f conftest.err conftest.$ac_ext
-+
-+  # OK, works on sane cases.  Now check whether non-existent headers
-+  # can be detected and how.
-+  cat >conftest.$ac_ext <<_ACEOF
-+/* confdefs.h.  */
-+_ACEOF
-+cat confdefs.h >>conftest.$ac_ext
-+cat >>conftest.$ac_ext <<_ACEOF
-+/* end confdefs.h.  */
-+#include <ac_nonexistent.h>
-+_ACEOF
-+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
-   ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
--  (exit $ac_status); }; }; then
--  grub_cv_check_uscore_uscore_bss_start_symbol=yes
-+  (exit $ac_status); } >/dev/null; then
-+  if test -s conftest.err; then
-+    ac_cpp_err=$ac_c_preproc_warn_flag
-+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
-+  else
-+    ac_cpp_err=
-+  fi
-+else
-+  ac_cpp_err=yes
-+fi
-+if test -z "$ac_cpp_err"; then
-+  # Broken: success on invalid input.
-+continue
- else
-   echo "$as_me: failed program was:" >&5
- sed 's/^/| /' conftest.$ac_ext >&5
--grub_cv_check_uscore_uscore_bss_start_symbol=no
--fi
--rm -f conftest.err conftest.$ac_objext \
--      conftest$ac_exeext conftest.$ac_ext
-+  # Passes both tests.
-+ac_preproc_ok=:
-+break
- fi
-+rm -f conftest.err conftest.$ac_ext
-+done
-+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-+rm -f conftest.err conftest.$ac_ext
-+if $ac_preproc_ok; then
-+  break
-+fi
--echo "$as_me:$LINENO: result: $grub_cv_check_uscore_uscore_bss_start_symbol" >&5
--echo "${ECHO_T}$grub_cv_check_uscore_uscore_bss_start_symbol" >&6
-+    done
-+    ac_cv_prog_CPP=$CPP
--echo "$as_me:$LINENO: checking if edata is defined by the compiler" >&5
--echo $ECHO_N "checking if edata is defined by the compiler... $ECHO_C" >&6
--if test "${grub_cv_check_edata_symbol+set}" = set; then
--  echo $ECHO_N "(cached) $ECHO_C" >&6
-+fi
-+  CPP=$ac_cv_prog_CPP
- else
-+  ac_cv_prog_CPP=$CPP
-+fi
-+echo "$as_me:$LINENO: result: $CPP" >&5
-+echo "${ECHO_T}$CPP" >&6
-+ac_preproc_ok=false
-+for ac_c_preproc_warn_flag in '' yes
-+do
-+  # Use a header file that comes with gcc, so configuring glibc
-+  # with a fresh cross-compiler works.
-+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-+  # <limits.h> exists even on freestanding compilers.
-+  # On the NeXT, cc -E runs the code through the compiler's parser,
-+  # not just through cpp. "Syntax error" is here to catch this case.
-   cat >conftest.$ac_ext <<_ACEOF
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
- cat >>conftest.$ac_ext <<_ACEOF
- /* end confdefs.h.  */
--
--int
--main ()
--{
--asm ("incl edata")
--  ;
--  return 0;
--}
-+#ifdef __STDC__
-+# include <limits.h>
-+#else
-+# include <assert.h>
-+#endif
-+                   Syntax error
- _ACEOF
--rm -f conftest.$ac_objext conftest$ac_exeext
--if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
--  (eval $ac_link) 2>conftest.er1
-+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
-   ac_status=$?
-   grep -v '^ *+' conftest.er1 >conftest.err
-   rm -f conftest.er1
-   cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
--  (exit $ac_status); } &&
--       { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
--  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
--  (eval $ac_try) 2>&5
--  ac_status=$?
--  echo "$as_me:$LINENO: \$? = $ac_status" >&5
--  (exit $ac_status); }; } &&
--       { ac_try='test -s conftest$ac_exeext'
--  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
--  (eval $ac_try) 2>&5
-+  (exit $ac_status); } >/dev/null; then
-+  if test -s conftest.err; then
-+    ac_cpp_err=$ac_c_preproc_warn_flag
-+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
-+  else
-+    ac_cpp_err=
-+  fi
-+else
-+  ac_cpp_err=yes
-+fi
-+if test -z "$ac_cpp_err"; then
-+  :
-+else
-+  echo "$as_me: failed program was:" >&5
-+sed 's/^/| /' conftest.$ac_ext >&5
-+
-+  # Broken: fails on valid input.
-+continue
-+fi
-+rm -f conftest.err conftest.$ac_ext
-+
-+  # OK, works on sane cases.  Now check whether non-existent headers
-+  # can be detected and how.
-+  cat >conftest.$ac_ext <<_ACEOF
-+/* confdefs.h.  */
-+_ACEOF
-+cat confdefs.h >>conftest.$ac_ext
-+cat >>conftest.$ac_ext <<_ACEOF
-+/* end confdefs.h.  */
-+#include <ac_nonexistent.h>
-+_ACEOF
-+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
-   ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
--  (exit $ac_status); }; }; then
--  grub_cv_check_edata_symbol=yes
-+  (exit $ac_status); } >/dev/null; then
-+  if test -s conftest.err; then
-+    ac_cpp_err=$ac_c_preproc_warn_flag
-+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
-+  else
-+    ac_cpp_err=
-+  fi
-+else
-+  ac_cpp_err=yes
-+fi
-+if test -z "$ac_cpp_err"; then
-+  # Broken: success on invalid input.
-+continue
- else
-   echo "$as_me: failed program was:" >&5
- sed 's/^/| /' conftest.$ac_ext >&5
--grub_cv_check_edata_symbol=no
-+  # Passes both tests.
-+ac_preproc_ok=:
-+break
- fi
--rm -f conftest.err conftest.$ac_objext \
--      conftest$ac_exeext conftest.$ac_ext
-+rm -f conftest.err conftest.$ac_ext
-+
-+done
-+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-+rm -f conftest.err conftest.$ac_ext
-+if $ac_preproc_ok; then
-+  :
-+else
-+  { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
-+See \`config.log' for more details." >&5
-+echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check
-+See \`config.log' for more details." >&2;}
-+   { (exit 1); exit 1; }; }
- fi
-+ac_ext=c
-+ac_cpp='$CPP $CPPFLAGS'
-+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-+ac_compiler_gnu=$ac_cv_c_compiler_gnu
--echo "$as_me:$LINENO: result: $grub_cv_check_edata_symbol" >&5
--echo "${ECHO_T}$grub_cv_check_edata_symbol" >&6
--echo "$as_me:$LINENO: checking if _edata is defined by the compiler" >&5
--echo $ECHO_N "checking if _edata is defined by the compiler... $ECHO_C" >&6
--if test "${grub_cv_check_uscore_edata_symbol+set}" = set; then
-+echo "$as_me:$LINENO: checking for egrep" >&5
-+echo $ECHO_N "checking for egrep... $ECHO_C" >&6
-+if test "${ac_cv_prog_egrep+set}" = set; then
-+  echo $ECHO_N "(cached) $ECHO_C" >&6
-+else
-+  if echo a | (grep -E '(a|b)') >/dev/null 2>&1
-+    then ac_cv_prog_egrep='grep -E'
-+    else ac_cv_prog_egrep='egrep'
-+    fi
-+fi
-+echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5
-+echo "${ECHO_T}$ac_cv_prog_egrep" >&6
-+ EGREP=$ac_cv_prog_egrep
-+
-+
-+echo "$as_me:$LINENO: checking for ANSI C header files" >&5
-+echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
-+if test "${ac_cv_header_stdc+set}" = set; then
-   echo $ECHO_N "(cached) $ECHO_C" >&6
- else
-   cat >conftest.$ac_ext <<_ACEOF
-@@ -3205,80 +3567,96 @@
- cat confdefs.h >>conftest.$ac_ext
- cat >>conftest.$ac_ext <<_ACEOF
- /* end confdefs.h.  */
-+#include <stdlib.h>
-+#include <stdarg.h>
-+#include <string.h>
-+#include <float.h>
- int
- main ()
- {
--asm ("incl _edata")
-+
-   ;
-   return 0;
- }
- _ACEOF
--rm -f conftest.$ac_objext conftest$ac_exeext
--if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
--  (eval $ac_link) 2>conftest.er1
-+rm -f conftest.$ac_objext
-+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-+  (eval $ac_compile) 2>conftest.er1
-   ac_status=$?
-   grep -v '^ *+' conftest.er1 >conftest.err
-   rm -f conftest.er1
-   cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } &&
--       { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
-+       { ac_try='test -z "$ac_c_werror_flag"
-+                       || test ! -s conftest.err'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); }; } &&
--       { ac_try='test -s conftest$ac_exeext'
-+       { ac_try='test -s conftest.$ac_objext'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); }; }; then
--  grub_cv_check_uscore_edata_symbol=yes
-+  ac_cv_header_stdc=yes
- else
-   echo "$as_me: failed program was:" >&5
- sed 's/^/| /' conftest.$ac_ext >&5
--grub_cv_check_uscore_edata_symbol=no
--fi
--rm -f conftest.err conftest.$ac_objext \
--      conftest$ac_exeext conftest.$ac_ext
-+ac_cv_header_stdc=no
- fi
-+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
--
--echo "$as_me:$LINENO: result: $grub_cv_check_uscore_edata_symbol" >&5
--echo "${ECHO_T}$grub_cv_check_uscore_edata_symbol" >&6
--
--
--
--
--if test "x$grub_cv_check_uscore_uscore_bss_start_symbol" = xyes; then
--  cat >>confdefs.h <<\_ACEOF
--#define BSS_START_SYMBOL __bss_start
-+if test $ac_cv_header_stdc = yes; then
-+  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
-+  cat >conftest.$ac_ext <<_ACEOF
-+/* confdefs.h.  */
- _ACEOF
-+cat confdefs.h >>conftest.$ac_ext
-+cat >>conftest.$ac_ext <<_ACEOF
-+/* end confdefs.h.  */
-+#include <string.h>
--elif test "x$grub_cv_check_edata_symbol" = xyes; then
--  cat >>confdefs.h <<\_ACEOF
--#define BSS_START_SYMBOL edata
- _ACEOF
-+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-+  $EGREP "memchr" >/dev/null 2>&1; then
-+  :
-+else
-+  ac_cv_header_stdc=no
-+fi
-+rm -f conftest*
--elif test "x$grub_cv_check_uscore_edata_symbol" = xyes; then
--  cat >>confdefs.h <<\_ACEOF
--#define BSS_START_SYMBOL _edata
-+fi
-+
-+if test $ac_cv_header_stdc = yes; then
-+  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
-+  cat >conftest.$ac_ext <<_ACEOF
-+/* confdefs.h.  */
- _ACEOF
-+cat confdefs.h >>conftest.$ac_ext
-+cat >>conftest.$ac_ext <<_ACEOF
-+/* end confdefs.h.  */
-+#include <stdlib.h>
-+_ACEOF
-+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-+  $EGREP "free" >/dev/null 2>&1; then
-+  :
- else
--  { { echo "$as_me:$LINENO: error: none of __bss_start, edata or _edata is defined" >&5
--echo "$as_me: error: none of __bss_start, edata or _edata is defined" >&2;}
--   { (exit 1); exit 1; }; }
-+  ac_cv_header_stdc=no
- fi
-+rm -f conftest*
-+fi
--echo "$as_me:$LINENO: checking if end is defined by the compiler" >&5
--echo $ECHO_N "checking if end is defined by the compiler... $ECHO_C" >&6
--if test "${grub_cv_check_end_symbol+set}" = set; then
--  echo $ECHO_N "(cached) $ECHO_C" >&6
-+if test $ac_cv_header_stdc = yes; then
-+  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
-+  if test "$cross_compiling" = yes; then
-+  :
- else
-   cat >conftest.$ac_ext <<_ACEOF
- /* confdefs.h.  */
-@@ -3286,54 +3664,139 @@
- cat confdefs.h >>conftest.$ac_ext
- cat >>conftest.$ac_ext <<_ACEOF
- /* end confdefs.h.  */
-+#include <ctype.h>
-+#if ((' ' & 0x0FF) == 0x020)
-+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
-+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
-+#else
-+# define ISLOWER(c) \
-+                 (('a' <= (c) && (c) <= 'i') \
-+                   || ('j' <= (c) && (c) <= 'r') \
-+                   || ('s' <= (c) && (c) <= 'z'))
-+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
-+#endif
-+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
- int
- main ()
- {
--asm ("incl end")
--  ;
--  return 0;
-+  int i;
-+  for (i = 0; i < 256; i++)
-+    if (XOR (islower (i), ISLOWER (i))
-+      || toupper (i) != TOUPPER (i))
-+      exit(2);
-+  exit (0);
- }
- _ACEOF
--rm -f conftest.$ac_objext conftest$ac_exeext
-+rm -f conftest$ac_exeext
- if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
--  (eval $ac_link) 2>conftest.er1
-+  (eval $ac_link) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; }; then
-+  :
-+else
-+  echo "$as_me: program exited with status $ac_status" >&5
-+echo "$as_me: failed program was:" >&5
-+sed 's/^/| /' conftest.$ac_ext >&5
-+
-+( exit $ac_status )
-+ac_cv_header_stdc=no
-+fi
-+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-+fi
-+fi
-+fi
-+echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
-+echo "${ECHO_T}$ac_cv_header_stdc" >&6
-+if test $ac_cv_header_stdc = yes; then
-+
-+cat >>confdefs.h <<\_ACEOF
-+#define STDC_HEADERS 1
-+_ACEOF
-+
-+fi
-+
-+# On IRIX 5.3, sys/types and inttypes.h are conflicting.
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
-+                inttypes.h stdint.h unistd.h
-+do
-+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-+echo "$as_me:$LINENO: checking for $ac_header" >&5
-+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-+if eval "test \"\${$as_ac_Header+set}\" = set"; then
-+  echo $ECHO_N "(cached) $ECHO_C" >&6
-+else
-+  cat >conftest.$ac_ext <<_ACEOF
-+/* confdefs.h.  */
-+_ACEOF
-+cat confdefs.h >>conftest.$ac_ext
-+cat >>conftest.$ac_ext <<_ACEOF
-+/* end confdefs.h.  */
-+$ac_includes_default
-+
-+#include <$ac_header>
-+_ACEOF
-+rm -f conftest.$ac_objext
-+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-+  (eval $ac_compile) 2>conftest.er1
-   ac_status=$?
-   grep -v '^ *+' conftest.er1 >conftest.err
-   rm -f conftest.er1
-   cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } &&
--       { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
-+       { ac_try='test -z "$ac_c_werror_flag"
-+                       || test ! -s conftest.err'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); }; } &&
--       { ac_try='test -s conftest$ac_exeext'
-+       { ac_try='test -s conftest.$ac_objext'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); }; }; then
--  grub_cv_check_end_symbol=yes
-+  eval "$as_ac_Header=yes"
- else
-   echo "$as_me: failed program was:" >&5
- sed 's/^/| /' conftest.$ac_ext >&5
--grub_cv_check_end_symbol=no
-+eval "$as_ac_Header=no"
- fi
--rm -f conftest.err conftest.$ac_objext \
--      conftest$ac_exeext conftest.$ac_ext
-+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-+fi
-+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-+if test `eval echo '${'$as_ac_Header'}'` = yes; then
-+  cat >>confdefs.h <<_ACEOF
-+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-+_ACEOF
-+
- fi
-+done
--echo "$as_me:$LINENO: result: $grub_cv_check_end_symbol" >&5
--echo "${ECHO_T}$grub_cv_check_end_symbol" >&6
--echo "$as_me:$LINENO: checking if _end is defined by the compiler" >&5
--echo $ECHO_N "checking if _end is defined by the compiler... $ECHO_C" >&6
--if test "${grub_cv_check_uscore_end_symbol+set}" = set; then
-+echo "$as_me:$LINENO: checking for void *" >&5
-+echo $ECHO_N "checking for void *... $ECHO_C" >&6
-+if test "${ac_cv_type_void_p+set}" = set; then
-   echo $ECHO_N "(cached) $ECHO_C" >&6
- else
-   cat >conftest.$ac_ext <<_ACEOF
-@@ -3342,1050 +3805,1050 @@
- cat confdefs.h >>conftest.$ac_ext
- cat >>conftest.$ac_ext <<_ACEOF
- /* end confdefs.h.  */
--
-+$ac_includes_default
- int
- main ()
- {
--asm ("incl _end")
-+if ((void * *) 0)
-+  return 0;
-+if (sizeof (void *))
-+  return 0;
-   ;
-   return 0;
- }
- _ACEOF
--rm -f conftest.$ac_objext conftest$ac_exeext
--if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
--  (eval $ac_link) 2>conftest.er1
-+rm -f conftest.$ac_objext
-+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-+  (eval $ac_compile) 2>conftest.er1
-   ac_status=$?
-   grep -v '^ *+' conftest.er1 >conftest.err
-   rm -f conftest.er1
-   cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } &&
--       { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
-+       { ac_try='test -z "$ac_c_werror_flag"
-+                       || test ! -s conftest.err'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); }; } &&
--       { ac_try='test -s conftest$ac_exeext'
-+       { ac_try='test -s conftest.$ac_objext'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); }; }; then
--  grub_cv_check_uscore_end_symbol=yes
-+  ac_cv_type_void_p=yes
- else
-   echo "$as_me: failed program was:" >&5
- sed 's/^/| /' conftest.$ac_ext >&5
--grub_cv_check_uscore_end_symbol=no
--fi
--rm -f conftest.err conftest.$ac_objext \
--      conftest$ac_exeext conftest.$ac_ext
--fi
--
--
--echo "$as_me:$LINENO: result: $grub_cv_check_uscore_end_symbol" >&5
--echo "${ECHO_T}$grub_cv_check_uscore_end_symbol" >&6
--
--
--
--
--if test "x$grub_cv_check_end_symbol" = xyes; then
--  cat >>confdefs.h <<\_ACEOF
--#define END_SYMBOL end
--_ACEOF
--
--elif test "x$grub_cv_check_uscore_end_symbol" = xyes; then
--  cat >>confdefs.h <<\_ACEOF
--#define END_SYMBOL _end
--_ACEOF
--
--else
--  { { echo "$as_me:$LINENO: error: neither end nor _end is defined" >&5
--echo "$as_me: error: neither end nor _end is defined" >&2;}
--   { (exit 1); exit 1; }; }
-+ac_cv_type_void_p=no
- fi
--
-+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
- fi
-+echo "$as_me:$LINENO: result: $ac_cv_type_void_p" >&5
-+echo "${ECHO_T}$ac_cv_type_void_p" >&6
--if test "x$host_cpu" = xi386; then
--
--echo "$as_me:$LINENO: checking whether addr32 must be in the same line as the instruction" >&5
--echo $ECHO_N "checking whether addr32 must be in the same line as the instruction... $ECHO_C" >&6
--if test "${grub_cv_i386_asm_prefix_requirement+set}" = set; then
-+echo "$as_me:$LINENO: checking size of void *" >&5
-+echo $ECHO_N "checking size of void *... $ECHO_C" >&6
-+if test "${ac_cv_sizeof_void_p+set}" = set; then
-   echo $ECHO_N "(cached) $ECHO_C" >&6
- else
--  cat > conftest.s <<\EOF
--      .code16
--l1:   addr32  movb    %al, l1
--EOF
-+  if test "$ac_cv_type_void_p" = yes; then
-+  # The cast to unsigned long works around a bug in the HP C Compiler
-+  # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
-+  # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
-+  # This bug is HP SR number 8606223364.
-+  if test "$cross_compiling" = yes; then
-+  # Depending upon the size, compute the lo and hi bounds.
-+cat >conftest.$ac_ext <<_ACEOF
-+/* confdefs.h.  */
-+_ACEOF
-+cat confdefs.h >>conftest.$ac_ext
-+cat >>conftest.$ac_ext <<_ACEOF
-+/* end confdefs.h.  */
-+$ac_includes_default
-+int
-+main ()
-+{
-+static int test_array [1 - 2 * !(((long) (sizeof (void *))) >= 0)];
-+test_array [0] = 0
--if { ac_try='${CC-cc} ${CFLAGS} -c conftest.s'
--  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
--  (eval $ac_try) 2>&5
--  ac_status=$?
-+  ;
-+  return 0;
-+}
-+_ACEOF
-+rm -f conftest.$ac_objext
-+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-+  (eval $ac_compile) 2>conftest.er1
-+  ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
--  (exit $ac_status); }; } && test -s conftest.o; then
--  grub_cv_i386_asm_prefix_requirement=yes
--else
--  grub_cv_i386_asm_prefix_requirement=no
--fi
--
--rm -f conftest*
--fi
--
--
--if test "x$grub_cv_i386_asm_prefix_requirement" = xyes; then
--  grub_tmp_addr32="addr32"
--  grub_tmp_data32="data32"
--else
--  grub_tmp_addr32="addr32;"
--  grub_tmp_data32="data32;"
--fi
--
--
--cat >>confdefs.h <<_ACEOF
--#define ADDR32 $grub_tmp_addr32
-+  (exit $ac_status); } &&
-+       { ac_try='test -z "$ac_c_werror_flag"
-+                       || test ! -s conftest.err'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; } &&
-+       { ac_try='test -s conftest.$ac_objext'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; }; then
-+  ac_lo=0 ac_mid=0
-+  while :; do
-+    cat >conftest.$ac_ext <<_ACEOF
-+/* confdefs.h.  */
- _ACEOF
-+cat confdefs.h >>conftest.$ac_ext
-+cat >>conftest.$ac_ext <<_ACEOF
-+/* end confdefs.h.  */
-+$ac_includes_default
-+int
-+main ()
-+{
-+static int test_array [1 - 2 * !(((long) (sizeof (void *))) <= $ac_mid)];
-+test_array [0] = 0
--
--cat >>confdefs.h <<_ACEOF
--#define DATA32 $grub_tmp_data32
-+  ;
-+  return 0;
-+}
- _ACEOF
--
--
--echo "$as_me:$LINENO: result: $grub_cv_i386_asm_prefix_requirement" >&5
--echo "${ECHO_T}$grub_cv_i386_asm_prefix_requirement" >&6
--
--
--echo "$as_me:$LINENO: checking for .code16 addr32 assembler support" >&5
--echo $ECHO_N "checking for .code16 addr32 assembler support... $ECHO_C" >&6
--if test "${grub_cv_i386_asm_addr32+set}" = set; then
--  echo $ECHO_N "(cached) $ECHO_C" >&6
--else
--  cat > conftest.s.in <<\EOF
--      .code16
--l1:   @ADDR32@        movb    %al, l1
--EOF
--
--if test "x$grub_cv_i386_asm_prefix_requirement" = xyes; then
--  sed -e s/@ADDR32@/addr32/ < conftest.s.in > conftest.s
--else
--  sed -e s/@ADDR32@/addr32\;/ < conftest.s.in > conftest.s
--fi
--
--if { ac_try='${CC-cc} ${CFLAGS} -c conftest.s'
-+rm -f conftest.$ac_objext
-+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-+  (eval $ac_compile) 2>conftest.er1
-+  ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); } &&
-+       { ac_try='test -z "$ac_c_werror_flag"
-+                       || test ! -s conftest.err'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
--  (exit $ac_status); }; } && test -s conftest.o; then
--  grub_cv_i386_asm_addr32=yes
--else
--  grub_cv_i386_asm_addr32=no
--fi
--
--rm -f conftest*
--fi
--
--
--echo "$as_me:$LINENO: result: $grub_cv_i386_asm_addr32" >&5
--echo "${ECHO_T}$grub_cv_i386_asm_addr32" >&6
--
--echo "$as_me:$LINENO: checking whether an absolute indirect call/jump must not be prefixed with an asterisk" >&5
--echo $ECHO_N "checking whether an absolute indirect call/jump must not be prefixed with an asterisk... $ECHO_C" >&6
--if test "${grub_cv_i386_asm_absolute_without_asterisk+set}" = set; then
--  echo $ECHO_N "(cached) $ECHO_C" >&6
--else
--  cat > conftest.s <<\EOF
--      lcall   *(offset)
--offset:
--      .long   0
--      .word   0
--EOF
--
--if { ac_try='${CC-cc} ${CFLAGS} -c conftest.s'
-+  (exit $ac_status); }; } &&
-+       { ac_try='test -s conftest.$ac_objext'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
--  (exit $ac_status); }; } && test -s conftest.o; then
--  grub_cv_i386_asm_absolute_without_asterisk=no
-+  (exit $ac_status); }; }; then
-+  ac_hi=$ac_mid; break
- else
--  grub_cv_i386_asm_absolute_without_asterisk=yes
--fi
--
--rm -f conftest*
--fi
--
--
--if test "x$grub_cv_i386_asm_absolute_without_asterisk" = xyes; then
--
--cat >>confdefs.h <<\_ACEOF
--#define ABSOLUTE_WITHOUT_ASTERISK 1
--_ACEOF
-+  echo "$as_me: failed program was:" >&5
-+sed 's/^/| /' conftest.$ac_ext >&5
-+ac_lo=`expr $ac_mid + 1`
-+                  if test $ac_lo -le $ac_mid; then
-+                    ac_lo= ac_hi=
-+                    break
-+                  fi
-+                  ac_mid=`expr 2 '*' $ac_mid + 1`
- fi
--
--echo "$as_me:$LINENO: result: $grub_cv_i386_asm_absolute_without_asterisk" >&5
--echo "${ECHO_T}$grub_cv_i386_asm_absolute_without_asterisk" >&6
--
--echo "$as_me:$LINENO: checking if GCC has the regparm=3 bug" >&5
--echo $ECHO_N "checking if GCC has the regparm=3 bug... $ECHO_C" >&6
--if test "${grub_cv_i386_check_nested_functions+set}" = set; then
--  echo $ECHO_N "(cached) $ECHO_C" >&6
--else
--  if test "$cross_compiling" = yes; then
--  { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
--See \`config.log' for more details." >&5
--echo "$as_me: error: cannot run test program while cross compiling
--See \`config.log' for more details." >&2;}
--   { (exit 1); exit 1; }; }
-+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-+  done
- else
--  cat >conftest.$ac_ext <<_ACEOF
-+  echo "$as_me: failed program was:" >&5
-+sed 's/^/| /' conftest.$ac_ext >&5
-+
-+cat >conftest.$ac_ext <<_ACEOF
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
- cat >>conftest.$ac_ext <<_ACEOF
- /* end confdefs.h.  */
--
--static int
--test (int *n)
-+$ac_includes_default
-+int
-+main ()
- {
--  return *n == -1;
--}
-+static int test_array [1 - 2 * !(((long) (sizeof (void *))) < 0)];
-+test_array [0] = 0
--static int
--testfunc (int __attribute__ ((__regparm__ (3))) (*hook) (int a, int b, int *c))
--{
--  int a = 0;
--  int b = 0;
--  int c = -1;
--  return hook (a, b, &c);
-+  ;
-+  return 0;
- }
--
-+_ACEOF
-+rm -f conftest.$ac_objext
-+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-+  (eval $ac_compile) 2>conftest.er1
-+  ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); } &&
-+       { ac_try='test -z "$ac_c_werror_flag"
-+                       || test ! -s conftest.err'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; } &&
-+       { ac_try='test -s conftest.$ac_objext'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; }; then
-+  ac_hi=-1 ac_mid=-1
-+  while :; do
-+    cat >conftest.$ac_ext <<_ACEOF
-+/* confdefs.h.  */
-+_ACEOF
-+cat confdefs.h >>conftest.$ac_ext
-+cat >>conftest.$ac_ext <<_ACEOF
-+/* end confdefs.h.  */
-+$ac_includes_default
- int
--main (void)
-+main ()
- {
--  int __attribute__ ((__regparm__ (3))) nestedfunc (int a, int b, int *c)
--    {
--      return a == b && test (c);
--    }
--  return testfunc (nestedfunc) ? 0 : 1;
--}
-+static int test_array [1 - 2 * !(((long) (sizeof (void *))) >= $ac_mid)];
-+test_array [0] = 0
-+  ;
-+  return 0;
-+}
- _ACEOF
--rm -f conftest$ac_exeext
--if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
--  (eval $ac_link) 2>&5
-+rm -f conftest.$ac_objext
-+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-+  (eval $ac_compile) 2>conftest.er1
-+  ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); } &&
-+       { ac_try='test -z "$ac_c_werror_flag"
-+                       || test ! -s conftest.err'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-   ac_status=$?
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
--  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-+  (exit $ac_status); }; } &&
-+       { ac_try='test -s conftest.$ac_objext'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); }; }; then
--  grub_cv_i386_check_nested_functions=no
-+  ac_lo=$ac_mid; break
- else
--  echo "$as_me: program exited with status $ac_status" >&5
--echo "$as_me: failed program was:" >&5
-+  echo "$as_me: failed program was:" >&5
- sed 's/^/| /' conftest.$ac_ext >&5
--( exit $ac_status )
--grub_cv_i386_check_nested_functions=yes
-+ac_hi=`expr '(' $ac_mid ')' - 1`
-+                     if test $ac_mid -le $ac_hi; then
-+                       ac_lo= ac_hi=
-+                       break
-+                     fi
-+                     ac_mid=`expr 2 '*' $ac_mid`
- fi
--rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-+  done
-+else
-+  echo "$as_me: failed program was:" >&5
-+sed 's/^/| /' conftest.$ac_ext >&5
-+
-+ac_lo= ac_hi=
- fi
-+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
- fi
--
--
--echo "$as_me:$LINENO: result: $grub_cv_i386_check_nested_functions" >&5
--echo "${ECHO_T}$grub_cv_i386_check_nested_functions" >&6
--
--if test "x$grub_cv_i386_check_nested_functions" = xyes; then
--
--cat >>confdefs.h <<\_ACEOF
--#define NESTED_FUNC_ATTR __attribute__ ((__regparm__ (2)))
-+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-+# Binary search between lo and hi bounds.
-+while test "x$ac_lo" != "x$ac_hi"; do
-+  ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
-+  cat >conftest.$ac_ext <<_ACEOF
-+/* confdefs.h.  */
- _ACEOF
-+cat confdefs.h >>conftest.$ac_ext
-+cat >>conftest.$ac_ext <<_ACEOF
-+/* end confdefs.h.  */
-+$ac_includes_default
-+int
-+main ()
-+{
-+static int test_array [1 - 2 * !(((long) (sizeof (void *))) <= $ac_mid)];
-+test_array [0] = 0
--else
--
--cat >>confdefs.h <<\_ACEOF
--#define NESTED_FUNC_ATTR __attribute__ ((__regparm__ (2)))
-+  ;
-+  return 0;
-+}
- _ACEOF
-+rm -f conftest.$ac_objext
-+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-+  (eval $ac_compile) 2>conftest.er1
-+  ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); } &&
-+       { ac_try='test -z "$ac_c_werror_flag"
-+                       || test ! -s conftest.err'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; } &&
-+       { ac_try='test -s conftest.$ac_objext'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; }; then
-+  ac_hi=$ac_mid
-+else
-+  echo "$as_me: failed program was:" >&5
-+sed 's/^/| /' conftest.$ac_ext >&5
-+ac_lo=`expr '(' $ac_mid ')' + 1`
- fi
--
-+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-+done
-+case $ac_lo in
-+?*) ac_cv_sizeof_void_p=$ac_lo;;
-+'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (void *), 77
-+See \`config.log' for more details." >&5
-+echo "$as_me: error: cannot compute sizeof (void *), 77
-+See \`config.log' for more details." >&2;}
-+   { (exit 1); exit 1; }; } ;;
-+esac
- else
--
--cat >>confdefs.h <<\_ACEOF
--#define NESTED_FUNC_ATTR
-+  if test "$cross_compiling" = yes; then
-+  { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
-+See \`config.log' for more details." >&5
-+echo "$as_me: error: cannot run test program while cross compiling
-+See \`config.log' for more details." >&2;}
-+   { (exit 1); exit 1; }; }
-+else
-+  cat >conftest.$ac_ext <<_ACEOF
-+/* confdefs.h.  */
- _ACEOF
-+cat confdefs.h >>conftest.$ac_ext
-+cat >>conftest.$ac_ext <<_ACEOF
-+/* end confdefs.h.  */
-+$ac_includes_default
-+long longval () { return (long) (sizeof (void *)); }
-+unsigned long ulongval () { return (long) (sizeof (void *)); }
-+#include <stdio.h>
-+#include <stdlib.h>
-+int
-+main ()
-+{
--fi
-+  FILE *f = fopen ("conftest.val", "w");
-+  if (! f)
-+    exit (1);
-+  if (((long) (sizeof (void *))) < 0)
-+    {
-+      long i = longval ();
-+      if (i != ((long) (sizeof (void *))))
-+      exit (1);
-+      fprintf (f, "%ld\n", i);
-+    }
-+  else
-+    {
-+      unsigned long i = ulongval ();
-+      if (i != ((long) (sizeof (void *))))
-+      exit (1);
-+      fprintf (f, "%lu\n", i);
-+    }
-+  exit (ferror (f) || fclose (f) != 0);
--# Find a good install program.  We prefer a C program (faster),
--# so one script is as good as another.  But avoid the broken or
--# incompatible versions:
--# SysV /etc/install, /usr/sbin/install
--# SunOS /usr/etc/install
--# IRIX /sbin/install
--# AIX /bin/install
--# AmigaOS /C/install, which installs bootblocks on floppy discs
--# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
--# AFS /usr/afsws/bin/install, which mishandles nonexistent args
--# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
--# OS/2's system install, which has a completely different semantic
--# ./install, which can be erroneously created by make from ./install.sh.
--echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
--echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6
--if test -z "$INSTALL"; then
--if test "${ac_cv_path_install+set}" = set; then
--  echo $ECHO_N "(cached) $ECHO_C" >&6
-+  ;
-+  return 0;
-+}
-+_ACEOF
-+rm -f conftest$ac_exeext
-+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-+  (eval $ac_link) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; }; then
-+  ac_cv_sizeof_void_p=`cat conftest.val`
- else
--  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
--for as_dir in $PATH
--do
--  IFS=$as_save_IFS
--  test -z "$as_dir" && as_dir=.
--  # Account for people who put trailing slashes in PATH elements.
--case $as_dir/ in
--  ./ | .// | /cC/* | \
--  /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
--  ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \
--  /usr/ucb/* ) ;;
--  *)
--    # OSF1 and SCO ODT 3.0 have their own names for install.
--    # Don't use installbsd from OSF since it installs stuff as root
--    # by default.
--    for ac_prog in ginstall scoinst install; do
--      for ac_exec_ext in '' $ac_executable_extensions; do
--      if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
--        if test $ac_prog = install &&
--          grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
--          # AIX install.  It has an incompatible calling convention.
--          :
--        elif test $ac_prog = install &&
--          grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
--          # program-specific install script used by HP pwplus--don't use.
--          :
--        else
--          ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
--          break 3
--        fi
--      fi
--      done
--    done
--    ;;
--esac
--done
--
-+  echo "$as_me: program exited with status $ac_status" >&5
-+echo "$as_me: failed program was:" >&5
-+sed 's/^/| /' conftest.$ac_ext >&5
-+( exit $ac_status )
-+{ { echo "$as_me:$LINENO: error: cannot compute sizeof (void *), 77
-+See \`config.log' for more details." >&5
-+echo "$as_me: error: cannot compute sizeof (void *), 77
-+See \`config.log' for more details." >&2;}
-+   { (exit 1); exit 1; }; }
- fi
--  if test "${ac_cv_path_install+set}" = set; then
--    INSTALL=$ac_cv_path_install
--  else
--    # As a last resort, use the slow shell script.  We don't cache a
--    # path for INSTALL within a source directory, because that will
--    # break other packages using the cache if that directory is
--    # removed, or if the path is relative.
--    INSTALL=$ac_install_sh
--  fi
-+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
- fi
--echo "$as_me:$LINENO: result: $INSTALL" >&5
--echo "${ECHO_T}$INSTALL" >&6
--
--# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
--# It thinks the first close brace ends the variable substitution.
--test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
--
--test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
-+fi
-+rm -f conftest.val
-+else
-+  ac_cv_sizeof_void_p=0
-+fi
-+fi
-+echo "$as_me:$LINENO: result: $ac_cv_sizeof_void_p" >&5
-+echo "${ECHO_T}$ac_cv_sizeof_void_p" >&6
-+cat >>confdefs.h <<_ACEOF
-+#define SIZEOF_VOID_P $ac_cv_sizeof_void_p
-+_ACEOF
--test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
--echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
--echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6
--set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'`
--if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
-+echo "$as_me:$LINENO: checking for long" >&5
-+echo $ECHO_N "checking for long... $ECHO_C" >&6
-+if test "${ac_cv_type_long+set}" = set; then
-   echo $ECHO_N "(cached) $ECHO_C" >&6
- else
--  cat >conftest.make <<\_ACEOF
--all:
--      @echo 'ac_maketemp="$(MAKE)"'
-+  cat >conftest.$ac_ext <<_ACEOF
-+/* confdefs.h.  */
- _ACEOF
--# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
--eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
--if test -n "$ac_maketemp"; then
--  eval ac_cv_prog_make_${ac_make}_set=yes
--else
--  eval ac_cv_prog_make_${ac_make}_set=no
--fi
--rm -f conftest.make
--fi
--if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
--  echo "$as_me:$LINENO: result: yes" >&5
--echo "${ECHO_T}yes" >&6
--  SET_MAKE=
--else
--  echo "$as_me:$LINENO: result: no" >&5
--echo "${ECHO_T}no" >&6
--  SET_MAKE="MAKE=${MAKE-make}"
--fi
--
--if test -n "$ac_tool_prefix"; then
--  # Extract the first word of "${ac_tool_prefix}objcopy", so it can be a program name with args.
--set dummy ${ac_tool_prefix}objcopy; ac_word=$2
--echo "$as_me:$LINENO: checking for $ac_word" >&5
--echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
--if test "${ac_cv_prog_OBJCOPY+set}" = set; then
--  echo $ECHO_N "(cached) $ECHO_C" >&6
--else
--  if test -n "$OBJCOPY"; then
--  ac_cv_prog_OBJCOPY="$OBJCOPY" # Let the user override the test.
--else
--as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
--for as_dir in $PATH
--do
--  IFS=$as_save_IFS
--  test -z "$as_dir" && as_dir=.
--  for ac_exec_ext in '' $ac_executable_extensions; do
--  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
--    ac_cv_prog_OBJCOPY="${ac_tool_prefix}objcopy"
--    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
--    break 2
--  fi
--done
--done
--
--fi
--fi
--OBJCOPY=$ac_cv_prog_OBJCOPY
--if test -n "$OBJCOPY"; then
--  echo "$as_me:$LINENO: result: $OBJCOPY" >&5
--echo "${ECHO_T}$OBJCOPY" >&6
--else
--  echo "$as_me:$LINENO: result: no" >&5
--echo "${ECHO_T}no" >&6
--fi
--
--fi
--if test -z "$ac_cv_prog_OBJCOPY"; then
--  ac_ct_OBJCOPY=$OBJCOPY
--  # Extract the first word of "objcopy", so it can be a program name with args.
--set dummy objcopy; ac_word=$2
--echo "$as_me:$LINENO: checking for $ac_word" >&5
--echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
--if test "${ac_cv_prog_ac_ct_OBJCOPY+set}" = set; then
--  echo $ECHO_N "(cached) $ECHO_C" >&6
--else
--  if test -n "$ac_ct_OBJCOPY"; then
--  ac_cv_prog_ac_ct_OBJCOPY="$ac_ct_OBJCOPY" # Let the user override the test.
-+cat confdefs.h >>conftest.$ac_ext
-+cat >>conftest.$ac_ext <<_ACEOF
-+/* end confdefs.h.  */
-+$ac_includes_default
-+int
-+main ()
-+{
-+if ((long *) 0)
-+  return 0;
-+if (sizeof (long))
-+  return 0;
-+  ;
-+  return 0;
-+}
-+_ACEOF
-+rm -f conftest.$ac_objext
-+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-+  (eval $ac_compile) 2>conftest.er1
-+  ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); } &&
-+       { ac_try='test -z "$ac_c_werror_flag"
-+                       || test ! -s conftest.err'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; } &&
-+       { ac_try='test -s conftest.$ac_objext'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; }; then
-+  ac_cv_type_long=yes
- else
--as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
--for as_dir in $PATH
--do
--  IFS=$as_save_IFS
--  test -z "$as_dir" && as_dir=.
--  for ac_exec_ext in '' $ac_executable_extensions; do
--  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
--    ac_cv_prog_ac_ct_OBJCOPY="objcopy"
--    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
--    break 2
--  fi
--done
--done
-+  echo "$as_me: failed program was:" >&5
-+sed 's/^/| /' conftest.$ac_ext >&5
-+ac_cv_type_long=no
- fi
-+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
- fi
--ac_ct_OBJCOPY=$ac_cv_prog_ac_ct_OBJCOPY
--if test -n "$ac_ct_OBJCOPY"; then
--  echo "$as_me:$LINENO: result: $ac_ct_OBJCOPY" >&5
--echo "${ECHO_T}$ac_ct_OBJCOPY" >&6
--else
--  echo "$as_me:$LINENO: result: no" >&5
--echo "${ECHO_T}no" >&6
--fi
--
--  OBJCOPY=$ac_ct_OBJCOPY
--else
--  OBJCOPY="$ac_cv_prog_OBJCOPY"
--fi
-+echo "$as_me:$LINENO: result: $ac_cv_type_long" >&5
-+echo "${ECHO_T}$ac_cv_type_long" >&6
--echo "$as_me:$LINENO: checking whether ${OBJCOPY} works for absolute addresses" >&5
--echo $ECHO_N "checking whether ${OBJCOPY} works for absolute addresses... $ECHO_C" >&6
--if test "${grub_cv_prog_objcopy_absolute+set}" = set; then
-+echo "$as_me:$LINENO: checking size of long" >&5
-+echo $ECHO_N "checking size of long... $ECHO_C" >&6
-+if test "${ac_cv_sizeof_long+set}" = set; then
-   echo $ECHO_N "(cached) $ECHO_C" >&6
- else
--  cat > conftest.c <<\EOF
--void
--cmain (void)
-+  if test "$ac_cv_type_long" = yes; then
-+  # The cast to unsigned long works around a bug in the HP C Compiler
-+  # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
-+  # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
-+  # This bug is HP SR number 8606223364.
-+  if test "$cross_compiling" = yes; then
-+  # Depending upon the size, compute the lo and hi bounds.
-+cat >conftest.$ac_ext <<_ACEOF
-+/* confdefs.h.  */
-+_ACEOF
-+cat confdefs.h >>conftest.$ac_ext
-+cat >>conftest.$ac_ext <<_ACEOF
-+/* end confdefs.h.  */
-+$ac_includes_default
-+int
-+main ()
- {
--   *((int *) 0x1000) = 2;
--}
--EOF
-+static int test_array [1 - 2 * !(((long) (sizeof (long))) >= 0)];
-+test_array [0] = 0
-+  ;
-+  return 0;
-+}
-+_ACEOF
-+rm -f conftest.$ac_objext
- if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
--  (eval $ac_compile) 2>&5
-+  (eval $ac_compile) 2>conftest.er1
-   ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
--  (exit $ac_status); } && test -s conftest.o; then :
--else
--  { { echo "$as_me:$LINENO: error: ${CC-cc} cannot compile C source code" >&5
--echo "$as_me: error: ${CC-cc} cannot compile C source code" >&2;}
--   { (exit 1); exit 1; }; }
--fi
--grub_cv_prog_objcopy_absolute=yes
--for link_addr in 2000 8000 7C00; do
--  if { ac_try='${CC-cc} ${CFLAGS} -nostdlib -Wl,-N -Wl,-Ttext -Wl,$link_addr conftest.o -o conftest.exec'
-+  (exit $ac_status); } &&
-+       { ac_try='test -z "$ac_c_werror_flag"
-+                       || test ! -s conftest.err'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
--  (exit $ac_status); }; }; then :
--  else
--    { { echo "$as_me:$LINENO: error: ${CC-cc} cannot link at address $link_addr" >&5
--echo "$as_me: error: ${CC-cc} cannot link at address $link_addr" >&2;}
--   { (exit 1); exit 1; }; }
--  fi
--  if { ac_try='${OBJCOPY-objcopy} -O binary conftest.exec conftest'
-+  (exit $ac_status); }; } &&
-+       { ac_try='test -s conftest.$ac_objext'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
--  (exit $ac_status); }; }; then :
--  else
--    { { echo "$as_me:$LINENO: error: ${OBJCOPY-objcopy} cannot create binary files" >&5
--echo "$as_me: error: ${OBJCOPY-objcopy} cannot create binary files" >&2;}
--   { (exit 1); exit 1; }; }
--  fi
--  if test ! -f conftest.old || { ac_try='cmp -s conftest.old conftest'
-+  (exit $ac_status); }; }; then
-+  ac_lo=0 ac_mid=0
-+  while :; do
-+    cat >conftest.$ac_ext <<_ACEOF
-+/* confdefs.h.  */
-+_ACEOF
-+cat confdefs.h >>conftest.$ac_ext
-+cat >>conftest.$ac_ext <<_ACEOF
-+/* end confdefs.h.  */
-+$ac_includes_default
-+int
-+main ()
-+{
-+static int test_array [1 - 2 * !(((long) (sizeof (long))) <= $ac_mid)];
-+test_array [0] = 0
-+
-+  ;
-+  return 0;
-+}
-+_ACEOF
-+rm -f conftest.$ac_objext
-+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-+  (eval $ac_compile) 2>conftest.er1
-+  ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); } &&
-+       { ac_try='test -z "$ac_c_werror_flag"
-+                       || test ! -s conftest.err'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; } &&
-+       { ac_try='test -s conftest.$ac_objext'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); }; }; then
--    mv -f conftest conftest.old
--  else
--    grub_cv_prog_objcopy_absolute=no
--    break
--  fi
--done
--rm -f conftest*
--fi
--
--echo "$as_me:$LINENO: result: $grub_cv_prog_objcopy_absolute" >&5
--echo "${ECHO_T}$grub_cv_prog_objcopy_absolute" >&6
-+  ac_hi=$ac_mid; break
-+else
-+  echo "$as_me: failed program was:" >&5
-+sed 's/^/| /' conftest.$ac_ext >&5
--if test "x$grub_cv_prog_objcopy_absolute" = xno; then
--  { { echo "$as_me:$LINENO: error: GRUB requires a working absolute objcopy; upgrade your binutils" >&5
--echo "$as_me: error: GRUB requires a working absolute objcopy; upgrade your binutils" >&2;}
--   { (exit 1); exit 1; }; }
-+ac_lo=`expr $ac_mid + 1`
-+                  if test $ac_lo -le $ac_mid; then
-+                    ac_lo= ac_hi=
-+                    break
-+                  fi
-+                  ac_mid=`expr 2 '*' $ac_mid + 1`
- fi
-+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-+  done
-+else
-+  echo "$as_me: failed program was:" >&5
-+sed 's/^/| /' conftest.$ac_ext >&5
--if test -n "$ac_tool_prefix"; then
--  # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
--set dummy ${ac_tool_prefix}strip; ac_word=$2
--echo "$as_me:$LINENO: checking for $ac_word" >&5
--echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
--if test "${ac_cv_prog_STRIP+set}" = set; then
--  echo $ECHO_N "(cached) $ECHO_C" >&6
--else
--  if test -n "$STRIP"; then
--  ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
--else
--as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
--for as_dir in $PATH
--do
--  IFS=$as_save_IFS
--  test -z "$as_dir" && as_dir=.
--  for ac_exec_ext in '' $ac_executable_extensions; do
--  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
--    ac_cv_prog_STRIP="${ac_tool_prefix}strip"
--    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
--    break 2
--  fi
--done
--done
-+cat >conftest.$ac_ext <<_ACEOF
-+/* confdefs.h.  */
-+_ACEOF
-+cat confdefs.h >>conftest.$ac_ext
-+cat >>conftest.$ac_ext <<_ACEOF
-+/* end confdefs.h.  */
-+$ac_includes_default
-+int
-+main ()
-+{
-+static int test_array [1 - 2 * !(((long) (sizeof (long))) < 0)];
-+test_array [0] = 0
--fi
--fi
--STRIP=$ac_cv_prog_STRIP
--if test -n "$STRIP"; then
--  echo "$as_me:$LINENO: result: $STRIP" >&5
--echo "${ECHO_T}$STRIP" >&6
-+  ;
-+  return 0;
-+}
-+_ACEOF
-+rm -f conftest.$ac_objext
-+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-+  (eval $ac_compile) 2>conftest.er1
-+  ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); } &&
-+       { ac_try='test -z "$ac_c_werror_flag"
-+                       || test ! -s conftest.err'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; } &&
-+       { ac_try='test -s conftest.$ac_objext'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; }; then
-+  ac_hi=-1 ac_mid=-1
-+  while :; do
-+    cat >conftest.$ac_ext <<_ACEOF
-+/* confdefs.h.  */
-+_ACEOF
-+cat confdefs.h >>conftest.$ac_ext
-+cat >>conftest.$ac_ext <<_ACEOF
-+/* end confdefs.h.  */
-+$ac_includes_default
-+int
-+main ()
-+{
-+static int test_array [1 - 2 * !(((long) (sizeof (long))) >= $ac_mid)];
-+test_array [0] = 0
-+
-+  ;
-+  return 0;
-+}
-+_ACEOF
-+rm -f conftest.$ac_objext
-+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-+  (eval $ac_compile) 2>conftest.er1
-+  ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); } &&
-+       { ac_try='test -z "$ac_c_werror_flag"
-+                       || test ! -s conftest.err'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; } &&
-+       { ac_try='test -s conftest.$ac_objext'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; }; then
-+  ac_lo=$ac_mid; break
- else
--  echo "$as_me:$LINENO: result: no" >&5
--echo "${ECHO_T}no" >&6
--fi
-+  echo "$as_me: failed program was:" >&5
-+sed 's/^/| /' conftest.$ac_ext >&5
-+ac_hi=`expr '(' $ac_mid ')' - 1`
-+                     if test $ac_mid -le $ac_hi; then
-+                       ac_lo= ac_hi=
-+                       break
-+                     fi
-+                     ac_mid=`expr 2 '*' $ac_mid`
- fi
--if test -z "$ac_cv_prog_STRIP"; then
--  ac_ct_STRIP=$STRIP
--  # Extract the first word of "strip", so it can be a program name with args.
--set dummy strip; ac_word=$2
--echo "$as_me:$LINENO: checking for $ac_word" >&5
--echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
--if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
--  echo $ECHO_N "(cached) $ECHO_C" >&6
--else
--  if test -n "$ac_ct_STRIP"; then
--  ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
-+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-+  done
- else
--as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
--for as_dir in $PATH
--do
--  IFS=$as_save_IFS
--  test -z "$as_dir" && as_dir=.
--  for ac_exec_ext in '' $ac_executable_extensions; do
--  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
--    ac_cv_prog_ac_ct_STRIP="strip"
--    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
--    break 2
--  fi
--done
--done
-+  echo "$as_me: failed program was:" >&5
-+sed 's/^/| /' conftest.$ac_ext >&5
-+ac_lo= ac_hi=
- fi
-+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
- fi
--ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
--if test -n "$ac_ct_STRIP"; then
--  echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
--echo "${ECHO_T}$ac_ct_STRIP" >&6
--else
--  echo "$as_me:$LINENO: result: no" >&5
--echo "${ECHO_T}no" >&6
--fi
-+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-+# Binary search between lo and hi bounds.
-+while test "x$ac_lo" != "x$ac_hi"; do
-+  ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
-+  cat >conftest.$ac_ext <<_ACEOF
-+/* confdefs.h.  */
-+_ACEOF
-+cat confdefs.h >>conftest.$ac_ext
-+cat >>conftest.$ac_ext <<_ACEOF
-+/* end confdefs.h.  */
-+$ac_includes_default
-+int
-+main ()
-+{
-+static int test_array [1 - 2 * !(((long) (sizeof (long))) <= $ac_mid)];
-+test_array [0] = 0
--  STRIP=$ac_ct_STRIP
-+  ;
-+  return 0;
-+}
-+_ACEOF
-+rm -f conftest.$ac_objext
-+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-+  (eval $ac_compile) 2>conftest.er1
-+  ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); } &&
-+       { ac_try='test -z "$ac_c_werror_flag"
-+                       || test ! -s conftest.err'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; } &&
-+       { ac_try='test -s conftest.$ac_objext'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; }; then
-+  ac_hi=$ac_mid
- else
--  STRIP="$ac_cv_prog_STRIP"
--fi
-+  echo "$as_me: failed program was:" >&5
-+sed 's/^/| /' conftest.$ac_ext >&5
--if test -n "$ac_tool_prefix"; then
--  # Extract the first word of "${ac_tool_prefix}nm", so it can be a program name with args.
--set dummy ${ac_tool_prefix}nm; ac_word=$2
--echo "$as_me:$LINENO: checking for $ac_word" >&5
--echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
--if test "${ac_cv_prog_NM+set}" = set; then
--  echo $ECHO_N "(cached) $ECHO_C" >&6
-+ac_lo=`expr '(' $ac_mid ')' + 1`
-+fi
-+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-+done
-+case $ac_lo in
-+?*) ac_cv_sizeof_long=$ac_lo;;
-+'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (long), 77
-+See \`config.log' for more details." >&5
-+echo "$as_me: error: cannot compute sizeof (long), 77
-+See \`config.log' for more details." >&2;}
-+   { (exit 1); exit 1; }; } ;;
-+esac
- else
--  if test -n "$NM"; then
--  ac_cv_prog_NM="$NM" # Let the user override the test.
-+  if test "$cross_compiling" = yes; then
-+  { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
-+See \`config.log' for more details." >&5
-+echo "$as_me: error: cannot run test program while cross compiling
-+See \`config.log' for more details." >&2;}
-+   { (exit 1); exit 1; }; }
- else
--as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
--for as_dir in $PATH
--do
--  IFS=$as_save_IFS
--  test -z "$as_dir" && as_dir=.
--  for ac_exec_ext in '' $ac_executable_extensions; do
--  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
--    ac_cv_prog_NM="${ac_tool_prefix}nm"
--    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
--    break 2
--  fi
--done
--done
-+  cat >conftest.$ac_ext <<_ACEOF
-+/* confdefs.h.  */
-+_ACEOF
-+cat confdefs.h >>conftest.$ac_ext
-+cat >>conftest.$ac_ext <<_ACEOF
-+/* end confdefs.h.  */
-+$ac_includes_default
-+long longval () { return (long) (sizeof (long)); }
-+unsigned long ulongval () { return (long) (sizeof (long)); }
-+#include <stdio.h>
-+#include <stdlib.h>
-+int
-+main ()
-+{
--fi
--fi
--NM=$ac_cv_prog_NM
--if test -n "$NM"; then
--  echo "$as_me:$LINENO: result: $NM" >&5
--echo "${ECHO_T}$NM" >&6
--else
--  echo "$as_me:$LINENO: result: no" >&5
--echo "${ECHO_T}no" >&6
--fi
--
--fi
--if test -z "$ac_cv_prog_NM"; then
--  ac_ct_NM=$NM
--  # Extract the first word of "nm", so it can be a program name with args.
--set dummy nm; ac_word=$2
--echo "$as_me:$LINENO: checking for $ac_word" >&5
--echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
--if test "${ac_cv_prog_ac_ct_NM+set}" = set; then
--  echo $ECHO_N "(cached) $ECHO_C" >&6
--else
--  if test -n "$ac_ct_NM"; then
--  ac_cv_prog_ac_ct_NM="$ac_ct_NM" # Let the user override the test.
--else
--as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
--for as_dir in $PATH
--do
--  IFS=$as_save_IFS
--  test -z "$as_dir" && as_dir=.
--  for ac_exec_ext in '' $ac_executable_extensions; do
--  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
--    ac_cv_prog_ac_ct_NM="nm"
--    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
--    break 2
--  fi
--done
--done
--
--fi
--fi
--ac_ct_NM=$ac_cv_prog_ac_ct_NM
--if test -n "$ac_ct_NM"; then
--  echo "$as_me:$LINENO: result: $ac_ct_NM" >&5
--echo "${ECHO_T}$ac_ct_NM" >&6
--else
--  echo "$as_me:$LINENO: result: no" >&5
--echo "${ECHO_T}no" >&6
--fi
--
--  NM=$ac_ct_NM
--else
--  NM="$ac_cv_prog_NM"
--fi
--
--if test -n "$ac_tool_prefix"; then
--  # Extract the first word of "${ac_tool_prefix}ld", so it can be a program name with args.
--set dummy ${ac_tool_prefix}ld; ac_word=$2
--echo "$as_me:$LINENO: checking for $ac_word" >&5
--echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
--if test "${ac_cv_prog_LD+set}" = set; then
--  echo $ECHO_N "(cached) $ECHO_C" >&6
--else
--  if test -n "$LD"; then
--  ac_cv_prog_LD="$LD" # Let the user override the test.
--else
--as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
--for as_dir in $PATH
--do
--  IFS=$as_save_IFS
--  test -z "$as_dir" && as_dir=.
--  for ac_exec_ext in '' $ac_executable_extensions; do
--  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
--    ac_cv_prog_LD="${ac_tool_prefix}ld"
--    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
--    break 2
--  fi
--done
--done
--
--fi
--fi
--LD=$ac_cv_prog_LD
--if test -n "$LD"; then
--  echo "$as_me:$LINENO: result: $LD" >&5
--echo "${ECHO_T}$LD" >&6
--else
--  echo "$as_me:$LINENO: result: no" >&5
--echo "${ECHO_T}no" >&6
--fi
--
--fi
--if test -z "$ac_cv_prog_LD"; then
--  ac_ct_LD=$LD
--  # Extract the first word of "ld", so it can be a program name with args.
--set dummy ld; ac_word=$2
--echo "$as_me:$LINENO: checking for $ac_word" >&5
--echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
--if test "${ac_cv_prog_ac_ct_LD+set}" = set; then
--  echo $ECHO_N "(cached) $ECHO_C" >&6
--else
--  if test -n "$ac_ct_LD"; then
--  ac_cv_prog_ac_ct_LD="$ac_ct_LD" # Let the user override the test.
--else
--as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
--for as_dir in $PATH
--do
--  IFS=$as_save_IFS
--  test -z "$as_dir" && as_dir=.
--  for ac_exec_ext in '' $ac_executable_extensions; do
--  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
--    ac_cv_prog_ac_ct_LD="ld"
--    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
--    break 2
--  fi
--done
--done
-+  FILE *f = fopen ("conftest.val", "w");
-+  if (! f)
-+    exit (1);
-+  if (((long) (sizeof (long))) < 0)
-+    {
-+      long i = longval ();
-+      if (i != ((long) (sizeof (long))))
-+      exit (1);
-+      fprintf (f, "%ld\n", i);
-+    }
-+  else
-+    {
-+      unsigned long i = ulongval ();
-+      if (i != ((long) (sizeof (long))))
-+      exit (1);
-+      fprintf (f, "%lu\n", i);
-+    }
-+  exit (ferror (f) || fclose (f) != 0);
--fi
--fi
--ac_ct_LD=$ac_cv_prog_ac_ct_LD
--if test -n "$ac_ct_LD"; then
--  echo "$as_me:$LINENO: result: $ac_ct_LD" >&5
--echo "${ECHO_T}$ac_ct_LD" >&6
-+  ;
-+  return 0;
-+}
-+_ACEOF
-+rm -f conftest$ac_exeext
-+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-+  (eval $ac_link) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; }; then
-+  ac_cv_sizeof_long=`cat conftest.val`
- else
--  echo "$as_me:$LINENO: result: no" >&5
--echo "${ECHO_T}no" >&6
--fi
-+  echo "$as_me: program exited with status $ac_status" >&5
-+echo "$as_me: failed program was:" >&5
-+sed 's/^/| /' conftest.$ac_ext >&5
--  LD=$ac_ct_LD
--else
--  LD="$ac_cv_prog_LD"
-+( exit $ac_status )
-+{ { echo "$as_me:$LINENO: error: cannot compute sizeof (long), 77
-+See \`config.log' for more details." >&5
-+echo "$as_me: error: cannot compute sizeof (long), 77
-+See \`config.log' for more details." >&2;}
-+   { (exit 1); exit 1; }; }
- fi
--
--
--# This is not a "must".
--# Extract the first word of "ruby", so it can be a program name with args.
--set dummy ruby; ac_word=$2
--echo "$as_me:$LINENO: checking for $ac_word" >&5
--echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
--if test "${ac_cv_path_RUBY+set}" = set; then
--  echo $ECHO_N "(cached) $ECHO_C" >&6
--else
--  case $RUBY in
--  [\\/]* | ?:[\\/]*)
--  ac_cv_path_RUBY="$RUBY" # Let the user override the test with a path.
--  ;;
--  *)
--  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
--for as_dir in $PATH
--do
--  IFS=$as_save_IFS
--  test -z "$as_dir" && as_dir=.
--  for ac_exec_ext in '' $ac_executable_extensions; do
--  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
--    ac_cv_path_RUBY="$as_dir/$ac_word$ac_exec_ext"
--    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
--    break 2
--  fi
--done
--done
--
--  ;;
--esac
-+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
- fi
--RUBY=$ac_cv_path_RUBY
--
--if test -n "$RUBY"; then
--  echo "$as_me:$LINENO: result: $RUBY" >&5
--echo "${ECHO_T}$RUBY" >&6
--else
--  echo "$as_me:$LINENO: result: no" >&5
--echo "${ECHO_T}no" >&6
- fi
--
--
--# For cross-compiling.
--if test "x$build" != "x$host"; then
--  for ac_prog in gcc egcs cc
--do
--  # Extract the first word of "$ac_prog", so it can be a program name with args.
--set dummy $ac_prog; ac_word=$2
--echo "$as_me:$LINENO: checking for $ac_word" >&5
--echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
--if test "${ac_cv_prog_BUILD_CC+set}" = set; then
--  echo $ECHO_N "(cached) $ECHO_C" >&6
--else
--  if test -n "$BUILD_CC"; then
--  ac_cv_prog_BUILD_CC="$BUILD_CC" # Let the user override the test.
-+rm -f conftest.val
- else
--as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
--for as_dir in $PATH
--do
--  IFS=$as_save_IFS
--  test -z "$as_dir" && as_dir=.
--  for ac_exec_ext in '' $ac_executable_extensions; do
--  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
--    ac_cv_prog_BUILD_CC="$ac_prog"
--    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
--    break 2
--  fi
--done
--done
--
--fi
-+  ac_cv_sizeof_long=0
- fi
--BUILD_CC=$ac_cv_prog_BUILD_CC
--if test -n "$BUILD_CC"; then
--  echo "$as_me:$LINENO: result: $BUILD_CC" >&5
--echo "${ECHO_T}$BUILD_CC" >&6
--else
--  echo "$as_me:$LINENO: result: no" >&5
--echo "${ECHO_T}no" >&6
- fi
-+echo "$as_me:$LINENO: result: $ac_cv_sizeof_long" >&5
-+echo "${ECHO_T}$ac_cv_sizeof_long" >&6
-+cat >>confdefs.h <<_ACEOF
-+#define SIZEOF_LONG $ac_cv_sizeof_long
-+_ACEOF
--  test -n "$BUILD_CC" && break
--done
--test -n "$BUILD_CC" || BUILD_CC="{ { echo "$as_me:$LINENO: error: none of gcc, egcs and cc is found. set BUILD_CC manually." >&5
--echo "$as_me: error: none of gcc, egcs and cc is found. set BUILD_CC manually." >&2;}
--   { (exit 1); exit 1; }; }"
--else
--  BUILD_CC="$CC"
-+if test "x$host_m32" = x1; then
-+  # Force 32-bit mode.
-+  CFLAGS="$CFLAGS -m32"
-+  LDFLAGS="$LDFLAGS -m32"
- fi
--# Test the C compiler for the build environment.
--tmp_CC="$CC"
--tmp_CFLAGS="$CFLAGS"
--tmp_LDFLAGS="$LDFLAGS"
--tmp_CPPFLAGS="$CPPFLAGS"
--CC="$BUILD_CC"
--CFLAGS="$BUILD_CFLAGS"
--CPPFLAGS="$BUILD_CPPFLAGS"
--LDFLAGS="$BUILD_LDDFLAGS"
--
--# Identify characteristics of the build architecture.
--echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5
--echo $ECHO_N "checking whether byte ordering is bigendian... $ECHO_C" >&6
--if test "${ac_cv_c_bigendian+set}" = set; then
-+# Check LZO when compiling for the i386-pc.
-+if test "$target_cpu"-"$platform" = i386-pc; then
-+  # There are three possibilities. LZO version 2 installed with the name
-+  # liblzo2, with the name liblzo, and LZO version 1.
-+  echo "$as_me:$LINENO: checking for __lzo_init_v2 in -llzo2" >&5
-+echo $ECHO_N "checking for __lzo_init_v2 in -llzo2... $ECHO_C" >&6
-+if test "${ac_cv_lib_lzo2___lzo_init_v2+set}" = set; then
-   echo $ECHO_N "(cached) $ECHO_C" >&6
- else
--  # See if sys/param.h defines the BYTE_ORDER macro.
-+  ac_check_lib_save_LIBS=$LIBS
-+LIBS="-llzo2  $LIBS"
- cat >conftest.$ac_ext <<_ACEOF
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
- cat >>conftest.$ac_ext <<_ACEOF
- /* end confdefs.h.  */
--#include <sys/types.h>
--#include <sys/param.h>
-+/* Override any gcc2 internal prototype to avoid an error.  */
-+#ifdef __cplusplus
-+extern "C"
-+#endif
-+/* We use char because int might match the return type of a gcc2
-+   builtin and then its argument prototype would still apply.  */
-+char __lzo_init_v2 ();
- int
- main ()
- {
--#if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
-- bogus endian macros
--#endif
--
-+__lzo_init_v2 ();
-   ;
-   return 0;
- }
- _ACEOF
--rm -f conftest.$ac_objext
--if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
--  (eval $ac_compile) 2>conftest.er1
-+rm -f conftest.$ac_objext conftest$ac_exeext
-+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-+  (eval $ac_link) 2>conftest.er1
-   ac_status=$?
-   grep -v '^ *+' conftest.er1 >conftest.err
-   rm -f conftest.er1
-   cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } &&
--       { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
-+       { ac_try='test -z "$ac_c_werror_flag"
-+                       || test ! -s conftest.err'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); }; } &&
--       { ac_try='test -s conftest.$ac_objext'
-+       { ac_try='test -s conftest$ac_exeext'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); }; }; then
--  # It does; now see whether it defined to BIG_ENDIAN or not.
-+  ac_cv_lib_lzo2___lzo_init_v2=yes
-+else
-+  echo "$as_me: failed program was:" >&5
-+sed 's/^/| /' conftest.$ac_ext >&5
-+
-+ac_cv_lib_lzo2___lzo_init_v2=no
-+fi
-+rm -f conftest.err conftest.$ac_objext \
-+      conftest$ac_exeext conftest.$ac_ext
-+LIBS=$ac_check_lib_save_LIBS
-+fi
-+echo "$as_me:$LINENO: result: $ac_cv_lib_lzo2___lzo_init_v2" >&5
-+echo "${ECHO_T}$ac_cv_lib_lzo2___lzo_init_v2" >&6
-+if test $ac_cv_lib_lzo2___lzo_init_v2 = yes; then
-+  LIBLZO="-llzo2"
-+else
-+  echo "$as_me:$LINENO: checking for __lzo_init_v2 in -llzo" >&5
-+echo $ECHO_N "checking for __lzo_init_v2 in -llzo... $ECHO_C" >&6
-+if test "${ac_cv_lib_lzo___lzo_init_v2+set}" = set; then
-+  echo $ECHO_N "(cached) $ECHO_C" >&6
-+else
-+  ac_check_lib_save_LIBS=$LIBS
-+LIBS="-llzo  $LIBS"
- cat >conftest.$ac_ext <<_ACEOF
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
- cat >>conftest.$ac_ext <<_ACEOF
- /* end confdefs.h.  */
--#include <sys/types.h>
--#include <sys/param.h>
-+/* Override any gcc2 internal prototype to avoid an error.  */
-+#ifdef __cplusplus
-+extern "C"
-+#endif
-+/* We use char because int might match the return type of a gcc2
-+   builtin and then its argument prototype would still apply.  */
-+char __lzo_init_v2 ();
- int
- main ()
- {
--#if BYTE_ORDER != BIG_ENDIAN
-- not big endian
--#endif
--
-+__lzo_init_v2 ();
-   ;
-   return 0;
- }
- _ACEOF
--rm -f conftest.$ac_objext
--if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
--  (eval $ac_compile) 2>conftest.er1
-+rm -f conftest.$ac_objext conftest$ac_exeext
-+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-+  (eval $ac_link) 2>conftest.er1
-   ac_status=$?
-   grep -v '^ *+' conftest.er1 >conftest.err
-   rm -f conftest.er1
-   cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } &&
--       { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
-+       { ac_try='test -z "$ac_c_werror_flag"
-+                       || test ! -s conftest.err'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); }; } &&
--       { ac_try='test -s conftest.$ac_objext'
-+       { ac_try='test -s conftest$ac_exeext'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); }; }; then
--  ac_cv_c_bigendian=yes
-+  ac_cv_lib_lzo___lzo_init_v2=yes
- else
-   echo "$as_me: failed program was:" >&5
- sed 's/^/| /' conftest.$ac_ext >&5
--ac_cv_c_bigendian=no
-+ac_cv_lib_lzo___lzo_init_v2=no
- fi
--rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-+rm -f conftest.err conftest.$ac_objext \
-+      conftest$ac_exeext conftest.$ac_ext
-+LIBS=$ac_check_lib_save_LIBS
-+fi
-+echo "$as_me:$LINENO: result: $ac_cv_lib_lzo___lzo_init_v2" >&5
-+echo "${ECHO_T}$ac_cv_lib_lzo___lzo_init_v2" >&6
-+if test $ac_cv_lib_lzo___lzo_init_v2 = yes; then
-+  LIBLZO="-llzo"
- else
--  echo "$as_me: failed program was:" >&5
--sed 's/^/| /' conftest.$ac_ext >&5
--
--# It does not; compile a test program.
--if test "$cross_compiling" = yes; then
--  # try to guess the endianness by grepping values into an object file
--  ac_cv_c_bigendian=unknown
--  cat >conftest.$ac_ext <<_ACEOF
-+  echo "$as_me:$LINENO: checking for __lzo_init2 in -llzo" >&5
-+echo $ECHO_N "checking for __lzo_init2 in -llzo... $ECHO_C" >&6
-+if test "${ac_cv_lib_lzo___lzo_init2+set}" = set; then
-+  echo $ECHO_N "(cached) $ECHO_C" >&6
-+else
-+  ac_check_lib_save_LIBS=$LIBS
-+LIBS="-llzo  $LIBS"
-+cat >conftest.$ac_ext <<_ACEOF
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
- cat >>conftest.$ac_ext <<_ACEOF
- /* end confdefs.h.  */
--short ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
--short ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
--void _ascii () { char *s = (char *) ascii_mm; s = (char *) ascii_ii; }
--short ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
--short ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
--void _ebcdic () { char *s = (char *) ebcdic_mm; s = (char *) ebcdic_ii; }
-+
-+/* Override any gcc2 internal prototype to avoid an error.  */
-+#ifdef __cplusplus
-+extern "C"
-+#endif
-+/* We use char because int might match the return type of a gcc2
-+   builtin and then its argument prototype would still apply.  */
-+char __lzo_init2 ();
- int
- main ()
- {
-- _ascii (); _ebcdic ();
-+__lzo_init2 ();
-   ;
-   return 0;
- }
- _ACEOF
--rm -f conftest.$ac_objext
--if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
--  (eval $ac_compile) 2>conftest.er1
-+rm -f conftest.$ac_objext conftest$ac_exeext
-+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-+  (eval $ac_link) 2>conftest.er1
-   ac_status=$?
-   grep -v '^ *+' conftest.er1 >conftest.err
-   rm -f conftest.er1
-   cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } &&
--       { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
-+       { ac_try='test -z "$ac_c_werror_flag"
-+                       || test ! -s conftest.err'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); }; } &&
--       { ac_try='test -s conftest.$ac_objext'
-+       { ac_try='test -s conftest$ac_exeext'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); }; }; then
--  if grep BIGenDianSyS conftest.$ac_objext >/dev/null ; then
--  ac_cv_c_bigendian=yes
--fi
--if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then
--  if test "$ac_cv_c_bigendian" = unknown; then
--    ac_cv_c_bigendian=no
--  else
--    # finding both strings is unlikely to happen, but who knows?
--    ac_cv_c_bigendian=unknown
--  fi
--fi
-+  ac_cv_lib_lzo___lzo_init2=yes
- else
-   echo "$as_me: failed program was:" >&5
- sed 's/^/| /' conftest.$ac_ext >&5
-+ac_cv_lib_lzo___lzo_init2=no
- fi
--rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-+rm -f conftest.err conftest.$ac_objext \
-+      conftest$ac_exeext conftest.$ac_ext
-+LIBS=$ac_check_lib_save_LIBS
-+fi
-+echo "$as_me:$LINENO: result: $ac_cv_lib_lzo___lzo_init2" >&5
-+echo "${ECHO_T}$ac_cv_lib_lzo___lzo_init2" >&6
-+if test $ac_cv_lib_lzo___lzo_init2 = yes; then
-+  LIBLZO="-llzo"
-+else
-+  { { echo "$as_me:$LINENO: error: LZO library version 1.02 or later is required" >&5
-+echo "$as_me: error: LZO library version 1.02 or later is required" >&2;}
-+   { (exit 1); exit 1; }; }
-+fi
-+
-+fi
-+
-+fi
-+
-+
-+  LIBS="$LIBS $LIBLZO"
-+  echo "$as_me:$LINENO: checking for lzo1x_999_compress" >&5
-+echo $ECHO_N "checking for lzo1x_999_compress... $ECHO_C" >&6
-+if test "${ac_cv_func_lzo1x_999_compress+set}" = set; then
-+  echo $ECHO_N "(cached) $ECHO_C" >&6
- else
-   cat >conftest.$ac_ext <<_ACEOF
- /* confdefs.h.  */
-@@ -4393,140 +4856,164 @@
- cat confdefs.h >>conftest.$ac_ext
- cat >>conftest.$ac_ext <<_ACEOF
- /* end confdefs.h.  */
-+/* Define lzo1x_999_compress to an innocuous variant, in case <limits.h> declares lzo1x_999_compress.
-+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-+#define lzo1x_999_compress innocuous_lzo1x_999_compress
-+
-+/* System header to define __stub macros and hopefully few prototypes,
-+    which can conflict with char lzo1x_999_compress (); below.
-+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-+    <limits.h> exists even on freestanding compilers.  */
-+
-+#ifdef __STDC__
-+# include <limits.h>
-+#else
-+# include <assert.h>
-+#endif
-+
-+#undef lzo1x_999_compress
-+
-+/* Override any gcc2 internal prototype to avoid an error.  */
-+#ifdef __cplusplus
-+extern "C"
-+{
-+#endif
-+/* We use char because int might match the return type of a gcc2
-+   builtin and then its argument prototype would still apply.  */
-+char lzo1x_999_compress ();
-+/* The GNU C library defines this for functions which it implements
-+    to always fail with ENOSYS.  Some functions are actually named
-+    something starting with __ and the normal name is an alias.  */
-+#if defined (__stub_lzo1x_999_compress) || defined (__stub___lzo1x_999_compress)
-+choke me
-+#else
-+char (*f) () = lzo1x_999_compress;
-+#endif
-+#ifdef __cplusplus
-+}
-+#endif
-+
- int
- main ()
- {
--  /* Are we little or big endian?  From Harbison&Steele.  */
--  union
--  {
--    long l;
--    char c[sizeof (long)];
--  } u;
--  u.l = 1;
--  exit (u.c[sizeof (long) - 1] == 1);
-+return f != lzo1x_999_compress;
-+  ;
-+  return 0;
- }
- _ACEOF
--rm -f conftest$ac_exeext
-+rm -f conftest.$ac_objext conftest$ac_exeext
- if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
--  (eval $ac_link) 2>&5
-+  (eval $ac_link) 2>conftest.er1
-   ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
--  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-+  (exit $ac_status); } &&
-+       { ac_try='test -z "$ac_c_werror_flag"
-+                       || test ! -s conftest.err'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; } &&
-+       { ac_try='test -s conftest$ac_exeext'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); }; }; then
--  ac_cv_c_bigendian=no
-+  ac_cv_func_lzo1x_999_compress=yes
- else
--  echo "$as_me: program exited with status $ac_status" >&5
--echo "$as_me: failed program was:" >&5
-+  echo "$as_me: failed program was:" >&5
- sed 's/^/| /' conftest.$ac_ext >&5
--( exit $ac_status )
--ac_cv_c_bigendian=yes
--fi
--rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-+ac_cv_func_lzo1x_999_compress=no
- fi
-+rm -f conftest.err conftest.$ac_objext \
-+      conftest$ac_exeext conftest.$ac_ext
- fi
--rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-+echo "$as_me:$LINENO: result: $ac_cv_func_lzo1x_999_compress" >&5
-+echo "${ECHO_T}$ac_cv_func_lzo1x_999_compress" >&6
-+if test $ac_cv_func_lzo1x_999_compress = yes; then
-+  :
-+else
-+  { { echo "$as_me:$LINENO: error: LZO1X-999 must be enabled" >&5
-+echo "$as_me: error: LZO1X-999 must be enabled" >&2;}
-+   { (exit 1); exit 1; }; }
- fi
--echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5
--echo "${ECHO_T}$ac_cv_c_bigendian" >&6
--case $ac_cv_c_bigendian in
--  yes)
--cat >>confdefs.h <<\_ACEOF
--#define WORDS_BIGENDIAN 1
--_ACEOF
-- ;;
--  no)
--     ;;
--  *)
--    { { echo "$as_me:$LINENO: error: unknown endianness
--presetting ac_cv_c_bigendian=no (or yes) will help" >&5
--echo "$as_me: error: unknown endianness
--presetting ac_cv_c_bigendian=no (or yes) will help" >&2;}
--   { (exit 1); exit 1; }; } ;;
--esac
--ac_ext=c
--ac_cpp='$CPP $CPPFLAGS'
--ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
--ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
--ac_compiler_gnu=$ac_cv_c_compiler_gnu
--echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
--echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
--# On Suns, sometimes $CPP names a directory.
--if test -n "$CPP" && test -d "$CPP"; then
--  CPP=
--fi
--if test -z "$CPP"; then
--  if test "${ac_cv_prog_CPP+set}" = set; then
-+  # LZO version 2 uses lzo/lzo1x.h, while LZO version 1 uses lzo1x.h.
-+
-+
-+for ac_header in lzo/lzo1x.h lzo1x.h
-+do
-+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-+if eval "test \"\${$as_ac_Header+set}\" = set"; then
-+  echo "$as_me:$LINENO: checking for $ac_header" >&5
-+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-+if eval "test \"\${$as_ac_Header+set}\" = set"; then
-   echo $ECHO_N "(cached) $ECHO_C" >&6
-+fi
-+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
- else
--      # Double quotes because CPP needs to be expanded
--    for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
--    do
--      ac_preproc_ok=false
--for ac_c_preproc_warn_flag in '' yes
--do
--  # Use a header file that comes with gcc, so configuring glibc
--  # with a fresh cross-compiler works.
--  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
--  # <limits.h> exists even on freestanding compilers.
--  # On the NeXT, cc -E runs the code through the compiler's parser,
--  # not just through cpp. "Syntax error" is here to catch this case.
--  cat >conftest.$ac_ext <<_ACEOF
-+  # Is the header compilable?
-+echo "$as_me:$LINENO: checking $ac_header usability" >&5
-+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
-+cat >conftest.$ac_ext <<_ACEOF
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
- cat >>conftest.$ac_ext <<_ACEOF
- /* end confdefs.h.  */
--#ifdef __STDC__
--# include <limits.h>
--#else
--# include <assert.h>
--#endif
--                   Syntax error
-+$ac_includes_default
-+#include <$ac_header>
- _ACEOF
--if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
--  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
-+rm -f conftest.$ac_objext
-+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-+  (eval $ac_compile) 2>conftest.er1
-   ac_status=$?
-   grep -v '^ *+' conftest.er1 >conftest.err
-   rm -f conftest.er1
-   cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
--  (exit $ac_status); } >/dev/null; then
--  if test -s conftest.err; then
--    ac_cpp_err=$ac_c_preproc_warn_flag
--    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
--  else
--    ac_cpp_err=
--  fi
--else
--  ac_cpp_err=yes
--fi
--if test -z "$ac_cpp_err"; then
--  :
-+  (exit $ac_status); } &&
-+       { ac_try='test -z "$ac_c_werror_flag"
-+                       || test ! -s conftest.err'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; } &&
-+       { ac_try='test -s conftest.$ac_objext'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; }; then
-+  ac_header_compiler=yes
- else
-   echo "$as_me: failed program was:" >&5
- sed 's/^/| /' conftest.$ac_ext >&5
--  # Broken: fails on valid input.
--continue
-+ac_header_compiler=no
- fi
--rm -f conftest.err conftest.$ac_ext
-+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-+echo "${ECHO_T}$ac_header_compiler" >&6
--  # OK, works on sane cases.  Now check whether non-existent headers
--  # can be detected and how.
--  cat >conftest.$ac_ext <<_ACEOF
-+# Is the header present?
-+echo "$as_me:$LINENO: checking $ac_header presence" >&5
-+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
-+cat >conftest.$ac_ext <<_ACEOF
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
- cat >>conftest.$ac_ext <<_ACEOF
- /* end confdefs.h.  */
--#include <ac_nonexistent.h>
-+#include <$ac_header>
- _ACEOF
- if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
-@@ -4546,352 +5033,237 @@
-   ac_cpp_err=yes
- fi
- if test -z "$ac_cpp_err"; then
--  # Broken: success on invalid input.
--continue
-+  ac_header_preproc=yes
- else
-   echo "$as_me: failed program was:" >&5
- sed 's/^/| /' conftest.$ac_ext >&5
--  # Passes both tests.
--ac_preproc_ok=:
--break
-+  ac_header_preproc=no
- fi
- rm -f conftest.err conftest.$ac_ext
-+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-+echo "${ECHO_T}$ac_header_preproc" >&6
--done
--# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
--rm -f conftest.err conftest.$ac_ext
--if $ac_preproc_ok; then
--  break
-+# So?  What about this header?
-+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-+  yes:no: )
-+    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
-+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
-+    ac_header_preproc=yes
-+    ;;
-+  no:yes:* )
-+    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
-+    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
-+echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
-+    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
-+    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
-+echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
-+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-+    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-+    (
-+      cat <<\_ASBOX
-+## ------------------------------- ##
-+## Report this to bug-grub@gnu.org ##
-+## ------------------------------- ##
-+_ASBOX
-+    ) |
-+      sed "s/^/$as_me: WARNING:     /" >&2
-+    ;;
-+esac
-+echo "$as_me:$LINENO: checking for $ac_header" >&5
-+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-+if eval "test \"\${$as_ac_Header+set}\" = set"; then
-+  echo $ECHO_N "(cached) $ECHO_C" >&6
-+else
-+  eval "$as_ac_Header=\$ac_header_preproc"
- fi
-+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
--    done
--    ac_cv_prog_CPP=$CPP
-+fi
-+if test `eval echo '${'$as_ac_Header'}'` = yes; then
-+  cat >>confdefs.h <<_ACEOF
-+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-+_ACEOF
- fi
--  CPP=$ac_cv_prog_CPP
--else
--  ac_cv_prog_CPP=$CPP
-+
-+done
-+
- fi
--echo "$as_me:$LINENO: result: $CPP" >&5
--echo "${ECHO_T}$CPP" >&6
--ac_preproc_ok=false
--for ac_c_preproc_warn_flag in '' yes
--do
--  # Use a header file that comes with gcc, so configuring glibc
--  # with a fresh cross-compiler works.
--  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
--  # <limits.h> exists even on freestanding compilers.
--  # On the NeXT, cc -E runs the code through the compiler's parser,
--  # not just through cpp. "Syntax error" is here to catch this case.
--  cat >conftest.$ac_ext <<_ACEOF
-+
-+# Check for curses.
-+echo "$as_me:$LINENO: checking for wgetch in -lncurses" >&5
-+echo $ECHO_N "checking for wgetch in -lncurses... $ECHO_C" >&6
-+if test "${ac_cv_lib_ncurses_wgetch+set}" = set; then
-+  echo $ECHO_N "(cached) $ECHO_C" >&6
-+else
-+  ac_check_lib_save_LIBS=$LIBS
-+LIBS="-lncurses  $LIBS"
-+cat >conftest.$ac_ext <<_ACEOF
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
- cat >>conftest.$ac_ext <<_ACEOF
- /* end confdefs.h.  */
--#ifdef __STDC__
--# include <limits.h>
--#else
--# include <assert.h>
-+
-+/* Override any gcc2 internal prototype to avoid an error.  */
-+#ifdef __cplusplus
-+extern "C"
- #endif
--                   Syntax error
-+/* We use char because int might match the return type of a gcc2
-+   builtin and then its argument prototype would still apply.  */
-+char wgetch ();
-+int
-+main ()
-+{
-+wgetch ();
-+  ;
-+  return 0;
-+}
- _ACEOF
--if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
--  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
-+rm -f conftest.$ac_objext conftest$ac_exeext
-+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-+  (eval $ac_link) 2>conftest.er1
-   ac_status=$?
-   grep -v '^ *+' conftest.er1 >conftest.err
-   rm -f conftest.er1
-   cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
--  (exit $ac_status); } >/dev/null; then
--  if test -s conftest.err; then
--    ac_cpp_err=$ac_c_preproc_warn_flag
--    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
--  else
--    ac_cpp_err=
--  fi
--else
--  ac_cpp_err=yes
--fi
--if test -z "$ac_cpp_err"; then
--  :
-+  (exit $ac_status); } &&
-+       { ac_try='test -z "$ac_c_werror_flag"
-+                       || test ! -s conftest.err'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; } &&
-+       { ac_try='test -s conftest$ac_exeext'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; }; then
-+  ac_cv_lib_ncurses_wgetch=yes
- else
-   echo "$as_me: failed program was:" >&5
- sed 's/^/| /' conftest.$ac_ext >&5
--  # Broken: fails on valid input.
--continue
-+ac_cv_lib_ncurses_wgetch=no
- fi
--rm -f conftest.err conftest.$ac_ext
--
--  # OK, works on sane cases.  Now check whether non-existent headers
--  # can be detected and how.
--  cat >conftest.$ac_ext <<_ACEOF
-+rm -f conftest.err conftest.$ac_objext \
-+      conftest$ac_exeext conftest.$ac_ext
-+LIBS=$ac_check_lib_save_LIBS
-+fi
-+echo "$as_me:$LINENO: result: $ac_cv_lib_ncurses_wgetch" >&5
-+echo "${ECHO_T}$ac_cv_lib_ncurses_wgetch" >&6
-+if test $ac_cv_lib_ncurses_wgetch = yes; then
-+  LIBCURSES="-lncurses"
-+else
-+  echo "$as_me:$LINENO: checking for wgetch in -lcurses" >&5
-+echo $ECHO_N "checking for wgetch in -lcurses... $ECHO_C" >&6
-+if test "${ac_cv_lib_curses_wgetch+set}" = set; then
-+  echo $ECHO_N "(cached) $ECHO_C" >&6
-+else
-+  ac_check_lib_save_LIBS=$LIBS
-+LIBS="-lcurses  $LIBS"
-+cat >conftest.$ac_ext <<_ACEOF
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
- cat >>conftest.$ac_ext <<_ACEOF
- /* end confdefs.h.  */
--#include <ac_nonexistent.h>
--_ACEOF
--if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
--  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
--  ac_status=$?
--  grep -v '^ *+' conftest.er1 >conftest.err
--  rm -f conftest.er1
--  cat conftest.err >&5
--  echo "$as_me:$LINENO: \$? = $ac_status" >&5
--  (exit $ac_status); } >/dev/null; then
--  if test -s conftest.err; then
--    ac_cpp_err=$ac_c_preproc_warn_flag
--    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
--  else
--    ac_cpp_err=
--  fi
--else
--  ac_cpp_err=yes
--fi
--if test -z "$ac_cpp_err"; then
--  # Broken: success on invalid input.
--continue
--else
--  echo "$as_me: failed program was:" >&5
--sed 's/^/| /' conftest.$ac_ext >&5
--
--  # Passes both tests.
--ac_preproc_ok=:
--break
--fi
--rm -f conftest.err conftest.$ac_ext
--
--done
--# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
--rm -f conftest.err conftest.$ac_ext
--if $ac_preproc_ok; then
--  :
--else
--  { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
--See \`config.log' for more details." >&5
--echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check
--See \`config.log' for more details." >&2;}
--   { (exit 1); exit 1; }; }
--fi
--
--ac_ext=c
--ac_cpp='$CPP $CPPFLAGS'
--ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
--ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
--ac_compiler_gnu=$ac_cv_c_compiler_gnu
--
--
--echo "$as_me:$LINENO: checking for egrep" >&5
--echo $ECHO_N "checking for egrep... $ECHO_C" >&6
--if test "${ac_cv_prog_egrep+set}" = set; then
--  echo $ECHO_N "(cached) $ECHO_C" >&6
--else
--  if echo a | (grep -E '(a|b)') >/dev/null 2>&1
--    then ac_cv_prog_egrep='grep -E'
--    else ac_cv_prog_egrep='egrep'
--    fi
--fi
--echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5
--echo "${ECHO_T}$ac_cv_prog_egrep" >&6
-- EGREP=$ac_cv_prog_egrep
--
--
--echo "$as_me:$LINENO: checking for ANSI C header files" >&5
--echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
--if test "${ac_cv_header_stdc+set}" = set; then
--  echo $ECHO_N "(cached) $ECHO_C" >&6
--else
--  cat >conftest.$ac_ext <<_ACEOF
--/* confdefs.h.  */
--_ACEOF
--cat confdefs.h >>conftest.$ac_ext
--cat >>conftest.$ac_ext <<_ACEOF
--/* end confdefs.h.  */
--#include <stdlib.h>
--#include <stdarg.h>
--#include <string.h>
--#include <float.h>
-+/* Override any gcc2 internal prototype to avoid an error.  */
-+#ifdef __cplusplus
-+extern "C"
-+#endif
-+/* We use char because int might match the return type of a gcc2
-+   builtin and then its argument prototype would still apply.  */
-+char wgetch ();
- int
- main ()
- {
--
-+wgetch ();
-   ;
-   return 0;
- }
- _ACEOF
--rm -f conftest.$ac_objext
--if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
--  (eval $ac_compile) 2>conftest.er1
-+rm -f conftest.$ac_objext conftest$ac_exeext
-+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-+  (eval $ac_link) 2>conftest.er1
-   ac_status=$?
-   grep -v '^ *+' conftest.er1 >conftest.err
-   rm -f conftest.er1
-   cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } &&
--       { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
-+       { ac_try='test -z "$ac_c_werror_flag"
-+                       || test ! -s conftest.err'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); }; } &&
--       { ac_try='test -s conftest.$ac_objext'
-+       { ac_try='test -s conftest$ac_exeext'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); }; }; then
--  ac_cv_header_stdc=yes
-+  ac_cv_lib_curses_wgetch=yes
- else
-   echo "$as_me: failed program was:" >&5
- sed 's/^/| /' conftest.$ac_ext >&5
--ac_cv_header_stdc=no
--fi
--rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
--
--if test $ac_cv_header_stdc = yes; then
--  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
--  cat >conftest.$ac_ext <<_ACEOF
--/* confdefs.h.  */
--_ACEOF
--cat confdefs.h >>conftest.$ac_ext
--cat >>conftest.$ac_ext <<_ACEOF
--/* end confdefs.h.  */
--#include <string.h>
--
--_ACEOF
--if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
--  $EGREP "memchr" >/dev/null 2>&1; then
--  :
--else
--  ac_cv_header_stdc=no
--fi
--rm -f conftest*
--
--fi
--
--if test $ac_cv_header_stdc = yes; then
--  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
--  cat >conftest.$ac_ext <<_ACEOF
--/* confdefs.h.  */
--_ACEOF
--cat confdefs.h >>conftest.$ac_ext
--cat >>conftest.$ac_ext <<_ACEOF
--/* end confdefs.h.  */
--#include <stdlib.h>
--
--_ACEOF
--if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
--  $EGREP "free" >/dev/null 2>&1; then
--  :
--else
--  ac_cv_header_stdc=no
--fi
--rm -f conftest*
--
--fi
--
--if test $ac_cv_header_stdc = yes; then
--  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
--  if test "$cross_compiling" = yes; then
--  :
--else
--  cat >conftest.$ac_ext <<_ACEOF
--/* confdefs.h.  */
--_ACEOF
--cat confdefs.h >>conftest.$ac_ext
--cat >>conftest.$ac_ext <<_ACEOF
--/* end confdefs.h.  */
--#include <ctype.h>
--#if ((' ' & 0x0FF) == 0x020)
--# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
--# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
--#else
--# define ISLOWER(c) \
--                 (('a' <= (c) && (c) <= 'i') \
--                   || ('j' <= (c) && (c) <= 'r') \
--                   || ('s' <= (c) && (c) <= 'z'))
--# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
--#endif
--
--#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
--int
--main ()
--{
--  int i;
--  for (i = 0; i < 256; i++)
--    if (XOR (islower (i), ISLOWER (i))
--      || toupper (i) != TOUPPER (i))
--      exit(2);
--  exit (0);
--}
--_ACEOF
--rm -f conftest$ac_exeext
--if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
--  (eval $ac_link) 2>&5
--  ac_status=$?
--  echo "$as_me:$LINENO: \$? = $ac_status" >&5
--  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
--  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
--  (eval $ac_try) 2>&5
--  ac_status=$?
--  echo "$as_me:$LINENO: \$? = $ac_status" >&5
--  (exit $ac_status); }; }; then
--  :
--else
--  echo "$as_me: program exited with status $ac_status" >&5
--echo "$as_me: failed program was:" >&5
--sed 's/^/| /' conftest.$ac_ext >&5
--
--( exit $ac_status )
--ac_cv_header_stdc=no
--fi
--rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-+ac_cv_lib_curses_wgetch=no
- fi
-+rm -f conftest.err conftest.$ac_objext \
-+      conftest$ac_exeext conftest.$ac_ext
-+LIBS=$ac_check_lib_save_LIBS
- fi
-+echo "$as_me:$LINENO: result: $ac_cv_lib_curses_wgetch" >&5
-+echo "${ECHO_T}$ac_cv_lib_curses_wgetch" >&6
-+if test $ac_cv_lib_curses_wgetch = yes; then
-+  LIBCURSES="-lcurses"
- fi
--echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
--echo "${ECHO_T}$ac_cv_header_stdc" >&6
--if test $ac_cv_header_stdc = yes; then
--
--cat >>confdefs.h <<\_ACEOF
--#define STDC_HEADERS 1
--_ACEOF
- fi
--# On IRIX 5.3, sys/types and inttypes.h are conflicting.
--
--
--
--
-+# Check for headers.
--for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
--                inttypes.h stdint.h unistd.h
-+for ac_header in ncurses/curses.h ncurses.h curses.h
- do
- as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
--echo "$as_me:$LINENO: checking for $ac_header" >&5
-+if eval "test \"\${$as_ac_Header+set}\" = set"; then
-+  echo "$as_me:$LINENO: checking for $ac_header" >&5
- echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
- if eval "test \"\${$as_ac_Header+set}\" = set"; then
-   echo $ECHO_N "(cached) $ECHO_C" >&6
-+fi
-+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
- else
--  cat >conftest.$ac_ext <<_ACEOF
-+  # Is the header compilable?
-+echo "$as_me:$LINENO: checking $ac_header usability" >&5
-+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
-+cat >conftest.$ac_ext <<_ACEOF
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
- cat >>conftest.$ac_ext <<_ACEOF
- /* end confdefs.h.  */
- $ac_includes_default
--
- #include <$ac_header>
- _ACEOF
- rm -f conftest.$ac_objext
-@@ -4903,7 +5275,8 @@
-   cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } &&
--       { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
-+       { ac_try='test -z "$ac_c_werror_flag"
-+                       || test ! -s conftest.err'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-@@ -4915,649 +5288,728 @@
-   ac_status=$?
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); }; }; then
--  eval "$as_ac_Header=yes"
-+  ac_header_compiler=yes
- else
-   echo "$as_me: failed program was:" >&5
- sed 's/^/| /' conftest.$ac_ext >&5
--eval "$as_ac_Header=no"
-+ac_header_compiler=no
- fi
- rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
--fi
--echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
--echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
--if test `eval echo '${'$as_ac_Header'}'` = yes; then
--  cat >>confdefs.h <<_ACEOF
--#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
--_ACEOF
--
--fi
--
--done
--
-+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-+echo "${ECHO_T}$ac_header_compiler" >&6
--echo "$as_me:$LINENO: checking for void *" >&5
--echo $ECHO_N "checking for void *... $ECHO_C" >&6
--if test "${ac_cv_type_void_p+set}" = set; then
--  echo $ECHO_N "(cached) $ECHO_C" >&6
--else
--  cat >conftest.$ac_ext <<_ACEOF
--/* confdefs.h.  */
-+# Is the header present?
-+echo "$as_me:$LINENO: checking $ac_header presence" >&5
-+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
-+cat >conftest.$ac_ext <<_ACEOF
-+/* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
- cat >>conftest.$ac_ext <<_ACEOF
- /* end confdefs.h.  */
--$ac_includes_default
--int
--main ()
--{
--if ((void * *) 0)
--  return 0;
--if (sizeof (void *))
--  return 0;
--  ;
--  return 0;
--}
-+#include <$ac_header>
- _ACEOF
--rm -f conftest.$ac_objext
--if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
--  (eval $ac_compile) 2>conftest.er1
-+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
-   ac_status=$?
-   grep -v '^ *+' conftest.er1 >conftest.err
-   rm -f conftest.er1
-   cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
--  (exit $ac_status); } &&
--       { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
--  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
--  (eval $ac_try) 2>&5
--  ac_status=$?
--  echo "$as_me:$LINENO: \$? = $ac_status" >&5
--  (exit $ac_status); }; } &&
--       { ac_try='test -s conftest.$ac_objext'
--  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
--  (eval $ac_try) 2>&5
--  ac_status=$?
--  echo "$as_me:$LINENO: \$? = $ac_status" >&5
--  (exit $ac_status); }; }; then
--  ac_cv_type_void_p=yes
-+  (exit $ac_status); } >/dev/null; then
-+  if test -s conftest.err; then
-+    ac_cpp_err=$ac_c_preproc_warn_flag
-+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
-+  else
-+    ac_cpp_err=
-+  fi
-+else
-+  ac_cpp_err=yes
-+fi
-+if test -z "$ac_cpp_err"; then
-+  ac_header_preproc=yes
- else
-   echo "$as_me: failed program was:" >&5
- sed 's/^/| /' conftest.$ac_ext >&5
--ac_cv_type_void_p=no
--fi
--rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-+  ac_header_preproc=no
- fi
--echo "$as_me:$LINENO: result: $ac_cv_type_void_p" >&5
--echo "${ECHO_T}$ac_cv_type_void_p" >&6
-+rm -f conftest.err conftest.$ac_ext
-+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-+echo "${ECHO_T}$ac_header_preproc" >&6
--echo "$as_me:$LINENO: checking size of void *" >&5
--echo $ECHO_N "checking size of void *... $ECHO_C" >&6
--if test "${ac_cv_sizeof_void_p+set}" = set; then
-+# So?  What about this header?
-+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-+  yes:no: )
-+    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
-+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
-+    ac_header_preproc=yes
-+    ;;
-+  no:yes:* )
-+    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
-+    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
-+echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
-+    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
-+    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
-+echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
-+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-+    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-+    (
-+      cat <<\_ASBOX
-+## ------------------------------- ##
-+## Report this to bug-grub@gnu.org ##
-+## ------------------------------- ##
-+_ASBOX
-+    ) |
-+      sed "s/^/$as_me: WARNING:     /" >&2
-+    ;;
-+esac
-+echo "$as_me:$LINENO: checking for $ac_header" >&5
-+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-+if eval "test \"\${$as_ac_Header+set}\" = set"; then
-   echo $ECHO_N "(cached) $ECHO_C" >&6
- else
--  if test "$ac_cv_type_void_p" = yes; then
--  # The cast to unsigned long works around a bug in the HP C Compiler
--  # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
--  # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
--  # This bug is HP SR number 8606223364.
--  if test "$cross_compiling" = yes; then
--  # Depending upon the size, compute the lo and hi bounds.
--cat >conftest.$ac_ext <<_ACEOF
--/* confdefs.h.  */
--_ACEOF
--cat confdefs.h >>conftest.$ac_ext
--cat >>conftest.$ac_ext <<_ACEOF
--/* end confdefs.h.  */
--$ac_includes_default
--int
--main ()
--{
--static int test_array [1 - 2 * !(((long) (sizeof (void *))) >= 0)];
--test_array [0] = 0
-+  eval "$as_ac_Header=\$ac_header_preproc"
-+fi
-+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
--  ;
--  return 0;
--}
--_ACEOF
--rm -f conftest.$ac_objext
--if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
--  (eval $ac_compile) 2>conftest.er1
--  ac_status=$?
--  grep -v '^ *+' conftest.er1 >conftest.err
--  rm -f conftest.er1
--  cat conftest.err >&5
--  echo "$as_me:$LINENO: \$? = $ac_status" >&5
--  (exit $ac_status); } &&
--       { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
--  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
--  (eval $ac_try) 2>&5
--  ac_status=$?
--  echo "$as_me:$LINENO: \$? = $ac_status" >&5
--  (exit $ac_status); }; } &&
--       { ac_try='test -s conftest.$ac_objext'
--  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
--  (eval $ac_try) 2>&5
--  ac_status=$?
--  echo "$as_me:$LINENO: \$? = $ac_status" >&5
--  (exit $ac_status); }; }; then
--  ac_lo=0 ac_mid=0
--  while :; do
--    cat >conftest.$ac_ext <<_ACEOF
--/* confdefs.h.  */
-+fi
-+if test `eval echo '${'$as_ac_Header'}'` = yes; then
-+  cat >>confdefs.h <<_ACEOF
-+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
- _ACEOF
--cat confdefs.h >>conftest.$ac_ext
--cat >>conftest.$ac_ext <<_ACEOF
--/* end confdefs.h.  */
--$ac_includes_default
--int
--main ()
--{
--static int test_array [1 - 2 * !(((long) (sizeof (void *))) <= $ac_mid)];
--test_array [0] = 0
--  ;
--  return 0;
--}
--_ACEOF
--rm -f conftest.$ac_objext
--if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
--  (eval $ac_compile) 2>conftest.er1
--  ac_status=$?
--  grep -v '^ *+' conftest.er1 >conftest.err
--  rm -f conftest.er1
--  cat conftest.err >&5
--  echo "$as_me:$LINENO: \$? = $ac_status" >&5
--  (exit $ac_status); } &&
--       { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
--  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
--  (eval $ac_try) 2>&5
--  ac_status=$?
--  echo "$as_me:$LINENO: \$? = $ac_status" >&5
--  (exit $ac_status); }; } &&
--       { ac_try='test -s conftest.$ac_objext'
--  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
--  (eval $ac_try) 2>&5
--  ac_status=$?
--  echo "$as_me:$LINENO: \$? = $ac_status" >&5
--  (exit $ac_status); }; }; then
--  ac_hi=$ac_mid; break
-+fi
-+
-+done
-+
-+
-+#
-+# Check for target programs.
-+#
-+
-+# For cross-compiling.
-+if test "x$target" != "x$host"; then
-+  # XXX this depends on the implementation of autoconf!
-+  tmp_ac_tool_prefix="$ac_tool_prefix"
-+  ac_tool_prefix=$target_alias-
-+
-+  if test -n "$ac_tool_prefix"; then
-+  for ac_prog in gcc egcs cc
-+  do
-+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
-+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-+echo "$as_me:$LINENO: checking for $ac_word" >&5
-+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-+if test "${ac_cv_prog_TARGET_CC+set}" = set; then
-+  echo $ECHO_N "(cached) $ECHO_C" >&6
- else
--  echo "$as_me: failed program was:" >&5
--sed 's/^/| /' conftest.$ac_ext >&5
-+  if test -n "$TARGET_CC"; then
-+  ac_cv_prog_TARGET_CC="$TARGET_CC" # Let the user override the test.
-+else
-+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-+for as_dir in $PATH
-+do
-+  IFS=$as_save_IFS
-+  test -z "$as_dir" && as_dir=.
-+  for ac_exec_ext in '' $ac_executable_extensions; do
-+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-+    ac_cv_prog_TARGET_CC="$ac_tool_prefix$ac_prog"
-+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-+    break 2
-+  fi
-+done
-+done
--ac_lo=`expr $ac_mid + 1`
--                  if test $ac_lo -le $ac_mid; then
--                    ac_lo= ac_hi=
--                    break
--                  fi
--                  ac_mid=`expr 2 '*' $ac_mid + 1`
- fi
--rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-+fi
-+TARGET_CC=$ac_cv_prog_TARGET_CC
-+if test -n "$TARGET_CC"; then
-+  echo "$as_me:$LINENO: result: $TARGET_CC" >&5
-+echo "${ECHO_T}$TARGET_CC" >&6
-+else
-+  echo "$as_me:$LINENO: result: no" >&5
-+echo "${ECHO_T}no" >&6
-+fi
-+
-+    test -n "$TARGET_CC" && break
-   done
-+fi
-+if test -z "$TARGET_CC"; then
-+  ac_ct_TARGET_CC=$TARGET_CC
-+  for ac_prog in gcc egcs cc
-+do
-+  # Extract the first word of "$ac_prog", so it can be a program name with args.
-+set dummy $ac_prog; ac_word=$2
-+echo "$as_me:$LINENO: checking for $ac_word" >&5
-+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-+if test "${ac_cv_prog_ac_ct_TARGET_CC+set}" = set; then
-+  echo $ECHO_N "(cached) $ECHO_C" >&6
- else
--  echo "$as_me: failed program was:" >&5
--sed 's/^/| /' conftest.$ac_ext >&5
-+  if test -n "$ac_ct_TARGET_CC"; then
-+  ac_cv_prog_ac_ct_TARGET_CC="$ac_ct_TARGET_CC" # Let the user override the test.
-+else
-+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-+for as_dir in $PATH
-+do
-+  IFS=$as_save_IFS
-+  test -z "$as_dir" && as_dir=.
-+  for ac_exec_ext in '' $ac_executable_extensions; do
-+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-+    ac_cv_prog_ac_ct_TARGET_CC="$ac_prog"
-+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-+    break 2
-+  fi
-+done
-+done
--cat >conftest.$ac_ext <<_ACEOF
--/* confdefs.h.  */
--_ACEOF
--cat confdefs.h >>conftest.$ac_ext
--cat >>conftest.$ac_ext <<_ACEOF
--/* end confdefs.h.  */
--$ac_includes_default
--int
--main ()
--{
--static int test_array [1 - 2 * !(((long) (sizeof (void *))) < 0)];
--test_array [0] = 0
-+fi
-+fi
-+ac_ct_TARGET_CC=$ac_cv_prog_ac_ct_TARGET_CC
-+if test -n "$ac_ct_TARGET_CC"; then
-+  echo "$as_me:$LINENO: result: $ac_ct_TARGET_CC" >&5
-+echo "${ECHO_T}$ac_ct_TARGET_CC" >&6
-+else
-+  echo "$as_me:$LINENO: result: no" >&5
-+echo "${ECHO_T}no" >&6
-+fi
--  ;
--  return 0;
--}
--_ACEOF
--rm -f conftest.$ac_objext
--if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
--  (eval $ac_compile) 2>conftest.er1
--  ac_status=$?
--  grep -v '^ *+' conftest.er1 >conftest.err
--  rm -f conftest.er1
--  cat conftest.err >&5
--  echo "$as_me:$LINENO: \$? = $ac_status" >&5
--  (exit $ac_status); } &&
--       { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
--  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
--  (eval $ac_try) 2>&5
--  ac_status=$?
--  echo "$as_me:$LINENO: \$? = $ac_status" >&5
--  (exit $ac_status); }; } &&
--       { ac_try='test -s conftest.$ac_objext'
--  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
--  (eval $ac_try) 2>&5
--  ac_status=$?
--  echo "$as_me:$LINENO: \$? = $ac_status" >&5
--  (exit $ac_status); }; }; then
--  ac_hi=-1 ac_mid=-1
--  while :; do
--    cat >conftest.$ac_ext <<_ACEOF
--/* confdefs.h.  */
--_ACEOF
--cat confdefs.h >>conftest.$ac_ext
--cat >>conftest.$ac_ext <<_ACEOF
--/* end confdefs.h.  */
--$ac_includes_default
--int
--main ()
--{
--static int test_array [1 - 2 * !(((long) (sizeof (void *))) >= $ac_mid)];
--test_array [0] = 0
-+  test -n "$ac_ct_TARGET_CC" && break
-+done
-+test -n "$ac_ct_TARGET_CC" || ac_ct_TARGET_CC="{ { echo "$as_me:$LINENO: error: none of gcc, egcs and cc is found. set TARGET_CC manually." >&5
-+echo "$as_me: error: none of gcc, egcs and cc is found. set TARGET_CC manually." >&2;}
-+   { (exit 1); exit 1; }; }"
--  ;
--  return 0;
--}
--_ACEOF
--rm -f conftest.$ac_objext
--if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
--  (eval $ac_compile) 2>conftest.er1
--  ac_status=$?
--  grep -v '^ *+' conftest.er1 >conftest.err
--  rm -f conftest.er1
--  cat conftest.err >&5
--  echo "$as_me:$LINENO: \$? = $ac_status" >&5
--  (exit $ac_status); } &&
--       { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
--  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
--  (eval $ac_try) 2>&5
--  ac_status=$?
--  echo "$as_me:$LINENO: \$? = $ac_status" >&5
--  (exit $ac_status); }; } &&
--       { ac_try='test -s conftest.$ac_objext'
--  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
--  (eval $ac_try) 2>&5
--  ac_status=$?
--  echo "$as_me:$LINENO: \$? = $ac_status" >&5
--  (exit $ac_status); }; }; then
--  ac_lo=$ac_mid; break
-+  TARGET_CC=$ac_ct_TARGET_CC
-+fi
-+
-+  if test -n "$ac_tool_prefix"; then
-+  # Extract the first word of "${ac_tool_prefix}objcopy", so it can be a program name with args.
-+set dummy ${ac_tool_prefix}objcopy; ac_word=$2
-+echo "$as_me:$LINENO: checking for $ac_word" >&5
-+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-+if test "${ac_cv_prog_OBJCOPY+set}" = set; then
-+  echo $ECHO_N "(cached) $ECHO_C" >&6
-+else
-+  if test -n "$OBJCOPY"; then
-+  ac_cv_prog_OBJCOPY="$OBJCOPY" # Let the user override the test.
-+else
-+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-+for as_dir in $PATH
-+do
-+  IFS=$as_save_IFS
-+  test -z "$as_dir" && as_dir=.
-+  for ac_exec_ext in '' $ac_executable_extensions; do
-+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-+    ac_cv_prog_OBJCOPY="${ac_tool_prefix}objcopy"
-+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-+    break 2
-+  fi
-+done
-+done
-+
-+fi
-+fi
-+OBJCOPY=$ac_cv_prog_OBJCOPY
-+if test -n "$OBJCOPY"; then
-+  echo "$as_me:$LINENO: result: $OBJCOPY" >&5
-+echo "${ECHO_T}$OBJCOPY" >&6
-+else
-+  echo "$as_me:$LINENO: result: no" >&5
-+echo "${ECHO_T}no" >&6
-+fi
-+
-+fi
-+if test -z "$ac_cv_prog_OBJCOPY"; then
-+  ac_ct_OBJCOPY=$OBJCOPY
-+  # Extract the first word of "objcopy", so it can be a program name with args.
-+set dummy objcopy; ac_word=$2
-+echo "$as_me:$LINENO: checking for $ac_word" >&5
-+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-+if test "${ac_cv_prog_ac_ct_OBJCOPY+set}" = set; then
-+  echo $ECHO_N "(cached) $ECHO_C" >&6
-+else
-+  if test -n "$ac_ct_OBJCOPY"; then
-+  ac_cv_prog_ac_ct_OBJCOPY="$ac_ct_OBJCOPY" # Let the user override the test.
-+else
-+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-+for as_dir in $PATH
-+do
-+  IFS=$as_save_IFS
-+  test -z "$as_dir" && as_dir=.
-+  for ac_exec_ext in '' $ac_executable_extensions; do
-+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-+    ac_cv_prog_ac_ct_OBJCOPY="objcopy"
-+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-+    break 2
-+  fi
-+done
-+done
-+
-+fi
-+fi
-+ac_ct_OBJCOPY=$ac_cv_prog_ac_ct_OBJCOPY
-+if test -n "$ac_ct_OBJCOPY"; then
-+  echo "$as_me:$LINENO: result: $ac_ct_OBJCOPY" >&5
-+echo "${ECHO_T}$ac_ct_OBJCOPY" >&6
-+else
-+  echo "$as_me:$LINENO: result: no" >&5
-+echo "${ECHO_T}no" >&6
-+fi
-+
-+  OBJCOPY=$ac_ct_OBJCOPY
-+else
-+  OBJCOPY="$ac_cv_prog_OBJCOPY"
-+fi
-+
-+  if test -n "$ac_tool_prefix"; then
-+  # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
-+set dummy ${ac_tool_prefix}strip; ac_word=$2
-+echo "$as_me:$LINENO: checking for $ac_word" >&5
-+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-+if test "${ac_cv_prog_STRIP+set}" = set; then
-+  echo $ECHO_N "(cached) $ECHO_C" >&6
-+else
-+  if test -n "$STRIP"; then
-+  ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
-+else
-+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-+for as_dir in $PATH
-+do
-+  IFS=$as_save_IFS
-+  test -z "$as_dir" && as_dir=.
-+  for ac_exec_ext in '' $ac_executable_extensions; do
-+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-+    ac_cv_prog_STRIP="${ac_tool_prefix}strip"
-+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-+    break 2
-+  fi
-+done
-+done
-+
-+fi
-+fi
-+STRIP=$ac_cv_prog_STRIP
-+if test -n "$STRIP"; then
-+  echo "$as_me:$LINENO: result: $STRIP" >&5
-+echo "${ECHO_T}$STRIP" >&6
-+else
-+  echo "$as_me:$LINENO: result: no" >&5
-+echo "${ECHO_T}no" >&6
-+fi
-+
-+fi
-+if test -z "$ac_cv_prog_STRIP"; then
-+  ac_ct_STRIP=$STRIP
-+  # Extract the first word of "strip", so it can be a program name with args.
-+set dummy strip; ac_word=$2
-+echo "$as_me:$LINENO: checking for $ac_word" >&5
-+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-+if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
-+  echo $ECHO_N "(cached) $ECHO_C" >&6
-+else
-+  if test -n "$ac_ct_STRIP"; then
-+  ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
-+else
-+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-+for as_dir in $PATH
-+do
-+  IFS=$as_save_IFS
-+  test -z "$as_dir" && as_dir=.
-+  for ac_exec_ext in '' $ac_executable_extensions; do
-+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-+    ac_cv_prog_ac_ct_STRIP="strip"
-+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-+    break 2
-+  fi
-+done
-+done
-+
-+fi
-+fi
-+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
-+if test -n "$ac_ct_STRIP"; then
-+  echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
-+echo "${ECHO_T}$ac_ct_STRIP" >&6
-+else
-+  echo "$as_me:$LINENO: result: no" >&5
-+echo "${ECHO_T}no" >&6
-+fi
-+
-+  STRIP=$ac_ct_STRIP
-+else
-+  STRIP="$ac_cv_prog_STRIP"
-+fi
-+
-+  if test -n "$ac_tool_prefix"; then
-+  # Extract the first word of "${ac_tool_prefix}nm", so it can be a program name with args.
-+set dummy ${ac_tool_prefix}nm; ac_word=$2
-+echo "$as_me:$LINENO: checking for $ac_word" >&5
-+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-+if test "${ac_cv_prog_NM+set}" = set; then
-+  echo $ECHO_N "(cached) $ECHO_C" >&6
-+else
-+  if test -n "$NM"; then
-+  ac_cv_prog_NM="$NM" # Let the user override the test.
-+else
-+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-+for as_dir in $PATH
-+do
-+  IFS=$as_save_IFS
-+  test -z "$as_dir" && as_dir=.
-+  for ac_exec_ext in '' $ac_executable_extensions; do
-+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-+    ac_cv_prog_NM="${ac_tool_prefix}nm"
-+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-+    break 2
-+  fi
-+done
-+done
-+
-+fi
-+fi
-+NM=$ac_cv_prog_NM
-+if test -n "$NM"; then
-+  echo "$as_me:$LINENO: result: $NM" >&5
-+echo "${ECHO_T}$NM" >&6
-+else
-+  echo "$as_me:$LINENO: result: no" >&5
-+echo "${ECHO_T}no" >&6
-+fi
-+
-+fi
-+if test -z "$ac_cv_prog_NM"; then
-+  ac_ct_NM=$NM
-+  # Extract the first word of "nm", so it can be a program name with args.
-+set dummy nm; ac_word=$2
-+echo "$as_me:$LINENO: checking for $ac_word" >&5
-+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-+if test "${ac_cv_prog_ac_ct_NM+set}" = set; then
-+  echo $ECHO_N "(cached) $ECHO_C" >&6
-+else
-+  if test -n "$ac_ct_NM"; then
-+  ac_cv_prog_ac_ct_NM="$ac_ct_NM" # Let the user override the test.
-+else
-+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-+for as_dir in $PATH
-+do
-+  IFS=$as_save_IFS
-+  test -z "$as_dir" && as_dir=.
-+  for ac_exec_ext in '' $ac_executable_extensions; do
-+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-+    ac_cv_prog_ac_ct_NM="nm"
-+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-+    break 2
-+  fi
-+done
-+done
-+
-+fi
-+fi
-+ac_ct_NM=$ac_cv_prog_ac_ct_NM
-+if test -n "$ac_ct_NM"; then
-+  echo "$as_me:$LINENO: result: $ac_ct_NM" >&5
-+echo "${ECHO_T}$ac_ct_NM" >&6
-+else
-+  echo "$as_me:$LINENO: result: no" >&5
-+echo "${ECHO_T}no" >&6
-+fi
-+
-+  NM=$ac_ct_NM
-+else
-+  NM="$ac_cv_prog_NM"
-+fi
-+
-+
-+  ac_tool_prefix="$tmp_ac_tool_prefix"
-+else
-+  if test "x$TARGET_CC" = x; then
-+    TARGET_CC=$CC
-+  fi
-+  if test -n "$ac_tool_prefix"; then
-+  # Extract the first word of "${ac_tool_prefix}objcopy", so it can be a program name with args.
-+set dummy ${ac_tool_prefix}objcopy; ac_word=$2
-+echo "$as_me:$LINENO: checking for $ac_word" >&5
-+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-+if test "${ac_cv_prog_OBJCOPY+set}" = set; then
-+  echo $ECHO_N "(cached) $ECHO_C" >&6
-+else
-+  if test -n "$OBJCOPY"; then
-+  ac_cv_prog_OBJCOPY="$OBJCOPY" # Let the user override the test.
-+else
-+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-+for as_dir in $PATH
-+do
-+  IFS=$as_save_IFS
-+  test -z "$as_dir" && as_dir=.
-+  for ac_exec_ext in '' $ac_executable_extensions; do
-+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-+    ac_cv_prog_OBJCOPY="${ac_tool_prefix}objcopy"
-+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-+    break 2
-+  fi
-+done
-+done
-+
-+fi
-+fi
-+OBJCOPY=$ac_cv_prog_OBJCOPY
-+if test -n "$OBJCOPY"; then
-+  echo "$as_me:$LINENO: result: $OBJCOPY" >&5
-+echo "${ECHO_T}$OBJCOPY" >&6
- else
--  echo "$as_me: failed program was:" >&5
--sed 's/^/| /' conftest.$ac_ext >&5
-+  echo "$as_me:$LINENO: result: no" >&5
-+echo "${ECHO_T}no" >&6
-+fi
--ac_hi=`expr '(' $ac_mid ')' - 1`
--                     if test $ac_mid -le $ac_hi; then
--                       ac_lo= ac_hi=
--                       break
--                     fi
--                     ac_mid=`expr 2 '*' $ac_mid`
- fi
--rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
--  done
-+if test -z "$ac_cv_prog_OBJCOPY"; then
-+  ac_ct_OBJCOPY=$OBJCOPY
-+  # Extract the first word of "objcopy", so it can be a program name with args.
-+set dummy objcopy; ac_word=$2
-+echo "$as_me:$LINENO: checking for $ac_word" >&5
-+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-+if test "${ac_cv_prog_ac_ct_OBJCOPY+set}" = set; then
-+  echo $ECHO_N "(cached) $ECHO_C" >&6
- else
--  echo "$as_me: failed program was:" >&5
--sed 's/^/| /' conftest.$ac_ext >&5
-+  if test -n "$ac_ct_OBJCOPY"; then
-+  ac_cv_prog_ac_ct_OBJCOPY="$ac_ct_OBJCOPY" # Let the user override the test.
-+else
-+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-+for as_dir in $PATH
-+do
-+  IFS=$as_save_IFS
-+  test -z "$as_dir" && as_dir=.
-+  for ac_exec_ext in '' $ac_executable_extensions; do
-+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-+    ac_cv_prog_ac_ct_OBJCOPY="objcopy"
-+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-+    break 2
-+  fi
-+done
-+done
--ac_lo= ac_hi=
- fi
--rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
- fi
--rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
--# Binary search between lo and hi bounds.
--while test "x$ac_lo" != "x$ac_hi"; do
--  ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
--  cat >conftest.$ac_ext <<_ACEOF
--/* confdefs.h.  */
--_ACEOF
--cat confdefs.h >>conftest.$ac_ext
--cat >>conftest.$ac_ext <<_ACEOF
--/* end confdefs.h.  */
--$ac_includes_default
--int
--main ()
--{
--static int test_array [1 - 2 * !(((long) (sizeof (void *))) <= $ac_mid)];
--test_array [0] = 0
--
--  ;
--  return 0;
--}
--_ACEOF
--rm -f conftest.$ac_objext
--if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
--  (eval $ac_compile) 2>conftest.er1
--  ac_status=$?
--  grep -v '^ *+' conftest.er1 >conftest.err
--  rm -f conftest.er1
--  cat conftest.err >&5
--  echo "$as_me:$LINENO: \$? = $ac_status" >&5
--  (exit $ac_status); } &&
--       { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
--  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
--  (eval $ac_try) 2>&5
--  ac_status=$?
--  echo "$as_me:$LINENO: \$? = $ac_status" >&5
--  (exit $ac_status); }; } &&
--       { ac_try='test -s conftest.$ac_objext'
--  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
--  (eval $ac_try) 2>&5
--  ac_status=$?
--  echo "$as_me:$LINENO: \$? = $ac_status" >&5
--  (exit $ac_status); }; }; then
--  ac_hi=$ac_mid
-+ac_ct_OBJCOPY=$ac_cv_prog_ac_ct_OBJCOPY
-+if test -n "$ac_ct_OBJCOPY"; then
-+  echo "$as_me:$LINENO: result: $ac_ct_OBJCOPY" >&5
-+echo "${ECHO_T}$ac_ct_OBJCOPY" >&6
- else
--  echo "$as_me: failed program was:" >&5
--sed 's/^/| /' conftest.$ac_ext >&5
-+  echo "$as_me:$LINENO: result: no" >&5
-+echo "${ECHO_T}no" >&6
-+fi
--ac_lo=`expr '(' $ac_mid ')' + 1`
-+  OBJCOPY=$ac_ct_OBJCOPY
-+else
-+  OBJCOPY="$ac_cv_prog_OBJCOPY"
- fi
--rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-+
-+  if test -n "$ac_tool_prefix"; then
-+  # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
-+set dummy ${ac_tool_prefix}strip; ac_word=$2
-+echo "$as_me:$LINENO: checking for $ac_word" >&5
-+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-+if test "${ac_cv_prog_STRIP+set}" = set; then
-+  echo $ECHO_N "(cached) $ECHO_C" >&6
-+else
-+  if test -n "$STRIP"; then
-+  ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
-+else
-+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-+for as_dir in $PATH
-+do
-+  IFS=$as_save_IFS
-+  test -z "$as_dir" && as_dir=.
-+  for ac_exec_ext in '' $ac_executable_extensions; do
-+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-+    ac_cv_prog_STRIP="${ac_tool_prefix}strip"
-+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-+    break 2
-+  fi
- done
--case $ac_lo in
--?*) ac_cv_sizeof_void_p=$ac_lo;;
--'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (void *), 77
--See \`config.log' for more details." >&5
--echo "$as_me: error: cannot compute sizeof (void *), 77
--See \`config.log' for more details." >&2;}
--   { (exit 1); exit 1; }; } ;;
--esac
-+done
-+
-+fi
-+fi
-+STRIP=$ac_cv_prog_STRIP
-+if test -n "$STRIP"; then
-+  echo "$as_me:$LINENO: result: $STRIP" >&5
-+echo "${ECHO_T}$STRIP" >&6
- else
--  if test "$cross_compiling" = yes; then
--  { { echo "$as_me:$LINENO: error: internal error: not reached in cross-compile" >&5
--echo "$as_me: error: internal error: not reached in cross-compile" >&2;}
--   { (exit 1); exit 1; }; }
-+  echo "$as_me:$LINENO: result: no" >&5
-+echo "${ECHO_T}no" >&6
-+fi
-+
-+fi
-+if test -z "$ac_cv_prog_STRIP"; then
-+  ac_ct_STRIP=$STRIP
-+  # Extract the first word of "strip", so it can be a program name with args.
-+set dummy strip; ac_word=$2
-+echo "$as_me:$LINENO: checking for $ac_word" >&5
-+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-+if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
-+  echo $ECHO_N "(cached) $ECHO_C" >&6
- else
--  cat >conftest.$ac_ext <<_ACEOF
--/* confdefs.h.  */
--_ACEOF
--cat confdefs.h >>conftest.$ac_ext
--cat >>conftest.$ac_ext <<_ACEOF
--/* end confdefs.h.  */
--$ac_includes_default
--long longval () { return (long) (sizeof (void *)); }
--unsigned long ulongval () { return (long) (sizeof (void *)); }
--#include <stdio.h>
--#include <stdlib.h>
--int
--main ()
--{
-+  if test -n "$ac_ct_STRIP"; then
-+  ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
-+else
-+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-+for as_dir in $PATH
-+do
-+  IFS=$as_save_IFS
-+  test -z "$as_dir" && as_dir=.
-+  for ac_exec_ext in '' $ac_executable_extensions; do
-+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-+    ac_cv_prog_ac_ct_STRIP="strip"
-+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-+    break 2
-+  fi
-+done
-+done
--  FILE *f = fopen ("conftest.val", "w");
--  if (! f)
--    exit (1);
--  if (((long) (sizeof (void *))) < 0)
--    {
--      long i = longval ();
--      if (i != ((long) (sizeof (void *))))
--      exit (1);
--      fprintf (f, "%ld\n", i);
--    }
--  else
--    {
--      unsigned long i = ulongval ();
--      if (i != ((long) (sizeof (void *))))
--      exit (1);
--      fprintf (f, "%lu\n", i);
--    }
--  exit (ferror (f) || fclose (f) != 0);
-+fi
-+fi
-+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
-+if test -n "$ac_ct_STRIP"; then
-+  echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
-+echo "${ECHO_T}$ac_ct_STRIP" >&6
-+else
-+  echo "$as_me:$LINENO: result: no" >&5
-+echo "${ECHO_T}no" >&6
-+fi
--  ;
--  return 0;
--}
--_ACEOF
--rm -f conftest$ac_exeext
--if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
--  (eval $ac_link) 2>&5
--  ac_status=$?
--  echo "$as_me:$LINENO: \$? = $ac_status" >&5
--  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
--  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
--  (eval $ac_try) 2>&5
--  ac_status=$?
--  echo "$as_me:$LINENO: \$? = $ac_status" >&5
--  (exit $ac_status); }; }; then
--  ac_cv_sizeof_void_p=`cat conftest.val`
-+  STRIP=$ac_ct_STRIP
- else
--  echo "$as_me: program exited with status $ac_status" >&5
--echo "$as_me: failed program was:" >&5
--sed 's/^/| /' conftest.$ac_ext >&5
-+  STRIP="$ac_cv_prog_STRIP"
-+fi
-+
-+  if test -n "$ac_tool_prefix"; then
-+  # Extract the first word of "${ac_tool_prefix}nm", so it can be a program name with args.
-+set dummy ${ac_tool_prefix}nm; ac_word=$2
-+echo "$as_me:$LINENO: checking for $ac_word" >&5
-+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-+if test "${ac_cv_prog_NM+set}" = set; then
-+  echo $ECHO_N "(cached) $ECHO_C" >&6
-+else
-+  if test -n "$NM"; then
-+  ac_cv_prog_NM="$NM" # Let the user override the test.
-+else
-+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-+for as_dir in $PATH
-+do
-+  IFS=$as_save_IFS
-+  test -z "$as_dir" && as_dir=.
-+  for ac_exec_ext in '' $ac_executable_extensions; do
-+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-+    ac_cv_prog_NM="${ac_tool_prefix}nm"
-+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-+    break 2
-+  fi
-+done
-+done
--( exit $ac_status )
--{ { echo "$as_me:$LINENO: error: cannot compute sizeof (void *), 77
--See \`config.log' for more details." >&5
--echo "$as_me: error: cannot compute sizeof (void *), 77
--See \`config.log' for more details." >&2;}
--   { (exit 1); exit 1; }; }
--fi
--rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
- fi
- fi
--rm -f conftest.val
-+NM=$ac_cv_prog_NM
-+if test -n "$NM"; then
-+  echo "$as_me:$LINENO: result: $NM" >&5
-+echo "${ECHO_T}$NM" >&6
- else
--  ac_cv_sizeof_void_p=0
--fi
-+  echo "$as_me:$LINENO: result: no" >&5
-+echo "${ECHO_T}no" >&6
- fi
--echo "$as_me:$LINENO: result: $ac_cv_sizeof_void_p" >&5
--echo "${ECHO_T}$ac_cv_sizeof_void_p" >&6
--cat >>confdefs.h <<_ACEOF
--#define SIZEOF_VOID_P $ac_cv_sizeof_void_p
--_ACEOF
--
--echo "$as_me:$LINENO: checking for long" >&5
--echo $ECHO_N "checking for long... $ECHO_C" >&6
--if test "${ac_cv_type_long+set}" = set; then
-+fi
-+if test -z "$ac_cv_prog_NM"; then
-+  ac_ct_NM=$NM
-+  # Extract the first word of "nm", so it can be a program name with args.
-+set dummy nm; ac_word=$2
-+echo "$as_me:$LINENO: checking for $ac_word" >&5
-+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-+if test "${ac_cv_prog_ac_ct_NM+set}" = set; then
-   echo $ECHO_N "(cached) $ECHO_C" >&6
- else
--  cat >conftest.$ac_ext <<_ACEOF
--/* confdefs.h.  */
--_ACEOF
--cat confdefs.h >>conftest.$ac_ext
--cat >>conftest.$ac_ext <<_ACEOF
--/* end confdefs.h.  */
--$ac_includes_default
--int
--main ()
--{
--if ((long *) 0)
--  return 0;
--if (sizeof (long))
--  return 0;
--  ;
--  return 0;
--}
--_ACEOF
--rm -f conftest.$ac_objext
--if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
--  (eval $ac_compile) 2>conftest.er1
--  ac_status=$?
--  grep -v '^ *+' conftest.er1 >conftest.err
--  rm -f conftest.er1
--  cat conftest.err >&5
--  echo "$as_me:$LINENO: \$? = $ac_status" >&5
--  (exit $ac_status); } &&
--       { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
--  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
--  (eval $ac_try) 2>&5
--  ac_status=$?
--  echo "$as_me:$LINENO: \$? = $ac_status" >&5
--  (exit $ac_status); }; } &&
--       { ac_try='test -s conftest.$ac_objext'
--  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
--  (eval $ac_try) 2>&5
--  ac_status=$?
--  echo "$as_me:$LINENO: \$? = $ac_status" >&5
--  (exit $ac_status); }; }; then
--  ac_cv_type_long=yes
-+  if test -n "$ac_ct_NM"; then
-+  ac_cv_prog_ac_ct_NM="$ac_ct_NM" # Let the user override the test.
- else
--  echo "$as_me: failed program was:" >&5
--sed 's/^/| /' conftest.$ac_ext >&5
-+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-+for as_dir in $PATH
-+do
-+  IFS=$as_save_IFS
-+  test -z "$as_dir" && as_dir=.
-+  for ac_exec_ext in '' $ac_executable_extensions; do
-+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-+    ac_cv_prog_ac_ct_NM="nm"
-+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-+    break 2
-+  fi
-+done
-+done
--ac_cv_type_long=no
- fi
--rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
- fi
--echo "$as_me:$LINENO: result: $ac_cv_type_long" >&5
--echo "${ECHO_T}$ac_cv_type_long" >&6
--
--echo "$as_me:$LINENO: checking size of long" >&5
--echo $ECHO_N "checking size of long... $ECHO_C" >&6
--if test "${ac_cv_sizeof_long+set}" = set; then
--  echo $ECHO_N "(cached) $ECHO_C" >&6
-+ac_ct_NM=$ac_cv_prog_ac_ct_NM
-+if test -n "$ac_ct_NM"; then
-+  echo "$as_me:$LINENO: result: $ac_ct_NM" >&5
-+echo "${ECHO_T}$ac_ct_NM" >&6
- else
--  if test "$ac_cv_type_long" = yes; then
--  # The cast to unsigned long works around a bug in the HP C Compiler
--  # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
--  # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
--  # This bug is HP SR number 8606223364.
--  if test "$cross_compiling" = yes; then
--  # Depending upon the size, compute the lo and hi bounds.
--cat >conftest.$ac_ext <<_ACEOF
--/* confdefs.h.  */
--_ACEOF
--cat confdefs.h >>conftest.$ac_ext
--cat >>conftest.$ac_ext <<_ACEOF
--/* end confdefs.h.  */
--$ac_includes_default
--int
--main ()
--{
--static int test_array [1 - 2 * !(((long) (sizeof (long))) >= 0)];
--test_array [0] = 0
--
--  ;
--  return 0;
--}
--_ACEOF
--rm -f conftest.$ac_objext
--if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
--  (eval $ac_compile) 2>conftest.er1
--  ac_status=$?
--  grep -v '^ *+' conftest.er1 >conftest.err
--  rm -f conftest.er1
--  cat conftest.err >&5
--  echo "$as_me:$LINENO: \$? = $ac_status" >&5
--  (exit $ac_status); } &&
--       { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
--  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
--  (eval $ac_try) 2>&5
--  ac_status=$?
--  echo "$as_me:$LINENO: \$? = $ac_status" >&5
--  (exit $ac_status); }; } &&
--       { ac_try='test -s conftest.$ac_objext'
--  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
--  (eval $ac_try) 2>&5
--  ac_status=$?
--  echo "$as_me:$LINENO: \$? = $ac_status" >&5
--  (exit $ac_status); }; }; then
--  ac_lo=0 ac_mid=0
--  while :; do
--    cat >conftest.$ac_ext <<_ACEOF
--/* confdefs.h.  */
--_ACEOF
--cat confdefs.h >>conftest.$ac_ext
--cat >>conftest.$ac_ext <<_ACEOF
--/* end confdefs.h.  */
--$ac_includes_default
--int
--main ()
--{
--static int test_array [1 - 2 * !(((long) (sizeof (long))) <= $ac_mid)];
--test_array [0] = 0
-+  echo "$as_me:$LINENO: result: no" >&5
-+echo "${ECHO_T}no" >&6
-+fi
--  ;
--  return 0;
--}
--_ACEOF
--rm -f conftest.$ac_objext
--if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
--  (eval $ac_compile) 2>conftest.er1
--  ac_status=$?
--  grep -v '^ *+' conftest.er1 >conftest.err
--  rm -f conftest.er1
--  cat conftest.err >&5
--  echo "$as_me:$LINENO: \$? = $ac_status" >&5
--  (exit $ac_status); } &&
--       { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
--  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
--  (eval $ac_try) 2>&5
--  ac_status=$?
--  echo "$as_me:$LINENO: \$? = $ac_status" >&5
--  (exit $ac_status); }; } &&
--       { ac_try='test -s conftest.$ac_objext'
--  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
--  (eval $ac_try) 2>&5
--  ac_status=$?
--  echo "$as_me:$LINENO: \$? = $ac_status" >&5
--  (exit $ac_status); }; }; then
--  ac_hi=$ac_mid; break
-+  NM=$ac_ct_NM
- else
--  echo "$as_me: failed program was:" >&5
--sed 's/^/| /' conftest.$ac_ext >&5
-+  NM="$ac_cv_prog_NM"
-+fi
--ac_lo=`expr $ac_mid + 1`
--                  if test $ac_lo -le $ac_mid; then
--                    ac_lo= ac_hi=
--                    break
--                  fi
--                  ac_mid=`expr 2 '*' $ac_mid + 1`
- fi
--rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
--  done
--else
--  echo "$as_me: failed program was:" >&5
--sed 's/^/| /' conftest.$ac_ext >&5
--cat >conftest.$ac_ext <<_ACEOF
--/* confdefs.h.  */
--_ACEOF
--cat confdefs.h >>conftest.$ac_ext
--cat >>conftest.$ac_ext <<_ACEOF
--/* end confdefs.h.  */
--$ac_includes_default
--int
--main ()
--{
--static int test_array [1 - 2 * !(((long) (sizeof (long))) < 0)];
--test_array [0] = 0
--  ;
--  return 0;
--}
--_ACEOF
--rm -f conftest.$ac_objext
--if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
--  (eval $ac_compile) 2>conftest.er1
--  ac_status=$?
--  grep -v '^ *+' conftest.er1 >conftest.err
--  rm -f conftest.er1
--  cat conftest.err >&5
--  echo "$as_me:$LINENO: \$? = $ac_status" >&5
--  (exit $ac_status); } &&
--       { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
--  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
--  (eval $ac_try) 2>&5
--  ac_status=$?
--  echo "$as_me:$LINENO: \$? = $ac_status" >&5
--  (exit $ac_status); }; } &&
--       { ac_try='test -s conftest.$ac_objext'
--  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
--  (eval $ac_try) 2>&5
--  ac_status=$?
--  echo "$as_me:$LINENO: \$? = $ac_status" >&5
--  (exit $ac_status); }; }; then
--  ac_hi=-1 ac_mid=-1
--  while :; do
-+
-+# Test the C compiler for the target environment.
-+tmp_CC="$CC"
-+tmp_CFLAGS="$CFLAGS"
-+tmp_LDFLAGS="$LDFLAGS"
-+tmp_CPPFLAGS="$CPPFLAGS"
-+tmp_LIBS="$LIBS"
-+CC="$TARGET_CC"
-+CFLAGS="$TARGET_CFLAGS"
-+CPPFLAGS="$TARGET_CPPFLAGS"
-+LDFLAGS="$TARGET_LDFLAGS"
-+LIBS=""
-+
-+if test "x$TARGET_CFLAGS" = x; then
-+  # debug flags.
-+  TARGET_CFLAGS="-Wall -W -Wshadow -Wpointer-arith -Wmissing-prototypes \
-+                 -Wundef -Wstrict-prototypes -g"
-+
-+  # optimization flags.
-+  echo "$as_me:$LINENO: checking whether optimization for size works" >&5
-+echo $ECHO_N "checking whether optimization for size works... $ECHO_C" >&6
-+if test "${size_flag+set}" = set; then
-+  echo $ECHO_N "(cached) $ECHO_C" >&6
-+else
-+
-+    CFLAGS=-Os
-     cat >conftest.$ac_ext <<_ACEOF
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
- cat >>conftest.$ac_ext <<_ACEOF
- /* end confdefs.h.  */
--$ac_includes_default
-+
- int
- main ()
- {
--static int test_array [1 - 2 * !(((long) (sizeof (long))) >= $ac_mid)];
--test_array [0] = 0
-   ;
-   return 0;
-@@ -5572,7 +6024,8 @@
-   cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } &&
--       { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
-+       { ac_try='test -z "$ac_c_werror_flag"
-+                       || test ! -s conftest.err'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-@@ -5584,44 +6037,43 @@
-   ac_status=$?
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); }; }; then
--  ac_lo=$ac_mid; break
-+  size_flag=yes
- else
-   echo "$as_me: failed program was:" >&5
- sed 's/^/| /' conftest.$ac_ext >&5
--ac_hi=`expr '(' $ac_mid ')' - 1`
--                     if test $ac_mid -le $ac_hi; then
--                       ac_lo= ac_hi=
--                       break
--                     fi
--                     ac_mid=`expr 2 '*' $ac_mid`
-+size_flag=no
- fi
- rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
--  done
--else
--  echo "$as_me: failed program was:" >&5
--sed 's/^/| /' conftest.$ac_ext >&5
--ac_lo= ac_hi=
- fi
--rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
--fi
--rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
--# Binary search between lo and hi bounds.
--while test "x$ac_lo" != "x$ac_hi"; do
--  ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
--  cat >conftest.$ac_ext <<_ACEOF
-+echo "$as_me:$LINENO: result: $size_flag" >&5
-+echo "${ECHO_T}$size_flag" >&6
-+  if test "x$size_flag" = xyes; then
-+    TARGET_CFLAGS="$TARGET_CFLAGS -Os"
-+  else
-+    TARGET_CFLAGS="$TARGET_CFLAGS -O2 -fno-strength-reduce -fno-unroll-loops"
-+  fi
-+
-+  # Force no alignment to save space on i386.
-+  if test "x$target_cpu" = xi386; then
-+    echo "$as_me:$LINENO: checking whether -falign-loops works" >&5
-+echo $ECHO_N "checking whether -falign-loops works... $ECHO_C" >&6
-+if test "${falign_loop_flag+set}" = set; then
-+  echo $ECHO_N "(cached) $ECHO_C" >&6
-+else
-+
-+      CFLAGS="-falign-loops=1"
-+      cat >conftest.$ac_ext <<_ACEOF
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
- cat >>conftest.$ac_ext <<_ACEOF
- /* end confdefs.h.  */
--$ac_includes_default
-+
- int
- main ()
- {
--static int test_array [1 - 2 * !(((long) (sizeof (long))) <= $ac_mid)];
--test_array [0] = 0
-   ;
-   return 0;
-@@ -5636,7 +6088,8 @@
-   cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } &&
--       { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
-+       { ac_try='test -z "$ac_c_werror_flag"
-+                       || test ! -s conftest.err'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-@@ -5648,136 +6101,182 @@
-   ac_status=$?
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); }; }; then
--  ac_hi=$ac_mid
-+  falign_loop_flag=yes
- else
-   echo "$as_me: failed program was:" >&5
- sed 's/^/| /' conftest.$ac_ext >&5
--ac_lo=`expr '(' $ac_mid ')' + 1`
-+falign_loop_flag=no
- fi
- rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
--done
--case $ac_lo in
--?*) ac_cv_sizeof_long=$ac_lo;;
--'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (long), 77
--See \`config.log' for more details." >&5
--echo "$as_me: error: cannot compute sizeof (long), 77
--See \`config.log' for more details." >&2;}
--   { (exit 1); exit 1; }; } ;;
--esac
--else
--  if test "$cross_compiling" = yes; then
--  { { echo "$as_me:$LINENO: error: internal error: not reached in cross-compile" >&5
--echo "$as_me: error: internal error: not reached in cross-compile" >&2;}
--   { (exit 1); exit 1; }; }
-+
-+fi
-+echo "$as_me:$LINENO: result: $falign_loop_flag" >&5
-+echo "${ECHO_T}$falign_loop_flag" >&6
-+
-+    if test "x$falign_loop_flag" = xyes; then
-+      TARGET_CFLAGS="$TARGET_CFLAGS -falign-jumps=1 -falign-loops=1 -falign-functions=1"
-+    else
-+      TARGET_CFLAGS="$TARGET_CFLAGS -malign-jumps=1 -malign-loops=1 -malign-functions=1"
-+    fi
-+  fi
-+fi
-+
-+if test "x$target_m32" = x1; then
-+  # Force 32-bit mode.
-+  TARGET_CFLAGS="$TARGET_CFLAGS -m32"
-+  TARGET_LDFLAGS="$TARGET_LDFLAGS -m32"
-+fi
-+
-+
-+
-+
-+
-+# Set them to their new values for the tests below.
-+CC="$TARGET_CC"
-+CFLAGS="$TARGET_CFLAGS"
-+CPPFLAGS="$TARGET_CPPFLAGS"
-+LDFLAGS="$TARGET_LDFLAGS"
-+
-+# Defined in aclocal.m4.
-+echo "$as_me:$LINENO: checking whether ${OBJCOPY} works for absolute addresses" >&5
-+echo $ECHO_N "checking whether ${OBJCOPY} works for absolute addresses... $ECHO_C" >&6
-+if test "${grub_cv_prog_objcopy_absolute+set}" = set; then
-+  echo $ECHO_N "(cached) $ECHO_C" >&6
- else
--  cat >conftest.$ac_ext <<_ACEOF
--/* confdefs.h.  */
--_ACEOF
--cat confdefs.h >>conftest.$ac_ext
--cat >>conftest.$ac_ext <<_ACEOF
--/* end confdefs.h.  */
--$ac_includes_default
--long longval () { return (long) (sizeof (long)); }
--unsigned long ulongval () { return (long) (sizeof (long)); }
--#include <stdio.h>
--#include <stdlib.h>
--int
--main ()
-+  cat > conftest.c <<\EOF
-+void
-+cmain (void)
- {
-+   *((int *) 0x1000) = 2;
-+}
-+EOF
--  FILE *f = fopen ("conftest.val", "w");
--  if (! f)
--    exit (1);
--  if (((long) (sizeof (long))) < 0)
--    {
--      long i = longval ();
--      if (i != ((long) (sizeof (long))))
--      exit (1);
--      fprintf (f, "%ld\n", i);
--    }
-+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-+  (eval $ac_compile) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); } && test -s conftest.o; then :
-+else
-+  { { echo "$as_me:$LINENO: error: ${CC-cc} cannot compile C source code" >&5
-+echo "$as_me: error: ${CC-cc} cannot compile C source code" >&2;}
-+   { (exit 1); exit 1; }; }
-+fi
-+grub_cv_prog_objcopy_absolute=yes
-+for link_addr in 2000 8000 7C00; do
-+  if { ac_try='${CC-cc} ${CFLAGS} -nostdlib -Wl,-N -Wl,-Ttext -Wl,$link_addr conftest.o -o conftest.exec'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; }; then :
-   else
--    {
--      unsigned long i = ulongval ();
--      if (i != ((long) (sizeof (long))))
--      exit (1);
--      fprintf (f, "%lu\n", i);
--    }
--  exit (ferror (f) || fclose (f) != 0);
--
--  ;
--  return 0;
--}
--_ACEOF
--rm -f conftest$ac_exeext
--if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
--  (eval $ac_link) 2>&5
-+    { { echo "$as_me:$LINENO: error: ${CC-cc} cannot link at address $link_addr" >&5
-+echo "$as_me: error: ${CC-cc} cannot link at address $link_addr" >&2;}
-+   { (exit 1); exit 1; }; }
-+  fi
-+  if { ac_try='${OBJCOPY-objcopy} -O binary conftest.exec conftest'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-   ac_status=$?
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
--  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-+  (exit $ac_status); }; }; then :
-+  else
-+    { { echo "$as_me:$LINENO: error: ${OBJCOPY-objcopy} cannot create binary files" >&5
-+echo "$as_me: error: ${OBJCOPY-objcopy} cannot create binary files" >&2;}
-+   { (exit 1); exit 1; }; }
-+  fi
-+  if test ! -f conftest.old || { ac_try='cmp -s conftest.old conftest'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); }; }; then
--  ac_cv_sizeof_long=`cat conftest.val`
--else
--  echo "$as_me: program exited with status $ac_status" >&5
--echo "$as_me: failed program was:" >&5
--sed 's/^/| /' conftest.$ac_ext >&5
-+    mv -f conftest conftest.old
-+  else
-+    grub_cv_prog_objcopy_absolute=no
-+    break
-+  fi
-+done
-+rm -f conftest*
-+fi
--( exit $ac_status )
--{ { echo "$as_me:$LINENO: error: cannot compute sizeof (long), 77
--See \`config.log' for more details." >&5
--echo "$as_me: error: cannot compute sizeof (long), 77
--See \`config.log' for more details." >&2;}
-+echo "$as_me:$LINENO: result: $grub_cv_prog_objcopy_absolute" >&5
-+echo "${ECHO_T}$grub_cv_prog_objcopy_absolute" >&6
-+
-+if test "x$grub_cv_prog_objcopy_absolute" = xno; then
-+  { { echo "$as_me:$LINENO: error: GRUB requires a working absolute objcopy; upgrade your binutils" >&5
-+echo "$as_me: error: GRUB requires a working absolute objcopy; upgrade your binutils" >&2;}
-    { (exit 1); exit 1; }; }
- fi
--rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
--fi
-+
-+
-+echo "$as_me:$LINENO: checking if C symbols get an underscore after compilation" >&5
-+echo $ECHO_N "checking if C symbols get an underscore after compilation... $ECHO_C" >&6
-+if test "${grub_cv_asm_uscore+set}" = set; then
-+  echo $ECHO_N "(cached) $ECHO_C" >&6
-+else
-+  cat > conftest.c <<\EOF
-+int
-+func (int *list)
-+{
-+  *list = 0;
-+  return *list;
-+}
-+EOF
-+
-+if { ac_try='${CC-cc} ${CFLAGS} -S conftest.c'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; } && test -s conftest.s; then
-+  true
-+else
-+  { { echo "$as_me:$LINENO: error: ${CC-cc} failed to produce assembly code" >&5
-+echo "$as_me: error: ${CC-cc} failed to produce assembly code" >&2;}
-+   { (exit 1); exit 1; }; }
- fi
--rm -f conftest.val
-+
-+if grep _func conftest.s >/dev/null 2>&1; then
-+  grub_cv_asm_uscore=yes
- else
--  ac_cv_sizeof_long=0
-+  grub_cv_asm_uscore=no
- fi
-+
-+rm -f conftest*
- fi
--echo "$as_me:$LINENO: result: $ac_cv_sizeof_long" >&5
--echo "${ECHO_T}$ac_cv_sizeof_long" >&6
-+
-+
-+if test "x$grub_cv_asm_uscore" = xyes; then
-+
- cat >>confdefs.h <<_ACEOF
--#define SIZEOF_LONG $ac_cv_sizeof_long
-+#define HAVE_ASM_USCORE $grub_cv_asm_uscore
- _ACEOF
-+fi
-+
-+echo "$as_me:$LINENO: result: $grub_cv_asm_uscore" >&5
-+echo "${ECHO_T}$grub_cv_asm_uscore" >&6
-+if test "x$target_cpu" = xi386; then
--# Check LZO when compiling for the i386.
--if test "x$host_cpu" = xi386; then
--  # There are three possibilities. LZO version 2 installed with the name
--  # liblzo2, with the name liblzo, and LZO version 1.
--  echo "$as_me:$LINENO: checking for __lzo_init_v2 in -llzo2" >&5
--echo $ECHO_N "checking for __lzo_init_v2 in -llzo2... $ECHO_C" >&6
--if test "${ac_cv_lib_lzo2___lzo_init_v2+set}" = set; then
--  echo $ECHO_N "(cached) $ECHO_C" >&6
--else
--  ac_check_lib_save_LIBS=$LIBS
--LIBS="-llzo2  $LIBS"
--cat >conftest.$ac_ext <<_ACEOF
-+echo "$as_me:$LINENO: checking if start is defined by the compiler" >&5
-+echo $ECHO_N "checking if start is defined by the compiler... $ECHO_C" >&6
-+if test "${grub_cv_check_start_symbol+set}" = set; then
-+  echo $ECHO_N "(cached) $ECHO_C" >&6
-+else
-+  cat >conftest.$ac_ext <<_ACEOF
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
- cat >>conftest.$ac_ext <<_ACEOF
- /* end confdefs.h.  */
--/* Override any gcc2 internal prototype to avoid an error.  */
--#ifdef __cplusplus
--extern "C"
--#endif
--/* We use char because int might match the return type of a gcc2
--   builtin and then its argument prototype would still apply.  */
--char __lzo_init_v2 ();
- int
- main ()
- {
--__lzo_init_v2 ();
-+asm ("incl start")
-   ;
-   return 0;
- }
-@@ -5791,7 +6290,8 @@
-   cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } &&
--       { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
-+       { ac_try='test -z "$ac_c_werror_flag"
-+                       || test ! -s conftest.err'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-@@ -5803,47 +6303,37 @@
-   ac_status=$?
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); }; }; then
--  ac_cv_lib_lzo2___lzo_init_v2=yes
-+  grub_cv_check_start_symbol=yes
- else
-   echo "$as_me: failed program was:" >&5
- sed 's/^/| /' conftest.$ac_ext >&5
--ac_cv_lib_lzo2___lzo_init_v2=no
-+grub_cv_check_start_symbol=no
- fi
- rm -f conftest.err conftest.$ac_objext \
-       conftest$ac_exeext conftest.$ac_ext
--LIBS=$ac_check_lib_save_LIBS
- fi
--echo "$as_me:$LINENO: result: $ac_cv_lib_lzo2___lzo_init_v2" >&5
--echo "${ECHO_T}$ac_cv_lib_lzo2___lzo_init_v2" >&6
--if test $ac_cv_lib_lzo2___lzo_init_v2 = yes; then
--  LIBLZO="-llzo2"
--else
--  echo "$as_me:$LINENO: checking for __lzo_init_v2 in -llzo" >&5
--echo $ECHO_N "checking for __lzo_init_v2 in -llzo... $ECHO_C" >&6
--if test "${ac_cv_lib_lzo___lzo_init_v2+set}" = set; then
-+
-+
-+echo "$as_me:$LINENO: result: $grub_cv_check_start_symbol" >&5
-+echo "${ECHO_T}$grub_cv_check_start_symbol" >&6
-+
-+echo "$as_me:$LINENO: checking if _start is defined by the compiler" >&5
-+echo $ECHO_N "checking if _start is defined by the compiler... $ECHO_C" >&6
-+if test "${grub_cv_check_uscore_start_symbol+set}" = set; then
-   echo $ECHO_N "(cached) $ECHO_C" >&6
- else
--  ac_check_lib_save_LIBS=$LIBS
--LIBS="-llzo  $LIBS"
--cat >conftest.$ac_ext <<_ACEOF
-+  cat >conftest.$ac_ext <<_ACEOF
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
- cat >>conftest.$ac_ext <<_ACEOF
- /* end confdefs.h.  */
--/* Override any gcc2 internal prototype to avoid an error.  */
--#ifdef __cplusplus
--extern "C"
--#endif
--/* We use char because int might match the return type of a gcc2
--   builtin and then its argument prototype would still apply.  */
--char __lzo_init_v2 ();
- int
- main ()
- {
--__lzo_init_v2 ();
-+asm ("incl _start")
-   ;
-   return 0;
- }
-@@ -5857,7 +6347,8 @@
-   cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } &&
--       { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
-+       { ac_try='test -z "$ac_c_werror_flag"
-+                       || test ! -s conftest.err'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-@@ -5869,47 +6360,57 @@
-   ac_status=$?
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); }; }; then
--  ac_cv_lib_lzo___lzo_init_v2=yes
-+  grub_cv_check_uscore_start_symbol=yes
- else
-   echo "$as_me: failed program was:" >&5
- sed 's/^/| /' conftest.$ac_ext >&5
--ac_cv_lib_lzo___lzo_init_v2=no
-+grub_cv_check_uscore_start_symbol=no
- fi
- rm -f conftest.err conftest.$ac_objext \
-       conftest$ac_exeext conftest.$ac_ext
--LIBS=$ac_check_lib_save_LIBS
- fi
--echo "$as_me:$LINENO: result: $ac_cv_lib_lzo___lzo_init_v2" >&5
--echo "${ECHO_T}$ac_cv_lib_lzo___lzo_init_v2" >&6
--if test $ac_cv_lib_lzo___lzo_init_v2 = yes; then
--  LIBLZO="-llzo"
-+
-+
-+echo "$as_me:$LINENO: result: $grub_cv_check_uscore_start_symbol" >&5
-+echo "${ECHO_T}$grub_cv_check_uscore_start_symbol" >&6
-+
-+
-+
-+
-+if test "x$grub_cv_check_start_symbol" = xyes; then
-+  cat >>confdefs.h <<\_ACEOF
-+#define START_SYMBOL start
-+_ACEOF
-+
-+elif test "x$grub_cv_check_uscore_start_symbol" = xyes; then
-+  cat >>confdefs.h <<\_ACEOF
-+#define START_SYMBOL _start
-+_ACEOF
-+
- else
--  echo "$as_me:$LINENO: checking for __lzo_init2 in -llzo" >&5
--echo $ECHO_N "checking for __lzo_init2 in -llzo... $ECHO_C" >&6
--if test "${ac_cv_lib_lzo___lzo_init2+set}" = set; then
-+  { { echo "$as_me:$LINENO: error: neither start nor _start is defined" >&5
-+echo "$as_me: error: neither start nor _start is defined" >&2;}
-+   { (exit 1); exit 1; }; }
-+fi
-+
-+
-+echo "$as_me:$LINENO: checking if __bss_start is defined by the compiler" >&5
-+echo $ECHO_N "checking if __bss_start is defined by the compiler... $ECHO_C" >&6
-+if test "${grub_cv_check_uscore_uscore_bss_start_symbol+set}" = set; then
-   echo $ECHO_N "(cached) $ECHO_C" >&6
- else
--  ac_check_lib_save_LIBS=$LIBS
--LIBS="-llzo  $LIBS"
--cat >conftest.$ac_ext <<_ACEOF
-+  cat >conftest.$ac_ext <<_ACEOF
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
- cat >>conftest.$ac_ext <<_ACEOF
- /* end confdefs.h.  */
--/* Override any gcc2 internal prototype to avoid an error.  */
--#ifdef __cplusplus
--extern "C"
--#endif
--/* We use char because int might match the return type of a gcc2
--   builtin and then its argument prototype would still apply.  */
--char __lzo_init2 ();
- int
- main ()
- {
--__lzo_init2 ();
-+asm ("incl __bss_start")
-   ;
-   return 0;
- }
-@@ -5923,7 +6424,8 @@
-   cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } &&
--       { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
-+       { ac_try='test -z "$ac_c_werror_flag"
-+                       || test ! -s conftest.err'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-@@ -5935,36 +6437,24 @@
-   ac_status=$?
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); }; }; then
--  ac_cv_lib_lzo___lzo_init2=yes
-+  grub_cv_check_uscore_uscore_bss_start_symbol=yes
- else
-   echo "$as_me: failed program was:" >&5
- sed 's/^/| /' conftest.$ac_ext >&5
--ac_cv_lib_lzo___lzo_init2=no
-+grub_cv_check_uscore_uscore_bss_start_symbol=no
- fi
- rm -f conftest.err conftest.$ac_objext \
-       conftest$ac_exeext conftest.$ac_ext
--LIBS=$ac_check_lib_save_LIBS
--fi
--echo "$as_me:$LINENO: result: $ac_cv_lib_lzo___lzo_init2" >&5
--echo "${ECHO_T}$ac_cv_lib_lzo___lzo_init2" >&6
--if test $ac_cv_lib_lzo___lzo_init2 = yes; then
--  LIBLZO="-llzo"
--else
--  { { echo "$as_me:$LINENO: error: LZO library version 1.02 or later is required" >&5
--echo "$as_me: error: LZO library version 1.02 or later is required" >&2;}
--   { (exit 1); exit 1; }; }
- fi
--fi
--
--fi
-+echo "$as_me:$LINENO: result: $grub_cv_check_uscore_uscore_bss_start_symbol" >&5
-+echo "${ECHO_T}$grub_cv_check_uscore_uscore_bss_start_symbol" >&6
--  LIBS="$LIBS $LIBLZO"
--  echo "$as_me:$LINENO: checking for lzo1x_999_compress" >&5
--echo $ECHO_N "checking for lzo1x_999_compress... $ECHO_C" >&6
--if test "${ac_cv_func_lzo1x_999_compress+set}" = set; then
-+echo "$as_me:$LINENO: checking if edata is defined by the compiler" >&5
-+echo $ECHO_N "checking if edata is defined by the compiler... $ECHO_C" >&6
-+if test "${grub_cv_check_edata_symbol+set}" = set; then
-   echo $ECHO_N "(cached) $ECHO_C" >&6
- else
-   cat >conftest.$ac_ext <<_ACEOF
-@@ -5973,47 +6463,11 @@
- cat confdefs.h >>conftest.$ac_ext
- cat >>conftest.$ac_ext <<_ACEOF
- /* end confdefs.h.  */
--/* Define lzo1x_999_compress to an innocuous variant, in case <limits.h> declares lzo1x_999_compress.
--   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
--#define lzo1x_999_compress innocuous_lzo1x_999_compress
--
--/* System header to define __stub macros and hopefully few prototypes,
--    which can conflict with char lzo1x_999_compress (); below.
--    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
--    <limits.h> exists even on freestanding compilers.  */
--
--#ifdef __STDC__
--# include <limits.h>
--#else
--# include <assert.h>
--#endif
--
--#undef lzo1x_999_compress
--
--/* Override any gcc2 internal prototype to avoid an error.  */
--#ifdef __cplusplus
--extern "C"
--{
--#endif
--/* We use char because int might match the return type of a gcc2
--   builtin and then its argument prototype would still apply.  */
--char lzo1x_999_compress ();
--/* The GNU C library defines this for functions which it implements
--    to always fail with ENOSYS.  Some functions are actually named
--    something starting with __ and the normal name is an alias.  */
--#if defined (__stub_lzo1x_999_compress) || defined (__stub___lzo1x_999_compress)
--choke me
--#else
--char (*f) () = lzo1x_999_compress;
--#endif
--#ifdef __cplusplus
--}
--#endif
- int
- main ()
- {
--return f != lzo1x_999_compress;
-+asm ("incl edata")
-   ;
-   return 0;
- }
-@@ -6027,7 +6481,8 @@
-   cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } &&
--       { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
-+       { ac_try='test -z "$ac_c_werror_flag"
-+                       || test ! -s conftest.err'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-@@ -6039,206 +6494,119 @@
-   ac_status=$?
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); }; }; then
--  ac_cv_func_lzo1x_999_compress=yes
-+  grub_cv_check_edata_symbol=yes
- else
-   echo "$as_me: failed program was:" >&5
- sed 's/^/| /' conftest.$ac_ext >&5
--ac_cv_func_lzo1x_999_compress=no
-+grub_cv_check_edata_symbol=no
- fi
- rm -f conftest.err conftest.$ac_objext \
-       conftest$ac_exeext conftest.$ac_ext
- fi
--echo "$as_me:$LINENO: result: $ac_cv_func_lzo1x_999_compress" >&5
--echo "${ECHO_T}$ac_cv_func_lzo1x_999_compress" >&6
--if test $ac_cv_func_lzo1x_999_compress = yes; then
--  :
--else
--  { { echo "$as_me:$LINENO: error: LZO1X-999 must be enabled" >&5
--echo "$as_me: error: LZO1X-999 must be enabled" >&2;}
--   { (exit 1); exit 1; }; }
--fi
--
--  # LZO version 2 uses lzo/lzo1x.h, while LZO version 1 uses lzo1x.h.
-+echo "$as_me:$LINENO: result: $grub_cv_check_edata_symbol" >&5
-+echo "${ECHO_T}$grub_cv_check_edata_symbol" >&6
--for ac_header in lzo/lzo1x.h lzo1x.h
--do
--as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
--if eval "test \"\${$as_ac_Header+set}\" = set"; then
--  echo "$as_me:$LINENO: checking for $ac_header" >&5
--echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
--if eval "test \"\${$as_ac_Header+set}\" = set"; then
-+echo "$as_me:$LINENO: checking if _edata is defined by the compiler" >&5
-+echo $ECHO_N "checking if _edata is defined by the compiler... $ECHO_C" >&6
-+if test "${grub_cv_check_uscore_edata_symbol+set}" = set; then
-   echo $ECHO_N "(cached) $ECHO_C" >&6
--fi
--echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
--echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
- else
--  # Is the header compilable?
--echo "$as_me:$LINENO: checking $ac_header usability" >&5
--echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
--cat >conftest.$ac_ext <<_ACEOF
-+  cat >conftest.$ac_ext <<_ACEOF
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
- cat >>conftest.$ac_ext <<_ACEOF
- /* end confdefs.h.  */
--$ac_includes_default
--#include <$ac_header>
-+
-+int
-+main ()
-+{
-+asm ("incl _edata")
-+  ;
-+  return 0;
-+}
- _ACEOF
--rm -f conftest.$ac_objext
--if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
--  (eval $ac_compile) 2>conftest.er1
-+rm -f conftest.$ac_objext conftest$ac_exeext
-+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-+  (eval $ac_link) 2>conftest.er1
-   ac_status=$?
-   grep -v '^ *+' conftest.er1 >conftest.err
-   rm -f conftest.er1
-   cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } &&
--       { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
-+       { ac_try='test -z "$ac_c_werror_flag"
-+                       || test ! -s conftest.err'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); }; } &&
--       { ac_try='test -s conftest.$ac_objext'
-+       { ac_try='test -s conftest$ac_exeext'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); }; }; then
--  ac_header_compiler=yes
--else
--  echo "$as_me: failed program was:" >&5
--sed 's/^/| /' conftest.$ac_ext >&5
--
--ac_header_compiler=no
--fi
--rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
--echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
--echo "${ECHO_T}$ac_header_compiler" >&6
--
--# Is the header present?
--echo "$as_me:$LINENO: checking $ac_header presence" >&5
--echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
--cat >conftest.$ac_ext <<_ACEOF
--/* confdefs.h.  */
--_ACEOF
--cat confdefs.h >>conftest.$ac_ext
--cat >>conftest.$ac_ext <<_ACEOF
--/* end confdefs.h.  */
--#include <$ac_header>
--_ACEOF
--if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
--  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
--  ac_status=$?
--  grep -v '^ *+' conftest.er1 >conftest.err
--  rm -f conftest.er1
--  cat conftest.err >&5
--  echo "$as_me:$LINENO: \$? = $ac_status" >&5
--  (exit $ac_status); } >/dev/null; then
--  if test -s conftest.err; then
--    ac_cpp_err=$ac_c_preproc_warn_flag
--    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
--  else
--    ac_cpp_err=
--  fi
--else
--  ac_cpp_err=yes
--fi
--if test -z "$ac_cpp_err"; then
--  ac_header_preproc=yes
-+  grub_cv_check_uscore_edata_symbol=yes
- else
-   echo "$as_me: failed program was:" >&5
- sed 's/^/| /' conftest.$ac_ext >&5
--  ac_header_preproc=no
-+grub_cv_check_uscore_edata_symbol=no
- fi
--rm -f conftest.err conftest.$ac_ext
--echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
--echo "${ECHO_T}$ac_header_preproc" >&6
--
--# So?  What about this header?
--case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
--  yes:no: )
--    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
--echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
--    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
--echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
--    ac_header_preproc=yes
--    ;;
--  no:yes:* )
--    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
--echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
--    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
--echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
--    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
--echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
--    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
--echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
--    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
--echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
--    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
--echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
--    (
--      cat <<\_ASBOX
--## ------------------------------- ##
--## Report this to bug-grub@gnu.org ##
--## ------------------------------- ##
--_ASBOX
--    ) |
--      sed "s/^/$as_me: WARNING:     /" >&2
--    ;;
--esac
--echo "$as_me:$LINENO: checking for $ac_header" >&5
--echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
--if eval "test \"\${$as_ac_Header+set}\" = set"; then
--  echo $ECHO_N "(cached) $ECHO_C" >&6
--else
--  eval "$as_ac_Header=\$ac_header_preproc"
-+rm -f conftest.err conftest.$ac_objext \
-+      conftest$ac_exeext conftest.$ac_ext
- fi
--echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
--echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
--fi
--if test `eval echo '${'$as_ac_Header'}'` = yes; then
--  cat >>confdefs.h <<_ACEOF
--#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-+
-+echo "$as_me:$LINENO: result: $grub_cv_check_uscore_edata_symbol" >&5
-+echo "${ECHO_T}$grub_cv_check_uscore_edata_symbol" >&6
-+
-+
-+
-+
-+if test "x$grub_cv_check_uscore_uscore_bss_start_symbol" = xyes; then
-+  cat >>confdefs.h <<\_ACEOF
-+#define BSS_START_SYMBOL __bss_start
- _ACEOF
--fi
-+elif test "x$grub_cv_check_edata_symbol" = xyes; then
-+  cat >>confdefs.h <<\_ACEOF
-+#define BSS_START_SYMBOL edata
-+_ACEOF
--done
-+elif test "x$grub_cv_check_uscore_edata_symbol" = xyes; then
-+  cat >>confdefs.h <<\_ACEOF
-+#define BSS_START_SYMBOL _edata
-+_ACEOF
-+else
-+  { { echo "$as_me:$LINENO: error: none of __bss_start, edata or _edata is defined" >&5
-+echo "$as_me: error: none of __bss_start, edata or _edata is defined" >&2;}
-+   { (exit 1); exit 1; }; }
- fi
--# Check for curses.
--echo "$as_me:$LINENO: checking for wgetch in -lncurses" >&5
--echo $ECHO_N "checking for wgetch in -lncurses... $ECHO_C" >&6
--if test "${ac_cv_lib_ncurses_wgetch+set}" = set; then
-+
-+echo "$as_me:$LINENO: checking if end is defined by the compiler" >&5
-+echo $ECHO_N "checking if end is defined by the compiler... $ECHO_C" >&6
-+if test "${grub_cv_check_end_symbol+set}" = set; then
-   echo $ECHO_N "(cached) $ECHO_C" >&6
- else
--  ac_check_lib_save_LIBS=$LIBS
--LIBS="-lncurses  $LIBS"
--cat >conftest.$ac_ext <<_ACEOF
-+  cat >conftest.$ac_ext <<_ACEOF
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
- cat >>conftest.$ac_ext <<_ACEOF
- /* end confdefs.h.  */
--/* Override any gcc2 internal prototype to avoid an error.  */
--#ifdef __cplusplus
--extern "C"
--#endif
--/* We use char because int might match the return type of a gcc2
--   builtin and then its argument prototype would still apply.  */
--char wgetch ();
- int
- main ()
- {
--wgetch ();
-+asm ("incl end")
-   ;
-   return 0;
- }
-@@ -6252,7 +6620,8 @@
-   cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } &&
--       { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
-+       { ac_try='test -z "$ac_c_werror_flag"
-+                       || test ! -s conftest.err'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-@@ -6264,47 +6633,37 @@
-   ac_status=$?
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); }; }; then
--  ac_cv_lib_ncurses_wgetch=yes
-+  grub_cv_check_end_symbol=yes
- else
-   echo "$as_me: failed program was:" >&5
- sed 's/^/| /' conftest.$ac_ext >&5
--ac_cv_lib_ncurses_wgetch=no
-+grub_cv_check_end_symbol=no
- fi
- rm -f conftest.err conftest.$ac_objext \
-       conftest$ac_exeext conftest.$ac_ext
--LIBS=$ac_check_lib_save_LIBS
- fi
--echo "$as_me:$LINENO: result: $ac_cv_lib_ncurses_wgetch" >&5
--echo "${ECHO_T}$ac_cv_lib_ncurses_wgetch" >&6
--if test $ac_cv_lib_ncurses_wgetch = yes; then
--  LIBCURSES="-lncurses"
--else
--  echo "$as_me:$LINENO: checking for wgetch in -lcurses" >&5
--echo $ECHO_N "checking for wgetch in -lcurses... $ECHO_C" >&6
--if test "${ac_cv_lib_curses_wgetch+set}" = set; then
-+
-+
-+echo "$as_me:$LINENO: result: $grub_cv_check_end_symbol" >&5
-+echo "${ECHO_T}$grub_cv_check_end_symbol" >&6
-+
-+echo "$as_me:$LINENO: checking if _end is defined by the compiler" >&5
-+echo $ECHO_N "checking if _end is defined by the compiler... $ECHO_C" >&6
-+if test "${grub_cv_check_uscore_end_symbol+set}" = set; then
-   echo $ECHO_N "(cached) $ECHO_C" >&6
- else
--  ac_check_lib_save_LIBS=$LIBS
--LIBS="-lcurses  $LIBS"
--cat >conftest.$ac_ext <<_ACEOF
-+  cat >conftest.$ac_ext <<_ACEOF
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
- cat >>conftest.$ac_ext <<_ACEOF
- /* end confdefs.h.  */
--/* Override any gcc2 internal prototype to avoid an error.  */
--#ifdef __cplusplus
--extern "C"
--#endif
--/* We use char because int might match the return type of a gcc2
--   builtin and then its argument prototype would still apply.  */
--char wgetch ();
- int
- main ()
- {
--wgetch ();
-+asm ("incl _end")
-   ;
-   return 0;
- }
-@@ -6318,7 +6677,8 @@
-   cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } &&
--       { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
-+       { ac_try='test -z "$ac_c_werror_flag"
-+                       || test ! -s conftest.err'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-@@ -6329,189 +6689,279 @@
-   (eval $ac_try) 2>&5
-   ac_status=$?
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
--  (exit $ac_status); }; }; then
--  ac_cv_lib_curses_wgetch=yes
-+  (exit $ac_status); }; }; then
-+  grub_cv_check_uscore_end_symbol=yes
-+else
-+  echo "$as_me: failed program was:" >&5
-+sed 's/^/| /' conftest.$ac_ext >&5
-+
-+grub_cv_check_uscore_end_symbol=no
-+fi
-+rm -f conftest.err conftest.$ac_objext \
-+      conftest$ac_exeext conftest.$ac_ext
-+fi
-+
-+
-+echo "$as_me:$LINENO: result: $grub_cv_check_uscore_end_symbol" >&5
-+echo "${ECHO_T}$grub_cv_check_uscore_end_symbol" >&6
-+
-+
-+
-+
-+if test "x$grub_cv_check_end_symbol" = xyes; then
-+  cat >>confdefs.h <<\_ACEOF
-+#define END_SYMBOL end
-+_ACEOF
-+
-+elif test "x$grub_cv_check_uscore_end_symbol" = xyes; then
-+  cat >>confdefs.h <<\_ACEOF
-+#define END_SYMBOL _end
-+_ACEOF
-+
-+else
-+  { { echo "$as_me:$LINENO: error: neither end nor _end is defined" >&5
-+echo "$as_me: error: neither end nor _end is defined" >&2;}
-+   { (exit 1); exit 1; }; }
-+fi
-+
-+
-+echo "$as_me:$LINENO: checking whether addr32 must be in the same line as the instruction" >&5
-+echo $ECHO_N "checking whether addr32 must be in the same line as the instruction... $ECHO_C" >&6
-+if test "${grub_cv_i386_asm_prefix_requirement+set}" = set; then
-+  echo $ECHO_N "(cached) $ECHO_C" >&6
-+else
-+  cat > conftest.s <<\EOF
-+      .code16
-+l1:   addr32  movb    %al, l1
-+EOF
-+
-+if { ac_try='${CC-cc} ${CFLAGS} -c conftest.s'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; } && test -s conftest.o; then
-+  grub_cv_i386_asm_prefix_requirement=yes
-+else
-+  grub_cv_i386_asm_prefix_requirement=no
-+fi
-+
-+rm -f conftest*
-+fi
-+
-+
-+if test "x$grub_cv_i386_asm_prefix_requirement" = xyes; then
-+  grub_tmp_addr32="addr32"
-+  grub_tmp_data32="data32"
-+else
-+  grub_tmp_addr32="addr32;"
-+  grub_tmp_data32="data32;"
-+fi
-+
-+
-+cat >>confdefs.h <<_ACEOF
-+#define ADDR32 $grub_tmp_addr32
-+_ACEOF
-+
-+
-+cat >>confdefs.h <<_ACEOF
-+#define DATA32 $grub_tmp_data32
-+_ACEOF
-+
-+
-+echo "$as_me:$LINENO: result: $grub_cv_i386_asm_prefix_requirement" >&5
-+echo "${ECHO_T}$grub_cv_i386_asm_prefix_requirement" >&6
-+
-+
-+echo "$as_me:$LINENO: checking for .code16 addr32 assembler support" >&5
-+echo $ECHO_N "checking for .code16 addr32 assembler support... $ECHO_C" >&6
-+if test "${grub_cv_i386_asm_addr32+set}" = set; then
-+  echo $ECHO_N "(cached) $ECHO_C" >&6
-+else
-+  cat > conftest.s.in <<\EOF
-+      .code16
-+l1:   @ADDR32@        movb    %al, l1
-+EOF
-+
-+if test "x$grub_cv_i386_asm_prefix_requirement" = xyes; then
-+  sed -e s/@ADDR32@/addr32/ < conftest.s.in > conftest.s
-+else
-+  sed -e s/@ADDR32@/addr32\;/ < conftest.s.in > conftest.s
-+fi
-+
-+if { ac_try='${CC-cc} ${CFLAGS} -c conftest.s'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; } && test -s conftest.o; then
-+  grub_cv_i386_asm_addr32=yes
-+else
-+  grub_cv_i386_asm_addr32=no
-+fi
-+
-+rm -f conftest*
-+fi
-+
-+
-+echo "$as_me:$LINENO: result: $grub_cv_i386_asm_addr32" >&5
-+echo "${ECHO_T}$grub_cv_i386_asm_addr32" >&6
-+
-+echo "$as_me:$LINENO: checking whether an absolute indirect call/jump must not be prefixed with an asterisk" >&5
-+echo $ECHO_N "checking whether an absolute indirect call/jump must not be prefixed with an asterisk... $ECHO_C" >&6
-+if test "${grub_cv_i386_asm_absolute_without_asterisk+set}" = set; then
-+  echo $ECHO_N "(cached) $ECHO_C" >&6
-+else
-+  cat > conftest.s <<\EOF
-+      lcall   *(offset)
-+offset:
-+      .long   0
-+      .word   0
-+EOF
-+
-+if { ac_try='${CC-cc} ${CFLAGS} -c conftest.s'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; } && test -s conftest.o; then
-+  grub_cv_i386_asm_absolute_without_asterisk=no
- else
--  echo "$as_me: failed program was:" >&5
--sed 's/^/| /' conftest.$ac_ext >&5
--
--ac_cv_lib_curses_wgetch=no
--fi
--rm -f conftest.err conftest.$ac_objext \
--      conftest$ac_exeext conftest.$ac_ext
--LIBS=$ac_check_lib_save_LIBS
--fi
--echo "$as_me:$LINENO: result: $ac_cv_lib_curses_wgetch" >&5
--echo "${ECHO_T}$ac_cv_lib_curses_wgetch" >&6
--if test $ac_cv_lib_curses_wgetch = yes; then
--  LIBCURSES="-lcurses"
-+  grub_cv_i386_asm_absolute_without_asterisk=yes
- fi
-+rm -f conftest*
- fi
-+if test "x$grub_cv_i386_asm_absolute_without_asterisk" = xyes; then
--# Check for headers.
-+cat >>confdefs.h <<\_ACEOF
-+#define ABSOLUTE_WITHOUT_ASTERISK 1
-+_ACEOF
-+fi
-+echo "$as_me:$LINENO: result: $grub_cv_i386_asm_absolute_without_asterisk" >&5
-+echo "${ECHO_T}$grub_cv_i386_asm_absolute_without_asterisk" >&6
--for ac_header in ncurses/curses.h ncurses.h curses.h
--do
--as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
--if eval "test \"\${$as_ac_Header+set}\" = set"; then
--  echo "$as_me:$LINENO: checking for $ac_header" >&5
--echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
--if eval "test \"\${$as_ac_Header+set}\" = set"; then
-+echo "$as_me:$LINENO: checking if GCC has the regparm=3 bug" >&5
-+echo $ECHO_N "checking if GCC has the regparm=3 bug... $ECHO_C" >&6
-+if test "${grub_cv_i386_check_nested_functions+set}" = set; then
-   echo $ECHO_N "(cached) $ECHO_C" >&6
--fi
--echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
--echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
- else
--  # Is the header compilable?
--echo "$as_me:$LINENO: checking $ac_header usability" >&5
--echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
--cat >conftest.$ac_ext <<_ACEOF
-+  if test "$cross_compiling" = yes; then
-+  { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
-+See \`config.log' for more details." >&5
-+echo "$as_me: error: cannot run test program while cross compiling
-+See \`config.log' for more details." >&2;}
-+   { (exit 1); exit 1; }; }
-+else
-+  cat >conftest.$ac_ext <<_ACEOF
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
- cat >>conftest.$ac_ext <<_ACEOF
- /* end confdefs.h.  */
--$ac_includes_default
--#include <$ac_header>
-+
-+static int
-+test (int *n)
-+{
-+  return *n == -1;
-+}
-+
-+static int
-+testfunc (int __attribute__ ((__regparm__ (3))) (*hook) (int a, int b, int *c))
-+{
-+  int a = 0;
-+  int b = 0;
-+  int c = -1;
-+  return hook (a, b, &c);
-+}
-+
-+int
-+main (void)
-+{
-+  int __attribute__ ((__regparm__ (3))) nestedfunc (int a, int b, int *c)
-+    {
-+      return a == b && test (c);
-+    }
-+  return testfunc (nestedfunc) ? 0 : 1;
-+}
-+
- _ACEOF
--rm -f conftest.$ac_objext
--if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
--  (eval $ac_compile) 2>conftest.er1
--  ac_status=$?
--  grep -v '^ *+' conftest.er1 >conftest.err
--  rm -f conftest.er1
--  cat conftest.err >&5
--  echo "$as_me:$LINENO: \$? = $ac_status" >&5
--  (exit $ac_status); } &&
--       { ac_try='test -z "$ac_c_werror_flag"                   || test ! -s conftest.err'
--  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
--  (eval $ac_try) 2>&5
-+rm -f conftest$ac_exeext
-+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-+  (eval $ac_link) 2>&5
-   ac_status=$?
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
--  (exit $ac_status); }; } &&
--       { ac_try='test -s conftest.$ac_objext'
-+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); }; }; then
--  ac_header_compiler=yes
-+  grub_cv_i386_check_nested_functions=no
- else
--  echo "$as_me: failed program was:" >&5
-+  echo "$as_me: program exited with status $ac_status" >&5
-+echo "$as_me: failed program was:" >&5
- sed 's/^/| /' conftest.$ac_ext >&5
--ac_header_compiler=no
-+( exit $ac_status )
-+grub_cv_i386_check_nested_functions=yes
-+fi
-+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-+fi
- fi
--rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
--echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
--echo "${ECHO_T}$ac_header_compiler" >&6
--# Is the header present?
--echo "$as_me:$LINENO: checking $ac_header presence" >&5
--echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
--cat >conftest.$ac_ext <<_ACEOF
--/* confdefs.h.  */
--_ACEOF
--cat confdefs.h >>conftest.$ac_ext
--cat >>conftest.$ac_ext <<_ACEOF
--/* end confdefs.h.  */
--#include <$ac_header>
-+
-+echo "$as_me:$LINENO: result: $grub_cv_i386_check_nested_functions" >&5
-+echo "${ECHO_T}$grub_cv_i386_check_nested_functions" >&6
-+
-+if test "x$grub_cv_i386_check_nested_functions" = xyes; then
-+
-+cat >>confdefs.h <<\_ACEOF
-+#define NESTED_FUNC_ATTR __attribute__ ((__regparm__ (2)))
- _ACEOF
--if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
--  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
--  ac_status=$?
--  grep -v '^ *+' conftest.er1 >conftest.err
--  rm -f conftest.er1
--  cat conftest.err >&5
--  echo "$as_me:$LINENO: \$? = $ac_status" >&5
--  (exit $ac_status); } >/dev/null; then
--  if test -s conftest.err; then
--    ac_cpp_err=$ac_c_preproc_warn_flag
--    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
--  else
--    ac_cpp_err=
--  fi
--else
--  ac_cpp_err=yes
--fi
--if test -z "$ac_cpp_err"; then
--  ac_header_preproc=yes
-+
- else
--  echo "$as_me: failed program was:" >&5
--sed 's/^/| /' conftest.$ac_ext >&5
--  ac_header_preproc=no
-+cat >>confdefs.h <<\_ACEOF
-+#define NESTED_FUNC_ATTR __attribute__ ((__regparm__ (2)))
-+_ACEOF
-+
- fi
--rm -f conftest.err conftest.$ac_ext
--echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
--echo "${ECHO_T}$ac_header_preproc" >&6
--# So?  What about this header?
--case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
--  yes:no: )
--    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
--echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
--    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
--echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
--    ac_header_preproc=yes
--    ;;
--  no:yes:* )
--    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
--echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
--    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
--echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
--    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
--echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
--    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
--echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
--    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
--echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
--    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
--echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
--    (
--      cat <<\_ASBOX
--## ------------------------------- ##
--## Report this to bug-grub@gnu.org ##
--## ------------------------------- ##
--_ASBOX
--    ) |
--      sed "s/^/$as_me: WARNING:     /" >&2
--    ;;
--esac
--echo "$as_me:$LINENO: checking for $ac_header" >&5
--echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
--if eval "test \"\${$as_ac_Header+set}\" = set"; then
--  echo $ECHO_N "(cached) $ECHO_C" >&6
- else
--  eval "$as_ac_Header=\$ac_header_preproc"
--fi
--echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
--echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
--fi
--if test `eval echo '${'$as_ac_Header'}'` = yes; then
--  cat >>confdefs.h <<_ACEOF
--#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-+cat >>confdefs.h <<\_ACEOF
-+#define NESTED_FUNC_ATTR
- _ACEOF
- fi
--done
--
--
-+# Restore the flags.
- CC="$tmp_CC"
- CFLAGS="$tmp_CFLAGS"
- CPPFLAGS="$tmp_CPPFLAGS"
-+LDFLAGS="$tmp_LDFLAGS"
-+LIBS="$tmp_LIBS"
-+
-+# Check for options.
-+# Check whether --enable-mm-debug or --disable-mm-debug was given.
-+if test "${enable_mm_debug+set}" = set; then
-+  enableval="$enable_mm_debug"
-+
-+cat >>confdefs.h <<\_ACEOF
-+#define MM_DEBUG 1
-+_ACEOF
-+
-+fi;
- # Output files.
--                    ac_config_links="$ac_config_links include/grub/cpu:include/grub/$host_cpu include/grub/machine:include/grub/$host_cpu/$host_vendor"
-+                    ac_config_links="$ac_config_links include/grub/cpu:include/grub/$target_cpu include/grub/machine:include/grub/$target_cpu/$platform"
--          ac_config_files="$ac_config_files Makefile"
-+                              ac_config_files="$ac_config_files Makefile gensymlist.sh genkernsyms.sh"
-           ac_config_files="$ac_config_files stamp-h"
-@@ -6877,7 +7327,7 @@
- } >&5
- cat >&5 <<_CSEOF
--This file was extended by GRUB $as_me 1.93, which was
-+This file was extended by GRUB $as_me 1.94, which was
- generated by GNU Autoconf 2.59.  Invocation command line was
-   CONFIG_FILES    = $CONFIG_FILES
-@@ -6940,7 +7390,7 @@
- cat >>$CONFIG_STATUS <<_ACEOF
- ac_cs_version="\\
--GRUB config.status 1.93
-+GRUB config.status 1.94
- configured by $0, generated by GNU Autoconf 2.59,
-   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
-@@ -7044,9 +7494,11 @@
-   case "$ac_config_target" in
-   # Handling of arguments.
-   "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
-+  "gensymlist.sh" ) CONFIG_FILES="$CONFIG_FILES gensymlist.sh" ;;
-+  "genkernsyms.sh" ) CONFIG_FILES="$CONFIG_FILES genkernsyms.sh" ;;
-   "stamp-h" ) CONFIG_FILES="$CONFIG_FILES stamp-h" ;;
--  "include/grub/cpu" ) CONFIG_LINKS="$CONFIG_LINKS include/grub/cpu:include/grub/$host_cpu" ;;
--  "include/grub/machine" ) CONFIG_LINKS="$CONFIG_LINKS include/grub/machine:include/grub/$host_cpu/$host_vendor" ;;
-+  "include/grub/cpu" ) CONFIG_LINKS="$CONFIG_LINKS include/grub/cpu:include/grub/$target_cpu" ;;
-+  "include/grub/machine" ) CONFIG_LINKS="$CONFIG_LINKS include/grub/machine:include/grub/$target_cpu/$platform" ;;
-   "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
-   *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
- echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
-@@ -7141,6 +7593,19 @@
- s,@host_cpu@,$host_cpu,;t t
- s,@host_vendor@,$host_vendor,;t t
- s,@host_os@,$host_os,;t t
-+s,@target@,$target,;t t
-+s,@target_cpu@,$target_cpu,;t t
-+s,@target_vendor@,$target_vendor,;t t
-+s,@target_os@,$target_os,;t t
-+s,@platform@,$platform,;t t
-+s,@CMP@,$CMP,;t t
-+s,@YACC@,$YACC,;t t
-+s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
-+s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
-+s,@INSTALL_DATA@,$INSTALL_DATA,;t t
-+s,@AWK@,$AWK,;t t
-+s,@SET_MAKE@,$SET_MAKE,;t t
-+s,@RUBY@,$RUBY,;t t
- s,@CC@,$CC,;t t
- s,@CFLAGS@,$CFLAGS,;t t
- s,@LDFLAGS@,$LDFLAGS,;t t
-@@ -7148,25 +7613,21 @@
- s,@ac_ct_CC@,$ac_ct_CC,;t t
- s,@EXEEXT@,$EXEEXT,;t t
- s,@OBJEXT@,$OBJEXT,;t t
--s,@YACC@,$YACC,;t t
--s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
--s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
--s,@INSTALL_DATA@,$INSTALL_DATA,;t t
--s,@SET_MAKE@,$SET_MAKE,;t t
-+s,@CPP@,$CPP,;t t
-+s,@EGREP@,$EGREP,;t t
-+s,@LIBLZO@,$LIBLZO,;t t
-+s,@LIBCURSES@,$LIBCURSES,;t t
-+s,@TARGET_CC@,$TARGET_CC,;t t
-+s,@ac_ct_TARGET_CC@,$ac_ct_TARGET_CC,;t t
- s,@OBJCOPY@,$OBJCOPY,;t t
- s,@ac_ct_OBJCOPY@,$ac_ct_OBJCOPY,;t t
- s,@STRIP@,$STRIP,;t t
- s,@ac_ct_STRIP@,$ac_ct_STRIP,;t t
- s,@NM@,$NM,;t t
- s,@ac_ct_NM@,$ac_ct_NM,;t t
--s,@LD@,$LD,;t t
--s,@ac_ct_LD@,$ac_ct_LD,;t t
--s,@RUBY@,$RUBY,;t t
--s,@BUILD_CC@,$BUILD_CC,;t t
--s,@CPP@,$CPP,;t t
--s,@EGREP@,$EGREP,;t t
--s,@LIBLZO@,$LIBLZO,;t t
--s,@LIBCURSES@,$LIBCURSES,;t t
-+s,@TARGET_CFLAGS@,$TARGET_CFLAGS,;t t
-+s,@TARGET_CPPFLAGS@,$TARGET_CPPFLAGS,;t t
-+s,@TARGET_LDFLAGS@,$TARGET_LDFLAGS,;t t
- s,@LIBOBJS@,$LIBOBJS,;t t
- s,@LTLIBOBJS@,$LTLIBOBJS,;t t
- CEOF
-@@ -7335,6 +7796,11 @@
-   *) ac_INSTALL=$ac_top_builddir$INSTALL ;;
-   esac
-+  if test x"$ac_file" != x-; then
-+    { echo "$as_me:$LINENO: creating $ac_file" >&5
-+echo "$as_me: creating $ac_file" >&6;}
-+    rm -f "$ac_file"
-+  fi
-   # Let's still pretend it is `configure' which instantiates (i.e., don't
-   # use $as_me), people would be surprised to read:
-   #    /* config.h.  Generated by config.status.  */
-@@ -7373,12 +7839,6 @@
-        fi;;
-       esac
-     done` || { (exit 1); exit 1; }
--
--  if test x"$ac_file" != x-; then
--    { echo "$as_me:$LINENO: creating $ac_file" >&5
--echo "$as_me: creating $ac_file" >&6;}
--    rm -f "$ac_file"
--  fi
- _ACEOF
- cat >>$CONFIG_STATUS <<_ACEOF
-   sed "$ac_vpsub
-Index: configure.ac
-===================================================================
-RCS file: /cvsroot/grub/grub2/configure.ac,v
-retrieving revision 1.21
-retrieving revision 1.31
-diff -u -r1.21 -r1.31
---- configure.ac       10 Mar 2006 22:27:24 -0000      1.21
-+++ configure.ac       4 Jun 2006 12:59:19 -0000       1.31
-@@ -1,6 +1,6 @@
- # Process this file with autoconf to produce a configure script.
--# Copyright (C) 2002,2003,2004,2005  Free Software Foundation, Inc.
-+# Copyright (C) 2002,2003,2004,2005,2006  Free Software Foundation, Inc.
- #
- # This configure.ac is free software; the author
- # gives unlimited permission to copy and/or distribute it,
-@@ -11,55 +11,191 @@
- # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- # PARTICULAR PURPOSE.
--AC_INIT(GRUB, 1.93, [bug-grub@gnu.org])
-+dnl This configure script is complicated, because GRUB needs to deal
-+dnl with three potentially different types:
-+dnl
-+dnl   build  -- the environment for building GRUB
-+dnl   host   -- the environment for running utilities
-+dnl   target -- the environment for running GRUB
-+dnl
-+dnl In addition, GRUB needs to deal with a platform specification
-+dnl which specifies the system running GRUB, such as firmware.
-+dnl This is necessary because the target type in autoconf does not
-+dnl describe such a system very well.
-+dnl
-+dnl The current strategy is to use variables with no prefix (such as
-+dnl CC, CFLAGS, etc.) for the host type as well as the build type,
-+dnl because GRUB does not need to use those variables for the build
-+dnl type, so there is no conflict. Variables with the prefix "TARGET_"
-+dnl (such as TARGET_CC, TARGET_CFLAGS, etc.) are used for the target
-+dnl type.
-+
-+
-+AC_INIT(GRUB, 1.94, [bug-grub@gnu.org])
- AC_PREREQ(2.53)
- AC_CONFIG_SRCDIR([include/grub/dl.h])
- AC_CONFIG_HEADER([config.h])
--# Checks for build and host systems.
--AC_CANONICAL_BUILD
-+# Checks for host and target systems.
- AC_CANONICAL_HOST
-+AC_CANONICAL_TARGET
- case "$host_cpu" in
--  i[[3456]]86) host_cpu=i386 ;;
--  x86_64) host_cpu=i386 biarch32=1 ;;
-+  powerpc64) host_m32=1 ;;
-+esac
-+
-+case "$target_cpu" in
-+  i[[3456]]86) target_cpu=i386 ;;
-+  x86_64) target_cpu=i386 target_m32=1 ;;
-   powerpc) ;;
--  powerpc64) host_cpu=powerpc biarch32=1;;
-+  powerpc64) target_cpu=powerpc target_m32=1;;
-   sparc64) ;;
-   *) AC_MSG_ERROR([unsupported CPU type]) ;;
- esac
--case "$host_cpu"-"$host_vendor" in
--  i386-*) host_vendor=pc ;;
--  powerpc-*) host_vendor=ieee1275 ;;
--  sparc64-*) host_vendor=ieee1275 ;;
-+# Specify the platform (such as firmware).
-+AC_ARG_WITH([platform],
-+            AS_HELP_STRING([--with-platform=PLATFORM],
-+                           [select the host platform [[guessed]]]))
-+
-+# Guess the platform if not specified.
-+if test "x$with_platform" = x; then
-+  case "$target_cpu"-"$target_vendor" in
-+    i386-apple) platform=efi ;;
-+    i386-*) platform=pc ;;
-+    powerpc-*) platform=ieee1275 ;;
-+    sparc64-*) platform=ieee1275 ;;
-+    *) AC_MSG_ERROR([unsupported machine type]) ;;
-+  esac
-+else
-+  platform="$with_platform"
-+fi
-+
-+# Sanity check.
-+case "$target_cpu"-"$platform" in
-+  i386-efi) ;;
-+  i386-pc) ;;
-+  powerpc-ieee1275) ;;
-+  sparc64-ieee1275) ;;
-   *) AC_MSG_ERROR([unsupported machine type]) ;;
- esac
--AC_SUBST(host_cpu)
--AC_SUBST(host_vendor)
-+AC_SUBST(target_cpu)
-+AC_SUBST(platform)
--# Checks for programs.
--if test "x$CFLAGS" = x; then
--  default_CFLAGS=yes
--fi
-+#
-+# Checks for build programs.
-+#
--AC_PROG_CC
-+# Although cmp is listed in the GNU Coding Standards as a command which
-+# can used directly, OpenBSD lacks cmp in the default installation.
-+AC_CHECK_PROGS([CMP], [cmp])
-+if test "x$CMP" = x; then
-+  AC_MSG_ERROR([cmp is not found])
-+fi
- AC_CHECK_PROGS([YACC], [bison])
- if test "x$YACC" = x; then
--  AC_MSG_ERROR([Could not find bison.])
-+  AC_MSG_ERROR([bison is not found])
- fi
--AC_SYS_LARGEFILE
-+AC_PROG_INSTALL
-+AC_PROG_AWK
-+AC_PROG_MAKE_SET
-+# This is not a "must".
-+AC_PATH_PROG(RUBY, ruby)
-+
-+#
-+# Checks for host programs.
-+#
-+
-+AC_PROG_CC
- # Must be GCC.
- test "x$GCC" = xyes || AC_MSG_ERROR([GCC is required])
--if test "x$default_CFLAGS" = xyes; then
-+AC_SYS_LARGEFILE
-+
-+# Identify characteristics of the host architecture.
-+AC_C_BIGENDIAN
-+AC_CHECK_SIZEOF(void *)
-+AC_CHECK_SIZEOF(long)
-+
-+if test "x$host_m32" = x1; then
-+  # Force 32-bit mode.
-+  CFLAGS="$CFLAGS -m32"
-+  LDFLAGS="$LDFLAGS -m32"
-+fi
-+
-+# Check LZO when compiling for the i386-pc.
-+if test "$target_cpu"-"$platform" = i386-pc; then
-+  # There are three possibilities. LZO version 2 installed with the name
-+  # liblzo2, with the name liblzo, and LZO version 1.
-+  AC_CHECK_LIB(lzo2, __lzo_init_v2, [LIBLZO="-llzo2"],
-+    AC_CHECK_LIB(lzo, __lzo_init_v2, [LIBLZO="-llzo"],
-+      AC_CHECK_LIB(lzo, __lzo_init2, [LIBLZO="-llzo"],
-+             AC_MSG_ERROR([LZO library version 1.02 or later is required]))))
-+  AC_SUBST(LIBLZO)
-+  LIBS="$LIBS $LIBLZO"
-+  AC_CHECK_FUNC(lzo1x_999_compress, , 
-+              [AC_MSG_ERROR([LZO1X-999 must be enabled])])
-+
-+  # LZO version 2 uses lzo/lzo1x.h, while LZO version 1 uses lzo1x.h.
-+  AC_CHECK_HEADERS(lzo/lzo1x.h lzo1x.h)
-+fi
-+
-+# Check for curses.
-+AC_CHECK_LIB(ncurses, wgetch, [LIBCURSES="-lncurses"],
-+  [AC_CHECK_LIB(curses, wgetch, [LIBCURSES="-lcurses"])])
-+AC_SUBST(LIBCURSES)
-+
-+# Check for headers.
-+AC_CHECK_HEADERS(ncurses/curses.h ncurses.h curses.h)
-+
-+#
-+# Check for target programs.
-+#
-+
-+# For cross-compiling.
-+if test "x$target" != "x$host"; then
-+  # XXX this depends on the implementation of autoconf!
-+  tmp_ac_tool_prefix="$ac_tool_prefix"
-+  ac_tool_prefix=$target_alias-
-+
-+  AC_CHECK_TOOLS(TARGET_CC, [gcc egcs cc],
-+                 [AC_MSG_ERROR([none of gcc, egcs and cc is found. set TARGET_CC manually.])])
-+  AC_CHECK_TOOL(OBJCOPY, objcopy)
-+  AC_CHECK_TOOL(STRIP, strip)
-+  AC_CHECK_TOOL(NM, nm)
-+
-+  ac_tool_prefix="$tmp_ac_tool_prefix"
-+else
-+  if test "x$TARGET_CC" = x; then
-+    TARGET_CC=$CC
-+  fi
-+  AC_CHECK_TOOL(OBJCOPY, objcopy)
-+  AC_CHECK_TOOL(STRIP, strip)
-+  AC_CHECK_TOOL(NM, nm)
-+fi
-+AC_SUBST(TARGET_CC)
-+
-+
-+# Test the C compiler for the target environment.
-+tmp_CC="$CC"
-+tmp_CFLAGS="$CFLAGS"
-+tmp_LDFLAGS="$LDFLAGS"
-+tmp_CPPFLAGS="$CPPFLAGS"
-+tmp_LIBS="$LIBS"
-+CC="$TARGET_CC"
-+CFLAGS="$TARGET_CFLAGS"
-+CPPFLAGS="$TARGET_CPPFLAGS"
-+LDFLAGS="$TARGET_LDFLAGS"
-+LIBS=""
-+
-+if test "x$TARGET_CFLAGS" = x; then
-   # debug flags.
--  tmp_CFLAGS="-Wall -W -Wshadow -Wpointer-arith -Wmissing-prototypes \
--              -Wundef -Wstrict-prototypes -g"
-+  TARGET_CFLAGS="-Wall -W -Wshadow -Wpointer-arith -Wmissing-prototypes \
-+                 -Wundef -Wstrict-prototypes -g"
-   # optimization flags.
-   AC_CACHE_CHECK([whether optimization for size works], size_flag, [
-@@ -67,42 +203,49 @@
-     AC_TRY_COMPILE(, , size_flag=yes, size_flag=no)
-   ])
-   if test "x$size_flag" = xyes; then
--    tmp_CFLAGS="$tmp_CFLAGS -Os"
-+    TARGET_CFLAGS="$TARGET_CFLAGS -Os"
-   else
--    tmp_CFLAGS="$tmp_CFLAGS -O2 -fno-strength-reduce -fno-unroll-loops"
-+    TARGET_CFLAGS="$TARGET_CFLAGS -O2 -fno-strength-reduce -fno-unroll-loops"
-   fi
-   # Force no alignment to save space on i386.
--  if test "x$host_cpu" = xi386; then
-+  if test "x$target_cpu" = xi386; then
-     AC_CACHE_CHECK([whether -falign-loops works], [falign_loop_flag], [
-       CFLAGS="-falign-loops=1"
-       AC_TRY_COMPILE(, , [falign_loop_flag=yes], [falign_loop_flag=no])
-     ])
-     if test "x$falign_loop_flag" = xyes; then
--      tmp_CFLAGS="$tmp_CFLAGS -falign-jumps=1 -falign-loops=1 -falign-functions=1"
-+      TARGET_CFLAGS="$TARGET_CFLAGS -falign-jumps=1 -falign-loops=1 -falign-functions=1"
-     else
--      tmp_CFLAGS="$tmp_CFLAGS -malign-jumps=1 -malign-loops=1 -malign-functions=1"
-+      TARGET_CFLAGS="$TARGET_CFLAGS -malign-jumps=1 -malign-loops=1 -malign-functions=1"
-     fi
-   fi
-+fi
--  if test "x$biarch32" = x1; then
--    tmp_CFLAGS="$tmp_CFLAGS -m32"
--  fi
--
--  CFLAGS="$tmp_CFLAGS"
-+if test "x$target_m32" = x1; then
-+  # Force 32-bit mode.
-+  TARGET_CFLAGS="$TARGET_CFLAGS -m32"
-+  TARGET_LDFLAGS="$TARGET_LDFLAGS -m32"
- fi
--AC_SUBST(CFLAGS)
-+
-+AC_SUBST(TARGET_CFLAGS)
-+AC_SUBST(TARGET_CPPFLAGS)
-+AC_SUBST(TARGET_LDFLAGS)
-+
-+# Set them to their new values for the tests below.
-+CC="$TARGET_CC"
-+CFLAGS="$TARGET_CFLAGS"
-+CPPFLAGS="$TARGET_CPPFLAGS"
-+LDFLAGS="$TARGET_LDFLAGS"
- # Defined in aclocal.m4.
-+grub_PROG_OBJCOPY_ABSOLUTE
- grub_ASM_USCORE
--if test "x$host_cpu" = xi386; then
-+if test "x$target_cpu" = xi386; then
-   grub_CHECK_START_SYMBOL
-   grub_CHECK_BSS_START_SYMBOL
-   grub_CHECK_END_SYMBOL
--fi
--
--if test "x$host_cpu" = xi386; then
-   grub_I386_ASM_PREFIX_REQUIREMENT
-   grub_I386_ASM_ADDR32
-   grub_I386_ASM_ABSOLUTE_WITHOUT_ASTERISK
-@@ -111,73 +254,23 @@
-   AC_DEFINE([NESTED_FUNC_ATTR], [], [Catch gcc bug])
- fi
--AC_PROG_INSTALL
--AC_PROG_MAKE_SET
--AC_CHECK_TOOL(OBJCOPY, objcopy)
--grub_PROG_OBJCOPY_ABSOLUTE
--AC_CHECK_TOOL(STRIP, strip)
--AC_CHECK_TOOL(NM, nm)
--AC_CHECK_TOOL(LD, ld)
--
--# This is not a "must".
--AC_PATH_PROG(RUBY, ruby)
--
--# For cross-compiling.
--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
--  BUILD_CC="$CC"
--  AC_SUBST(BUILD_CC)
--fi
--
--# Test the C compiler for the build environment.
--tmp_CC="$CC"
--tmp_CFLAGS="$CFLAGS"
--tmp_LDFLAGS="$LDFLAGS"
--tmp_CPPFLAGS="$CPPFLAGS"
--CC="$BUILD_CC"
--CFLAGS="$BUILD_CFLAGS"
--CPPFLAGS="$BUILD_CPPFLAGS"
--LDFLAGS="$BUILD_LDDFLAGS"
--
--# Identify characteristics of the build architecture.
--AC_C_BIGENDIAN
--AC_CHECK_SIZEOF(void *)
--AC_CHECK_SIZEOF(long)
--
--# Check LZO when compiling for the i386.
--if test "x$host_cpu" = xi386; then
--  # There are three possibilities. LZO version 2 installed with the name
--  # liblzo2, with the name liblzo, and LZO version 1.
--  AC_CHECK_LIB(lzo2, __lzo_init_v2, [LIBLZO="-llzo2"],
--    AC_CHECK_LIB(lzo, __lzo_init_v2, [LIBLZO="-llzo"],
--      AC_CHECK_LIB(lzo, __lzo_init2, [LIBLZO="-llzo"],
--             AC_MSG_ERROR([LZO library version 1.02 or later is required]))))
--  AC_SUBST(LIBLZO)
--  LIBS="$LIBS $LIBLZO"
--  AC_CHECK_FUNC(lzo1x_999_compress, , 
--              [AC_MSG_ERROR([LZO1X-999 must be enabled])])
--
--  # LZO version 2 uses lzo/lzo1x.h, while LZO version 1 uses lzo1x.h.
--  AC_CHECK_HEADERS(lzo/lzo1x.h lzo1x.h)
--fi
--
--# Check for curses.
--AC_CHECK_LIB(ncurses, wgetch, [LIBCURSES="-lncurses"],
--  [AC_CHECK_LIB(curses, wgetch, [LIBCURSES="-lcurses"])])
--AC_SUBST(LIBCURSES)
--
--# Check for headers.
--AC_CHECK_HEADERS(ncurses/curses.h ncurses.h curses.h)
--
-+# Restore the flags.
- CC="$tmp_CC"
- CFLAGS="$tmp_CFLAGS"
- CPPFLAGS="$tmp_CPPFLAGS"
-+LDFLAGS="$tmp_LDFLAGS"
-+LIBS="$tmp_LIBS"
-+
-+# Check for options.
-+AC_ARG_ENABLE([mm-debug], 
-+            AS_HELP_STRING([--enable-mm-debug],
-+                             [include memory manger debugging]),
-+              [AC_DEFINE([MM_DEBUG], [1],
-+                         [Define to 1 if you enable memory manager debugging.])])
- # Output files.
--AC_CONFIG_LINKS([include/grub/cpu:include/grub/$host_cpu
--      include/grub/machine:include/grub/$host_cpu/$host_vendor])
--AC_CONFIG_FILES([Makefile])
-+AC_CONFIG_LINKS([include/grub/cpu:include/grub/$target_cpu
-+      include/grub/machine:include/grub/$target_cpu/$platform])
-+AC_CONFIG_FILES([Makefile gensymlist.sh genkernsyms.sh])
- AC_CONFIG_FILES([stamp-h], [echo timestamp > stamp-h])
- AC_OUTPUT
-Index: genkernsyms.sh
-===================================================================
-RCS file: genkernsyms.sh
-diff -N genkernsyms.sh
---- genkernsyms.sh     24 Feb 2004 17:21:52 -0000      1.2
-+++ /dev/null  1 Jan 1970 00:00:00 -0000
-@@ -1,15 +0,0 @@
--#! /bin/sh
--#
--# Copyright (C) 2002  Free Software Foundation, Inc.
--#
--# This gensymlist.sh is free software; the author
--# gives unlimited permission to copy and/or distribute it,
--# with or without modifications, as long as this notice is preserved.
--#
--# This program is distributed in the hope that it will be useful,
--# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
--# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
--# PARTICULAR PURPOSE.
--
--cat $* | grep -v '^#' | sed -n '/EXPORT_FUNC *([a-zA-Z0-9_]*)/{s/.*EXPORT_FUNC *(\([a-zA-Z0-9_]*\)).*/\1 kernel/;p;}'
--cat $* | grep -v '^#' | sed -n '/EXPORT_VAR *([a-zA-Z0-9_]*)/{s/.*EXPORT_VAR *(\([a-zA-Z0-9_]*\)).*/\1 kernel/;p;}'
-Index: genkernsyms.sh.in
-===================================================================
-RCS file: genkernsyms.sh.in
-diff -N genkernsyms.sh.in
---- /dev/null  1 Jan 1970 00:00:00 -0000
-+++ genkernsyms.sh.in  26 Apr 2006 21:58:35 -0000      1.1
-@@ -0,0 +1,24 @@
-+#! /bin/sh
-+#
-+# Copyright (C) 2002,2006  Free Software Foundation, Inc.
-+#
-+# This gensymlist.sh is free software; the author
-+# gives unlimited permission to copy and/or distribute it,
-+# with or without modifications, as long as this notice is preserved.
-+#
-+# This program is distributed in the hope that it will be useful,
-+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-+# PARTICULAR PURPOSE.
-+
-+### The configure script will replace these variables.
-+
-+srcdir=@srcdir@
-+CC=@CC@
-+
-+$CC -DGRUB_SYMBOL_GENERATOR=1 -E -I. -Iinclude -I$srcdir/include $* \
-+  | grep -v '^#' \
-+  | sed -n \
-+        -e '/EXPORT_FUNC *([a-zA-Z0-9_]*)/{s/.*EXPORT_FUNC *(\([a-zA-Z0-9_]*\)).*/\1 kernel/;p;}' \
-+        -e '/EXPORT_VAR *([a-zA-Z0-9_]*)/{s/.*EXPORT_VAR *(\([a-zA-Z0-9_]*\)).*/\1 kernel/;p;}' \
-+  | sort -u
-Index: genmk.rb
-===================================================================
-RCS file: /cvsroot/grub/grub2/genmk.rb,v
-retrieving revision 1.18
-retrieving revision 1.25
-diff -u -r1.18 -r1.25
---- genmk.rb   18 Nov 2005 14:56:55 -0000      1.18
-+++ genmk.rb   2 Jun 2006 19:33:58 -0000       1.25
-@@ -1,6 +1,6 @@
- #! /usr/bin/ruby -w
- #
--# Copyright (C) 2002,2003,2004,2005  Free Software Foundation, Inc.
-+# Copyright (C) 2002,2003,2004,2005,2006  Free Software Foundation, Inc.
- #
- # This genmk.rb is free software; the author
- # gives unlimited permission to copy and/or distribute it,
-@@ -60,7 +60,7 @@
-       $(OBJCOPY) -O binary -R .note -R .comment $< $@
- #{exe}: #{objs_str}
--      $(CC) -o $@ $^ $(LDFLAGS) $(#{prefix}_LDFLAGS)
-+      $(TARGET_CC) -o $@ $^ $(TARGET_LDFLAGS) $(#{prefix}_LDFLAGS)
- " + objs.collect_with_index do |obj, i|
-       src = sources[i]
-@@ -71,11 +71,11 @@
-       dir = File.dirname(src)
-       
-       "#{obj}: #{src}
--      $(CC) -I#{dir} -I$(srcdir)/#{dir} $(CPPFLAGS) #{extra_flags} $(#{flag}) $(#{prefix}_#{flag}) -c -o $@ $<
-+      $(TARGET_CC) -I#{dir} -I$(srcdir)/#{dir} $(TARGET_CPPFLAGS) #{extra_flags} $(TARGET_#{flag}) $(#{prefix}_#{flag}) -c -o $@ $<
- #{dep}: #{src}
-       set -e; \
--        $(CC) -I#{dir} -I$(srcdir)/#{dir} $(CPPFLAGS) #{extra_flags} $(#{flag}) $(#{prefix}_#{flag}) -M $< \
-+        $(TARGET_CC) -I#{dir} -I$(srcdir)/#{dir} $(TARGET_CPPFLAGS) #{extra_flags} $(TARGET_#{flag}) $(#{prefix}_#{flag}) -M $< \
-         | sed 's,#{Regexp.quote(fake_obj)}[ :]*,#{obj} $@ : ,g' > $@; \
-         [ -s $@ ] || rm -f $@
-@@ -111,28 +111,33 @@
-     mod_name = File.basename(@name, '.mod')
-     symbolic_name = mod_name.sub(/\.[^\.]*$/, '')
-     
--    "CLEANFILES += #{@name} #{mod_obj} #{mod_src} #{pre_obj} #{objs_str} #{defsym} #{undsym}
--MOSTLYCLEANFILES += #{deps_str}
-+    "CLEANFILES += #{@name} #{mod_obj} #{mod_src} #{pre_obj} #{objs_str} #{undsym}
-+ifneq ($(#{prefix}_EXPORTS),no)
-+CLEANFILES += #{defsym}
- DEFSYMFILES += #{defsym}
-+endif
-+MOSTLYCLEANFILES += #{deps_str}
- UNDSYMFILES += #{undsym}
- #{@name}: #{pre_obj} #{mod_obj}
-       -rm -f $@
--      $(LD) $(#{prefix}_LDFLAGS) $(LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(#{prefix}_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
-       $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
- #{pre_obj}: #{objs_str}
-       -rm -f $@
--      $(LD) $(#{prefix}_LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(#{prefix}_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
- #{mod_obj}: #{mod_src}
--      $(CC) $(CPPFLAGS) $(CFLAGS) $(#{prefix}_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(#{prefix}_CFLAGS) -c -o $@ $<
- #{mod_src}: moddep.lst genmodsrc.sh
-       sh $(srcdir)/genmodsrc.sh '#{mod_name}' $< > $@ || (rm -f $@; exit 1)
-+ifneq ($(#{prefix}_EXPORTS),no)
- #{defsym}: #{pre_obj}
-       $(NM) -g --defined-only -P -p $< | sed 's/^\\([^ ]*\\).*/\\1 #{mod_name}/' > $@
-+endif
- #{undsym}: #{pre_obj}
-       echo '#{mod_name}' > $@
-@@ -148,11 +153,11 @@
-       dir = File.dirname(src)
-       "#{obj}: #{src}
--      $(CC) -I#{dir} -I$(srcdir)/#{dir} $(CPPFLAGS) $(#{flag}) $(#{prefix}_#{flag}) -c -o $@ $<
-+      $(TARGET_CC) -I#{dir} -I$(srcdir)/#{dir} $(TARGET_CPPFLAGS) $(TARGET_#{flag}) $(#{prefix}_#{flag}) -c -o $@ $<
- #{dep}: #{src}
-       set -e; \
--        $(CC) -I#{dir} -I$(srcdir)/#{dir} $(CPPFLAGS) $(#{flag}) $(#{prefix}_#{flag}) -M $< \
-+        $(TARGET_CC) -I#{dir} -I$(srcdir)/#{dir} $(TARGET_CPPFLAGS) $(TARGET_#{flag}) $(#{prefix}_#{flag}) -M $< \
-         | sed 's,#{Regexp.quote(fake_obj)}[ :]*,#{obj} $@ : ,g' > $@; \
-         [ -s $@ ] || rm -f $@
-@@ -164,12 +169,12 @@
- #{command}: #{src} gencmdlist.sh
-       set -e; \
--        $(CC) -I#{dir} -I$(srcdir)/#{dir} $(CPPFLAGS) $(#{flag}) $(#{prefix}_#{flag}) -E $< \
-+        $(TARGET_CC) -I#{dir} -I$(srcdir)/#{dir} $(TARGET_CPPFLAGS) $(TARGET_#{flag}) $(#{prefix}_#{flag}) -E $< \
-         | sh $(srcdir)/gencmdlist.sh #{symbolic_name} > $@ || (rm -f $@; exit 1)
- #{fs}: #{src} genfslist.sh
-       set -e; \
--        $(CC) -I#{dir} -I$(srcdir)/#{dir} $(CPPFLAGS) $(#{flag}) $(#{prefix}_#{flag}) -E $< \
-+        $(TARGET_CC) -I#{dir} -I$(srcdir)/#{dir} $(TARGET_CPPFLAGS) $(TARGET_#{flag}) $(#{prefix}_#{flag}) -E $< \
-         | sh $(srcdir)/genfslist.sh #{symbolic_name} > $@ || (rm -f $@; exit 1)
-@@ -199,7 +204,7 @@
- MOSTLYCLEANFILES += #{deps_str}
- #{@name}: #{objs_str}
--      $(BUILD_CC) -o $@ $^ $(BUILD_LDFLAGS) $(#{prefix}_LDFLAGS)
-+      $(CC) -o $@ $^ $(LDFLAGS) $(#{prefix}_LDFLAGS)
- " + objs.collect_with_index do |obj, i|
-       src = sources[i]
-@@ -208,11 +213,11 @@
-       dir = File.dirname(src)
-       "#{obj}: #{src}
--      $(BUILD_CC) -I#{dir} -I$(srcdir)/#{dir} $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(#{prefix}_CFLAGS) -c -o $@ $<
-+      $(CC) -I#{dir} -I$(srcdir)/#{dir} $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(#{prefix}_CFLAGS) -c -o $@ $<
- #{dep}: #{src}
-       set -e; \
--        $(BUILD_CC) -I#{dir} -I$(srcdir)/#{dir} $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(#{prefix}_CFLAGS) -M $< \
-+        $(CC) -I#{dir} -I$(srcdir)/#{dir} $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(#{prefix}_CFLAGS) -M $< \
-         | sed 's,#{Regexp.quote(fake_obj)}[ :]*,#{obj} $@ : ,g' > $@; \
-         [ -s $@ ] || rm -f $@
-@@ -244,7 +249,7 @@
- MOSTLYCLEANFILES += #{deps_str}
- #{@name}: #{objs_str}
--      $(CC) -o $@ $^ $(LDFLAGS) $(#{prefix}_LDFLAGS)
-+      $(TARGET_CC) -o $@ $^ $(TARGET_LDFLAGS) $(#{prefix}_LDFLAGS)
- " + objs.collect_with_index do |obj, i|
-       src = sources[i]
-@@ -253,11 +258,11 @@
-       dir = File.dirname(src)
-       "#{obj}: #{src}
--      $(CC) -I#{dir} -I$(srcdir)/#{dir} $(CPPFLAGS) $(CFLAGS) $(#{prefix}_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -I#{dir} -I$(srcdir)/#{dir} $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(#{prefix}_CFLAGS) -c -o $@ $<
- #{dep}: #{src}
-       set -e; \
--        $(CC) -I#{dir} -I$(srcdir)/#{dir} $(CPPFLAGS) $(CFLAGS) $(#{prefix}_CFLAGS) -M $< \
-+        $(TARGET_CC) -I#{dir} -I$(srcdir)/#{dir} $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(#{prefix}_CFLAGS) -M $< \
-         | sed 's,#{Regexp.quote(fake_obj)}[ :]*,#{obj} $@ : ,g' > $@; \
-         [ -s $@ ] || rm -f $@
-Index: genmoddep.awk
-===================================================================
-RCS file: genmoddep.awk
-diff -N genmoddep.awk
---- /dev/null  1 Jan 1970 00:00:00 -0000
-+++ genmoddep.awk      28 May 2006 23:01:43 -0000      1.1
-@@ -0,0 +1,62 @@
-+#! /usr/bin/awk -f
-+#
-+# Copyright (C) 2006  Free Software Foundation, Inc.
-+#
-+# This genmoddep.awk is free software; the author
-+# gives unlimited permission to copy and/or distribute it,
-+# with or without modifications, as long as this notice is preserved.
-+#
-+# This program is distributed in the hope that it will be useful,
-+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-+# PARTICULAR PURPOSE.
-+
-+# Read defined symbols from stdin.
-+BEGIN {
-+  while (getline <"/dev/stdin") {
-+    symtab[$1] = $2
-+  }
-+}
-+
-+# The first line contains a module name.
-+FNR == 1 {
-+  module = $1
-+  next
-+};
-+
-+# The rest is undefined symbols.
-+{
-+  if ($1 in symtab) {
-+    modtab[module] = modtab[module] " " symtab[$1];
-+  }
-+  else {
-+    printf "%s in %s is not defined\n", $1, module >"/dev/stderr";
-+    error++;
-+    exit;
-+  }
-+}
-+
-+# Output the result.
-+END {
-+  if (error == 1)
-+    exit 1;
-+  
-+  for (mod in modtab) {
-+    # Remove duplications.
-+    split(modtab[mod], depmods, " ");
-+    for (depmod in uniqmods) {
-+      delete uniqmods[depmod];
-+    }
-+    for (i in depmods) {
-+      depmod = depmods[i];
-+      # Ignore kernel, as always loaded.
-+      if (depmod != "kernel")
-+      uniqmods[depmod] = 1;
-+    }
-+    modlist = ""
-+    for (depmod in uniqmods) {
-+      modlist = modlist " " depmod;
-+    }
-+    printf "%s:%s\n", mod, modlist;
-+  }
-+}
-Index: gensymlist.sh
-===================================================================
-RCS file: gensymlist.sh
-diff -N gensymlist.sh
---- gensymlist.sh      4 Apr 2004 13:45:59 -0000       1.4
-+++ /dev/null  1 Jan 1970 00:00:00 -0000
-@@ -1,65 +0,0 @@
--#! /bin/sh
--#
--# Copyright (C) 2002  Free Software Foundation, Inc.
--#
--# This gensymlist.sh is free software; the author
--# gives unlimited permission to copy and/or distribute it,
--# with or without modifications, as long as this notice is preserved.
--#
--# This program is distributed in the hope that it will be useful,
--# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
--# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
--# PARTICULAR PURPOSE.
--
--cat <<EOF
--/* This file is automatically generated by gensymlist.sh. DO NOT EDIT! */
--/*
-- *  GRUB  --  GRand Unified Bootloader
-- *  Copyright (C) 2002  Free Software Foundation, Inc.
-- *
-- *  GRUB is free software; you can redistribute it and/or modify
-- *  it under the terms of the GNU General Public License as published by
-- *  the Free Software Foundation; either version 2 of the License, or
-- *  (at your option) any later version.
-- *
-- *  This program is distributed in the hope that it will be useful,
-- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
-- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-- *  GNU General Public License for more details.
-- *
-- *  You should have received a copy of the GNU General Public License
-- *  along with GRUB; if not, write to the Free Software
-- *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-- */
--
--EOF
--
--for i in $*; do
--  echo "#include <$i>"
--done
--
--cat <<EOF
--
--void
--grub_register_exported_symbols (void)
--{
--EOF
--
--cat <<EOF
--  struct symtab { const char *name; void *addr; };
--  struct symtab *p;
--  static struct symtab tab[] =
--    {
--EOF
--
--cat $* | grep -v '^#' | sed -n '/EXPORT_FUNC *([a-zA-Z0-9_]*)/{s/.*EXPORT_FUNC *(\([a-zA-Z0-9_]*\)).*/      {"\1", \1},/;p;}'
--cat $* | grep -v '^#' | sed -n '/EXPORT_VAR *([a-zA-Z0-9_]*)/{s/.*EXPORT_VAR *(\([a-zA-Z0-9_]*\)).*/      {"\1", \&\1},/;p;}'
--
--cat <<EOF
--      {0, 0}
--    };
--
--  for (p = tab; p->name; p++)
--    grub_dl_register_symbol (p->name, p->addr, 0);
--}
--EOF
-Index: gensymlist.sh.in
-===================================================================
-RCS file: gensymlist.sh.in
-diff -N gensymlist.sh.in
---- /dev/null  1 Jan 1970 00:00:00 -0000
-+++ gensymlist.sh.in   26 Apr 2006 21:58:35 -0000      1.1
-@@ -0,0 +1,75 @@
-+#! /bin/sh
-+#
-+# Copyright (C) 2002,2006  Free Software Foundation, Inc.
-+#
-+# This gensymlist.sh.in is free software; the author
-+# gives unlimited permission to copy and/or distribute it,
-+# with or without modifications, as long as this notice is preserved.
-+#
-+# This program is distributed in the hope that it will be useful,
-+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-+# PARTICULAR PURPOSE.
-+
-+### The configure script will replace these variables.
-+
-+srcdir=@srcdir@
-+CC=@CC@
-+
-+
-+cat <<EOF
-+/* This file is automatically generated by gensymlist.sh. DO NOT EDIT! */
-+/*
-+ *  GRUB  --  GRand Unified Bootloader
-+ *  Copyright (C) 2002,2006  Free Software Foundation, Inc.
-+ *
-+ *  GRUB is free software; you can redistribute it and/or modify
-+ *  it under the terms of the GNU General Public License as published by
-+ *  the Free Software Foundation; either version 2 of the License, or
-+ *  (at your option) any later version.
-+ *
-+ *  This program is distributed in the hope that it will be useful,
-+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+ *  GNU General Public License for more details.
-+ *
-+ *  You should have received a copy of the GNU General Public License
-+ *  along with GRUB; if not, write to the Free Software
-+ *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-+ */
-+
-+EOF
-+
-+for i in $*; do
-+  echo "#include <$i>"
-+done
-+
-+cat <<EOF
-+
-+void
-+grub_register_exported_symbols (void)
-+{
-+EOF
-+
-+cat <<EOF
-+  struct symtab { const char *name; void *addr; };
-+  struct symtab *p;
-+  static struct symtab tab[] =
-+    {
-+EOF
-+
-+$CC -DGRUB_SYMBOL_GENERATOR=1 -E -I. -Iinclude -I$srcdir/include $* \
-+  | grep -v '^#' \
-+  | sed -n \
-+        -e '/EXPORT_FUNC *([a-zA-Z0-9_]*)/{s/.*EXPORT_FUNC *(\([a-zA-Z0-9_]*\)).*/      {"\1", \1},/;p;}' \
-+        -e '/EXPORT_VAR *([a-zA-Z0-9_]*)/{s/.*EXPORT_VAR *(\([a-zA-Z0-9_]*\)).*/      {"\1", \&\1},/;p;}' \
-+  | sort -u
-+
-+cat <<EOF
-+      {0, 0}
-+    };
-+
-+  for (p = tab; p->name; p++)
-+    grub_dl_register_symbol (p->name, p->addr, 0);
-+}
-+EOF
-Index: install-sh
-===================================================================
-RCS file: /cvsroot/grub/grub2/install-sh,v
-retrieving revision 1.2
-retrieving revision 1.3
-diff -u -r1.2 -r1.3
---- install-sh 6 Aug 2005 15:50:05 -0000       1.2
-+++ install-sh 4 Jun 2006 12:59:19 -0000       1.3
-@@ -1,7 +1,7 @@
- #!/bin/sh
- # install - install a program, script, or datafile
--scriptversion=2005-07-09.12
-+scriptversion=2006-05-11.20
- # This originates from X11R5 (mit/util/scripts/install.sh), which was
- # later released in X11R6 (xc/config/util/install.sh) with the
-@@ -42,12 +42,17 @@
- # from scratch.  It can only install one file at a time, a restriction
- # shared with many OS's install programs.
-+nl='
-+'
-+IFS=" ""      $nl"
-+
- # set DOITPROG to echo to test this script
- # Don't use :- since 4.3BSD and earlier shells don't like it.
- doit="${DOITPROG-}"
--# put in absolute paths if you don't have them in your path; or use env. vars.
-+# Put in absolute file names if you don't have them in your path;
-+# or use environment vars.
- mvprog="${MVPROG-mv}"
- cpprog="${CPPROG-cp}"
-@@ -58,7 +63,21 @@
- rmprog="${RMPROG-rm}"
- mkdirprog="${MKDIRPROG-mkdir}"
--chmodcmd="$chmodprog 0755"
-+posix_glob=
-+posix_mkdir=
-+
-+# Symbolic mode for testing mkdir with directories.
-+# It is the same as 755, but also tests that "u+" works.
-+test_mode=u=rwx,g=rx,o=rx,u+wx
-+
-+# Desired mode of installed file.
-+mode=0755
-+
-+# Desired mode of newly created intermediate directories.
-+# It is empty if not known yet.
-+intermediate_mode=
-+
-+chmodcmd=$chmodprog
- chowncmd=
- chgrpcmd=
- stripcmd=
-@@ -95,7 +114,7 @@
-   CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG
- "
--while test -n "$1"; do
-+while test $# -ne 0; do
-   case $1 in
-     -c) shift
-         continue;;
-@@ -111,7 +130,7 @@
-     --help) echo "$usage"; exit $?;;
--    -m) chmodcmd="$chmodprog $2"
-+    -m) mode=$2
-         shift
-         shift
-         continue;;
-@@ -136,25 +155,33 @@
-     --version) echo "$0 $scriptversion"; exit $?;;
--    *)  # When -d is used, all remaining arguments are directories to create.
--      # When -t is used, the destination is already specified.
--      test -n "$dir_arg$dstarg" && break
--        # Otherwise, the last argument is the destination.  Remove it from $@.
--      for arg
--      do
--          if test -n "$dstarg"; then
--          # $@ is not empty: it contains at least $arg.
--          set fnord "$@" "$dstarg"
--          shift # fnord
--        fi
--        shift # arg
--        dstarg=$arg
--      done
-+    --)       shift
-       break;;
-+
-+    -*)       echo "$0: invalid option: $1" >&2
-+      exit 1;;
-+
-+    *)  break;;
-   esac
- done
--if test -z "$1"; then
-+if test $# -ne 0 && test -z "$dir_arg$dstarg"; then
-+  # When -d is used, all remaining arguments are directories to create.
-+  # When -t is used, the destination is already specified.
-+  # Otherwise, the last argument is the destination.  Remove it from $@.
-+  for arg
-+  do
-+    if test -n "$dstarg"; then
-+      # $@ is not empty: it contains at least $arg.
-+      set fnord "$@" "$dstarg"
-+      shift # fnord
-+    fi
-+    shift # arg
-+    dstarg=$arg
-+  done
-+fi
-+
-+if test $# -eq 0; then
-   if test -z "$dir_arg"; then
-     echo "$0: no input file specified." >&2
-     exit 1
-@@ -164,6 +191,8 @@
-   exit 0
- fi
-+test -n "$dir_arg" || trap '(exit $?); exit' 1 2 13 15
-+
- for src
- do
-   # Protect names starting with `-'.
-@@ -173,15 +202,11 @@
-   if test -n "$dir_arg"; then
-     dst=$src
--    src=
--
--    if test -d "$dst"; then
--      mkdircmd=:
--      chmodcmd=
--    else
--      mkdircmd=$mkdirprog
--    fi
-+    dstdir=$dst
-+    test -d "$dstdir"
-+    dstdir_status=$?
-   else
-+
-     # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
-     # might cause directories to be created, which would be especially bad
-     # if $src (and thus $dsttmp) contains '*'.
-@@ -208,53 +233,150 @@
-       echo "$0: $dstarg: Is a directory" >&2
-       exit 1
-       fi
--      dst=$dst/`basename "$src"`
-+      dstdir=$dst
-+      dst=$dstdir/`basename "$src"`
-+      dstdir_status=0
-+    else
-+      # Prefer dirname, but fall back on a substitute if dirname fails.
-+      dstdir=`
-+      (dirname "$dst") 2>/dev/null ||
-+      expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-+           X"$dst" : 'X\(//\)[^/]' \| \
-+           X"$dst" : 'X\(//\)$' \| \
-+           X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
-+      echo X"$dst" |
-+          sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
-+                 s//\1/
-+                 q
-+               }
-+               /^X\(\/\/\)[^/].*/{
-+                 s//\1/
-+                 q
-+               }
-+               /^X\(\/\/\)$/{
-+                 s//\1/
-+                 q
-+               }
-+               /^X\(\/\).*/{
-+                 s//\1/
-+                 q
-+               }
-+               s/.*/./; q'
-+      `
-+
-+      test -d "$dstdir"
-+      dstdir_status=$?
-     fi
-   fi
--  # This sed command emulates the dirname command.
--  dstdir=`echo "$dst" | sed -e 's,/*$,,;s,[^/]*$,,;s,/*$,,;s,^$,.,'`
-+  obsolete_mkdir_used=false
--  # Make sure that the destination directory exists.
--
--  # Skip lots of stat calls in the usual case.
--  if test ! -d "$dstdir"; then
--    case $dstdir in
--      /*) pathcomp=/ ;;
--      -*) pathcomp=./ ;;
--      *)  pathcomp= ;;
-+  if test $dstdir_status != 0; then
-+    case $posix_mkdir in
-+      '')
-+      posix_mkdir=false
-+      if $mkdirprog -m $test_mode -p -- / >/dev/null 2>&1; then
-+        posix_mkdir=true
-+      else
-+        # Remove any dirs left behind by ancient mkdir implementations.
-+        rmdir ./-m "$test_mode" ./-p ./-- 2>/dev/null
-+      fi ;;
-     esac
--    oIFS=$IFS
--    IFS=/
--    set fnord $dstdir
--    shift
--    IFS=$oIFS
--
--    for d
--    do
--      test "x$d" = x && continue
--
--      pathcomp=$pathcomp$d
--      if test ! -d "$pathcomp"; then
--        $mkdirprog "$pathcomp"
--      # mkdir can fail with a `File exist' error in case several
--      # install-sh are creating the directory concurrently.  This
--      # is OK.
--      test -d "$pathcomp" || exit 1
-+
-+    if
-+      $posix_mkdir && {
-+
-+      # With -d, create the new directory with the user-specified mode.
-+      # Otherwise, create it using the same intermediate mode that
-+      # mkdir -p would use when creating intermediate directories.
-+      # POSIX says that this mode is "$(umask -S),u+wx", so use that
-+      # if umask -S works.
-+
-+      if test -n "$dir_arg"; then
-+        mkdir_mode=$mode
-+      else
-+        case $intermediate_mode in
-+          '')
-+            if umask_S=`(umask -S) 2>/dev/null`; then
-+              intermediate_mode=$umask_S,u+wx
-+            else
-+              intermediate_mode=$test_mode
-+            fi ;;
-+        esac
-+        mkdir_mode=$intermediate_mode
-+      fi
-+
-+      $mkdirprog -m "$mkdir_mode" -p -- "$dstdir"
-+      }
-+    then :
-+    else
-+
-+      # mkdir does not conform to POSIX, or it failed possibly due to
-+      # a race condition.  Create the directory the slow way, step by
-+      # step, checking for races as we go.
-+
-+      case $dstdir in
-+      /*) prefix=/ ;;
-+      -*) prefix=./ ;;
-+      *)  prefix= ;;
-+      esac
-+
-+      case $posix_glob in
-+        '')
-+        if (set -f) 2>/dev/null; then
-+          posix_glob=true
-+        else
-+          posix_glob=false
-+        fi ;;
-+      esac
-+
-+      oIFS=$IFS
-+      IFS=/
-+      $posix_glob && set -f
-+      set fnord $dstdir
-+      shift
-+      $posix_glob && set +f
-+      IFS=$oIFS
-+
-+      prefixes=
-+
-+      for d
-+      do
-+      test -z "$d" && continue
-+
-+      prefix=$prefix$d
-+      if test -d "$prefix"; then
-+        prefixes=
-+      else
-+        if $posix_mkdir; then
-+          $mkdirprog -m "$mkdir_mode" -p -- "$dstdir" && break
-+          # Don't fail if two instances are running concurrently.
-+          test -d "$prefix" || exit 1
-+        else
-+          case $prefix in
-+            *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
-+            *) qprefix=$prefix;;
-+          esac
-+          prefixes="$prefixes '$qprefix'"
-+        fi
-+      fi
-+      prefix=$prefix/
-+      done
-+
-+      if test -n "$prefixes"; then
-+      # Don't fail if two instances are running concurrently.
-+      eval "\$mkdirprog $prefixes" || test -d "$dstdir" || exit 1
-+      obsolete_mkdir_used=true
-       fi
--      pathcomp=$pathcomp/
--    done
-+    fi
-   fi
-   if test -n "$dir_arg"; then
--    $doit $mkdircmd "$dst" \
--      && { test -z "$chowncmd" || $doit $chowncmd "$dst"; } \
--      && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } \
--      && { test -z "$stripcmd" || $doit $stripcmd "$dst"; } \
--      && { test -z "$chmodcmd" || $doit $chmodcmd "$dst"; }
--
-+    { test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
-+    { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
-+    { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
-+      test -z "$chmodcmd" || $doit $chmodcmd "$mode" "$dst"; } || exit 1
-   else
--    dstfile=`basename "$dst"`
-     # Make a couple of temp file names in the proper directory.
-     dsttmp=$dstdir/_inst.$$_
-@@ -262,7 +384,6 @@
-     # Trap to clean up those temp files at exit.
-     trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
--    trap '(exit $?); exit' 1 2 13 15
-     # Copy the file name to the temp name.
-     $doit $cpprog "$src" "$dsttmp" &&
-@@ -276,10 +397,10 @@
-     { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \
-       && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \
-       && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \
--      && { test -z "$chmodcmd" || $doit $chmodcmd "$dsttmp"; } &&
-+      && { test -z "$chmodcmd" || $doit $chmodcmd "$mode" "$dsttmp"; } &&
-     # Now rename the file to the real destination.
--    { $doit $mvcmd -f "$dsttmp" "$dstdir/$dstfile" 2>/dev/null \
-+    { $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null \
-       || {
-          # The rename failed, perhaps because mv can't rename something else
-          # to itself, or perhaps because mv is so ancient that it does not
-@@ -291,11 +412,12 @@
-          # reasons.  In this case, the final cleanup might fail but the new
-          # file should still install successfully.
-          {
--           if test -f "$dstdir/$dstfile"; then
--             $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null \
--             || $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null \
-+           if test -f "$dst"; then
-+             $doit $rmcmd -f "$dst" 2>/dev/null \
-+             || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null \
-+                   && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }; }\
-              || {
--               echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2
-+               echo "$0: cannot unlink or rename $dst" >&2
-                (exit 1); exit 1
-              }
-            else
-@@ -304,16 +426,13 @@
-          } &&
-          # Now rename the file to the real destination.
--         $doit $mvcmd "$dsttmp" "$dstdir/$dstfile"
-+         $doit $mvcmd "$dsttmp" "$dst"
-        }
--    }
--  fi || { (exit 1); exit 1; }
--done
-+    } || exit 1
--# The final little trick to "correctly" pass the exit status to the exit trap.
--{
--  (exit 0); exit 0
--}
-+    trap '' 0
-+  fi
-+done
- # Local variables:
- # eval: (add-hook 'write-file-hooks 'time-stamp)
-Index: mkinstalldirs
-===================================================================
-RCS file: /cvsroot/grub/grub2/mkinstalldirs,v
-retrieving revision 1.2
-retrieving revision 1.3
-diff -u -r1.2 -r1.3
---- mkinstalldirs      6 Aug 2005 15:50:05 -0000       1.2
-+++ mkinstalldirs      4 Jun 2006 12:59:19 -0000       1.3
-@@ -1,7 +1,7 @@
- #! /bin/sh
- # mkinstalldirs --- make directory hierarchy
--scriptversion=2005-06-29.22
-+scriptversion=2006-05-11.19
- # Original author: Noah Friedman <friedman@prep.ai.mit.edu>
- # Created: 1993-05-16
-@@ -11,6 +11,9 @@
- # bugs to <bug-automake@gnu.org> or send patches to
- # <automake-patches@gnu.org>.
-+nl='
-+'
-+IFS=" ""      $nl"
- errstatus=0
- dirmode=
-Index: boot/i386/pc/boot.S
-===================================================================
-RCS file: /cvsroot/grub/grub2/boot/i386/pc/boot.S,v
-retrieving revision 1.7
-retrieving revision 1.9
-diff -u -r1.7 -r1.9
---- boot/i386/pc/boot.S        1 Feb 2006 06:12:58 -0000       1.7
-+++ boot/i386/pc/boot.S        4 Jun 2006 15:56:53 -0000       1.9
-@@ -1,7 +1,7 @@
- /* -*-Asm-*- */
- /*
-  *  GRUB  --  GRand Unified Bootloader
-- *  Copyright (C) 1999,2000,2001,2002,2005   Free Software Foundation, Inc.
-+ *  Copyright (C) 1999,2000,2001,2002,2005,2006  Free Software Foundation, Inc.
-  *
-  *  This program is free software; you can redistribute it and/or modify
-  *  it under the terms of the GNU General Public License as published by
-@@ -91,17 +91,15 @@
- boot_version: 
-       .byte   GRUB_BOOT_VERSION_MAJOR, GRUB_BOOT_VERSION_MINOR
--boot_drive:   
--      .byte 0xff      /* the disk to load kernel from */
--                      /* 0xff means use the boot drive */
--force_lba:
--      .byte   0
- kernel_address:
-       .word   GRUB_BOOT_MACHINE_KERNEL_ADDR
--kernel_sector:
--      .long   1
- kernel_segment:
-       .word   GRUB_BOOT_MACHINE_KERNEL_SEG
-+kernel_sector:
-+      .long   1, 0
-+boot_drive:   
-+      .byte 0xff      /* the disk to load kernel from */
-+                      /* 0xff means use the boot drive */
- after_BPB:
-@@ -155,6 +153,9 @@
-       /* print a notification message on the screen */
-       MSG(notification_string)
-+      /* set %si to the disk address packet */
-+      movw    $ABS(disk_address_packet), %si
-+      
-       /* do not probe LBA if the drive is a floppy */
-       testb   $GRUB_BOOT_MACHINE_BIOS_HD_FLAG, %dl
-       jz      chs_mode
-@@ -176,38 +177,32 @@
-       cmpw    $0xaa55, %bx
-       jne     chs_mode
--      /* check if AH=0x42 is supported if FORCE_LBA is zero */
--      MOV_MEM_TO_AL(ABS(force_lba))   /* movb ABS(force_lba), %al */
--      testb   %al, %al
--      jnz     lba_mode
-       andw    $1, %cx
-       jz      chs_mode
-       
- lba_mode:
--      /* set %si to the disk address packet */
--      movw    $ABS(disk_address_packet), %si
-+      xorw    %ax, %ax
-+      movw    %ax, 4(%si)
-+      incw    %ax     
-       /* set the mode to non-zero */
--      movb    $1, -1(%si)
-+      movb    %al, -1(%si)
-       
--      movl    ABS(kernel_sector), %ebx
-+      /* the blocks */
-+      movw    %ax, 2(%si)
-       /* the size and the reserved byte */
-       movw    $0x0010, (%si)
--      /* the blocks */
--      movw    $1, 2(%si)
--      
--      /* the absolute address (low 32 bits) */
-+      /* the absolute address */
-+      movl    ABS(kernel_sector), %ebx
-       movl    %ebx, 8(%si)
-+      movl    ABS(kernel_sector + 4), %ebx
-+      movl    %ebx, 12(%si)
-       /* the segment of buffer address */
-       movw    $GRUB_BOOT_MACHINE_BUFFER_SEG, 6(%si)
--      xorl    %eax, %eax
--      movw    %ax, 4(%si)
--      movl    %eax, 12(%si)
--      
- /*
-  * BIOS call "INT 0x13 Function 0x42" to read sectors from disk into memory
-  *    Call with       %ah = 0x42
-@@ -245,20 +240,15 @@
-       jmp     hd_probe_error
- final_init:
--      
--      movw    $ABS(sectors), %si
--
-       /* set the mode to zero */
--      movb    $0, -1(%si)
-+      movzbl  %dh, %eax
-+      movb    %ah, -1(%si)
-       
-       /* save number of heads */
--      xorl    %eax, %eax
--      movb    %dh, %al
-       incw    %ax
-       movl    %eax, 4(%si)
--      xorw    %dx, %dx
--      movb    %cl, %dl
-+      movzbw  %cl, %dx
-       shlw    $2, %dx
-       movb    %ch, %al
-       movb    %dh, %ah
-@@ -267,14 +257,18 @@
-       incw    %ax
-       movw    %ax, 8(%si)
--      xorw    %ax, %ax
--      movb    %dl, %al
-+      movzbw  %dl, %ax
-       shrb    $2, %al
-       /* save number of sectors */
-       movl    %eax, (%si)
- setup_sectors:
-+      /* load logical sector start (top half) */
-+      movl    ABS(kernel_sector + 4), %eax
-+      orl     %eax, %eax
-+      jnz     geometry_error
-+      
-       /* load logical sector start (bottom half) */
-       movl    ABS(kernel_sector), %eax
-@@ -285,41 +279,34 @@
-       divl    (%si)
-       /* save sector start */
--      movb    %dl, 10(%si)
-+      movb    %dl, %cl
--      xorl    %edx, %edx      /* zero %edx */
-+      xorw    %dx, %dx        /* zero %edx */
-       divl    4(%si)          /* divide by number of heads */
--      /* save head start */
--      movb    %dl, 11(%si)
--
--      /* save cylinder start */
--      movw    %ax, 12(%si)
--
-       /* do we need too many cylinders? */
-       cmpw    8(%si), %ax
-       jge     geometry_error
--/*
-- *  This is the loop for taking care of BIOS geometry translation (ugh!)
-- */
-+      /* normalize sector start (1-based) */
-+      incb    %cl
--      /* get high bits of cylinder */
--      movb    13(%si), %dl
-+      /* low bits of cylinder start */
-+      movb    %al, %ch
--      shlb    $6, %dl         /* shift left by 6 bits */
--      movb    10(%si), %cl    /* get sector */
-+      /* high bits of cylinder start */
-+      xorb    %al, %al
-+      shrw    $2, %ax
-+      orb     %al, %cl
--      incb    %cl             /* normalize sector (sectors go
--                                      from 1-N, not 0-(N-1) ) */
--      orb     %dl, %cl        /* composite together */
--      movb    12(%si), %ch    /* sector+hcyl in cl, cylinder in ch */
-+      /* save head start */
-+      movb    %dl, %al
--      /* restore %dx */
-+      /* restore %dl */
-       popw    %dx
--      
--      /* head number */
--      movb    11(%si), %dh
-+
-+      /* head start */
-+      movb    %al, %dh
- /*
-  * BIOS call "INT 0x13 Function 0x2" to read sectors from disk into memory
-Index: boot/i386/pc/diskboot.S
-===================================================================
-RCS file: /cvsroot/grub/grub2/boot/i386/pc/diskboot.S,v
-retrieving revision 1.3
-retrieving revision 1.4
-diff -u -r1.3 -r1.4
---- boot/i386/pc/diskboot.S    4 Apr 2004 13:45:59 -0000       1.3
-+++ boot/i386/pc/diskboot.S    4 Jun 2006 15:56:53 -0000       1.4
-@@ -1,6 +1,6 @@
- /*
-  *  GRUB  --  GRand Unified Bootloader
-- *  Copyright (C) 1999,2000,2001,2002   Free Software Foundation, Inc.
-+ *  Copyright (C) 1999,2000,2001,2002,2006   Free Software Foundation, Inc.
-  *
-  *  This program is free software; you can redistribute it and/or modify
-  *  it under the terms of the GNU General Public License as published by
-@@ -71,7 +71,7 @@
- bootloop:
-       /* check the number of sectors to read */
--      cmpw    $0, 4(%di)
-+      cmpw    $0, 8(%di)
-       /* if zero, go to the start function */
-       je      bootit
-@@ -86,26 +86,28 @@
- lba_mode:     
-       /* load logical sector start */
-       movl    (%di), %ebx
-+      movl    4(%di), %ecx
-       /* the maximum is limited to 0x7f because of Phoenix EDD */
-       xorl    %eax, %eax
-       movb    $0x7f, %al
-       /* how many do we really want to read? */
--      cmpw    %ax, 4(%di)     /* compare against total number of sectors */
-+      cmpw    %ax, 8(%di)     /* compare against total number of sectors */
-       /* which is greater? */
-       jg      1f
-       /* if less than, set to total */
--      movw    4(%di), %ax
-+      movw    8(%di), %ax
- 1:    
-       /* subtract from total */
--      subw    %ax, 4(%di)
-+      subw    %ax, 8(%di)
-       /* add into logical sector start */
-       addl    %eax, (%di)
-+      adcl    $0, 4(%di)
-       /* set up disk address packet */
-@@ -115,8 +117,9 @@
-       /* the number of sectors */
-       movw    %ax, 2(%si)
--      /* the absolute address (low 32 bits) */
-+      /* the absolute address */
-       movl    %ebx, 8(%si)
-+      movl    %ecx, 12(%si)
-       /* the segment of buffer address */
-       movw    $GRUB_BOOT_MACHINE_BUFFER_SEG, 6(%si)
-@@ -124,15 +127,8 @@
-       /* save %ax from destruction! */
-       pushw   %ax
--      /* zero %eax */
--      xorl    %eax, %eax
--
-       /* the offset of buffer address */
--      movw    %ax, 4(%si)
--
--      /* the absolute address (high 32 bits) */
--      movl    %eax, 12(%si)
--
-+      movw    $0, 4(%si)
- /*
-  * BIOS call "INT 0x13 Function 0x42" to read sectors from disk into memory
-@@ -152,6 +148,11 @@
-       jmp     copy_buffer
-                       
- chs_mode:     
-+      /* load logical sector start (top half) */
-+      movl    4(%di), %eax
-+      orl     %eax, %eax
-+      jnz     geometry_error
-+
-       /* load logical sector start (bottom half) */
-       movl    (%di), %eax
-@@ -184,21 +185,22 @@
-       subb    10(%si), %al
-       /* how many do we really want to read? */
--      cmpw    %ax, 4(%di)     /* compare against total number of sectors */
-+      cmpw    %ax, 8(%di)     /* compare against total number of sectors */
-       /* which is greater? */
-       jg      2f
-       /* if less than, set to total */
--      movw    4(%di), %ax
-+      movw    8(%di), %ax
- 2:    
-       /* subtract from total */
--      subw    %ax, 4(%di)
-+      subw    %ax, 8(%di)
-       /* add into logical sector start */
-       addl    %eax, (%di)
-+      adcl    $0, 4(%di)
- /*
-  *  This is the loop for taking care of BIOS geometry translation (ugh!)
-@@ -252,7 +254,7 @@
- copy_buffer:  
-       /* load addresses for copy from disk buffer to destination */
--      movw    6(%di), %es     /* load destination segment */
-+      movw    10(%di), %es    /* load destination segment */
-       /* restore %ax */
-       popw    %ax
-@@ -260,7 +262,7 @@
-       /* determine the next possible destination address (presuming
-               512 byte sectors!) */
-       shlw    $5, %ax         /* shift %ax five bits to the left */
--      addw    %ax, 6(%di)     /* add the corrected value to the destination
-+      addw    %ax, 10(%di)    /* add the corrected value to the destination
-                                  address for next time */
-       /* save addressing regs */
-@@ -288,7 +290,7 @@
-       popa
-       /* check if finished with this dataset */
--      cmpw    $0, 4(%di)
-+      cmpw    $0, 8(%di)
-       jne     setup_sectors
-       /* update position to load from */
-@@ -374,7 +376,7 @@
- blocklist_default_start:
-       /* this is the sector start parameter, in logical sectors from
-          the start of the disk, sector 0 */
--      .long 2
-+      .long 2, 0
- blocklist_default_len:
-       /* this is the number of sectors to read the command "install"
-          will fill this up */
-Index: commands/blocklist.c
-===================================================================
-RCS file: commands/blocklist.c
-diff -N commands/blocklist.c
---- /dev/null  1 Jan 1970 00:00:00 -0000
-+++ commands/blocklist.c       4 Jun 2006 15:56:54 -0000       1.2
-@@ -0,0 +1,123 @@
-+/* blocklist.c - print the block list of a file */
-+/*
-+ *  GRUB  --  GRand Unified Bootloader
-+ *  Copyright (C) 2006  Free Software Foundation, Inc.
-+ *
-+ *  GRUB is free software; you can redistribute it and/or modify
-+ *  it under the terms of the GNU General Public License as published by
-+ *  the Free Software Foundation; either version 2 of the License, or
-+ *  (at your option) any later version.
-+ *
-+ *  This program is distributed in the hope that it will be useful,
-+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+ *  GNU General Public License for more details.
-+ *
-+ *  You should have received a copy of the GNU General Public License
-+ *  along with GRUB; if not, write to the Free Software
-+ *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-+ */
-+
-+#include <grub/normal.h>
-+#include <grub/dl.h>
-+#include <grub/arg.h>
-+#include <grub/misc.h>
-+#include <grub/file.h>
-+#include <grub/mm.h>
-+#include <grub/disk.h>
-+#include <grub/partition.h>
-+
-+static grub_err_t
-+grub_cmd_blocklist (struct grub_arg_list *state __attribute__ ((unused)),
-+                  int argc, char **args)
-+{
-+  grub_file_t file;
-+  char buf[GRUB_DISK_SECTOR_SIZE];
-+  unsigned long start_sector = 0;
-+  unsigned num_sectors = 0;
-+  int num_entries = 0;
-+  grub_disk_addr_t part_start = 0;
-+  auto void read_blocklist (grub_disk_addr_t sector, unsigned offset,
-+                          unsigned length);
-+  auto void print_blocklist (grub_disk_addr_t sector, unsigned num,
-+                           unsigned offset, unsigned length);
-+  
-+  void read_blocklist (grub_disk_addr_t sector, unsigned offset,
-+                     unsigned length)
-+    {
-+      if (num_sectors > 0)
-+      {
-+        if (start_sector + num_sectors == sector
-+            && offset == 0 && length == GRUB_DISK_SECTOR_SIZE)
-+          {
-+            num_sectors++;
-+            return;
-+          }
-+        
-+        print_blocklist (start_sector, num_sectors, 0, 0);
-+        num_sectors = 0;
-+      }
-+
-+      if (offset == 0 && length == GRUB_DISK_SECTOR_SIZE)
-+      {
-+        start_sector = sector;
-+        num_sectors++;
-+      }
-+      else
-+      print_blocklist (sector, 0, offset, length);
-+    }
-+  
-+  void print_blocklist (grub_disk_addr_t sector, unsigned num,
-+                      unsigned offset, unsigned length)
-+    {
-+      if (num_entries++)
-+      grub_printf (",");
-+
-+      grub_printf ("%llu", sector - part_start);
-+      if (num > 0)
-+      grub_printf ("+%u", num);
-+      if (offset != 0 || length != 0)
-+      grub_printf ("[%u-%u]", offset, offset + length);
-+    }
-+  
-+  if (argc < 1)
-+    return grub_error (GRUB_ERR_BAD_ARGUMENT, "no file specified");
-+
-+  file = grub_file_open (args[0]);
-+  if (! file)
-+    return grub_errno;
-+
-+  if (! file->device->disk)
-+    return grub_error (GRUB_ERR_BAD_DEVICE,
-+                     "this command is available only for disk devices.");
-+
-+  if (file->device->disk->partition)
-+    part_start = grub_partition_get_start (file->device->disk->partition);
-+  
-+  file->read_hook = read_blocklist;
-+
-+  while (grub_file_read (file, buf, sizeof (buf)) > 0)
-+    ;
-+
-+  if (num_sectors > 0)
-+    print_blocklist (start_sector, num_sectors, 0, 0);
-+  
-+  grub_file_close (file);
-+
-+  return grub_errno;
-+}
-+
-+\f
-+GRUB_MOD_INIT(blocklist)
-+{
-+  (void) mod;                 /* To stop warning. */
-+  grub_register_command ("blocklist", grub_cmd_blocklist,
-+                       GRUB_COMMAND_FLAG_BOTH,
-+                       "blocklist FILE",
-+                       "Print a block list.", 0);
-+}
-+
-+GRUB_MOD_FINI(blocklist)
-+{
-+  grub_unregister_command ("blocklist");
-+}
-Index: commands/cmp.c
-===================================================================
-RCS file: /cvsroot/grub/grub2/commands/cmp.c,v
-retrieving revision 1.6
-retrieving revision 1.7
-diff -u -r1.6 -r1.7
---- commands/cmp.c     13 Nov 2005 15:47:08 -0000      1.6
-+++ commands/cmp.c     4 Jun 2006 15:56:54 -0000       1.7
-@@ -1,7 +1,7 @@
- /* cmd.c - command to cmp an operating system */
- /*
-  *  GRUB  --  GRand Unified Bootloader
-- *  Copyright (C) 2003,2005  Free Software Foundation, Inc.
-+ *  Copyright (C) 2003,2005,2006  Free Software Foundation, Inc.
-  *
-  *  GRUB is free software; you can redistribute it and/or modify
-  *  it under the terms of the GNU General Public License as published by
-@@ -32,9 +32,8 @@
- grub_cmd_cmp (struct grub_arg_list *state __attribute__ ((unused)),
-             int argc, char **args)
- {
--  grub_err_t err;
-   grub_ssize_t rd1, rd2;
--  grub_uint32_t pos;
-+  grub_off_t pos;
-   grub_file_t file1 = 0;
-   grub_file_t file2 = 0;
-   char *buf1 = 0;
-@@ -46,25 +45,29 @@
-   grub_printf ("Compare `%s' and `%s':\n", args[0],
-              args[1]);
--  if (! (file1 = grub_gzfile_open (args[0], 1) ) ||
--      ! (file2 = grub_gzfile_open (args[1], 1) ) )
-+  file1 = grub_gzfile_open (args[0], 1);
-+  file2 = grub_gzfile_open (args[1], 1);
-+  if (! file1 || ! file2)
-     goto cleanup;
-   if (grub_file_size (file1) != grub_file_size (file2))
--    grub_printf ("Differ in size: %d [%s], %d [%s]\n", 
-+    grub_printf ("Differ in size: %llu [%s], %llu [%s]\n", 
-                grub_file_size (file1), args[0], 
-                grub_file_size (file2), args[1]);
--  
-   else
-     {
-       pos = 0;
--      if (! (buf1 = (char *) grub_malloc (BUFFER_SIZE) ) ||
--          ! (buf2 = (char *) grub_malloc (BUFFER_SIZE) ) )
-+      buf1 = grub_malloc (BUFFER_SIZE);
-+      buf2 = grub_malloc (BUFFER_SIZE);
-+      
-+      if (! buf1 || ! buf2)
-         goto cleanup;
-+      
-       do
-       {
-         int i;
-+        
-         rd1 = grub_file_read (file1, buf1, BUFFER_SIZE);
-         rd2 = grub_file_read (file2, buf2, BUFFER_SIZE);
-@@ -75,7 +78,7 @@
-           {
-             if (buf1[i] != buf2[i])
-               {
--                grub_printf ("Differ at the offset %d: 0x%x [%s], 0x%x [%s]\n",
-+                grub_printf ("Differ at the offset %llu: 0x%x [%s], 0x%x [%s]\n",
-                              i + pos, buf1[i], args[0],
-                              buf2[i], args[1]);
-                 goto cleanup;
-@@ -83,12 +86,14 @@
-           }
-         pos += BUFFER_SIZE;
-         
--      } while (rd2);
-+      }
-+      while (rd2);
-+      
-       grub_printf ("The files are identical.\n");
-     }
- cleanup:
--  err=grub_errno;
-+  
-   if (buf1)
-     grub_free (buf1);
-   if (buf2)
-@@ -98,7 +103,7 @@
-   if (file2)
-     grub_file_close (file2);
--  return err;
-+  return grub_errno;
- }
\f
-Index: commands/configfile.c
-===================================================================
-RCS file: /cvsroot/grub/grub2/commands/configfile.c,v
-retrieving revision 1.3
-retrieving revision 1.6
-diff -u -r1.3 -r1.6
---- commands/configfile.c      13 Nov 2005 15:47:08 -0000      1.3
-+++ commands/configfile.c      4 Jun 2006 15:56:54 -0000       1.6
-@@ -1,7 +1,7 @@
- /* configfile.c - command to manually load config file  */
- /*
-  *  GRUB  --  GRand Unified Bootloader
-- *  Copyright (C) 2005  Free Software Foundation, Inc.
-+ *  Copyright (C) 2005,2006  Free Software Foundation, Inc.
-  *
-  *  GRUB is free software; you can redistribute it and/or modify
-  *  it under the terms of the GNU General Public License as published by
-@@ -23,6 +23,7 @@
- #include <grub/arg.h>
- #include <grub/term.h>
- #include <grub/misc.h>
-+#include <grub/env.h>
- static grub_err_t
- grub_cmd_configfile (struct grub_arg_list *state __attribute__ ((unused)),
-@@ -33,6 +34,21 @@
-     return grub_error (GRUB_ERR_BAD_ARGUMENT, "file name required");
-   grub_cls ();
-+  grub_env_context_open ();
-+  grub_normal_execute (args[0], 1);
-+  grub_env_context_close ();
-+
-+  return 0;
-+}
-+
-+static grub_err_t
-+grub_cmd_source (struct grub_arg_list *state __attribute__ ((unused)),
-+               int argc, char **args)
-+
-+{
-+  if (argc != 1)
-+    return grub_error (GRUB_ERR_BAD_ARGUMENT, "file name required");
-+
-   grub_normal_execute (args[0], 1);
-   return 0;
-@@ -45,9 +61,19 @@
-   grub_register_command ("configfile", grub_cmd_configfile,
-                         GRUB_COMMAND_FLAG_BOTH, "configfile FILE",
-                         "Load another config file.", 0);
-+  grub_register_command ("source", grub_cmd_source,
-+                        GRUB_COMMAND_FLAG_BOTH, "source FILE",
-+                        "Load another config file without changing context.",
-+                       0);
-+  grub_register_command (".", grub_cmd_source,
-+                        GRUB_COMMAND_FLAG_BOTH, ". FILE",
-+                        "Load another config file without changing context.",
-+                       0);
- }
- GRUB_MOD_FINI(configfile)
- {
-   grub_unregister_command ("configfile");
-+  grub_unregister_command ("source");
-+  grub_unregister_command (".");
- }
-Index: commands/default.c
-===================================================================
-RCS file: commands/default.c
-diff -N commands/default.c
---- commands/default.c 13 Nov 2005 15:47:08 -0000      1.2
-+++ /dev/null  1 Jan 1970 00:00:00 -0000
-@@ -1,57 +0,0 @@
--/* default.c - set the default boot entry */
--/*
-- *  GRUB  --  GRand Unified Bootloader
-- *  Copyright (C) 2005  Free Software Foundation, Inc.
-- *
-- *  GRUB is free software; you can redistribute it and/or modify
-- *  it under the terms of the GNU General Public License as published by
-- *  the Free Software Foundation; either version 2 of the License, or
-- *  (at your option) any later version.
-- *
-- *  This program is distributed in the hope that it will be useful,
-- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
-- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-- *  GNU General Public License for more details.
-- *
-- *  You should have received a copy of the GNU General Public License
-- *  along with GRUB; if not, write to the Free Software
-- *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-- */
--
--#include <grub/arg.h>
--#include <grub/misc.h>
--#include <grub/normal.h>
--#include <grub/err.h>
--#include <grub/dl.h>
--
--/* This is a simple version. This should support a saved boot entry,
--   a label, etc.  */
--static grub_err_t
--grub_cmd_default (struct grub_arg_list *state __attribute__ ((unused)),
--                int argc, char **args)
--{
--  grub_menu_t menu;
--  
--  if (argc != 1)
--    return grub_error (GRUB_ERR_BAD_ARGUMENT, "entry number required");
--
--  menu = grub_context_get_current_menu ();
--  if (menu)
--    menu->default_entry = grub_strtoul (args[0], 0, 0);
--
--  return grub_errno;
--}
--
--\f
--
--GRUB_MOD_INIT(default)
--{
--  (void)mod;                  /* To stop warning. */
--  grub_register_command ("default", grub_cmd_default, GRUB_COMMAND_FLAG_MENU,
--                       "default ENTRY", "Set the default entry", 0);
--}
--
--GRUB_MOD_FINI(default)
--{
--  grub_unregister_command ("default");
--}
-Index: commands/ls.c
-===================================================================
-RCS file: /cvsroot/grub/grub2/commands/ls.c,v
-retrieving revision 1.13
-retrieving revision 1.14
-diff -u -r1.13 -r1.14
---- commands/ls.c      13 Nov 2005 15:47:08 -0000      1.13
-+++ commands/ls.c      4 Jun 2006 15:56:54 -0000       1.14
-@@ -106,7 +106,7 @@
-           }
-         if (! human)
--          grub_printf ("%-12d", file->size);
-+          grub_printf ("%-12llu", file->size);
-         else
-           {
-             float fsize = file->size;
-@@ -127,7 +127,7 @@
-                 grub_printf ("%-12s", buf);
-               }
-             else
--              grub_printf ("%-12d", file->size);
-+              grub_printf ("%-12llu", file->size);
-             
-           }
-         grub_file_close (file);
-Index: commands/timeout.c
-===================================================================
-RCS file: commands/timeout.c
-diff -N commands/timeout.c
---- commands/timeout.c 13 Nov 2005 15:47:08 -0000      1.2
-+++ /dev/null  1 Jan 1970 00:00:00 -0000
-@@ -1,55 +0,0 @@
--/* timeout.c - set the timeout */
--/*
-- *  GRUB  --  GRand Unified Bootloader
-- *  Copyright (C) 2005  Free Software Foundation, Inc.
-- *
-- *  GRUB is free software; you can redistribute it and/or modify
-- *  it under the terms of the GNU General Public License as published by
-- *  the Free Software Foundation; either version 2 of the License, or
-- *  (at your option) any later version.
-- *
-- *  This program is distributed in the hope that it will be useful,
-- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
-- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-- *  GNU General Public License for more details.
-- *
-- *  You should have received a copy of the GNU General Public License
-- *  along with GRUB; if not, write to the Free Software
-- *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-- */
--
--#include <grub/arg.h>
--#include <grub/misc.h>
--#include <grub/normal.h>
--#include <grub/err.h>
--#include <grub/dl.h>
--
--static grub_err_t
--grub_cmd_timeout (struct grub_arg_list *state __attribute__ ((unused)),
--                int argc, char **args)
--{
--  grub_menu_t menu;
--  
--  if (argc != 1)
--    return grub_error (GRUB_ERR_BAD_ARGUMENT, "timeout value required");
--
--  menu = grub_context_get_current_menu ();
--  if (menu)
--    menu->timeout = grub_strtoul (args[0], 0, 0);
--
--  return grub_errno;
--}
--
--\f
--
--GRUB_MOD_INIT(timeout)
--{
--  (void)mod;                  /* To stop warning. */
--  grub_register_command ("timeout", grub_cmd_timeout, GRUB_COMMAND_FLAG_MENU,
--                       "timeout SECS", "Set the timeout", 0);
--}
--
--GRUB_MOD_FINI(timeout)
--{
--  grub_unregister_command ("timeout");
--}
-Index: commands/videotest.c
-===================================================================
-RCS file: commands/videotest.c
-diff -N commands/videotest.c
---- /dev/null  1 Jan 1970 00:00:00 -0000
-+++ commands/videotest.c       14 Mar 2006 19:08:33 -0000      1.1
-@@ -0,0 +1,130 @@
-+/*
-+ *  GRUB  --  GRand Unified Bootloader
-+ *  Copyright (C) 2006  Free Software Foundation, Inc.
-+ *
-+ *  This program is free software; you can redistribute it and/or modify
-+ *  it under the terms of the GNU General Public License as published by
-+ *  the Free Software Foundation; either version 2 of the License, or
-+ *  (at your option) any later version.
-+ *
-+ *  This program is distributed in the hope that it will be useful,
-+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+ *  GNU General Public License for more details.
-+ *
-+ *  You should have received a copy of the GNU General Public License
-+ *  along with this program; if not, write to the Free Software
-+ *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-+ */
-+
-+#include <grub/machine/memory.h>
-+#include <grub/video.h>
-+#include <grub/types.h>
-+#include <grub/dl.h>
-+#include <grub/misc.h>
-+#include <grub/normal.h>
-+#include <grub/arg.h>
-+#include <grub/mm.h>
-+#include <grub/font.h>
-+#include <grub/term.h>
-+
-+static grub_err_t
-+grub_cmd_videotest (struct grub_arg_list *state __attribute__ ((unused)),
-+                    int argc __attribute__ ((unused)),
-+                    char **args __attribute__ ((unused)))
-+{
-+  if (grub_video_setup (1024, 768,
-+                        GRUB_VIDEO_MODE_TYPE_INDEX_COLOR) != GRUB_ERR_NONE)
-+    return grub_errno;
-+  
-+  grub_getkey ();
-+
-+  grub_video_color_t color;
-+  unsigned int x;
-+  unsigned int y;
-+  unsigned int width;
-+  unsigned int height;
-+  int i;
-+  struct grub_font_glyph glyph;
-+  struct grub_video_render_target *text_layer;
-+  grub_video_color_t palette[16];
-+  
-+  grub_video_get_viewport (&x, &y, &width, &height);
-+
-+  grub_video_create_render_target (&text_layer, width, height,
-+                                   GRUB_VIDEO_MODE_TYPE_RGB
-+                                   | GRUB_VIDEO_MODE_TYPE_ALPHA);
-+
-+  grub_video_set_active_render_target (GRUB_VIDEO_RENDER_TARGET_DISPLAY);                                   
-+
-+  color = grub_video_map_rgb (0, 0, 0);
-+  grub_video_fill_rect (color, 0, 0, width, height);
-+  
-+  color = grub_video_map_rgb (255, 0, 0);
-+  grub_video_fill_rect (color, 0, 0, 100, 100);
-+  
-+  color = grub_video_map_rgb (0, 255, 255);
-+  grub_video_fill_rect (color, 100, 100, 100, 100);
-+
-+  grub_font_get_glyph ('*', &glyph);  
-+  grub_video_blit_glyph (&glyph, color, 200 ,0);
-+
-+  grub_video_set_viewport (x + 150, y + 150,
-+                           width - 150 * 2, height - 150 * 2);
-+  color = grub_video_map_rgb (77, 33, 77);
-+  grub_video_fill_rect (color, 0, 0, width, height);
-+  
-+  grub_video_set_active_render_target (text_layer);
-+  
-+  color = grub_video_map_rgb (255, 255, 255);
-+  
-+  grub_font_get_glyph ('A', &glyph);  
-+  grub_video_blit_glyph (&glyph, color, 16, 16);
-+  grub_font_get_glyph ('B', &glyph);  
-+  grub_video_blit_glyph (&glyph, color, 16 * 2, 16);
-+
-+  grub_font_get_glyph ('*', &glyph);  
-+  
-+  for (i = 0; i < 16; i++)
-+    {
-+      color = grub_video_map_color (i);
-+      palette[i] = color;
-+      grub_video_blit_glyph (&glyph, color, 16 + i * 16, 32);
-+    }
-+
-+  grub_video_set_active_render_target (GRUB_VIDEO_RENDER_TARGET_DISPLAY);
-+
-+  for (i = 0; i < 255; i++)
-+    {
-+      color = grub_video_map_rgb (i, 33, 77);
-+      grub_video_fill_rect (color, 0, 0, width, height);
-+      grub_video_blit_render_target (text_layer, 0, 0, 0, 0, width, height);
-+    }
-+  
-+  grub_getkey ();
-+  
-+  grub_video_delete_render_target (text_layer);
-+  
-+  grub_video_restore ();
-+  
-+  for (i = 0; i < 16; i++)
-+    grub_printf("color %d: %08x\n", i, palette[i]);
-+  
-+  grub_errno = GRUB_ERR_NONE;
-+  return grub_errno;
-+}
-+
-+GRUB_MOD_INIT(videotest)
-+{
-+  grub_register_command ("videotest",
-+                         grub_cmd_videotest,
-+                         GRUB_COMMAND_FLAG_BOTH,
-+                         "videotest",
-+                         "Test video subsystem",
-+                         0);
-+}
-+
-+GRUB_MOD_FINI(videotest)
-+{
-+  grub_unregister_command ("videotest");
-+}
-Index: commands/i386/pc/play.c
-===================================================================
-RCS file: /cvsroot/grub/grub2/commands/i386/pc/play.c,v
-retrieving revision 1.1
-retrieving revision 1.2
-diff -u -r1.1 -r1.2
---- commands/i386/pc/play.c    3 Dec 2005 16:18:27 -0000       1.1
-+++ commands/i386/pc/play.c    4 Jun 2006 15:56:54 -0000       1.2
-@@ -27,6 +27,7 @@
- #include <grub/disk.h>
- #include <grub/term.h>
- #include <grub/misc.h>
-+#include <grub/machine/time.h>
- #define BASE_TEMPO 120
-Index: conf/common.mk
-===================================================================
-RCS file: /cvsroot/grub/grub2/conf/common.mk,v
-retrieving revision 1.6
-retrieving revision 1.15
-diff -u -r1.6 -r1.15
---- conf/common.mk     25 Dec 2005 15:59:50 -0000      1.6
-+++ conf/common.mk     2 Jun 2006 19:33:58 -0000       1.15
-@@ -6,16 +6,16 @@
- DISTCLEANFILES += grub_script.tab.c grub_script.tab.h
- # For grub-emu.
--grub_modules_init.lst: geninit.sh
--      (cd $(srcdir); find . -name '*.c' -printf "%P\n" | xargs grep GRUB_MOD_INIT) > $@
-+grub_modules_init.lst: geninit.sh $(filter-out grub_emu_init.c,$(grub_emu_SOURCES))
-+      rm -f $@; grep GRUB_MOD_INIT $(filter %.c,$^) /dev/null > $@
- DISTCLEANFILES += grub_modules_init.lst
- grub_modules_init.h: $(filter-out grub_emu_init.c,$(grub_emu_SOURCES)) geninitheader.sh grub_modules_init.lst
--      sh $(srcdir)/geninitheader.sh > $@
-+      rm -f $@; sh $(srcdir)/geninitheader.sh > $@
- DISTCLEANFILES += grub_modules_init.h
- grub_emu_init.c: $(filter-out grub_emu_init.c,$(grub_emu_SOURCES)) geninit.sh grub_modules_init.lst grub_modules_init.h
--      sh $(srcdir)/geninit.sh $(filter %.c,$^) > $@
-+      rm -f $@; sh $(srcdir)/geninit.sh $(filter %.c,$^) > $@
- DISTCLEANFILES += grub_emu_init.c
-@@ -26,38 +26,43 @@
- # For fshelp.mod.
- fshelp_mod_SOURCES = fs/fshelp.c
--CLEANFILES += fshelp.mod mod-fshelp.o mod-fshelp.c pre-fshelp.o fshelp_mod-fs_fshelp.o def-fshelp.lst und-fshelp.lst
--MOSTLYCLEANFILES += fshelp_mod-fs_fshelp.d
-+CLEANFILES += fshelp.mod mod-fshelp.o mod-fshelp.c pre-fshelp.o fshelp_mod-fs_fshelp.o und-fshelp.lst
-+ifneq ($(fshelp_mod_EXPORTS),no)
-+CLEANFILES += def-fshelp.lst
- DEFSYMFILES += def-fshelp.lst
-+endif
-+MOSTLYCLEANFILES += fshelp_mod-fs_fshelp.d
- UNDSYMFILES += und-fshelp.lst
- fshelp.mod: pre-fshelp.o mod-fshelp.o
-       -rm -f $@
--      $(LD) $(fshelp_mod_LDFLAGS) $(LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(fshelp_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
-       $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
- pre-fshelp.o: fshelp_mod-fs_fshelp.o
-       -rm -f $@
--      $(LD) $(fshelp_mod_LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(fshelp_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
- mod-fshelp.o: mod-fshelp.c
--      $(CC) $(CPPFLAGS) $(CFLAGS) $(fshelp_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fshelp_mod_CFLAGS) -c -o $@ $<
- mod-fshelp.c: moddep.lst genmodsrc.sh
-       sh $(srcdir)/genmodsrc.sh 'fshelp' $< > $@ || (rm -f $@; exit 1)
-+ifneq ($(fshelp_mod_EXPORTS),no)
- def-fshelp.lst: pre-fshelp.o
-       $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 fshelp/' > $@
-+endif
- und-fshelp.lst: pre-fshelp.o
-       echo 'fshelp' > $@
-       $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
- fshelp_mod-fs_fshelp.o: fs/fshelp.c
--      $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(fshelp_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fshelp_mod_CFLAGS) -c -o $@ $<
- fshelp_mod-fs_fshelp.d: fs/fshelp.c
--      set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(fshelp_mod_CFLAGS) -M $<      | sed 's,fshelp\.o[ :]*,fshelp_mod-fs_fshelp.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fshelp_mod_CFLAGS) -M $<         | sed 's,fshelp\.o[ :]*,fshelp_mod-fs_fshelp.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
- -include fshelp_mod-fs_fshelp.d
-@@ -66,10 +71,10 @@
- FSFILES += fs-fshelp_mod-fs_fshelp.lst
- cmd-fshelp_mod-fs_fshelp.lst: fs/fshelp.c gencmdlist.sh
--      set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(fshelp_mod_CFLAGS) -E $<      | sh $(srcdir)/gencmdlist.sh fshelp > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fshelp_mod_CFLAGS) -E $<         | sh $(srcdir)/gencmdlist.sh fshelp > $@ || (rm -f $@; exit 1)
- fs-fshelp_mod-fs_fshelp.lst: fs/fshelp.c genfslist.sh
--      set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(fshelp_mod_CFLAGS) -E $<      | sh $(srcdir)/genfslist.sh fshelp > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fshelp_mod_CFLAGS) -E $<         | sh $(srcdir)/genfslist.sh fshelp > $@ || (rm -f $@; exit 1)
- fshelp_mod_CFLAGS = $(COMMON_CFLAGS)
-@@ -77,38 +82,43 @@
- # For fat.mod.
- fat_mod_SOURCES = fs/fat.c
--CLEANFILES += fat.mod mod-fat.o mod-fat.c pre-fat.o fat_mod-fs_fat.o def-fat.lst und-fat.lst
--MOSTLYCLEANFILES += fat_mod-fs_fat.d
-+CLEANFILES += fat.mod mod-fat.o mod-fat.c pre-fat.o fat_mod-fs_fat.o und-fat.lst
-+ifneq ($(fat_mod_EXPORTS),no)
-+CLEANFILES += def-fat.lst
- DEFSYMFILES += def-fat.lst
-+endif
-+MOSTLYCLEANFILES += fat_mod-fs_fat.d
- UNDSYMFILES += und-fat.lst
- fat.mod: pre-fat.o mod-fat.o
-       -rm -f $@
--      $(LD) $(fat_mod_LDFLAGS) $(LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(fat_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
-       $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
- pre-fat.o: fat_mod-fs_fat.o
-       -rm -f $@
--      $(LD) $(fat_mod_LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(fat_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
- mod-fat.o: mod-fat.c
--      $(CC) $(CPPFLAGS) $(CFLAGS) $(fat_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fat_mod_CFLAGS) -c -o $@ $<
- mod-fat.c: moddep.lst genmodsrc.sh
-       sh $(srcdir)/genmodsrc.sh 'fat' $< > $@ || (rm -f $@; exit 1)
-+ifneq ($(fat_mod_EXPORTS),no)
- def-fat.lst: pre-fat.o
-       $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 fat/' > $@
-+endif
- und-fat.lst: pre-fat.o
-       echo 'fat' > $@
-       $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
- fat_mod-fs_fat.o: fs/fat.c
--      $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(fat_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fat_mod_CFLAGS) -c -o $@ $<
- fat_mod-fs_fat.d: fs/fat.c
--      set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(fat_mod_CFLAGS) -M $<         | sed 's,fat\.o[ :]*,fat_mod-fs_fat.o $@ : ,g' > $@;    [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fat_mod_CFLAGS) -M $<    | sed 's,fat\.o[ :]*,fat_mod-fs_fat.o $@ : ,g' > $@;    [ -s $@ ] || rm -f $@
- -include fat_mod-fs_fat.d
-@@ -117,10 +127,10 @@
- FSFILES += fs-fat_mod-fs_fat.lst
- cmd-fat_mod-fs_fat.lst: fs/fat.c gencmdlist.sh
--      set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(fat_mod_CFLAGS) -E $<         | sh $(srcdir)/gencmdlist.sh fat > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fat_mod_CFLAGS) -E $<    | sh $(srcdir)/gencmdlist.sh fat > $@ || (rm -f $@; exit 1)
- fs-fat_mod-fs_fat.lst: fs/fat.c genfslist.sh
--      set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(fat_mod_CFLAGS) -E $<         | sh $(srcdir)/genfslist.sh fat > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fat_mod_CFLAGS) -E $<    | sh $(srcdir)/genfslist.sh fat > $@ || (rm -f $@; exit 1)
- fat_mod_CFLAGS = $(COMMON_CFLAGS)
-@@ -128,38 +138,43 @@
- # For ufs.mod.
- ufs_mod_SOURCES = fs/ufs.c
--CLEANFILES += ufs.mod mod-ufs.o mod-ufs.c pre-ufs.o ufs_mod-fs_ufs.o def-ufs.lst und-ufs.lst
--MOSTLYCLEANFILES += ufs_mod-fs_ufs.d
-+CLEANFILES += ufs.mod mod-ufs.o mod-ufs.c pre-ufs.o ufs_mod-fs_ufs.o und-ufs.lst
-+ifneq ($(ufs_mod_EXPORTS),no)
-+CLEANFILES += def-ufs.lst
- DEFSYMFILES += def-ufs.lst
-+endif
-+MOSTLYCLEANFILES += ufs_mod-fs_ufs.d
- UNDSYMFILES += und-ufs.lst
- ufs.mod: pre-ufs.o mod-ufs.o
-       -rm -f $@
--      $(LD) $(ufs_mod_LDFLAGS) $(LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(ufs_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
-       $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
- pre-ufs.o: ufs_mod-fs_ufs.o
-       -rm -f $@
--      $(LD) $(ufs_mod_LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(ufs_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
- mod-ufs.o: mod-ufs.c
--      $(CC) $(CPPFLAGS) $(CFLAGS) $(ufs_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ufs_mod_CFLAGS) -c -o $@ $<
- mod-ufs.c: moddep.lst genmodsrc.sh
-       sh $(srcdir)/genmodsrc.sh 'ufs' $< > $@ || (rm -f $@; exit 1)
-+ifneq ($(ufs_mod_EXPORTS),no)
- def-ufs.lst: pre-ufs.o
-       $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 ufs/' > $@
-+endif
- und-ufs.lst: pre-ufs.o
-       echo 'ufs' > $@
-       $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
- ufs_mod-fs_ufs.o: fs/ufs.c
--      $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(ufs_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ufs_mod_CFLAGS) -c -o $@ $<
- ufs_mod-fs_ufs.d: fs/ufs.c
--      set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(ufs_mod_CFLAGS) -M $<         | sed 's,ufs\.o[ :]*,ufs_mod-fs_ufs.o $@ : ,g' > $@;    [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ufs_mod_CFLAGS) -M $<    | sed 's,ufs\.o[ :]*,ufs_mod-fs_ufs.o $@ : ,g' > $@;    [ -s $@ ] || rm -f $@
- -include ufs_mod-fs_ufs.d
-@@ -168,10 +183,10 @@
- FSFILES += fs-ufs_mod-fs_ufs.lst
- cmd-ufs_mod-fs_ufs.lst: fs/ufs.c gencmdlist.sh
--      set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(ufs_mod_CFLAGS) -E $<         | sh $(srcdir)/gencmdlist.sh ufs > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ufs_mod_CFLAGS) -E $<    | sh $(srcdir)/gencmdlist.sh ufs > $@ || (rm -f $@; exit 1)
- fs-ufs_mod-fs_ufs.lst: fs/ufs.c genfslist.sh
--      set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(ufs_mod_CFLAGS) -E $<         | sh $(srcdir)/genfslist.sh ufs > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ufs_mod_CFLAGS) -E $<    | sh $(srcdir)/genfslist.sh ufs > $@ || (rm -f $@; exit 1)
- ufs_mod_CFLAGS = $(COMMON_CFLAGS)
-@@ -179,38 +194,43 @@
- # For ext2.mod.
- ext2_mod_SOURCES = fs/ext2.c
--CLEANFILES += ext2.mod mod-ext2.o mod-ext2.c pre-ext2.o ext2_mod-fs_ext2.o def-ext2.lst und-ext2.lst
--MOSTLYCLEANFILES += ext2_mod-fs_ext2.d
-+CLEANFILES += ext2.mod mod-ext2.o mod-ext2.c pre-ext2.o ext2_mod-fs_ext2.o und-ext2.lst
-+ifneq ($(ext2_mod_EXPORTS),no)
-+CLEANFILES += def-ext2.lst
- DEFSYMFILES += def-ext2.lst
-+endif
-+MOSTLYCLEANFILES += ext2_mod-fs_ext2.d
- UNDSYMFILES += und-ext2.lst
- ext2.mod: pre-ext2.o mod-ext2.o
-       -rm -f $@
--      $(LD) $(ext2_mod_LDFLAGS) $(LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(ext2_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
-       $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
- pre-ext2.o: ext2_mod-fs_ext2.o
-       -rm -f $@
--      $(LD) $(ext2_mod_LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(ext2_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
- mod-ext2.o: mod-ext2.c
--      $(CC) $(CPPFLAGS) $(CFLAGS) $(ext2_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ext2_mod_CFLAGS) -c -o $@ $<
- mod-ext2.c: moddep.lst genmodsrc.sh
-       sh $(srcdir)/genmodsrc.sh 'ext2' $< > $@ || (rm -f $@; exit 1)
-+ifneq ($(ext2_mod_EXPORTS),no)
- def-ext2.lst: pre-ext2.o
-       $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 ext2/' > $@
-+endif
- und-ext2.lst: pre-ext2.o
-       echo 'ext2' > $@
-       $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
- ext2_mod-fs_ext2.o: fs/ext2.c
--      $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(ext2_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ext2_mod_CFLAGS) -c -o $@ $<
- ext2_mod-fs_ext2.d: fs/ext2.c
--      set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(ext2_mod_CFLAGS) -M $<        | sed 's,ext2\.o[ :]*,ext2_mod-fs_ext2.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ext2_mod_CFLAGS) -M $<           | sed 's,ext2\.o[ :]*,ext2_mod-fs_ext2.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
- -include ext2_mod-fs_ext2.d
-@@ -219,10 +239,10 @@
- FSFILES += fs-ext2_mod-fs_ext2.lst
- cmd-ext2_mod-fs_ext2.lst: fs/ext2.c gencmdlist.sh
--      set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(ext2_mod_CFLAGS) -E $<        | sh $(srcdir)/gencmdlist.sh ext2 > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ext2_mod_CFLAGS) -E $<           | sh $(srcdir)/gencmdlist.sh ext2 > $@ || (rm -f $@; exit 1)
- fs-ext2_mod-fs_ext2.lst: fs/ext2.c genfslist.sh
--      set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(ext2_mod_CFLAGS) -E $<        | sh $(srcdir)/genfslist.sh ext2 > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ext2_mod_CFLAGS) -E $<           | sh $(srcdir)/genfslist.sh ext2 > $@ || (rm -f $@; exit 1)
- ext2_mod_CFLAGS = $(COMMON_CFLAGS)
-@@ -230,38 +250,43 @@
- # For minix.mod.
- minix_mod_SOURCES = fs/minix.c
--CLEANFILES += minix.mod mod-minix.o mod-minix.c pre-minix.o minix_mod-fs_minix.o def-minix.lst und-minix.lst
--MOSTLYCLEANFILES += minix_mod-fs_minix.d
-+CLEANFILES += minix.mod mod-minix.o mod-minix.c pre-minix.o minix_mod-fs_minix.o und-minix.lst
-+ifneq ($(minix_mod_EXPORTS),no)
-+CLEANFILES += def-minix.lst
- DEFSYMFILES += def-minix.lst
-+endif
-+MOSTLYCLEANFILES += minix_mod-fs_minix.d
- UNDSYMFILES += und-minix.lst
- minix.mod: pre-minix.o mod-minix.o
-       -rm -f $@
--      $(LD) $(minix_mod_LDFLAGS) $(LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(minix_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
-       $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
- pre-minix.o: minix_mod-fs_minix.o
-       -rm -f $@
--      $(LD) $(minix_mod_LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(minix_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
- mod-minix.o: mod-minix.c
--      $(CC) $(CPPFLAGS) $(CFLAGS) $(minix_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(minix_mod_CFLAGS) -c -o $@ $<
- mod-minix.c: moddep.lst genmodsrc.sh
-       sh $(srcdir)/genmodsrc.sh 'minix' $< > $@ || (rm -f $@; exit 1)
-+ifneq ($(minix_mod_EXPORTS),no)
- def-minix.lst: pre-minix.o
-       $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 minix/' > $@
-+endif
- und-minix.lst: pre-minix.o
-       echo 'minix' > $@
-       $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
- minix_mod-fs_minix.o: fs/minix.c
--      $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(minix_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(minix_mod_CFLAGS) -c -o $@ $<
- minix_mod-fs_minix.d: fs/minix.c
--      set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(minix_mod_CFLAGS) -M $<       | sed 's,minix\.o[ :]*,minix_mod-fs_minix.o $@ : ,g' > $@;      [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(minix_mod_CFLAGS) -M $<          | sed 's,minix\.o[ :]*,minix_mod-fs_minix.o $@ : ,g' > $@;      [ -s $@ ] || rm -f $@
- -include minix_mod-fs_minix.d
-@@ -270,10 +295,10 @@
- FSFILES += fs-minix_mod-fs_minix.lst
- cmd-minix_mod-fs_minix.lst: fs/minix.c gencmdlist.sh
--      set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(minix_mod_CFLAGS) -E $<       | sh $(srcdir)/gencmdlist.sh minix > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(minix_mod_CFLAGS) -E $<          | sh $(srcdir)/gencmdlist.sh minix > $@ || (rm -f $@; exit 1)
- fs-minix_mod-fs_minix.lst: fs/minix.c genfslist.sh
--      set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(minix_mod_CFLAGS) -E $<       | sh $(srcdir)/genfslist.sh minix > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(minix_mod_CFLAGS) -E $<          | sh $(srcdir)/genfslist.sh minix > $@ || (rm -f $@; exit 1)
- minix_mod_CFLAGS = $(COMMON_CFLAGS)
-@@ -281,38 +306,43 @@
- # For hfs.mod.
- hfs_mod_SOURCES = fs/hfs.c
--CLEANFILES += hfs.mod mod-hfs.o mod-hfs.c pre-hfs.o hfs_mod-fs_hfs.o def-hfs.lst und-hfs.lst
--MOSTLYCLEANFILES += hfs_mod-fs_hfs.d
-+CLEANFILES += hfs.mod mod-hfs.o mod-hfs.c pre-hfs.o hfs_mod-fs_hfs.o und-hfs.lst
-+ifneq ($(hfs_mod_EXPORTS),no)
-+CLEANFILES += def-hfs.lst
- DEFSYMFILES += def-hfs.lst
-+endif
-+MOSTLYCLEANFILES += hfs_mod-fs_hfs.d
- UNDSYMFILES += und-hfs.lst
- hfs.mod: pre-hfs.o mod-hfs.o
-       -rm -f $@
--      $(LD) $(hfs_mod_LDFLAGS) $(LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(hfs_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
-       $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
- pre-hfs.o: hfs_mod-fs_hfs.o
-       -rm -f $@
--      $(LD) $(hfs_mod_LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(hfs_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
- mod-hfs.o: mod-hfs.c
--      $(CC) $(CPPFLAGS) $(CFLAGS) $(hfs_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hfs_mod_CFLAGS) -c -o $@ $<
- mod-hfs.c: moddep.lst genmodsrc.sh
-       sh $(srcdir)/genmodsrc.sh 'hfs' $< > $@ || (rm -f $@; exit 1)
-+ifneq ($(hfs_mod_EXPORTS),no)
- def-hfs.lst: pre-hfs.o
-       $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 hfs/' > $@
-+endif
- und-hfs.lst: pre-hfs.o
-       echo 'hfs' > $@
-       $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
- hfs_mod-fs_hfs.o: fs/hfs.c
--      $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(hfs_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hfs_mod_CFLAGS) -c -o $@ $<
- hfs_mod-fs_hfs.d: fs/hfs.c
--      set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(hfs_mod_CFLAGS) -M $<         | sed 's,hfs\.o[ :]*,hfs_mod-fs_hfs.o $@ : ,g' > $@;    [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hfs_mod_CFLAGS) -M $<    | sed 's,hfs\.o[ :]*,hfs_mod-fs_hfs.o $@ : ,g' > $@;    [ -s $@ ] || rm -f $@
- -include hfs_mod-fs_hfs.d
-@@ -321,10 +351,10 @@
- FSFILES += fs-hfs_mod-fs_hfs.lst
- cmd-hfs_mod-fs_hfs.lst: fs/hfs.c gencmdlist.sh
--      set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(hfs_mod_CFLAGS) -E $<         | sh $(srcdir)/gencmdlist.sh hfs > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hfs_mod_CFLAGS) -E $<    | sh $(srcdir)/gencmdlist.sh hfs > $@ || (rm -f $@; exit 1)
- fs-hfs_mod-fs_hfs.lst: fs/hfs.c genfslist.sh
--      set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(hfs_mod_CFLAGS) -E $<         | sh $(srcdir)/genfslist.sh hfs > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hfs_mod_CFLAGS) -E $<    | sh $(srcdir)/genfslist.sh hfs > $@ || (rm -f $@; exit 1)
- hfs_mod_CFLAGS = $(COMMON_CFLAGS)
-@@ -332,38 +362,43 @@
- # For jfs.mod.
- jfs_mod_SOURCES = fs/jfs.c
--CLEANFILES += jfs.mod mod-jfs.o mod-jfs.c pre-jfs.o jfs_mod-fs_jfs.o def-jfs.lst und-jfs.lst
--MOSTLYCLEANFILES += jfs_mod-fs_jfs.d
-+CLEANFILES += jfs.mod mod-jfs.o mod-jfs.c pre-jfs.o jfs_mod-fs_jfs.o und-jfs.lst
-+ifneq ($(jfs_mod_EXPORTS),no)
-+CLEANFILES += def-jfs.lst
- DEFSYMFILES += def-jfs.lst
-+endif
-+MOSTLYCLEANFILES += jfs_mod-fs_jfs.d
- UNDSYMFILES += und-jfs.lst
- jfs.mod: pre-jfs.o mod-jfs.o
-       -rm -f $@
--      $(LD) $(jfs_mod_LDFLAGS) $(LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(jfs_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
-       $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
- pre-jfs.o: jfs_mod-fs_jfs.o
-       -rm -f $@
--      $(LD) $(jfs_mod_LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(jfs_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
- mod-jfs.o: mod-jfs.c
--      $(CC) $(CPPFLAGS) $(CFLAGS) $(jfs_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(jfs_mod_CFLAGS) -c -o $@ $<
- mod-jfs.c: moddep.lst genmodsrc.sh
-       sh $(srcdir)/genmodsrc.sh 'jfs' $< > $@ || (rm -f $@; exit 1)
-+ifneq ($(jfs_mod_EXPORTS),no)
- def-jfs.lst: pre-jfs.o
-       $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 jfs/' > $@
-+endif
- und-jfs.lst: pre-jfs.o
-       echo 'jfs' > $@
-       $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
- jfs_mod-fs_jfs.o: fs/jfs.c
--      $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(jfs_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(jfs_mod_CFLAGS) -c -o $@ $<
- jfs_mod-fs_jfs.d: fs/jfs.c
--      set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(jfs_mod_CFLAGS) -M $<         | sed 's,jfs\.o[ :]*,jfs_mod-fs_jfs.o $@ : ,g' > $@;    [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(jfs_mod_CFLAGS) -M $<    | sed 's,jfs\.o[ :]*,jfs_mod-fs_jfs.o $@ : ,g' > $@;    [ -s $@ ] || rm -f $@
- -include jfs_mod-fs_jfs.d
-@@ -372,10 +407,10 @@
- FSFILES += fs-jfs_mod-fs_jfs.lst
- cmd-jfs_mod-fs_jfs.lst: fs/jfs.c gencmdlist.sh
--      set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(jfs_mod_CFLAGS) -E $<         | sh $(srcdir)/gencmdlist.sh jfs > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(jfs_mod_CFLAGS) -E $<    | sh $(srcdir)/gencmdlist.sh jfs > $@ || (rm -f $@; exit 1)
- fs-jfs_mod-fs_jfs.lst: fs/jfs.c genfslist.sh
--      set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(jfs_mod_CFLAGS) -E $<         | sh $(srcdir)/genfslist.sh jfs > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(jfs_mod_CFLAGS) -E $<    | sh $(srcdir)/genfslist.sh jfs > $@ || (rm -f $@; exit 1)
- jfs_mod_CFLAGS = $(COMMON_CFLAGS)
-@@ -383,38 +418,43 @@
- # For iso9660.mod.
- iso9660_mod_SOURCES = fs/iso9660.c
--CLEANFILES += iso9660.mod mod-iso9660.o mod-iso9660.c pre-iso9660.o iso9660_mod-fs_iso9660.o def-iso9660.lst und-iso9660.lst
--MOSTLYCLEANFILES += iso9660_mod-fs_iso9660.d
-+CLEANFILES += iso9660.mod mod-iso9660.o mod-iso9660.c pre-iso9660.o iso9660_mod-fs_iso9660.o und-iso9660.lst
-+ifneq ($(iso9660_mod_EXPORTS),no)
-+CLEANFILES += def-iso9660.lst
- DEFSYMFILES += def-iso9660.lst
-+endif
-+MOSTLYCLEANFILES += iso9660_mod-fs_iso9660.d
- UNDSYMFILES += und-iso9660.lst
- iso9660.mod: pre-iso9660.o mod-iso9660.o
-       -rm -f $@
--      $(LD) $(iso9660_mod_LDFLAGS) $(LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(iso9660_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
-       $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
- pre-iso9660.o: iso9660_mod-fs_iso9660.o
-       -rm -f $@
--      $(LD) $(iso9660_mod_LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(iso9660_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
- mod-iso9660.o: mod-iso9660.c
--      $(CC) $(CPPFLAGS) $(CFLAGS) $(iso9660_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(iso9660_mod_CFLAGS) -c -o $@ $<
- mod-iso9660.c: moddep.lst genmodsrc.sh
-       sh $(srcdir)/genmodsrc.sh 'iso9660' $< > $@ || (rm -f $@; exit 1)
-+ifneq ($(iso9660_mod_EXPORTS),no)
- def-iso9660.lst: pre-iso9660.o
-       $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 iso9660/' > $@
-+endif
- und-iso9660.lst: pre-iso9660.o
-       echo 'iso9660' > $@
-       $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
- iso9660_mod-fs_iso9660.o: fs/iso9660.c
--      $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(iso9660_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(iso9660_mod_CFLAGS) -c -o $@ $<
- iso9660_mod-fs_iso9660.d: fs/iso9660.c
--      set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(iso9660_mod_CFLAGS) -M $<     | sed 's,iso9660\.o[ :]*,iso9660_mod-fs_iso9660.o $@ : ,g' > $@;        [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(iso9660_mod_CFLAGS) -M $<        | sed 's,iso9660\.o[ :]*,iso9660_mod-fs_iso9660.o $@ : ,g' > $@;        [ -s $@ ] || rm -f $@
- -include iso9660_mod-fs_iso9660.d
-@@ -423,10 +463,10 @@
- FSFILES += fs-iso9660_mod-fs_iso9660.lst
- cmd-iso9660_mod-fs_iso9660.lst: fs/iso9660.c gencmdlist.sh
--      set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(iso9660_mod_CFLAGS) -E $<     | sh $(srcdir)/gencmdlist.sh iso9660 > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(iso9660_mod_CFLAGS) -E $<        | sh $(srcdir)/gencmdlist.sh iso9660 > $@ || (rm -f $@; exit 1)
- fs-iso9660_mod-fs_iso9660.lst: fs/iso9660.c genfslist.sh
--      set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(iso9660_mod_CFLAGS) -E $<     | sh $(srcdir)/genfslist.sh iso9660 > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(iso9660_mod_CFLAGS) -E $<        | sh $(srcdir)/genfslist.sh iso9660 > $@ || (rm -f $@; exit 1)
- iso9660_mod_CFLAGS = $(COMMON_CFLAGS)
-@@ -434,38 +474,43 @@
- # For xfs.mod.
- xfs_mod_SOURCES = fs/xfs.c
--CLEANFILES += xfs.mod mod-xfs.o mod-xfs.c pre-xfs.o xfs_mod-fs_xfs.o def-xfs.lst und-xfs.lst
--MOSTLYCLEANFILES += xfs_mod-fs_xfs.d
-+CLEANFILES += xfs.mod mod-xfs.o mod-xfs.c pre-xfs.o xfs_mod-fs_xfs.o und-xfs.lst
-+ifneq ($(xfs_mod_EXPORTS),no)
-+CLEANFILES += def-xfs.lst
- DEFSYMFILES += def-xfs.lst
-+endif
-+MOSTLYCLEANFILES += xfs_mod-fs_xfs.d
- UNDSYMFILES += und-xfs.lst
- xfs.mod: pre-xfs.o mod-xfs.o
-       -rm -f $@
--      $(LD) $(xfs_mod_LDFLAGS) $(LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(xfs_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
-       $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
- pre-xfs.o: xfs_mod-fs_xfs.o
-       -rm -f $@
--      $(LD) $(xfs_mod_LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(xfs_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
- mod-xfs.o: mod-xfs.c
--      $(CC) $(CPPFLAGS) $(CFLAGS) $(xfs_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(xfs_mod_CFLAGS) -c -o $@ $<
- mod-xfs.c: moddep.lst genmodsrc.sh
-       sh $(srcdir)/genmodsrc.sh 'xfs' $< > $@ || (rm -f $@; exit 1)
-+ifneq ($(xfs_mod_EXPORTS),no)
- def-xfs.lst: pre-xfs.o
-       $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 xfs/' > $@
-+endif
- und-xfs.lst: pre-xfs.o
-       echo 'xfs' > $@
-       $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
- xfs_mod-fs_xfs.o: fs/xfs.c
--      $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(xfs_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(xfs_mod_CFLAGS) -c -o $@ $<
- xfs_mod-fs_xfs.d: fs/xfs.c
--      set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(xfs_mod_CFLAGS) -M $<         | sed 's,xfs\.o[ :]*,xfs_mod-fs_xfs.o $@ : ,g' > $@;    [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(xfs_mod_CFLAGS) -M $<    | sed 's,xfs\.o[ :]*,xfs_mod-fs_xfs.o $@ : ,g' > $@;    [ -s $@ ] || rm -f $@
- -include xfs_mod-fs_xfs.d
-@@ -474,10 +519,10 @@
- FSFILES += fs-xfs_mod-fs_xfs.lst
- cmd-xfs_mod-fs_xfs.lst: fs/xfs.c gencmdlist.sh
--      set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(xfs_mod_CFLAGS) -E $<         | sh $(srcdir)/gencmdlist.sh xfs > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(xfs_mod_CFLAGS) -E $<    | sh $(srcdir)/gencmdlist.sh xfs > $@ || (rm -f $@; exit 1)
- fs-xfs_mod-fs_xfs.lst: fs/xfs.c genfslist.sh
--      set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(xfs_mod_CFLAGS) -E $<         | sh $(srcdir)/genfslist.sh xfs > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(xfs_mod_CFLAGS) -E $<    | sh $(srcdir)/genfslist.sh xfs > $@ || (rm -f $@; exit 1)
- xfs_mod_CFLAGS = $(COMMON_CFLAGS)
-@@ -485,38 +530,43 @@
- # For affs.mod.
- affs_mod_SOURCES = fs/affs.c
--CLEANFILES += affs.mod mod-affs.o mod-affs.c pre-affs.o affs_mod-fs_affs.o def-affs.lst und-affs.lst
--MOSTLYCLEANFILES += affs_mod-fs_affs.d
-+CLEANFILES += affs.mod mod-affs.o mod-affs.c pre-affs.o affs_mod-fs_affs.o und-affs.lst
-+ifneq ($(affs_mod_EXPORTS),no)
-+CLEANFILES += def-affs.lst
- DEFSYMFILES += def-affs.lst
-+endif
-+MOSTLYCLEANFILES += affs_mod-fs_affs.d
- UNDSYMFILES += und-affs.lst
- affs.mod: pre-affs.o mod-affs.o
-       -rm -f $@
--      $(LD) $(affs_mod_LDFLAGS) $(LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(affs_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
-       $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
- pre-affs.o: affs_mod-fs_affs.o
-       -rm -f $@
--      $(LD) $(affs_mod_LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(affs_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
- mod-affs.o: mod-affs.c
--      $(CC) $(CPPFLAGS) $(CFLAGS) $(affs_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(affs_mod_CFLAGS) -c -o $@ $<
- mod-affs.c: moddep.lst genmodsrc.sh
-       sh $(srcdir)/genmodsrc.sh 'affs' $< > $@ || (rm -f $@; exit 1)
-+ifneq ($(affs_mod_EXPORTS),no)
- def-affs.lst: pre-affs.o
-       $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 affs/' > $@
-+endif
- und-affs.lst: pre-affs.o
-       echo 'affs' > $@
-       $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
- affs_mod-fs_affs.o: fs/affs.c
--      $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(affs_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(affs_mod_CFLAGS) -c -o $@ $<
- affs_mod-fs_affs.d: fs/affs.c
--      set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(affs_mod_CFLAGS) -M $<        | sed 's,affs\.o[ :]*,affs_mod-fs_affs.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(affs_mod_CFLAGS) -M $<           | sed 's,affs\.o[ :]*,affs_mod-fs_affs.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
- -include affs_mod-fs_affs.d
-@@ -525,10 +575,10 @@
- FSFILES += fs-affs_mod-fs_affs.lst
- cmd-affs_mod-fs_affs.lst: fs/affs.c gencmdlist.sh
--      set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(affs_mod_CFLAGS) -E $<        | sh $(srcdir)/gencmdlist.sh affs > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(affs_mod_CFLAGS) -E $<           | sh $(srcdir)/gencmdlist.sh affs > $@ || (rm -f $@; exit 1)
- fs-affs_mod-fs_affs.lst: fs/affs.c genfslist.sh
--      set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(affs_mod_CFLAGS) -E $<        | sh $(srcdir)/genfslist.sh affs > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(affs_mod_CFLAGS) -E $<           | sh $(srcdir)/genfslist.sh affs > $@ || (rm -f $@; exit 1)
- affs_mod_CFLAGS = $(COMMON_CFLAGS)
-@@ -536,38 +586,43 @@
- # For sfs.mod.
- sfs_mod_SOURCES = fs/sfs.c
--CLEANFILES += sfs.mod mod-sfs.o mod-sfs.c pre-sfs.o sfs_mod-fs_sfs.o def-sfs.lst und-sfs.lst
--MOSTLYCLEANFILES += sfs_mod-fs_sfs.d
-+CLEANFILES += sfs.mod mod-sfs.o mod-sfs.c pre-sfs.o sfs_mod-fs_sfs.o und-sfs.lst
-+ifneq ($(sfs_mod_EXPORTS),no)
-+CLEANFILES += def-sfs.lst
- DEFSYMFILES += def-sfs.lst
-+endif
-+MOSTLYCLEANFILES += sfs_mod-fs_sfs.d
- UNDSYMFILES += und-sfs.lst
- sfs.mod: pre-sfs.o mod-sfs.o
-       -rm -f $@
--      $(LD) $(sfs_mod_LDFLAGS) $(LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(sfs_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
-       $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
- pre-sfs.o: sfs_mod-fs_sfs.o
-       -rm -f $@
--      $(LD) $(sfs_mod_LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(sfs_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
- mod-sfs.o: mod-sfs.c
--      $(CC) $(CPPFLAGS) $(CFLAGS) $(sfs_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sfs_mod_CFLAGS) -c -o $@ $<
- mod-sfs.c: moddep.lst genmodsrc.sh
-       sh $(srcdir)/genmodsrc.sh 'sfs' $< > $@ || (rm -f $@; exit 1)
-+ifneq ($(sfs_mod_EXPORTS),no)
- def-sfs.lst: pre-sfs.o
-       $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 sfs/' > $@
-+endif
- und-sfs.lst: pre-sfs.o
-       echo 'sfs' > $@
-       $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
- sfs_mod-fs_sfs.o: fs/sfs.c
--      $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(sfs_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sfs_mod_CFLAGS) -c -o $@ $<
- sfs_mod-fs_sfs.d: fs/sfs.c
--      set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(sfs_mod_CFLAGS) -M $<         | sed 's,sfs\.o[ :]*,sfs_mod-fs_sfs.o $@ : ,g' > $@;    [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sfs_mod_CFLAGS) -M $<    | sed 's,sfs\.o[ :]*,sfs_mod-fs_sfs.o $@ : ,g' > $@;    [ -s $@ ] || rm -f $@
- -include sfs_mod-fs_sfs.d
-@@ -576,10 +631,10 @@
- FSFILES += fs-sfs_mod-fs_sfs.lst
- cmd-sfs_mod-fs_sfs.lst: fs/sfs.c gencmdlist.sh
--      set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(sfs_mod_CFLAGS) -E $<         | sh $(srcdir)/gencmdlist.sh sfs > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sfs_mod_CFLAGS) -E $<    | sh $(srcdir)/gencmdlist.sh sfs > $@ || (rm -f $@; exit 1)
- fs-sfs_mod-fs_sfs.lst: fs/sfs.c genfslist.sh
--      set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(sfs_mod_CFLAGS) -E $<         | sh $(srcdir)/genfslist.sh sfs > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sfs_mod_CFLAGS) -E $<    | sh $(srcdir)/genfslist.sh sfs > $@ || (rm -f $@; exit 1)
- sfs_mod_CFLAGS = $(COMMON_CFLAGS)
-@@ -587,38 +642,43 @@
- # For hfsplus.mod.
- hfsplus_mod_SOURCES = fs/hfsplus.c
--CLEANFILES += hfsplus.mod mod-hfsplus.o mod-hfsplus.c pre-hfsplus.o hfsplus_mod-fs_hfsplus.o def-hfsplus.lst und-hfsplus.lst
--MOSTLYCLEANFILES += hfsplus_mod-fs_hfsplus.d
-+CLEANFILES += hfsplus.mod mod-hfsplus.o mod-hfsplus.c pre-hfsplus.o hfsplus_mod-fs_hfsplus.o und-hfsplus.lst
-+ifneq ($(hfsplus_mod_EXPORTS),no)
-+CLEANFILES += def-hfsplus.lst
- DEFSYMFILES += def-hfsplus.lst
-+endif
-+MOSTLYCLEANFILES += hfsplus_mod-fs_hfsplus.d
- UNDSYMFILES += und-hfsplus.lst
- hfsplus.mod: pre-hfsplus.o mod-hfsplus.o
-       -rm -f $@
--      $(LD) $(hfsplus_mod_LDFLAGS) $(LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(hfsplus_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
-       $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
- pre-hfsplus.o: hfsplus_mod-fs_hfsplus.o
-       -rm -f $@
--      $(LD) $(hfsplus_mod_LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(hfsplus_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
- mod-hfsplus.o: mod-hfsplus.c
--      $(CC) $(CPPFLAGS) $(CFLAGS) $(hfsplus_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hfsplus_mod_CFLAGS) -c -o $@ $<
- mod-hfsplus.c: moddep.lst genmodsrc.sh
-       sh $(srcdir)/genmodsrc.sh 'hfsplus' $< > $@ || (rm -f $@; exit 1)
-+ifneq ($(hfsplus_mod_EXPORTS),no)
- def-hfsplus.lst: pre-hfsplus.o
-       $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 hfsplus/' > $@
-+endif
- und-hfsplus.lst: pre-hfsplus.o
-       echo 'hfsplus' > $@
-       $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
- hfsplus_mod-fs_hfsplus.o: fs/hfsplus.c
--      $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(hfsplus_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hfsplus_mod_CFLAGS) -c -o $@ $<
- hfsplus_mod-fs_hfsplus.d: fs/hfsplus.c
--      set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(hfsplus_mod_CFLAGS) -M $<     | sed 's,hfsplus\.o[ :]*,hfsplus_mod-fs_hfsplus.o $@ : ,g' > $@;        [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hfsplus_mod_CFLAGS) -M $<        | sed 's,hfsplus\.o[ :]*,hfsplus_mod-fs_hfsplus.o $@ : ,g' > $@;        [ -s $@ ] || rm -f $@
- -include hfsplus_mod-fs_hfsplus.d
-@@ -627,10 +687,10 @@
- FSFILES += fs-hfsplus_mod-fs_hfsplus.lst
- cmd-hfsplus_mod-fs_hfsplus.lst: fs/hfsplus.c gencmdlist.sh
--      set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(hfsplus_mod_CFLAGS) -E $<     | sh $(srcdir)/gencmdlist.sh hfsplus > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hfsplus_mod_CFLAGS) -E $<        | sh $(srcdir)/gencmdlist.sh hfsplus > $@ || (rm -f $@; exit 1)
- fs-hfsplus_mod-fs_hfsplus.lst: fs/hfsplus.c genfslist.sh
--      set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(hfsplus_mod_CFLAGS) -E $<     | sh $(srcdir)/genfslist.sh hfsplus > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hfsplus_mod_CFLAGS) -E $<        | sh $(srcdir)/genfslist.sh hfsplus > $@ || (rm -f $@; exit 1)
- hfsplus_mod_CFLAGS = $(COMMON_CFLAGS)
-@@ -641,38 +701,43 @@
- # For amiga.mod
- amiga_mod_SOURCES = partmap/amiga.c
--CLEANFILES += amiga.mod mod-amiga.o mod-amiga.c pre-amiga.o amiga_mod-partmap_amiga.o def-amiga.lst und-amiga.lst
--MOSTLYCLEANFILES += amiga_mod-partmap_amiga.d
-+CLEANFILES += amiga.mod mod-amiga.o mod-amiga.c pre-amiga.o amiga_mod-partmap_amiga.o und-amiga.lst
-+ifneq ($(amiga_mod_EXPORTS),no)
-+CLEANFILES += def-amiga.lst
- DEFSYMFILES += def-amiga.lst
-+endif
-+MOSTLYCLEANFILES += amiga_mod-partmap_amiga.d
- UNDSYMFILES += und-amiga.lst
- amiga.mod: pre-amiga.o mod-amiga.o
-       -rm -f $@
--      $(LD) $(amiga_mod_LDFLAGS) $(LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(amiga_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
-       $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
- pre-amiga.o: amiga_mod-partmap_amiga.o
-       -rm -f $@
--      $(LD) $(amiga_mod_LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(amiga_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
- mod-amiga.o: mod-amiga.c
--      $(CC) $(CPPFLAGS) $(CFLAGS) $(amiga_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(amiga_mod_CFLAGS) -c -o $@ $<
- mod-amiga.c: moddep.lst genmodsrc.sh
-       sh $(srcdir)/genmodsrc.sh 'amiga' $< > $@ || (rm -f $@; exit 1)
-+ifneq ($(amiga_mod_EXPORTS),no)
- def-amiga.lst: pre-amiga.o
-       $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 amiga/' > $@
-+endif
- und-amiga.lst: pre-amiga.o
-       echo 'amiga' > $@
-       $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
- amiga_mod-partmap_amiga.o: partmap/amiga.c
--      $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) $(amiga_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(amiga_mod_CFLAGS) -c -o $@ $<
- amiga_mod-partmap_amiga.d: partmap/amiga.c
--      set -e;           $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) $(amiga_mod_CFLAGS) -M $<     | sed 's,amiga\.o[ :]*,amiga_mod-partmap_amiga.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(amiga_mod_CFLAGS) -M $<        | sed 's,amiga\.o[ :]*,amiga_mod-partmap_amiga.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
- -include amiga_mod-partmap_amiga.d
-@@ -681,10 +746,10 @@
- FSFILES += fs-amiga_mod-partmap_amiga.lst
- cmd-amiga_mod-partmap_amiga.lst: partmap/amiga.c gencmdlist.sh
--      set -e;           $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) $(amiga_mod_CFLAGS) -E $<     | sh $(srcdir)/gencmdlist.sh amiga > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(amiga_mod_CFLAGS) -E $<        | sh $(srcdir)/gencmdlist.sh amiga > $@ || (rm -f $@; exit 1)
- fs-amiga_mod-partmap_amiga.lst: partmap/amiga.c genfslist.sh
--      set -e;           $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) $(amiga_mod_CFLAGS) -E $<     | sh $(srcdir)/genfslist.sh amiga > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(amiga_mod_CFLAGS) -E $<        | sh $(srcdir)/genfslist.sh amiga > $@ || (rm -f $@; exit 1)
- amiga_mod_CFLAGS = $(COMMON_CFLAGS)
-@@ -692,38 +757,43 @@
- # For apple.mod
- apple_mod_SOURCES = partmap/apple.c
--CLEANFILES += apple.mod mod-apple.o mod-apple.c pre-apple.o apple_mod-partmap_apple.o def-apple.lst und-apple.lst
--MOSTLYCLEANFILES += apple_mod-partmap_apple.d
-+CLEANFILES += apple.mod mod-apple.o mod-apple.c pre-apple.o apple_mod-partmap_apple.o und-apple.lst
-+ifneq ($(apple_mod_EXPORTS),no)
-+CLEANFILES += def-apple.lst
- DEFSYMFILES += def-apple.lst
-+endif
-+MOSTLYCLEANFILES += apple_mod-partmap_apple.d
- UNDSYMFILES += und-apple.lst
- apple.mod: pre-apple.o mod-apple.o
-       -rm -f $@
--      $(LD) $(apple_mod_LDFLAGS) $(LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(apple_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
-       $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
- pre-apple.o: apple_mod-partmap_apple.o
-       -rm -f $@
--      $(LD) $(apple_mod_LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(apple_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
- mod-apple.o: mod-apple.c
--      $(CC) $(CPPFLAGS) $(CFLAGS) $(apple_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(apple_mod_CFLAGS) -c -o $@ $<
- mod-apple.c: moddep.lst genmodsrc.sh
-       sh $(srcdir)/genmodsrc.sh 'apple' $< > $@ || (rm -f $@; exit 1)
-+ifneq ($(apple_mod_EXPORTS),no)
- def-apple.lst: pre-apple.o
-       $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 apple/' > $@
-+endif
- und-apple.lst: pre-apple.o
-       echo 'apple' > $@
-       $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
- apple_mod-partmap_apple.o: partmap/apple.c
--      $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) $(apple_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(apple_mod_CFLAGS) -c -o $@ $<
- apple_mod-partmap_apple.d: partmap/apple.c
--      set -e;           $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) $(apple_mod_CFLAGS) -M $<     | sed 's,apple\.o[ :]*,apple_mod-partmap_apple.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(apple_mod_CFLAGS) -M $<        | sed 's,apple\.o[ :]*,apple_mod-partmap_apple.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
- -include apple_mod-partmap_apple.d
-@@ -732,10 +802,10 @@
- FSFILES += fs-apple_mod-partmap_apple.lst
- cmd-apple_mod-partmap_apple.lst: partmap/apple.c gencmdlist.sh
--      set -e;           $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) $(apple_mod_CFLAGS) -E $<     | sh $(srcdir)/gencmdlist.sh apple > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(apple_mod_CFLAGS) -E $<        | sh $(srcdir)/gencmdlist.sh apple > $@ || (rm -f $@; exit 1)
- fs-apple_mod-partmap_apple.lst: partmap/apple.c genfslist.sh
--      set -e;           $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) $(apple_mod_CFLAGS) -E $<     | sh $(srcdir)/genfslist.sh apple > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(apple_mod_CFLAGS) -E $<        | sh $(srcdir)/genfslist.sh apple > $@ || (rm -f $@; exit 1)
- apple_mod_CFLAGS = $(COMMON_CFLAGS)
-@@ -743,38 +813,43 @@
- # For pc.mod
- pc_mod_SOURCES = partmap/pc.c
--CLEANFILES += pc.mod mod-pc.o mod-pc.c pre-pc.o pc_mod-partmap_pc.o def-pc.lst und-pc.lst
--MOSTLYCLEANFILES += pc_mod-partmap_pc.d
-+CLEANFILES += pc.mod mod-pc.o mod-pc.c pre-pc.o pc_mod-partmap_pc.o und-pc.lst
-+ifneq ($(pc_mod_EXPORTS),no)
-+CLEANFILES += def-pc.lst
- DEFSYMFILES += def-pc.lst
-+endif
-+MOSTLYCLEANFILES += pc_mod-partmap_pc.d
- UNDSYMFILES += und-pc.lst
- pc.mod: pre-pc.o mod-pc.o
-       -rm -f $@
--      $(LD) $(pc_mod_LDFLAGS) $(LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(pc_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
-       $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
- pre-pc.o: pc_mod-partmap_pc.o
-       -rm -f $@
--      $(LD) $(pc_mod_LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(pc_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
- mod-pc.o: mod-pc.c
--      $(CC) $(CPPFLAGS) $(CFLAGS) $(pc_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pc_mod_CFLAGS) -c -o $@ $<
- mod-pc.c: moddep.lst genmodsrc.sh
-       sh $(srcdir)/genmodsrc.sh 'pc' $< > $@ || (rm -f $@; exit 1)
-+ifneq ($(pc_mod_EXPORTS),no)
- def-pc.lst: pre-pc.o
-       $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 pc/' > $@
-+endif
- und-pc.lst: pre-pc.o
-       echo 'pc' > $@
-       $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
- pc_mod-partmap_pc.o: partmap/pc.c
--      $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) $(pc_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pc_mod_CFLAGS) -c -o $@ $<
- pc_mod-partmap_pc.d: partmap/pc.c
--      set -e;           $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) $(pc_mod_CFLAGS) -M $<        | sed 's,pc\.o[ :]*,pc_mod-partmap_pc.o $@ : ,g' > $@;          [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pc_mod_CFLAGS) -M $<           | sed 's,pc\.o[ :]*,pc_mod-partmap_pc.o $@ : ,g' > $@;          [ -s $@ ] || rm -f $@
- -include pc_mod-partmap_pc.d
-@@ -783,10 +858,10 @@
- FSFILES += fs-pc_mod-partmap_pc.lst
- cmd-pc_mod-partmap_pc.lst: partmap/pc.c gencmdlist.sh
--      set -e;           $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) $(pc_mod_CFLAGS) -E $<        | sh $(srcdir)/gencmdlist.sh pc > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pc_mod_CFLAGS) -E $<           | sh $(srcdir)/gencmdlist.sh pc > $@ || (rm -f $@; exit 1)
- fs-pc_mod-partmap_pc.lst: partmap/pc.c genfslist.sh
--      set -e;           $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) $(pc_mod_CFLAGS) -E $<        | sh $(srcdir)/genfslist.sh pc > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pc_mod_CFLAGS) -E $<           | sh $(srcdir)/genfslist.sh pc > $@ || (rm -f $@; exit 1)
- pc_mod_CFLAGS = $(COMMON_CFLAGS)
-@@ -794,38 +869,43 @@
- # For sun.mod
- sun_mod_SOURCES = partmap/sun.c
--CLEANFILES += sun.mod mod-sun.o mod-sun.c pre-sun.o sun_mod-partmap_sun.o def-sun.lst und-sun.lst
--MOSTLYCLEANFILES += sun_mod-partmap_sun.d
-+CLEANFILES += sun.mod mod-sun.o mod-sun.c pre-sun.o sun_mod-partmap_sun.o und-sun.lst
-+ifneq ($(sun_mod_EXPORTS),no)
-+CLEANFILES += def-sun.lst
- DEFSYMFILES += def-sun.lst
-+endif
-+MOSTLYCLEANFILES += sun_mod-partmap_sun.d
- UNDSYMFILES += und-sun.lst
- sun.mod: pre-sun.o mod-sun.o
-       -rm -f $@
--      $(LD) $(sun_mod_LDFLAGS) $(LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(sun_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
-       $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
- pre-sun.o: sun_mod-partmap_sun.o
-       -rm -f $@
--      $(LD) $(sun_mod_LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(sun_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
- mod-sun.o: mod-sun.c
--      $(CC) $(CPPFLAGS) $(CFLAGS) $(sun_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sun_mod_CFLAGS) -c -o $@ $<
- mod-sun.c: moddep.lst genmodsrc.sh
-       sh $(srcdir)/genmodsrc.sh 'sun' $< > $@ || (rm -f $@; exit 1)
-+ifneq ($(sun_mod_EXPORTS),no)
- def-sun.lst: pre-sun.o
-       $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 sun/' > $@
-+endif
- und-sun.lst: pre-sun.o
-       echo 'sun' > $@
-       $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
- sun_mod-partmap_sun.o: partmap/sun.c
--      $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) $(sun_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sun_mod_CFLAGS) -c -o $@ $<
- sun_mod-partmap_sun.d: partmap/sun.c
--      set -e;           $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) $(sun_mod_CFLAGS) -M $<       | sed 's,sun\.o[ :]*,sun_mod-partmap_sun.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sun_mod_CFLAGS) -M $<          | sed 's,sun\.o[ :]*,sun_mod-partmap_sun.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
- -include sun_mod-partmap_sun.d
-@@ -834,10 +914,10 @@
- FSFILES += fs-sun_mod-partmap_sun.lst
- cmd-sun_mod-partmap_sun.lst: partmap/sun.c gencmdlist.sh
--      set -e;           $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) $(sun_mod_CFLAGS) -E $<       | sh $(srcdir)/gencmdlist.sh sun > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sun_mod_CFLAGS) -E $<          | sh $(srcdir)/gencmdlist.sh sun > $@ || (rm -f $@; exit 1)
- fs-sun_mod-partmap_sun.lst: partmap/sun.c genfslist.sh
--      set -e;           $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) $(sun_mod_CFLAGS) -E $<       | sh $(srcdir)/genfslist.sh sun > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sun_mod_CFLAGS) -E $<          | sh $(srcdir)/genfslist.sh sun > $@ || (rm -f $@; exit 1)
- sun_mod_CFLAGS = $(COMMON_CFLAGS)
-@@ -845,38 +925,43 @@
- # For acorn.mod
- acorn_mod_SOURCES = partmap/acorn.c
--CLEANFILES += acorn.mod mod-acorn.o mod-acorn.c pre-acorn.o acorn_mod-partmap_acorn.o def-acorn.lst und-acorn.lst
--MOSTLYCLEANFILES += acorn_mod-partmap_acorn.d
-+CLEANFILES += acorn.mod mod-acorn.o mod-acorn.c pre-acorn.o acorn_mod-partmap_acorn.o und-acorn.lst
-+ifneq ($(acorn_mod_EXPORTS),no)
-+CLEANFILES += def-acorn.lst
- DEFSYMFILES += def-acorn.lst
-+endif
-+MOSTLYCLEANFILES += acorn_mod-partmap_acorn.d
- UNDSYMFILES += und-acorn.lst
- acorn.mod: pre-acorn.o mod-acorn.o
-       -rm -f $@
--      $(LD) $(acorn_mod_LDFLAGS) $(LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(acorn_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
-       $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
- pre-acorn.o: acorn_mod-partmap_acorn.o
-       -rm -f $@
--      $(LD) $(acorn_mod_LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(acorn_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
- mod-acorn.o: mod-acorn.c
--      $(CC) $(CPPFLAGS) $(CFLAGS) $(acorn_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(acorn_mod_CFLAGS) -c -o $@ $<
- mod-acorn.c: moddep.lst genmodsrc.sh
-       sh $(srcdir)/genmodsrc.sh 'acorn' $< > $@ || (rm -f $@; exit 1)
-+ifneq ($(acorn_mod_EXPORTS),no)
- def-acorn.lst: pre-acorn.o
-       $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 acorn/' > $@
-+endif
- und-acorn.lst: pre-acorn.o
-       echo 'acorn' > $@
-       $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
- acorn_mod-partmap_acorn.o: partmap/acorn.c
--      $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) $(acorn_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(acorn_mod_CFLAGS) -c -o $@ $<
- acorn_mod-partmap_acorn.d: partmap/acorn.c
--      set -e;           $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) $(acorn_mod_CFLAGS) -M $<     | sed 's,acorn\.o[ :]*,acorn_mod-partmap_acorn.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(acorn_mod_CFLAGS) -M $<        | sed 's,acorn\.o[ :]*,acorn_mod-partmap_acorn.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
- -include acorn_mod-partmap_acorn.d
-@@ -885,10 +970,10 @@
- FSFILES += fs-acorn_mod-partmap_acorn.lst
- cmd-acorn_mod-partmap_acorn.lst: partmap/acorn.c gencmdlist.sh
--      set -e;           $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) $(acorn_mod_CFLAGS) -E $<     | sh $(srcdir)/gencmdlist.sh acorn > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(acorn_mod_CFLAGS) -E $<        | sh $(srcdir)/gencmdlist.sh acorn > $@ || (rm -f $@; exit 1)
- fs-acorn_mod-partmap_acorn.lst: partmap/acorn.c genfslist.sh
--      set -e;           $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) $(acorn_mod_CFLAGS) -E $<     | sh $(srcdir)/genfslist.sh acorn > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(acorn_mod_CFLAGS) -E $<        | sh $(srcdir)/genfslist.sh acorn > $@ || (rm -f $@; exit 1)
- acorn_mod_CFLAGS = $(COMMON_CFLAGS)
-@@ -896,38 +981,43 @@
- # For gpt.mod
- gpt_mod_SOURCES = partmap/gpt.c
--CLEANFILES += gpt.mod mod-gpt.o mod-gpt.c pre-gpt.o gpt_mod-partmap_gpt.o def-gpt.lst und-gpt.lst
--MOSTLYCLEANFILES += gpt_mod-partmap_gpt.d
-+CLEANFILES += gpt.mod mod-gpt.o mod-gpt.c pre-gpt.o gpt_mod-partmap_gpt.o und-gpt.lst
-+ifneq ($(gpt_mod_EXPORTS),no)
-+CLEANFILES += def-gpt.lst
- DEFSYMFILES += def-gpt.lst
-+endif
-+MOSTLYCLEANFILES += gpt_mod-partmap_gpt.d
- UNDSYMFILES += und-gpt.lst
- gpt.mod: pre-gpt.o mod-gpt.o
-       -rm -f $@
--      $(LD) $(gpt_mod_LDFLAGS) $(LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(gpt_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
-       $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
- pre-gpt.o: gpt_mod-partmap_gpt.o
-       -rm -f $@
--      $(LD) $(gpt_mod_LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(gpt_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
- mod-gpt.o: mod-gpt.c
--      $(CC) $(CPPFLAGS) $(CFLAGS) $(gpt_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(gpt_mod_CFLAGS) -c -o $@ $<
- mod-gpt.c: moddep.lst genmodsrc.sh
-       sh $(srcdir)/genmodsrc.sh 'gpt' $< > $@ || (rm -f $@; exit 1)
-+ifneq ($(gpt_mod_EXPORTS),no)
- def-gpt.lst: pre-gpt.o
-       $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 gpt/' > $@
-+endif
- und-gpt.lst: pre-gpt.o
-       echo 'gpt' > $@
-       $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
- gpt_mod-partmap_gpt.o: partmap/gpt.c
--      $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) $(gpt_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(gpt_mod_CFLAGS) -c -o $@ $<
- gpt_mod-partmap_gpt.d: partmap/gpt.c
--      set -e;           $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) $(gpt_mod_CFLAGS) -M $<       | sed 's,gpt\.o[ :]*,gpt_mod-partmap_gpt.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(gpt_mod_CFLAGS) -M $<          | sed 's,gpt\.o[ :]*,gpt_mod-partmap_gpt.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
- -include gpt_mod-partmap_gpt.d
-@@ -936,10 +1026,10 @@
- FSFILES += fs-gpt_mod-partmap_gpt.lst
- cmd-gpt_mod-partmap_gpt.lst: partmap/gpt.c gencmdlist.sh
--      set -e;           $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) $(gpt_mod_CFLAGS) -E $<       | sh $(srcdir)/gencmdlist.sh gpt > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(gpt_mod_CFLAGS) -E $<          | sh $(srcdir)/gencmdlist.sh gpt > $@ || (rm -f $@; exit 1)
- fs-gpt_mod-partmap_gpt.lst: partmap/gpt.c genfslist.sh
--      set -e;           $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) $(gpt_mod_CFLAGS) -E $<       | sh $(srcdir)/genfslist.sh gpt > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(gpt_mod_CFLAGS) -E $<          | sh $(srcdir)/genfslist.sh gpt > $@ || (rm -f $@; exit 1)
- gpt_mod_CFLAGS = $(COMMON_CFLAGS)
-@@ -949,43 +1039,48 @@
- # Commands.
- pkgdata_MODULES += hello.mod boot.mod terminal.mod ls.mod     \
-       cmp.mod cat.mod help.mod font.mod search.mod            \
--      loopback.mod default.mod timeout.mod configfile.mod     \
--      terminfo.mod test.mod
-+      loopback.mod configfile.mod                             \
-+      terminfo.mod test.mod blocklist.mod
- # For hello.mod.
- hello_mod_SOURCES = hello/hello.c
--CLEANFILES += hello.mod mod-hello.o mod-hello.c pre-hello.o hello_mod-hello_hello.o def-hello.lst und-hello.lst
--MOSTLYCLEANFILES += hello_mod-hello_hello.d
-+CLEANFILES += hello.mod mod-hello.o mod-hello.c pre-hello.o hello_mod-hello_hello.o und-hello.lst
-+ifneq ($(hello_mod_EXPORTS),no)
-+CLEANFILES += def-hello.lst
- DEFSYMFILES += def-hello.lst
-+endif
-+MOSTLYCLEANFILES += hello_mod-hello_hello.d
- UNDSYMFILES += und-hello.lst
- hello.mod: pre-hello.o mod-hello.o
-       -rm -f $@
--      $(LD) $(hello_mod_LDFLAGS) $(LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(hello_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
-       $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
- pre-hello.o: hello_mod-hello_hello.o
-       -rm -f $@
--      $(LD) $(hello_mod_LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(hello_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
- mod-hello.o: mod-hello.c
--      $(CC) $(CPPFLAGS) $(CFLAGS) $(hello_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hello_mod_CFLAGS) -c -o $@ $<
- mod-hello.c: moddep.lst genmodsrc.sh
-       sh $(srcdir)/genmodsrc.sh 'hello' $< > $@ || (rm -f $@; exit 1)
-+ifneq ($(hello_mod_EXPORTS),no)
- def-hello.lst: pre-hello.o
-       $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 hello/' > $@
-+endif
- und-hello.lst: pre-hello.o
-       echo 'hello' > $@
-       $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
- hello_mod-hello_hello.o: hello/hello.c
--      $(CC) -Ihello -I$(srcdir)/hello $(CPPFLAGS) $(CFLAGS) $(hello_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Ihello -I$(srcdir)/hello $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hello_mod_CFLAGS) -c -o $@ $<
- hello_mod-hello_hello.d: hello/hello.c
--      set -e;           $(CC) -Ihello -I$(srcdir)/hello $(CPPFLAGS) $(CFLAGS) $(hello_mod_CFLAGS) -M $<         | sed 's,hello\.o[ :]*,hello_mod-hello_hello.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Ihello -I$(srcdir)/hello $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hello_mod_CFLAGS) -M $<    | sed 's,hello\.o[ :]*,hello_mod-hello_hello.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
- -include hello_mod-hello_hello.d
-@@ -994,10 +1089,10 @@
- FSFILES += fs-hello_mod-hello_hello.lst
- cmd-hello_mod-hello_hello.lst: hello/hello.c gencmdlist.sh
--      set -e;           $(CC) -Ihello -I$(srcdir)/hello $(CPPFLAGS) $(CFLAGS) $(hello_mod_CFLAGS) -E $<         | sh $(srcdir)/gencmdlist.sh hello > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Ihello -I$(srcdir)/hello $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hello_mod_CFLAGS) -E $<    | sh $(srcdir)/gencmdlist.sh hello > $@ || (rm -f $@; exit 1)
- fs-hello_mod-hello_hello.lst: hello/hello.c genfslist.sh
--      set -e;           $(CC) -Ihello -I$(srcdir)/hello $(CPPFLAGS) $(CFLAGS) $(hello_mod_CFLAGS) -E $<         | sh $(srcdir)/genfslist.sh hello > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Ihello -I$(srcdir)/hello $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hello_mod_CFLAGS) -E $<    | sh $(srcdir)/genfslist.sh hello > $@ || (rm -f $@; exit 1)
- hello_mod_CFLAGS = $(COMMON_CFLAGS)
-@@ -1005,38 +1100,43 @@
- # For boot.mod.
- boot_mod_SOURCES = commands/boot.c
--CLEANFILES += boot.mod mod-boot.o mod-boot.c pre-boot.o boot_mod-commands_boot.o def-boot.lst und-boot.lst
--MOSTLYCLEANFILES += boot_mod-commands_boot.d
-+CLEANFILES += boot.mod mod-boot.o mod-boot.c pre-boot.o boot_mod-commands_boot.o und-boot.lst
-+ifneq ($(boot_mod_EXPORTS),no)
-+CLEANFILES += def-boot.lst
- DEFSYMFILES += def-boot.lst
-+endif
-+MOSTLYCLEANFILES += boot_mod-commands_boot.d
- UNDSYMFILES += und-boot.lst
- boot.mod: pre-boot.o mod-boot.o
-       -rm -f $@
--      $(LD) $(boot_mod_LDFLAGS) $(LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(boot_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
-       $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
- pre-boot.o: boot_mod-commands_boot.o
-       -rm -f $@
--      $(LD) $(boot_mod_LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(boot_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
- mod-boot.o: mod-boot.c
--      $(CC) $(CPPFLAGS) $(CFLAGS) $(boot_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(boot_mod_CFLAGS) -c -o $@ $<
- mod-boot.c: moddep.lst genmodsrc.sh
-       sh $(srcdir)/genmodsrc.sh 'boot' $< > $@ || (rm -f $@; exit 1)
-+ifneq ($(boot_mod_EXPORTS),no)
- def-boot.lst: pre-boot.o
-       $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 boot/' > $@
-+endif
- und-boot.lst: pre-boot.o
-       echo 'boot' > $@
-       $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
- boot_mod-commands_boot.o: commands/boot.c
--      $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(boot_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(boot_mod_CFLAGS) -c -o $@ $<
- boot_mod-commands_boot.d: commands/boot.c
--      set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(boot_mod_CFLAGS) -M $<    | sed 's,boot\.o[ :]*,boot_mod-commands_boot.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(boot_mod_CFLAGS) -M $<       | sed 's,boot\.o[ :]*,boot_mod-commands_boot.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
- -include boot_mod-commands_boot.d
-@@ -1045,10 +1145,10 @@
- FSFILES += fs-boot_mod-commands_boot.lst
- cmd-boot_mod-commands_boot.lst: commands/boot.c gencmdlist.sh
--      set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(boot_mod_CFLAGS) -E $<    | sh $(srcdir)/gencmdlist.sh boot > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(boot_mod_CFLAGS) -E $<       | sh $(srcdir)/gencmdlist.sh boot > $@ || (rm -f $@; exit 1)
- fs-boot_mod-commands_boot.lst: commands/boot.c genfslist.sh
--      set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(boot_mod_CFLAGS) -E $<    | sh $(srcdir)/genfslist.sh boot > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(boot_mod_CFLAGS) -E $<       | sh $(srcdir)/genfslist.sh boot > $@ || (rm -f $@; exit 1)
- boot_mod_CFLAGS = $(COMMON_CFLAGS)
-@@ -1056,38 +1156,43 @@
- # For terminal.mod.
- terminal_mod_SOURCES = commands/terminal.c
--CLEANFILES += terminal.mod mod-terminal.o mod-terminal.c pre-terminal.o terminal_mod-commands_terminal.o def-terminal.lst und-terminal.lst
--MOSTLYCLEANFILES += terminal_mod-commands_terminal.d
-+CLEANFILES += terminal.mod mod-terminal.o mod-terminal.c pre-terminal.o terminal_mod-commands_terminal.o und-terminal.lst
-+ifneq ($(terminal_mod_EXPORTS),no)
-+CLEANFILES += def-terminal.lst
- DEFSYMFILES += def-terminal.lst
-+endif
-+MOSTLYCLEANFILES += terminal_mod-commands_terminal.d
- UNDSYMFILES += und-terminal.lst
- terminal.mod: pre-terminal.o mod-terminal.o
-       -rm -f $@
--      $(LD) $(terminal_mod_LDFLAGS) $(LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(terminal_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
-       $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
- pre-terminal.o: terminal_mod-commands_terminal.o
-       -rm -f $@
--      $(LD) $(terminal_mod_LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(terminal_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
- mod-terminal.o: mod-terminal.c
--      $(CC) $(CPPFLAGS) $(CFLAGS) $(terminal_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(terminal_mod_CFLAGS) -c -o $@ $<
- mod-terminal.c: moddep.lst genmodsrc.sh
-       sh $(srcdir)/genmodsrc.sh 'terminal' $< > $@ || (rm -f $@; exit 1)
-+ifneq ($(terminal_mod_EXPORTS),no)
- def-terminal.lst: pre-terminal.o
-       $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 terminal/' > $@
-+endif
- und-terminal.lst: pre-terminal.o
-       echo 'terminal' > $@
-       $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
- terminal_mod-commands_terminal.o: commands/terminal.c
--      $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(terminal_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(terminal_mod_CFLAGS) -c -o $@ $<
- terminal_mod-commands_terminal.d: commands/terminal.c
--      set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(terminal_mod_CFLAGS) -M $<        | sed 's,terminal\.o[ :]*,terminal_mod-commands_terminal.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(terminal_mod_CFLAGS) -M $<           | sed 's,terminal\.o[ :]*,terminal_mod-commands_terminal.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
- -include terminal_mod-commands_terminal.d
-@@ -1096,10 +1201,10 @@
- FSFILES += fs-terminal_mod-commands_terminal.lst
- cmd-terminal_mod-commands_terminal.lst: commands/terminal.c gencmdlist.sh
--      set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(terminal_mod_CFLAGS) -E $<        | sh $(srcdir)/gencmdlist.sh terminal > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(terminal_mod_CFLAGS) -E $<           | sh $(srcdir)/gencmdlist.sh terminal > $@ || (rm -f $@; exit 1)
- fs-terminal_mod-commands_terminal.lst: commands/terminal.c genfslist.sh
--      set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(terminal_mod_CFLAGS) -E $<        | sh $(srcdir)/genfslist.sh terminal > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(terminal_mod_CFLAGS) -E $<           | sh $(srcdir)/genfslist.sh terminal > $@ || (rm -f $@; exit 1)
- terminal_mod_CFLAGS = $(COMMON_CFLAGS)
-@@ -1107,38 +1212,43 @@
- # For ls.mod.
- ls_mod_SOURCES = commands/ls.c
--CLEANFILES += ls.mod mod-ls.o mod-ls.c pre-ls.o ls_mod-commands_ls.o def-ls.lst und-ls.lst
--MOSTLYCLEANFILES += ls_mod-commands_ls.d
-+CLEANFILES += ls.mod mod-ls.o mod-ls.c pre-ls.o ls_mod-commands_ls.o und-ls.lst
-+ifneq ($(ls_mod_EXPORTS),no)
-+CLEANFILES += def-ls.lst
- DEFSYMFILES += def-ls.lst
-+endif
-+MOSTLYCLEANFILES += ls_mod-commands_ls.d
- UNDSYMFILES += und-ls.lst
- ls.mod: pre-ls.o mod-ls.o
-       -rm -f $@
--      $(LD) $(ls_mod_LDFLAGS) $(LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(ls_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
-       $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
- pre-ls.o: ls_mod-commands_ls.o
-       -rm -f $@
--      $(LD) $(ls_mod_LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(ls_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
- mod-ls.o: mod-ls.c
--      $(CC) $(CPPFLAGS) $(CFLAGS) $(ls_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ls_mod_CFLAGS) -c -o $@ $<
- mod-ls.c: moddep.lst genmodsrc.sh
-       sh $(srcdir)/genmodsrc.sh 'ls' $< > $@ || (rm -f $@; exit 1)
-+ifneq ($(ls_mod_EXPORTS),no)
- def-ls.lst: pre-ls.o
-       $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 ls/' > $@
-+endif
- und-ls.lst: pre-ls.o
-       echo 'ls' > $@
-       $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
- ls_mod-commands_ls.o: commands/ls.c
--      $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(ls_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ls_mod_CFLAGS) -c -o $@ $<
- ls_mod-commands_ls.d: commands/ls.c
--      set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(ls_mod_CFLAGS) -M $<      | sed 's,ls\.o[ :]*,ls_mod-commands_ls.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ls_mod_CFLAGS) -M $<         | sed 's,ls\.o[ :]*,ls_mod-commands_ls.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
- -include ls_mod-commands_ls.d
-@@ -1147,10 +1257,10 @@
- FSFILES += fs-ls_mod-commands_ls.lst
- cmd-ls_mod-commands_ls.lst: commands/ls.c gencmdlist.sh
--      set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(ls_mod_CFLAGS) -E $<      | sh $(srcdir)/gencmdlist.sh ls > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ls_mod_CFLAGS) -E $<         | sh $(srcdir)/gencmdlist.sh ls > $@ || (rm -f $@; exit 1)
- fs-ls_mod-commands_ls.lst: commands/ls.c genfslist.sh
--      set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(ls_mod_CFLAGS) -E $<      | sh $(srcdir)/genfslist.sh ls > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ls_mod_CFLAGS) -E $<         | sh $(srcdir)/genfslist.sh ls > $@ || (rm -f $@; exit 1)
- ls_mod_CFLAGS = $(COMMON_CFLAGS)
-@@ -1158,38 +1268,43 @@
- # For cmp.mod.
- cmp_mod_SOURCES = commands/cmp.c
--CLEANFILES += cmp.mod mod-cmp.o mod-cmp.c pre-cmp.o cmp_mod-commands_cmp.o def-cmp.lst und-cmp.lst
--MOSTLYCLEANFILES += cmp_mod-commands_cmp.d
-+CLEANFILES += cmp.mod mod-cmp.o mod-cmp.c pre-cmp.o cmp_mod-commands_cmp.o und-cmp.lst
-+ifneq ($(cmp_mod_EXPORTS),no)
-+CLEANFILES += def-cmp.lst
- DEFSYMFILES += def-cmp.lst
-+endif
-+MOSTLYCLEANFILES += cmp_mod-commands_cmp.d
- UNDSYMFILES += und-cmp.lst
- cmp.mod: pre-cmp.o mod-cmp.o
-       -rm -f $@
--      $(LD) $(cmp_mod_LDFLAGS) $(LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(cmp_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
-       $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
- pre-cmp.o: cmp_mod-commands_cmp.o
-       -rm -f $@
--      $(LD) $(cmp_mod_LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(cmp_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
- mod-cmp.o: mod-cmp.c
--      $(CC) $(CPPFLAGS) $(CFLAGS) $(cmp_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cmp_mod_CFLAGS) -c -o $@ $<
- mod-cmp.c: moddep.lst genmodsrc.sh
-       sh $(srcdir)/genmodsrc.sh 'cmp' $< > $@ || (rm -f $@; exit 1)
-+ifneq ($(cmp_mod_EXPORTS),no)
- def-cmp.lst: pre-cmp.o
-       $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 cmp/' > $@
-+endif
- und-cmp.lst: pre-cmp.o
-       echo 'cmp' > $@
-       $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
- cmp_mod-commands_cmp.o: commands/cmp.c
--      $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(cmp_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cmp_mod_CFLAGS) -c -o $@ $<
- cmp_mod-commands_cmp.d: commands/cmp.c
--      set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(cmp_mod_CFLAGS) -M $<     | sed 's,cmp\.o[ :]*,cmp_mod-commands_cmp.o $@ : ,g' > $@;      [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cmp_mod_CFLAGS) -M $<        | sed 's,cmp\.o[ :]*,cmp_mod-commands_cmp.o $@ : ,g' > $@;      [ -s $@ ] || rm -f $@
- -include cmp_mod-commands_cmp.d
-@@ -1198,10 +1313,10 @@
- FSFILES += fs-cmp_mod-commands_cmp.lst
- cmd-cmp_mod-commands_cmp.lst: commands/cmp.c gencmdlist.sh
--      set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(cmp_mod_CFLAGS) -E $<     | sh $(srcdir)/gencmdlist.sh cmp > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cmp_mod_CFLAGS) -E $<        | sh $(srcdir)/gencmdlist.sh cmp > $@ || (rm -f $@; exit 1)
- fs-cmp_mod-commands_cmp.lst: commands/cmp.c genfslist.sh
--      set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(cmp_mod_CFLAGS) -E $<     | sh $(srcdir)/genfslist.sh cmp > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cmp_mod_CFLAGS) -E $<        | sh $(srcdir)/genfslist.sh cmp > $@ || (rm -f $@; exit 1)
- cmp_mod_CFLAGS = $(COMMON_CFLAGS)
-@@ -1209,38 +1324,43 @@
- # For cat.mod.
- cat_mod_SOURCES = commands/cat.c
--CLEANFILES += cat.mod mod-cat.o mod-cat.c pre-cat.o cat_mod-commands_cat.o def-cat.lst und-cat.lst
--MOSTLYCLEANFILES += cat_mod-commands_cat.d
-+CLEANFILES += cat.mod mod-cat.o mod-cat.c pre-cat.o cat_mod-commands_cat.o und-cat.lst
-+ifneq ($(cat_mod_EXPORTS),no)
-+CLEANFILES += def-cat.lst
- DEFSYMFILES += def-cat.lst
-+endif
-+MOSTLYCLEANFILES += cat_mod-commands_cat.d
- UNDSYMFILES += und-cat.lst
- cat.mod: pre-cat.o mod-cat.o
-       -rm -f $@
--      $(LD) $(cat_mod_LDFLAGS) $(LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(cat_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
-       $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
- pre-cat.o: cat_mod-commands_cat.o
-       -rm -f $@
--      $(LD) $(cat_mod_LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(cat_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
- mod-cat.o: mod-cat.c
--      $(CC) $(CPPFLAGS) $(CFLAGS) $(cat_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cat_mod_CFLAGS) -c -o $@ $<
- mod-cat.c: moddep.lst genmodsrc.sh
-       sh $(srcdir)/genmodsrc.sh 'cat' $< > $@ || (rm -f $@; exit 1)
-+ifneq ($(cat_mod_EXPORTS),no)
- def-cat.lst: pre-cat.o
-       $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 cat/' > $@
-+endif
- und-cat.lst: pre-cat.o
-       echo 'cat' > $@
-       $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
- cat_mod-commands_cat.o: commands/cat.c
--      $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(cat_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cat_mod_CFLAGS) -c -o $@ $<
- cat_mod-commands_cat.d: commands/cat.c
--      set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(cat_mod_CFLAGS) -M $<     | sed 's,cat\.o[ :]*,cat_mod-commands_cat.o $@ : ,g' > $@;      [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cat_mod_CFLAGS) -M $<        | sed 's,cat\.o[ :]*,cat_mod-commands_cat.o $@ : ,g' > $@;      [ -s $@ ] || rm -f $@
- -include cat_mod-commands_cat.d
-@@ -1249,10 +1369,10 @@
- FSFILES += fs-cat_mod-commands_cat.lst
- cmd-cat_mod-commands_cat.lst: commands/cat.c gencmdlist.sh
--      set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(cat_mod_CFLAGS) -E $<     | sh $(srcdir)/gencmdlist.sh cat > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cat_mod_CFLAGS) -E $<        | sh $(srcdir)/gencmdlist.sh cat > $@ || (rm -f $@; exit 1)
- fs-cat_mod-commands_cat.lst: commands/cat.c genfslist.sh
--      set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(cat_mod_CFLAGS) -E $<     | sh $(srcdir)/genfslist.sh cat > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cat_mod_CFLAGS) -E $<        | sh $(srcdir)/genfslist.sh cat > $@ || (rm -f $@; exit 1)
- cat_mod_CFLAGS = $(COMMON_CFLAGS)
-@@ -1260,38 +1380,43 @@
- # For help.mod.
- help_mod_SOURCES = commands/help.c
--CLEANFILES += help.mod mod-help.o mod-help.c pre-help.o help_mod-commands_help.o def-help.lst und-help.lst
--MOSTLYCLEANFILES += help_mod-commands_help.d
-+CLEANFILES += help.mod mod-help.o mod-help.c pre-help.o help_mod-commands_help.o und-help.lst
-+ifneq ($(help_mod_EXPORTS),no)
-+CLEANFILES += def-help.lst
- DEFSYMFILES += def-help.lst
-+endif
-+MOSTLYCLEANFILES += help_mod-commands_help.d
- UNDSYMFILES += und-help.lst
- help.mod: pre-help.o mod-help.o
-       -rm -f $@
--      $(LD) $(help_mod_LDFLAGS) $(LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(help_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
-       $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
- pre-help.o: help_mod-commands_help.o
-       -rm -f $@
--      $(LD) $(help_mod_LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(help_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
- mod-help.o: mod-help.c
--      $(CC) $(CPPFLAGS) $(CFLAGS) $(help_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(help_mod_CFLAGS) -c -o $@ $<
- mod-help.c: moddep.lst genmodsrc.sh
-       sh $(srcdir)/genmodsrc.sh 'help' $< > $@ || (rm -f $@; exit 1)
-+ifneq ($(help_mod_EXPORTS),no)
- def-help.lst: pre-help.o
-       $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 help/' > $@
-+endif
- und-help.lst: pre-help.o
-       echo 'help' > $@
-       $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
- help_mod-commands_help.o: commands/help.c
--      $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(help_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(help_mod_CFLAGS) -c -o $@ $<
- help_mod-commands_help.d: commands/help.c
--      set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(help_mod_CFLAGS) -M $<    | sed 's,help\.o[ :]*,help_mod-commands_help.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(help_mod_CFLAGS) -M $<       | sed 's,help\.o[ :]*,help_mod-commands_help.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
- -include help_mod-commands_help.d
-@@ -1300,10 +1425,10 @@
- FSFILES += fs-help_mod-commands_help.lst
- cmd-help_mod-commands_help.lst: commands/help.c gencmdlist.sh
--      set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(help_mod_CFLAGS) -E $<    | sh $(srcdir)/gencmdlist.sh help > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(help_mod_CFLAGS) -E $<       | sh $(srcdir)/gencmdlist.sh help > $@ || (rm -f $@; exit 1)
- fs-help_mod-commands_help.lst: commands/help.c genfslist.sh
--      set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(help_mod_CFLAGS) -E $<    | sh $(srcdir)/genfslist.sh help > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(help_mod_CFLAGS) -E $<       | sh $(srcdir)/genfslist.sh help > $@ || (rm -f $@; exit 1)
- help_mod_CFLAGS = $(COMMON_CFLAGS)
-@@ -1311,38 +1436,43 @@
- # For font.mod.
- font_mod_SOURCES = font/manager.c
--CLEANFILES += font.mod mod-font.o mod-font.c pre-font.o font_mod-font_manager.o def-font.lst und-font.lst
--MOSTLYCLEANFILES += font_mod-font_manager.d
-+CLEANFILES += font.mod mod-font.o mod-font.c pre-font.o font_mod-font_manager.o und-font.lst
-+ifneq ($(font_mod_EXPORTS),no)
-+CLEANFILES += def-font.lst
- DEFSYMFILES += def-font.lst
-+endif
-+MOSTLYCLEANFILES += font_mod-font_manager.d
- UNDSYMFILES += und-font.lst
- font.mod: pre-font.o mod-font.o
-       -rm -f $@
--      $(LD) $(font_mod_LDFLAGS) $(LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(font_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
-       $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
- pre-font.o: font_mod-font_manager.o
-       -rm -f $@
--      $(LD) $(font_mod_LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(font_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
- mod-font.o: mod-font.c
--      $(CC) $(CPPFLAGS) $(CFLAGS) $(font_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(font_mod_CFLAGS) -c -o $@ $<
- mod-font.c: moddep.lst genmodsrc.sh
-       sh $(srcdir)/genmodsrc.sh 'font' $< > $@ || (rm -f $@; exit 1)
-+ifneq ($(font_mod_EXPORTS),no)
- def-font.lst: pre-font.o
-       $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 font/' > $@
-+endif
- und-font.lst: pre-font.o
-       echo 'font' > $@
-       $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
- font_mod-font_manager.o: font/manager.c
--      $(CC) -Ifont -I$(srcdir)/font $(CPPFLAGS) $(CFLAGS) $(font_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Ifont -I$(srcdir)/font $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(font_mod_CFLAGS) -c -o $@ $<
- font_mod-font_manager.d: font/manager.c
--      set -e;           $(CC) -Ifont -I$(srcdir)/font $(CPPFLAGS) $(CFLAGS) $(font_mod_CFLAGS) -M $<    | sed 's,manager\.o[ :]*,font_mod-font_manager.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Ifont -I$(srcdir)/font $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(font_mod_CFLAGS) -M $<       | sed 's,manager\.o[ :]*,font_mod-font_manager.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
- -include font_mod-font_manager.d
-@@ -1351,10 +1481,10 @@
- FSFILES += fs-font_mod-font_manager.lst
- cmd-font_mod-font_manager.lst: font/manager.c gencmdlist.sh
--      set -e;           $(CC) -Ifont -I$(srcdir)/font $(CPPFLAGS) $(CFLAGS) $(font_mod_CFLAGS) -E $<    | sh $(srcdir)/gencmdlist.sh font > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Ifont -I$(srcdir)/font $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(font_mod_CFLAGS) -E $<       | sh $(srcdir)/gencmdlist.sh font > $@ || (rm -f $@; exit 1)
- fs-font_mod-font_manager.lst: font/manager.c genfslist.sh
--      set -e;           $(CC) -Ifont -I$(srcdir)/font $(CPPFLAGS) $(CFLAGS) $(font_mod_CFLAGS) -E $<    | sh $(srcdir)/genfslist.sh font > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Ifont -I$(srcdir)/font $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(font_mod_CFLAGS) -E $<       | sh $(srcdir)/genfslist.sh font > $@ || (rm -f $@; exit 1)
- font_mod_CFLAGS = $(COMMON_CFLAGS)
-@@ -1362,38 +1492,43 @@
- # For search.mod.
- search_mod_SOURCES = commands/search.c
--CLEANFILES += search.mod mod-search.o mod-search.c pre-search.o search_mod-commands_search.o def-search.lst und-search.lst
--MOSTLYCLEANFILES += search_mod-commands_search.d
-+CLEANFILES += search.mod mod-search.o mod-search.c pre-search.o search_mod-commands_search.o und-search.lst
-+ifneq ($(search_mod_EXPORTS),no)
-+CLEANFILES += def-search.lst
- DEFSYMFILES += def-search.lst
-+endif
-+MOSTLYCLEANFILES += search_mod-commands_search.d
- UNDSYMFILES += und-search.lst
- search.mod: pre-search.o mod-search.o
-       -rm -f $@
--      $(LD) $(search_mod_LDFLAGS) $(LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(search_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
-       $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
- pre-search.o: search_mod-commands_search.o
-       -rm -f $@
--      $(LD) $(search_mod_LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(search_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
- mod-search.o: mod-search.c
--      $(CC) $(CPPFLAGS) $(CFLAGS) $(search_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(search_mod_CFLAGS) -c -o $@ $<
- mod-search.c: moddep.lst genmodsrc.sh
-       sh $(srcdir)/genmodsrc.sh 'search' $< > $@ || (rm -f $@; exit 1)
-+ifneq ($(search_mod_EXPORTS),no)
- def-search.lst: pre-search.o
-       $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 search/' > $@
-+endif
- und-search.lst: pre-search.o
-       echo 'search' > $@
-       $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
- search_mod-commands_search.o: commands/search.c
--      $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(search_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(search_mod_CFLAGS) -c -o $@ $<
- search_mod-commands_search.d: commands/search.c
--      set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(search_mod_CFLAGS) -M $<          | sed 's,search\.o[ :]*,search_mod-commands_search.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(search_mod_CFLAGS) -M $<     | sed 's,search\.o[ :]*,search_mod-commands_search.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
- -include search_mod-commands_search.d
-@@ -1402,10 +1537,10 @@
- FSFILES += fs-search_mod-commands_search.lst
- cmd-search_mod-commands_search.lst: commands/search.c gencmdlist.sh
--      set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(search_mod_CFLAGS) -E $<          | sh $(srcdir)/gencmdlist.sh search > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(search_mod_CFLAGS) -E $<     | sh $(srcdir)/gencmdlist.sh search > $@ || (rm -f $@; exit 1)
- fs-search_mod-commands_search.lst: commands/search.c genfslist.sh
--      set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(search_mod_CFLAGS) -E $<          | sh $(srcdir)/genfslist.sh search > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(search_mod_CFLAGS) -E $<     | sh $(srcdir)/genfslist.sh search > $@ || (rm -f $@; exit 1)
- search_mod_CFLAGS = $(COMMON_CFLAGS)
-@@ -1413,38 +1548,43 @@
- # For test.mod.
- test_mod_SOURCES = commands/test.c
--CLEANFILES += test.mod mod-test.o mod-test.c pre-test.o test_mod-commands_test.o def-test.lst und-test.lst
--MOSTLYCLEANFILES += test_mod-commands_test.d
-+CLEANFILES += test.mod mod-test.o mod-test.c pre-test.o test_mod-commands_test.o und-test.lst
-+ifneq ($(test_mod_EXPORTS),no)
-+CLEANFILES += def-test.lst
- DEFSYMFILES += def-test.lst
-+endif
-+MOSTLYCLEANFILES += test_mod-commands_test.d
- UNDSYMFILES += und-test.lst
- test.mod: pre-test.o mod-test.o
-       -rm -f $@
--      $(LD) $(test_mod_LDFLAGS) $(LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(test_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
-       $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
- pre-test.o: test_mod-commands_test.o
-       -rm -f $@
--      $(LD) $(test_mod_LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(test_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
- mod-test.o: mod-test.c
--      $(CC) $(CPPFLAGS) $(CFLAGS) $(test_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(test_mod_CFLAGS) -c -o $@ $<
- mod-test.c: moddep.lst genmodsrc.sh
-       sh $(srcdir)/genmodsrc.sh 'test' $< > $@ || (rm -f $@; exit 1)
-+ifneq ($(test_mod_EXPORTS),no)
- def-test.lst: pre-test.o
-       $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 test/' > $@
-+endif
- und-test.lst: pre-test.o
-       echo 'test' > $@
-       $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
- test_mod-commands_test.o: commands/test.c
--      $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(test_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(test_mod_CFLAGS) -c -o $@ $<
- test_mod-commands_test.d: commands/test.c
--      set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(test_mod_CFLAGS) -M $<    | sed 's,test\.o[ :]*,test_mod-commands_test.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(test_mod_CFLAGS) -M $<       | sed 's,test\.o[ :]*,test_mod-commands_test.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
- -include test_mod-commands_test.d
-@@ -1453,10 +1593,10 @@
- FSFILES += fs-test_mod-commands_test.lst
- cmd-test_mod-commands_test.lst: commands/test.c gencmdlist.sh
--      set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(test_mod_CFLAGS) -E $<    | sh $(srcdir)/gencmdlist.sh test > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(test_mod_CFLAGS) -E $<       | sh $(srcdir)/gencmdlist.sh test > $@ || (rm -f $@; exit 1)
- fs-test_mod-commands_test.lst: commands/test.c genfslist.sh
--      set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(test_mod_CFLAGS) -E $<    | sh $(srcdir)/genfslist.sh test > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(test_mod_CFLAGS) -E $<       | sh $(srcdir)/genfslist.sh test > $@ || (rm -f $@; exit 1)
- test_mod_CFLAGS = $(COMMON_CFLAGS)
-@@ -1464,38 +1604,43 @@
- # For loopback.mod
- loopback_mod_SOURCES = disk/loopback.c
--CLEANFILES += loopback.mod mod-loopback.o mod-loopback.c pre-loopback.o loopback_mod-disk_loopback.o def-loopback.lst und-loopback.lst
--MOSTLYCLEANFILES += loopback_mod-disk_loopback.d
-+CLEANFILES += loopback.mod mod-loopback.o mod-loopback.c pre-loopback.o loopback_mod-disk_loopback.o und-loopback.lst
-+ifneq ($(loopback_mod_EXPORTS),no)
-+CLEANFILES += def-loopback.lst
- DEFSYMFILES += def-loopback.lst
-+endif
-+MOSTLYCLEANFILES += loopback_mod-disk_loopback.d
- UNDSYMFILES += und-loopback.lst
- loopback.mod: pre-loopback.o mod-loopback.o
-       -rm -f $@
--      $(LD) $(loopback_mod_LDFLAGS) $(LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(loopback_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
-       $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
- pre-loopback.o: loopback_mod-disk_loopback.o
-       -rm -f $@
--      $(LD) $(loopback_mod_LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(loopback_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
- mod-loopback.o: mod-loopback.c
--      $(CC) $(CPPFLAGS) $(CFLAGS) $(loopback_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(loopback_mod_CFLAGS) -c -o $@ $<
- mod-loopback.c: moddep.lst genmodsrc.sh
-       sh $(srcdir)/genmodsrc.sh 'loopback' $< > $@ || (rm -f $@; exit 1)
-+ifneq ($(loopback_mod_EXPORTS),no)
- def-loopback.lst: pre-loopback.o
-       $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 loopback/' > $@
-+endif
- und-loopback.lst: pre-loopback.o
-       echo 'loopback' > $@
-       $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
- loopback_mod-disk_loopback.o: disk/loopback.c
--      $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) $(loopback_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(loopback_mod_CFLAGS) -c -o $@ $<
- loopback_mod-disk_loopback.d: disk/loopback.c
--      set -e;           $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) $(loopback_mod_CFLAGS) -M $<        | sed 's,loopback\.o[ :]*,loopback_mod-disk_loopback.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(loopback_mod_CFLAGS) -M $<           | sed 's,loopback\.o[ :]*,loopback_mod-disk_loopback.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
- -include loopback_mod-disk_loopback.d
-@@ -1504,151 +1649,54 @@
- FSFILES += fs-loopback_mod-disk_loopback.lst
- cmd-loopback_mod-disk_loopback.lst: disk/loopback.c gencmdlist.sh
--      set -e;           $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) $(loopback_mod_CFLAGS) -E $<        | sh $(srcdir)/gencmdlist.sh loopback > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(loopback_mod_CFLAGS) -E $<           | sh $(srcdir)/gencmdlist.sh loopback > $@ || (rm -f $@; exit 1)
- fs-loopback_mod-disk_loopback.lst: disk/loopback.c genfslist.sh
--      set -e;           $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) $(loopback_mod_CFLAGS) -E $<        | sh $(srcdir)/genfslist.sh loopback > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(loopback_mod_CFLAGS) -E $<           | sh $(srcdir)/genfslist.sh loopback > $@ || (rm -f $@; exit 1)
- loopback_mod_CFLAGS = $(COMMON_CFLAGS)
- loopback_mod_LDFLAGS = $(COMMON_LDFLAGS)
--# For default.mod
--default_mod_SOURCES = commands/default.c
--CLEANFILES += default.mod mod-default.o mod-default.c pre-default.o default_mod-commands_default.o def-default.lst und-default.lst
--MOSTLYCLEANFILES += default_mod-commands_default.d
--DEFSYMFILES += def-default.lst
--UNDSYMFILES += und-default.lst
--
--default.mod: pre-default.o mod-default.o
--      -rm -f $@
--      $(LD) $(default_mod_LDFLAGS) $(LDFLAGS) -r -d -o $@ $^
--      $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
--
--pre-default.o: default_mod-commands_default.o
--      -rm -f $@
--      $(LD) $(default_mod_LDFLAGS) -r -d -o $@ $^
--
--mod-default.o: mod-default.c
--      $(CC) $(CPPFLAGS) $(CFLAGS) $(default_mod_CFLAGS) -c -o $@ $<
--
--mod-default.c: moddep.lst genmodsrc.sh
--      sh $(srcdir)/genmodsrc.sh 'default' $< > $@ || (rm -f $@; exit 1)
--
--def-default.lst: pre-default.o
--      $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 default/' > $@
--
--und-default.lst: pre-default.o
--      echo 'default' > $@
--      $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
--
--default_mod-commands_default.o: commands/default.c
--      $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(default_mod_CFLAGS) -c -o $@ $<
--
--default_mod-commands_default.d: commands/default.c
--      set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(default_mod_CFLAGS) -M $<         | sed 's,default\.o[ :]*,default_mod-commands_default.o $@ : ,g' > $@;          [ -s $@ ] || rm -f $@
--
---include default_mod-commands_default.d
--
--CLEANFILES += cmd-default_mod-commands_default.lst fs-default_mod-commands_default.lst
--COMMANDFILES += cmd-default_mod-commands_default.lst
--FSFILES += fs-default_mod-commands_default.lst
--
--cmd-default_mod-commands_default.lst: commands/default.c gencmdlist.sh
--      set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(default_mod_CFLAGS) -E $<         | sh $(srcdir)/gencmdlist.sh default > $@ || (rm -f $@; exit 1)
--
--fs-default_mod-commands_default.lst: commands/default.c genfslist.sh
--      set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(default_mod_CFLAGS) -E $<         | sh $(srcdir)/genfslist.sh default > $@ || (rm -f $@; exit 1)
--
--
--default_mod_CFLAGS = $(COMMON_CFLAGS)
--default_mod_LDFLAGS = $(COMMON_LDFLAGS)
--
--# For timeout.mod
--timeout_mod_SOURCES = commands/timeout.c
--CLEANFILES += timeout.mod mod-timeout.o mod-timeout.c pre-timeout.o timeout_mod-commands_timeout.o def-timeout.lst und-timeout.lst
--MOSTLYCLEANFILES += timeout_mod-commands_timeout.d
--DEFSYMFILES += def-timeout.lst
--UNDSYMFILES += und-timeout.lst
--
--timeout.mod: pre-timeout.o mod-timeout.o
--      -rm -f $@
--      $(LD) $(timeout_mod_LDFLAGS) $(LDFLAGS) -r -d -o $@ $^
--      $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
--
--pre-timeout.o: timeout_mod-commands_timeout.o
--      -rm -f $@
--      $(LD) $(timeout_mod_LDFLAGS) -r -d -o $@ $^
--
--mod-timeout.o: mod-timeout.c
--      $(CC) $(CPPFLAGS) $(CFLAGS) $(timeout_mod_CFLAGS) -c -o $@ $<
--
--mod-timeout.c: moddep.lst genmodsrc.sh
--      sh $(srcdir)/genmodsrc.sh 'timeout' $< > $@ || (rm -f $@; exit 1)
--
--def-timeout.lst: pre-timeout.o
--      $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 timeout/' > $@
--
--und-timeout.lst: pre-timeout.o
--      echo 'timeout' > $@
--      $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
--
--timeout_mod-commands_timeout.o: commands/timeout.c
--      $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(timeout_mod_CFLAGS) -c -o $@ $<
--
--timeout_mod-commands_timeout.d: commands/timeout.c
--      set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(timeout_mod_CFLAGS) -M $<         | sed 's,timeout\.o[ :]*,timeout_mod-commands_timeout.o $@ : ,g' > $@;          [ -s $@ ] || rm -f $@
--
---include timeout_mod-commands_timeout.d
--
--CLEANFILES += cmd-timeout_mod-commands_timeout.lst fs-timeout_mod-commands_timeout.lst
--COMMANDFILES += cmd-timeout_mod-commands_timeout.lst
--FSFILES += fs-timeout_mod-commands_timeout.lst
--
--cmd-timeout_mod-commands_timeout.lst: commands/timeout.c gencmdlist.sh
--      set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(timeout_mod_CFLAGS) -E $<         | sh $(srcdir)/gencmdlist.sh timeout > $@ || (rm -f $@; exit 1)
--
--fs-timeout_mod-commands_timeout.lst: commands/timeout.c genfslist.sh
--      set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(timeout_mod_CFLAGS) -E $<         | sh $(srcdir)/genfslist.sh timeout > $@ || (rm -f $@; exit 1)
--
--
--timeout_mod_CFLAGS = $(COMMON_CFLAGS)
--timeout_mod_LDFLAGS = $(COMMON_LDFLAGS)
--
- # For configfile.mod
- configfile_mod_SOURCES = commands/configfile.c
--CLEANFILES += configfile.mod mod-configfile.o mod-configfile.c pre-configfile.o configfile_mod-commands_configfile.o def-configfile.lst und-configfile.lst
--MOSTLYCLEANFILES += configfile_mod-commands_configfile.d
-+CLEANFILES += configfile.mod mod-configfile.o mod-configfile.c pre-configfile.o configfile_mod-commands_configfile.o und-configfile.lst
-+ifneq ($(configfile_mod_EXPORTS),no)
-+CLEANFILES += def-configfile.lst
- DEFSYMFILES += def-configfile.lst
-+endif
-+MOSTLYCLEANFILES += configfile_mod-commands_configfile.d
- UNDSYMFILES += und-configfile.lst
- configfile.mod: pre-configfile.o mod-configfile.o
-       -rm -f $@
--      $(LD) $(configfile_mod_LDFLAGS) $(LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(configfile_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
-       $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
- pre-configfile.o: configfile_mod-commands_configfile.o
-       -rm -f $@
--      $(LD) $(configfile_mod_LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(configfile_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
- mod-configfile.o: mod-configfile.c
--      $(CC) $(CPPFLAGS) $(CFLAGS) $(configfile_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(configfile_mod_CFLAGS) -c -o $@ $<
- mod-configfile.c: moddep.lst genmodsrc.sh
-       sh $(srcdir)/genmodsrc.sh 'configfile' $< > $@ || (rm -f $@; exit 1)
-+ifneq ($(configfile_mod_EXPORTS),no)
- def-configfile.lst: pre-configfile.o
-       $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 configfile/' > $@
-+endif
- und-configfile.lst: pre-configfile.o
-       echo 'configfile' > $@
-       $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
- configfile_mod-commands_configfile.o: commands/configfile.c
--      $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(configfile_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(configfile_mod_CFLAGS) -c -o $@ $<
- configfile_mod-commands_configfile.d: commands/configfile.c
--      set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(configfile_mod_CFLAGS) -M $<      | sed 's,configfile\.o[ :]*,configfile_mod-commands_configfile.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(configfile_mod_CFLAGS) -M $<         | sed 's,configfile\.o[ :]*,configfile_mod-commands_configfile.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
- -include configfile_mod-commands_configfile.d
-@@ -1657,10 +1705,10 @@
- FSFILES += fs-configfile_mod-commands_configfile.lst
- cmd-configfile_mod-commands_configfile.lst: commands/configfile.c gencmdlist.sh
--      set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(configfile_mod_CFLAGS) -E $<      | sh $(srcdir)/gencmdlist.sh configfile > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(configfile_mod_CFLAGS) -E $<         | sh $(srcdir)/gencmdlist.sh configfile > $@ || (rm -f $@; exit 1)
- fs-configfile_mod-commands_configfile.lst: commands/configfile.c genfslist.sh
--      set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(configfile_mod_CFLAGS) -E $<      | sh $(srcdir)/genfslist.sh configfile > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(configfile_mod_CFLAGS) -E $<         | sh $(srcdir)/genfslist.sh configfile > $@ || (rm -f $@; exit 1)
- configfile_mod_CFLAGS = $(COMMON_CFLAGS)
-@@ -1668,38 +1716,43 @@
- # For terminfo.mod.
- terminfo_mod_SOURCES = term/terminfo.c term/tparm.c
--CLEANFILES += terminfo.mod mod-terminfo.o mod-terminfo.c pre-terminfo.o terminfo_mod-term_terminfo.o terminfo_mod-term_tparm.o def-terminfo.lst und-terminfo.lst
--MOSTLYCLEANFILES += terminfo_mod-term_terminfo.d terminfo_mod-term_tparm.d
-+CLEANFILES += terminfo.mod mod-terminfo.o mod-terminfo.c pre-terminfo.o terminfo_mod-term_terminfo.o terminfo_mod-term_tparm.o und-terminfo.lst
-+ifneq ($(terminfo_mod_EXPORTS),no)
-+CLEANFILES += def-terminfo.lst
- DEFSYMFILES += def-terminfo.lst
-+endif
-+MOSTLYCLEANFILES += terminfo_mod-term_terminfo.d terminfo_mod-term_tparm.d
- UNDSYMFILES += und-terminfo.lst
- terminfo.mod: pre-terminfo.o mod-terminfo.o
-       -rm -f $@
--      $(LD) $(terminfo_mod_LDFLAGS) $(LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(terminfo_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
-       $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
- pre-terminfo.o: terminfo_mod-term_terminfo.o terminfo_mod-term_tparm.o
-       -rm -f $@
--      $(LD) $(terminfo_mod_LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(terminfo_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
- mod-terminfo.o: mod-terminfo.c
--      $(CC) $(CPPFLAGS) $(CFLAGS) $(terminfo_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(terminfo_mod_CFLAGS) -c -o $@ $<
- mod-terminfo.c: moddep.lst genmodsrc.sh
-       sh $(srcdir)/genmodsrc.sh 'terminfo' $< > $@ || (rm -f $@; exit 1)
-+ifneq ($(terminfo_mod_EXPORTS),no)
- def-terminfo.lst: pre-terminfo.o
-       $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 terminfo/' > $@
-+endif
- und-terminfo.lst: pre-terminfo.o
-       echo 'terminfo' > $@
-       $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
- terminfo_mod-term_terminfo.o: term/terminfo.c
--      $(CC) -Iterm -I$(srcdir)/term $(CPPFLAGS) $(CFLAGS) $(terminfo_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Iterm -I$(srcdir)/term $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(terminfo_mod_CFLAGS) -c -o $@ $<
- terminfo_mod-term_terminfo.d: term/terminfo.c
--      set -e;           $(CC) -Iterm -I$(srcdir)/term $(CPPFLAGS) $(CFLAGS) $(terminfo_mod_CFLAGS) -M $<        | sed 's,terminfo\.o[ :]*,terminfo_mod-term_terminfo.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Iterm -I$(srcdir)/term $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(terminfo_mod_CFLAGS) -M $<           | sed 's,terminfo\.o[ :]*,terminfo_mod-term_terminfo.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
- -include terminfo_mod-term_terminfo.d
-@@ -1708,17 +1761,17 @@
- FSFILES += fs-terminfo_mod-term_terminfo.lst
- cmd-terminfo_mod-term_terminfo.lst: term/terminfo.c gencmdlist.sh
--      set -e;           $(CC) -Iterm -I$(srcdir)/term $(CPPFLAGS) $(CFLAGS) $(terminfo_mod_CFLAGS) -E $<        | sh $(srcdir)/gencmdlist.sh terminfo > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Iterm -I$(srcdir)/term $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(terminfo_mod_CFLAGS) -E $<           | sh $(srcdir)/gencmdlist.sh terminfo > $@ || (rm -f $@; exit 1)
- fs-terminfo_mod-term_terminfo.lst: term/terminfo.c genfslist.sh
--      set -e;           $(CC) -Iterm -I$(srcdir)/term $(CPPFLAGS) $(CFLAGS) $(terminfo_mod_CFLAGS) -E $<        | sh $(srcdir)/genfslist.sh terminfo > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Iterm -I$(srcdir)/term $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(terminfo_mod_CFLAGS) -E $<           | sh $(srcdir)/genfslist.sh terminfo > $@ || (rm -f $@; exit 1)
- terminfo_mod-term_tparm.o: term/tparm.c
--      $(CC) -Iterm -I$(srcdir)/term $(CPPFLAGS) $(CFLAGS) $(terminfo_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Iterm -I$(srcdir)/term $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(terminfo_mod_CFLAGS) -c -o $@ $<
- terminfo_mod-term_tparm.d: term/tparm.c
--      set -e;           $(CC) -Iterm -I$(srcdir)/term $(CPPFLAGS) $(CFLAGS) $(terminfo_mod_CFLAGS) -M $<        | sed 's,tparm\.o[ :]*,terminfo_mod-term_tparm.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Iterm -I$(srcdir)/term $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(terminfo_mod_CFLAGS) -M $<           | sed 's,tparm\.o[ :]*,terminfo_mod-term_tparm.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
- -include terminfo_mod-term_tparm.d
-@@ -1727,53 +1780,113 @@
- FSFILES += fs-terminfo_mod-term_tparm.lst
- cmd-terminfo_mod-term_tparm.lst: term/tparm.c gencmdlist.sh
--      set -e;           $(CC) -Iterm -I$(srcdir)/term $(CPPFLAGS) $(CFLAGS) $(terminfo_mod_CFLAGS) -E $<        | sh $(srcdir)/gencmdlist.sh terminfo > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Iterm -I$(srcdir)/term $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(terminfo_mod_CFLAGS) -E $<           | sh $(srcdir)/gencmdlist.sh terminfo > $@ || (rm -f $@; exit 1)
- fs-terminfo_mod-term_tparm.lst: term/tparm.c genfslist.sh
--      set -e;           $(CC) -Iterm -I$(srcdir)/term $(CPPFLAGS) $(CFLAGS) $(terminfo_mod_CFLAGS) -E $<        | sh $(srcdir)/genfslist.sh terminfo > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Iterm -I$(srcdir)/term $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(terminfo_mod_CFLAGS) -E $<           | sh $(srcdir)/genfslist.sh terminfo > $@ || (rm -f $@; exit 1)
- terminfo_mod_CFLAGS = $(COMMON_CFLAGS)
- terminfo_mod_LDFLAGS = $(COMMON_LDFLAGS)
-+# For blocklist.mod.
-+blocklist_mod_SOURCES = commands/blocklist.c
-+CLEANFILES += blocklist.mod mod-blocklist.o mod-blocklist.c pre-blocklist.o blocklist_mod-commands_blocklist.o und-blocklist.lst
-+ifneq ($(blocklist_mod_EXPORTS),no)
-+CLEANFILES += def-blocklist.lst
-+DEFSYMFILES += def-blocklist.lst
-+endif
-+MOSTLYCLEANFILES += blocklist_mod-commands_blocklist.d
-+UNDSYMFILES += und-blocklist.lst
-+
-+blocklist.mod: pre-blocklist.o mod-blocklist.o
-+      -rm -f $@
-+      $(TARGET_CC) $(blocklist_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
-+      $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
-+
-+pre-blocklist.o: blocklist_mod-commands_blocklist.o
-+      -rm -f $@
-+      $(TARGET_CC) $(blocklist_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
-+
-+mod-blocklist.o: mod-blocklist.c
-+      $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(blocklist_mod_CFLAGS) -c -o $@ $<
-+
-+mod-blocklist.c: moddep.lst genmodsrc.sh
-+      sh $(srcdir)/genmodsrc.sh 'blocklist' $< > $@ || (rm -f $@; exit 1)
-+
-+ifneq ($(blocklist_mod_EXPORTS),no)
-+def-blocklist.lst: pre-blocklist.o
-+      $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 blocklist/' > $@
-+endif
-+
-+und-blocklist.lst: pre-blocklist.o
-+      echo 'blocklist' > $@
-+      $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
-+
-+blocklist_mod-commands_blocklist.o: commands/blocklist.c
-+      $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(blocklist_mod_CFLAGS) -c -o $@ $<
-+
-+blocklist_mod-commands_blocklist.d: commands/blocklist.c
-+      set -e;           $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(blocklist_mod_CFLAGS) -M $<          | sed 's,blocklist\.o[ :]*,blocklist_mod-commands_blocklist.o $@ : ,g' > $@;    [ -s $@ ] || rm -f $@
-+
-+-include blocklist_mod-commands_blocklist.d
-+
-+CLEANFILES += cmd-blocklist_mod-commands_blocklist.lst fs-blocklist_mod-commands_blocklist.lst
-+COMMANDFILES += cmd-blocklist_mod-commands_blocklist.lst
-+FSFILES += fs-blocklist_mod-commands_blocklist.lst
-+
-+cmd-blocklist_mod-commands_blocklist.lst: commands/blocklist.c gencmdlist.sh
-+      set -e;           $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(blocklist_mod_CFLAGS) -E $<          | sh $(srcdir)/gencmdlist.sh blocklist > $@ || (rm -f $@; exit 1)
-+
-+fs-blocklist_mod-commands_blocklist.lst: commands/blocklist.c genfslist.sh
-+      set -e;           $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(blocklist_mod_CFLAGS) -E $<          | sh $(srcdir)/genfslist.sh blocklist > $@ || (rm -f $@; exit 1)
-+
-+
-+blocklist_mod_CFLAGS = $(COMMON_CFLAGS)
-+blocklist_mod_LDFLAGS = $(COMMON_LDFLAGS)
- # Misc.
- pkgdata_MODULES += gzio.mod 
- # For gzio.mod.
- gzio_mod_SOURCES = io/gzio.c
--CLEANFILES += gzio.mod mod-gzio.o mod-gzio.c pre-gzio.o gzio_mod-io_gzio.o def-gzio.lst und-gzio.lst
--MOSTLYCLEANFILES += gzio_mod-io_gzio.d
-+CLEANFILES += gzio.mod mod-gzio.o mod-gzio.c pre-gzio.o gzio_mod-io_gzio.o und-gzio.lst
-+ifneq ($(gzio_mod_EXPORTS),no)
-+CLEANFILES += def-gzio.lst
- DEFSYMFILES += def-gzio.lst
-+endif
-+MOSTLYCLEANFILES += gzio_mod-io_gzio.d
- UNDSYMFILES += und-gzio.lst
- gzio.mod: pre-gzio.o mod-gzio.o
-       -rm -f $@
--      $(LD) $(gzio_mod_LDFLAGS) $(LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(gzio_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
-       $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
- pre-gzio.o: gzio_mod-io_gzio.o
-       -rm -f $@
--      $(LD) $(gzio_mod_LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(gzio_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
- mod-gzio.o: mod-gzio.c
--      $(CC) $(CPPFLAGS) $(CFLAGS) $(gzio_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(gzio_mod_CFLAGS) -c -o $@ $<
- mod-gzio.c: moddep.lst genmodsrc.sh
-       sh $(srcdir)/genmodsrc.sh 'gzio' $< > $@ || (rm -f $@; exit 1)
-+ifneq ($(gzio_mod_EXPORTS),no)
- def-gzio.lst: pre-gzio.o
-       $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 gzio/' > $@
-+endif
- und-gzio.lst: pre-gzio.o
-       echo 'gzio' > $@
-       $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
- gzio_mod-io_gzio.o: io/gzio.c
--      $(CC) -Iio -I$(srcdir)/io $(CPPFLAGS) $(CFLAGS) $(gzio_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Iio -I$(srcdir)/io $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(gzio_mod_CFLAGS) -c -o $@ $<
- gzio_mod-io_gzio.d: io/gzio.c
--      set -e;           $(CC) -Iio -I$(srcdir)/io $(CPPFLAGS) $(CFLAGS) $(gzio_mod_CFLAGS) -M $<        | sed 's,gzio\.o[ :]*,gzio_mod-io_gzio.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Iio -I$(srcdir)/io $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(gzio_mod_CFLAGS) -M $<           | sed 's,gzio\.o[ :]*,gzio_mod-io_gzio.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
- -include gzio_mod-io_gzio.d
-@@ -1782,10 +1895,10 @@
- FSFILES += fs-gzio_mod-io_gzio.lst
- cmd-gzio_mod-io_gzio.lst: io/gzio.c gencmdlist.sh
--      set -e;           $(CC) -Iio -I$(srcdir)/io $(CPPFLAGS) $(CFLAGS) $(gzio_mod_CFLAGS) -E $<        | sh $(srcdir)/gencmdlist.sh gzio > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Iio -I$(srcdir)/io $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(gzio_mod_CFLAGS) -E $<           | sh $(srcdir)/gencmdlist.sh gzio > $@ || (rm -f $@; exit 1)
- fs-gzio_mod-io_gzio.lst: io/gzio.c genfslist.sh
--      set -e;           $(CC) -Iio -I$(srcdir)/io $(CPPFLAGS) $(CFLAGS) $(gzio_mod_CFLAGS) -E $<        | sh $(srcdir)/genfslist.sh gzio > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Iio -I$(srcdir)/io $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(gzio_mod_CFLAGS) -E $<           | sh $(srcdir)/genfslist.sh gzio > $@ || (rm -f $@; exit 1)
- gzio_mod_CFLAGS = $(COMMON_CFLAGS)
-Index: conf/common.rmk
-===================================================================
-RCS file: /cvsroot/grub/grub2/conf/common.rmk,v
-retrieving revision 1.5
-retrieving revision 1.9
-diff -u -r1.5 -r1.9
---- conf/common.rmk    25 Dec 2005 15:59:50 -0000      1.5
-+++ conf/common.rmk    2 Jun 2006 19:33:58 -0000       1.9
-@@ -6,16 +6,16 @@
- DISTCLEANFILES += grub_script.tab.c grub_script.tab.h
- # For grub-emu.
--grub_modules_init.lst: geninit.sh
--      (cd $(srcdir); find . -name '*.c' -printf "%P\n" | xargs grep GRUB_MOD_INIT) > $@
-+grub_modules_init.lst: geninit.sh $(filter-out grub_emu_init.c,$(grub_emu_SOURCES))
-+      rm -f $@; grep GRUB_MOD_INIT $(filter %.c,$^) /dev/null > $@
- DISTCLEANFILES += grub_modules_init.lst
- grub_modules_init.h: $(filter-out grub_emu_init.c,$(grub_emu_SOURCES)) geninitheader.sh grub_modules_init.lst
--      sh $(srcdir)/geninitheader.sh > $@
-+      rm -f $@; sh $(srcdir)/geninitheader.sh > $@
- DISTCLEANFILES += grub_modules_init.h
- grub_emu_init.c: $(filter-out grub_emu_init.c,$(grub_emu_SOURCES)) geninit.sh grub_modules_init.lst grub_modules_init.h
--      sh $(srcdir)/geninit.sh $(filter %.c,$^) > $@
-+      rm -f $@; sh $(srcdir)/geninit.sh $(filter %.c,$^) > $@
- DISTCLEANFILES += grub_emu_init.c
-@@ -121,8 +121,8 @@
- # Commands.
- pkgdata_MODULES += hello.mod boot.mod terminal.mod ls.mod     \
-       cmp.mod cat.mod help.mod font.mod search.mod            \
--      loopback.mod default.mod timeout.mod configfile.mod     \
--      terminfo.mod test.mod
-+      loopback.mod configfile.mod                             \
-+      terminfo.mod test.mod blocklist.mod
- # For hello.mod.
- hello_mod_SOURCES = hello/hello.c
-@@ -179,16 +179,6 @@
- loopback_mod_CFLAGS = $(COMMON_CFLAGS)
- loopback_mod_LDFLAGS = $(COMMON_LDFLAGS)
--# For default.mod
--default_mod_SOURCES = commands/default.c
--default_mod_CFLAGS = $(COMMON_CFLAGS)
--default_mod_LDFLAGS = $(COMMON_LDFLAGS)
--
--# For timeout.mod
--timeout_mod_SOURCES = commands/timeout.c
--timeout_mod_CFLAGS = $(COMMON_CFLAGS)
--timeout_mod_LDFLAGS = $(COMMON_LDFLAGS)
--
- # For configfile.mod
- configfile_mod_SOURCES = commands/configfile.c
- configfile_mod_CFLAGS = $(COMMON_CFLAGS)
-@@ -199,6 +189,10 @@
- terminfo_mod_CFLAGS = $(COMMON_CFLAGS)
- terminfo_mod_LDFLAGS = $(COMMON_LDFLAGS)
-+# For blocklist.mod.
-+blocklist_mod_SOURCES = commands/blocklist.c
-+blocklist_mod_CFLAGS = $(COMMON_CFLAGS)
-+blocklist_mod_LDFLAGS = $(COMMON_LDFLAGS)
- # Misc.
- pkgdata_MODULES += gzio.mod 
-Index: conf/i386-efi.mk
-===================================================================
-RCS file: conf/i386-efi.mk
-diff -N conf/i386-efi.mk
---- /dev/null  1 Jan 1970 00:00:00 -0000
-+++ conf/i386-efi.mk   4 Jun 2006 12:59:19 -0000       1.13
-@@ -0,0 +1,1145 @@
-+# -*- makefile -*-
-+
-+COMMON_ASFLAGS = -nostdinc -fno-builtin -m32
-+COMMON_CFLAGS = -fno-builtin -m32
-+COMMON_LDFLAGS = -melf_i386 -nostdlib
-+
-+# Utilities.
-+bin_UTILITIES = grub-mkimage
-+#sbin_UTILITIES = grub-setup grub-emu grub-mkdevicemap grub-probefs
-+
-+# For grub-mkimage.
-+grub_mkimage_SOURCES = util/i386/efi/grub-mkimage.c util/misc.c \
-+      util/resolve.c
-+CLEANFILES += grub-mkimage grub_mkimage-util_i386_efi_grub_mkimage.o grub_mkimage-util_misc.o grub_mkimage-util_resolve.o
-+MOSTLYCLEANFILES += grub_mkimage-util_i386_efi_grub_mkimage.d grub_mkimage-util_misc.d grub_mkimage-util_resolve.d
-+
-+grub-mkimage: grub_mkimage-util_i386_efi_grub_mkimage.o grub_mkimage-util_misc.o grub_mkimage-util_resolve.o
-+      $(CC) -o $@ $^ $(LDFLAGS) $(grub_mkimage_LDFLAGS)
-+
-+grub_mkimage-util_i386_efi_grub_mkimage.o: util/i386/efi/grub-mkimage.c
-+      $(CC) -Iutil/i386/efi -I$(srcdir)/util/i386/efi $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_mkimage_CFLAGS) -c -o $@ $<
-+
-+grub_mkimage-util_i386_efi_grub_mkimage.d: util/i386/efi/grub-mkimage.c
-+      set -e;           $(CC) -Iutil/i386/efi -I$(srcdir)/util/i386/efi $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_mkimage_CFLAGS) -M $<        | sed 's,grub\-mkimage\.o[ :]*,grub_mkimage-util_i386_efi_grub_mkimage.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
-+
-+-include grub_mkimage-util_i386_efi_grub_mkimage.d
-+
-+grub_mkimage-util_misc.o: util/misc.c
-+      $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_mkimage_CFLAGS) -c -o $@ $<
-+
-+grub_mkimage-util_misc.d: util/misc.c
-+      set -e;           $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_mkimage_CFLAGS) -M $<          | sed 's,misc\.o[ :]*,grub_mkimage-util_misc.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
-+
-+-include grub_mkimage-util_misc.d
-+
-+grub_mkimage-util_resolve.o: util/resolve.c
-+      $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_mkimage_CFLAGS) -c -o $@ $<
-+
-+grub_mkimage-util_resolve.d: util/resolve.c
-+      set -e;           $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_mkimage_CFLAGS) -M $<          | sed 's,resolve\.o[ :]*,grub_mkimage-util_resolve.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
-+
-+-include grub_mkimage-util_resolve.d
-+
-+
-+# For grub-setup.
-+#grub_setup_SOURCES = util/i386/pc/grub-setup.c util/i386/pc/biosdisk.c       \
-+#     util/misc.c util/i386/pc/getroot.c kern/device.c kern/disk.c    \
-+#     kern/err.c kern/misc.c fs/fat.c fs/ext2.c fs/xfs.c fs/affs.c    \
-+#     fs/sfs.c kern/parser.c kern/partition.c partmap/pc.c            \
-+#     fs/ufs.c fs/minix.c fs/hfs.c fs/jfs.c fs/hfsplus.c kern/file.c  \
-+#     kern/fs.c kern/env.c fs/fshelp.c
-+
-+# For grub-mkdevicemap.
-+#grub_mkdevicemap_SOURCES = util/i386/pc/grub-mkdevicemap.c util/misc.c
-+
-+# For grub-probefs.
-+#grub_probefs_SOURCES = util/i386/pc/grub-probefs.c   \
-+#     util/i386/pc/biosdisk.c util/misc.c util/i386/pc/getroot.c      \
-+#     kern/device.c kern/disk.c kern/err.c kern/misc.c fs/fat.c       \
-+#     fs/ext2.c kern/parser.c kern/partition.c partmap/pc.c fs/ufs.c  \
-+#     fs/minix.c fs/hfs.c fs/jfs.c kern/fs.c kern/env.c fs/fshelp.c   \
-+#     fs/xfs.c fs/affs.c fs/sfs.c fs/hfsplus.c
-+
-+# For grub-emu.
-+grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c      \
-+      commands/configfile.c commands/help.c                           \
-+      commands/terminal.c commands/ls.c commands/test.c               \
-+      commands/search.c                                               \
-+      commands/i386/pc/halt.c commands/i386/pc/reboot.c               \
-+      disk/loopback.c                                                 \
-+      fs/affs.c fs/ext2.c fs/fat.c fs/fshelp.c fs/hfs.c fs/iso9660.c  \
-+      fs/jfs.c fs/minix.c fs/sfs.c fs/ufs.c fs/xfs.c fs/hfsplus.c     \
-+      io/gzio.c                                                       \
-+      kern/device.c kern/disk.c kern/dl.c kern/env.c kern/err.c       \
-+      normal/execute.c kern/file.c kern/fs.c normal/lexer.c           \
-+      kern/loader.c kern/main.c kern/misc.c kern/parser.c             \
-+      grub_script.tab.c kern/partition.c kern/rescue.c kern/term.c    \
-+      normal/arg.c normal/cmdline.c normal/command.c normal/function.c\
-+      normal/completion.c normal/context.c normal/main.c              \
-+      normal/menu.c normal/menu_entry.c normal/misc.c normal/script.c \
-+      partmap/amiga.c partmap/apple.c partmap/pc.c partmap/sun.c      \
-+      partmap/acorn.c partmap/gpt.c                                   \
-+      util/console.c util/grub-emu.c util/misc.c                      \
-+      util/i386/pc/biosdisk.c util/i386/pc/getroot.c                  \
-+      util/i386/pc/misc.c grub_emu_init.c
-+
-+grub_emu_LDFLAGS = $(LIBCURSES)
-+
-+# Scripts.
-+#sbin_SCRIPTS = grub-install
-+
-+# For grub-install.
-+#grub_install_SOURCES = util/efi/pc/grub-install.in
-+
-+# Modules.
-+pkgdata_MODULES = kernel.mod normal.mod _chain.mod chain.mod \
-+      _linux.mod linux.mod
-+
-+# For kernel.mod.
-+kernel_mod_EXPORTS = no
-+kernel_mod_SOURCES = kern/i386/efi/startup.S kern/main.c kern/device.c \
-+      kern/disk.c kern/dl.c kern/file.c kern/fs.c kern/err.c \
-+      kern/misc.c kern/mm.c kern/loader.c kern/rescue.c kern/term.c \
-+      kern/i386/dl.c kern/i386/efi/init.c kern/parser.c kern/partition.c \
-+      kern/env.c symlist.c kern/efi/efi.c kern/efi/init.c kern/efi/mm.c \
-+      term/efi/console.c disk/efi/efidisk.c
-+CLEANFILES += kernel.mod mod-kernel.o mod-kernel.c pre-kernel.o kernel_mod-kern_i386_efi_startup.o kernel_mod-kern_main.o kernel_mod-kern_device.o kernel_mod-kern_disk.o kernel_mod-kern_dl.o kernel_mod-kern_file.o kernel_mod-kern_fs.o kernel_mod-kern_err.o kernel_mod-kern_misc.o kernel_mod-kern_mm.o kernel_mod-kern_loader.o kernel_mod-kern_rescue.o kernel_mod-kern_term.o kernel_mod-kern_i386_dl.o kernel_mod-kern_i386_efi_init.o kernel_mod-kern_parser.o kernel_mod-kern_partition.o kernel_mod-kern_env.o kernel_mod-symlist.o kernel_mod-kern_efi_efi.o kernel_mod-kern_efi_init.o kernel_mod-kern_efi_mm.o kernel_mod-term_efi_console.o kernel_mod-disk_efi_efidisk.o und-kernel.lst
-+ifneq ($(kernel_mod_EXPORTS),no)
-+CLEANFILES += def-kernel.lst
-+DEFSYMFILES += def-kernel.lst
-+endif
-+MOSTLYCLEANFILES += kernel_mod-kern_i386_efi_startup.d kernel_mod-kern_main.d kernel_mod-kern_device.d kernel_mod-kern_disk.d kernel_mod-kern_dl.d kernel_mod-kern_file.d kernel_mod-kern_fs.d kernel_mod-kern_err.d kernel_mod-kern_misc.d kernel_mod-kern_mm.d kernel_mod-kern_loader.d kernel_mod-kern_rescue.d kernel_mod-kern_term.d kernel_mod-kern_i386_dl.d kernel_mod-kern_i386_efi_init.d kernel_mod-kern_parser.d kernel_mod-kern_partition.d kernel_mod-kern_env.d kernel_mod-symlist.d kernel_mod-kern_efi_efi.d kernel_mod-kern_efi_init.d kernel_mod-kern_efi_mm.d kernel_mod-term_efi_console.d kernel_mod-disk_efi_efidisk.d
-+UNDSYMFILES += und-kernel.lst
-+
-+kernel.mod: pre-kernel.o mod-kernel.o
-+      -rm -f $@
-+      $(TARGET_CC) $(kernel_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
-+      $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
-+
-+pre-kernel.o: kernel_mod-kern_i386_efi_startup.o kernel_mod-kern_main.o kernel_mod-kern_device.o kernel_mod-kern_disk.o kernel_mod-kern_dl.o kernel_mod-kern_file.o kernel_mod-kern_fs.o kernel_mod-kern_err.o kernel_mod-kern_misc.o kernel_mod-kern_mm.o kernel_mod-kern_loader.o kernel_mod-kern_rescue.o kernel_mod-kern_term.o kernel_mod-kern_i386_dl.o kernel_mod-kern_i386_efi_init.o kernel_mod-kern_parser.o kernel_mod-kern_partition.o kernel_mod-kern_env.o kernel_mod-symlist.o kernel_mod-kern_efi_efi.o kernel_mod-kern_efi_init.o kernel_mod-kern_efi_mm.o kernel_mod-term_efi_console.o kernel_mod-disk_efi_efidisk.o
-+      -rm -f $@
-+      $(TARGET_CC) $(kernel_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
-+
-+mod-kernel.o: mod-kernel.c
-+      $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -c -o $@ $<
-+
-+mod-kernel.c: moddep.lst genmodsrc.sh
-+      sh $(srcdir)/genmodsrc.sh 'kernel' $< > $@ || (rm -f $@; exit 1)
-+
-+ifneq ($(kernel_mod_EXPORTS),no)
-+def-kernel.lst: pre-kernel.o
-+      $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 kernel/' > $@
-+endif
-+
-+und-kernel.lst: pre-kernel.o
-+      echo 'kernel' > $@
-+      $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
-+
-+kernel_mod-kern_i386_efi_startup.o: kern/i386/efi/startup.S
-+      $(TARGET_CC) -Ikern/i386/efi -I$(srcdir)/kern/i386/efi $(TARGET_CPPFLAGS) $(TARGET_ASFLAGS) $(kernel_mod_ASFLAGS) -c -o $@ $<
-+
-+kernel_mod-kern_i386_efi_startup.d: kern/i386/efi/startup.S
-+      set -e;           $(TARGET_CC) -Ikern/i386/efi -I$(srcdir)/kern/i386/efi $(TARGET_CPPFLAGS) $(TARGET_ASFLAGS) $(kernel_mod_ASFLAGS) -M $<         | sed 's,startup\.o[ :]*,kernel_mod-kern_i386_efi_startup.o $@ : ,g' > $@;      [ -s $@ ] || rm -f $@
-+
-+-include kernel_mod-kern_i386_efi_startup.d
-+
-+CLEANFILES += cmd-kernel_mod-kern_i386_efi_startup.lst fs-kernel_mod-kern_i386_efi_startup.lst
-+COMMANDFILES += cmd-kernel_mod-kern_i386_efi_startup.lst
-+FSFILES += fs-kernel_mod-kern_i386_efi_startup.lst
-+
-+cmd-kernel_mod-kern_i386_efi_startup.lst: kern/i386/efi/startup.S gencmdlist.sh
-+      set -e;           $(TARGET_CC) -Ikern/i386/efi -I$(srcdir)/kern/i386/efi $(TARGET_CPPFLAGS) $(TARGET_ASFLAGS) $(kernel_mod_ASFLAGS) -E $<         | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1)
-+
-+fs-kernel_mod-kern_i386_efi_startup.lst: kern/i386/efi/startup.S genfslist.sh
-+      set -e;           $(TARGET_CC) -Ikern/i386/efi -I$(srcdir)/kern/i386/efi $(TARGET_CPPFLAGS) $(TARGET_ASFLAGS) $(kernel_mod_ASFLAGS) -E $<         | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1)
-+
-+
-+kernel_mod-kern_main.o: kern/main.c
-+      $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -c -o $@ $<
-+
-+kernel_mod-kern_main.d: kern/main.c
-+      set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -M $<     | sed 's,main\.o[ :]*,kernel_mod-kern_main.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
-+
-+-include kernel_mod-kern_main.d
-+
-+CLEANFILES += cmd-kernel_mod-kern_main.lst fs-kernel_mod-kern_main.lst
-+COMMANDFILES += cmd-kernel_mod-kern_main.lst
-+FSFILES += fs-kernel_mod-kern_main.lst
-+
-+cmd-kernel_mod-kern_main.lst: kern/main.c gencmdlist.sh
-+      set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $<     | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1)
-+
-+fs-kernel_mod-kern_main.lst: kern/main.c genfslist.sh
-+      set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $<     | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1)
-+
-+
-+kernel_mod-kern_device.o: kern/device.c
-+      $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -c -o $@ $<
-+
-+kernel_mod-kern_device.d: kern/device.c
-+      set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -M $<     | sed 's,device\.o[ :]*,kernel_mod-kern_device.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
-+
-+-include kernel_mod-kern_device.d
-+
-+CLEANFILES += cmd-kernel_mod-kern_device.lst fs-kernel_mod-kern_device.lst
-+COMMANDFILES += cmd-kernel_mod-kern_device.lst
-+FSFILES += fs-kernel_mod-kern_device.lst
-+
-+cmd-kernel_mod-kern_device.lst: kern/device.c gencmdlist.sh
-+      set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $<     | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1)
-+
-+fs-kernel_mod-kern_device.lst: kern/device.c genfslist.sh
-+      set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $<     | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1)
-+
-+
-+kernel_mod-kern_disk.o: kern/disk.c
-+      $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -c -o $@ $<
-+
-+kernel_mod-kern_disk.d: kern/disk.c
-+      set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -M $<     | sed 's,disk\.o[ :]*,kernel_mod-kern_disk.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
-+
-+-include kernel_mod-kern_disk.d
-+
-+CLEANFILES += cmd-kernel_mod-kern_disk.lst fs-kernel_mod-kern_disk.lst
-+COMMANDFILES += cmd-kernel_mod-kern_disk.lst
-+FSFILES += fs-kernel_mod-kern_disk.lst
-+
-+cmd-kernel_mod-kern_disk.lst: kern/disk.c gencmdlist.sh
-+      set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $<     | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1)
-+
-+fs-kernel_mod-kern_disk.lst: kern/disk.c genfslist.sh
-+      set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $<     | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1)
-+
-+
-+kernel_mod-kern_dl.o: kern/dl.c
-+      $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -c -o $@ $<
-+
-+kernel_mod-kern_dl.d: kern/dl.c
-+      set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -M $<     | sed 's,dl\.o[ :]*,kernel_mod-kern_dl.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
-+
-+-include kernel_mod-kern_dl.d
-+
-+CLEANFILES += cmd-kernel_mod-kern_dl.lst fs-kernel_mod-kern_dl.lst
-+COMMANDFILES += cmd-kernel_mod-kern_dl.lst
-+FSFILES += fs-kernel_mod-kern_dl.lst
-+
-+cmd-kernel_mod-kern_dl.lst: kern/dl.c gencmdlist.sh
-+      set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $<     | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1)
-+
-+fs-kernel_mod-kern_dl.lst: kern/dl.c genfslist.sh
-+      set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $<     | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1)
-+
-+
-+kernel_mod-kern_file.o: kern/file.c
-+      $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -c -o $@ $<
-+
-+kernel_mod-kern_file.d: kern/file.c
-+      set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -M $<     | sed 's,file\.o[ :]*,kernel_mod-kern_file.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
-+
-+-include kernel_mod-kern_file.d
-+
-+CLEANFILES += cmd-kernel_mod-kern_file.lst fs-kernel_mod-kern_file.lst
-+COMMANDFILES += cmd-kernel_mod-kern_file.lst
-+FSFILES += fs-kernel_mod-kern_file.lst
-+
-+cmd-kernel_mod-kern_file.lst: kern/file.c gencmdlist.sh
-+      set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $<     | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1)
-+
-+fs-kernel_mod-kern_file.lst: kern/file.c genfslist.sh
-+      set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $<     | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1)
-+
-+
-+kernel_mod-kern_fs.o: kern/fs.c
-+      $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -c -o $@ $<
-+
-+kernel_mod-kern_fs.d: kern/fs.c
-+      set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -M $<     | sed 's,fs\.o[ :]*,kernel_mod-kern_fs.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
-+
-+-include kernel_mod-kern_fs.d
-+
-+CLEANFILES += cmd-kernel_mod-kern_fs.lst fs-kernel_mod-kern_fs.lst
-+COMMANDFILES += cmd-kernel_mod-kern_fs.lst
-+FSFILES += fs-kernel_mod-kern_fs.lst
-+
-+cmd-kernel_mod-kern_fs.lst: kern/fs.c gencmdlist.sh
-+      set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $<     | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1)
-+
-+fs-kernel_mod-kern_fs.lst: kern/fs.c genfslist.sh
-+      set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $<     | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1)
-+
-+
-+kernel_mod-kern_err.o: kern/err.c
-+      $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -c -o $@ $<
-+
-+kernel_mod-kern_err.d: kern/err.c
-+      set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -M $<     | sed 's,err\.o[ :]*,kernel_mod-kern_err.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
-+
-+-include kernel_mod-kern_err.d
-+
-+CLEANFILES += cmd-kernel_mod-kern_err.lst fs-kernel_mod-kern_err.lst
-+COMMANDFILES += cmd-kernel_mod-kern_err.lst
-+FSFILES += fs-kernel_mod-kern_err.lst
-+
-+cmd-kernel_mod-kern_err.lst: kern/err.c gencmdlist.sh
-+      set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $<     | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1)
-+
-+fs-kernel_mod-kern_err.lst: kern/err.c genfslist.sh
-+      set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $<     | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1)
-+
-+
-+kernel_mod-kern_misc.o: kern/misc.c
-+      $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -c -o $@ $<
-+
-+kernel_mod-kern_misc.d: kern/misc.c
-+      set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -M $<     | sed 's,misc\.o[ :]*,kernel_mod-kern_misc.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
-+
-+-include kernel_mod-kern_misc.d
-+
-+CLEANFILES += cmd-kernel_mod-kern_misc.lst fs-kernel_mod-kern_misc.lst
-+COMMANDFILES += cmd-kernel_mod-kern_misc.lst
-+FSFILES += fs-kernel_mod-kern_misc.lst
-+
-+cmd-kernel_mod-kern_misc.lst: kern/misc.c gencmdlist.sh
-+      set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $<     | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1)
-+
-+fs-kernel_mod-kern_misc.lst: kern/misc.c genfslist.sh
-+      set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $<     | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1)
-+
-+
-+kernel_mod-kern_mm.o: kern/mm.c
-+      $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -c -o $@ $<
-+
-+kernel_mod-kern_mm.d: kern/mm.c
-+      set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -M $<     | sed 's,mm\.o[ :]*,kernel_mod-kern_mm.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
-+
-+-include kernel_mod-kern_mm.d
-+
-+CLEANFILES += cmd-kernel_mod-kern_mm.lst fs-kernel_mod-kern_mm.lst
-+COMMANDFILES += cmd-kernel_mod-kern_mm.lst
-+FSFILES += fs-kernel_mod-kern_mm.lst
-+
-+cmd-kernel_mod-kern_mm.lst: kern/mm.c gencmdlist.sh
-+      set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $<     | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1)
-+
-+fs-kernel_mod-kern_mm.lst: kern/mm.c genfslist.sh
-+      set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $<     | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1)
-+
-+
-+kernel_mod-kern_loader.o: kern/loader.c
-+      $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -c -o $@ $<
-+
-+kernel_mod-kern_loader.d: kern/loader.c
-+      set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -M $<     | sed 's,loader\.o[ :]*,kernel_mod-kern_loader.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
-+
-+-include kernel_mod-kern_loader.d
-+
-+CLEANFILES += cmd-kernel_mod-kern_loader.lst fs-kernel_mod-kern_loader.lst
-+COMMANDFILES += cmd-kernel_mod-kern_loader.lst
-+FSFILES += fs-kernel_mod-kern_loader.lst
-+
-+cmd-kernel_mod-kern_loader.lst: kern/loader.c gencmdlist.sh
-+      set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $<     | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1)
-+
-+fs-kernel_mod-kern_loader.lst: kern/loader.c genfslist.sh
-+      set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $<     | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1)
-+
-+
-+kernel_mod-kern_rescue.o: kern/rescue.c
-+      $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -c -o $@ $<
-+
-+kernel_mod-kern_rescue.d: kern/rescue.c
-+      set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -M $<     | sed 's,rescue\.o[ :]*,kernel_mod-kern_rescue.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
-+
-+-include kernel_mod-kern_rescue.d
-+
-+CLEANFILES += cmd-kernel_mod-kern_rescue.lst fs-kernel_mod-kern_rescue.lst
-+COMMANDFILES += cmd-kernel_mod-kern_rescue.lst
-+FSFILES += fs-kernel_mod-kern_rescue.lst
-+
-+cmd-kernel_mod-kern_rescue.lst: kern/rescue.c gencmdlist.sh
-+      set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $<     | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1)
-+
-+fs-kernel_mod-kern_rescue.lst: kern/rescue.c genfslist.sh
-+      set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $<     | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1)
-+
-+
-+kernel_mod-kern_term.o: kern/term.c
-+      $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -c -o $@ $<
-+
-+kernel_mod-kern_term.d: kern/term.c
-+      set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -M $<     | sed 's,term\.o[ :]*,kernel_mod-kern_term.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
-+
-+-include kernel_mod-kern_term.d
-+
-+CLEANFILES += cmd-kernel_mod-kern_term.lst fs-kernel_mod-kern_term.lst
-+COMMANDFILES += cmd-kernel_mod-kern_term.lst
-+FSFILES += fs-kernel_mod-kern_term.lst
-+
-+cmd-kernel_mod-kern_term.lst: kern/term.c gencmdlist.sh
-+      set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $<     | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1)
-+
-+fs-kernel_mod-kern_term.lst: kern/term.c genfslist.sh
-+      set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $<     | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1)
-+
-+
-+kernel_mod-kern_i386_dl.o: kern/i386/dl.c
-+      $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -c -o $@ $<
-+
-+kernel_mod-kern_i386_dl.d: kern/i386/dl.c
-+      set -e;           $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -M $<           | sed 's,dl\.o[ :]*,kernel_mod-kern_i386_dl.o $@ : ,g' > $@;    [ -s $@ ] || rm -f $@
-+
-+-include kernel_mod-kern_i386_dl.d
-+
-+CLEANFILES += cmd-kernel_mod-kern_i386_dl.lst fs-kernel_mod-kern_i386_dl.lst
-+COMMANDFILES += cmd-kernel_mod-kern_i386_dl.lst
-+FSFILES += fs-kernel_mod-kern_i386_dl.lst
-+
-+cmd-kernel_mod-kern_i386_dl.lst: kern/i386/dl.c gencmdlist.sh
-+      set -e;           $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $<           | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1)
-+
-+fs-kernel_mod-kern_i386_dl.lst: kern/i386/dl.c genfslist.sh
-+      set -e;           $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $<           | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1)
-+
-+
-+kernel_mod-kern_i386_efi_init.o: kern/i386/efi/init.c
-+      $(TARGET_CC) -Ikern/i386/efi -I$(srcdir)/kern/i386/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -c -o $@ $<
-+
-+kernel_mod-kern_i386_efi_init.d: kern/i386/efi/init.c
-+      set -e;           $(TARGET_CC) -Ikern/i386/efi -I$(srcdir)/kern/i386/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -M $<           | sed 's,init\.o[ :]*,kernel_mod-kern_i386_efi_init.o $@ : ,g' > $@;    [ -s $@ ] || rm -f $@
-+
-+-include kernel_mod-kern_i386_efi_init.d
-+
-+CLEANFILES += cmd-kernel_mod-kern_i386_efi_init.lst fs-kernel_mod-kern_i386_efi_init.lst
-+COMMANDFILES += cmd-kernel_mod-kern_i386_efi_init.lst
-+FSFILES += fs-kernel_mod-kern_i386_efi_init.lst
-+
-+cmd-kernel_mod-kern_i386_efi_init.lst: kern/i386/efi/init.c gencmdlist.sh
-+      set -e;           $(TARGET_CC) -Ikern/i386/efi -I$(srcdir)/kern/i386/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $<           | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1)
-+
-+fs-kernel_mod-kern_i386_efi_init.lst: kern/i386/efi/init.c genfslist.sh
-+      set -e;           $(TARGET_CC) -Ikern/i386/efi -I$(srcdir)/kern/i386/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $<           | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1)
-+
-+
-+kernel_mod-kern_parser.o: kern/parser.c
-+      $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -c -o $@ $<
-+
-+kernel_mod-kern_parser.d: kern/parser.c
-+      set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -M $<     | sed 's,parser\.o[ :]*,kernel_mod-kern_parser.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
-+
-+-include kernel_mod-kern_parser.d
-+
-+CLEANFILES += cmd-kernel_mod-kern_parser.lst fs-kernel_mod-kern_parser.lst
-+COMMANDFILES += cmd-kernel_mod-kern_parser.lst
-+FSFILES += fs-kernel_mod-kern_parser.lst
-+
-+cmd-kernel_mod-kern_parser.lst: kern/parser.c gencmdlist.sh
-+      set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $<     | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1)
-+
-+fs-kernel_mod-kern_parser.lst: kern/parser.c genfslist.sh
-+      set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $<     | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1)
-+
-+
-+kernel_mod-kern_partition.o: kern/partition.c
-+      $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -c -o $@ $<
-+
-+kernel_mod-kern_partition.d: kern/partition.c
-+      set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -M $<     | sed 's,partition\.o[ :]*,kernel_mod-kern_partition.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
-+
-+-include kernel_mod-kern_partition.d
-+
-+CLEANFILES += cmd-kernel_mod-kern_partition.lst fs-kernel_mod-kern_partition.lst
-+COMMANDFILES += cmd-kernel_mod-kern_partition.lst
-+FSFILES += fs-kernel_mod-kern_partition.lst
-+
-+cmd-kernel_mod-kern_partition.lst: kern/partition.c gencmdlist.sh
-+      set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $<     | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1)
-+
-+fs-kernel_mod-kern_partition.lst: kern/partition.c genfslist.sh
-+      set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $<     | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1)
-+
-+
-+kernel_mod-kern_env.o: kern/env.c
-+      $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -c -o $@ $<
-+
-+kernel_mod-kern_env.d: kern/env.c
-+      set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -M $<     | sed 's,env\.o[ :]*,kernel_mod-kern_env.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
-+
-+-include kernel_mod-kern_env.d
-+
-+CLEANFILES += cmd-kernel_mod-kern_env.lst fs-kernel_mod-kern_env.lst
-+COMMANDFILES += cmd-kernel_mod-kern_env.lst
-+FSFILES += fs-kernel_mod-kern_env.lst
-+
-+cmd-kernel_mod-kern_env.lst: kern/env.c gencmdlist.sh
-+      set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $<     | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1)
-+
-+fs-kernel_mod-kern_env.lst: kern/env.c genfslist.sh
-+      set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $<     | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1)
-+
-+
-+kernel_mod-symlist.o: symlist.c
-+      $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -c -o $@ $<
-+
-+kernel_mod-symlist.d: symlist.c
-+      set -e;           $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -M $<           | sed 's,symlist\.o[ :]*,kernel_mod-symlist.o $@ : ,g' > $@;    [ -s $@ ] || rm -f $@
-+
-+-include kernel_mod-symlist.d
-+
-+CLEANFILES += cmd-kernel_mod-symlist.lst fs-kernel_mod-symlist.lst
-+COMMANDFILES += cmd-kernel_mod-symlist.lst
-+FSFILES += fs-kernel_mod-symlist.lst
-+
-+cmd-kernel_mod-symlist.lst: symlist.c gencmdlist.sh
-+      set -e;           $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $<           | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1)
-+
-+fs-kernel_mod-symlist.lst: symlist.c genfslist.sh
-+      set -e;           $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $<           | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1)
-+
-+
-+kernel_mod-kern_efi_efi.o: kern/efi/efi.c
-+      $(TARGET_CC) -Ikern/efi -I$(srcdir)/kern/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -c -o $@ $<
-+
-+kernel_mod-kern_efi_efi.d: kern/efi/efi.c
-+      set -e;           $(TARGET_CC) -Ikern/efi -I$(srcdir)/kern/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -M $<     | sed 's,efi\.o[ :]*,kernel_mod-kern_efi_efi.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
-+
-+-include kernel_mod-kern_efi_efi.d
-+
-+CLEANFILES += cmd-kernel_mod-kern_efi_efi.lst fs-kernel_mod-kern_efi_efi.lst
-+COMMANDFILES += cmd-kernel_mod-kern_efi_efi.lst
-+FSFILES += fs-kernel_mod-kern_efi_efi.lst
-+
-+cmd-kernel_mod-kern_efi_efi.lst: kern/efi/efi.c gencmdlist.sh
-+      set -e;           $(TARGET_CC) -Ikern/efi -I$(srcdir)/kern/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $<     | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1)
-+
-+fs-kernel_mod-kern_efi_efi.lst: kern/efi/efi.c genfslist.sh
-+      set -e;           $(TARGET_CC) -Ikern/efi -I$(srcdir)/kern/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $<     | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1)
-+
-+
-+kernel_mod-kern_efi_init.o: kern/efi/init.c
-+      $(TARGET_CC) -Ikern/efi -I$(srcdir)/kern/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -c -o $@ $<
-+
-+kernel_mod-kern_efi_init.d: kern/efi/init.c
-+      set -e;           $(TARGET_CC) -Ikern/efi -I$(srcdir)/kern/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -M $<     | sed 's,init\.o[ :]*,kernel_mod-kern_efi_init.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
-+
-+-include kernel_mod-kern_efi_init.d
-+
-+CLEANFILES += cmd-kernel_mod-kern_efi_init.lst fs-kernel_mod-kern_efi_init.lst
-+COMMANDFILES += cmd-kernel_mod-kern_efi_init.lst
-+FSFILES += fs-kernel_mod-kern_efi_init.lst
-+
-+cmd-kernel_mod-kern_efi_init.lst: kern/efi/init.c gencmdlist.sh
-+      set -e;           $(TARGET_CC) -Ikern/efi -I$(srcdir)/kern/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $<     | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1)
-+
-+fs-kernel_mod-kern_efi_init.lst: kern/efi/init.c genfslist.sh
-+      set -e;           $(TARGET_CC) -Ikern/efi -I$(srcdir)/kern/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $<     | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1)
-+
-+
-+kernel_mod-kern_efi_mm.o: kern/efi/mm.c
-+      $(TARGET_CC) -Ikern/efi -I$(srcdir)/kern/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -c -o $@ $<
-+
-+kernel_mod-kern_efi_mm.d: kern/efi/mm.c
-+      set -e;           $(TARGET_CC) -Ikern/efi -I$(srcdir)/kern/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -M $<     | sed 's,mm\.o[ :]*,kernel_mod-kern_efi_mm.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
-+
-+-include kernel_mod-kern_efi_mm.d
-+
-+CLEANFILES += cmd-kernel_mod-kern_efi_mm.lst fs-kernel_mod-kern_efi_mm.lst
-+COMMANDFILES += cmd-kernel_mod-kern_efi_mm.lst
-+FSFILES += fs-kernel_mod-kern_efi_mm.lst
-+
-+cmd-kernel_mod-kern_efi_mm.lst: kern/efi/mm.c gencmdlist.sh
-+      set -e;           $(TARGET_CC) -Ikern/efi -I$(srcdir)/kern/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $<     | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1)
-+
-+fs-kernel_mod-kern_efi_mm.lst: kern/efi/mm.c genfslist.sh
-+      set -e;           $(TARGET_CC) -Ikern/efi -I$(srcdir)/kern/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $<     | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1)
-+
-+
-+kernel_mod-term_efi_console.o: term/efi/console.c
-+      $(TARGET_CC) -Iterm/efi -I$(srcdir)/term/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -c -o $@ $<
-+
-+kernel_mod-term_efi_console.d: term/efi/console.c
-+      set -e;           $(TARGET_CC) -Iterm/efi -I$(srcdir)/term/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -M $<     | sed 's,console\.o[ :]*,kernel_mod-term_efi_console.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
-+
-+-include kernel_mod-term_efi_console.d
-+
-+CLEANFILES += cmd-kernel_mod-term_efi_console.lst fs-kernel_mod-term_efi_console.lst
-+COMMANDFILES += cmd-kernel_mod-term_efi_console.lst
-+FSFILES += fs-kernel_mod-term_efi_console.lst
-+
-+cmd-kernel_mod-term_efi_console.lst: term/efi/console.c gencmdlist.sh
-+      set -e;           $(TARGET_CC) -Iterm/efi -I$(srcdir)/term/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $<     | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1)
-+
-+fs-kernel_mod-term_efi_console.lst: term/efi/console.c genfslist.sh
-+      set -e;           $(TARGET_CC) -Iterm/efi -I$(srcdir)/term/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $<     | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1)
-+
-+
-+kernel_mod-disk_efi_efidisk.o: disk/efi/efidisk.c
-+      $(TARGET_CC) -Idisk/efi -I$(srcdir)/disk/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -c -o $@ $<
-+
-+kernel_mod-disk_efi_efidisk.d: disk/efi/efidisk.c
-+      set -e;           $(TARGET_CC) -Idisk/efi -I$(srcdir)/disk/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -M $<     | sed 's,efidisk\.o[ :]*,kernel_mod-disk_efi_efidisk.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
-+
-+-include kernel_mod-disk_efi_efidisk.d
-+
-+CLEANFILES += cmd-kernel_mod-disk_efi_efidisk.lst fs-kernel_mod-disk_efi_efidisk.lst
-+COMMANDFILES += cmd-kernel_mod-disk_efi_efidisk.lst
-+FSFILES += fs-kernel_mod-disk_efi_efidisk.lst
-+
-+cmd-kernel_mod-disk_efi_efidisk.lst: disk/efi/efidisk.c gencmdlist.sh
-+      set -e;           $(TARGET_CC) -Idisk/efi -I$(srcdir)/disk/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $<     | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1)
-+
-+fs-kernel_mod-disk_efi_efidisk.lst: disk/efi/efidisk.c genfslist.sh
-+      set -e;           $(TARGET_CC) -Idisk/efi -I$(srcdir)/disk/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $<     | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1)
-+
-+
-+kernel_mod_HEADERS = arg.h boot.h device.h disk.h dl.h elf.h env.h err.h \
-+      file.h fs.h kernel.h loader.h misc.h mm.h net.h parser.h partition.h \
-+      pc_partition.h rescue.h symbol.h term.h types.h \
-+      i386/efi/time.h efi/efi.h efi/time.h efi/disk.h
-+kernel_mod_CFLAGS = $(COMMON_CFLAGS)
-+kernel_mod_ASFLAGS = $(COMMON_ASFLAGS)
-+kernel_mod_LDFLAGS = $(COMMON_LDFLAGS)
-+
-+MOSTLYCLEANFILES += symlist.c
-+MOSTLYCLEANFILES += symlist.c kernel_syms.lst
-+DEFSYMFILES += kernel_syms.lst
-+
-+symlist.c: $(addprefix include/grub/,$(kernel_mod_HEADERS)) config.h gensymlist.sh
-+      /bin/sh gensymlist.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1)
-+
-+kernel_syms.lst: $(addprefix include/grub/,$(kernel_mod_HEADERS)) config.h genkernsyms.sh
-+      /bin/sh genkernsyms.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1)
-+
-+# For normal.mod.
-+normal_mod_SOURCES = normal/arg.c normal/cmdline.c normal/command.c   \
-+      normal/completion.c normal/execute.c            \
-+      normal/function.c normal/lexer.c normal/main.c normal/menu.c    \
-+      normal/menu_entry.c normal/misc.c grub_script.tab.c             \
-+      normal/script.c normal/i386/setjmp.S
-+CLEANFILES += normal.mod mod-normal.o mod-normal.c pre-normal.o normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_i386_setjmp.o und-normal.lst
-+ifneq ($(normal_mod_EXPORTS),no)
-+CLEANFILES += def-normal.lst
-+DEFSYMFILES += def-normal.lst
-+endif
-+MOSTLYCLEANFILES += normal_mod-normal_arg.d normal_mod-normal_cmdline.d normal_mod-normal_command.d normal_mod-normal_completion.d normal_mod-normal_execute.d normal_mod-normal_function.d normal_mod-normal_lexer.d normal_mod-normal_main.d normal_mod-normal_menu.d normal_mod-normal_menu_entry.d normal_mod-normal_misc.d normal_mod-grub_script_tab.d normal_mod-normal_script.d normal_mod-normal_i386_setjmp.d
-+UNDSYMFILES += und-normal.lst
-+
-+normal.mod: pre-normal.o mod-normal.o
-+      -rm -f $@
-+      $(TARGET_CC) $(normal_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
-+      $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
-+
-+pre-normal.o: normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_i386_setjmp.o
-+      -rm -f $@
-+      $(TARGET_CC) $(normal_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
-+
-+mod-normal.o: mod-normal.c
-+      $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
-+
-+mod-normal.c: moddep.lst genmodsrc.sh
-+      sh $(srcdir)/genmodsrc.sh 'normal' $< > $@ || (rm -f $@; exit 1)
-+
-+ifneq ($(normal_mod_EXPORTS),no)
-+def-normal.lst: pre-normal.o
-+      $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 normal/' > $@
-+endif
-+
-+und-normal.lst: pre-normal.o
-+      echo 'normal' > $@
-+      $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
-+
-+normal_mod-normal_arg.o: normal/arg.c
-+      $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
-+
-+normal_mod-normal_arg.d: normal/arg.c
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -M $<         | sed 's,arg\.o[ :]*,normal_mod-normal_arg.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
-+
-+-include normal_mod-normal_arg.d
-+
-+CLEANFILES += cmd-normal_mod-normal_arg.lst fs-normal_mod-normal_arg.lst
-+COMMANDFILES += cmd-normal_mod-normal_arg.lst
-+FSFILES += fs-normal_mod-normal_arg.lst
-+
-+cmd-normal_mod-normal_arg.lst: normal/arg.c gencmdlist.sh
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $<         | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
-+
-+fs-normal_mod-normal_arg.lst: normal/arg.c genfslist.sh
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $<         | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
-+
-+
-+normal_mod-normal_cmdline.o: normal/cmdline.c
-+      $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
-+
-+normal_mod-normal_cmdline.d: normal/cmdline.c
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -M $<         | sed 's,cmdline\.o[ :]*,normal_mod-normal_cmdline.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
-+
-+-include normal_mod-normal_cmdline.d
-+
-+CLEANFILES += cmd-normal_mod-normal_cmdline.lst fs-normal_mod-normal_cmdline.lst
-+COMMANDFILES += cmd-normal_mod-normal_cmdline.lst
-+FSFILES += fs-normal_mod-normal_cmdline.lst
-+
-+cmd-normal_mod-normal_cmdline.lst: normal/cmdline.c gencmdlist.sh
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $<         | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
-+
-+fs-normal_mod-normal_cmdline.lst: normal/cmdline.c genfslist.sh
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $<         | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
-+
-+
-+normal_mod-normal_command.o: normal/command.c
-+      $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
-+
-+normal_mod-normal_command.d: normal/command.c
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -M $<         | sed 's,command\.o[ :]*,normal_mod-normal_command.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
-+
-+-include normal_mod-normal_command.d
-+
-+CLEANFILES += cmd-normal_mod-normal_command.lst fs-normal_mod-normal_command.lst
-+COMMANDFILES += cmd-normal_mod-normal_command.lst
-+FSFILES += fs-normal_mod-normal_command.lst
-+
-+cmd-normal_mod-normal_command.lst: normal/command.c gencmdlist.sh
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $<         | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
-+
-+fs-normal_mod-normal_command.lst: normal/command.c genfslist.sh
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $<         | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
-+
-+
-+normal_mod-normal_completion.o: normal/completion.c
-+      $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
-+
-+normal_mod-normal_completion.d: normal/completion.c
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -M $<         | sed 's,completion\.o[ :]*,normal_mod-normal_completion.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
-+
-+-include normal_mod-normal_completion.d
-+
-+CLEANFILES += cmd-normal_mod-normal_completion.lst fs-normal_mod-normal_completion.lst
-+COMMANDFILES += cmd-normal_mod-normal_completion.lst
-+FSFILES += fs-normal_mod-normal_completion.lst
-+
-+cmd-normal_mod-normal_completion.lst: normal/completion.c gencmdlist.sh
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $<         | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
-+
-+fs-normal_mod-normal_completion.lst: normal/completion.c genfslist.sh
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $<         | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
-+
-+
-+normal_mod-normal_execute.o: normal/execute.c
-+      $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
-+
-+normal_mod-normal_execute.d: normal/execute.c
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -M $<         | sed 's,execute\.o[ :]*,normal_mod-normal_execute.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
-+
-+-include normal_mod-normal_execute.d
-+
-+CLEANFILES += cmd-normal_mod-normal_execute.lst fs-normal_mod-normal_execute.lst
-+COMMANDFILES += cmd-normal_mod-normal_execute.lst
-+FSFILES += fs-normal_mod-normal_execute.lst
-+
-+cmd-normal_mod-normal_execute.lst: normal/execute.c gencmdlist.sh
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $<         | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
-+
-+fs-normal_mod-normal_execute.lst: normal/execute.c genfslist.sh
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $<         | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
-+
-+
-+normal_mod-normal_function.o: normal/function.c
-+      $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
-+
-+normal_mod-normal_function.d: normal/function.c
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -M $<         | sed 's,function\.o[ :]*,normal_mod-normal_function.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
-+
-+-include normal_mod-normal_function.d
-+
-+CLEANFILES += cmd-normal_mod-normal_function.lst fs-normal_mod-normal_function.lst
-+COMMANDFILES += cmd-normal_mod-normal_function.lst
-+FSFILES += fs-normal_mod-normal_function.lst
-+
-+cmd-normal_mod-normal_function.lst: normal/function.c gencmdlist.sh
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $<         | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
-+
-+fs-normal_mod-normal_function.lst: normal/function.c genfslist.sh
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $<         | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
-+
-+
-+normal_mod-normal_lexer.o: normal/lexer.c
-+      $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
-+
-+normal_mod-normal_lexer.d: normal/lexer.c
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -M $<         | sed 's,lexer\.o[ :]*,normal_mod-normal_lexer.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
-+
-+-include normal_mod-normal_lexer.d
-+
-+CLEANFILES += cmd-normal_mod-normal_lexer.lst fs-normal_mod-normal_lexer.lst
-+COMMANDFILES += cmd-normal_mod-normal_lexer.lst
-+FSFILES += fs-normal_mod-normal_lexer.lst
-+
-+cmd-normal_mod-normal_lexer.lst: normal/lexer.c gencmdlist.sh
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $<         | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
-+
-+fs-normal_mod-normal_lexer.lst: normal/lexer.c genfslist.sh
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $<         | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
-+
-+
-+normal_mod-normal_main.o: normal/main.c
-+      $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
-+
-+normal_mod-normal_main.d: normal/main.c
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -M $<         | sed 's,main\.o[ :]*,normal_mod-normal_main.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
-+
-+-include normal_mod-normal_main.d
-+
-+CLEANFILES += cmd-normal_mod-normal_main.lst fs-normal_mod-normal_main.lst
-+COMMANDFILES += cmd-normal_mod-normal_main.lst
-+FSFILES += fs-normal_mod-normal_main.lst
-+
-+cmd-normal_mod-normal_main.lst: normal/main.c gencmdlist.sh
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $<         | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
-+
-+fs-normal_mod-normal_main.lst: normal/main.c genfslist.sh
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $<         | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
-+
-+
-+normal_mod-normal_menu.o: normal/menu.c
-+      $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
-+
-+normal_mod-normal_menu.d: normal/menu.c
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -M $<         | sed 's,menu\.o[ :]*,normal_mod-normal_menu.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
-+
-+-include normal_mod-normal_menu.d
-+
-+CLEANFILES += cmd-normal_mod-normal_menu.lst fs-normal_mod-normal_menu.lst
-+COMMANDFILES += cmd-normal_mod-normal_menu.lst
-+FSFILES += fs-normal_mod-normal_menu.lst
-+
-+cmd-normal_mod-normal_menu.lst: normal/menu.c gencmdlist.sh
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $<         | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
-+
-+fs-normal_mod-normal_menu.lst: normal/menu.c genfslist.sh
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $<         | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
-+
-+
-+normal_mod-normal_menu_entry.o: normal/menu_entry.c
-+      $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
-+
-+normal_mod-normal_menu_entry.d: normal/menu_entry.c
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -M $<         | sed 's,menu_entry\.o[ :]*,normal_mod-normal_menu_entry.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
-+
-+-include normal_mod-normal_menu_entry.d
-+
-+CLEANFILES += cmd-normal_mod-normal_menu_entry.lst fs-normal_mod-normal_menu_entry.lst
-+COMMANDFILES += cmd-normal_mod-normal_menu_entry.lst
-+FSFILES += fs-normal_mod-normal_menu_entry.lst
-+
-+cmd-normal_mod-normal_menu_entry.lst: normal/menu_entry.c gencmdlist.sh
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $<         | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
-+
-+fs-normal_mod-normal_menu_entry.lst: normal/menu_entry.c genfslist.sh
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $<         | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
-+
-+
-+normal_mod-normal_misc.o: normal/misc.c
-+      $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
-+
-+normal_mod-normal_misc.d: normal/misc.c
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -M $<         | sed 's,misc\.o[ :]*,normal_mod-normal_misc.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
-+
-+-include normal_mod-normal_misc.d
-+
-+CLEANFILES += cmd-normal_mod-normal_misc.lst fs-normal_mod-normal_misc.lst
-+COMMANDFILES += cmd-normal_mod-normal_misc.lst
-+FSFILES += fs-normal_mod-normal_misc.lst
-+
-+cmd-normal_mod-normal_misc.lst: normal/misc.c gencmdlist.sh
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $<         | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
-+
-+fs-normal_mod-normal_misc.lst: normal/misc.c genfslist.sh
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $<         | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
-+
-+
-+normal_mod-grub_script_tab.o: grub_script.tab.c
-+      $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
-+
-+normal_mod-grub_script_tab.d: grub_script.tab.c
-+      set -e;           $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -M $<           | sed 's,grub_script\.tab\.o[ :]*,normal_mod-grub_script_tab.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
-+
-+-include normal_mod-grub_script_tab.d
-+
-+CLEANFILES += cmd-normal_mod-grub_script_tab.lst fs-normal_mod-grub_script_tab.lst
-+COMMANDFILES += cmd-normal_mod-grub_script_tab.lst
-+FSFILES += fs-normal_mod-grub_script_tab.lst
-+
-+cmd-normal_mod-grub_script_tab.lst: grub_script.tab.c gencmdlist.sh
-+      set -e;           $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $<           | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
-+
-+fs-normal_mod-grub_script_tab.lst: grub_script.tab.c genfslist.sh
-+      set -e;           $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $<           | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
-+
-+
-+normal_mod-normal_script.o: normal/script.c
-+      $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
-+
-+normal_mod-normal_script.d: normal/script.c
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -M $<         | sed 's,script\.o[ :]*,normal_mod-normal_script.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
-+
-+-include normal_mod-normal_script.d
-+
-+CLEANFILES += cmd-normal_mod-normal_script.lst fs-normal_mod-normal_script.lst
-+COMMANDFILES += cmd-normal_mod-normal_script.lst
-+FSFILES += fs-normal_mod-normal_script.lst
-+
-+cmd-normal_mod-normal_script.lst: normal/script.c gencmdlist.sh
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $<         | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
-+
-+fs-normal_mod-normal_script.lst: normal/script.c genfslist.sh
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $<         | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
-+
-+
-+normal_mod-normal_i386_setjmp.o: normal/i386/setjmp.S
-+      $(TARGET_CC) -Inormal/i386 -I$(srcdir)/normal/i386 $(TARGET_CPPFLAGS) $(TARGET_ASFLAGS) $(normal_mod_ASFLAGS) -c -o $@ $<
-+
-+normal_mod-normal_i386_setjmp.d: normal/i386/setjmp.S
-+      set -e;           $(TARGET_CC) -Inormal/i386 -I$(srcdir)/normal/i386 $(TARGET_CPPFLAGS) $(TARGET_ASFLAGS) $(normal_mod_ASFLAGS) -M $<     | sed 's,setjmp\.o[ :]*,normal_mod-normal_i386_setjmp.o $@ : ,g' > $@;          [ -s $@ ] || rm -f $@
-+
-+-include normal_mod-normal_i386_setjmp.d
-+
-+CLEANFILES += cmd-normal_mod-normal_i386_setjmp.lst fs-normal_mod-normal_i386_setjmp.lst
-+COMMANDFILES += cmd-normal_mod-normal_i386_setjmp.lst
-+FSFILES += fs-normal_mod-normal_i386_setjmp.lst
-+
-+cmd-normal_mod-normal_i386_setjmp.lst: normal/i386/setjmp.S gencmdlist.sh
-+      set -e;           $(TARGET_CC) -Inormal/i386 -I$(srcdir)/normal/i386 $(TARGET_CPPFLAGS) $(TARGET_ASFLAGS) $(normal_mod_ASFLAGS) -E $<     | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
-+
-+fs-normal_mod-normal_i386_setjmp.lst: normal/i386/setjmp.S genfslist.sh
-+      set -e;           $(TARGET_CC) -Inormal/i386 -I$(srcdir)/normal/i386 $(TARGET_CPPFLAGS) $(TARGET_ASFLAGS) $(normal_mod_ASFLAGS) -E $<     | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
-+
-+
-+normal_mod_CFLAGS = $(COMMON_CFLAGS)
-+normal_mod_ASFLAGS = $(COMMON_ASFLAGS)
-+normal_mod_LDFLAGS = $(COMMON_LDFLAGS)
-+
-+# For _chain.mod.
-+_chain_mod_SOURCES = loader/efi/chainloader.c
-+CLEANFILES += _chain.mod mod-_chain.o mod-_chain.c pre-_chain.o _chain_mod-loader_efi_chainloader.o und-_chain.lst
-+ifneq ($(_chain_mod_EXPORTS),no)
-+CLEANFILES += def-_chain.lst
-+DEFSYMFILES += def-_chain.lst
-+endif
-+MOSTLYCLEANFILES += _chain_mod-loader_efi_chainloader.d
-+UNDSYMFILES += und-_chain.lst
-+
-+_chain.mod: pre-_chain.o mod-_chain.o
-+      -rm -f $@
-+      $(TARGET_CC) $(_chain_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
-+      $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
-+
-+pre-_chain.o: _chain_mod-loader_efi_chainloader.o
-+      -rm -f $@
-+      $(TARGET_CC) $(_chain_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
-+
-+mod-_chain.o: mod-_chain.c
-+      $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_chain_mod_CFLAGS) -c -o $@ $<
-+
-+mod-_chain.c: moddep.lst genmodsrc.sh
-+      sh $(srcdir)/genmodsrc.sh '_chain' $< > $@ || (rm -f $@; exit 1)
-+
-+ifneq ($(_chain_mod_EXPORTS),no)
-+def-_chain.lst: pre-_chain.o
-+      $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 _chain/' > $@
-+endif
-+
-+und-_chain.lst: pre-_chain.o
-+      echo '_chain' > $@
-+      $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
-+
-+_chain_mod-loader_efi_chainloader.o: loader/efi/chainloader.c
-+      $(TARGET_CC) -Iloader/efi -I$(srcdir)/loader/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_chain_mod_CFLAGS) -c -o $@ $<
-+
-+_chain_mod-loader_efi_chainloader.d: loader/efi/chainloader.c
-+      set -e;           $(TARGET_CC) -Iloader/efi -I$(srcdir)/loader/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_chain_mod_CFLAGS) -M $<         | sed 's,chainloader\.o[ :]*,_chain_mod-loader_efi_chainloader.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
-+
-+-include _chain_mod-loader_efi_chainloader.d
-+
-+CLEANFILES += cmd-_chain_mod-loader_efi_chainloader.lst fs-_chain_mod-loader_efi_chainloader.lst
-+COMMANDFILES += cmd-_chain_mod-loader_efi_chainloader.lst
-+FSFILES += fs-_chain_mod-loader_efi_chainloader.lst
-+
-+cmd-_chain_mod-loader_efi_chainloader.lst: loader/efi/chainloader.c gencmdlist.sh
-+      set -e;           $(TARGET_CC) -Iloader/efi -I$(srcdir)/loader/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_chain_mod_CFLAGS) -E $<         | sh $(srcdir)/gencmdlist.sh _chain > $@ || (rm -f $@; exit 1)
-+
-+fs-_chain_mod-loader_efi_chainloader.lst: loader/efi/chainloader.c genfslist.sh
-+      set -e;           $(TARGET_CC) -Iloader/efi -I$(srcdir)/loader/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_chain_mod_CFLAGS) -E $<         | sh $(srcdir)/genfslist.sh _chain > $@ || (rm -f $@; exit 1)
-+
-+
-+_chain_mod_CFLAGS = $(COMMON_CFLAGS)
-+_chain_mod_LDFLAGS = $(COMMON_LDFLAGS)
-+
-+# For chain.mod.
-+chain_mod_SOURCES = loader/efi/chainloader_normal.c
-+CLEANFILES += chain.mod mod-chain.o mod-chain.c pre-chain.o chain_mod-loader_efi_chainloader_normal.o und-chain.lst
-+ifneq ($(chain_mod_EXPORTS),no)
-+CLEANFILES += def-chain.lst
-+DEFSYMFILES += def-chain.lst
-+endif
-+MOSTLYCLEANFILES += chain_mod-loader_efi_chainloader_normal.d
-+UNDSYMFILES += und-chain.lst
-+
-+chain.mod: pre-chain.o mod-chain.o
-+      -rm -f $@
-+      $(TARGET_CC) $(chain_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
-+      $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
-+
-+pre-chain.o: chain_mod-loader_efi_chainloader_normal.o
-+      -rm -f $@
-+      $(TARGET_CC) $(chain_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
-+
-+mod-chain.o: mod-chain.c
-+      $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(chain_mod_CFLAGS) -c -o $@ $<
-+
-+mod-chain.c: moddep.lst genmodsrc.sh
-+      sh $(srcdir)/genmodsrc.sh 'chain' $< > $@ || (rm -f $@; exit 1)
-+
-+ifneq ($(chain_mod_EXPORTS),no)
-+def-chain.lst: pre-chain.o
-+      $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 chain/' > $@
-+endif
-+
-+und-chain.lst: pre-chain.o
-+      echo 'chain' > $@
-+      $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
-+
-+chain_mod-loader_efi_chainloader_normal.o: loader/efi/chainloader_normal.c
-+      $(TARGET_CC) -Iloader/efi -I$(srcdir)/loader/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(chain_mod_CFLAGS) -c -o $@ $<
-+
-+chain_mod-loader_efi_chainloader_normal.d: loader/efi/chainloader_normal.c
-+      set -e;           $(TARGET_CC) -Iloader/efi -I$(srcdir)/loader/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(chain_mod_CFLAGS) -M $<          | sed 's,chainloader_normal\.o[ :]*,chain_mod-loader_efi_chainloader_normal.o $@ : ,g' > $@;    [ -s $@ ] || rm -f $@
-+
-+-include chain_mod-loader_efi_chainloader_normal.d
-+
-+CLEANFILES += cmd-chain_mod-loader_efi_chainloader_normal.lst fs-chain_mod-loader_efi_chainloader_normal.lst
-+COMMANDFILES += cmd-chain_mod-loader_efi_chainloader_normal.lst
-+FSFILES += fs-chain_mod-loader_efi_chainloader_normal.lst
-+
-+cmd-chain_mod-loader_efi_chainloader_normal.lst: loader/efi/chainloader_normal.c gencmdlist.sh
-+      set -e;           $(TARGET_CC) -Iloader/efi -I$(srcdir)/loader/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(chain_mod_CFLAGS) -E $<          | sh $(srcdir)/gencmdlist.sh chain > $@ || (rm -f $@; exit 1)
-+
-+fs-chain_mod-loader_efi_chainloader_normal.lst: loader/efi/chainloader_normal.c genfslist.sh
-+      set -e;           $(TARGET_CC) -Iloader/efi -I$(srcdir)/loader/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(chain_mod_CFLAGS) -E $<          | sh $(srcdir)/genfslist.sh chain > $@ || (rm -f $@; exit 1)
-+
-+
-+chain_mod_CFLAGS = $(COMMON_CFLAGS)
-+chain_mod_LDFLAGS = $(COMMON_LDFLAGS)
-+
-+# For _linux.mod.
-+_linux_mod_SOURCES = loader/i386/efi/linux.c
-+CLEANFILES += _linux.mod mod-_linux.o mod-_linux.c pre-_linux.o _linux_mod-loader_i386_efi_linux.o und-_linux.lst
-+ifneq ($(_linux_mod_EXPORTS),no)
-+CLEANFILES += def-_linux.lst
-+DEFSYMFILES += def-_linux.lst
-+endif
-+MOSTLYCLEANFILES += _linux_mod-loader_i386_efi_linux.d
-+UNDSYMFILES += und-_linux.lst
-+
-+_linux.mod: pre-_linux.o mod-_linux.o
-+      -rm -f $@
-+      $(TARGET_CC) $(_linux_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
-+      $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
-+
-+pre-_linux.o: _linux_mod-loader_i386_efi_linux.o
-+      -rm -f $@
-+      $(TARGET_CC) $(_linux_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
-+
-+mod-_linux.o: mod-_linux.c
-+      $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_linux_mod_CFLAGS) -c -o $@ $<
-+
-+mod-_linux.c: moddep.lst genmodsrc.sh
-+      sh $(srcdir)/genmodsrc.sh '_linux' $< > $@ || (rm -f $@; exit 1)
-+
-+ifneq ($(_linux_mod_EXPORTS),no)
-+def-_linux.lst: pre-_linux.o
-+      $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 _linux/' > $@
-+endif
-+
-+und-_linux.lst: pre-_linux.o
-+      echo '_linux' > $@
-+      $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
-+
-+_linux_mod-loader_i386_efi_linux.o: loader/i386/efi/linux.c
-+      $(TARGET_CC) -Iloader/i386/efi -I$(srcdir)/loader/i386/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_linux_mod_CFLAGS) -c -o $@ $<
-+
-+_linux_mod-loader_i386_efi_linux.d: loader/i386/efi/linux.c
-+      set -e;           $(TARGET_CC) -Iloader/i386/efi -I$(srcdir)/loader/i386/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_linux_mod_CFLAGS) -M $<       | sed 's,linux\.o[ :]*,_linux_mod-loader_i386_efi_linux.o $@ : ,g' > $@;        [ -s $@ ] || rm -f $@
-+
-+-include _linux_mod-loader_i386_efi_linux.d
-+
-+CLEANFILES += cmd-_linux_mod-loader_i386_efi_linux.lst fs-_linux_mod-loader_i386_efi_linux.lst
-+COMMANDFILES += cmd-_linux_mod-loader_i386_efi_linux.lst
-+FSFILES += fs-_linux_mod-loader_i386_efi_linux.lst
-+
-+cmd-_linux_mod-loader_i386_efi_linux.lst: loader/i386/efi/linux.c gencmdlist.sh
-+      set -e;           $(TARGET_CC) -Iloader/i386/efi -I$(srcdir)/loader/i386/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_linux_mod_CFLAGS) -E $<       | sh $(srcdir)/gencmdlist.sh _linux > $@ || (rm -f $@; exit 1)
-+
-+fs-_linux_mod-loader_i386_efi_linux.lst: loader/i386/efi/linux.c genfslist.sh
-+      set -e;           $(TARGET_CC) -Iloader/i386/efi -I$(srcdir)/loader/i386/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_linux_mod_CFLAGS) -E $<       | sh $(srcdir)/genfslist.sh _linux > $@ || (rm -f $@; exit 1)
-+
-+
-+_linux_mod_CFLAGS = $(COMMON_CFLAGS)
-+_linux_mod_LDFLAGS = $(COMMON_LDFLAGS)
-+
-+# For linux.mod.
-+linux_mod_SOURCES = loader/i386/efi/linux_normal.c
-+CLEANFILES += linux.mod mod-linux.o mod-linux.c pre-linux.o linux_mod-loader_i386_efi_linux_normal.o und-linux.lst
-+ifneq ($(linux_mod_EXPORTS),no)
-+CLEANFILES += def-linux.lst
-+DEFSYMFILES += def-linux.lst
-+endif
-+MOSTLYCLEANFILES += linux_mod-loader_i386_efi_linux_normal.d
-+UNDSYMFILES += und-linux.lst
-+
-+linux.mod: pre-linux.o mod-linux.o
-+      -rm -f $@
-+      $(TARGET_CC) $(linux_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
-+      $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
-+
-+pre-linux.o: linux_mod-loader_i386_efi_linux_normal.o
-+      -rm -f $@
-+      $(TARGET_CC) $(linux_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
-+
-+mod-linux.o: mod-linux.c
-+      $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -c -o $@ $<
-+
-+mod-linux.c: moddep.lst genmodsrc.sh
-+      sh $(srcdir)/genmodsrc.sh 'linux' $< > $@ || (rm -f $@; exit 1)
-+
-+ifneq ($(linux_mod_EXPORTS),no)
-+def-linux.lst: pre-linux.o
-+      $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 linux/' > $@
-+endif
-+
-+und-linux.lst: pre-linux.o
-+      echo 'linux' > $@
-+      $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
-+
-+linux_mod-loader_i386_efi_linux_normal.o: loader/i386/efi/linux_normal.c
-+      $(TARGET_CC) -Iloader/i386/efi -I$(srcdir)/loader/i386/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -c -o $@ $<
-+
-+linux_mod-loader_i386_efi_linux_normal.d: loader/i386/efi/linux_normal.c
-+      set -e;           $(TARGET_CC) -Iloader/i386/efi -I$(srcdir)/loader/i386/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -M $<        | sed 's,linux_normal\.o[ :]*,linux_mod-loader_i386_efi_linux_normal.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
-+
-+-include linux_mod-loader_i386_efi_linux_normal.d
-+
-+CLEANFILES += cmd-linux_mod-loader_i386_efi_linux_normal.lst fs-linux_mod-loader_i386_efi_linux_normal.lst
-+COMMANDFILES += cmd-linux_mod-loader_i386_efi_linux_normal.lst
-+FSFILES += fs-linux_mod-loader_i386_efi_linux_normal.lst
-+
-+cmd-linux_mod-loader_i386_efi_linux_normal.lst: loader/i386/efi/linux_normal.c gencmdlist.sh
-+      set -e;           $(TARGET_CC) -Iloader/i386/efi -I$(srcdir)/loader/i386/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $<        | sh $(srcdir)/gencmdlist.sh linux > $@ || (rm -f $@; exit 1)
-+
-+fs-linux_mod-loader_i386_efi_linux_normal.lst: loader/i386/efi/linux_normal.c genfslist.sh
-+      set -e;           $(TARGET_CC) -Iloader/i386/efi -I$(srcdir)/loader/i386/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $<        | sh $(srcdir)/genfslist.sh linux > $@ || (rm -f $@; exit 1)
-+
-+
-+linux_mod_CFLAGS = $(COMMON_CFLAGS)
-+linux_mod_LDFLAGS = $(COMMON_LDFLAGS)
-+
-+include $(srcdir)/conf/common.mk
-Index: conf/i386-efi.rmk
-===================================================================
-RCS file: conf/i386-efi.rmk
-diff -N conf/i386-efi.rmk
---- /dev/null  1 Jan 1970 00:00:00 -0000
-+++ conf/i386-efi.rmk  28 May 2006 23:01:43 -0000      1.9
-@@ -0,0 +1,125 @@
-+# -*- makefile -*-
-+
-+COMMON_ASFLAGS = -nostdinc -fno-builtin -m32
-+COMMON_CFLAGS = -fno-builtin -m32
-+COMMON_LDFLAGS = -melf_i386 -nostdlib
-+
-+# Utilities.
-+bin_UTILITIES = grub-mkimage
-+#sbin_UTILITIES = grub-setup grub-emu grub-mkdevicemap grub-probefs
-+
-+# For grub-mkimage.
-+grub_mkimage_SOURCES = util/i386/efi/grub-mkimage.c util/misc.c \
-+      util/resolve.c
-+
-+# For grub-setup.
-+#grub_setup_SOURCES = util/i386/pc/grub-setup.c util/i386/pc/biosdisk.c       \
-+#     util/misc.c util/i386/pc/getroot.c kern/device.c kern/disk.c    \
-+#     kern/err.c kern/misc.c fs/fat.c fs/ext2.c fs/xfs.c fs/affs.c    \
-+#     fs/sfs.c kern/parser.c kern/partition.c partmap/pc.c            \
-+#     fs/ufs.c fs/minix.c fs/hfs.c fs/jfs.c fs/hfsplus.c kern/file.c  \
-+#     kern/fs.c kern/env.c fs/fshelp.c
-+
-+# For grub-mkdevicemap.
-+#grub_mkdevicemap_SOURCES = util/i386/pc/grub-mkdevicemap.c util/misc.c
-+
-+# For grub-probefs.
-+#grub_probefs_SOURCES = util/i386/pc/grub-probefs.c   \
-+#     util/i386/pc/biosdisk.c util/misc.c util/i386/pc/getroot.c      \
-+#     kern/device.c kern/disk.c kern/err.c kern/misc.c fs/fat.c       \
-+#     fs/ext2.c kern/parser.c kern/partition.c partmap/pc.c fs/ufs.c  \
-+#     fs/minix.c fs/hfs.c fs/jfs.c kern/fs.c kern/env.c fs/fshelp.c   \
-+#     fs/xfs.c fs/affs.c fs/sfs.c fs/hfsplus.c
-+
-+# For grub-emu.
-+grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c      \
-+      commands/configfile.c commands/help.c                           \
-+      commands/terminal.c commands/ls.c commands/test.c               \
-+      commands/search.c                                               \
-+      commands/i386/pc/halt.c commands/i386/pc/reboot.c               \
-+      disk/loopback.c                                                 \
-+      fs/affs.c fs/ext2.c fs/fat.c fs/fshelp.c fs/hfs.c fs/iso9660.c  \
-+      fs/jfs.c fs/minix.c fs/sfs.c fs/ufs.c fs/xfs.c fs/hfsplus.c     \
-+      io/gzio.c                                                       \
-+      kern/device.c kern/disk.c kern/dl.c kern/env.c kern/err.c       \
-+      normal/execute.c kern/file.c kern/fs.c normal/lexer.c           \
-+      kern/loader.c kern/main.c kern/misc.c kern/parser.c             \
-+      grub_script.tab.c kern/partition.c kern/rescue.c kern/term.c    \
-+      normal/arg.c normal/cmdline.c normal/command.c normal/function.c\
-+      normal/completion.c normal/context.c normal/main.c              \
-+      normal/menu.c normal/menu_entry.c normal/misc.c normal/script.c \
-+      partmap/amiga.c partmap/apple.c partmap/pc.c partmap/sun.c      \
-+      partmap/acorn.c partmap/gpt.c                                   \
-+      util/console.c util/grub-emu.c util/misc.c                      \
-+      util/i386/pc/biosdisk.c util/i386/pc/getroot.c                  \
-+      util/i386/pc/misc.c grub_emu_init.c
-+
-+grub_emu_LDFLAGS = $(LIBCURSES)
-+
-+# Scripts.
-+#sbin_SCRIPTS = grub-install
-+
-+# For grub-install.
-+#grub_install_SOURCES = util/efi/pc/grub-install.in
-+
-+# Modules.
-+pkgdata_MODULES = kernel.mod normal.mod _chain.mod chain.mod \
-+      _linux.mod linux.mod
-+
-+# For kernel.mod.
-+kernel_mod_EXPORTS = no
-+kernel_mod_SOURCES = kern/i386/efi/startup.S kern/main.c kern/device.c \
-+      kern/disk.c kern/dl.c kern/file.c kern/fs.c kern/err.c \
-+      kern/misc.c kern/mm.c kern/loader.c kern/rescue.c kern/term.c \
-+      kern/i386/dl.c kern/i386/efi/init.c kern/parser.c kern/partition.c \
-+      kern/env.c symlist.c kern/efi/efi.c kern/efi/init.c kern/efi/mm.c \
-+      term/efi/console.c disk/efi/efidisk.c
-+kernel_mod_HEADERS = arg.h boot.h device.h disk.h dl.h elf.h env.h err.h \
-+      file.h fs.h kernel.h loader.h misc.h mm.h net.h parser.h partition.h \
-+      pc_partition.h rescue.h symbol.h term.h types.h \
-+      i386/efi/time.h efi/efi.h efi/time.h efi/disk.h
-+kernel_mod_CFLAGS = $(COMMON_CFLAGS)
-+kernel_mod_ASFLAGS = $(COMMON_ASFLAGS)
-+kernel_mod_LDFLAGS = $(COMMON_LDFLAGS)
-+
-+MOSTLYCLEANFILES += symlist.c
-+MOSTLYCLEANFILES += symlist.c kernel_syms.lst
-+DEFSYMFILES += kernel_syms.lst
-+
-+symlist.c: $(addprefix include/grub/,$(kernel_mod_HEADERS)) config.h gensymlist.sh
-+      /bin/sh gensymlist.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1)
-+
-+kernel_syms.lst: $(addprefix include/grub/,$(kernel_mod_HEADERS)) config.h genkernsyms.sh
-+      /bin/sh genkernsyms.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1)
-+
-+# For normal.mod.
-+normal_mod_SOURCES = normal/arg.c normal/cmdline.c normal/command.c   \
-+      normal/completion.c normal/execute.c            \
-+      normal/function.c normal/lexer.c normal/main.c normal/menu.c    \
-+      normal/menu_entry.c normal/misc.c grub_script.tab.c             \
-+      normal/script.c normal/i386/setjmp.S
-+normal_mod_CFLAGS = $(COMMON_CFLAGS)
-+normal_mod_ASFLAGS = $(COMMON_ASFLAGS)
-+normal_mod_LDFLAGS = $(COMMON_LDFLAGS)
-+
-+# For _chain.mod.
-+_chain_mod_SOURCES = loader/efi/chainloader.c
-+_chain_mod_CFLAGS = $(COMMON_CFLAGS)
-+_chain_mod_LDFLAGS = $(COMMON_LDFLAGS)
-+
-+# For chain.mod.
-+chain_mod_SOURCES = loader/efi/chainloader_normal.c
-+chain_mod_CFLAGS = $(COMMON_CFLAGS)
-+chain_mod_LDFLAGS = $(COMMON_LDFLAGS)
-+
-+# For _linux.mod.
-+_linux_mod_SOURCES = loader/i386/efi/linux.c
-+_linux_mod_CFLAGS = $(COMMON_CFLAGS)
-+_linux_mod_LDFLAGS = $(COMMON_LDFLAGS)
-+
-+# For linux.mod.
-+linux_mod_SOURCES = loader/i386/efi/linux_normal.c
-+linux_mod_CFLAGS = $(COMMON_CFLAGS)
-+linux_mod_LDFLAGS = $(COMMON_LDFLAGS)
-+
-+include $(srcdir)/conf/common.mk
-Index: conf/i386-pc.mk
-===================================================================
-RCS file: /cvsroot/grub/grub2/conf/i386-pc.mk,v
-retrieving revision 1.61
-retrieving revision 1.73
-diff -u -r1.61 -r1.73
---- conf/i386-pc.mk    25 Dec 2005 15:59:50 -0000      1.61
-+++ conf/i386-pc.mk    2 Jun 2006 19:33:58 -0000       1.73
-@@ -2,7 +2,7 @@
- COMMON_ASFLAGS = -nostdinc -fno-builtin
- COMMON_CFLAGS = -fno-builtin -mrtd -mregparm=3 -m32
--COMMON_LDFLAGS = -melf_i386
-+COMMON_LDFLAGS = -melf_i386 -nostdlib
- # Images.
- pkgdata_IMAGES = boot.img diskboot.img kernel.img pxeboot.img
-@@ -16,13 +16,13 @@
-       $(OBJCOPY) -O binary -R .note -R .comment $< $@
- boot.exec: boot_img-boot_i386_pc_boot.o
--      $(CC) -o $@ $^ $(LDFLAGS) $(boot_img_LDFLAGS)
-+      $(TARGET_CC) -o $@ $^ $(TARGET_LDFLAGS) $(boot_img_LDFLAGS)
- boot_img-boot_i386_pc_boot.o: boot/i386/pc/boot.S
--      $(CC) -Iboot/i386/pc -I$(srcdir)/boot/i386/pc $(CPPFLAGS) -DASM_FILE=1 $(ASFLAGS) $(boot_img_ASFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Iboot/i386/pc -I$(srcdir)/boot/i386/pc $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(boot_img_ASFLAGS) -c -o $@ $<
- boot_img-boot_i386_pc_boot.d: boot/i386/pc/boot.S
--      set -e;           $(CC) -Iboot/i386/pc -I$(srcdir)/boot/i386/pc $(CPPFLAGS) -DASM_FILE=1 $(ASFLAGS) $(boot_img_ASFLAGS) -M $<     | sed 's,boot\.o[ :]*,boot_img-boot_i386_pc_boot.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Iboot/i386/pc -I$(srcdir)/boot/i386/pc $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(boot_img_ASFLAGS) -M $<        | sed 's,boot\.o[ :]*,boot_img-boot_i386_pc_boot.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
- -include boot_img-boot_i386_pc_boot.d
-@@ -38,13 +38,13 @@
-       $(OBJCOPY) -O binary -R .note -R .comment $< $@
- pxeboot.exec: pxeboot_img-boot_i386_pc_pxeboot.o
--      $(CC) -o $@ $^ $(LDFLAGS) $(pxeboot_img_LDFLAGS)
-+      $(TARGET_CC) -o $@ $^ $(TARGET_LDFLAGS) $(pxeboot_img_LDFLAGS)
- pxeboot_img-boot_i386_pc_pxeboot.o: boot/i386/pc/pxeboot.S
--      $(CC) -Iboot/i386/pc -I$(srcdir)/boot/i386/pc $(CPPFLAGS) -DASM_FILE=1 $(ASFLAGS) $(pxeboot_img_ASFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Iboot/i386/pc -I$(srcdir)/boot/i386/pc $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(pxeboot_img_ASFLAGS) -c -o $@ $<
- pxeboot_img-boot_i386_pc_pxeboot.d: boot/i386/pc/pxeboot.S
--      set -e;           $(CC) -Iboot/i386/pc -I$(srcdir)/boot/i386/pc $(CPPFLAGS) -DASM_FILE=1 $(ASFLAGS) $(pxeboot_img_ASFLAGS) -M $<          | sed 's,pxeboot\.o[ :]*,pxeboot_img-boot_i386_pc_pxeboot.o $@ : ,g' > $@;      [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Iboot/i386/pc -I$(srcdir)/boot/i386/pc $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(pxeboot_img_ASFLAGS) -M $<     | sed 's,pxeboot\.o[ :]*,pxeboot_img-boot_i386_pc_pxeboot.o $@ : ,g' > $@;      [ -s $@ ] || rm -f $@
- -include pxeboot_img-boot_i386_pc_pxeboot.d
-@@ -60,13 +60,13 @@
-       $(OBJCOPY) -O binary -R .note -R .comment $< $@
- diskboot.exec: diskboot_img-boot_i386_pc_diskboot.o
--      $(CC) -o $@ $^ $(LDFLAGS) $(diskboot_img_LDFLAGS)
-+      $(TARGET_CC) -o $@ $^ $(TARGET_LDFLAGS) $(diskboot_img_LDFLAGS)
- diskboot_img-boot_i386_pc_diskboot.o: boot/i386/pc/diskboot.S
--      $(CC) -Iboot/i386/pc -I$(srcdir)/boot/i386/pc $(CPPFLAGS) -DASM_FILE=1 $(ASFLAGS) $(diskboot_img_ASFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Iboot/i386/pc -I$(srcdir)/boot/i386/pc $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(diskboot_img_ASFLAGS) -c -o $@ $<
- diskboot_img-boot_i386_pc_diskboot.d: boot/i386/pc/diskboot.S
--      set -e;           $(CC) -Iboot/i386/pc -I$(srcdir)/boot/i386/pc $(CPPFLAGS) -DASM_FILE=1 $(ASFLAGS) $(diskboot_img_ASFLAGS) -M $<         | sed 's,diskboot\.o[ :]*,diskboot_img-boot_i386_pc_diskboot.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Iboot/i386/pc -I$(srcdir)/boot/i386/pc $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(diskboot_img_ASFLAGS) -M $<    | sed 's,diskboot\.o[ :]*,diskboot_img-boot_i386_pc_diskboot.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
- -include diskboot_img-boot_i386_pc_diskboot.d
-@@ -88,173 +88,173 @@
-       $(OBJCOPY) -O binary -R .note -R .comment $< $@
- kernel.exec: kernel_img-kern_i386_pc_startup.o kernel_img-kern_main.o kernel_img-kern_device.o kernel_img-kern_disk.o kernel_img-kern_dl.o kernel_img-kern_file.o kernel_img-kern_fs.o kernel_img-kern_err.o kernel_img-kern_misc.o kernel_img-kern_mm.o kernel_img-kern_loader.o kernel_img-kern_rescue.o kernel_img-kern_term.o kernel_img-kern_i386_dl.o kernel_img-kern_i386_pc_init.o kernel_img-kern_parser.o kernel_img-kern_partition.o kernel_img-kern_env.o kernel_img-disk_i386_pc_biosdisk.o kernel_img-term_i386_pc_console.o kernel_img-symlist.o
--      $(CC) -o $@ $^ $(LDFLAGS) $(kernel_img_LDFLAGS)
-+      $(TARGET_CC) -o $@ $^ $(TARGET_LDFLAGS) $(kernel_img_LDFLAGS)
- kernel_img-kern_i386_pc_startup.o: kern/i386/pc/startup.S
--      $(CC) -Ikern/i386/pc -I$(srcdir)/kern/i386/pc $(CPPFLAGS) -DASM_FILE=1 $(ASFLAGS) $(kernel_img_ASFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Ikern/i386/pc -I$(srcdir)/kern/i386/pc $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(kernel_img_ASFLAGS) -c -o $@ $<
- kernel_img-kern_i386_pc_startup.d: kern/i386/pc/startup.S
--      set -e;           $(CC) -Ikern/i386/pc -I$(srcdir)/kern/i386/pc $(CPPFLAGS) -DASM_FILE=1 $(ASFLAGS) $(kernel_img_ASFLAGS) -M $<           | sed 's,startup\.o[ :]*,kernel_img-kern_i386_pc_startup.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Ikern/i386/pc -I$(srcdir)/kern/i386/pc $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(kernel_img_ASFLAGS) -M $<      | sed 's,startup\.o[ :]*,kernel_img-kern_i386_pc_startup.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
- -include kernel_img-kern_i386_pc_startup.d
- kernel_img-kern_main.o: kern/main.c
--      $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS)  $(CFLAGS) $(kernel_img_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS)  $(TARGET_CFLAGS) $(kernel_img_CFLAGS) -c -o $@ $<
- kernel_img-kern_main.d: kern/main.c
--      set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS)  $(CFLAGS) $(kernel_img_CFLAGS) -M $<         | sed 's,main\.o[ :]*,kernel_img-kern_main.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS)  $(TARGET_CFLAGS) $(kernel_img_CFLAGS) -M $<    | sed 's,main\.o[ :]*,kernel_img-kern_main.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
- -include kernel_img-kern_main.d
- kernel_img-kern_device.o: kern/device.c
--      $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS)  $(CFLAGS) $(kernel_img_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS)  $(TARGET_CFLAGS) $(kernel_img_CFLAGS) -c -o $@ $<
- kernel_img-kern_device.d: kern/device.c
--      set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS)  $(CFLAGS) $(kernel_img_CFLAGS) -M $<         | sed 's,device\.o[ :]*,kernel_img-kern_device.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS)  $(TARGET_CFLAGS) $(kernel_img_CFLAGS) -M $<    | sed 's,device\.o[ :]*,kernel_img-kern_device.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
- -include kernel_img-kern_device.d
- kernel_img-kern_disk.o: kern/disk.c
--      $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS)  $(CFLAGS) $(kernel_img_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS)  $(TARGET_CFLAGS) $(kernel_img_CFLAGS) -c -o $@ $<
- kernel_img-kern_disk.d: kern/disk.c
--      set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS)  $(CFLAGS) $(kernel_img_CFLAGS) -M $<         | sed 's,disk\.o[ :]*,kernel_img-kern_disk.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS)  $(TARGET_CFLAGS) $(kernel_img_CFLAGS) -M $<    | sed 's,disk\.o[ :]*,kernel_img-kern_disk.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
- -include kernel_img-kern_disk.d
- kernel_img-kern_dl.o: kern/dl.c
--      $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS)  $(CFLAGS) $(kernel_img_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS)  $(TARGET_CFLAGS) $(kernel_img_CFLAGS) -c -o $@ $<
- kernel_img-kern_dl.d: kern/dl.c
--      set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS)  $(CFLAGS) $(kernel_img_CFLAGS) -M $<         | sed 's,dl\.o[ :]*,kernel_img-kern_dl.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS)  $(TARGET_CFLAGS) $(kernel_img_CFLAGS) -M $<    | sed 's,dl\.o[ :]*,kernel_img-kern_dl.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
- -include kernel_img-kern_dl.d
- kernel_img-kern_file.o: kern/file.c
--      $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS)  $(CFLAGS) $(kernel_img_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS)  $(TARGET_CFLAGS) $(kernel_img_CFLAGS) -c -o $@ $<
- kernel_img-kern_file.d: kern/file.c
--      set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS)  $(CFLAGS) $(kernel_img_CFLAGS) -M $<         | sed 's,file\.o[ :]*,kernel_img-kern_file.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS)  $(TARGET_CFLAGS) $(kernel_img_CFLAGS) -M $<    | sed 's,file\.o[ :]*,kernel_img-kern_file.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
- -include kernel_img-kern_file.d
- kernel_img-kern_fs.o: kern/fs.c
--      $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS)  $(CFLAGS) $(kernel_img_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS)  $(TARGET_CFLAGS) $(kernel_img_CFLAGS) -c -o $@ $<
- kernel_img-kern_fs.d: kern/fs.c
--      set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS)  $(CFLAGS) $(kernel_img_CFLAGS) -M $<         | sed 's,fs\.o[ :]*,kernel_img-kern_fs.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS)  $(TARGET_CFLAGS) $(kernel_img_CFLAGS) -M $<    | sed 's,fs\.o[ :]*,kernel_img-kern_fs.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
- -include kernel_img-kern_fs.d
- kernel_img-kern_err.o: kern/err.c
--      $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS)  $(CFLAGS) $(kernel_img_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS)  $(TARGET_CFLAGS) $(kernel_img_CFLAGS) -c -o $@ $<
- kernel_img-kern_err.d: kern/err.c
--      set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS)  $(CFLAGS) $(kernel_img_CFLAGS) -M $<         | sed 's,err\.o[ :]*,kernel_img-kern_err.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS)  $(TARGET_CFLAGS) $(kernel_img_CFLAGS) -M $<    | sed 's,err\.o[ :]*,kernel_img-kern_err.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
- -include kernel_img-kern_err.d
- kernel_img-kern_misc.o: kern/misc.c
--      $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS)  $(CFLAGS) $(kernel_img_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS)  $(TARGET_CFLAGS) $(kernel_img_CFLAGS) -c -o $@ $<
- kernel_img-kern_misc.d: kern/misc.c
--      set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS)  $(CFLAGS) $(kernel_img_CFLAGS) -M $<         | sed 's,misc\.o[ :]*,kernel_img-kern_misc.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS)  $(TARGET_CFLAGS) $(kernel_img_CFLAGS) -M $<    | sed 's,misc\.o[ :]*,kernel_img-kern_misc.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
- -include kernel_img-kern_misc.d
- kernel_img-kern_mm.o: kern/mm.c
--      $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS)  $(CFLAGS) $(kernel_img_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS)  $(TARGET_CFLAGS) $(kernel_img_CFLAGS) -c -o $@ $<
- kernel_img-kern_mm.d: kern/mm.c
--      set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS)  $(CFLAGS) $(kernel_img_CFLAGS) -M $<         | sed 's,mm\.o[ :]*,kernel_img-kern_mm.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS)  $(TARGET_CFLAGS) $(kernel_img_CFLAGS) -M $<    | sed 's,mm\.o[ :]*,kernel_img-kern_mm.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
- -include kernel_img-kern_mm.d
- kernel_img-kern_loader.o: kern/loader.c
--      $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS)  $(CFLAGS) $(kernel_img_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS)  $(TARGET_CFLAGS) $(kernel_img_CFLAGS) -c -o $@ $<
- kernel_img-kern_loader.d: kern/loader.c
--      set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS)  $(CFLAGS) $(kernel_img_CFLAGS) -M $<         | sed 's,loader\.o[ :]*,kernel_img-kern_loader.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS)  $(TARGET_CFLAGS) $(kernel_img_CFLAGS) -M $<    | sed 's,loader\.o[ :]*,kernel_img-kern_loader.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
- -include kernel_img-kern_loader.d
- kernel_img-kern_rescue.o: kern/rescue.c
--      $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS)  $(CFLAGS) $(kernel_img_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS)  $(TARGET_CFLAGS) $(kernel_img_CFLAGS) -c -o $@ $<
- kernel_img-kern_rescue.d: kern/rescue.c
--      set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS)  $(CFLAGS) $(kernel_img_CFLAGS) -M $<         | sed 's,rescue\.o[ :]*,kernel_img-kern_rescue.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS)  $(TARGET_CFLAGS) $(kernel_img_CFLAGS) -M $<    | sed 's,rescue\.o[ :]*,kernel_img-kern_rescue.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
- -include kernel_img-kern_rescue.d
- kernel_img-kern_term.o: kern/term.c
--      $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS)  $(CFLAGS) $(kernel_img_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS)  $(TARGET_CFLAGS) $(kernel_img_CFLAGS) -c -o $@ $<
- kernel_img-kern_term.d: kern/term.c
--      set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS)  $(CFLAGS) $(kernel_img_CFLAGS) -M $<         | sed 's,term\.o[ :]*,kernel_img-kern_term.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS)  $(TARGET_CFLAGS) $(kernel_img_CFLAGS) -M $<    | sed 's,term\.o[ :]*,kernel_img-kern_term.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
- -include kernel_img-kern_term.d
- kernel_img-kern_i386_dl.o: kern/i386/dl.c
--      $(CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(CPPFLAGS)  $(CFLAGS) $(kernel_img_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS)  $(TARGET_CFLAGS) $(kernel_img_CFLAGS) -c -o $@ $<
- kernel_img-kern_i386_dl.d: kern/i386/dl.c
--      set -e;           $(CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(CPPFLAGS)  $(CFLAGS) $(kernel_img_CFLAGS) -M $<       | sed 's,dl\.o[ :]*,kernel_img-kern_i386_dl.o $@ : ,g' > $@;    [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS)  $(TARGET_CFLAGS) $(kernel_img_CFLAGS) -M $<          | sed 's,dl\.o[ :]*,kernel_img-kern_i386_dl.o $@ : ,g' > $@;    [ -s $@ ] || rm -f $@
- -include kernel_img-kern_i386_dl.d
- kernel_img-kern_i386_pc_init.o: kern/i386/pc/init.c
--      $(CC) -Ikern/i386/pc -I$(srcdir)/kern/i386/pc $(CPPFLAGS)  $(CFLAGS) $(kernel_img_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Ikern/i386/pc -I$(srcdir)/kern/i386/pc $(TARGET_CPPFLAGS)  $(TARGET_CFLAGS) $(kernel_img_CFLAGS) -c -o $@ $<
- kernel_img-kern_i386_pc_init.d: kern/i386/pc/init.c
--      set -e;           $(CC) -Ikern/i386/pc -I$(srcdir)/kern/i386/pc $(CPPFLAGS)  $(CFLAGS) $(kernel_img_CFLAGS) -M $<         | sed 's,init\.o[ :]*,kernel_img-kern_i386_pc_init.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Ikern/i386/pc -I$(srcdir)/kern/i386/pc $(TARGET_CPPFLAGS)  $(TARGET_CFLAGS) $(kernel_img_CFLAGS) -M $<    | sed 's,init\.o[ :]*,kernel_img-kern_i386_pc_init.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
- -include kernel_img-kern_i386_pc_init.d
- kernel_img-kern_parser.o: kern/parser.c
--      $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS)  $(CFLAGS) $(kernel_img_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS)  $(TARGET_CFLAGS) $(kernel_img_CFLAGS) -c -o $@ $<
- kernel_img-kern_parser.d: kern/parser.c
--      set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS)  $(CFLAGS) $(kernel_img_CFLAGS) -M $<         | sed 's,parser\.o[ :]*,kernel_img-kern_parser.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS)  $(TARGET_CFLAGS) $(kernel_img_CFLAGS) -M $<    | sed 's,parser\.o[ :]*,kernel_img-kern_parser.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
- -include kernel_img-kern_parser.d
- kernel_img-kern_partition.o: kern/partition.c
--      $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS)  $(CFLAGS) $(kernel_img_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS)  $(TARGET_CFLAGS) $(kernel_img_CFLAGS) -c -o $@ $<
- kernel_img-kern_partition.d: kern/partition.c
--      set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS)  $(CFLAGS) $(kernel_img_CFLAGS) -M $<         | sed 's,partition\.o[ :]*,kernel_img-kern_partition.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS)  $(TARGET_CFLAGS) $(kernel_img_CFLAGS) -M $<    | sed 's,partition\.o[ :]*,kernel_img-kern_partition.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
- -include kernel_img-kern_partition.d
- kernel_img-kern_env.o: kern/env.c
--      $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS)  $(CFLAGS) $(kernel_img_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS)  $(TARGET_CFLAGS) $(kernel_img_CFLAGS) -c -o $@ $<
- kernel_img-kern_env.d: kern/env.c
--      set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS)  $(CFLAGS) $(kernel_img_CFLAGS) -M $<         | sed 's,env\.o[ :]*,kernel_img-kern_env.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS)  $(TARGET_CFLAGS) $(kernel_img_CFLAGS) -M $<    | sed 's,env\.o[ :]*,kernel_img-kern_env.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
- -include kernel_img-kern_env.d
- kernel_img-disk_i386_pc_biosdisk.o: disk/i386/pc/biosdisk.c
--      $(CC) -Idisk/i386/pc -I$(srcdir)/disk/i386/pc $(CPPFLAGS)  $(CFLAGS) $(kernel_img_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Idisk/i386/pc -I$(srcdir)/disk/i386/pc $(TARGET_CPPFLAGS)  $(TARGET_CFLAGS) $(kernel_img_CFLAGS) -c -o $@ $<
- kernel_img-disk_i386_pc_biosdisk.d: disk/i386/pc/biosdisk.c
--      set -e;           $(CC) -Idisk/i386/pc -I$(srcdir)/disk/i386/pc $(CPPFLAGS)  $(CFLAGS) $(kernel_img_CFLAGS) -M $<         | sed 's,biosdisk\.o[ :]*,kernel_img-disk_i386_pc_biosdisk.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Idisk/i386/pc -I$(srcdir)/disk/i386/pc $(TARGET_CPPFLAGS)  $(TARGET_CFLAGS) $(kernel_img_CFLAGS) -M $<    | sed 's,biosdisk\.o[ :]*,kernel_img-disk_i386_pc_biosdisk.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
- -include kernel_img-disk_i386_pc_biosdisk.d
- kernel_img-term_i386_pc_console.o: term/i386/pc/console.c
--      $(CC) -Iterm/i386/pc -I$(srcdir)/term/i386/pc $(CPPFLAGS)  $(CFLAGS) $(kernel_img_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Iterm/i386/pc -I$(srcdir)/term/i386/pc $(TARGET_CPPFLAGS)  $(TARGET_CFLAGS) $(kernel_img_CFLAGS) -c -o $@ $<
- kernel_img-term_i386_pc_console.d: term/i386/pc/console.c
--      set -e;           $(CC) -Iterm/i386/pc -I$(srcdir)/term/i386/pc $(CPPFLAGS)  $(CFLAGS) $(kernel_img_CFLAGS) -M $<         | sed 's,console\.o[ :]*,kernel_img-term_i386_pc_console.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Iterm/i386/pc -I$(srcdir)/term/i386/pc $(TARGET_CPPFLAGS)  $(TARGET_CFLAGS) $(kernel_img_CFLAGS) -M $<    | sed 's,console\.o[ :]*,kernel_img-term_i386_pc_console.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
- -include kernel_img-term_i386_pc_console.d
- kernel_img-symlist.o: symlist.c
--      $(CC) -I. -I$(srcdir)/. $(CPPFLAGS)  $(CFLAGS) $(kernel_img_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS)  $(TARGET_CFLAGS) $(kernel_img_CFLAGS) -c -o $@ $<
- kernel_img-symlist.d: symlist.c
--      set -e;           $(CC) -I. -I$(srcdir)/. $(CPPFLAGS)  $(CFLAGS) $(kernel_img_CFLAGS) -M $<       | sed 's,symlist\.o[ :]*,kernel_img-symlist.o $@ : ,g' > $@;    [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS)  $(TARGET_CFLAGS) $(kernel_img_CFLAGS) -M $<          | sed 's,symlist\.o[ :]*,kernel_img-symlist.o $@ : ,g' > $@;    [ -s $@ ] || rm -f $@
- -include kernel_img-symlist.d
-@@ -271,16 +271,15 @@
- MOSTLYCLEANFILES += symlist.c kernel_syms.lst
- DEFSYMFILES += kernel_syms.lst
--symlist.c: $(addprefix include/grub/,$(kernel_img_HEADERS)) gensymlist.sh
--      sh $(srcdir)/gensymlist.sh $(filter %.h,$^) > $@
-+symlist.c: $(addprefix include/grub/,$(kernel_img_HEADERS)) config.h gensymlist.sh
-+      /bin/sh gensymlist.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1)
--kernel_syms.lst: $(addprefix include/grub/,$(kernel_img_HEADERS)) genkernsyms.sh
--      sh $(srcdir)/genkernsyms.sh $(filter %h,$^) > $@
-+kernel_syms.lst: $(addprefix include/grub/,$(kernel_img_HEADERS)) config.h genkernsyms.sh
-+      /bin/sh genkernsyms.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1)
- # Utilities.
- bin_UTILITIES = grub-mkimage
- sbin_UTILITIES = grub-setup grub-emu grub-mkdevicemap grub-probefs
--noinst_UTILITIES = genmoddep
- # For grub-mkimage.
- grub_mkimage_SOURCES = util/i386/pc/grub-mkimage.c util/misc.c \
-@@ -289,29 +288,29 @@
- MOSTLYCLEANFILES += grub_mkimage-util_i386_pc_grub_mkimage.d grub_mkimage-util_misc.d grub_mkimage-util_resolve.d
- grub-mkimage: grub_mkimage-util_i386_pc_grub_mkimage.o grub_mkimage-util_misc.o grub_mkimage-util_resolve.o
--      $(BUILD_CC) -o $@ $^ $(BUILD_LDFLAGS) $(grub_mkimage_LDFLAGS)
-+      $(CC) -o $@ $^ $(LDFLAGS) $(grub_mkimage_LDFLAGS)
- grub_mkimage-util_i386_pc_grub_mkimage.o: util/i386/pc/grub-mkimage.c
--      $(BUILD_CC) -Iutil/i386/pc -I$(srcdir)/util/i386/pc $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_mkimage_CFLAGS) -c -o $@ $<
-+      $(CC) -Iutil/i386/pc -I$(srcdir)/util/i386/pc $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_mkimage_CFLAGS) -c -o $@ $<
- grub_mkimage-util_i386_pc_grub_mkimage.d: util/i386/pc/grub-mkimage.c
--      set -e;           $(BUILD_CC) -Iutil/i386/pc -I$(srcdir)/util/i386/pc $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_mkimage_CFLAGS) -M $<        | sed 's,grub\-mkimage\.o[ :]*,grub_mkimage-util_i386_pc_grub_mkimage.o $@ : ,g' > $@;          [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Iutil/i386/pc -I$(srcdir)/util/i386/pc $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_mkimage_CFLAGS) -M $<          | sed 's,grub\-mkimage\.o[ :]*,grub_mkimage-util_i386_pc_grub_mkimage.o $@ : ,g' > $@;          [ -s $@ ] || rm -f $@
- -include grub_mkimage-util_i386_pc_grub_mkimage.d
- grub_mkimage-util_misc.o: util/misc.c
--      $(BUILD_CC) -Iutil -I$(srcdir)/util $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_mkimage_CFLAGS) -c -o $@ $<
-+      $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_mkimage_CFLAGS) -c -o $@ $<
- grub_mkimage-util_misc.d: util/misc.c
--      set -e;           $(BUILD_CC) -Iutil -I$(srcdir)/util $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_mkimage_CFLAGS) -M $<        | sed 's,misc\.o[ :]*,grub_mkimage-util_misc.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_mkimage_CFLAGS) -M $<          | sed 's,misc\.o[ :]*,grub_mkimage-util_misc.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
- -include grub_mkimage-util_misc.d
- grub_mkimage-util_resolve.o: util/resolve.c
--      $(BUILD_CC) -Iutil -I$(srcdir)/util $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_mkimage_CFLAGS) -c -o $@ $<
-+      $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_mkimage_CFLAGS) -c -o $@ $<
- grub_mkimage-util_resolve.d: util/resolve.c
--      set -e;           $(BUILD_CC) -Iutil -I$(srcdir)/util $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_mkimage_CFLAGS) -M $<        | sed 's,resolve\.o[ :]*,grub_mkimage-util_resolve.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_mkimage_CFLAGS) -M $<          | sed 's,resolve\.o[ :]*,grub_mkimage-util_resolve.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
- -include grub_mkimage-util_resolve.d
-@@ -328,205 +327,205 @@
- MOSTLYCLEANFILES += grub_setup-util_i386_pc_grub_setup.d grub_setup-util_i386_pc_biosdisk.d grub_setup-util_misc.d grub_setup-util_i386_pc_getroot.d grub_setup-kern_device.d grub_setup-kern_disk.d grub_setup-kern_err.d grub_setup-kern_misc.d grub_setup-fs_fat.d grub_setup-fs_ext2.d grub_setup-fs_xfs.d grub_setup-fs_affs.d grub_setup-fs_sfs.d grub_setup-kern_parser.d grub_setup-kern_partition.d grub_setup-partmap_pc.d grub_setup-fs_ufs.d grub_setup-fs_minix.d grub_setup-fs_hfs.d grub_setup-fs_jfs.d grub_setup-fs_hfsplus.d grub_setup-kern_file.d grub_setup-kern_fs.d grub_setup-kern_env.d grub_setup-fs_fshelp.d
- grub-setup: grub_setup-util_i386_pc_grub_setup.o grub_setup-util_i386_pc_biosdisk.o grub_setup-util_misc.o grub_setup-util_i386_pc_getroot.o grub_setup-kern_device.o grub_setup-kern_disk.o grub_setup-kern_err.o grub_setup-kern_misc.o grub_setup-fs_fat.o grub_setup-fs_ext2.o grub_setup-fs_xfs.o grub_setup-fs_affs.o grub_setup-fs_sfs.o grub_setup-kern_parser.o grub_setup-kern_partition.o grub_setup-partmap_pc.o grub_setup-fs_ufs.o grub_setup-fs_minix.o grub_setup-fs_hfs.o grub_setup-fs_jfs.o grub_setup-fs_hfsplus.o grub_setup-kern_file.o grub_setup-kern_fs.o grub_setup-kern_env.o grub_setup-fs_fshelp.o
--      $(BUILD_CC) -o $@ $^ $(BUILD_LDFLAGS) $(grub_setup_LDFLAGS)
-+      $(CC) -o $@ $^ $(LDFLAGS) $(grub_setup_LDFLAGS)
- grub_setup-util_i386_pc_grub_setup.o: util/i386/pc/grub-setup.c
--      $(BUILD_CC) -Iutil/i386/pc -I$(srcdir)/util/i386/pc $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -c -o $@ $<
-+      $(CC) -Iutil/i386/pc -I$(srcdir)/util/i386/pc $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -c -o $@ $<
- grub_setup-util_i386_pc_grub_setup.d: util/i386/pc/grub-setup.c
--      set -e;           $(BUILD_CC) -Iutil/i386/pc -I$(srcdir)/util/i386/pc $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -M $<          | sed 's,grub\-setup\.o[ :]*,grub_setup-util_i386_pc_grub_setup.o $@ : ,g' > $@;        [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Iutil/i386/pc -I$(srcdir)/util/i386/pc $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -M $<    | sed 's,grub\-setup\.o[ :]*,grub_setup-util_i386_pc_grub_setup.o $@ : ,g' > $@;        [ -s $@ ] || rm -f $@
- -include grub_setup-util_i386_pc_grub_setup.d
- grub_setup-util_i386_pc_biosdisk.o: util/i386/pc/biosdisk.c
--      $(BUILD_CC) -Iutil/i386/pc -I$(srcdir)/util/i386/pc $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -c -o $@ $<
-+      $(CC) -Iutil/i386/pc -I$(srcdir)/util/i386/pc $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -c -o $@ $<
- grub_setup-util_i386_pc_biosdisk.d: util/i386/pc/biosdisk.c
--      set -e;           $(BUILD_CC) -Iutil/i386/pc -I$(srcdir)/util/i386/pc $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -M $<          | sed 's,biosdisk\.o[ :]*,grub_setup-util_i386_pc_biosdisk.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Iutil/i386/pc -I$(srcdir)/util/i386/pc $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -M $<    | sed 's,biosdisk\.o[ :]*,grub_setup-util_i386_pc_biosdisk.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
- -include grub_setup-util_i386_pc_biosdisk.d
- grub_setup-util_misc.o: util/misc.c
--      $(BUILD_CC) -Iutil -I$(srcdir)/util $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -c -o $@ $<
-+      $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -c -o $@ $<
- grub_setup-util_misc.d: util/misc.c
--      set -e;           $(BUILD_CC) -Iutil -I$(srcdir)/util $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -M $<          | sed 's,misc\.o[ :]*,grub_setup-util_misc.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -M $<    | sed 's,misc\.o[ :]*,grub_setup-util_misc.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
- -include grub_setup-util_misc.d
- grub_setup-util_i386_pc_getroot.o: util/i386/pc/getroot.c
--      $(BUILD_CC) -Iutil/i386/pc -I$(srcdir)/util/i386/pc $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -c -o $@ $<
-+      $(CC) -Iutil/i386/pc -I$(srcdir)/util/i386/pc $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -c -o $@ $<
- grub_setup-util_i386_pc_getroot.d: util/i386/pc/getroot.c
--      set -e;           $(BUILD_CC) -Iutil/i386/pc -I$(srcdir)/util/i386/pc $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -M $<          | sed 's,getroot\.o[ :]*,grub_setup-util_i386_pc_getroot.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Iutil/i386/pc -I$(srcdir)/util/i386/pc $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -M $<    | sed 's,getroot\.o[ :]*,grub_setup-util_i386_pc_getroot.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
- -include grub_setup-util_i386_pc_getroot.d
- grub_setup-kern_device.o: kern/device.c
--      $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -c -o $@ $<
-+      $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -c -o $@ $<
- grub_setup-kern_device.d: kern/device.c
--      set -e;           $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -M $<          | sed 's,device\.o[ :]*,grub_setup-kern_device.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -M $<    | sed 's,device\.o[ :]*,grub_setup-kern_device.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
- -include grub_setup-kern_device.d
- grub_setup-kern_disk.o: kern/disk.c
--      $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -c -o $@ $<
-+      $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -c -o $@ $<
- grub_setup-kern_disk.d: kern/disk.c
--      set -e;           $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -M $<          | sed 's,disk\.o[ :]*,grub_setup-kern_disk.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -M $<    | sed 's,disk\.o[ :]*,grub_setup-kern_disk.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
- -include grub_setup-kern_disk.d
- grub_setup-kern_err.o: kern/err.c
--      $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -c -o $@ $<
-+      $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -c -o $@ $<
- grub_setup-kern_err.d: kern/err.c
--      set -e;           $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -M $<          | sed 's,err\.o[ :]*,grub_setup-kern_err.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -M $<    | sed 's,err\.o[ :]*,grub_setup-kern_err.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
- -include grub_setup-kern_err.d
- grub_setup-kern_misc.o: kern/misc.c
--      $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -c -o $@ $<
-+      $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -c -o $@ $<
- grub_setup-kern_misc.d: kern/misc.c
--      set -e;           $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -M $<          | sed 's,misc\.o[ :]*,grub_setup-kern_misc.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -M $<    | sed 's,misc\.o[ :]*,grub_setup-kern_misc.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
- -include grub_setup-kern_misc.d
- grub_setup-fs_fat.o: fs/fat.c
--      $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -c -o $@ $<
-+      $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -c -o $@ $<
- grub_setup-fs_fat.d: fs/fat.c
--      set -e;           $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -M $<      | sed 's,fat\.o[ :]*,grub_setup-fs_fat.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -M $<        | sed 's,fat\.o[ :]*,grub_setup-fs_fat.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
- -include grub_setup-fs_fat.d
- grub_setup-fs_ext2.o: fs/ext2.c
--      $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -c -o $@ $<
-+      $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -c -o $@ $<
- grub_setup-fs_ext2.d: fs/ext2.c
--      set -e;           $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -M $<      | sed 's,ext2\.o[ :]*,grub_setup-fs_ext2.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -M $<        | sed 's,ext2\.o[ :]*,grub_setup-fs_ext2.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
- -include grub_setup-fs_ext2.d
- grub_setup-fs_xfs.o: fs/xfs.c
--      $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -c -o $@ $<
-+      $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -c -o $@ $<
- grub_setup-fs_xfs.d: fs/xfs.c
--      set -e;           $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -M $<      | sed 's,xfs\.o[ :]*,grub_setup-fs_xfs.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -M $<        | sed 's,xfs\.o[ :]*,grub_setup-fs_xfs.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
- -include grub_setup-fs_xfs.d
- grub_setup-fs_affs.o: fs/affs.c
--      $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -c -o $@ $<
-+      $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -c -o $@ $<
- grub_setup-fs_affs.d: fs/affs.c
--      set -e;           $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -M $<      | sed 's,affs\.o[ :]*,grub_setup-fs_affs.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -M $<        | sed 's,affs\.o[ :]*,grub_setup-fs_affs.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
- -include grub_setup-fs_affs.d
- grub_setup-fs_sfs.o: fs/sfs.c
--      $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -c -o $@ $<
-+      $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -c -o $@ $<
- grub_setup-fs_sfs.d: fs/sfs.c
--      set -e;           $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -M $<      | sed 's,sfs\.o[ :]*,grub_setup-fs_sfs.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -M $<        | sed 's,sfs\.o[ :]*,grub_setup-fs_sfs.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
- -include grub_setup-fs_sfs.d
- grub_setup-kern_parser.o: kern/parser.c
--      $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -c -o $@ $<
-+      $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -c -o $@ $<
- grub_setup-kern_parser.d: kern/parser.c
--      set -e;           $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -M $<          | sed 's,parser\.o[ :]*,grub_setup-kern_parser.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -M $<    | sed 's,parser\.o[ :]*,grub_setup-kern_parser.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
- -include grub_setup-kern_parser.d
- grub_setup-kern_partition.o: kern/partition.c
--      $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -c -o $@ $<
-+      $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -c -o $@ $<
- grub_setup-kern_partition.d: kern/partition.c
--      set -e;           $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -M $<          | sed 's,partition\.o[ :]*,grub_setup-kern_partition.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -M $<    | sed 's,partition\.o[ :]*,grub_setup-kern_partition.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
- -include grub_setup-kern_partition.d
- grub_setup-partmap_pc.o: partmap/pc.c
--      $(BUILD_CC) -Ipartmap -I$(srcdir)/partmap $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -c -o $@ $<
-+      $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -c -o $@ $<
- grub_setup-partmap_pc.d: partmap/pc.c
--      set -e;           $(BUILD_CC) -Ipartmap -I$(srcdir)/partmap $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -M $<    | sed 's,pc\.o[ :]*,grub_setup-partmap_pc.o $@ : ,g' > $@;      [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -M $<      | sed 's,pc\.o[ :]*,grub_setup-partmap_pc.o $@ : ,g' > $@;      [ -s $@ ] || rm -f $@
- -include grub_setup-partmap_pc.d
- grub_setup-fs_ufs.o: fs/ufs.c
--      $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -c -o $@ $<
-+      $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -c -o $@ $<
- grub_setup-fs_ufs.d: fs/ufs.c
--      set -e;           $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -M $<      | sed 's,ufs\.o[ :]*,grub_setup-fs_ufs.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -M $<        | sed 's,ufs\.o[ :]*,grub_setup-fs_ufs.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
- -include grub_setup-fs_ufs.d
- grub_setup-fs_minix.o: fs/minix.c
--      $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -c -o $@ $<
-+      $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -c -o $@ $<
- grub_setup-fs_minix.d: fs/minix.c
--      set -e;           $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -M $<      | sed 's,minix\.o[ :]*,grub_setup-fs_minix.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -M $<        | sed 's,minix\.o[ :]*,grub_setup-fs_minix.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
- -include grub_setup-fs_minix.d
- grub_setup-fs_hfs.o: fs/hfs.c
--      $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -c -o $@ $<
-+      $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -c -o $@ $<
- grub_setup-fs_hfs.d: fs/hfs.c
--      set -e;           $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -M $<      | sed 's,hfs\.o[ :]*,grub_setup-fs_hfs.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -M $<        | sed 's,hfs\.o[ :]*,grub_setup-fs_hfs.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
- -include grub_setup-fs_hfs.d
- grub_setup-fs_jfs.o: fs/jfs.c
--      $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -c -o $@ $<
-+      $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -c -o $@ $<
- grub_setup-fs_jfs.d: fs/jfs.c
--      set -e;           $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -M $<      | sed 's,jfs\.o[ :]*,grub_setup-fs_jfs.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -M $<        | sed 's,jfs\.o[ :]*,grub_setup-fs_jfs.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
- -include grub_setup-fs_jfs.d
- grub_setup-fs_hfsplus.o: fs/hfsplus.c
--      $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -c -o $@ $<
-+      $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -c -o $@ $<
- grub_setup-fs_hfsplus.d: fs/hfsplus.c
--      set -e;           $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -M $<      | sed 's,hfsplus\.o[ :]*,grub_setup-fs_hfsplus.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -M $<        | sed 's,hfsplus\.o[ :]*,grub_setup-fs_hfsplus.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
- -include grub_setup-fs_hfsplus.d
- grub_setup-kern_file.o: kern/file.c
--      $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -c -o $@ $<
-+      $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -c -o $@ $<
- grub_setup-kern_file.d: kern/file.c
--      set -e;           $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -M $<          | sed 's,file\.o[ :]*,grub_setup-kern_file.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -M $<    | sed 's,file\.o[ :]*,grub_setup-kern_file.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
- -include grub_setup-kern_file.d
- grub_setup-kern_fs.o: kern/fs.c
--      $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -c -o $@ $<
-+      $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -c -o $@ $<
- grub_setup-kern_fs.d: kern/fs.c
--      set -e;           $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -M $<          | sed 's,fs\.o[ :]*,grub_setup-kern_fs.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -M $<    | sed 's,fs\.o[ :]*,grub_setup-kern_fs.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
- -include grub_setup-kern_fs.d
- grub_setup-kern_env.o: kern/env.c
--      $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -c -o $@ $<
-+      $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -c -o $@ $<
- grub_setup-kern_env.d: kern/env.c
--      set -e;           $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -M $<          | sed 's,env\.o[ :]*,grub_setup-kern_env.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -M $<    | sed 's,env\.o[ :]*,grub_setup-kern_env.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
- -include grub_setup-kern_env.d
- grub_setup-fs_fshelp.o: fs/fshelp.c
--      $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -c -o $@ $<
-+      $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -c -o $@ $<
- grub_setup-fs_fshelp.d: fs/fshelp.c
--      set -e;           $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -M $<      | sed 's,fshelp\.o[ :]*,grub_setup-fs_fshelp.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -M $<        | sed 's,fshelp\.o[ :]*,grub_setup-fs_fshelp.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
- -include grub_setup-fs_fshelp.d
-@@ -537,21 +536,21 @@
- MOSTLYCLEANFILES += grub_mkdevicemap-util_i386_pc_grub_mkdevicemap.d grub_mkdevicemap-util_misc.d
- grub-mkdevicemap: grub_mkdevicemap-util_i386_pc_grub_mkdevicemap.o grub_mkdevicemap-util_misc.o
--      $(BUILD_CC) -o $@ $^ $(BUILD_LDFLAGS) $(grub_mkdevicemap_LDFLAGS)
-+      $(CC) -o $@ $^ $(LDFLAGS) $(grub_mkdevicemap_LDFLAGS)
- grub_mkdevicemap-util_i386_pc_grub_mkdevicemap.o: util/i386/pc/grub-mkdevicemap.c
--      $(BUILD_CC) -Iutil/i386/pc -I$(srcdir)/util/i386/pc $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_mkdevicemap_CFLAGS) -c -o $@ $<
-+      $(CC) -Iutil/i386/pc -I$(srcdir)/util/i386/pc $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_mkdevicemap_CFLAGS) -c -o $@ $<
- grub_mkdevicemap-util_i386_pc_grub_mkdevicemap.d: util/i386/pc/grub-mkdevicemap.c
--      set -e;           $(BUILD_CC) -Iutil/i386/pc -I$(srcdir)/util/i386/pc $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_mkdevicemap_CFLAGS) -M $<    | sed 's,grub\-mkdevicemap\.o[ :]*,grub_mkdevicemap-util_i386_pc_grub_mkdevicemap.o $@ : ,g' > $@;      [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Iutil/i386/pc -I$(srcdir)/util/i386/pc $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_mkdevicemap_CFLAGS) -M $<      | sed 's,grub\-mkdevicemap\.o[ :]*,grub_mkdevicemap-util_i386_pc_grub_mkdevicemap.o $@ : ,g' > $@;      [ -s $@ ] || rm -f $@
- -include grub_mkdevicemap-util_i386_pc_grub_mkdevicemap.d
- grub_mkdevicemap-util_misc.o: util/misc.c
--      $(BUILD_CC) -Iutil -I$(srcdir)/util $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_mkdevicemap_CFLAGS) -c -o $@ $<
-+      $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_mkdevicemap_CFLAGS) -c -o $@ $<
- grub_mkdevicemap-util_misc.d: util/misc.c
--      set -e;           $(BUILD_CC) -Iutil -I$(srcdir)/util $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_mkdevicemap_CFLAGS) -M $<    | sed 's,misc\.o[ :]*,grub_mkdevicemap-util_misc.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_mkdevicemap_CFLAGS) -M $<      | sed 's,misc\.o[ :]*,grub_mkdevicemap-util_misc.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
- -include grub_mkdevicemap-util_misc.d
-@@ -567,206 +566,206 @@
- MOSTLYCLEANFILES += grub_probefs-util_i386_pc_grub_probefs.d grub_probefs-util_i386_pc_biosdisk.d grub_probefs-util_misc.d grub_probefs-util_i386_pc_getroot.d grub_probefs-kern_device.d grub_probefs-kern_disk.d grub_probefs-kern_err.d grub_probefs-kern_misc.d grub_probefs-fs_fat.d grub_probefs-fs_ext2.d grub_probefs-kern_parser.d grub_probefs-kern_partition.d grub_probefs-partmap_pc.d grub_probefs-fs_ufs.d grub_probefs-fs_minix.d grub_probefs-fs_hfs.d grub_probefs-fs_jfs.d grub_probefs-kern_fs.d grub_probefs-kern_env.d grub_probefs-fs_fshelp.d grub_probefs-fs_xfs.d grub_probefs-fs_affs.d grub_probefs-fs_sfs.d grub_probefs-fs_hfsplus.d
- grub-probefs: grub_probefs-util_i386_pc_grub_probefs.o grub_probefs-util_i386_pc_biosdisk.o grub_probefs-util_misc.o grub_probefs-util_i386_pc_getroot.o grub_probefs-kern_device.o grub_probefs-kern_disk.o grub_probefs-kern_err.o grub_probefs-kern_misc.o grub_probefs-fs_fat.o grub_probefs-fs_ext2.o grub_probefs-kern_parser.o grub_probefs-kern_partition.o grub_probefs-partmap_pc.o grub_probefs-fs_ufs.o grub_probefs-fs_minix.o grub_probefs-fs_hfs.o grub_probefs-fs_jfs.o grub_probefs-kern_fs.o grub_probefs-kern_env.o grub_probefs-fs_fshelp.o grub_probefs-fs_xfs.o grub_probefs-fs_affs.o grub_probefs-fs_sfs.o grub_probefs-fs_hfsplus.o
--      $(BUILD_CC) -o $@ $^ $(BUILD_LDFLAGS) $(grub_probefs_LDFLAGS)
-+      $(CC) -o $@ $^ $(LDFLAGS) $(grub_probefs_LDFLAGS)
- grub_probefs-util_i386_pc_grub_probefs.o: util/i386/pc/grub-probefs.c
--      $(BUILD_CC) -Iutil/i386/pc -I$(srcdir)/util/i386/pc $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -c -o $@ $<
-+      $(CC) -Iutil/i386/pc -I$(srcdir)/util/i386/pc $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -c -o $@ $<
- grub_probefs-util_i386_pc_grub_probefs.d: util/i386/pc/grub-probefs.c
--      set -e;           $(BUILD_CC) -Iutil/i386/pc -I$(srcdir)/util/i386/pc $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -M $<        | sed 's,grub\-probefs\.o[ :]*,grub_probefs-util_i386_pc_grub_probefs.o $@ : ,g' > $@;          [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Iutil/i386/pc -I$(srcdir)/util/i386/pc $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -M $<          | sed 's,grub\-probefs\.o[ :]*,grub_probefs-util_i386_pc_grub_probefs.o $@ : ,g' > $@;          [ -s $@ ] || rm -f $@
- -include grub_probefs-util_i386_pc_grub_probefs.d
- grub_probefs-util_i386_pc_biosdisk.o: util/i386/pc/biosdisk.c
--      $(BUILD_CC) -Iutil/i386/pc -I$(srcdir)/util/i386/pc $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -c -o $@ $<
-+      $(CC) -Iutil/i386/pc -I$(srcdir)/util/i386/pc $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -c -o $@ $<
- grub_probefs-util_i386_pc_biosdisk.d: util/i386/pc/biosdisk.c
--      set -e;           $(BUILD_CC) -Iutil/i386/pc -I$(srcdir)/util/i386/pc $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -M $<        | sed 's,biosdisk\.o[ :]*,grub_probefs-util_i386_pc_biosdisk.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Iutil/i386/pc -I$(srcdir)/util/i386/pc $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -M $<          | sed 's,biosdisk\.o[ :]*,grub_probefs-util_i386_pc_biosdisk.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
- -include grub_probefs-util_i386_pc_biosdisk.d
- grub_probefs-util_misc.o: util/misc.c
--      $(BUILD_CC) -Iutil -I$(srcdir)/util $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -c -o $@ $<
-+      $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -c -o $@ $<
- grub_probefs-util_misc.d: util/misc.c
--      set -e;           $(BUILD_CC) -Iutil -I$(srcdir)/util $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -M $<        | sed 's,misc\.o[ :]*,grub_probefs-util_misc.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -M $<          | sed 's,misc\.o[ :]*,grub_probefs-util_misc.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
- -include grub_probefs-util_misc.d
- grub_probefs-util_i386_pc_getroot.o: util/i386/pc/getroot.c
--      $(BUILD_CC) -Iutil/i386/pc -I$(srcdir)/util/i386/pc $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -c -o $@ $<
-+      $(CC) -Iutil/i386/pc -I$(srcdir)/util/i386/pc $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -c -o $@ $<
- grub_probefs-util_i386_pc_getroot.d: util/i386/pc/getroot.c
--      set -e;           $(BUILD_CC) -Iutil/i386/pc -I$(srcdir)/util/i386/pc $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -M $<        | sed 's,getroot\.o[ :]*,grub_probefs-util_i386_pc_getroot.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Iutil/i386/pc -I$(srcdir)/util/i386/pc $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -M $<          | sed 's,getroot\.o[ :]*,grub_probefs-util_i386_pc_getroot.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
- -include grub_probefs-util_i386_pc_getroot.d
- grub_probefs-kern_device.o: kern/device.c
--      $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -c -o $@ $<
-+      $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -c -o $@ $<
- grub_probefs-kern_device.d: kern/device.c
--      set -e;           $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -M $<        | sed 's,device\.o[ :]*,grub_probefs-kern_device.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -M $<          | sed 's,device\.o[ :]*,grub_probefs-kern_device.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
- -include grub_probefs-kern_device.d
- grub_probefs-kern_disk.o: kern/disk.c
--      $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -c -o $@ $<
-+      $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -c -o $@ $<
- grub_probefs-kern_disk.d: kern/disk.c
--      set -e;           $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -M $<        | sed 's,disk\.o[ :]*,grub_probefs-kern_disk.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -M $<          | sed 's,disk\.o[ :]*,grub_probefs-kern_disk.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
- -include grub_probefs-kern_disk.d
- grub_probefs-kern_err.o: kern/err.c
--      $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -c -o $@ $<
-+      $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -c -o $@ $<
- grub_probefs-kern_err.d: kern/err.c
--      set -e;           $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -M $<        | sed 's,err\.o[ :]*,grub_probefs-kern_err.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -M $<          | sed 's,err\.o[ :]*,grub_probefs-kern_err.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
- -include grub_probefs-kern_err.d
- grub_probefs-kern_misc.o: kern/misc.c
--      $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -c -o $@ $<
-+      $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -c -o $@ $<
- grub_probefs-kern_misc.d: kern/misc.c
--      set -e;           $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -M $<        | sed 's,misc\.o[ :]*,grub_probefs-kern_misc.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -M $<          | sed 's,misc\.o[ :]*,grub_probefs-kern_misc.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
- -include grub_probefs-kern_misc.d
- grub_probefs-fs_fat.o: fs/fat.c
--      $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -c -o $@ $<
-+      $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -c -o $@ $<
- grub_probefs-fs_fat.d: fs/fat.c
--      set -e;           $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -M $<    | sed 's,fat\.o[ :]*,grub_probefs-fs_fat.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -M $<      | sed 's,fat\.o[ :]*,grub_probefs-fs_fat.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
- -include grub_probefs-fs_fat.d
- grub_probefs-fs_ext2.o: fs/ext2.c
--      $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -c -o $@ $<
-+      $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -c -o $@ $<
- grub_probefs-fs_ext2.d: fs/ext2.c
--      set -e;           $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -M $<    | sed 's,ext2\.o[ :]*,grub_probefs-fs_ext2.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -M $<      | sed 's,ext2\.o[ :]*,grub_probefs-fs_ext2.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
- -include grub_probefs-fs_ext2.d
- grub_probefs-kern_parser.o: kern/parser.c
--      $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -c -o $@ $<
-+      $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -c -o $@ $<
- grub_probefs-kern_parser.d: kern/parser.c
--      set -e;           $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -M $<        | sed 's,parser\.o[ :]*,grub_probefs-kern_parser.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -M $<          | sed 's,parser\.o[ :]*,grub_probefs-kern_parser.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
- -include grub_probefs-kern_parser.d
- grub_probefs-kern_partition.o: kern/partition.c
--      $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -c -o $@ $<
-+      $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -c -o $@ $<
- grub_probefs-kern_partition.d: kern/partition.c
--      set -e;           $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -M $<        | sed 's,partition\.o[ :]*,grub_probefs-kern_partition.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -M $<          | sed 's,partition\.o[ :]*,grub_probefs-kern_partition.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
- -include grub_probefs-kern_partition.d
- grub_probefs-partmap_pc.o: partmap/pc.c
--      $(BUILD_CC) -Ipartmap -I$(srcdir)/partmap $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -c -o $@ $<
-+      $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -c -o $@ $<
- grub_probefs-partmap_pc.d: partmap/pc.c
--      set -e;           $(BUILD_CC) -Ipartmap -I$(srcdir)/partmap $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -M $<          | sed 's,pc\.o[ :]*,grub_probefs-partmap_pc.o $@ : ,g' > $@;    [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -M $<    | sed 's,pc\.o[ :]*,grub_probefs-partmap_pc.o $@ : ,g' > $@;    [ -s $@ ] || rm -f $@
- -include grub_probefs-partmap_pc.d
- grub_probefs-fs_ufs.o: fs/ufs.c
--      $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -c -o $@ $<
-+      $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -c -o $@ $<
- grub_probefs-fs_ufs.d: fs/ufs.c
--      set -e;           $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -M $<    | sed 's,ufs\.o[ :]*,grub_probefs-fs_ufs.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -M $<      | sed 's,ufs\.o[ :]*,grub_probefs-fs_ufs.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
- -include grub_probefs-fs_ufs.d
- grub_probefs-fs_minix.o: fs/minix.c
--      $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -c -o $@ $<
-+      $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -c -o $@ $<
- grub_probefs-fs_minix.d: fs/minix.c
--      set -e;           $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -M $<    | sed 's,minix\.o[ :]*,grub_probefs-fs_minix.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -M $<      | sed 's,minix\.o[ :]*,grub_probefs-fs_minix.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
- -include grub_probefs-fs_minix.d
- grub_probefs-fs_hfs.o: fs/hfs.c
--      $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -c -o $@ $<
-+      $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -c -o $@ $<
- grub_probefs-fs_hfs.d: fs/hfs.c
--      set -e;           $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -M $<    | sed 's,hfs\.o[ :]*,grub_probefs-fs_hfs.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -M $<      | sed 's,hfs\.o[ :]*,grub_probefs-fs_hfs.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
- -include grub_probefs-fs_hfs.d
- grub_probefs-fs_jfs.o: fs/jfs.c
--      $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -c -o $@ $<
-+      $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -c -o $@ $<
- grub_probefs-fs_jfs.d: fs/jfs.c
--      set -e;           $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -M $<    | sed 's,jfs\.o[ :]*,grub_probefs-fs_jfs.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -M $<      | sed 's,jfs\.o[ :]*,grub_probefs-fs_jfs.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
- -include grub_probefs-fs_jfs.d
- grub_probefs-kern_fs.o: kern/fs.c
--      $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -c -o $@ $<
-+      $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -c -o $@ $<
- grub_probefs-kern_fs.d: kern/fs.c
--      set -e;           $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -M $<        | sed 's,fs\.o[ :]*,grub_probefs-kern_fs.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -M $<          | sed 's,fs\.o[ :]*,grub_probefs-kern_fs.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
- -include grub_probefs-kern_fs.d
- grub_probefs-kern_env.o: kern/env.c
--      $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -c -o $@ $<
-+      $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -c -o $@ $<
- grub_probefs-kern_env.d: kern/env.c
--      set -e;           $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -M $<        | sed 's,env\.o[ :]*,grub_probefs-kern_env.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -M $<          | sed 's,env\.o[ :]*,grub_probefs-kern_env.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
- -include grub_probefs-kern_env.d
- grub_probefs-fs_fshelp.o: fs/fshelp.c
--      $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -c -o $@ $<
-+      $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -c -o $@ $<
- grub_probefs-fs_fshelp.d: fs/fshelp.c
--      set -e;           $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -M $<    | sed 's,fshelp\.o[ :]*,grub_probefs-fs_fshelp.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -M $<      | sed 's,fshelp\.o[ :]*,grub_probefs-fs_fshelp.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
- -include grub_probefs-fs_fshelp.d
- grub_probefs-fs_xfs.o: fs/xfs.c
--      $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -c -o $@ $<
-+      $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -c -o $@ $<
- grub_probefs-fs_xfs.d: fs/xfs.c
--      set -e;           $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -M $<    | sed 's,xfs\.o[ :]*,grub_probefs-fs_xfs.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -M $<      | sed 's,xfs\.o[ :]*,grub_probefs-fs_xfs.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
- -include grub_probefs-fs_xfs.d
- grub_probefs-fs_affs.o: fs/affs.c
--      $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -c -o $@ $<
-+      $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -c -o $@ $<
- grub_probefs-fs_affs.d: fs/affs.c
--      set -e;           $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -M $<    | sed 's,affs\.o[ :]*,grub_probefs-fs_affs.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -M $<      | sed 's,affs\.o[ :]*,grub_probefs-fs_affs.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
- -include grub_probefs-fs_affs.d
- grub_probefs-fs_sfs.o: fs/sfs.c
--      $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -c -o $@ $<
-+      $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -c -o $@ $<
- grub_probefs-fs_sfs.d: fs/sfs.c
--      set -e;           $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -M $<    | sed 's,sfs\.o[ :]*,grub_probefs-fs_sfs.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -M $<      | sed 's,sfs\.o[ :]*,grub_probefs-fs_sfs.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
- -include grub_probefs-fs_sfs.d
- grub_probefs-fs_hfsplus.o: fs/hfsplus.c
--      $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -c -o $@ $<
-+      $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -c -o $@ $<
- grub_probefs-fs_hfsplus.d: fs/hfsplus.c
--      set -e;           $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -M $<    | sed 's,hfsplus\.o[ :]*,grub_probefs-fs_hfsplus.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -M $<      | sed 's,hfsplus\.o[ :]*,grub_probefs-fs_hfsplus.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
- -include grub_probefs-fs_hfsplus.d
- # For grub-emu.
--grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c              \
--      commands/configfile.c commands/default.c commands/help.c        \
-+grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c      \
-+      commands/configfile.c commands/help.c                           \
-       commands/terminal.c commands/ls.c commands/test.c               \
--      commands/search.c commands/timeout.c                            \
-+      commands/search.c commands/blocklist.c                          \
-       commands/i386/pc/halt.c commands/i386/pc/reboot.c               \
-       disk/loopback.c                                                 \
-       fs/affs.c fs/ext2.c fs/fat.c fs/fshelp.c fs/hfs.c fs/iso9660.c  \
-@@ -777,583 +776,550 @@
-       kern/loader.c kern/main.c kern/misc.c kern/parser.c             \
-       grub_script.tab.c kern/partition.c kern/rescue.c kern/term.c    \
-       normal/arg.c normal/cmdline.c normal/command.c normal/function.c\
--      normal/completion.c normal/context.c normal/main.c              \
-+      normal/completion.c normal/main.c                               \
-       normal/menu.c normal/menu_entry.c normal/misc.c normal/script.c \
-       partmap/amiga.c partmap/apple.c partmap/pc.c partmap/sun.c      \
-       partmap/acorn.c partmap/gpt.c                                   \
-       util/console.c util/grub-emu.c util/misc.c                      \
-       util/i386/pc/biosdisk.c util/i386/pc/getroot.c                  \
-       util/i386/pc/misc.c grub_emu_init.c
--CLEANFILES += grub-emu grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_default.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_timeout.o grub_emu-commands_i386_pc_halt.o grub_emu-commands_i386_pc_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_fshelp.o grub_emu-fs_hfs.o grub_emu-fs_iso9660.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_hfsplus.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_context.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_i386_pc_biosdisk.o grub_emu-util_i386_pc_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-grub_emu_init.o
--MOSTLYCLEANFILES += grub_emu-commands_boot.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_default.d grub_emu-commands_help.d grub_emu-commands_terminal.d grub_emu-commands_ls.d grub_emu-commands_test.d grub_emu-commands_search.d grub_emu-commands_timeout.d grub_emu-commands_i386_pc_halt.d grub_emu-commands_i386_pc_reboot.d grub_emu-disk_loopback.d grub_emu-fs_affs.d grub_emu-fs_ext2.d grub_emu-fs_fat.d grub_emu-fs_fshelp.d grub_emu-fs_hfs.d grub_emu-fs_iso9660.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-fs_hfsplus.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-normal_execute.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-normal_lexer.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-grub_script_tab.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-normal_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_function.d grub_emu-normal_completion.d grub_emu-normal_context.d grub_emu-normal_main.d grub_emu-normal_menu.d grub_emu-normal_menu_entry.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-partmap_gpt.d grub_emu-util_console.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_i386_pc_biosdisk.d grub_emu-util_i386_pc_getroot.d grub_emu-util_i386_pc_misc.d grub_emu-grub_emu_init.d
-+CLEANFILES += grub-emu grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_i386_pc_halt.o grub_emu-commands_i386_pc_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_fshelp.o grub_emu-fs_hfs.o grub_emu-fs_iso9660.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_hfsplus.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_i386_pc_biosdisk.o grub_emu-util_i386_pc_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-grub_emu_init.o
-+MOSTLYCLEANFILES += grub_emu-commands_boot.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_help.d grub_emu-commands_terminal.d grub_emu-commands_ls.d grub_emu-commands_test.d grub_emu-commands_search.d grub_emu-commands_blocklist.d grub_emu-commands_i386_pc_halt.d grub_emu-commands_i386_pc_reboot.d grub_emu-disk_loopback.d grub_emu-fs_affs.d grub_emu-fs_ext2.d grub_emu-fs_fat.d grub_emu-fs_fshelp.d grub_emu-fs_hfs.d grub_emu-fs_iso9660.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-fs_hfsplus.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-normal_execute.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-normal_lexer.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-grub_script_tab.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-normal_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_function.d grub_emu-normal_completion.d grub_emu-normal_main.d grub_emu-normal_menu.d grub_emu-normal_menu_entry.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-partmap_gpt.d grub_emu-util_console.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_i386_pc_biosdisk.d grub_emu-util_i386_pc_getroot.d grub_emu-util_i386_pc_misc.d grub_emu-grub_emu_init.d
--grub-emu: grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_default.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_timeout.o grub_emu-commands_i386_pc_halt.o grub_emu-commands_i386_pc_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_fshelp.o grub_emu-fs_hfs.o grub_emu-fs_iso9660.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_hfsplus.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_context.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_i386_pc_biosdisk.o grub_emu-util_i386_pc_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-grub_emu_init.o
--      $(BUILD_CC) -o $@ $^ $(BUILD_LDFLAGS) $(grub_emu_LDFLAGS)
-+grub-emu: grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_i386_pc_halt.o grub_emu-commands_i386_pc_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_fshelp.o grub_emu-fs_hfs.o grub_emu-fs_iso9660.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_hfsplus.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_i386_pc_biosdisk.o grub_emu-util_i386_pc_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-grub_emu_init.o
-+      $(CC) -o $@ $^ $(LDFLAGS) $(grub_emu_LDFLAGS)
- grub_emu-commands_boot.o: commands/boot.c
--      $(BUILD_CC) -Icommands -I$(srcdir)/commands $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
-+      $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
- grub_emu-commands_boot.d: commands/boot.c
--      set -e;           $(BUILD_CC) -Icommands -I$(srcdir)/commands $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,boot\.o[ :]*,grub_emu-commands_boot.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,boot\.o[ :]*,grub_emu-commands_boot.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
- -include grub_emu-commands_boot.d
- grub_emu-commands_cat.o: commands/cat.c
--      $(BUILD_CC) -Icommands -I$(srcdir)/commands $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
-+      $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
- grub_emu-commands_cat.d: commands/cat.c
--      set -e;           $(BUILD_CC) -Icommands -I$(srcdir)/commands $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,cat\.o[ :]*,grub_emu-commands_cat.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,cat\.o[ :]*,grub_emu-commands_cat.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
- -include grub_emu-commands_cat.d
- grub_emu-commands_cmp.o: commands/cmp.c
--      $(BUILD_CC) -Icommands -I$(srcdir)/commands $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
-+      $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
- grub_emu-commands_cmp.d: commands/cmp.c
--      set -e;           $(BUILD_CC) -Icommands -I$(srcdir)/commands $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,cmp\.o[ :]*,grub_emu-commands_cmp.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,cmp\.o[ :]*,grub_emu-commands_cmp.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
- -include grub_emu-commands_cmp.d
- grub_emu-commands_configfile.o: commands/configfile.c
--      $(BUILD_CC) -Icommands -I$(srcdir)/commands $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
-+      $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
- grub_emu-commands_configfile.d: commands/configfile.c
--      set -e;           $(BUILD_CC) -Icommands -I$(srcdir)/commands $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,configfile\.o[ :]*,grub_emu-commands_configfile.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,configfile\.o[ :]*,grub_emu-commands_configfile.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
- -include grub_emu-commands_configfile.d
--grub_emu-commands_default.o: commands/default.c
--      $(BUILD_CC) -Icommands -I$(srcdir)/commands $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
--
--grub_emu-commands_default.d: commands/default.c
--      set -e;           $(BUILD_CC) -Icommands -I$(srcdir)/commands $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,default\.o[ :]*,grub_emu-commands_default.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
--
---include grub_emu-commands_default.d
--
- grub_emu-commands_help.o: commands/help.c
--      $(BUILD_CC) -Icommands -I$(srcdir)/commands $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
-+      $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
- grub_emu-commands_help.d: commands/help.c
--      set -e;           $(BUILD_CC) -Icommands -I$(srcdir)/commands $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,help\.o[ :]*,grub_emu-commands_help.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,help\.o[ :]*,grub_emu-commands_help.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
- -include grub_emu-commands_help.d
- grub_emu-commands_terminal.o: commands/terminal.c
--      $(BUILD_CC) -Icommands -I$(srcdir)/commands $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
-+      $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
- grub_emu-commands_terminal.d: commands/terminal.c
--      set -e;           $(BUILD_CC) -Icommands -I$(srcdir)/commands $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,terminal\.o[ :]*,grub_emu-commands_terminal.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,terminal\.o[ :]*,grub_emu-commands_terminal.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
- -include grub_emu-commands_terminal.d
- grub_emu-commands_ls.o: commands/ls.c
--      $(BUILD_CC) -Icommands -I$(srcdir)/commands $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
-+      $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
- grub_emu-commands_ls.d: commands/ls.c
--      set -e;           $(BUILD_CC) -Icommands -I$(srcdir)/commands $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,ls\.o[ :]*,grub_emu-commands_ls.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,ls\.o[ :]*,grub_emu-commands_ls.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
- -include grub_emu-commands_ls.d
- grub_emu-commands_test.o: commands/test.c
--      $(BUILD_CC) -Icommands -I$(srcdir)/commands $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
-+      $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
- grub_emu-commands_test.d: commands/test.c
--      set -e;           $(BUILD_CC) -Icommands -I$(srcdir)/commands $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,test\.o[ :]*,grub_emu-commands_test.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,test\.o[ :]*,grub_emu-commands_test.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
- -include grub_emu-commands_test.d
- grub_emu-commands_search.o: commands/search.c
--      $(BUILD_CC) -Icommands -I$(srcdir)/commands $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
-+      $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
- grub_emu-commands_search.d: commands/search.c
--      set -e;           $(BUILD_CC) -Icommands -I$(srcdir)/commands $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,search\.o[ :]*,grub_emu-commands_search.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,search\.o[ :]*,grub_emu-commands_search.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
- -include grub_emu-commands_search.d
--grub_emu-commands_timeout.o: commands/timeout.c
--      $(BUILD_CC) -Icommands -I$(srcdir)/commands $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
-+grub_emu-commands_blocklist.o: commands/blocklist.c
-+      $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
--grub_emu-commands_timeout.d: commands/timeout.c
--      set -e;           $(BUILD_CC) -Icommands -I$(srcdir)/commands $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,timeout\.o[ :]*,grub_emu-commands_timeout.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
-+grub_emu-commands_blocklist.d: commands/blocklist.c
-+      set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,blocklist\.o[ :]*,grub_emu-commands_blocklist.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
---include grub_emu-commands_timeout.d
-+-include grub_emu-commands_blocklist.d
- grub_emu-commands_i386_pc_halt.o: commands/i386/pc/halt.c
--      $(BUILD_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
-+      $(CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
- grub_emu-commands_i386_pc_halt.d: commands/i386/pc/halt.c
--      set -e;           $(BUILD_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,halt\.o[ :]*,grub_emu-commands_i386_pc_halt.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,halt\.o[ :]*,grub_emu-commands_i386_pc_halt.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
- -include grub_emu-commands_i386_pc_halt.d
- grub_emu-commands_i386_pc_reboot.o: commands/i386/pc/reboot.c
--      $(BUILD_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
-+      $(CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
- grub_emu-commands_i386_pc_reboot.d: commands/i386/pc/reboot.c
--      set -e;           $(BUILD_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,reboot\.o[ :]*,grub_emu-commands_i386_pc_reboot.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,reboot\.o[ :]*,grub_emu-commands_i386_pc_reboot.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
- -include grub_emu-commands_i386_pc_reboot.d
- grub_emu-disk_loopback.o: disk/loopback.c
--      $(BUILD_CC) -Idisk -I$(srcdir)/disk $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
-+      $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
- grub_emu-disk_loopback.d: disk/loopback.c
--      set -e;           $(BUILD_CC) -Idisk -I$(srcdir)/disk $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,loopback\.o[ :]*,grub_emu-disk_loopback.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,loopback\.o[ :]*,grub_emu-disk_loopback.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
- -include grub_emu-disk_loopback.d
- grub_emu-fs_affs.o: fs/affs.c
--      $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
-+      $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
- grub_emu-fs_affs.d: fs/affs.c
--      set -e;           $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,affs\.o[ :]*,grub_emu-fs_affs.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<          | sed 's,affs\.o[ :]*,grub_emu-fs_affs.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
- -include grub_emu-fs_affs.d
- grub_emu-fs_ext2.o: fs/ext2.c
--      $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
-+      $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
- grub_emu-fs_ext2.d: fs/ext2.c
--      set -e;           $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,ext2\.o[ :]*,grub_emu-fs_ext2.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<          | sed 's,ext2\.o[ :]*,grub_emu-fs_ext2.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
- -include grub_emu-fs_ext2.d
- grub_emu-fs_fat.o: fs/fat.c
--      $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
-+      $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
- grub_emu-fs_fat.d: fs/fat.c
--      set -e;           $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,fat\.o[ :]*,grub_emu-fs_fat.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<          | sed 's,fat\.o[ :]*,grub_emu-fs_fat.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
- -include grub_emu-fs_fat.d
- grub_emu-fs_fshelp.o: fs/fshelp.c
--      $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
-+      $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
- grub_emu-fs_fshelp.d: fs/fshelp.c
--      set -e;           $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,fshelp\.o[ :]*,grub_emu-fs_fshelp.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<          | sed 's,fshelp\.o[ :]*,grub_emu-fs_fshelp.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
- -include grub_emu-fs_fshelp.d
- grub_emu-fs_hfs.o: fs/hfs.c
--      $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
-+      $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
- grub_emu-fs_hfs.d: fs/hfs.c
--      set -e;           $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,hfs\.o[ :]*,grub_emu-fs_hfs.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<          | sed 's,hfs\.o[ :]*,grub_emu-fs_hfs.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
- -include grub_emu-fs_hfs.d
- grub_emu-fs_iso9660.o: fs/iso9660.c
--      $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
-+      $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
- grub_emu-fs_iso9660.d: fs/iso9660.c
--      set -e;           $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,iso9660\.o[ :]*,grub_emu-fs_iso9660.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<          | sed 's,iso9660\.o[ :]*,grub_emu-fs_iso9660.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
- -include grub_emu-fs_iso9660.d
- grub_emu-fs_jfs.o: fs/jfs.c
--      $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
-+      $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
- grub_emu-fs_jfs.d: fs/jfs.c
--      set -e;           $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,jfs\.o[ :]*,grub_emu-fs_jfs.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<          | sed 's,jfs\.o[ :]*,grub_emu-fs_jfs.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
- -include grub_emu-fs_jfs.d
- grub_emu-fs_minix.o: fs/minix.c
--      $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
-+      $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
- grub_emu-fs_minix.d: fs/minix.c
--      set -e;           $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,minix\.o[ :]*,grub_emu-fs_minix.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<          | sed 's,minix\.o[ :]*,grub_emu-fs_minix.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
- -include grub_emu-fs_minix.d
- grub_emu-fs_sfs.o: fs/sfs.c
--      $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
-+      $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
- grub_emu-fs_sfs.d: fs/sfs.c
--      set -e;           $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,sfs\.o[ :]*,grub_emu-fs_sfs.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<          | sed 's,sfs\.o[ :]*,grub_emu-fs_sfs.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
- -include grub_emu-fs_sfs.d
- grub_emu-fs_ufs.o: fs/ufs.c
--      $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
-+      $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
- grub_emu-fs_ufs.d: fs/ufs.c
--      set -e;           $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,ufs\.o[ :]*,grub_emu-fs_ufs.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<          | sed 's,ufs\.o[ :]*,grub_emu-fs_ufs.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
- -include grub_emu-fs_ufs.d
- grub_emu-fs_xfs.o: fs/xfs.c
--      $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
-+      $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
- grub_emu-fs_xfs.d: fs/xfs.c
--      set -e;           $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,xfs\.o[ :]*,grub_emu-fs_xfs.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<          | sed 's,xfs\.o[ :]*,grub_emu-fs_xfs.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
- -include grub_emu-fs_xfs.d
- grub_emu-fs_hfsplus.o: fs/hfsplus.c
--      $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
-+      $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
- grub_emu-fs_hfsplus.d: fs/hfsplus.c
--      set -e;           $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,hfsplus\.o[ :]*,grub_emu-fs_hfsplus.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<          | sed 's,hfsplus\.o[ :]*,grub_emu-fs_hfsplus.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
- -include grub_emu-fs_hfsplus.d
- grub_emu-io_gzio.o: io/gzio.c
--      $(BUILD_CC) -Iio -I$(srcdir)/io $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
-+      $(CC) -Iio -I$(srcdir)/io $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
- grub_emu-io_gzio.d: io/gzio.c
--      set -e;           $(BUILD_CC) -Iio -I$(srcdir)/io $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,gzio\.o[ :]*,grub_emu-io_gzio.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Iio -I$(srcdir)/io $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<          | sed 's,gzio\.o[ :]*,grub_emu-io_gzio.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
- -include grub_emu-io_gzio.d
- grub_emu-kern_device.o: kern/device.c
--      $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
-+      $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
- grub_emu-kern_device.d: kern/device.c
--      set -e;           $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,device\.o[ :]*,grub_emu-kern_device.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,device\.o[ :]*,grub_emu-kern_device.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
- -include grub_emu-kern_device.d
- grub_emu-kern_disk.o: kern/disk.c
--      $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
-+      $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
- grub_emu-kern_disk.d: kern/disk.c
--      set -e;           $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,disk\.o[ :]*,grub_emu-kern_disk.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,disk\.o[ :]*,grub_emu-kern_disk.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
- -include grub_emu-kern_disk.d
- grub_emu-kern_dl.o: kern/dl.c
--      $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
-+      $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
- grub_emu-kern_dl.d: kern/dl.c
--      set -e;           $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,dl\.o[ :]*,grub_emu-kern_dl.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,dl\.o[ :]*,grub_emu-kern_dl.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
- -include grub_emu-kern_dl.d
- grub_emu-kern_env.o: kern/env.c
--      $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
-+      $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
- grub_emu-kern_env.d: kern/env.c
--      set -e;           $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,env\.o[ :]*,grub_emu-kern_env.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,env\.o[ :]*,grub_emu-kern_env.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
- -include grub_emu-kern_env.d
- grub_emu-kern_err.o: kern/err.c
--      $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
-+      $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
- grub_emu-kern_err.d: kern/err.c
--      set -e;           $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,err\.o[ :]*,grub_emu-kern_err.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,err\.o[ :]*,grub_emu-kern_err.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
- -include grub_emu-kern_err.d
- grub_emu-normal_execute.o: normal/execute.c
--      $(BUILD_CC) -Inormal -I$(srcdir)/normal $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
-+      $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
- grub_emu-normal_execute.d: normal/execute.c
--      set -e;           $(BUILD_CC) -Inormal -I$(srcdir)/normal $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,execute\.o[ :]*,grub_emu-normal_execute.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<          | sed 's,execute\.o[ :]*,grub_emu-normal_execute.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
- -include grub_emu-normal_execute.d
- grub_emu-kern_file.o: kern/file.c
--      $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
-+      $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
- grub_emu-kern_file.d: kern/file.c
--      set -e;           $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,file\.o[ :]*,grub_emu-kern_file.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,file\.o[ :]*,grub_emu-kern_file.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
- -include grub_emu-kern_file.d
- grub_emu-kern_fs.o: kern/fs.c
--      $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
-+      $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
- grub_emu-kern_fs.d: kern/fs.c
--      set -e;           $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,fs\.o[ :]*,grub_emu-kern_fs.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,fs\.o[ :]*,grub_emu-kern_fs.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
- -include grub_emu-kern_fs.d
- grub_emu-normal_lexer.o: normal/lexer.c
--      $(BUILD_CC) -Inormal -I$(srcdir)/normal $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
-+      $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
- grub_emu-normal_lexer.d: normal/lexer.c
--      set -e;           $(BUILD_CC) -Inormal -I$(srcdir)/normal $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,lexer\.o[ :]*,grub_emu-normal_lexer.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<          | sed 's,lexer\.o[ :]*,grub_emu-normal_lexer.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
- -include grub_emu-normal_lexer.d
- grub_emu-kern_loader.o: kern/loader.c
--      $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
-+      $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
- grub_emu-kern_loader.d: kern/loader.c
--      set -e;           $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,loader\.o[ :]*,grub_emu-kern_loader.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,loader\.o[ :]*,grub_emu-kern_loader.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
- -include grub_emu-kern_loader.d
- grub_emu-kern_main.o: kern/main.c
--      $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
-+      $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
- grub_emu-kern_main.d: kern/main.c
--      set -e;           $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,main\.o[ :]*,grub_emu-kern_main.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,main\.o[ :]*,grub_emu-kern_main.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
- -include grub_emu-kern_main.d
- grub_emu-kern_misc.o: kern/misc.c
--      $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
-+      $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
- grub_emu-kern_misc.d: kern/misc.c
--      set -e;           $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,misc\.o[ :]*,grub_emu-kern_misc.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,misc\.o[ :]*,grub_emu-kern_misc.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
- -include grub_emu-kern_misc.d
- grub_emu-kern_parser.o: kern/parser.c
--      $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
-+      $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
- grub_emu-kern_parser.d: kern/parser.c
--      set -e;           $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,parser\.o[ :]*,grub_emu-kern_parser.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,parser\.o[ :]*,grub_emu-kern_parser.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
- -include grub_emu-kern_parser.d
- grub_emu-grub_script_tab.o: grub_script.tab.c
--      $(BUILD_CC) -I. -I$(srcdir)/. $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
-+      $(CC) -I. -I$(srcdir)/. $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
- grub_emu-grub_script_tab.d: grub_script.tab.c
--      set -e;           $(BUILD_CC) -I. -I$(srcdir)/. $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<          | sed 's,grub_script\.tab\.o[ :]*,grub_emu-grub_script_tab.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -I. -I$(srcdir)/. $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,grub_script\.tab\.o[ :]*,grub_emu-grub_script_tab.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
- -include grub_emu-grub_script_tab.d
- grub_emu-kern_partition.o: kern/partition.c
--      $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
-+      $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
- grub_emu-kern_partition.d: kern/partition.c
--      set -e;           $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,partition\.o[ :]*,grub_emu-kern_partition.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,partition\.o[ :]*,grub_emu-kern_partition.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
- -include grub_emu-kern_partition.d
- grub_emu-kern_rescue.o: kern/rescue.c
--      $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
-+      $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
- grub_emu-kern_rescue.d: kern/rescue.c
--      set -e;           $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,rescue\.o[ :]*,grub_emu-kern_rescue.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,rescue\.o[ :]*,grub_emu-kern_rescue.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
- -include grub_emu-kern_rescue.d
- grub_emu-kern_term.o: kern/term.c
--      $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
-+      $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
- grub_emu-kern_term.d: kern/term.c
--      set -e;           $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,term\.o[ :]*,grub_emu-kern_term.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,term\.o[ :]*,grub_emu-kern_term.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
- -include grub_emu-kern_term.d
- grub_emu-normal_arg.o: normal/arg.c
--      $(BUILD_CC) -Inormal -I$(srcdir)/normal $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
-+      $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
- grub_emu-normal_arg.d: normal/arg.c
--      set -e;           $(BUILD_CC) -Inormal -I$(srcdir)/normal $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,arg\.o[ :]*,grub_emu-normal_arg.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<          | sed 's,arg\.o[ :]*,grub_emu-normal_arg.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
- -include grub_emu-normal_arg.d
- grub_emu-normal_cmdline.o: normal/cmdline.c
--      $(BUILD_CC) -Inormal -I$(srcdir)/normal $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
-+      $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
- grub_emu-normal_cmdline.d: normal/cmdline.c
--      set -e;           $(BUILD_CC) -Inormal -I$(srcdir)/normal $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,cmdline\.o[ :]*,grub_emu-normal_cmdline.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<          | sed 's,cmdline\.o[ :]*,grub_emu-normal_cmdline.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
- -include grub_emu-normal_cmdline.d
- grub_emu-normal_command.o: normal/command.c
--      $(BUILD_CC) -Inormal -I$(srcdir)/normal $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
-+      $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
- grub_emu-normal_command.d: normal/command.c
--      set -e;           $(BUILD_CC) -Inormal -I$(srcdir)/normal $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,command\.o[ :]*,grub_emu-normal_command.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<          | sed 's,command\.o[ :]*,grub_emu-normal_command.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
- -include grub_emu-normal_command.d
- grub_emu-normal_function.o: normal/function.c
--      $(BUILD_CC) -Inormal -I$(srcdir)/normal $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
-+      $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
- grub_emu-normal_function.d: normal/function.c
--      set -e;           $(BUILD_CC) -Inormal -I$(srcdir)/normal $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,function\.o[ :]*,grub_emu-normal_function.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<          | sed 's,function\.o[ :]*,grub_emu-normal_function.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
- -include grub_emu-normal_function.d
- grub_emu-normal_completion.o: normal/completion.c
--      $(BUILD_CC) -Inormal -I$(srcdir)/normal $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
-+      $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
- grub_emu-normal_completion.d: normal/completion.c
--      set -e;           $(BUILD_CC) -Inormal -I$(srcdir)/normal $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,completion\.o[ :]*,grub_emu-normal_completion.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<          | sed 's,completion\.o[ :]*,grub_emu-normal_completion.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
- -include grub_emu-normal_completion.d
--grub_emu-normal_context.o: normal/context.c
--      $(BUILD_CC) -Inormal -I$(srcdir)/normal $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
--
--grub_emu-normal_context.d: normal/context.c
--      set -e;           $(BUILD_CC) -Inormal -I$(srcdir)/normal $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,context\.o[ :]*,grub_emu-normal_context.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
--
---include grub_emu-normal_context.d
--
- grub_emu-normal_main.o: normal/main.c
--      $(BUILD_CC) -Inormal -I$(srcdir)/normal $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
-+      $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
- grub_emu-normal_main.d: normal/main.c
--      set -e;           $(BUILD_CC) -Inormal -I$(srcdir)/normal $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,main\.o[ :]*,grub_emu-normal_main.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<          | sed 's,main\.o[ :]*,grub_emu-normal_main.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
- -include grub_emu-normal_main.d
- grub_emu-normal_menu.o: normal/menu.c
--      $(BUILD_CC) -Inormal -I$(srcdir)/normal $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
-+      $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
- grub_emu-normal_menu.d: normal/menu.c
--      set -e;           $(BUILD_CC) -Inormal -I$(srcdir)/normal $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,menu\.o[ :]*,grub_emu-normal_menu.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<          | sed 's,menu\.o[ :]*,grub_emu-normal_menu.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
- -include grub_emu-normal_menu.d
- grub_emu-normal_menu_entry.o: normal/menu_entry.c
--      $(BUILD_CC) -Inormal -I$(srcdir)/normal $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
-+      $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
- grub_emu-normal_menu_entry.d: normal/menu_entry.c
--      set -e;           $(BUILD_CC) -Inormal -I$(srcdir)/normal $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,menu_entry\.o[ :]*,grub_emu-normal_menu_entry.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<          | sed 's,menu_entry\.o[ :]*,grub_emu-normal_menu_entry.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
- -include grub_emu-normal_menu_entry.d
- grub_emu-normal_misc.o: normal/misc.c
--      $(BUILD_CC) -Inormal -I$(srcdir)/normal $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
-+      $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
- grub_emu-normal_misc.d: normal/misc.c
--      set -e;           $(BUILD_CC) -Inormal -I$(srcdir)/normal $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,misc\.o[ :]*,grub_emu-normal_misc.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<          | sed 's,misc\.o[ :]*,grub_emu-normal_misc.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
- -include grub_emu-normal_misc.d
- grub_emu-normal_script.o: normal/script.c
--      $(BUILD_CC) -Inormal -I$(srcdir)/normal $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
-+      $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
- grub_emu-normal_script.d: normal/script.c
--      set -e;           $(BUILD_CC) -Inormal -I$(srcdir)/normal $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,script\.o[ :]*,grub_emu-normal_script.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<          | sed 's,script\.o[ :]*,grub_emu-normal_script.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
- -include grub_emu-normal_script.d
- grub_emu-partmap_amiga.o: partmap/amiga.c
--      $(BUILD_CC) -Ipartmap -I$(srcdir)/partmap $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
-+      $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
- grub_emu-partmap_amiga.d: partmap/amiga.c
--      set -e;           $(BUILD_CC) -Ipartmap -I$(srcdir)/partmap $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,amiga\.o[ :]*,grub_emu-partmap_amiga.o $@ : ,g' > $@;          [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,amiga\.o[ :]*,grub_emu-partmap_amiga.o $@ : ,g' > $@;          [ -s $@ ] || rm -f $@
- -include grub_emu-partmap_amiga.d
- grub_emu-partmap_apple.o: partmap/apple.c
--      $(BUILD_CC) -Ipartmap -I$(srcdir)/partmap $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
-+      $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
- grub_emu-partmap_apple.d: partmap/apple.c
--      set -e;           $(BUILD_CC) -Ipartmap -I$(srcdir)/partmap $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,apple\.o[ :]*,grub_emu-partmap_apple.o $@ : ,g' > $@;          [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,apple\.o[ :]*,grub_emu-partmap_apple.o $@ : ,g' > $@;          [ -s $@ ] || rm -f $@
- -include grub_emu-partmap_apple.d
- grub_emu-partmap_pc.o: partmap/pc.c
--      $(BUILD_CC) -Ipartmap -I$(srcdir)/partmap $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
-+      $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
- grub_emu-partmap_pc.d: partmap/pc.c
--      set -e;           $(BUILD_CC) -Ipartmap -I$(srcdir)/partmap $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,pc\.o[ :]*,grub_emu-partmap_pc.o $@ : ,g' > $@;        [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,pc\.o[ :]*,grub_emu-partmap_pc.o $@ : ,g' > $@;        [ -s $@ ] || rm -f $@
- -include grub_emu-partmap_pc.d
- grub_emu-partmap_sun.o: partmap/sun.c
--      $(BUILD_CC) -Ipartmap -I$(srcdir)/partmap $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
-+      $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
- grub_emu-partmap_sun.d: partmap/sun.c
--      set -e;           $(BUILD_CC) -Ipartmap -I$(srcdir)/partmap $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,sun\.o[ :]*,grub_emu-partmap_sun.o $@ : ,g' > $@;      [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,sun\.o[ :]*,grub_emu-partmap_sun.o $@ : ,g' > $@;      [ -s $@ ] || rm -f $@
- -include grub_emu-partmap_sun.d
- grub_emu-partmap_acorn.o: partmap/acorn.c
--      $(BUILD_CC) -Ipartmap -I$(srcdir)/partmap $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
-+      $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
- grub_emu-partmap_acorn.d: partmap/acorn.c
--      set -e;           $(BUILD_CC) -Ipartmap -I$(srcdir)/partmap $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,acorn\.o[ :]*,grub_emu-partmap_acorn.o $@ : ,g' > $@;          [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,acorn\.o[ :]*,grub_emu-partmap_acorn.o $@ : ,g' > $@;          [ -s $@ ] || rm -f $@
- -include grub_emu-partmap_acorn.d
- grub_emu-partmap_gpt.o: partmap/gpt.c
--      $(BUILD_CC) -Ipartmap -I$(srcdir)/partmap $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
-+      $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
- grub_emu-partmap_gpt.d: partmap/gpt.c
--      set -e;           $(BUILD_CC) -Ipartmap -I$(srcdir)/partmap $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,gpt\.o[ :]*,grub_emu-partmap_gpt.o $@ : ,g' > $@;      [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,gpt\.o[ :]*,grub_emu-partmap_gpt.o $@ : ,g' > $@;      [ -s $@ ] || rm -f $@
- -include grub_emu-partmap_gpt.d
- grub_emu-util_console.o: util/console.c
--      $(BUILD_CC) -Iutil -I$(srcdir)/util $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
-+      $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
- grub_emu-util_console.d: util/console.c
--      set -e;           $(BUILD_CC) -Iutil -I$(srcdir)/util $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,console\.o[ :]*,grub_emu-util_console.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,console\.o[ :]*,grub_emu-util_console.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
- -include grub_emu-util_console.d
- grub_emu-util_grub_emu.o: util/grub-emu.c
--      $(BUILD_CC) -Iutil -I$(srcdir)/util $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
-+      $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
- grub_emu-util_grub_emu.d: util/grub-emu.c
--      set -e;           $(BUILD_CC) -Iutil -I$(srcdir)/util $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,grub\-emu\.o[ :]*,grub_emu-util_grub_emu.o $@ : ,g' > $@;      [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,grub\-emu\.o[ :]*,grub_emu-util_grub_emu.o $@ : ,g' > $@;      [ -s $@ ] || rm -f $@
- -include grub_emu-util_grub_emu.d
- grub_emu-util_misc.o: util/misc.c
--      $(BUILD_CC) -Iutil -I$(srcdir)/util $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
-+      $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
- grub_emu-util_misc.d: util/misc.c
--      set -e;           $(BUILD_CC) -Iutil -I$(srcdir)/util $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,misc\.o[ :]*,grub_emu-util_misc.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,misc\.o[ :]*,grub_emu-util_misc.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
- -include grub_emu-util_misc.d
- grub_emu-util_i386_pc_biosdisk.o: util/i386/pc/biosdisk.c
--      $(BUILD_CC) -Iutil/i386/pc -I$(srcdir)/util/i386/pc $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
-+      $(CC) -Iutil/i386/pc -I$(srcdir)/util/i386/pc $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
- grub_emu-util_i386_pc_biosdisk.d: util/i386/pc/biosdisk.c
--      set -e;           $(BUILD_CC) -Iutil/i386/pc -I$(srcdir)/util/i386/pc $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,biosdisk\.o[ :]*,grub_emu-util_i386_pc_biosdisk.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Iutil/i386/pc -I$(srcdir)/util/i386/pc $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,biosdisk\.o[ :]*,grub_emu-util_i386_pc_biosdisk.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
- -include grub_emu-util_i386_pc_biosdisk.d
- grub_emu-util_i386_pc_getroot.o: util/i386/pc/getroot.c
--      $(BUILD_CC) -Iutil/i386/pc -I$(srcdir)/util/i386/pc $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
-+      $(CC) -Iutil/i386/pc -I$(srcdir)/util/i386/pc $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
- grub_emu-util_i386_pc_getroot.d: util/i386/pc/getroot.c
--      set -e;           $(BUILD_CC) -Iutil/i386/pc -I$(srcdir)/util/i386/pc $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,getroot\.o[ :]*,grub_emu-util_i386_pc_getroot.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Iutil/i386/pc -I$(srcdir)/util/i386/pc $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,getroot\.o[ :]*,grub_emu-util_i386_pc_getroot.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
- -include grub_emu-util_i386_pc_getroot.d
- grub_emu-util_i386_pc_misc.o: util/i386/pc/misc.c
--      $(BUILD_CC) -Iutil/i386/pc -I$(srcdir)/util/i386/pc $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
-+      $(CC) -Iutil/i386/pc -I$(srcdir)/util/i386/pc $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
- grub_emu-util_i386_pc_misc.d: util/i386/pc/misc.c
--      set -e;           $(BUILD_CC) -Iutil/i386/pc -I$(srcdir)/util/i386/pc $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,misc\.o[ :]*,grub_emu-util_i386_pc_misc.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Iutil/i386/pc -I$(srcdir)/util/i386/pc $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,misc\.o[ :]*,grub_emu-util_i386_pc_misc.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
- -include grub_emu-util_i386_pc_misc.d
- grub_emu-grub_emu_init.o: grub_emu_init.c
--      $(BUILD_CC) -I. -I$(srcdir)/. $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
-+      $(CC) -I. -I$(srcdir)/. $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
- grub_emu-grub_emu_init.d: grub_emu_init.c
--      set -e;           $(BUILD_CC) -I. -I$(srcdir)/. $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<          | sed 's,grub_emu_init\.o[ :]*,grub_emu-grub_emu_init.o $@ : ,g' > $@;          [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -I. -I$(srcdir)/. $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,grub_emu_init\.o[ :]*,grub_emu-grub_emu_init.o $@ : ,g' > $@;          [ -s $@ ] || rm -f $@
- -include grub_emu-grub_emu_init.d
- grub_emu_LDFLAGS = $(LIBCURSES)
--# For genmoddep.
--genmoddep_SOURCES = util/genmoddep.c
--CLEANFILES += genmoddep genmoddep-util_genmoddep.o
--MOSTLYCLEANFILES += genmoddep-util_genmoddep.d
--
--genmoddep: genmoddep-util_genmoddep.o
--      $(BUILD_CC) -o $@ $^ $(BUILD_LDFLAGS) $(genmoddep_LDFLAGS)
--
--genmoddep-util_genmoddep.o: util/genmoddep.c
--      $(BUILD_CC) -Iutil -I$(srcdir)/util $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(genmoddep_CFLAGS) -c -o $@ $<
--
--genmoddep-util_genmoddep.d: util/genmoddep.c
--      set -e;           $(BUILD_CC) -Iutil -I$(srcdir)/util $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(genmoddep_CFLAGS) -M $<           | sed 's,genmoddep\.o[ :]*,genmoddep-util_genmoddep.o $@ : ,g' > $@;    [ -s $@ ] || rm -f $@
--
---include genmoddep-util_genmoddep.d
--
--
- # Scripts.
- sbin_SCRIPTS = grub-install
-@@ -1367,44 +1333,50 @@
- # Modules.
--pkgdata_MODULES = _chain.mod _linux.mod linux.mod normal.mod vga.mod  \
-+pkgdata_MODULES = _chain.mod _linux.mod linux.mod normal.mod \
-       _multiboot.mod chain.mod multiboot.mod reboot.mod halt.mod      \
--      vbe.mod vesafb.mod vbetest.mod vbeinfo.mod play.mod
-+      vbe.mod vbetest.mod vbeinfo.mod video.mod gfxterm.mod \
-+      videotest.mod play.mod
- # For _chain.mod.
- _chain_mod_SOURCES = loader/i386/pc/chainloader.c
--CLEANFILES += _chain.mod mod-_chain.o mod-_chain.c pre-_chain.o _chain_mod-loader_i386_pc_chainloader.o def-_chain.lst und-_chain.lst
--MOSTLYCLEANFILES += _chain_mod-loader_i386_pc_chainloader.d
-+CLEANFILES += _chain.mod mod-_chain.o mod-_chain.c pre-_chain.o _chain_mod-loader_i386_pc_chainloader.o und-_chain.lst
-+ifneq ($(_chain_mod_EXPORTS),no)
-+CLEANFILES += def-_chain.lst
- DEFSYMFILES += def-_chain.lst
-+endif
-+MOSTLYCLEANFILES += _chain_mod-loader_i386_pc_chainloader.d
- UNDSYMFILES += und-_chain.lst
- _chain.mod: pre-_chain.o mod-_chain.o
-       -rm -f $@
--      $(LD) $(_chain_mod_LDFLAGS) $(LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(_chain_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
-       $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
- pre-_chain.o: _chain_mod-loader_i386_pc_chainloader.o
-       -rm -f $@
--      $(LD) $(_chain_mod_LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(_chain_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
- mod-_chain.o: mod-_chain.c
--      $(CC) $(CPPFLAGS) $(CFLAGS) $(_chain_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_chain_mod_CFLAGS) -c -o $@ $<
- mod-_chain.c: moddep.lst genmodsrc.sh
-       sh $(srcdir)/genmodsrc.sh '_chain' $< > $@ || (rm -f $@; exit 1)
-+ifneq ($(_chain_mod_EXPORTS),no)
- def-_chain.lst: pre-_chain.o
-       $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 _chain/' > $@
-+endif
- und-_chain.lst: pre-_chain.o
-       echo '_chain' > $@
-       $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
- _chain_mod-loader_i386_pc_chainloader.o: loader/i386/pc/chainloader.c
--      $(CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(CPPFLAGS) $(CFLAGS) $(_chain_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_chain_mod_CFLAGS) -c -o $@ $<
- _chain_mod-loader_i386_pc_chainloader.d: loader/i386/pc/chainloader.c
--      set -e;           $(CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(CPPFLAGS) $(CFLAGS) $(_chain_mod_CFLAGS) -M $<      | sed 's,chainloader\.o[ :]*,_chain_mod-loader_i386_pc_chainloader.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_chain_mod_CFLAGS) -M $<         | sed 's,chainloader\.o[ :]*,_chain_mod-loader_i386_pc_chainloader.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
- -include _chain_mod-loader_i386_pc_chainloader.d
-@@ -1413,10 +1385,10 @@
- FSFILES += fs-_chain_mod-loader_i386_pc_chainloader.lst
- cmd-_chain_mod-loader_i386_pc_chainloader.lst: loader/i386/pc/chainloader.c gencmdlist.sh
--      set -e;           $(CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(CPPFLAGS) $(CFLAGS) $(_chain_mod_CFLAGS) -E $<      | sh $(srcdir)/gencmdlist.sh _chain > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_chain_mod_CFLAGS) -E $<         | sh $(srcdir)/gencmdlist.sh _chain > $@ || (rm -f $@; exit 1)
- fs-_chain_mod-loader_i386_pc_chainloader.lst: loader/i386/pc/chainloader.c genfslist.sh
--      set -e;           $(CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(CPPFLAGS) $(CFLAGS) $(_chain_mod_CFLAGS) -E $<      | sh $(srcdir)/genfslist.sh _chain > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_chain_mod_CFLAGS) -E $<         | sh $(srcdir)/genfslist.sh _chain > $@ || (rm -f $@; exit 1)
- _chain_mod_CFLAGS = $(COMMON_CFLAGS)
-@@ -1424,38 +1396,43 @@
- # For chain.mod.
- chain_mod_SOURCES = loader/i386/pc/chainloader_normal.c
--CLEANFILES += chain.mod mod-chain.o mod-chain.c pre-chain.o chain_mod-loader_i386_pc_chainloader_normal.o def-chain.lst und-chain.lst
--MOSTLYCLEANFILES += chain_mod-loader_i386_pc_chainloader_normal.d
-+CLEANFILES += chain.mod mod-chain.o mod-chain.c pre-chain.o chain_mod-loader_i386_pc_chainloader_normal.o und-chain.lst
-+ifneq ($(chain_mod_EXPORTS),no)
-+CLEANFILES += def-chain.lst
- DEFSYMFILES += def-chain.lst
-+endif
-+MOSTLYCLEANFILES += chain_mod-loader_i386_pc_chainloader_normal.d
- UNDSYMFILES += und-chain.lst
- chain.mod: pre-chain.o mod-chain.o
-       -rm -f $@
--      $(LD) $(chain_mod_LDFLAGS) $(LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(chain_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
-       $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
- pre-chain.o: chain_mod-loader_i386_pc_chainloader_normal.o
-       -rm -f $@
--      $(LD) $(chain_mod_LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(chain_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
- mod-chain.o: mod-chain.c
--      $(CC) $(CPPFLAGS) $(CFLAGS) $(chain_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(chain_mod_CFLAGS) -c -o $@ $<
- mod-chain.c: moddep.lst genmodsrc.sh
-       sh $(srcdir)/genmodsrc.sh 'chain' $< > $@ || (rm -f $@; exit 1)
-+ifneq ($(chain_mod_EXPORTS),no)
- def-chain.lst: pre-chain.o
-       $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 chain/' > $@
-+endif
- und-chain.lst: pre-chain.o
-       echo 'chain' > $@
-       $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
- chain_mod-loader_i386_pc_chainloader_normal.o: loader/i386/pc/chainloader_normal.c
--      $(CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(CPPFLAGS) $(CFLAGS) $(chain_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(chain_mod_CFLAGS) -c -o $@ $<
- chain_mod-loader_i386_pc_chainloader_normal.d: loader/i386/pc/chainloader_normal.c
--      set -e;           $(CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(CPPFLAGS) $(CFLAGS) $(chain_mod_CFLAGS) -M $<       | sed 's,chainloader_normal\.o[ :]*,chain_mod-loader_i386_pc_chainloader_normal.o $@ : ,g' > $@;        [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(chain_mod_CFLAGS) -M $<          | sed 's,chainloader_normal\.o[ :]*,chain_mod-loader_i386_pc_chainloader_normal.o $@ : ,g' > $@;        [ -s $@ ] || rm -f $@
- -include chain_mod-loader_i386_pc_chainloader_normal.d
-@@ -1464,10 +1441,10 @@
- FSFILES += fs-chain_mod-loader_i386_pc_chainloader_normal.lst
- cmd-chain_mod-loader_i386_pc_chainloader_normal.lst: loader/i386/pc/chainloader_normal.c gencmdlist.sh
--      set -e;           $(CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(CPPFLAGS) $(CFLAGS) $(chain_mod_CFLAGS) -E $<       | sh $(srcdir)/gencmdlist.sh chain > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(chain_mod_CFLAGS) -E $<          | sh $(srcdir)/gencmdlist.sh chain > $@ || (rm -f $@; exit 1)
- fs-chain_mod-loader_i386_pc_chainloader_normal.lst: loader/i386/pc/chainloader_normal.c genfslist.sh
--      set -e;           $(CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(CPPFLAGS) $(CFLAGS) $(chain_mod_CFLAGS) -E $<       | sh $(srcdir)/genfslist.sh chain > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(chain_mod_CFLAGS) -E $<          | sh $(srcdir)/genfslist.sh chain > $@ || (rm -f $@; exit 1)
- chain_mod_CFLAGS = $(COMMON_CFLAGS)
-@@ -1475,38 +1452,43 @@
- # For _linux.mod.
- _linux_mod_SOURCES = loader/i386/pc/linux.c
--CLEANFILES += _linux.mod mod-_linux.o mod-_linux.c pre-_linux.o _linux_mod-loader_i386_pc_linux.o def-_linux.lst und-_linux.lst
--MOSTLYCLEANFILES += _linux_mod-loader_i386_pc_linux.d
-+CLEANFILES += _linux.mod mod-_linux.o mod-_linux.c pre-_linux.o _linux_mod-loader_i386_pc_linux.o und-_linux.lst
-+ifneq ($(_linux_mod_EXPORTS),no)
-+CLEANFILES += def-_linux.lst
- DEFSYMFILES += def-_linux.lst
-+endif
-+MOSTLYCLEANFILES += _linux_mod-loader_i386_pc_linux.d
- UNDSYMFILES += und-_linux.lst
- _linux.mod: pre-_linux.o mod-_linux.o
-       -rm -f $@
--      $(LD) $(_linux_mod_LDFLAGS) $(LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(_linux_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
-       $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
- pre-_linux.o: _linux_mod-loader_i386_pc_linux.o
-       -rm -f $@
--      $(LD) $(_linux_mod_LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(_linux_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
- mod-_linux.o: mod-_linux.c
--      $(CC) $(CPPFLAGS) $(CFLAGS) $(_linux_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_linux_mod_CFLAGS) -c -o $@ $<
- mod-_linux.c: moddep.lst genmodsrc.sh
-       sh $(srcdir)/genmodsrc.sh '_linux' $< > $@ || (rm -f $@; exit 1)
-+ifneq ($(_linux_mod_EXPORTS),no)
- def-_linux.lst: pre-_linux.o
-       $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 _linux/' > $@
-+endif
- und-_linux.lst: pre-_linux.o
-       echo '_linux' > $@
-       $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
- _linux_mod-loader_i386_pc_linux.o: loader/i386/pc/linux.c
--      $(CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(CPPFLAGS) $(CFLAGS) $(_linux_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_linux_mod_CFLAGS) -c -o $@ $<
- _linux_mod-loader_i386_pc_linux.d: loader/i386/pc/linux.c
--      set -e;           $(CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(CPPFLAGS) $(CFLAGS) $(_linux_mod_CFLAGS) -M $<      | sed 's,linux\.o[ :]*,_linux_mod-loader_i386_pc_linux.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_linux_mod_CFLAGS) -M $<         | sed 's,linux\.o[ :]*,_linux_mod-loader_i386_pc_linux.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
- -include _linux_mod-loader_i386_pc_linux.d
-@@ -1515,10 +1497,10 @@
- FSFILES += fs-_linux_mod-loader_i386_pc_linux.lst
- cmd-_linux_mod-loader_i386_pc_linux.lst: loader/i386/pc/linux.c gencmdlist.sh
--      set -e;           $(CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(CPPFLAGS) $(CFLAGS) $(_linux_mod_CFLAGS) -E $<      | sh $(srcdir)/gencmdlist.sh _linux > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_linux_mod_CFLAGS) -E $<         | sh $(srcdir)/gencmdlist.sh _linux > $@ || (rm -f $@; exit 1)
- fs-_linux_mod-loader_i386_pc_linux.lst: loader/i386/pc/linux.c genfslist.sh
--      set -e;           $(CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(CPPFLAGS) $(CFLAGS) $(_linux_mod_CFLAGS) -E $<      | sh $(srcdir)/genfslist.sh _linux > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_linux_mod_CFLAGS) -E $<         | sh $(srcdir)/genfslist.sh _linux > $@ || (rm -f $@; exit 1)
- _linux_mod_CFLAGS = $(COMMON_CFLAGS)
-@@ -1526,38 +1508,43 @@
- # For linux.mod.
- linux_mod_SOURCES = loader/i386/pc/linux_normal.c
--CLEANFILES += linux.mod mod-linux.o mod-linux.c pre-linux.o linux_mod-loader_i386_pc_linux_normal.o def-linux.lst und-linux.lst
--MOSTLYCLEANFILES += linux_mod-loader_i386_pc_linux_normal.d
-+CLEANFILES += linux.mod mod-linux.o mod-linux.c pre-linux.o linux_mod-loader_i386_pc_linux_normal.o und-linux.lst
-+ifneq ($(linux_mod_EXPORTS),no)
-+CLEANFILES += def-linux.lst
- DEFSYMFILES += def-linux.lst
-+endif
-+MOSTLYCLEANFILES += linux_mod-loader_i386_pc_linux_normal.d
- UNDSYMFILES += und-linux.lst
- linux.mod: pre-linux.o mod-linux.o
-       -rm -f $@
--      $(LD) $(linux_mod_LDFLAGS) $(LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(linux_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
-       $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
- pre-linux.o: linux_mod-loader_i386_pc_linux_normal.o
-       -rm -f $@
--      $(LD) $(linux_mod_LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(linux_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
- mod-linux.o: mod-linux.c
--      $(CC) $(CPPFLAGS) $(CFLAGS) $(linux_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -c -o $@ $<
- mod-linux.c: moddep.lst genmodsrc.sh
-       sh $(srcdir)/genmodsrc.sh 'linux' $< > $@ || (rm -f $@; exit 1)
-+ifneq ($(linux_mod_EXPORTS),no)
- def-linux.lst: pre-linux.o
-       $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 linux/' > $@
-+endif
- und-linux.lst: pre-linux.o
-       echo 'linux' > $@
-       $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
- linux_mod-loader_i386_pc_linux_normal.o: loader/i386/pc/linux_normal.c
--      $(CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(CPPFLAGS) $(CFLAGS) $(linux_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -c -o $@ $<
- linux_mod-loader_i386_pc_linux_normal.d: loader/i386/pc/linux_normal.c
--      set -e;           $(CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(CPPFLAGS) $(CFLAGS) $(linux_mod_CFLAGS) -M $<       | sed 's,linux_normal\.o[ :]*,linux_mod-loader_i386_pc_linux_normal.o $@ : ,g' > $@;    [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -M $<          | sed 's,linux_normal\.o[ :]*,linux_mod-loader_i386_pc_linux_normal.o $@ : ,g' > $@;    [ -s $@ ] || rm -f $@
- -include linux_mod-loader_i386_pc_linux_normal.d
-@@ -1566,10 +1553,10 @@
- FSFILES += fs-linux_mod-loader_i386_pc_linux_normal.lst
- cmd-linux_mod-loader_i386_pc_linux_normal.lst: loader/i386/pc/linux_normal.c gencmdlist.sh
--      set -e;           $(CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(CPPFLAGS) $(CFLAGS) $(linux_mod_CFLAGS) -E $<       | sh $(srcdir)/gencmdlist.sh linux > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $<          | sh $(srcdir)/gencmdlist.sh linux > $@ || (rm -f $@; exit 1)
- fs-linux_mod-loader_i386_pc_linux_normal.lst: loader/i386/pc/linux_normal.c genfslist.sh
--      set -e;           $(CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(CPPFLAGS) $(CFLAGS) $(linux_mod_CFLAGS) -E $<       | sh $(srcdir)/genfslist.sh linux > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $<          | sh $(srcdir)/genfslist.sh linux > $@ || (rm -f $@; exit 1)
- linux_mod_CFLAGS = $(COMMON_CFLAGS)
-@@ -1577,42 +1564,47 @@
- # For normal.mod.
- normal_mod_SOURCES = normal/arg.c normal/cmdline.c normal/command.c   \
--      normal/completion.c normal/context.c normal/execute.c           \
-+      normal/completion.c normal/execute.c                            \
-       normal/function.c normal/lexer.c normal/main.c normal/menu.c    \
-       normal/menu_entry.c normal/misc.c grub_script.tab.c             \
-       normal/script.c normal/i386/setjmp.S
--CLEANFILES += normal.mod mod-normal.o mod-normal.c pre-normal.o normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_context.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_i386_setjmp.o def-normal.lst und-normal.lst
--MOSTLYCLEANFILES += normal_mod-normal_arg.d normal_mod-normal_cmdline.d normal_mod-normal_command.d normal_mod-normal_completion.d normal_mod-normal_context.d normal_mod-normal_execute.d normal_mod-normal_function.d normal_mod-normal_lexer.d normal_mod-normal_main.d normal_mod-normal_menu.d normal_mod-normal_menu_entry.d normal_mod-normal_misc.d normal_mod-grub_script_tab.d normal_mod-normal_script.d normal_mod-normal_i386_setjmp.d
-+CLEANFILES += normal.mod mod-normal.o mod-normal.c pre-normal.o normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_i386_setjmp.o und-normal.lst
-+ifneq ($(normal_mod_EXPORTS),no)
-+CLEANFILES += def-normal.lst
- DEFSYMFILES += def-normal.lst
-+endif
-+MOSTLYCLEANFILES += normal_mod-normal_arg.d normal_mod-normal_cmdline.d normal_mod-normal_command.d normal_mod-normal_completion.d normal_mod-normal_execute.d normal_mod-normal_function.d normal_mod-normal_lexer.d normal_mod-normal_main.d normal_mod-normal_menu.d normal_mod-normal_menu_entry.d normal_mod-normal_misc.d normal_mod-grub_script_tab.d normal_mod-normal_script.d normal_mod-normal_i386_setjmp.d
- UNDSYMFILES += und-normal.lst
- normal.mod: pre-normal.o mod-normal.o
-       -rm -f $@
--      $(LD) $(normal_mod_LDFLAGS) $(LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(normal_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
-       $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
--pre-normal.o: normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_context.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_i386_setjmp.o
-+pre-normal.o: normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_i386_setjmp.o
-       -rm -f $@
--      $(LD) $(normal_mod_LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(normal_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
- mod-normal.o: mod-normal.c
--      $(CC) $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
- mod-normal.c: moddep.lst genmodsrc.sh
-       sh $(srcdir)/genmodsrc.sh 'normal' $< > $@ || (rm -f $@; exit 1)
-+ifneq ($(normal_mod_EXPORTS),no)
- def-normal.lst: pre-normal.o
-       $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 normal/' > $@
-+endif
- und-normal.lst: pre-normal.o
-       echo 'normal' > $@
-       $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
- normal_mod-normal_arg.o: normal/arg.c
--      $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
- normal_mod-normal_arg.d: normal/arg.c
--      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -M $<      | sed 's,arg\.o[ :]*,normal_mod-normal_arg.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -M $<         | sed 's,arg\.o[ :]*,normal_mod-normal_arg.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
- -include normal_mod-normal_arg.d
-@@ -1621,17 +1613,17 @@
- FSFILES += fs-normal_mod-normal_arg.lst
- cmd-normal_mod-normal_arg.lst: normal/arg.c gencmdlist.sh
--      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $<         | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
- fs-normal_mod-normal_arg.lst: normal/arg.c genfslist.sh
--      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $<         | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
- normal_mod-normal_cmdline.o: normal/cmdline.c
--      $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
- normal_mod-normal_cmdline.d: normal/cmdline.c
--      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -M $<      | sed 's,cmdline\.o[ :]*,normal_mod-normal_cmdline.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -M $<         | sed 's,cmdline\.o[ :]*,normal_mod-normal_cmdline.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
- -include normal_mod-normal_cmdline.d
-@@ -1640,17 +1632,17 @@
- FSFILES += fs-normal_mod-normal_cmdline.lst
- cmd-normal_mod-normal_cmdline.lst: normal/cmdline.c gencmdlist.sh
--      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $<         | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
- fs-normal_mod-normal_cmdline.lst: normal/cmdline.c genfslist.sh
--      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $<         | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
- normal_mod-normal_command.o: normal/command.c
--      $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
- normal_mod-normal_command.d: normal/command.c
--      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -M $<      | sed 's,command\.o[ :]*,normal_mod-normal_command.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -M $<         | sed 's,command\.o[ :]*,normal_mod-normal_command.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
- -include normal_mod-normal_command.d
-@@ -1659,17 +1651,17 @@
- FSFILES += fs-normal_mod-normal_command.lst
- cmd-normal_mod-normal_command.lst: normal/command.c gencmdlist.sh
--      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $<         | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
- fs-normal_mod-normal_command.lst: normal/command.c genfslist.sh
--      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $<         | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
- normal_mod-normal_completion.o: normal/completion.c
--      $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
- normal_mod-normal_completion.d: normal/completion.c
--      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -M $<      | sed 's,completion\.o[ :]*,normal_mod-normal_completion.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -M $<         | sed 's,completion\.o[ :]*,normal_mod-normal_completion.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
- -include normal_mod-normal_completion.d
-@@ -1678,36 +1670,17 @@
- FSFILES += fs-normal_mod-normal_completion.lst
- cmd-normal_mod-normal_completion.lst: normal/completion.c gencmdlist.sh
--      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $<         | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
- fs-normal_mod-normal_completion.lst: normal/completion.c genfslist.sh
--      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
--
--
--normal_mod-normal_context.o: normal/context.c
--      $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
--
--normal_mod-normal_context.d: normal/context.c
--      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -M $<      | sed 's,context\.o[ :]*,normal_mod-normal_context.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
--
---include normal_mod-normal_context.d
--
--CLEANFILES += cmd-normal_mod-normal_context.lst fs-normal_mod-normal_context.lst
--COMMANDFILES += cmd-normal_mod-normal_context.lst
--FSFILES += fs-normal_mod-normal_context.lst
--
--cmd-normal_mod-normal_context.lst: normal/context.c gencmdlist.sh
--      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
--
--fs-normal_mod-normal_context.lst: normal/context.c genfslist.sh
--      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $<         | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
- normal_mod-normal_execute.o: normal/execute.c
--      $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
- normal_mod-normal_execute.d: normal/execute.c
--      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -M $<      | sed 's,execute\.o[ :]*,normal_mod-normal_execute.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -M $<         | sed 's,execute\.o[ :]*,normal_mod-normal_execute.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
- -include normal_mod-normal_execute.d
-@@ -1716,17 +1689,17 @@
- FSFILES += fs-normal_mod-normal_execute.lst
- cmd-normal_mod-normal_execute.lst: normal/execute.c gencmdlist.sh
--      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $<         | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
- fs-normal_mod-normal_execute.lst: normal/execute.c genfslist.sh
--      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $<         | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
- normal_mod-normal_function.o: normal/function.c
--      $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
- normal_mod-normal_function.d: normal/function.c
--      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -M $<      | sed 's,function\.o[ :]*,normal_mod-normal_function.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -M $<         | sed 's,function\.o[ :]*,normal_mod-normal_function.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
- -include normal_mod-normal_function.d
-@@ -1735,17 +1708,17 @@
- FSFILES += fs-normal_mod-normal_function.lst
- cmd-normal_mod-normal_function.lst: normal/function.c gencmdlist.sh
--      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $<         | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
- fs-normal_mod-normal_function.lst: normal/function.c genfslist.sh
--      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $<         | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
- normal_mod-normal_lexer.o: normal/lexer.c
--      $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
- normal_mod-normal_lexer.d: normal/lexer.c
--      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -M $<      | sed 's,lexer\.o[ :]*,normal_mod-normal_lexer.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -M $<         | sed 's,lexer\.o[ :]*,normal_mod-normal_lexer.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
- -include normal_mod-normal_lexer.d
-@@ -1754,17 +1727,17 @@
- FSFILES += fs-normal_mod-normal_lexer.lst
- cmd-normal_mod-normal_lexer.lst: normal/lexer.c gencmdlist.sh
--      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $<         | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
- fs-normal_mod-normal_lexer.lst: normal/lexer.c genfslist.sh
--      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $<         | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
- normal_mod-normal_main.o: normal/main.c
--      $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
- normal_mod-normal_main.d: normal/main.c
--      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -M $<      | sed 's,main\.o[ :]*,normal_mod-normal_main.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -M $<         | sed 's,main\.o[ :]*,normal_mod-normal_main.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
- -include normal_mod-normal_main.d
-@@ -1773,17 +1746,17 @@
- FSFILES += fs-normal_mod-normal_main.lst
- cmd-normal_mod-normal_main.lst: normal/main.c gencmdlist.sh
--      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $<         | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
- fs-normal_mod-normal_main.lst: normal/main.c genfslist.sh
--      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $<         | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
- normal_mod-normal_menu.o: normal/menu.c
--      $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
- normal_mod-normal_menu.d: normal/menu.c
--      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -M $<      | sed 's,menu\.o[ :]*,normal_mod-normal_menu.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -M $<         | sed 's,menu\.o[ :]*,normal_mod-normal_menu.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
- -include normal_mod-normal_menu.d
-@@ -1792,17 +1765,17 @@
- FSFILES += fs-normal_mod-normal_menu.lst
- cmd-normal_mod-normal_menu.lst: normal/menu.c gencmdlist.sh
--      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $<         | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
- fs-normal_mod-normal_menu.lst: normal/menu.c genfslist.sh
--      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $<         | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
- normal_mod-normal_menu_entry.o: normal/menu_entry.c
--      $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
- normal_mod-normal_menu_entry.d: normal/menu_entry.c
--      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -M $<      | sed 's,menu_entry\.o[ :]*,normal_mod-normal_menu_entry.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -M $<         | sed 's,menu_entry\.o[ :]*,normal_mod-normal_menu_entry.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
- -include normal_mod-normal_menu_entry.d
-@@ -1811,17 +1784,17 @@
- FSFILES += fs-normal_mod-normal_menu_entry.lst
- cmd-normal_mod-normal_menu_entry.lst: normal/menu_entry.c gencmdlist.sh
--      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $<         | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
- fs-normal_mod-normal_menu_entry.lst: normal/menu_entry.c genfslist.sh
--      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $<         | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
- normal_mod-normal_misc.o: normal/misc.c
--      $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
- normal_mod-normal_misc.d: normal/misc.c
--      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -M $<      | sed 's,misc\.o[ :]*,normal_mod-normal_misc.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -M $<         | sed 's,misc\.o[ :]*,normal_mod-normal_misc.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
- -include normal_mod-normal_misc.d
-@@ -1830,17 +1803,17 @@
- FSFILES += fs-normal_mod-normal_misc.lst
- cmd-normal_mod-normal_misc.lst: normal/misc.c gencmdlist.sh
--      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $<         | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
- fs-normal_mod-normal_misc.lst: normal/misc.c genfslist.sh
--      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $<         | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
- normal_mod-grub_script_tab.o: grub_script.tab.c
--      $(CC) -I. -I$(srcdir)/. $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
- normal_mod-grub_script_tab.d: grub_script.tab.c
--      set -e;           $(CC) -I. -I$(srcdir)/. $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -M $<        | sed 's,grub_script\.tab\.o[ :]*,normal_mod-grub_script_tab.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -M $<           | sed 's,grub_script\.tab\.o[ :]*,normal_mod-grub_script_tab.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
- -include normal_mod-grub_script_tab.d
-@@ -1849,17 +1822,17 @@
- FSFILES += fs-normal_mod-grub_script_tab.lst
- cmd-normal_mod-grub_script_tab.lst: grub_script.tab.c gencmdlist.sh
--      set -e;           $(CC) -I. -I$(srcdir)/. $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<        | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $<           | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
- fs-normal_mod-grub_script_tab.lst: grub_script.tab.c genfslist.sh
--      set -e;           $(CC) -I. -I$(srcdir)/. $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<        | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $<           | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
- normal_mod-normal_script.o: normal/script.c
--      $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
- normal_mod-normal_script.d: normal/script.c
--      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -M $<      | sed 's,script\.o[ :]*,normal_mod-normal_script.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -M $<         | sed 's,script\.o[ :]*,normal_mod-normal_script.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
- -include normal_mod-normal_script.d
-@@ -1868,17 +1841,17 @@
- FSFILES += fs-normal_mod-normal_script.lst
- cmd-normal_mod-normal_script.lst: normal/script.c gencmdlist.sh
--      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $<         | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
- fs-normal_mod-normal_script.lst: normal/script.c genfslist.sh
--      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $<         | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
- normal_mod-normal_i386_setjmp.o: normal/i386/setjmp.S
--      $(CC) -Inormal/i386 -I$(srcdir)/normal/i386 $(CPPFLAGS) $(ASFLAGS) $(normal_mod_ASFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Inormal/i386 -I$(srcdir)/normal/i386 $(TARGET_CPPFLAGS) $(TARGET_ASFLAGS) $(normal_mod_ASFLAGS) -c -o $@ $<
- normal_mod-normal_i386_setjmp.d: normal/i386/setjmp.S
--      set -e;           $(CC) -Inormal/i386 -I$(srcdir)/normal/i386 $(CPPFLAGS) $(ASFLAGS) $(normal_mod_ASFLAGS) -M $<          | sed 's,setjmp\.o[ :]*,normal_mod-normal_i386_setjmp.o $@ : ,g' > $@;          [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Inormal/i386 -I$(srcdir)/normal/i386 $(TARGET_CPPFLAGS) $(TARGET_ASFLAGS) $(normal_mod_ASFLAGS) -M $<     | sed 's,setjmp\.o[ :]*,normal_mod-normal_i386_setjmp.o $@ : ,g' > $@;          [ -s $@ ] || rm -f $@
- -include normal_mod-normal_i386_setjmp.d
-@@ -1887,10 +1860,10 @@
- FSFILES += fs-normal_mod-normal_i386_setjmp.lst
- cmd-normal_mod-normal_i386_setjmp.lst: normal/i386/setjmp.S gencmdlist.sh
--      set -e;           $(CC) -Inormal/i386 -I$(srcdir)/normal/i386 $(CPPFLAGS) $(ASFLAGS) $(normal_mod_ASFLAGS) -E $<          | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Inormal/i386 -I$(srcdir)/normal/i386 $(TARGET_CPPFLAGS) $(TARGET_ASFLAGS) $(normal_mod_ASFLAGS) -E $<     | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
- fs-normal_mod-normal_i386_setjmp.lst: normal/i386/setjmp.S genfslist.sh
--      set -e;           $(CC) -Inormal/i386 -I$(srcdir)/normal/i386 $(CPPFLAGS) $(ASFLAGS) $(normal_mod_ASFLAGS) -E $<          | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Inormal/i386 -I$(srcdir)/normal/i386 $(TARGET_CPPFLAGS) $(TARGET_ASFLAGS) $(normal_mod_ASFLAGS) -E $<     | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
- normal_mod_CFLAGS = $(COMMON_CFLAGS)
-@@ -1899,38 +1872,43 @@
- # For reboot.mod.
- reboot_mod_SOURCES = commands/i386/pc/reboot.c
--CLEANFILES += reboot.mod mod-reboot.o mod-reboot.c pre-reboot.o reboot_mod-commands_i386_pc_reboot.o def-reboot.lst und-reboot.lst
--MOSTLYCLEANFILES += reboot_mod-commands_i386_pc_reboot.d
-+CLEANFILES += reboot.mod mod-reboot.o mod-reboot.c pre-reboot.o reboot_mod-commands_i386_pc_reboot.o und-reboot.lst
-+ifneq ($(reboot_mod_EXPORTS),no)
-+CLEANFILES += def-reboot.lst
- DEFSYMFILES += def-reboot.lst
-+endif
-+MOSTLYCLEANFILES += reboot_mod-commands_i386_pc_reboot.d
- UNDSYMFILES += und-reboot.lst
- reboot.mod: pre-reboot.o mod-reboot.o
-       -rm -f $@
--      $(LD) $(reboot_mod_LDFLAGS) $(LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(reboot_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
-       $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
- pre-reboot.o: reboot_mod-commands_i386_pc_reboot.o
-       -rm -f $@
--      $(LD) $(reboot_mod_LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(reboot_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
- mod-reboot.o: mod-reboot.c
--      $(CC) $(CPPFLAGS) $(CFLAGS) $(reboot_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -c -o $@ $<
- mod-reboot.c: moddep.lst genmodsrc.sh
-       sh $(srcdir)/genmodsrc.sh 'reboot' $< > $@ || (rm -f $@; exit 1)
-+ifneq ($(reboot_mod_EXPORTS),no)
- def-reboot.lst: pre-reboot.o
-       $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 reboot/' > $@
-+endif
- und-reboot.lst: pre-reboot.o
-       echo 'reboot' > $@
-       $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
- reboot_mod-commands_i386_pc_reboot.o: commands/i386/pc/reboot.c
--      $(CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(CPPFLAGS) $(CFLAGS) $(reboot_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -c -o $@ $<
- reboot_mod-commands_i386_pc_reboot.d: commands/i386/pc/reboot.c
--      set -e;           $(CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(CPPFLAGS) $(CFLAGS) $(reboot_mod_CFLAGS) -M $<          | sed 's,reboot\.o[ :]*,reboot_mod-commands_i386_pc_reboot.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -M $<     | sed 's,reboot\.o[ :]*,reboot_mod-commands_i386_pc_reboot.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
- -include reboot_mod-commands_i386_pc_reboot.d
-@@ -1939,10 +1917,10 @@
- FSFILES += fs-reboot_mod-commands_i386_pc_reboot.lst
- cmd-reboot_mod-commands_i386_pc_reboot.lst: commands/i386/pc/reboot.c gencmdlist.sh
--      set -e;           $(CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(CPPFLAGS) $(CFLAGS) $(reboot_mod_CFLAGS) -E $<          | sh $(srcdir)/gencmdlist.sh reboot > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -E $<     | sh $(srcdir)/gencmdlist.sh reboot > $@ || (rm -f $@; exit 1)
- fs-reboot_mod-commands_i386_pc_reboot.lst: commands/i386/pc/reboot.c genfslist.sh
--      set -e;           $(CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(CPPFLAGS) $(CFLAGS) $(reboot_mod_CFLAGS) -E $<          | sh $(srcdir)/genfslist.sh reboot > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -E $<     | sh $(srcdir)/genfslist.sh reboot > $@ || (rm -f $@; exit 1)
- reboot_mod_CFLAGS = $(COMMON_CFLAGS)
-@@ -1950,38 +1928,43 @@
- # For halt.mod.
- halt_mod_SOURCES = commands/i386/pc/halt.c
--CLEANFILES += halt.mod mod-halt.o mod-halt.c pre-halt.o halt_mod-commands_i386_pc_halt.o def-halt.lst und-halt.lst
--MOSTLYCLEANFILES += halt_mod-commands_i386_pc_halt.d
-+CLEANFILES += halt.mod mod-halt.o mod-halt.c pre-halt.o halt_mod-commands_i386_pc_halt.o und-halt.lst
-+ifneq ($(halt_mod_EXPORTS),no)
-+CLEANFILES += def-halt.lst
- DEFSYMFILES += def-halt.lst
-+endif
-+MOSTLYCLEANFILES += halt_mod-commands_i386_pc_halt.d
- UNDSYMFILES += und-halt.lst
- halt.mod: pre-halt.o mod-halt.o
-       -rm -f $@
--      $(LD) $(halt_mod_LDFLAGS) $(LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(halt_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
-       $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
- pre-halt.o: halt_mod-commands_i386_pc_halt.o
-       -rm -f $@
--      $(LD) $(halt_mod_LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(halt_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
- mod-halt.o: mod-halt.c
--      $(CC) $(CPPFLAGS) $(CFLAGS) $(halt_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -c -o $@ $<
- mod-halt.c: moddep.lst genmodsrc.sh
-       sh $(srcdir)/genmodsrc.sh 'halt' $< > $@ || (rm -f $@; exit 1)
-+ifneq ($(halt_mod_EXPORTS),no)
- def-halt.lst: pre-halt.o
-       $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 halt/' > $@
-+endif
- und-halt.lst: pre-halt.o
-       echo 'halt' > $@
-       $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
- halt_mod-commands_i386_pc_halt.o: commands/i386/pc/halt.c
--      $(CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(CPPFLAGS) $(CFLAGS) $(halt_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -c -o $@ $<
- halt_mod-commands_i386_pc_halt.d: commands/i386/pc/halt.c
--      set -e;           $(CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(CPPFLAGS) $(CFLAGS) $(halt_mod_CFLAGS) -M $<    | sed 's,halt\.o[ :]*,halt_mod-commands_i386_pc_halt.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -M $<       | sed 's,halt\.o[ :]*,halt_mod-commands_i386_pc_halt.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
- -include halt_mod-commands_i386_pc_halt.d
-@@ -1990,66 +1973,15 @@
- FSFILES += fs-halt_mod-commands_i386_pc_halt.lst
- cmd-halt_mod-commands_i386_pc_halt.lst: commands/i386/pc/halt.c gencmdlist.sh
--      set -e;           $(CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(CPPFLAGS) $(CFLAGS) $(halt_mod_CFLAGS) -E $<    | sh $(srcdir)/gencmdlist.sh halt > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -E $<       | sh $(srcdir)/gencmdlist.sh halt > $@ || (rm -f $@; exit 1)
- fs-halt_mod-commands_i386_pc_halt.lst: commands/i386/pc/halt.c genfslist.sh
--      set -e;           $(CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(CPPFLAGS) $(CFLAGS) $(halt_mod_CFLAGS) -E $<    | sh $(srcdir)/genfslist.sh halt > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -E $<       | sh $(srcdir)/genfslist.sh halt > $@ || (rm -f $@; exit 1)
- halt_mod_CFLAGS = $(COMMON_CFLAGS)
- halt_mod_LDFLAGS = $(COMMON_LDFLAGS)
--# For vga.mod.
--vga_mod_SOURCES = term/i386/pc/vga.c
--CLEANFILES += vga.mod mod-vga.o mod-vga.c pre-vga.o vga_mod-term_i386_pc_vga.o def-vga.lst und-vga.lst
--MOSTLYCLEANFILES += vga_mod-term_i386_pc_vga.d
--DEFSYMFILES += def-vga.lst
--UNDSYMFILES += und-vga.lst
--
--vga.mod: pre-vga.o mod-vga.o
--      -rm -f $@
--      $(LD) $(vga_mod_LDFLAGS) $(LDFLAGS) -r -d -o $@ $^
--      $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
--
--pre-vga.o: vga_mod-term_i386_pc_vga.o
--      -rm -f $@
--      $(LD) $(vga_mod_LDFLAGS) -r -d -o $@ $^
--
--mod-vga.o: mod-vga.c
--      $(CC) $(CPPFLAGS) $(CFLAGS) $(vga_mod_CFLAGS) -c -o $@ $<
--
--mod-vga.c: moddep.lst genmodsrc.sh
--      sh $(srcdir)/genmodsrc.sh 'vga' $< > $@ || (rm -f $@; exit 1)
--
--def-vga.lst: pre-vga.o
--      $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 vga/' > $@
--
--und-vga.lst: pre-vga.o
--      echo 'vga' > $@
--      $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
--
--vga_mod-term_i386_pc_vga.o: term/i386/pc/vga.c
--      $(CC) -Iterm/i386/pc -I$(srcdir)/term/i386/pc $(CPPFLAGS) $(CFLAGS) $(vga_mod_CFLAGS) -c -o $@ $<
--
--vga_mod-term_i386_pc_vga.d: term/i386/pc/vga.c
--      set -e;           $(CC) -Iterm/i386/pc -I$(srcdir)/term/i386/pc $(CPPFLAGS) $(CFLAGS) $(vga_mod_CFLAGS) -M $<     | sed 's,vga\.o[ :]*,vga_mod-term_i386_pc_vga.o $@ : ,g' > $@;          [ -s $@ ] || rm -f $@
--
---include vga_mod-term_i386_pc_vga.d
--
--CLEANFILES += cmd-vga_mod-term_i386_pc_vga.lst fs-vga_mod-term_i386_pc_vga.lst
--COMMANDFILES += cmd-vga_mod-term_i386_pc_vga.lst
--FSFILES += fs-vga_mod-term_i386_pc_vga.lst
--
--cmd-vga_mod-term_i386_pc_vga.lst: term/i386/pc/vga.c gencmdlist.sh
--      set -e;           $(CC) -Iterm/i386/pc -I$(srcdir)/term/i386/pc $(CPPFLAGS) $(CFLAGS) $(vga_mod_CFLAGS) -E $<     | sh $(srcdir)/gencmdlist.sh vga > $@ || (rm -f $@; exit 1)
--
--fs-vga_mod-term_i386_pc_vga.lst: term/i386/pc/vga.c genfslist.sh
--      set -e;           $(CC) -Iterm/i386/pc -I$(srcdir)/term/i386/pc $(CPPFLAGS) $(CFLAGS) $(vga_mod_CFLAGS) -E $<     | sh $(srcdir)/genfslist.sh vga > $@ || (rm -f $@; exit 1)
--
--
--vga_mod_CFLAGS = $(COMMON_CFLAGS)
--vga_mod_LDFLAGS = $(COMMON_LDFLAGS)
--
- # For serial.mod.
- serial_mod_SOURCES = term/i386/pc/serial.c
- serial_mod_CFLAGS = $(COMMON_CFLAGS)
-@@ -2057,38 +1989,43 @@
- # For _multiboot.mod.
- _multiboot_mod_SOURCES = loader/i386/pc/multiboot.c
--CLEANFILES += _multiboot.mod mod-_multiboot.o mod-_multiboot.c pre-_multiboot.o _multiboot_mod-loader_i386_pc_multiboot.o def-_multiboot.lst und-_multiboot.lst
--MOSTLYCLEANFILES += _multiboot_mod-loader_i386_pc_multiboot.d
-+CLEANFILES += _multiboot.mod mod-_multiboot.o mod-_multiboot.c pre-_multiboot.o _multiboot_mod-loader_i386_pc_multiboot.o und-_multiboot.lst
-+ifneq ($(_multiboot_mod_EXPORTS),no)
-+CLEANFILES += def-_multiboot.lst
- DEFSYMFILES += def-_multiboot.lst
-+endif
-+MOSTLYCLEANFILES += _multiboot_mod-loader_i386_pc_multiboot.d
- UNDSYMFILES += und-_multiboot.lst
- _multiboot.mod: pre-_multiboot.o mod-_multiboot.o
-       -rm -f $@
--      $(LD) $(_multiboot_mod_LDFLAGS) $(LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(_multiboot_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
-       $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
- pre-_multiboot.o: _multiboot_mod-loader_i386_pc_multiboot.o
-       -rm -f $@
--      $(LD) $(_multiboot_mod_LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(_multiboot_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
- mod-_multiboot.o: mod-_multiboot.c
--      $(CC) $(CPPFLAGS) $(CFLAGS) $(_multiboot_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -c -o $@ $<
- mod-_multiboot.c: moddep.lst genmodsrc.sh
-       sh $(srcdir)/genmodsrc.sh '_multiboot' $< > $@ || (rm -f $@; exit 1)
-+ifneq ($(_multiboot_mod_EXPORTS),no)
- def-_multiboot.lst: pre-_multiboot.o
-       $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 _multiboot/' > $@
-+endif
- und-_multiboot.lst: pre-_multiboot.o
-       echo '_multiboot' > $@
-       $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
- _multiboot_mod-loader_i386_pc_multiboot.o: loader/i386/pc/multiboot.c
--      $(CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(CPPFLAGS) $(CFLAGS) $(_multiboot_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -c -o $@ $<
- _multiboot_mod-loader_i386_pc_multiboot.d: loader/i386/pc/multiboot.c
--      set -e;           $(CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(CPPFLAGS) $(CFLAGS) $(_multiboot_mod_CFLAGS) -M $<          | sed 's,multiboot\.o[ :]*,_multiboot_mod-loader_i386_pc_multiboot.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -M $<     | sed 's,multiboot\.o[ :]*,_multiboot_mod-loader_i386_pc_multiboot.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
- -include _multiboot_mod-loader_i386_pc_multiboot.d
-@@ -2097,10 +2034,10 @@
- FSFILES += fs-_multiboot_mod-loader_i386_pc_multiboot.lst
- cmd-_multiboot_mod-loader_i386_pc_multiboot.lst: loader/i386/pc/multiboot.c gencmdlist.sh
--      set -e;           $(CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(CPPFLAGS) $(CFLAGS) $(_multiboot_mod_CFLAGS) -E $<          | sh $(srcdir)/gencmdlist.sh _multiboot > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -E $<     | sh $(srcdir)/gencmdlist.sh _multiboot > $@ || (rm -f $@; exit 1)
- fs-_multiboot_mod-loader_i386_pc_multiboot.lst: loader/i386/pc/multiboot.c genfslist.sh
--      set -e;           $(CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(CPPFLAGS) $(CFLAGS) $(_multiboot_mod_CFLAGS) -E $<          | sh $(srcdir)/genfslist.sh _multiboot > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -E $<     | sh $(srcdir)/genfslist.sh _multiboot > $@ || (rm -f $@; exit 1)
- _multiboot_mod_CFLAGS = $(COMMON_CFLAGS)
-@@ -2108,38 +2045,43 @@
- # For multiboot.mod.
- multiboot_mod_SOURCES = loader/i386/pc/multiboot_normal.c
--CLEANFILES += multiboot.mod mod-multiboot.o mod-multiboot.c pre-multiboot.o multiboot_mod-loader_i386_pc_multiboot_normal.o def-multiboot.lst und-multiboot.lst
--MOSTLYCLEANFILES += multiboot_mod-loader_i386_pc_multiboot_normal.d
-+CLEANFILES += multiboot.mod mod-multiboot.o mod-multiboot.c pre-multiboot.o multiboot_mod-loader_i386_pc_multiboot_normal.o und-multiboot.lst
-+ifneq ($(multiboot_mod_EXPORTS),no)
-+CLEANFILES += def-multiboot.lst
- DEFSYMFILES += def-multiboot.lst
-+endif
-+MOSTLYCLEANFILES += multiboot_mod-loader_i386_pc_multiboot_normal.d
- UNDSYMFILES += und-multiboot.lst
- multiboot.mod: pre-multiboot.o mod-multiboot.o
-       -rm -f $@
--      $(LD) $(multiboot_mod_LDFLAGS) $(LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(multiboot_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
-       $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
- pre-multiboot.o: multiboot_mod-loader_i386_pc_multiboot_normal.o
-       -rm -f $@
--      $(LD) $(multiboot_mod_LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(multiboot_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
- mod-multiboot.o: mod-multiboot.c
--      $(CC) $(CPPFLAGS) $(CFLAGS) $(multiboot_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -c -o $@ $<
- mod-multiboot.c: moddep.lst genmodsrc.sh
-       sh $(srcdir)/genmodsrc.sh 'multiboot' $< > $@ || (rm -f $@; exit 1)
-+ifneq ($(multiboot_mod_EXPORTS),no)
- def-multiboot.lst: pre-multiboot.o
-       $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 multiboot/' > $@
-+endif
- und-multiboot.lst: pre-multiboot.o
-       echo 'multiboot' > $@
-       $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
- multiboot_mod-loader_i386_pc_multiboot_normal.o: loader/i386/pc/multiboot_normal.c
--      $(CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(CPPFLAGS) $(CFLAGS) $(multiboot_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -c -o $@ $<
- multiboot_mod-loader_i386_pc_multiboot_normal.d: loader/i386/pc/multiboot_normal.c
--      set -e;           $(CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(CPPFLAGS) $(CFLAGS) $(multiboot_mod_CFLAGS) -M $<           | sed 's,multiboot_normal\.o[ :]*,multiboot_mod-loader_i386_pc_multiboot_normal.o $@ : ,g' > $@;        [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -M $<      | sed 's,multiboot_normal\.o[ :]*,multiboot_mod-loader_i386_pc_multiboot_normal.o $@ : ,g' > $@;        [ -s $@ ] || rm -f $@
- -include multiboot_mod-loader_i386_pc_multiboot_normal.d
-@@ -2148,49 +2090,55 @@
- FSFILES += fs-multiboot_mod-loader_i386_pc_multiboot_normal.lst
- cmd-multiboot_mod-loader_i386_pc_multiboot_normal.lst: loader/i386/pc/multiboot_normal.c gencmdlist.sh
--      set -e;           $(CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(CPPFLAGS) $(CFLAGS) $(multiboot_mod_CFLAGS) -E $<           | sh $(srcdir)/gencmdlist.sh multiboot > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $<      | sh $(srcdir)/gencmdlist.sh multiboot > $@ || (rm -f $@; exit 1)
- fs-multiboot_mod-loader_i386_pc_multiboot_normal.lst: loader/i386/pc/multiboot_normal.c genfslist.sh
--      set -e;           $(CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(CPPFLAGS) $(CFLAGS) $(multiboot_mod_CFLAGS) -E $<           | sh $(srcdir)/genfslist.sh multiboot > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $<      | sh $(srcdir)/genfslist.sh multiboot > $@ || (rm -f $@; exit 1)
- multiboot_mod_CFLAGS = $(COMMON_CFLAGS)
- multiboot_mod_LDFLAGS = $(COMMON_LDFLAGS)
- # For vbe.mod.
--vbe_mod_SOURCES = video/i386/pc/vbe.c
--CLEANFILES += vbe.mod mod-vbe.o mod-vbe.c pre-vbe.o vbe_mod-video_i386_pc_vbe.o def-vbe.lst und-vbe.lst
--MOSTLYCLEANFILES += vbe_mod-video_i386_pc_vbe.d
-+vbe_mod_SOURCES = video/i386/pc/vbe.c video/i386/pc/vbeblit.c \
-+                video/i386/pc/vbefill.c
-+CLEANFILES += vbe.mod mod-vbe.o mod-vbe.c pre-vbe.o vbe_mod-video_i386_pc_vbe.o vbe_mod-video_i386_pc_vbeblit.o vbe_mod-video_i386_pc_vbefill.o und-vbe.lst
-+ifneq ($(vbe_mod_EXPORTS),no)
-+CLEANFILES += def-vbe.lst
- DEFSYMFILES += def-vbe.lst
-+endif
-+MOSTLYCLEANFILES += vbe_mod-video_i386_pc_vbe.d vbe_mod-video_i386_pc_vbeblit.d vbe_mod-video_i386_pc_vbefill.d
- UNDSYMFILES += und-vbe.lst
- vbe.mod: pre-vbe.o mod-vbe.o
-       -rm -f $@
--      $(LD) $(vbe_mod_LDFLAGS) $(LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(vbe_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
-       $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
--pre-vbe.o: vbe_mod-video_i386_pc_vbe.o
-+pre-vbe.o: vbe_mod-video_i386_pc_vbe.o vbe_mod-video_i386_pc_vbeblit.o vbe_mod-video_i386_pc_vbefill.o
-       -rm -f $@
--      $(LD) $(vbe_mod_LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(vbe_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
- mod-vbe.o: mod-vbe.c
--      $(CC) $(CPPFLAGS) $(CFLAGS) $(vbe_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbe_mod_CFLAGS) -c -o $@ $<
- mod-vbe.c: moddep.lst genmodsrc.sh
-       sh $(srcdir)/genmodsrc.sh 'vbe' $< > $@ || (rm -f $@; exit 1)
-+ifneq ($(vbe_mod_EXPORTS),no)
- def-vbe.lst: pre-vbe.o
-       $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 vbe/' > $@
-+endif
- und-vbe.lst: pre-vbe.o
-       echo 'vbe' > $@
-       $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
- vbe_mod-video_i386_pc_vbe.o: video/i386/pc/vbe.c
--      $(CC) -Ivideo/i386/pc -I$(srcdir)/video/i386/pc $(CPPFLAGS) $(CFLAGS) $(vbe_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Ivideo/i386/pc -I$(srcdir)/video/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbe_mod_CFLAGS) -c -o $@ $<
- vbe_mod-video_i386_pc_vbe.d: video/i386/pc/vbe.c
--      set -e;           $(CC) -Ivideo/i386/pc -I$(srcdir)/video/i386/pc $(CPPFLAGS) $(CFLAGS) $(vbe_mod_CFLAGS) -M $<           | sed 's,vbe\.o[ :]*,vbe_mod-video_i386_pc_vbe.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Ivideo/i386/pc -I$(srcdir)/video/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbe_mod_CFLAGS) -M $<      | sed 's,vbe\.o[ :]*,vbe_mod-video_i386_pc_vbe.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
- -include vbe_mod-video_i386_pc_vbe.d
-@@ -2199,100 +2147,92 @@
- FSFILES += fs-vbe_mod-video_i386_pc_vbe.lst
- cmd-vbe_mod-video_i386_pc_vbe.lst: video/i386/pc/vbe.c gencmdlist.sh
--      set -e;           $(CC) -Ivideo/i386/pc -I$(srcdir)/video/i386/pc $(CPPFLAGS) $(CFLAGS) $(vbe_mod_CFLAGS) -E $<           | sh $(srcdir)/gencmdlist.sh vbe > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Ivideo/i386/pc -I$(srcdir)/video/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbe_mod_CFLAGS) -E $<      | sh $(srcdir)/gencmdlist.sh vbe > $@ || (rm -f $@; exit 1)
- fs-vbe_mod-video_i386_pc_vbe.lst: video/i386/pc/vbe.c genfslist.sh
--      set -e;           $(CC) -Ivideo/i386/pc -I$(srcdir)/video/i386/pc $(CPPFLAGS) $(CFLAGS) $(vbe_mod_CFLAGS) -E $<           | sh $(srcdir)/genfslist.sh vbe > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Ivideo/i386/pc -I$(srcdir)/video/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbe_mod_CFLAGS) -E $<      | sh $(srcdir)/genfslist.sh vbe > $@ || (rm -f $@; exit 1)
--vbe_mod_CFLAGS = $(COMMON_CFLAGS)
--vbe_mod_LDFLAGS = $(COMMON_LDFLAGS)
-+vbe_mod-video_i386_pc_vbeblit.o: video/i386/pc/vbeblit.c
-+      $(TARGET_CC) -Ivideo/i386/pc -I$(srcdir)/video/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbe_mod_CFLAGS) -c -o $@ $<
--# For vesafb.mod.
--vesafb_mod_SOURCES = term/i386/pc/vesafb.c
--CLEANFILES += vesafb.mod mod-vesafb.o mod-vesafb.c pre-vesafb.o vesafb_mod-term_i386_pc_vesafb.o def-vesafb.lst und-vesafb.lst
--MOSTLYCLEANFILES += vesafb_mod-term_i386_pc_vesafb.d
--DEFSYMFILES += def-vesafb.lst
--UNDSYMFILES += und-vesafb.lst
-+vbe_mod-video_i386_pc_vbeblit.d: video/i386/pc/vbeblit.c
-+      set -e;           $(TARGET_CC) -Ivideo/i386/pc -I$(srcdir)/video/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbe_mod_CFLAGS) -M $<      | sed 's,vbeblit\.o[ :]*,vbe_mod-video_i386_pc_vbeblit.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
--vesafb.mod: pre-vesafb.o mod-vesafb.o
--      -rm -f $@
--      $(LD) $(vesafb_mod_LDFLAGS) $(LDFLAGS) -r -d -o $@ $^
--      $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
-+-include vbe_mod-video_i386_pc_vbeblit.d
--pre-vesafb.o: vesafb_mod-term_i386_pc_vesafb.o
--      -rm -f $@
--      $(LD) $(vesafb_mod_LDFLAGS) -r -d -o $@ $^
-+CLEANFILES += cmd-vbe_mod-video_i386_pc_vbeblit.lst fs-vbe_mod-video_i386_pc_vbeblit.lst
-+COMMANDFILES += cmd-vbe_mod-video_i386_pc_vbeblit.lst
-+FSFILES += fs-vbe_mod-video_i386_pc_vbeblit.lst
--mod-vesafb.o: mod-vesafb.c
--      $(CC) $(CPPFLAGS) $(CFLAGS) $(vesafb_mod_CFLAGS) -c -o $@ $<
-+cmd-vbe_mod-video_i386_pc_vbeblit.lst: video/i386/pc/vbeblit.c gencmdlist.sh
-+      set -e;           $(TARGET_CC) -Ivideo/i386/pc -I$(srcdir)/video/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbe_mod_CFLAGS) -E $<      | sh $(srcdir)/gencmdlist.sh vbe > $@ || (rm -f $@; exit 1)
--mod-vesafb.c: moddep.lst genmodsrc.sh
--      sh $(srcdir)/genmodsrc.sh 'vesafb' $< > $@ || (rm -f $@; exit 1)
-+fs-vbe_mod-video_i386_pc_vbeblit.lst: video/i386/pc/vbeblit.c genfslist.sh
-+      set -e;           $(TARGET_CC) -Ivideo/i386/pc -I$(srcdir)/video/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbe_mod_CFLAGS) -E $<      | sh $(srcdir)/genfslist.sh vbe > $@ || (rm -f $@; exit 1)
--def-vesafb.lst: pre-vesafb.o
--      $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 vesafb/' > $@
--und-vesafb.lst: pre-vesafb.o
--      echo 'vesafb' > $@
--      $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
-+vbe_mod-video_i386_pc_vbefill.o: video/i386/pc/vbefill.c
-+      $(TARGET_CC) -Ivideo/i386/pc -I$(srcdir)/video/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbe_mod_CFLAGS) -c -o $@ $<
--vesafb_mod-term_i386_pc_vesafb.o: term/i386/pc/vesafb.c
--      $(CC) -Iterm/i386/pc -I$(srcdir)/term/i386/pc $(CPPFLAGS) $(CFLAGS) $(vesafb_mod_CFLAGS) -c -o $@ $<
-+vbe_mod-video_i386_pc_vbefill.d: video/i386/pc/vbefill.c
-+      set -e;           $(TARGET_CC) -Ivideo/i386/pc -I$(srcdir)/video/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbe_mod_CFLAGS) -M $<      | sed 's,vbefill\.o[ :]*,vbe_mod-video_i386_pc_vbefill.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
--vesafb_mod-term_i386_pc_vesafb.d: term/i386/pc/vesafb.c
--      set -e;           $(CC) -Iterm/i386/pc -I$(srcdir)/term/i386/pc $(CPPFLAGS) $(CFLAGS) $(vesafb_mod_CFLAGS) -M $<          | sed 's,vesafb\.o[ :]*,vesafb_mod-term_i386_pc_vesafb.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
-+-include vbe_mod-video_i386_pc_vbefill.d
---include vesafb_mod-term_i386_pc_vesafb.d
-+CLEANFILES += cmd-vbe_mod-video_i386_pc_vbefill.lst fs-vbe_mod-video_i386_pc_vbefill.lst
-+COMMANDFILES += cmd-vbe_mod-video_i386_pc_vbefill.lst
-+FSFILES += fs-vbe_mod-video_i386_pc_vbefill.lst
--CLEANFILES += cmd-vesafb_mod-term_i386_pc_vesafb.lst fs-vesafb_mod-term_i386_pc_vesafb.lst
--COMMANDFILES += cmd-vesafb_mod-term_i386_pc_vesafb.lst
--FSFILES += fs-vesafb_mod-term_i386_pc_vesafb.lst
-+cmd-vbe_mod-video_i386_pc_vbefill.lst: video/i386/pc/vbefill.c gencmdlist.sh
-+      set -e;           $(TARGET_CC) -Ivideo/i386/pc -I$(srcdir)/video/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbe_mod_CFLAGS) -E $<      | sh $(srcdir)/gencmdlist.sh vbe > $@ || (rm -f $@; exit 1)
--cmd-vesafb_mod-term_i386_pc_vesafb.lst: term/i386/pc/vesafb.c gencmdlist.sh
--      set -e;           $(CC) -Iterm/i386/pc -I$(srcdir)/term/i386/pc $(CPPFLAGS) $(CFLAGS) $(vesafb_mod_CFLAGS) -E $<          | sh $(srcdir)/gencmdlist.sh vesafb > $@ || (rm -f $@; exit 1)
-+fs-vbe_mod-video_i386_pc_vbefill.lst: video/i386/pc/vbefill.c genfslist.sh
-+      set -e;           $(TARGET_CC) -Ivideo/i386/pc -I$(srcdir)/video/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbe_mod_CFLAGS) -E $<      | sh $(srcdir)/genfslist.sh vbe > $@ || (rm -f $@; exit 1)
--fs-vesafb_mod-term_i386_pc_vesafb.lst: term/i386/pc/vesafb.c genfslist.sh
--      set -e;           $(CC) -Iterm/i386/pc -I$(srcdir)/term/i386/pc $(CPPFLAGS) $(CFLAGS) $(vesafb_mod_CFLAGS) -E $<          | sh $(srcdir)/genfslist.sh vesafb > $@ || (rm -f $@; exit 1)
--
--vesafb_mod_CFLAGS = $(COMMON_CFLAGS)
--vesafb_mod_LDFLAGS = $(COMMON_LDFLAGS)
-+vbe_mod_CFLAGS = $(COMMON_CFLAGS)
-+vbe_mod_LDFLAGS = $(COMMON_LDFLAGS)
- # For vbeinfo.mod.
- vbeinfo_mod_SOURCES = commands/i386/pc/vbeinfo.c
--CLEANFILES += vbeinfo.mod mod-vbeinfo.o mod-vbeinfo.c pre-vbeinfo.o vbeinfo_mod-commands_i386_pc_vbeinfo.o def-vbeinfo.lst und-vbeinfo.lst
--MOSTLYCLEANFILES += vbeinfo_mod-commands_i386_pc_vbeinfo.d
-+CLEANFILES += vbeinfo.mod mod-vbeinfo.o mod-vbeinfo.c pre-vbeinfo.o vbeinfo_mod-commands_i386_pc_vbeinfo.o und-vbeinfo.lst
-+ifneq ($(vbeinfo_mod_EXPORTS),no)
-+CLEANFILES += def-vbeinfo.lst
- DEFSYMFILES += def-vbeinfo.lst
-+endif
-+MOSTLYCLEANFILES += vbeinfo_mod-commands_i386_pc_vbeinfo.d
- UNDSYMFILES += und-vbeinfo.lst
- vbeinfo.mod: pre-vbeinfo.o mod-vbeinfo.o
-       -rm -f $@
--      $(LD) $(vbeinfo_mod_LDFLAGS) $(LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(vbeinfo_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
-       $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
- pre-vbeinfo.o: vbeinfo_mod-commands_i386_pc_vbeinfo.o
-       -rm -f $@
--      $(LD) $(vbeinfo_mod_LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(vbeinfo_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
- mod-vbeinfo.o: mod-vbeinfo.c
--      $(CC) $(CPPFLAGS) $(CFLAGS) $(vbeinfo_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbeinfo_mod_CFLAGS) -c -o $@ $<
- mod-vbeinfo.c: moddep.lst genmodsrc.sh
-       sh $(srcdir)/genmodsrc.sh 'vbeinfo' $< > $@ || (rm -f $@; exit 1)
-+ifneq ($(vbeinfo_mod_EXPORTS),no)
- def-vbeinfo.lst: pre-vbeinfo.o
-       $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 vbeinfo/' > $@
-+endif
- und-vbeinfo.lst: pre-vbeinfo.o
-       echo 'vbeinfo' > $@
-       $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
- vbeinfo_mod-commands_i386_pc_vbeinfo.o: commands/i386/pc/vbeinfo.c
--      $(CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(CPPFLAGS) $(CFLAGS) $(vbeinfo_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbeinfo_mod_CFLAGS) -c -o $@ $<
- vbeinfo_mod-commands_i386_pc_vbeinfo.d: commands/i386/pc/vbeinfo.c
--      set -e;           $(CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(CPPFLAGS) $(CFLAGS) $(vbeinfo_mod_CFLAGS) -M $<         | sed 's,vbeinfo\.o[ :]*,vbeinfo_mod-commands_i386_pc_vbeinfo.o $@ : ,g' > $@;          [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbeinfo_mod_CFLAGS) -M $<    | sed 's,vbeinfo\.o[ :]*,vbeinfo_mod-commands_i386_pc_vbeinfo.o $@ : ,g' > $@;          [ -s $@ ] || rm -f $@
- -include vbeinfo_mod-commands_i386_pc_vbeinfo.d
-@@ -2301,10 +2241,10 @@
- FSFILES += fs-vbeinfo_mod-commands_i386_pc_vbeinfo.lst
- cmd-vbeinfo_mod-commands_i386_pc_vbeinfo.lst: commands/i386/pc/vbeinfo.c gencmdlist.sh
--      set -e;           $(CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(CPPFLAGS) $(CFLAGS) $(vbeinfo_mod_CFLAGS) -E $<         | sh $(srcdir)/gencmdlist.sh vbeinfo > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbeinfo_mod_CFLAGS) -E $<    | sh $(srcdir)/gencmdlist.sh vbeinfo > $@ || (rm -f $@; exit 1)
- fs-vbeinfo_mod-commands_i386_pc_vbeinfo.lst: commands/i386/pc/vbeinfo.c genfslist.sh
--      set -e;           $(CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(CPPFLAGS) $(CFLAGS) $(vbeinfo_mod_CFLAGS) -E $<         | sh $(srcdir)/genfslist.sh vbeinfo > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbeinfo_mod_CFLAGS) -E $<    | sh $(srcdir)/genfslist.sh vbeinfo > $@ || (rm -f $@; exit 1)
- vbeinfo_mod_CFLAGS = $(COMMON_CFLAGS)
-@@ -2312,38 +2252,43 @@
- # For vbetest.mod.
- vbetest_mod_SOURCES = commands/i386/pc/vbetest.c
--CLEANFILES += vbetest.mod mod-vbetest.o mod-vbetest.c pre-vbetest.o vbetest_mod-commands_i386_pc_vbetest.o def-vbetest.lst und-vbetest.lst
--MOSTLYCLEANFILES += vbetest_mod-commands_i386_pc_vbetest.d
-+CLEANFILES += vbetest.mod mod-vbetest.o mod-vbetest.c pre-vbetest.o vbetest_mod-commands_i386_pc_vbetest.o und-vbetest.lst
-+ifneq ($(vbetest_mod_EXPORTS),no)
-+CLEANFILES += def-vbetest.lst
- DEFSYMFILES += def-vbetest.lst
-+endif
-+MOSTLYCLEANFILES += vbetest_mod-commands_i386_pc_vbetest.d
- UNDSYMFILES += und-vbetest.lst
- vbetest.mod: pre-vbetest.o mod-vbetest.o
-       -rm -f $@
--      $(LD) $(vbetest_mod_LDFLAGS) $(LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(vbetest_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
-       $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
- pre-vbetest.o: vbetest_mod-commands_i386_pc_vbetest.o
-       -rm -f $@
--      $(LD) $(vbetest_mod_LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(vbetest_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
- mod-vbetest.o: mod-vbetest.c
--      $(CC) $(CPPFLAGS) $(CFLAGS) $(vbetest_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbetest_mod_CFLAGS) -c -o $@ $<
- mod-vbetest.c: moddep.lst genmodsrc.sh
-       sh $(srcdir)/genmodsrc.sh 'vbetest' $< > $@ || (rm -f $@; exit 1)
-+ifneq ($(vbetest_mod_EXPORTS),no)
- def-vbetest.lst: pre-vbetest.o
-       $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 vbetest/' > $@
-+endif
- und-vbetest.lst: pre-vbetest.o
-       echo 'vbetest' > $@
-       $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
- vbetest_mod-commands_i386_pc_vbetest.o: commands/i386/pc/vbetest.c
--      $(CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(CPPFLAGS) $(CFLAGS) $(vbetest_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbetest_mod_CFLAGS) -c -o $@ $<
- vbetest_mod-commands_i386_pc_vbetest.d: commands/i386/pc/vbetest.c
--      set -e;           $(CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(CPPFLAGS) $(CFLAGS) $(vbetest_mod_CFLAGS) -M $<         | sed 's,vbetest\.o[ :]*,vbetest_mod-commands_i386_pc_vbetest.o $@ : ,g' > $@;          [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbetest_mod_CFLAGS) -M $<    | sed 's,vbetest\.o[ :]*,vbetest_mod-commands_i386_pc_vbetest.o $@ : ,g' > $@;          [ -s $@ ] || rm -f $@
- -include vbetest_mod-commands_i386_pc_vbetest.d
-@@ -2352,10 +2297,10 @@
- FSFILES += fs-vbetest_mod-commands_i386_pc_vbetest.lst
- cmd-vbetest_mod-commands_i386_pc_vbetest.lst: commands/i386/pc/vbetest.c gencmdlist.sh
--      set -e;           $(CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(CPPFLAGS) $(CFLAGS) $(vbetest_mod_CFLAGS) -E $<         | sh $(srcdir)/gencmdlist.sh vbetest > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbetest_mod_CFLAGS) -E $<    | sh $(srcdir)/gencmdlist.sh vbetest > $@ || (rm -f $@; exit 1)
- fs-vbetest_mod-commands_i386_pc_vbetest.lst: commands/i386/pc/vbetest.c genfslist.sh
--      set -e;           $(CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(CPPFLAGS) $(CFLAGS) $(vbetest_mod_CFLAGS) -E $<         | sh $(srcdir)/genfslist.sh vbetest > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbetest_mod_CFLAGS) -E $<    | sh $(srcdir)/genfslist.sh vbetest > $@ || (rm -f $@; exit 1)
- vbetest_mod_CFLAGS = $(COMMON_CFLAGS)
-@@ -2363,38 +2308,43 @@
- # For play.mod.
- play_mod_SOURCES = commands/i386/pc/play.c
--CLEANFILES += play.mod mod-play.o mod-play.c pre-play.o play_mod-commands_i386_pc_play.o def-play.lst und-play.lst
--MOSTLYCLEANFILES += play_mod-commands_i386_pc_play.d
-+CLEANFILES += play.mod mod-play.o mod-play.c pre-play.o play_mod-commands_i386_pc_play.o und-play.lst
-+ifneq ($(play_mod_EXPORTS),no)
-+CLEANFILES += def-play.lst
- DEFSYMFILES += def-play.lst
-+endif
-+MOSTLYCLEANFILES += play_mod-commands_i386_pc_play.d
- UNDSYMFILES += und-play.lst
- play.mod: pre-play.o mod-play.o
-       -rm -f $@
--      $(LD) $(play_mod_LDFLAGS) $(LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(play_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
-       $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
- pre-play.o: play_mod-commands_i386_pc_play.o
-       -rm -f $@
--      $(LD) $(play_mod_LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(play_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
- mod-play.o: mod-play.c
--      $(CC) $(CPPFLAGS) $(CFLAGS) $(play_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(play_mod_CFLAGS) -c -o $@ $<
- mod-play.c: moddep.lst genmodsrc.sh
-       sh $(srcdir)/genmodsrc.sh 'play' $< > $@ || (rm -f $@; exit 1)
-+ifneq ($(play_mod_EXPORTS),no)
- def-play.lst: pre-play.o
-       $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 play/' > $@
-+endif
- und-play.lst: pre-play.o
-       echo 'play' > $@
-       $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
- play_mod-commands_i386_pc_play.o: commands/i386/pc/play.c
--      $(CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(CPPFLAGS) $(CFLAGS) $(play_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(play_mod_CFLAGS) -c -o $@ $<
- play_mod-commands_i386_pc_play.d: commands/i386/pc/play.c
--      set -e;           $(CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(CPPFLAGS) $(CFLAGS) $(play_mod_CFLAGS) -M $<    | sed 's,play\.o[ :]*,play_mod-commands_i386_pc_play.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(play_mod_CFLAGS) -M $<       | sed 's,play\.o[ :]*,play_mod-commands_i386_pc_play.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
- -include play_mod-commands_i386_pc_play.d
-@@ -2403,13 +2353,181 @@
- FSFILES += fs-play_mod-commands_i386_pc_play.lst
- cmd-play_mod-commands_i386_pc_play.lst: commands/i386/pc/play.c gencmdlist.sh
--      set -e;           $(CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(CPPFLAGS) $(CFLAGS) $(play_mod_CFLAGS) -E $<    | sh $(srcdir)/gencmdlist.sh play > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(play_mod_CFLAGS) -E $<       | sh $(srcdir)/gencmdlist.sh play > $@ || (rm -f $@; exit 1)
- fs-play_mod-commands_i386_pc_play.lst: commands/i386/pc/play.c genfslist.sh
--      set -e;           $(CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(CPPFLAGS) $(CFLAGS) $(play_mod_CFLAGS) -E $<    | sh $(srcdir)/genfslist.sh play > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(play_mod_CFLAGS) -E $<       | sh $(srcdir)/genfslist.sh play > $@ || (rm -f $@; exit 1)
- play_mod_CFLAGS = $(COMMON_CFLAGS)
- play_mod_LDFLAGS = $(COMMON_LDFLAGS)
-+# For video.mod.
-+video_mod_SOURCES = video/video.c
-+CLEANFILES += video.mod mod-video.o mod-video.c pre-video.o video_mod-video_video.o und-video.lst
-+ifneq ($(video_mod_EXPORTS),no)
-+CLEANFILES += def-video.lst
-+DEFSYMFILES += def-video.lst
-+endif
-+MOSTLYCLEANFILES += video_mod-video_video.d
-+UNDSYMFILES += und-video.lst
-+
-+video.mod: pre-video.o mod-video.o
-+      -rm -f $@
-+      $(TARGET_CC) $(video_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
-+      $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
-+
-+pre-video.o: video_mod-video_video.o
-+      -rm -f $@
-+      $(TARGET_CC) $(video_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
-+
-+mod-video.o: mod-video.c
-+      $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(video_mod_CFLAGS) -c -o $@ $<
-+
-+mod-video.c: moddep.lst genmodsrc.sh
-+      sh $(srcdir)/genmodsrc.sh 'video' $< > $@ || (rm -f $@; exit 1)
-+
-+ifneq ($(video_mod_EXPORTS),no)
-+def-video.lst: pre-video.o
-+      $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 video/' > $@
-+endif
-+
-+und-video.lst: pre-video.o
-+      echo 'video' > $@
-+      $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
-+
-+video_mod-video_video.o: video/video.c
-+      $(TARGET_CC) -Ivideo -I$(srcdir)/video $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(video_mod_CFLAGS) -c -o $@ $<
-+
-+video_mod-video_video.d: video/video.c
-+      set -e;           $(TARGET_CC) -Ivideo -I$(srcdir)/video $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(video_mod_CFLAGS) -M $<    | sed 's,video\.o[ :]*,video_mod-video_video.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
-+
-+-include video_mod-video_video.d
-+
-+CLEANFILES += cmd-video_mod-video_video.lst fs-video_mod-video_video.lst
-+COMMANDFILES += cmd-video_mod-video_video.lst
-+FSFILES += fs-video_mod-video_video.lst
-+
-+cmd-video_mod-video_video.lst: video/video.c gencmdlist.sh
-+      set -e;           $(TARGET_CC) -Ivideo -I$(srcdir)/video $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(video_mod_CFLAGS) -E $<    | sh $(srcdir)/gencmdlist.sh video > $@ || (rm -f $@; exit 1)
-+
-+fs-video_mod-video_video.lst: video/video.c genfslist.sh
-+      set -e;           $(TARGET_CC) -Ivideo -I$(srcdir)/video $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(video_mod_CFLAGS) -E $<    | sh $(srcdir)/genfslist.sh video > $@ || (rm -f $@; exit 1)
-+
-+
-+video_mod_CFLAGS = $(COMMON_CFLAGS)
-+video_mod_LDFLAGS = $(COMMON_LDFLAGS)
-+
-+# For gfxterm.mod.
-+gfxterm_mod_SOURCES = term/gfxterm.c
-+CLEANFILES += gfxterm.mod mod-gfxterm.o mod-gfxterm.c pre-gfxterm.o gfxterm_mod-term_gfxterm.o und-gfxterm.lst
-+ifneq ($(gfxterm_mod_EXPORTS),no)
-+CLEANFILES += def-gfxterm.lst
-+DEFSYMFILES += def-gfxterm.lst
-+endif
-+MOSTLYCLEANFILES += gfxterm_mod-term_gfxterm.d
-+UNDSYMFILES += und-gfxterm.lst
-+
-+gfxterm.mod: pre-gfxterm.o mod-gfxterm.o
-+      -rm -f $@
-+      $(TARGET_CC) $(gfxterm_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
-+      $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
-+
-+pre-gfxterm.o: gfxterm_mod-term_gfxterm.o
-+      -rm -f $@
-+      $(TARGET_CC) $(gfxterm_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
-+
-+mod-gfxterm.o: mod-gfxterm.c
-+      $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(gfxterm_mod_CFLAGS) -c -o $@ $<
-+
-+mod-gfxterm.c: moddep.lst genmodsrc.sh
-+      sh $(srcdir)/genmodsrc.sh 'gfxterm' $< > $@ || (rm -f $@; exit 1)
-+
-+ifneq ($(gfxterm_mod_EXPORTS),no)
-+def-gfxterm.lst: pre-gfxterm.o
-+      $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 gfxterm/' > $@
-+endif
-+
-+und-gfxterm.lst: pre-gfxterm.o
-+      echo 'gfxterm' > $@
-+      $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
-+
-+gfxterm_mod-term_gfxterm.o: term/gfxterm.c
-+      $(TARGET_CC) -Iterm -I$(srcdir)/term $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(gfxterm_mod_CFLAGS) -c -o $@ $<
-+
-+gfxterm_mod-term_gfxterm.d: term/gfxterm.c
-+      set -e;           $(TARGET_CC) -Iterm -I$(srcdir)/term $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(gfxterm_mod_CFLAGS) -M $<    | sed 's,gfxterm\.o[ :]*,gfxterm_mod-term_gfxterm.o $@ : ,g' > $@;      [ -s $@ ] || rm -f $@
-+
-+-include gfxterm_mod-term_gfxterm.d
-+
-+CLEANFILES += cmd-gfxterm_mod-term_gfxterm.lst fs-gfxterm_mod-term_gfxterm.lst
-+COMMANDFILES += cmd-gfxterm_mod-term_gfxterm.lst
-+FSFILES += fs-gfxterm_mod-term_gfxterm.lst
-+
-+cmd-gfxterm_mod-term_gfxterm.lst: term/gfxterm.c gencmdlist.sh
-+      set -e;           $(TARGET_CC) -Iterm -I$(srcdir)/term $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(gfxterm_mod_CFLAGS) -E $<    | sh $(srcdir)/gencmdlist.sh gfxterm > $@ || (rm -f $@; exit 1)
-+
-+fs-gfxterm_mod-term_gfxterm.lst: term/gfxterm.c genfslist.sh
-+      set -e;           $(TARGET_CC) -Iterm -I$(srcdir)/term $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(gfxterm_mod_CFLAGS) -E $<    | sh $(srcdir)/genfslist.sh gfxterm > $@ || (rm -f $@; exit 1)
-+
-+
-+gfxterm_mod_CFLAGS = $(COMMON_CFLAGS)
-+gfxterm_mod_LDFLAGS = $(COMMON_LDFLAGS)
-+
-+# For videotest.mod.
-+videotest_mod_SOURCES = commands/videotest.c
-+CLEANFILES += videotest.mod mod-videotest.o mod-videotest.c pre-videotest.o videotest_mod-commands_videotest.o und-videotest.lst
-+ifneq ($(videotest_mod_EXPORTS),no)
-+CLEANFILES += def-videotest.lst
-+DEFSYMFILES += def-videotest.lst
-+endif
-+MOSTLYCLEANFILES += videotest_mod-commands_videotest.d
-+UNDSYMFILES += und-videotest.lst
-+
-+videotest.mod: pre-videotest.o mod-videotest.o
-+      -rm -f $@
-+      $(TARGET_CC) $(videotest_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
-+      $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
-+
-+pre-videotest.o: videotest_mod-commands_videotest.o
-+      -rm -f $@
-+      $(TARGET_CC) $(videotest_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
-+
-+mod-videotest.o: mod-videotest.c
-+      $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(videotest_mod_CFLAGS) -c -o $@ $<
-+
-+mod-videotest.c: moddep.lst genmodsrc.sh
-+      sh $(srcdir)/genmodsrc.sh 'videotest' $< > $@ || (rm -f $@; exit 1)
-+
-+ifneq ($(videotest_mod_EXPORTS),no)
-+def-videotest.lst: pre-videotest.o
-+      $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 videotest/' > $@
-+endif
-+
-+und-videotest.lst: pre-videotest.o
-+      echo 'videotest' > $@
-+      $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
-+
-+videotest_mod-commands_videotest.o: commands/videotest.c
-+      $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(videotest_mod_CFLAGS) -c -o $@ $<
-+
-+videotest_mod-commands_videotest.d: commands/videotest.c
-+      set -e;           $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(videotest_mod_CFLAGS) -M $<          | sed 's,videotest\.o[ :]*,videotest_mod-commands_videotest.o $@ : ,g' > $@;    [ -s $@ ] || rm -f $@
-+
-+-include videotest_mod-commands_videotest.d
-+
-+CLEANFILES += cmd-videotest_mod-commands_videotest.lst fs-videotest_mod-commands_videotest.lst
-+COMMANDFILES += cmd-videotest_mod-commands_videotest.lst
-+FSFILES += fs-videotest_mod-commands_videotest.lst
-+
-+cmd-videotest_mod-commands_videotest.lst: commands/videotest.c gencmdlist.sh
-+      set -e;           $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(videotest_mod_CFLAGS) -E $<          | sh $(srcdir)/gencmdlist.sh videotest > $@ || (rm -f $@; exit 1)
-+
-+fs-videotest_mod-commands_videotest.lst: commands/videotest.c genfslist.sh
-+      set -e;           $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(videotest_mod_CFLAGS) -E $<          | sh $(srcdir)/genfslist.sh videotest > $@ || (rm -f $@; exit 1)
-+
-+
-+videotest_mod_CFLAGS = $(COMMON_CFLAGS)
-+videotest_mod_LDFLAGS = $(COMMON_LDFLAGS)
-+
- include $(srcdir)/conf/common.mk
-Index: conf/i386-pc.rmk
-===================================================================
-RCS file: /cvsroot/grub/grub2/conf/i386-pc.rmk,v
-retrieving revision 1.58
-retrieving revision 1.65
-diff -u -r1.58 -r1.65
---- conf/i386-pc.rmk   25 Dec 2005 15:59:50 -0000      1.58
-+++ conf/i386-pc.rmk   28 May 2006 23:01:43 -0000      1.65
-@@ -2,7 +2,7 @@
- COMMON_ASFLAGS = -nostdinc -fno-builtin
- COMMON_CFLAGS = -fno-builtin -mrtd -mregparm=3 -m32
--COMMON_LDFLAGS = -melf_i386
-+COMMON_LDFLAGS = -melf_i386 -nostdlib
- # Images.
- pkgdata_IMAGES = boot.img diskboot.img kernel.img pxeboot.img
-@@ -43,16 +43,15 @@
- MOSTLYCLEANFILES += symlist.c kernel_syms.lst
- DEFSYMFILES += kernel_syms.lst
--symlist.c: $(addprefix include/grub/,$(kernel_img_HEADERS)) gensymlist.sh
--      sh $(srcdir)/gensymlist.sh $(filter %.h,$^) > $@
-+symlist.c: $(addprefix include/grub/,$(kernel_img_HEADERS)) config.h gensymlist.sh
-+      /bin/sh gensymlist.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1)
--kernel_syms.lst: $(addprefix include/grub/,$(kernel_img_HEADERS)) genkernsyms.sh
--      sh $(srcdir)/genkernsyms.sh $(filter %h,$^) > $@
-+kernel_syms.lst: $(addprefix include/grub/,$(kernel_img_HEADERS)) config.h genkernsyms.sh
-+      /bin/sh genkernsyms.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1)
- # Utilities.
- bin_UTILITIES = grub-mkimage
- sbin_UTILITIES = grub-setup grub-emu grub-mkdevicemap grub-probefs
--noinst_UTILITIES = genmoddep
- # For grub-mkimage.
- grub_mkimage_SOURCES = util/i386/pc/grub-mkimage.c util/misc.c \
-@@ -79,10 +78,10 @@
-       fs/xfs.c fs/affs.c fs/sfs.c fs/hfsplus.c
- # For grub-emu.
--grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c              \
--      commands/configfile.c commands/default.c commands/help.c        \
-+grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c      \
-+      commands/configfile.c commands/help.c                           \
-       commands/terminal.c commands/ls.c commands/test.c               \
--      commands/search.c commands/timeout.c                            \
-+      commands/search.c commands/blocklist.c                          \
-       commands/i386/pc/halt.c commands/i386/pc/reboot.c               \
-       disk/loopback.c                                                 \
-       fs/affs.c fs/ext2.c fs/fat.c fs/fshelp.c fs/hfs.c fs/iso9660.c  \
-@@ -93,7 +92,7 @@
-       kern/loader.c kern/main.c kern/misc.c kern/parser.c             \
-       grub_script.tab.c kern/partition.c kern/rescue.c kern/term.c    \
-       normal/arg.c normal/cmdline.c normal/command.c normal/function.c\
--      normal/completion.c normal/context.c normal/main.c              \
-+      normal/completion.c normal/main.c                               \
-       normal/menu.c normal/menu_entry.c normal/misc.c normal/script.c \
-       partmap/amiga.c partmap/apple.c partmap/pc.c partmap/sun.c      \
-       partmap/acorn.c partmap/gpt.c                                   \
-@@ -103,9 +102,6 @@
- grub_emu_LDFLAGS = $(LIBCURSES)
--# For genmoddep.
--genmoddep_SOURCES = util/genmoddep.c
--
- # Scripts.
- sbin_SCRIPTS = grub-install
-@@ -113,9 +109,10 @@
- grub_install_SOURCES = util/i386/pc/grub-install.in
- # Modules.
--pkgdata_MODULES = _chain.mod _linux.mod linux.mod normal.mod vga.mod  \
-+pkgdata_MODULES = _chain.mod _linux.mod linux.mod normal.mod \
-       _multiboot.mod chain.mod multiboot.mod reboot.mod halt.mod      \
--      vbe.mod vesafb.mod vbetest.mod vbeinfo.mod play.mod
-+      vbe.mod vbetest.mod vbeinfo.mod video.mod gfxterm.mod \
-+      videotest.mod play.mod
- # For _chain.mod.
- _chain_mod_SOURCES = loader/i386/pc/chainloader.c
-@@ -139,7 +136,7 @@
- # For normal.mod.
- normal_mod_SOURCES = normal/arg.c normal/cmdline.c normal/command.c   \
--      normal/completion.c normal/context.c normal/execute.c           \
-+      normal/completion.c normal/execute.c                            \
-       normal/function.c normal/lexer.c normal/main.c normal/menu.c    \
-       normal/menu_entry.c normal/misc.c grub_script.tab.c             \
-       normal/script.c normal/i386/setjmp.S
-@@ -157,11 +154,6 @@
- halt_mod_CFLAGS = $(COMMON_CFLAGS)
- halt_mod_LDFLAGS = $(COMMON_LDFLAGS)
--# For vga.mod.
--vga_mod_SOURCES = term/i386/pc/vga.c
--vga_mod_CFLAGS = $(COMMON_CFLAGS)
--vga_mod_LDFLAGS = $(COMMON_LDFLAGS)
--
- # For serial.mod.
- serial_mod_SOURCES = term/i386/pc/serial.c
- serial_mod_CFLAGS = $(COMMON_CFLAGS)
-@@ -178,15 +170,11 @@
- multiboot_mod_LDFLAGS = $(COMMON_LDFLAGS)
- # For vbe.mod.
--vbe_mod_SOURCES = video/i386/pc/vbe.c
-+vbe_mod_SOURCES = video/i386/pc/vbe.c video/i386/pc/vbeblit.c \
-+                video/i386/pc/vbefill.c
- vbe_mod_CFLAGS = $(COMMON_CFLAGS)
- vbe_mod_LDFLAGS = $(COMMON_LDFLAGS)
--# For vesafb.mod.
--vesafb_mod_SOURCES = term/i386/pc/vesafb.c
--vesafb_mod_CFLAGS = $(COMMON_CFLAGS)
--vesafb_mod_LDFLAGS = $(COMMON_LDFLAGS)
--
- # For vbeinfo.mod.
- vbeinfo_mod_SOURCES = commands/i386/pc/vbeinfo.c
- vbeinfo_mod_CFLAGS = $(COMMON_CFLAGS)
-@@ -202,4 +190,19 @@
- play_mod_CFLAGS = $(COMMON_CFLAGS)
- play_mod_LDFLAGS = $(COMMON_LDFLAGS)
-+# For video.mod.
-+video_mod_SOURCES = video/video.c
-+video_mod_CFLAGS = $(COMMON_CFLAGS)
-+video_mod_LDFLAGS = $(COMMON_LDFLAGS)
-+
-+# For gfxterm.mod.
-+gfxterm_mod_SOURCES = term/gfxterm.c
-+gfxterm_mod_CFLAGS = $(COMMON_CFLAGS)
-+gfxterm_mod_LDFLAGS = $(COMMON_LDFLAGS)
-+
-+# For videotest.mod.
-+videotest_mod_SOURCES = commands/videotest.c
-+videotest_mod_CFLAGS = $(COMMON_CFLAGS)
-+videotest_mod_LDFLAGS = $(COMMON_LDFLAGS)
-+
- include $(srcdir)/conf/common.mk
-Index: conf/powerpc-ieee1275.mk
-===================================================================
-RCS file: /cvsroot/grub/grub2/conf/powerpc-ieee1275.mk,v
-retrieving revision 1.54
-retrieving revision 1.65
-diff -u -r1.54 -r1.65
---- conf/powerpc-ieee1275.mk   25 Dec 2005 15:59:50 -0000      1.54
-+++ conf/powerpc-ieee1275.mk   4 Jun 2006 12:59:19 -0000       1.65
-@@ -3,31 +3,31 @@
- COMMON_ASFLAGS = -nostdinc -D__ASSEMBLY__
- COMMON_CFLAGS = -ffreestanding -msoft-float
-+COMMON_LDFLAGS += -nostdlib
- # Images.
--MOSTLYCLEANFILES += grubof_symlist.c kernel_syms.lst
-+MOSTLYCLEANFILES += kernel_elf_symlist.c kernel_syms.lst
- DEFSYMFILES += kernel_syms.lst
--grubof_HEADERS = arg.h boot.h device.h disk.h dl.h elf.h env.h err.h \
-+kernel_elf_HEADERS = arg.h boot.h device.h disk.h dl.h elf.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 types.h powerpc/libgcc.h loader.h \
-       partition.h pc_partition.h ieee1275/ieee1275.h machine/time.h \
-       machine/kernel.h
--grubof_symlist.c: $(addprefix include/grub/,$(grubof_HEADERS)) gensymlist.sh
--      sh $(srcdir)/gensymlist.sh $(filter %.h,$^) > $@
-+kernel_elf_symlist.c: $(addprefix include/grub/,$(kernel_elf_HEADERS)) config.h gensymlist.sh
-+      /bin/sh gensymlist.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1)
--kernel_syms.lst: $(addprefix include/grub/,$(grubof_HEADERS)) genkernsyms.sh
--      sh $(srcdir)/genkernsyms.sh $(filter %h,$^) > $@
-+kernel_syms.lst: $(addprefix include/grub/,$(kernel_elf_HEADERS)) config.h genkernsyms.sh
-+      /bin/sh genkernsyms.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1)
- # Programs
--pkgdata_PROGRAMS = grubof
-+pkgdata_PROGRAMS = kernel.elf
- # Utilities.
- bin_UTILITIES = grub-emu
- sbin_UTILITIES = grub-mkimage
--noinst_UTILITIES = genmoddep
- # For grub-mkimage.
- grub_mkimage_SOURCES = util/powerpc/ieee1275/grub-mkimage.c util/misc.c \
-@@ -36,38 +36,38 @@
- MOSTLYCLEANFILES += grub_mkimage-util_powerpc_ieee1275_grub_mkimage.d grub_mkimage-util_misc.d grub_mkimage-util_resolve.d
- grub-mkimage: grub_mkimage-util_powerpc_ieee1275_grub_mkimage.o grub_mkimage-util_misc.o grub_mkimage-util_resolve.o
--      $(BUILD_CC) -o $@ $^ $(BUILD_LDFLAGS) $(grub_mkimage_LDFLAGS)
-+      $(CC) -o $@ $^ $(LDFLAGS) $(grub_mkimage_LDFLAGS)
- grub_mkimage-util_powerpc_ieee1275_grub_mkimage.o: util/powerpc/ieee1275/grub-mkimage.c
--      $(BUILD_CC) -Iutil/powerpc/ieee1275 -I$(srcdir)/util/powerpc/ieee1275 $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_mkimage_CFLAGS) -c -o $@ $<
-+      $(CC) -Iutil/powerpc/ieee1275 -I$(srcdir)/util/powerpc/ieee1275 $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_mkimage_CFLAGS) -c -o $@ $<
- grub_mkimage-util_powerpc_ieee1275_grub_mkimage.d: util/powerpc/ieee1275/grub-mkimage.c
--      set -e;           $(BUILD_CC) -Iutil/powerpc/ieee1275 -I$(srcdir)/util/powerpc/ieee1275 $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_mkimage_CFLAGS) -M $<      | sed 's,grub\-mkimage\.o[ :]*,grub_mkimage-util_powerpc_ieee1275_grub_mkimage.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Iutil/powerpc/ieee1275 -I$(srcdir)/util/powerpc/ieee1275 $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_mkimage_CFLAGS) -M $<        | sed 's,grub\-mkimage\.o[ :]*,grub_mkimage-util_powerpc_ieee1275_grub_mkimage.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
- -include grub_mkimage-util_powerpc_ieee1275_grub_mkimage.d
- grub_mkimage-util_misc.o: util/misc.c
--      $(BUILD_CC) -Iutil -I$(srcdir)/util $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_mkimage_CFLAGS) -c -o $@ $<
-+      $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_mkimage_CFLAGS) -c -o $@ $<
- grub_mkimage-util_misc.d: util/misc.c
--      set -e;           $(BUILD_CC) -Iutil -I$(srcdir)/util $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_mkimage_CFLAGS) -M $<        | sed 's,misc\.o[ :]*,grub_mkimage-util_misc.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_mkimage_CFLAGS) -M $<          | sed 's,misc\.o[ :]*,grub_mkimage-util_misc.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
- -include grub_mkimage-util_misc.d
- grub_mkimage-util_resolve.o: util/resolve.c
--      $(BUILD_CC) -Iutil -I$(srcdir)/util $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_mkimage_CFLAGS) -c -o $@ $<
-+      $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_mkimage_CFLAGS) -c -o $@ $<
- grub_mkimage-util_resolve.d: util/resolve.c
--      set -e;           $(BUILD_CC) -Iutil -I$(srcdir)/util $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_mkimage_CFLAGS) -M $<        | sed 's,resolve\.o[ :]*,grub_mkimage-util_resolve.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_mkimage_CFLAGS) -M $<          | sed 's,resolve\.o[ :]*,grub_mkimage-util_resolve.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
- -include grub_mkimage-util_resolve.d
- # For grub-emu
- grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c      \
--      commands/configfile.c commands/default.c commands/help.c        \
-+      commands/configfile.c commands/help.c                           \
-       commands/search.c commands/terminal.c commands/test.c           \
--      commands/ls.c commands/timeout.c                                \
-+      commands/ls.c commands/blocklist.c                              \
-       commands/ieee1275/halt.c commands/ieee1275/reboot.c             \
-       disk/loopback.c                                                 \
-       fs/affs.c fs/ext2.c fs/fat.c fs/fshelp.c fs/hfs.c fs/iso9660.c  \
-@@ -77,7 +77,7 @@
-       kern/file.c kern/fs.c kern/loader.c kern/main.c kern/misc.c     \
-       kern/parser.c kern/partition.c kern/rescue.c kern/term.c        \
-       normal/arg.c normal/cmdline.c normal/command.c                  \
--      normal/completion.c normal/context.c normal/execute.c           \
-+      normal/completion.c normal/execute.c                            \
-       normal/function.c normal/lexer.c normal/main.c normal/menu.c    \
-       normal/menu_entry.c normal/misc.c normal/script.c               \
-       partmap/amiga.c partmap/apple.c partmap/pc.c partmap/sun.c      \
-@@ -85,786 +85,754 @@
-       util/console.c util/grub-emu.c util/misc.c                      \
-       util/i386/pc/biosdisk.c util/i386/pc/getroot.c                  \
-       util/powerpc/ieee1275/misc.c grub_script.tab.c grub_emu_init.c
--CLEANFILES += grub-emu grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_default.o grub_emu-commands_help.o grub_emu-commands_search.o grub_emu-commands_terminal.o grub_emu-commands_test.o grub_emu-commands_ls.o grub_emu-commands_timeout.o grub_emu-commands_ieee1275_halt.o grub_emu-commands_ieee1275_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_fshelp.o grub_emu-fs_hfs.o grub_emu-fs_iso9660.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_hfsplus.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_completion.o grub_emu-normal_context.o grub_emu-normal_execute.o grub_emu-normal_function.o grub_emu-normal_lexer.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-util_console.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_i386_pc_biosdisk.o grub_emu-util_i386_pc_getroot.o grub_emu-util_powerpc_ieee1275_misc.o grub_emu-grub_script_tab.o grub_emu-grub_emu_init.o
--MOSTLYCLEANFILES += grub_emu-commands_boot.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_default.d grub_emu-commands_help.d grub_emu-commands_search.d grub_emu-commands_terminal.d grub_emu-commands_test.d grub_emu-commands_ls.d grub_emu-commands_timeout.d grub_emu-commands_ieee1275_halt.d grub_emu-commands_ieee1275_reboot.d grub_emu-disk_loopback.d grub_emu-fs_affs.d grub_emu-fs_ext2.d grub_emu-fs_fat.d grub_emu-fs_fshelp.d grub_emu-fs_hfs.d grub_emu-fs_iso9660.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-fs_hfsplus.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-normal_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_completion.d grub_emu-normal_context.d grub_emu-normal_execute.d grub_emu-normal_function.d grub_emu-normal_lexer.d grub_emu-normal_main.d grub_emu-normal_menu.d grub_emu-normal_menu_entry.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-util_console.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_i386_pc_biosdisk.d grub_emu-util_i386_pc_getroot.d grub_emu-util_powerpc_ieee1275_misc.d grub_emu-grub_script_tab.d grub_emu-grub_emu_init.d
-+CLEANFILES += grub-emu grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_help.o grub_emu-commands_search.o grub_emu-commands_terminal.o grub_emu-commands_test.o grub_emu-commands_ls.o grub_emu-commands_blocklist.o grub_emu-commands_ieee1275_halt.o grub_emu-commands_ieee1275_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_fshelp.o grub_emu-fs_hfs.o grub_emu-fs_iso9660.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_hfsplus.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_completion.o grub_emu-normal_execute.o grub_emu-normal_function.o grub_emu-normal_lexer.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-util_console.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_i386_pc_biosdisk.o grub_emu-util_i386_pc_getroot.o grub_emu-util_powerpc_ieee1275_misc.o grub_emu-grub_script_tab.o grub_emu-grub_emu_init.o
-+MOSTLYCLEANFILES += grub_emu-commands_boot.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_help.d grub_emu-commands_search.d grub_emu-commands_terminal.d grub_emu-commands_test.d grub_emu-commands_ls.d grub_emu-commands_blocklist.d grub_emu-commands_ieee1275_halt.d grub_emu-commands_ieee1275_reboot.d grub_emu-disk_loopback.d grub_emu-fs_affs.d grub_emu-fs_ext2.d grub_emu-fs_fat.d grub_emu-fs_fshelp.d grub_emu-fs_hfs.d grub_emu-fs_iso9660.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-fs_hfsplus.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-normal_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_completion.d grub_emu-normal_execute.d grub_emu-normal_function.d grub_emu-normal_lexer.d grub_emu-normal_main.d grub_emu-normal_menu.d grub_emu-normal_menu_entry.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-util_console.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_i386_pc_biosdisk.d grub_emu-util_i386_pc_getroot.d grub_emu-util_powerpc_ieee1275_misc.d grub_emu-grub_script_tab.d grub_emu-grub_emu_init.d
--grub-emu: grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_default.o grub_emu-commands_help.o grub_emu-commands_search.o grub_emu-commands_terminal.o grub_emu-commands_test.o grub_emu-commands_ls.o grub_emu-commands_timeout.o grub_emu-commands_ieee1275_halt.o grub_emu-commands_ieee1275_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_fshelp.o grub_emu-fs_hfs.o grub_emu-fs_iso9660.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_hfsplus.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_completion.o grub_emu-normal_context.o grub_emu-normal_execute.o grub_emu-normal_function.o grub_emu-normal_lexer.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-util_console.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_i386_pc_biosdisk.o grub_emu-util_i386_pc_getroot.o grub_emu-util_powerpc_ieee1275_misc.o grub_emu-grub_script_tab.o grub_emu-grub_emu_init.o
--      $(BUILD_CC) -o $@ $^ $(BUILD_LDFLAGS) $(grub_emu_LDFLAGS)
-+grub-emu: grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_help.o grub_emu-commands_search.o grub_emu-commands_terminal.o grub_emu-commands_test.o grub_emu-commands_ls.o grub_emu-commands_blocklist.o grub_emu-commands_ieee1275_halt.o grub_emu-commands_ieee1275_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_fshelp.o grub_emu-fs_hfs.o grub_emu-fs_iso9660.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_hfsplus.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_completion.o grub_emu-normal_execute.o grub_emu-normal_function.o grub_emu-normal_lexer.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-util_console.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_i386_pc_biosdisk.o grub_emu-util_i386_pc_getroot.o grub_emu-util_powerpc_ieee1275_misc.o grub_emu-grub_script_tab.o grub_emu-grub_emu_init.o
-+      $(CC) -o $@ $^ $(LDFLAGS) $(grub_emu_LDFLAGS)
- grub_emu-commands_boot.o: commands/boot.c
--      $(BUILD_CC) -Icommands -I$(srcdir)/commands $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
-+      $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
- grub_emu-commands_boot.d: commands/boot.c
--      set -e;           $(BUILD_CC) -Icommands -I$(srcdir)/commands $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,boot\.o[ :]*,grub_emu-commands_boot.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,boot\.o[ :]*,grub_emu-commands_boot.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
- -include grub_emu-commands_boot.d
- grub_emu-commands_cat.o: commands/cat.c
--      $(BUILD_CC) -Icommands -I$(srcdir)/commands $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
-+      $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
- grub_emu-commands_cat.d: commands/cat.c
--      set -e;           $(BUILD_CC) -Icommands -I$(srcdir)/commands $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,cat\.o[ :]*,grub_emu-commands_cat.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,cat\.o[ :]*,grub_emu-commands_cat.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
- -include grub_emu-commands_cat.d
- grub_emu-commands_cmp.o: commands/cmp.c
--      $(BUILD_CC) -Icommands -I$(srcdir)/commands $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
-+      $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
- grub_emu-commands_cmp.d: commands/cmp.c
--      set -e;           $(BUILD_CC) -Icommands -I$(srcdir)/commands $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,cmp\.o[ :]*,grub_emu-commands_cmp.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,cmp\.o[ :]*,grub_emu-commands_cmp.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
- -include grub_emu-commands_cmp.d
- grub_emu-commands_configfile.o: commands/configfile.c
--      $(BUILD_CC) -Icommands -I$(srcdir)/commands $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
-+      $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
- grub_emu-commands_configfile.d: commands/configfile.c
--      set -e;           $(BUILD_CC) -Icommands -I$(srcdir)/commands $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,configfile\.o[ :]*,grub_emu-commands_configfile.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,configfile\.o[ :]*,grub_emu-commands_configfile.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
- -include grub_emu-commands_configfile.d
--grub_emu-commands_default.o: commands/default.c
--      $(BUILD_CC) -Icommands -I$(srcdir)/commands $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
--
--grub_emu-commands_default.d: commands/default.c
--      set -e;           $(BUILD_CC) -Icommands -I$(srcdir)/commands $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,default\.o[ :]*,grub_emu-commands_default.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
--
---include grub_emu-commands_default.d
--
- grub_emu-commands_help.o: commands/help.c
--      $(BUILD_CC) -Icommands -I$(srcdir)/commands $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
-+      $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
- grub_emu-commands_help.d: commands/help.c
--      set -e;           $(BUILD_CC) -Icommands -I$(srcdir)/commands $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,help\.o[ :]*,grub_emu-commands_help.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,help\.o[ :]*,grub_emu-commands_help.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
- -include grub_emu-commands_help.d
- grub_emu-commands_search.o: commands/search.c
--      $(BUILD_CC) -Icommands -I$(srcdir)/commands $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
-+      $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
- grub_emu-commands_search.d: commands/search.c
--      set -e;           $(BUILD_CC) -Icommands -I$(srcdir)/commands $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,search\.o[ :]*,grub_emu-commands_search.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,search\.o[ :]*,grub_emu-commands_search.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
- -include grub_emu-commands_search.d
- grub_emu-commands_terminal.o: commands/terminal.c
--      $(BUILD_CC) -Icommands -I$(srcdir)/commands $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
-+      $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
- grub_emu-commands_terminal.d: commands/terminal.c
--      set -e;           $(BUILD_CC) -Icommands -I$(srcdir)/commands $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,terminal\.o[ :]*,grub_emu-commands_terminal.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,terminal\.o[ :]*,grub_emu-commands_terminal.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
- -include grub_emu-commands_terminal.d
- grub_emu-commands_test.o: commands/test.c
--      $(BUILD_CC) -Icommands -I$(srcdir)/commands $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
-+      $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
- grub_emu-commands_test.d: commands/test.c
--      set -e;           $(BUILD_CC) -Icommands -I$(srcdir)/commands $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,test\.o[ :]*,grub_emu-commands_test.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,test\.o[ :]*,grub_emu-commands_test.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
- -include grub_emu-commands_test.d
- grub_emu-commands_ls.o: commands/ls.c
--      $(BUILD_CC) -Icommands -I$(srcdir)/commands $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
-+      $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
- grub_emu-commands_ls.d: commands/ls.c
--      set -e;           $(BUILD_CC) -Icommands -I$(srcdir)/commands $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,ls\.o[ :]*,grub_emu-commands_ls.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,ls\.o[ :]*,grub_emu-commands_ls.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
- -include grub_emu-commands_ls.d
--grub_emu-commands_timeout.o: commands/timeout.c
--      $(BUILD_CC) -Icommands -I$(srcdir)/commands $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
-+grub_emu-commands_blocklist.o: commands/blocklist.c
-+      $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
--grub_emu-commands_timeout.d: commands/timeout.c
--      set -e;           $(BUILD_CC) -Icommands -I$(srcdir)/commands $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,timeout\.o[ :]*,grub_emu-commands_timeout.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
-+grub_emu-commands_blocklist.d: commands/blocklist.c
-+      set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,blocklist\.o[ :]*,grub_emu-commands_blocklist.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
---include grub_emu-commands_timeout.d
-+-include grub_emu-commands_blocklist.d
- grub_emu-commands_ieee1275_halt.o: commands/ieee1275/halt.c
--      $(BUILD_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
-+      $(CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
- grub_emu-commands_ieee1275_halt.d: commands/ieee1275/halt.c
--      set -e;           $(BUILD_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<          | sed 's,halt\.o[ :]*,grub_emu-commands_ieee1275_halt.o $@ : ,g' > $@;          [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,halt\.o[ :]*,grub_emu-commands_ieee1275_halt.o $@ : ,g' > $@;          [ -s $@ ] || rm -f $@
- -include grub_emu-commands_ieee1275_halt.d
- grub_emu-commands_ieee1275_reboot.o: commands/ieee1275/reboot.c
--      $(BUILD_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
-+      $(CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
- grub_emu-commands_ieee1275_reboot.d: commands/ieee1275/reboot.c
--      set -e;           $(BUILD_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<          | sed 's,reboot\.o[ :]*,grub_emu-commands_ieee1275_reboot.o $@ : ,g' > $@;      [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,reboot\.o[ :]*,grub_emu-commands_ieee1275_reboot.o $@ : ,g' > $@;      [ -s $@ ] || rm -f $@
- -include grub_emu-commands_ieee1275_reboot.d
- grub_emu-disk_loopback.o: disk/loopback.c
--      $(BUILD_CC) -Idisk -I$(srcdir)/disk $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
-+      $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
- grub_emu-disk_loopback.d: disk/loopback.c
--      set -e;           $(BUILD_CC) -Idisk -I$(srcdir)/disk $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,loopback\.o[ :]*,grub_emu-disk_loopback.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,loopback\.o[ :]*,grub_emu-disk_loopback.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
- -include grub_emu-disk_loopback.d
- grub_emu-fs_affs.o: fs/affs.c
--      $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
-+      $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
- grub_emu-fs_affs.d: fs/affs.c
--      set -e;           $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,affs\.o[ :]*,grub_emu-fs_affs.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<          | sed 's,affs\.o[ :]*,grub_emu-fs_affs.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
- -include grub_emu-fs_affs.d
- grub_emu-fs_ext2.o: fs/ext2.c
--      $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
-+      $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
- grub_emu-fs_ext2.d: fs/ext2.c
--      set -e;           $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,ext2\.o[ :]*,grub_emu-fs_ext2.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<          | sed 's,ext2\.o[ :]*,grub_emu-fs_ext2.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
- -include grub_emu-fs_ext2.d
- grub_emu-fs_fat.o: fs/fat.c
--      $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
-+      $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
- grub_emu-fs_fat.d: fs/fat.c
--      set -e;           $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,fat\.o[ :]*,grub_emu-fs_fat.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<          | sed 's,fat\.o[ :]*,grub_emu-fs_fat.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
- -include grub_emu-fs_fat.d
- grub_emu-fs_fshelp.o: fs/fshelp.c
--      $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
-+      $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
- grub_emu-fs_fshelp.d: fs/fshelp.c
--      set -e;           $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,fshelp\.o[ :]*,grub_emu-fs_fshelp.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<          | sed 's,fshelp\.o[ :]*,grub_emu-fs_fshelp.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
- -include grub_emu-fs_fshelp.d
- grub_emu-fs_hfs.o: fs/hfs.c
--      $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
-+      $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
- grub_emu-fs_hfs.d: fs/hfs.c
--      set -e;           $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,hfs\.o[ :]*,grub_emu-fs_hfs.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<          | sed 's,hfs\.o[ :]*,grub_emu-fs_hfs.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
- -include grub_emu-fs_hfs.d
- grub_emu-fs_iso9660.o: fs/iso9660.c
--      $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
-+      $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
- grub_emu-fs_iso9660.d: fs/iso9660.c
--      set -e;           $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,iso9660\.o[ :]*,grub_emu-fs_iso9660.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<          | sed 's,iso9660\.o[ :]*,grub_emu-fs_iso9660.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
- -include grub_emu-fs_iso9660.d
- grub_emu-fs_jfs.o: fs/jfs.c
--      $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
-+      $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
- grub_emu-fs_jfs.d: fs/jfs.c
--      set -e;           $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,jfs\.o[ :]*,grub_emu-fs_jfs.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<          | sed 's,jfs\.o[ :]*,grub_emu-fs_jfs.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
- -include grub_emu-fs_jfs.d
- grub_emu-fs_minix.o: fs/minix.c
--      $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
-+      $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
- grub_emu-fs_minix.d: fs/minix.c
--      set -e;           $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,minix\.o[ :]*,grub_emu-fs_minix.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<          | sed 's,minix\.o[ :]*,grub_emu-fs_minix.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
- -include grub_emu-fs_minix.d
- grub_emu-fs_sfs.o: fs/sfs.c
--      $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
-+      $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
- grub_emu-fs_sfs.d: fs/sfs.c
--      set -e;           $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,sfs\.o[ :]*,grub_emu-fs_sfs.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<          | sed 's,sfs\.o[ :]*,grub_emu-fs_sfs.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
- -include grub_emu-fs_sfs.d
- grub_emu-fs_ufs.o: fs/ufs.c
--      $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
-+      $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
- grub_emu-fs_ufs.d: fs/ufs.c
--      set -e;           $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,ufs\.o[ :]*,grub_emu-fs_ufs.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<          | sed 's,ufs\.o[ :]*,grub_emu-fs_ufs.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
- -include grub_emu-fs_ufs.d
- grub_emu-fs_xfs.o: fs/xfs.c
--      $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
-+      $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
- grub_emu-fs_xfs.d: fs/xfs.c
--      set -e;           $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,xfs\.o[ :]*,grub_emu-fs_xfs.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<          | sed 's,xfs\.o[ :]*,grub_emu-fs_xfs.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
- -include grub_emu-fs_xfs.d
- grub_emu-fs_hfsplus.o: fs/hfsplus.c
--      $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
-+      $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
- grub_emu-fs_hfsplus.d: fs/hfsplus.c
--      set -e;           $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,hfsplus\.o[ :]*,grub_emu-fs_hfsplus.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<          | sed 's,hfsplus\.o[ :]*,grub_emu-fs_hfsplus.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
- -include grub_emu-fs_hfsplus.d
- grub_emu-io_gzio.o: io/gzio.c
--      $(BUILD_CC) -Iio -I$(srcdir)/io $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
-+      $(CC) -Iio -I$(srcdir)/io $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
- grub_emu-io_gzio.d: io/gzio.c
--      set -e;           $(BUILD_CC) -Iio -I$(srcdir)/io $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,gzio\.o[ :]*,grub_emu-io_gzio.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Iio -I$(srcdir)/io $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<          | sed 's,gzio\.o[ :]*,grub_emu-io_gzio.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
- -include grub_emu-io_gzio.d
- grub_emu-kern_device.o: kern/device.c
--      $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
-+      $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
- grub_emu-kern_device.d: kern/device.c
--      set -e;           $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,device\.o[ :]*,grub_emu-kern_device.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,device\.o[ :]*,grub_emu-kern_device.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
- -include grub_emu-kern_device.d
- grub_emu-kern_disk.o: kern/disk.c
--      $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
-+      $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
- grub_emu-kern_disk.d: kern/disk.c
--      set -e;           $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,disk\.o[ :]*,grub_emu-kern_disk.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,disk\.o[ :]*,grub_emu-kern_disk.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
- -include grub_emu-kern_disk.d
- grub_emu-kern_dl.o: kern/dl.c
--      $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
-+      $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
- grub_emu-kern_dl.d: kern/dl.c
--      set -e;           $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,dl\.o[ :]*,grub_emu-kern_dl.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,dl\.o[ :]*,grub_emu-kern_dl.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
- -include grub_emu-kern_dl.d
- grub_emu-kern_env.o: kern/env.c
--      $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
-+      $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
- grub_emu-kern_env.d: kern/env.c
--      set -e;           $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,env\.o[ :]*,grub_emu-kern_env.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,env\.o[ :]*,grub_emu-kern_env.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
- -include grub_emu-kern_env.d
- grub_emu-kern_err.o: kern/err.c
--      $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
-+      $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
- grub_emu-kern_err.d: kern/err.c
--      set -e;           $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,err\.o[ :]*,grub_emu-kern_err.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,err\.o[ :]*,grub_emu-kern_err.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
- -include grub_emu-kern_err.d
- grub_emu-kern_file.o: kern/file.c
--      $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
-+      $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
- grub_emu-kern_file.d: kern/file.c
--      set -e;           $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,file\.o[ :]*,grub_emu-kern_file.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,file\.o[ :]*,grub_emu-kern_file.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
- -include grub_emu-kern_file.d
- grub_emu-kern_fs.o: kern/fs.c
--      $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
-+      $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
- grub_emu-kern_fs.d: kern/fs.c
--      set -e;           $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,fs\.o[ :]*,grub_emu-kern_fs.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,fs\.o[ :]*,grub_emu-kern_fs.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
- -include grub_emu-kern_fs.d
- grub_emu-kern_loader.o: kern/loader.c
--      $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
-+      $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
- grub_emu-kern_loader.d: kern/loader.c
--      set -e;           $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,loader\.o[ :]*,grub_emu-kern_loader.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,loader\.o[ :]*,grub_emu-kern_loader.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
- -include grub_emu-kern_loader.d
- grub_emu-kern_main.o: kern/main.c
--      $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
-+      $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
- grub_emu-kern_main.d: kern/main.c
--      set -e;           $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,main\.o[ :]*,grub_emu-kern_main.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,main\.o[ :]*,grub_emu-kern_main.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
- -include grub_emu-kern_main.d
- grub_emu-kern_misc.o: kern/misc.c
--      $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
-+      $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
- grub_emu-kern_misc.d: kern/misc.c
--      set -e;           $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,misc\.o[ :]*,grub_emu-kern_misc.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,misc\.o[ :]*,grub_emu-kern_misc.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
- -include grub_emu-kern_misc.d
- grub_emu-kern_parser.o: kern/parser.c
--      $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
-+      $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
- grub_emu-kern_parser.d: kern/parser.c
--      set -e;           $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,parser\.o[ :]*,grub_emu-kern_parser.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,parser\.o[ :]*,grub_emu-kern_parser.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
- -include grub_emu-kern_parser.d
- grub_emu-kern_partition.o: kern/partition.c
--      $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
-+      $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
- grub_emu-kern_partition.d: kern/partition.c
--      set -e;           $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,partition\.o[ :]*,grub_emu-kern_partition.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,partition\.o[ :]*,grub_emu-kern_partition.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
- -include grub_emu-kern_partition.d
- grub_emu-kern_rescue.o: kern/rescue.c
--      $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
-+      $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
- grub_emu-kern_rescue.d: kern/rescue.c
--      set -e;           $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,rescue\.o[ :]*,grub_emu-kern_rescue.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,rescue\.o[ :]*,grub_emu-kern_rescue.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
- -include grub_emu-kern_rescue.d
- grub_emu-kern_term.o: kern/term.c
--      $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
-+      $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
- grub_emu-kern_term.d: kern/term.c
--      set -e;           $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,term\.o[ :]*,grub_emu-kern_term.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,term\.o[ :]*,grub_emu-kern_term.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
- -include grub_emu-kern_term.d
- grub_emu-normal_arg.o: normal/arg.c
--      $(BUILD_CC) -Inormal -I$(srcdir)/normal $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
-+      $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
- grub_emu-normal_arg.d: normal/arg.c
--      set -e;           $(BUILD_CC) -Inormal -I$(srcdir)/normal $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,arg\.o[ :]*,grub_emu-normal_arg.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<          | sed 's,arg\.o[ :]*,grub_emu-normal_arg.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
- -include grub_emu-normal_arg.d
- grub_emu-normal_cmdline.o: normal/cmdline.c
--      $(BUILD_CC) -Inormal -I$(srcdir)/normal $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
-+      $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
- grub_emu-normal_cmdline.d: normal/cmdline.c
--      set -e;           $(BUILD_CC) -Inormal -I$(srcdir)/normal $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,cmdline\.o[ :]*,grub_emu-normal_cmdline.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<          | sed 's,cmdline\.o[ :]*,grub_emu-normal_cmdline.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
- -include grub_emu-normal_cmdline.d
- grub_emu-normal_command.o: normal/command.c
--      $(BUILD_CC) -Inormal -I$(srcdir)/normal $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
-+      $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
- grub_emu-normal_command.d: normal/command.c
--      set -e;           $(BUILD_CC) -Inormal -I$(srcdir)/normal $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,command\.o[ :]*,grub_emu-normal_command.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<          | sed 's,command\.o[ :]*,grub_emu-normal_command.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
- -include grub_emu-normal_command.d
- grub_emu-normal_completion.o: normal/completion.c
--      $(BUILD_CC) -Inormal -I$(srcdir)/normal $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
-+      $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
- grub_emu-normal_completion.d: normal/completion.c
--      set -e;           $(BUILD_CC) -Inormal -I$(srcdir)/normal $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,completion\.o[ :]*,grub_emu-normal_completion.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<          | sed 's,completion\.o[ :]*,grub_emu-normal_completion.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
- -include grub_emu-normal_completion.d
--grub_emu-normal_context.o: normal/context.c
--      $(BUILD_CC) -Inormal -I$(srcdir)/normal $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
--
--grub_emu-normal_context.d: normal/context.c
--      set -e;           $(BUILD_CC) -Inormal -I$(srcdir)/normal $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,context\.o[ :]*,grub_emu-normal_context.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
--
---include grub_emu-normal_context.d
--
- grub_emu-normal_execute.o: normal/execute.c
--      $(BUILD_CC) -Inormal -I$(srcdir)/normal $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
-+      $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
- grub_emu-normal_execute.d: normal/execute.c
--      set -e;           $(BUILD_CC) -Inormal -I$(srcdir)/normal $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,execute\.o[ :]*,grub_emu-normal_execute.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<          | sed 's,execute\.o[ :]*,grub_emu-normal_execute.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
- -include grub_emu-normal_execute.d
- grub_emu-normal_function.o: normal/function.c
--      $(BUILD_CC) -Inormal -I$(srcdir)/normal $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
-+      $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
- grub_emu-normal_function.d: normal/function.c
--      set -e;           $(BUILD_CC) -Inormal -I$(srcdir)/normal $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,function\.o[ :]*,grub_emu-normal_function.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<          | sed 's,function\.o[ :]*,grub_emu-normal_function.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
- -include grub_emu-normal_function.d
- grub_emu-normal_lexer.o: normal/lexer.c
--      $(BUILD_CC) -Inormal -I$(srcdir)/normal $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
-+      $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
- grub_emu-normal_lexer.d: normal/lexer.c
--      set -e;           $(BUILD_CC) -Inormal -I$(srcdir)/normal $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,lexer\.o[ :]*,grub_emu-normal_lexer.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<          | sed 's,lexer\.o[ :]*,grub_emu-normal_lexer.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
- -include grub_emu-normal_lexer.d
- grub_emu-normal_main.o: normal/main.c
--      $(BUILD_CC) -Inormal -I$(srcdir)/normal $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
-+      $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
- grub_emu-normal_main.d: normal/main.c
--      set -e;           $(BUILD_CC) -Inormal -I$(srcdir)/normal $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,main\.o[ :]*,grub_emu-normal_main.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<          | sed 's,main\.o[ :]*,grub_emu-normal_main.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
- -include grub_emu-normal_main.d
- grub_emu-normal_menu.o: normal/menu.c
--      $(BUILD_CC) -Inormal -I$(srcdir)/normal $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
-+      $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
- grub_emu-normal_menu.d: normal/menu.c
--      set -e;           $(BUILD_CC) -Inormal -I$(srcdir)/normal $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,menu\.o[ :]*,grub_emu-normal_menu.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<          | sed 's,menu\.o[ :]*,grub_emu-normal_menu.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
- -include grub_emu-normal_menu.d
- grub_emu-normal_menu_entry.o: normal/menu_entry.c
--      $(BUILD_CC) -Inormal -I$(srcdir)/normal $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
-+      $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
- grub_emu-normal_menu_entry.d: normal/menu_entry.c
--      set -e;           $(BUILD_CC) -Inormal -I$(srcdir)/normal $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,menu_entry\.o[ :]*,grub_emu-normal_menu_entry.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<          | sed 's,menu_entry\.o[ :]*,grub_emu-normal_menu_entry.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
- -include grub_emu-normal_menu_entry.d
- grub_emu-normal_misc.o: normal/misc.c
--      $(BUILD_CC) -Inormal -I$(srcdir)/normal $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
-+      $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
- grub_emu-normal_misc.d: normal/misc.c
--      set -e;           $(BUILD_CC) -Inormal -I$(srcdir)/normal $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,misc\.o[ :]*,grub_emu-normal_misc.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<          | sed 's,misc\.o[ :]*,grub_emu-normal_misc.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
- -include grub_emu-normal_misc.d
- grub_emu-normal_script.o: normal/script.c
--      $(BUILD_CC) -Inormal -I$(srcdir)/normal $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
-+      $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
- grub_emu-normal_script.d: normal/script.c
--      set -e;           $(BUILD_CC) -Inormal -I$(srcdir)/normal $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,script\.o[ :]*,grub_emu-normal_script.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<          | sed 's,script\.o[ :]*,grub_emu-normal_script.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
- -include grub_emu-normal_script.d
- grub_emu-partmap_amiga.o: partmap/amiga.c
--      $(BUILD_CC) -Ipartmap -I$(srcdir)/partmap $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
-+      $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
- grub_emu-partmap_amiga.d: partmap/amiga.c
--      set -e;           $(BUILD_CC) -Ipartmap -I$(srcdir)/partmap $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,amiga\.o[ :]*,grub_emu-partmap_amiga.o $@ : ,g' > $@;          [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,amiga\.o[ :]*,grub_emu-partmap_amiga.o $@ : ,g' > $@;          [ -s $@ ] || rm -f $@
- -include grub_emu-partmap_amiga.d
- grub_emu-partmap_apple.o: partmap/apple.c
--      $(BUILD_CC) -Ipartmap -I$(srcdir)/partmap $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
-+      $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
- grub_emu-partmap_apple.d: partmap/apple.c
--      set -e;           $(BUILD_CC) -Ipartmap -I$(srcdir)/partmap $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,apple\.o[ :]*,grub_emu-partmap_apple.o $@ : ,g' > $@;          [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,apple\.o[ :]*,grub_emu-partmap_apple.o $@ : ,g' > $@;          [ -s $@ ] || rm -f $@
- -include grub_emu-partmap_apple.d
- grub_emu-partmap_pc.o: partmap/pc.c
--      $(BUILD_CC) -Ipartmap -I$(srcdir)/partmap $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
-+      $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
- grub_emu-partmap_pc.d: partmap/pc.c
--      set -e;           $(BUILD_CC) -Ipartmap -I$(srcdir)/partmap $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,pc\.o[ :]*,grub_emu-partmap_pc.o $@ : ,g' > $@;        [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,pc\.o[ :]*,grub_emu-partmap_pc.o $@ : ,g' > $@;        [ -s $@ ] || rm -f $@
- -include grub_emu-partmap_pc.d
- grub_emu-partmap_sun.o: partmap/sun.c
--      $(BUILD_CC) -Ipartmap -I$(srcdir)/partmap $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
-+      $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
- grub_emu-partmap_sun.d: partmap/sun.c
--      set -e;           $(BUILD_CC) -Ipartmap -I$(srcdir)/partmap $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,sun\.o[ :]*,grub_emu-partmap_sun.o $@ : ,g' > $@;      [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,sun\.o[ :]*,grub_emu-partmap_sun.o $@ : ,g' > $@;      [ -s $@ ] || rm -f $@
- -include grub_emu-partmap_sun.d
- grub_emu-partmap_acorn.o: partmap/acorn.c
--      $(BUILD_CC) -Ipartmap -I$(srcdir)/partmap $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
-+      $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
- grub_emu-partmap_acorn.d: partmap/acorn.c
--      set -e;           $(BUILD_CC) -Ipartmap -I$(srcdir)/partmap $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,acorn\.o[ :]*,grub_emu-partmap_acorn.o $@ : ,g' > $@;          [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,acorn\.o[ :]*,grub_emu-partmap_acorn.o $@ : ,g' > $@;          [ -s $@ ] || rm -f $@
- -include grub_emu-partmap_acorn.d
- grub_emu-util_console.o: util/console.c
--      $(BUILD_CC) -Iutil -I$(srcdir)/util $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
-+      $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
- grub_emu-util_console.d: util/console.c
--      set -e;           $(BUILD_CC) -Iutil -I$(srcdir)/util $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,console\.o[ :]*,grub_emu-util_console.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,console\.o[ :]*,grub_emu-util_console.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
- -include grub_emu-util_console.d
- grub_emu-util_grub_emu.o: util/grub-emu.c
--      $(BUILD_CC) -Iutil -I$(srcdir)/util $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
-+      $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
- grub_emu-util_grub_emu.d: util/grub-emu.c
--      set -e;           $(BUILD_CC) -Iutil -I$(srcdir)/util $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,grub\-emu\.o[ :]*,grub_emu-util_grub_emu.o $@ : ,g' > $@;      [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,grub\-emu\.o[ :]*,grub_emu-util_grub_emu.o $@ : ,g' > $@;      [ -s $@ ] || rm -f $@
- -include grub_emu-util_grub_emu.d
- grub_emu-util_misc.o: util/misc.c
--      $(BUILD_CC) -Iutil -I$(srcdir)/util $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
-+      $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
- grub_emu-util_misc.d: util/misc.c
--      set -e;           $(BUILD_CC) -Iutil -I$(srcdir)/util $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,misc\.o[ :]*,grub_emu-util_misc.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,misc\.o[ :]*,grub_emu-util_misc.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
- -include grub_emu-util_misc.d
- grub_emu-util_i386_pc_biosdisk.o: util/i386/pc/biosdisk.c
--      $(BUILD_CC) -Iutil/i386/pc -I$(srcdir)/util/i386/pc $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
-+      $(CC) -Iutil/i386/pc -I$(srcdir)/util/i386/pc $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
- grub_emu-util_i386_pc_biosdisk.d: util/i386/pc/biosdisk.c
--      set -e;           $(BUILD_CC) -Iutil/i386/pc -I$(srcdir)/util/i386/pc $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,biosdisk\.o[ :]*,grub_emu-util_i386_pc_biosdisk.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Iutil/i386/pc -I$(srcdir)/util/i386/pc $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,biosdisk\.o[ :]*,grub_emu-util_i386_pc_biosdisk.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
- -include grub_emu-util_i386_pc_biosdisk.d
- grub_emu-util_i386_pc_getroot.o: util/i386/pc/getroot.c
--      $(BUILD_CC) -Iutil/i386/pc -I$(srcdir)/util/i386/pc $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
-+      $(CC) -Iutil/i386/pc -I$(srcdir)/util/i386/pc $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
- grub_emu-util_i386_pc_getroot.d: util/i386/pc/getroot.c
--      set -e;           $(BUILD_CC) -Iutil/i386/pc -I$(srcdir)/util/i386/pc $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,getroot\.o[ :]*,grub_emu-util_i386_pc_getroot.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Iutil/i386/pc -I$(srcdir)/util/i386/pc $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,getroot\.o[ :]*,grub_emu-util_i386_pc_getroot.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
- -include grub_emu-util_i386_pc_getroot.d
- grub_emu-util_powerpc_ieee1275_misc.o: util/powerpc/ieee1275/misc.c
--      $(BUILD_CC) -Iutil/powerpc/ieee1275 -I$(srcdir)/util/powerpc/ieee1275 $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
-+      $(CC) -Iutil/powerpc/ieee1275 -I$(srcdir)/util/powerpc/ieee1275 $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
- grub_emu-util_powerpc_ieee1275_misc.d: util/powerpc/ieee1275/misc.c
--      set -e;           $(BUILD_CC) -Iutil/powerpc/ieee1275 -I$(srcdir)/util/powerpc/ieee1275 $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<          | sed 's,misc\.o[ :]*,grub_emu-util_powerpc_ieee1275_misc.o $@ : ,g' > $@;      [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -Iutil/powerpc/ieee1275 -I$(srcdir)/util/powerpc/ieee1275 $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,misc\.o[ :]*,grub_emu-util_powerpc_ieee1275_misc.o $@ : ,g' > $@;      [ -s $@ ] || rm -f $@
- -include grub_emu-util_powerpc_ieee1275_misc.d
- grub_emu-grub_script_tab.o: grub_script.tab.c
--      $(BUILD_CC) -I. -I$(srcdir)/. $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
-+      $(CC) -I. -I$(srcdir)/. $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
- grub_emu-grub_script_tab.d: grub_script.tab.c
--      set -e;           $(BUILD_CC) -I. -I$(srcdir)/. $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<          | sed 's,grub_script\.tab\.o[ :]*,grub_emu-grub_script_tab.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -I. -I$(srcdir)/. $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,grub_script\.tab\.o[ :]*,grub_emu-grub_script_tab.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
- -include grub_emu-grub_script_tab.d
- grub_emu-grub_emu_init.o: grub_emu_init.c
--      $(BUILD_CC) -I. -I$(srcdir)/. $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
-+      $(CC) -I. -I$(srcdir)/. $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
- grub_emu-grub_emu_init.d: grub_emu_init.c
--      set -e;           $(BUILD_CC) -I. -I$(srcdir)/. $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<          | sed 's,grub_emu_init\.o[ :]*,grub_emu-grub_emu_init.o $@ : ,g' > $@;          [ -s $@ ] || rm -f $@
-+      set -e;           $(CC) -I. -I$(srcdir)/. $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,grub_emu_init\.o[ :]*,grub_emu-grub_emu_init.o $@ : ,g' > $@;          [ -s $@ ] || rm -f $@
- -include grub_emu-grub_emu_init.d
- grub_emu_LDFLAGS = $(LIBCURSES)
--grubof_SOURCES = kern/powerpc/ieee1275/crt0.S kern/powerpc/ieee1275/cmain.c \
-+kernel_elf_SOURCES = kern/powerpc/ieee1275/crt0.S kern/powerpc/ieee1275/cmain.c \
-       kern/ieee1275/ieee1275.c kern/main.c kern/device.c              \
-       kern/disk.c kern/dl.c kern/file.c kern/fs.c kern/err.c          \
-       kern/misc.c kern/mm.c kern/loader.c kern/rescue.c kern/term.c   \
-       kern/powerpc/ieee1275/init.c term/ieee1275/ofconsole.c          \
-       kern/powerpc/ieee1275/openfw.c disk/ieee1275/ofdisk.c           \
-       kern/parser.c kern/partition.c kern/env.c kern/powerpc/dl.c     \
--      grubof_symlist.c kern/powerpc/cache.S
--CLEANFILES += grubof grubof-kern_powerpc_ieee1275_crt0.o grubof-kern_powerpc_ieee1275_cmain.o grubof-kern_ieee1275_ieee1275.o grubof-kern_main.o grubof-kern_device.o grubof-kern_disk.o grubof-kern_dl.o grubof-kern_file.o grubof-kern_fs.o grubof-kern_err.o grubof-kern_misc.o grubof-kern_mm.o grubof-kern_loader.o grubof-kern_rescue.o grubof-kern_term.o grubof-kern_powerpc_ieee1275_init.o grubof-term_ieee1275_ofconsole.o grubof-kern_powerpc_ieee1275_openfw.o grubof-disk_ieee1275_ofdisk.o grubof-kern_parser.o grubof-kern_partition.o grubof-kern_env.o grubof-kern_powerpc_dl.o grubof-grubof_symlist.o grubof-kern_powerpc_cache.o
--MOSTLYCLEANFILES += grubof-kern_powerpc_ieee1275_crt0.d grubof-kern_powerpc_ieee1275_cmain.d grubof-kern_ieee1275_ieee1275.d grubof-kern_main.d grubof-kern_device.d grubof-kern_disk.d grubof-kern_dl.d grubof-kern_file.d grubof-kern_fs.d grubof-kern_err.d grubof-kern_misc.d grubof-kern_mm.d grubof-kern_loader.d grubof-kern_rescue.d grubof-kern_term.d grubof-kern_powerpc_ieee1275_init.d grubof-term_ieee1275_ofconsole.d grubof-kern_powerpc_ieee1275_openfw.d grubof-disk_ieee1275_ofdisk.d grubof-kern_parser.d grubof-kern_partition.d grubof-kern_env.d grubof-kern_powerpc_dl.d grubof-grubof_symlist.d grubof-kern_powerpc_cache.d
--
--grubof: grubof-kern_powerpc_ieee1275_crt0.o grubof-kern_powerpc_ieee1275_cmain.o grubof-kern_ieee1275_ieee1275.o grubof-kern_main.o grubof-kern_device.o grubof-kern_disk.o grubof-kern_dl.o grubof-kern_file.o grubof-kern_fs.o grubof-kern_err.o grubof-kern_misc.o grubof-kern_mm.o grubof-kern_loader.o grubof-kern_rescue.o grubof-kern_term.o grubof-kern_powerpc_ieee1275_init.o grubof-term_ieee1275_ofconsole.o grubof-kern_powerpc_ieee1275_openfw.o grubof-disk_ieee1275_ofdisk.o grubof-kern_parser.o grubof-kern_partition.o grubof-kern_env.o grubof-kern_powerpc_dl.o grubof-grubof_symlist.o grubof-kern_powerpc_cache.o
--      $(CC) -o $@ $^ $(LDFLAGS) $(grubof_LDFLAGS)
--
--grubof-kern_powerpc_ieee1275_crt0.o: kern/powerpc/ieee1275/crt0.S
--      $(CC) -Ikern/powerpc/ieee1275 -I$(srcdir)/kern/powerpc/ieee1275 $(CPPFLAGS) $(CFLAGS) $(grubof_CFLAGS) -c -o $@ $<
-+      kernel_elf_symlist.c kern/powerpc/cache.S
-+CLEANFILES += kernel.elf kernel_elf-kern_powerpc_ieee1275_crt0.o kernel_elf-kern_powerpc_ieee1275_cmain.o kernel_elf-kern_ieee1275_ieee1275.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_err.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_powerpc_ieee1275_init.o kernel_elf-term_ieee1275_ofconsole.o kernel_elf-kern_powerpc_ieee1275_openfw.o kernel_elf-disk_ieee1275_ofdisk.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_env.o kernel_elf-kern_powerpc_dl.o kernel_elf-kernel_elf_symlist.o kernel_elf-kern_powerpc_cache.o
-+MOSTLYCLEANFILES += kernel_elf-kern_powerpc_ieee1275_crt0.d kernel_elf-kern_powerpc_ieee1275_cmain.d kernel_elf-kern_ieee1275_ieee1275.d kernel_elf-kern_main.d kernel_elf-kern_device.d kernel_elf-kern_disk.d kernel_elf-kern_dl.d kernel_elf-kern_file.d kernel_elf-kern_fs.d kernel_elf-kern_err.d kernel_elf-kern_misc.d kernel_elf-kern_mm.d kernel_elf-kern_loader.d kernel_elf-kern_rescue.d kernel_elf-kern_term.d kernel_elf-kern_powerpc_ieee1275_init.d kernel_elf-term_ieee1275_ofconsole.d kernel_elf-kern_powerpc_ieee1275_openfw.d kernel_elf-disk_ieee1275_ofdisk.d kernel_elf-kern_parser.d kernel_elf-kern_partition.d kernel_elf-kern_env.d kernel_elf-kern_powerpc_dl.d kernel_elf-kernel_elf_symlist.d kernel_elf-kern_powerpc_cache.d
--grubof-kern_powerpc_ieee1275_crt0.d: kern/powerpc/ieee1275/crt0.S
--      set -e;           $(CC) -Ikern/powerpc/ieee1275 -I$(srcdir)/kern/powerpc/ieee1275 $(CPPFLAGS) $(CFLAGS) $(grubof_CFLAGS) -M $<    | sed 's,crt0\.o[ :]*,grubof-kern_powerpc_ieee1275_crt0.o $@ : ,g' > $@;        [ -s $@ ] || rm -f $@
-+kernel.elf: kernel_elf-kern_powerpc_ieee1275_crt0.o kernel_elf-kern_powerpc_ieee1275_cmain.o kernel_elf-kern_ieee1275_ieee1275.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_err.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_powerpc_ieee1275_init.o kernel_elf-term_ieee1275_ofconsole.o kernel_elf-kern_powerpc_ieee1275_openfw.o kernel_elf-disk_ieee1275_ofdisk.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_env.o kernel_elf-kern_powerpc_dl.o kernel_elf-kernel_elf_symlist.o kernel_elf-kern_powerpc_cache.o
-+      $(TARGET_CC) -o $@ $^ $(TARGET_LDFLAGS) $(kernel_elf_LDFLAGS)
---include grubof-kern_powerpc_ieee1275_crt0.d
-+kernel_elf-kern_powerpc_ieee1275_crt0.o: kern/powerpc/ieee1275/crt0.S
-+      $(TARGET_CC) -Ikern/powerpc/ieee1275 -I$(srcdir)/kern/powerpc/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
--grubof-kern_powerpc_ieee1275_cmain.o: kern/powerpc/ieee1275/cmain.c
--      $(CC) -Ikern/powerpc/ieee1275 -I$(srcdir)/kern/powerpc/ieee1275 $(CPPFLAGS) $(CFLAGS) $(grubof_CFLAGS) -c -o $@ $<
-+kernel_elf-kern_powerpc_ieee1275_crt0.d: kern/powerpc/ieee1275/crt0.S
-+      set -e;           $(TARGET_CC) -Ikern/powerpc/ieee1275 -I$(srcdir)/kern/powerpc/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -M $<           | sed 's,crt0\.o[ :]*,kernel_elf-kern_powerpc_ieee1275_crt0.o $@ : ,g' > $@;    [ -s $@ ] || rm -f $@
--grubof-kern_powerpc_ieee1275_cmain.d: kern/powerpc/ieee1275/cmain.c
--      set -e;           $(CC) -Ikern/powerpc/ieee1275 -I$(srcdir)/kern/powerpc/ieee1275 $(CPPFLAGS) $(CFLAGS) $(grubof_CFLAGS) -M $<    | sed 's,cmain\.o[ :]*,grubof-kern_powerpc_ieee1275_cmain.o $@ : ,g' > $@;      [ -s $@ ] || rm -f $@
-+-include kernel_elf-kern_powerpc_ieee1275_crt0.d
---include grubof-kern_powerpc_ieee1275_cmain.d
-+kernel_elf-kern_powerpc_ieee1275_cmain.o: kern/powerpc/ieee1275/cmain.c
-+      $(TARGET_CC) -Ikern/powerpc/ieee1275 -I$(srcdir)/kern/powerpc/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
--grubof-kern_ieee1275_ieee1275.o: kern/ieee1275/ieee1275.c
--      $(CC) -Ikern/ieee1275 -I$(srcdir)/kern/ieee1275 $(CPPFLAGS) $(CFLAGS) $(grubof_CFLAGS) -c -o $@ $<
-+kernel_elf-kern_powerpc_ieee1275_cmain.d: kern/powerpc/ieee1275/cmain.c
-+      set -e;           $(TARGET_CC) -Ikern/powerpc/ieee1275 -I$(srcdir)/kern/powerpc/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -M $<           | sed 's,cmain\.o[ :]*,kernel_elf-kern_powerpc_ieee1275_cmain.o $@ : ,g' > $@;          [ -s $@ ] || rm -f $@
--grubof-kern_ieee1275_ieee1275.d: kern/ieee1275/ieee1275.c
--      set -e;           $(CC) -Ikern/ieee1275 -I$(srcdir)/kern/ieee1275 $(CPPFLAGS) $(CFLAGS) $(grubof_CFLAGS) -M $<    | sed 's,ieee1275\.o[ :]*,grubof-kern_ieee1275_ieee1275.o $@ : ,g' > $@;        [ -s $@ ] || rm -f $@
-+-include kernel_elf-kern_powerpc_ieee1275_cmain.d
---include grubof-kern_ieee1275_ieee1275.d
-+kernel_elf-kern_ieee1275_ieee1275.o: kern/ieee1275/ieee1275.c
-+      $(TARGET_CC) -Ikern/ieee1275 -I$(srcdir)/kern/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
--grubof-kern_main.o: kern/main.c
--      $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(grubof_CFLAGS) -c -o $@ $<
-+kernel_elf-kern_ieee1275_ieee1275.d: kern/ieee1275/ieee1275.c
-+      set -e;           $(TARGET_CC) -Ikern/ieee1275 -I$(srcdir)/kern/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -M $<           | sed 's,ieee1275\.o[ :]*,kernel_elf-kern_ieee1275_ieee1275.o $@ : ,g' > $@;    [ -s $@ ] || rm -f $@
--grubof-kern_main.d: kern/main.c
--      set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(grubof_CFLAGS) -M $<      | sed 's,main\.o[ :]*,grubof-kern_main.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
-+-include kernel_elf-kern_ieee1275_ieee1275.d
---include grubof-kern_main.d
-+kernel_elf-kern_main.o: kern/main.c
-+      $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
--grubof-kern_device.o: kern/device.c
--      $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(grubof_CFLAGS) -c -o $@ $<
-+kernel_elf-kern_main.d: kern/main.c
-+      set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -M $<     | sed 's,main\.o[ :]*,kernel_elf-kern_main.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
--grubof-kern_device.d: kern/device.c
--      set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(grubof_CFLAGS) -M $<      | sed 's,device\.o[ :]*,grubof-kern_device.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
-+-include kernel_elf-kern_main.d
---include grubof-kern_device.d
-+kernel_elf-kern_device.o: kern/device.c
-+      $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
--grubof-kern_disk.o: kern/disk.c
--      $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(grubof_CFLAGS) -c -o $@ $<
-+kernel_elf-kern_device.d: kern/device.c
-+      set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -M $<     | sed 's,device\.o[ :]*,kernel_elf-kern_device.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
--grubof-kern_disk.d: kern/disk.c
--      set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(grubof_CFLAGS) -M $<      | sed 's,disk\.o[ :]*,grubof-kern_disk.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
-+-include kernel_elf-kern_device.d
---include grubof-kern_disk.d
-+kernel_elf-kern_disk.o: kern/disk.c
-+      $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
--grubof-kern_dl.o: kern/dl.c
--      $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(grubof_CFLAGS) -c -o $@ $<
-+kernel_elf-kern_disk.d: kern/disk.c
-+      set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -M $<     | sed 's,disk\.o[ :]*,kernel_elf-kern_disk.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
--grubof-kern_dl.d: kern/dl.c
--      set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(grubof_CFLAGS) -M $<      | sed 's,dl\.o[ :]*,grubof-kern_dl.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
-+-include kernel_elf-kern_disk.d
---include grubof-kern_dl.d
-+kernel_elf-kern_dl.o: kern/dl.c
-+      $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
--grubof-kern_file.o: kern/file.c
--      $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(grubof_CFLAGS) -c -o $@ $<
-+kernel_elf-kern_dl.d: kern/dl.c
-+      set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -M $<     | sed 's,dl\.o[ :]*,kernel_elf-kern_dl.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
--grubof-kern_file.d: kern/file.c
--      set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(grubof_CFLAGS) -M $<      | sed 's,file\.o[ :]*,grubof-kern_file.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
-+-include kernel_elf-kern_dl.d
---include grubof-kern_file.d
-+kernel_elf-kern_file.o: kern/file.c
-+      $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
--grubof-kern_fs.o: kern/fs.c
--      $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(grubof_CFLAGS) -c -o $@ $<
-+kernel_elf-kern_file.d: kern/file.c
-+      set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -M $<     | sed 's,file\.o[ :]*,kernel_elf-kern_file.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
--grubof-kern_fs.d: kern/fs.c
--      set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(grubof_CFLAGS) -M $<      | sed 's,fs\.o[ :]*,grubof-kern_fs.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
-+-include kernel_elf-kern_file.d
---include grubof-kern_fs.d
-+kernel_elf-kern_fs.o: kern/fs.c
-+      $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
--grubof-kern_err.o: kern/err.c
--      $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(grubof_CFLAGS) -c -o $@ $<
-+kernel_elf-kern_fs.d: kern/fs.c
-+      set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -M $<     | sed 's,fs\.o[ :]*,kernel_elf-kern_fs.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
--grubof-kern_err.d: kern/err.c
--      set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(grubof_CFLAGS) -M $<      | sed 's,err\.o[ :]*,grubof-kern_err.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
-+-include kernel_elf-kern_fs.d
---include grubof-kern_err.d
-+kernel_elf-kern_err.o: kern/err.c
-+      $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
--grubof-kern_misc.o: kern/misc.c
--      $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(grubof_CFLAGS) -c -o $@ $<
-+kernel_elf-kern_err.d: kern/err.c
-+      set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -M $<     | sed 's,err\.o[ :]*,kernel_elf-kern_err.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
--grubof-kern_misc.d: kern/misc.c
--      set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(grubof_CFLAGS) -M $<      | sed 's,misc\.o[ :]*,grubof-kern_misc.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
-+-include kernel_elf-kern_err.d
---include grubof-kern_misc.d
-+kernel_elf-kern_misc.o: kern/misc.c
-+      $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
--grubof-kern_mm.o: kern/mm.c
--      $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(grubof_CFLAGS) -c -o $@ $<
-+kernel_elf-kern_misc.d: kern/misc.c
-+      set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -M $<     | sed 's,misc\.o[ :]*,kernel_elf-kern_misc.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
--grubof-kern_mm.d: kern/mm.c
--      set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(grubof_CFLAGS) -M $<      | sed 's,mm\.o[ :]*,grubof-kern_mm.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
-+-include kernel_elf-kern_misc.d
---include grubof-kern_mm.d
-+kernel_elf-kern_mm.o: kern/mm.c
-+      $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
--grubof-kern_loader.o: kern/loader.c
--      $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(grubof_CFLAGS) -c -o $@ $<
-+kernel_elf-kern_mm.d: kern/mm.c
-+      set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -M $<     | sed 's,mm\.o[ :]*,kernel_elf-kern_mm.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
--grubof-kern_loader.d: kern/loader.c
--      set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(grubof_CFLAGS) -M $<      | sed 's,loader\.o[ :]*,grubof-kern_loader.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
-+-include kernel_elf-kern_mm.d
---include grubof-kern_loader.d
-+kernel_elf-kern_loader.o: kern/loader.c
-+      $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
--grubof-kern_rescue.o: kern/rescue.c
--      $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(grubof_CFLAGS) -c -o $@ $<
-+kernel_elf-kern_loader.d: kern/loader.c
-+      set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -M $<     | sed 's,loader\.o[ :]*,kernel_elf-kern_loader.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
--grubof-kern_rescue.d: kern/rescue.c
--      set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(grubof_CFLAGS) -M $<      | sed 's,rescue\.o[ :]*,grubof-kern_rescue.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
-+-include kernel_elf-kern_loader.d
---include grubof-kern_rescue.d
-+kernel_elf-kern_rescue.o: kern/rescue.c
-+      $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
--grubof-kern_term.o: kern/term.c
--      $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(grubof_CFLAGS) -c -o $@ $<
-+kernel_elf-kern_rescue.d: kern/rescue.c
-+      set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -M $<     | sed 's,rescue\.o[ :]*,kernel_elf-kern_rescue.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
--grubof-kern_term.d: kern/term.c
--      set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(grubof_CFLAGS) -M $<      | sed 's,term\.o[ :]*,grubof-kern_term.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
-+-include kernel_elf-kern_rescue.d
---include grubof-kern_term.d
-+kernel_elf-kern_term.o: kern/term.c
-+      $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
--grubof-kern_powerpc_ieee1275_init.o: kern/powerpc/ieee1275/init.c
--      $(CC) -Ikern/powerpc/ieee1275 -I$(srcdir)/kern/powerpc/ieee1275 $(CPPFLAGS) $(CFLAGS) $(grubof_CFLAGS) -c -o $@ $<
-+kernel_elf-kern_term.d: kern/term.c
-+      set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -M $<     | sed 's,term\.o[ :]*,kernel_elf-kern_term.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
--grubof-kern_powerpc_ieee1275_init.d: kern/powerpc/ieee1275/init.c
--      set -e;           $(CC) -Ikern/powerpc/ieee1275 -I$(srcdir)/kern/powerpc/ieee1275 $(CPPFLAGS) $(CFLAGS) $(grubof_CFLAGS) -M $<    | sed 's,init\.o[ :]*,grubof-kern_powerpc_ieee1275_init.o $@ : ,g' > $@;        [ -s $@ ] || rm -f $@
-+-include kernel_elf-kern_term.d
---include grubof-kern_powerpc_ieee1275_init.d
-+kernel_elf-kern_powerpc_ieee1275_init.o: kern/powerpc/ieee1275/init.c
-+      $(TARGET_CC) -Ikern/powerpc/ieee1275 -I$(srcdir)/kern/powerpc/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
--grubof-term_ieee1275_ofconsole.o: term/ieee1275/ofconsole.c
--      $(CC) -Iterm/ieee1275 -I$(srcdir)/term/ieee1275 $(CPPFLAGS) $(CFLAGS) $(grubof_CFLAGS) -c -o $@ $<
-+kernel_elf-kern_powerpc_ieee1275_init.d: kern/powerpc/ieee1275/init.c
-+      set -e;           $(TARGET_CC) -Ikern/powerpc/ieee1275 -I$(srcdir)/kern/powerpc/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -M $<           | sed 's,init\.o[ :]*,kernel_elf-kern_powerpc_ieee1275_init.o $@ : ,g' > $@;    [ -s $@ ] || rm -f $@
--grubof-term_ieee1275_ofconsole.d: term/ieee1275/ofconsole.c
--      set -e;           $(CC) -Iterm/ieee1275 -I$(srcdir)/term/ieee1275 $(CPPFLAGS) $(CFLAGS) $(grubof_CFLAGS) -M $<    | sed 's,ofconsole\.o[ :]*,grubof-term_ieee1275_ofconsole.o $@ : ,g' > $@;      [ -s $@ ] || rm -f $@
-+-include kernel_elf-kern_powerpc_ieee1275_init.d
---include grubof-term_ieee1275_ofconsole.d
-+kernel_elf-term_ieee1275_ofconsole.o: term/ieee1275/ofconsole.c
-+      $(TARGET_CC) -Iterm/ieee1275 -I$(srcdir)/term/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
--grubof-kern_powerpc_ieee1275_openfw.o: kern/powerpc/ieee1275/openfw.c
--      $(CC) -Ikern/powerpc/ieee1275 -I$(srcdir)/kern/powerpc/ieee1275 $(CPPFLAGS) $(CFLAGS) $(grubof_CFLAGS) -c -o $@ $<
-+kernel_elf-term_ieee1275_ofconsole.d: term/ieee1275/ofconsole.c
-+      set -e;           $(TARGET_CC) -Iterm/ieee1275 -I$(srcdir)/term/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -M $<           | sed 's,ofconsole\.o[ :]*,kernel_elf-term_ieee1275_ofconsole.o $@ : ,g' > $@;          [ -s $@ ] || rm -f $@
--grubof-kern_powerpc_ieee1275_openfw.d: kern/powerpc/ieee1275/openfw.c
--      set -e;           $(CC) -Ikern/powerpc/ieee1275 -I$(srcdir)/kern/powerpc/ieee1275 $(CPPFLAGS) $(CFLAGS) $(grubof_CFLAGS) -M $<    | sed 's,openfw\.o[ :]*,grubof-kern_powerpc_ieee1275_openfw.o $@ : ,g' > $@;    [ -s $@ ] || rm -f $@
-+-include kernel_elf-term_ieee1275_ofconsole.d
---include grubof-kern_powerpc_ieee1275_openfw.d
-+kernel_elf-kern_powerpc_ieee1275_openfw.o: kern/powerpc/ieee1275/openfw.c
-+      $(TARGET_CC) -Ikern/powerpc/ieee1275 -I$(srcdir)/kern/powerpc/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
--grubof-disk_ieee1275_ofdisk.o: disk/ieee1275/ofdisk.c
--      $(CC) -Idisk/ieee1275 -I$(srcdir)/disk/ieee1275 $(CPPFLAGS) $(CFLAGS) $(grubof_CFLAGS) -c -o $@ $<
-+kernel_elf-kern_powerpc_ieee1275_openfw.d: kern/powerpc/ieee1275/openfw.c
-+      set -e;           $(TARGET_CC) -Ikern/powerpc/ieee1275 -I$(srcdir)/kern/powerpc/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -M $<           | sed 's,openfw\.o[ :]*,kernel_elf-kern_powerpc_ieee1275_openfw.o $@ : ,g' > $@;        [ -s $@ ] || rm -f $@
--grubof-disk_ieee1275_ofdisk.d: disk/ieee1275/ofdisk.c
--      set -e;           $(CC) -Idisk/ieee1275 -I$(srcdir)/disk/ieee1275 $(CPPFLAGS) $(CFLAGS) $(grubof_CFLAGS) -M $<    | sed 's,ofdisk\.o[ :]*,grubof-disk_ieee1275_ofdisk.o $@ : ,g' > $@;    [ -s $@ ] || rm -f $@
-+-include kernel_elf-kern_powerpc_ieee1275_openfw.d
---include grubof-disk_ieee1275_ofdisk.d
-+kernel_elf-disk_ieee1275_ofdisk.o: disk/ieee1275/ofdisk.c
-+      $(TARGET_CC) -Idisk/ieee1275 -I$(srcdir)/disk/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
--grubof-kern_parser.o: kern/parser.c
--      $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(grubof_CFLAGS) -c -o $@ $<
-+kernel_elf-disk_ieee1275_ofdisk.d: disk/ieee1275/ofdisk.c
-+      set -e;           $(TARGET_CC) -Idisk/ieee1275 -I$(srcdir)/disk/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -M $<           | sed 's,ofdisk\.o[ :]*,kernel_elf-disk_ieee1275_ofdisk.o $@ : ,g' > $@;        [ -s $@ ] || rm -f $@
--grubof-kern_parser.d: kern/parser.c
--      set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(grubof_CFLAGS) -M $<      | sed 's,parser\.o[ :]*,grubof-kern_parser.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
-+-include kernel_elf-disk_ieee1275_ofdisk.d
---include grubof-kern_parser.d
-+kernel_elf-kern_parser.o: kern/parser.c
-+      $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
--grubof-kern_partition.o: kern/partition.c
--      $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(grubof_CFLAGS) -c -o $@ $<
-+kernel_elf-kern_parser.d: kern/parser.c
-+      set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -M $<     | sed 's,parser\.o[ :]*,kernel_elf-kern_parser.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
--grubof-kern_partition.d: kern/partition.c
--      set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(grubof_CFLAGS) -M $<      | sed 's,partition\.o[ :]*,grubof-kern_partition.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
-+-include kernel_elf-kern_parser.d
---include grubof-kern_partition.d
-+kernel_elf-kern_partition.o: kern/partition.c
-+      $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
--grubof-kern_env.o: kern/env.c
--      $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(grubof_CFLAGS) -c -o $@ $<
-+kernel_elf-kern_partition.d: kern/partition.c
-+      set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -M $<     | sed 's,partition\.o[ :]*,kernel_elf-kern_partition.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
--grubof-kern_env.d: kern/env.c
--      set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(grubof_CFLAGS) -M $<      | sed 's,env\.o[ :]*,grubof-kern_env.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
-+-include kernel_elf-kern_partition.d
---include grubof-kern_env.d
-+kernel_elf-kern_env.o: kern/env.c
-+      $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
--grubof-kern_powerpc_dl.o: kern/powerpc/dl.c
--      $(CC) -Ikern/powerpc -I$(srcdir)/kern/powerpc $(CPPFLAGS) $(CFLAGS) $(grubof_CFLAGS) -c -o $@ $<
-+kernel_elf-kern_env.d: kern/env.c
-+      set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -M $<     | sed 's,env\.o[ :]*,kernel_elf-kern_env.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
--grubof-kern_powerpc_dl.d: kern/powerpc/dl.c
--      set -e;           $(CC) -Ikern/powerpc -I$(srcdir)/kern/powerpc $(CPPFLAGS) $(CFLAGS) $(grubof_CFLAGS) -M $<      | sed 's,dl\.o[ :]*,grubof-kern_powerpc_dl.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
-+-include kernel_elf-kern_env.d
---include grubof-kern_powerpc_dl.d
-+kernel_elf-kern_powerpc_dl.o: kern/powerpc/dl.c
-+      $(TARGET_CC) -Ikern/powerpc -I$(srcdir)/kern/powerpc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
--grubof-grubof_symlist.o: grubof_symlist.c
--      $(CC) -I. -I$(srcdir)/. $(CPPFLAGS) $(CFLAGS) $(grubof_CFLAGS) -c -o $@ $<
-+kernel_elf-kern_powerpc_dl.d: kern/powerpc/dl.c
-+      set -e;           $(TARGET_CC) -Ikern/powerpc -I$(srcdir)/kern/powerpc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -M $<     | sed 's,dl\.o[ :]*,kernel_elf-kern_powerpc_dl.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
--grubof-grubof_symlist.d: grubof_symlist.c
--      set -e;           $(CC) -I. -I$(srcdir)/. $(CPPFLAGS) $(CFLAGS) $(grubof_CFLAGS) -M $<    | sed 's,grubof_symlist\.o[ :]*,grubof-grubof_symlist.o $@ : ,g' > $@;          [ -s $@ ] || rm -f $@
-+-include kernel_elf-kern_powerpc_dl.d
---include grubof-grubof_symlist.d
-+kernel_elf-kernel_elf_symlist.o: kernel_elf_symlist.c
-+      $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
--grubof-kern_powerpc_cache.o: kern/powerpc/cache.S
--      $(CC) -Ikern/powerpc -I$(srcdir)/kern/powerpc $(CPPFLAGS) $(CFLAGS) $(grubof_CFLAGS) -c -o $@ $<
-+kernel_elf-kernel_elf_symlist.d: kernel_elf_symlist.c
-+      set -e;           $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -M $<           | sed 's,kernel_elf_symlist\.o[ :]*,kernel_elf-kernel_elf_symlist.o $@ : ,g' > $@;      [ -s $@ ] || rm -f $@
--grubof-kern_powerpc_cache.d: kern/powerpc/cache.S
--      set -e;           $(CC) -Ikern/powerpc -I$(srcdir)/kern/powerpc $(CPPFLAGS) $(CFLAGS) $(grubof_CFLAGS) -M $<      | sed 's,cache\.o[ :]*,grubof-kern_powerpc_cache.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
-+-include kernel_elf-kernel_elf_symlist.d
---include grubof-kern_powerpc_cache.d
-+kernel_elf-kern_powerpc_cache.o: kern/powerpc/cache.S
-+      $(TARGET_CC) -Ikern/powerpc -I$(srcdir)/kern/powerpc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
--grubof_HEADERS = grub/powerpc/ieee1275/ieee1275.h
--grubof_CFLAGS = $(COMMON_CFLAGS)
--grubof_ASFLAGS = $(COMMON_ASFLAGS)
--grubof_LDFLAGS = -nostdlib -static-libgcc -lgcc -Wl,-N,-S,-Ttext,0x200000,-Bstatic
-+kernel_elf-kern_powerpc_cache.d: kern/powerpc/cache.S
-+      set -e;           $(TARGET_CC) -Ikern/powerpc -I$(srcdir)/kern/powerpc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -M $<     | sed 's,cache\.o[ :]*,kernel_elf-kern_powerpc_cache.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
--# For genmoddep.
--genmoddep_SOURCES = util/genmoddep.c
--CLEANFILES += genmoddep genmoddep-util_genmoddep.o
--MOSTLYCLEANFILES += genmoddep-util_genmoddep.d
--
--genmoddep: genmoddep-util_genmoddep.o
--      $(BUILD_CC) -o $@ $^ $(BUILD_LDFLAGS) $(genmoddep_LDFLAGS)
--
--genmoddep-util_genmoddep.o: util/genmoddep.c
--      $(BUILD_CC) -Iutil -I$(srcdir)/util $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(genmoddep_CFLAGS) -c -o $@ $<
--
--genmoddep-util_genmoddep.d: util/genmoddep.c
--      set -e;           $(BUILD_CC) -Iutil -I$(srcdir)/util $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(genmoddep_CFLAGS) -M $<           | sed 's,genmoddep\.o[ :]*,genmoddep-util_genmoddep.o $@ : ,g' > $@;    [ -s $@ ] || rm -f $@
--
---include genmoddep-util_genmoddep.d
-+-include kernel_elf-kern_powerpc_cache.d
-+kernel_elf_HEADERS = grub/powerpc/ieee1275/ieee1275.h
-+kernel_elf_CFLAGS = $(COMMON_CFLAGS)
-+kernel_elf_ASFLAGS = $(COMMON_ASFLAGS)
-+kernel_elf_LDFLAGS = $(COMMON_LDFLAGS) -static-libgcc -lgcc \
-+      -Wl,-N,-S,-Ttext,0x200000,-Bstatic
- # Scripts.
- sbin_SCRIPTS = grub-install
-@@ -888,38 +856,43 @@
- # For _linux.mod.
- _linux_mod_SOURCES = loader/powerpc/ieee1275/linux.c
--CLEANFILES += _linux.mod mod-_linux.o mod-_linux.c pre-_linux.o _linux_mod-loader_powerpc_ieee1275_linux.o def-_linux.lst und-_linux.lst
--MOSTLYCLEANFILES += _linux_mod-loader_powerpc_ieee1275_linux.d
-+CLEANFILES += _linux.mod mod-_linux.o mod-_linux.c pre-_linux.o _linux_mod-loader_powerpc_ieee1275_linux.o und-_linux.lst
-+ifneq ($(_linux_mod_EXPORTS),no)
-+CLEANFILES += def-_linux.lst
- DEFSYMFILES += def-_linux.lst
-+endif
-+MOSTLYCLEANFILES += _linux_mod-loader_powerpc_ieee1275_linux.d
- UNDSYMFILES += und-_linux.lst
- _linux.mod: pre-_linux.o mod-_linux.o
-       -rm -f $@
--      $(LD) $(_linux_mod_LDFLAGS) $(LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(_linux_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
-       $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
- pre-_linux.o: _linux_mod-loader_powerpc_ieee1275_linux.o
-       -rm -f $@
--      $(LD) $(_linux_mod_LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(_linux_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
- mod-_linux.o: mod-_linux.c
--      $(CC) $(CPPFLAGS) $(CFLAGS) $(_linux_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_linux_mod_CFLAGS) -c -o $@ $<
- mod-_linux.c: moddep.lst genmodsrc.sh
-       sh $(srcdir)/genmodsrc.sh '_linux' $< > $@ || (rm -f $@; exit 1)
-+ifneq ($(_linux_mod_EXPORTS),no)
- def-_linux.lst: pre-_linux.o
-       $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 _linux/' > $@
-+endif
- und-_linux.lst: pre-_linux.o
-       echo '_linux' > $@
-       $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
- _linux_mod-loader_powerpc_ieee1275_linux.o: loader/powerpc/ieee1275/linux.c
--      $(CC) -Iloader/powerpc/ieee1275 -I$(srcdir)/loader/powerpc/ieee1275 $(CPPFLAGS) $(CFLAGS) $(_linux_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Iloader/powerpc/ieee1275 -I$(srcdir)/loader/powerpc/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_linux_mod_CFLAGS) -c -o $@ $<
- _linux_mod-loader_powerpc_ieee1275_linux.d: loader/powerpc/ieee1275/linux.c
--      set -e;           $(CC) -Iloader/powerpc/ieee1275 -I$(srcdir)/loader/powerpc/ieee1275 $(CPPFLAGS) $(CFLAGS) $(_linux_mod_CFLAGS) -M $<    | sed 's,linux\.o[ :]*,_linux_mod-loader_powerpc_ieee1275_linux.o $@ : ,g' > $@;        [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Iloader/powerpc/ieee1275 -I$(srcdir)/loader/powerpc/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_linux_mod_CFLAGS) -M $<       | sed 's,linux\.o[ :]*,_linux_mod-loader_powerpc_ieee1275_linux.o $@ : ,g' > $@;        [ -s $@ ] || rm -f $@
- -include _linux_mod-loader_powerpc_ieee1275_linux.d
-@@ -928,48 +901,54 @@
- FSFILES += fs-_linux_mod-loader_powerpc_ieee1275_linux.lst
- cmd-_linux_mod-loader_powerpc_ieee1275_linux.lst: loader/powerpc/ieee1275/linux.c gencmdlist.sh
--      set -e;           $(CC) -Iloader/powerpc/ieee1275 -I$(srcdir)/loader/powerpc/ieee1275 $(CPPFLAGS) $(CFLAGS) $(_linux_mod_CFLAGS) -E $<    | sh $(srcdir)/gencmdlist.sh _linux > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Iloader/powerpc/ieee1275 -I$(srcdir)/loader/powerpc/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_linux_mod_CFLAGS) -E $<       | sh $(srcdir)/gencmdlist.sh _linux > $@ || (rm -f $@; exit 1)
- fs-_linux_mod-loader_powerpc_ieee1275_linux.lst: loader/powerpc/ieee1275/linux.c genfslist.sh
--      set -e;           $(CC) -Iloader/powerpc/ieee1275 -I$(srcdir)/loader/powerpc/ieee1275 $(CPPFLAGS) $(CFLAGS) $(_linux_mod_CFLAGS) -E $<    | sh $(srcdir)/genfslist.sh _linux > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Iloader/powerpc/ieee1275 -I$(srcdir)/loader/powerpc/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_linux_mod_CFLAGS) -E $<       | sh $(srcdir)/genfslist.sh _linux > $@ || (rm -f $@; exit 1)
- _linux_mod_CFLAGS = $(COMMON_CFLAGS)
-+_linux_mod_LDFLAGS = $(COMMON_LDFLAGS)
- # For linux.mod.
- linux_mod_SOURCES = loader/powerpc/ieee1275/linux_normal.c
--CLEANFILES += linux.mod mod-linux.o mod-linux.c pre-linux.o linux_mod-loader_powerpc_ieee1275_linux_normal.o def-linux.lst und-linux.lst
--MOSTLYCLEANFILES += linux_mod-loader_powerpc_ieee1275_linux_normal.d
-+CLEANFILES += linux.mod mod-linux.o mod-linux.c pre-linux.o linux_mod-loader_powerpc_ieee1275_linux_normal.o und-linux.lst
-+ifneq ($(linux_mod_EXPORTS),no)
-+CLEANFILES += def-linux.lst
- DEFSYMFILES += def-linux.lst
-+endif
-+MOSTLYCLEANFILES += linux_mod-loader_powerpc_ieee1275_linux_normal.d
- UNDSYMFILES += und-linux.lst
- linux.mod: pre-linux.o mod-linux.o
-       -rm -f $@
--      $(LD) $(linux_mod_LDFLAGS) $(LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(linux_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
-       $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
- pre-linux.o: linux_mod-loader_powerpc_ieee1275_linux_normal.o
-       -rm -f $@
--      $(LD) $(linux_mod_LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(linux_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
- mod-linux.o: mod-linux.c
--      $(CC) $(CPPFLAGS) $(CFLAGS) $(linux_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -c -o $@ $<
- mod-linux.c: moddep.lst genmodsrc.sh
-       sh $(srcdir)/genmodsrc.sh 'linux' $< > $@ || (rm -f $@; exit 1)
-+ifneq ($(linux_mod_EXPORTS),no)
- def-linux.lst: pre-linux.o
-       $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 linux/' > $@
-+endif
- und-linux.lst: pre-linux.o
-       echo 'linux' > $@
-       $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
- linux_mod-loader_powerpc_ieee1275_linux_normal.o: loader/powerpc/ieee1275/linux_normal.c
--      $(CC) -Iloader/powerpc/ieee1275 -I$(srcdir)/loader/powerpc/ieee1275 $(CPPFLAGS) $(CFLAGS) $(linux_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Iloader/powerpc/ieee1275 -I$(srcdir)/loader/powerpc/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -c -o $@ $<
- linux_mod-loader_powerpc_ieee1275_linux_normal.d: loader/powerpc/ieee1275/linux_normal.c
--      set -e;           $(CC) -Iloader/powerpc/ieee1275 -I$(srcdir)/loader/powerpc/ieee1275 $(CPPFLAGS) $(CFLAGS) $(linux_mod_CFLAGS) -M $<     | sed 's,linux_normal\.o[ :]*,linux_mod-loader_powerpc_ieee1275_linux_normal.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Iloader/powerpc/ieee1275 -I$(srcdir)/loader/powerpc/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -M $<        | sed 's,linux_normal\.o[ :]*,linux_mod-loader_powerpc_ieee1275_linux_normal.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
- -include linux_mod-loader_powerpc_ieee1275_linux_normal.d
-@@ -978,52 +957,58 @@
- FSFILES += fs-linux_mod-loader_powerpc_ieee1275_linux_normal.lst
- cmd-linux_mod-loader_powerpc_ieee1275_linux_normal.lst: loader/powerpc/ieee1275/linux_normal.c gencmdlist.sh
--      set -e;           $(CC) -Iloader/powerpc/ieee1275 -I$(srcdir)/loader/powerpc/ieee1275 $(CPPFLAGS) $(CFLAGS) $(linux_mod_CFLAGS) -E $<     | sh $(srcdir)/gencmdlist.sh linux > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Iloader/powerpc/ieee1275 -I$(srcdir)/loader/powerpc/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $<        | sh $(srcdir)/gencmdlist.sh linux > $@ || (rm -f $@; exit 1)
- fs-linux_mod-loader_powerpc_ieee1275_linux_normal.lst: loader/powerpc/ieee1275/linux_normal.c genfslist.sh
--      set -e;           $(CC) -Iloader/powerpc/ieee1275 -I$(srcdir)/loader/powerpc/ieee1275 $(CPPFLAGS) $(CFLAGS) $(linux_mod_CFLAGS) -E $<     | sh $(srcdir)/genfslist.sh linux > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Iloader/powerpc/ieee1275 -I$(srcdir)/loader/powerpc/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $<        | sh $(srcdir)/genfslist.sh linux > $@ || (rm -f $@; exit 1)
- linux_mod_CFLAGS = $(COMMON_CFLAGS)
-+linux_mod_LDFLAGS = $(COMMON_LDFLAGS)
- # For normal.mod.
- normal_mod_SOURCES = normal/arg.c normal/cmdline.c normal/command.c   \
--      normal/completion.c normal/context.c normal/execute.c           \
-+      normal/completion.c normal/execute.c                            \
-       normal/function.c normal/lexer.c normal/main.c normal/menu.c    \
-       normal/menu_entry.c normal/misc.c grub_script.tab.c             \
-       normal/script.c normal/powerpc/setjmp.S
--CLEANFILES += normal.mod mod-normal.o mod-normal.c pre-normal.o normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_context.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_powerpc_setjmp.o def-normal.lst und-normal.lst
--MOSTLYCLEANFILES += normal_mod-normal_arg.d normal_mod-normal_cmdline.d normal_mod-normal_command.d normal_mod-normal_completion.d normal_mod-normal_context.d normal_mod-normal_execute.d normal_mod-normal_function.d normal_mod-normal_lexer.d normal_mod-normal_main.d normal_mod-normal_menu.d normal_mod-normal_menu_entry.d normal_mod-normal_misc.d normal_mod-grub_script_tab.d normal_mod-normal_script.d normal_mod-normal_powerpc_setjmp.d
-+CLEANFILES += normal.mod mod-normal.o mod-normal.c pre-normal.o normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_powerpc_setjmp.o und-normal.lst
-+ifneq ($(normal_mod_EXPORTS),no)
-+CLEANFILES += def-normal.lst
- DEFSYMFILES += def-normal.lst
-+endif
-+MOSTLYCLEANFILES += normal_mod-normal_arg.d normal_mod-normal_cmdline.d normal_mod-normal_command.d normal_mod-normal_completion.d normal_mod-normal_execute.d normal_mod-normal_function.d normal_mod-normal_lexer.d normal_mod-normal_main.d normal_mod-normal_menu.d normal_mod-normal_menu_entry.d normal_mod-normal_misc.d normal_mod-grub_script_tab.d normal_mod-normal_script.d normal_mod-normal_powerpc_setjmp.d
- UNDSYMFILES += und-normal.lst
- normal.mod: pre-normal.o mod-normal.o
-       -rm -f $@
--      $(LD) $(normal_mod_LDFLAGS) $(LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(normal_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
-       $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
--pre-normal.o: normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_context.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_powerpc_setjmp.o
-+pre-normal.o: normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_powerpc_setjmp.o
-       -rm -f $@
--      $(LD) $(normal_mod_LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(normal_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
- mod-normal.o: mod-normal.c
--      $(CC) $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
- mod-normal.c: moddep.lst genmodsrc.sh
-       sh $(srcdir)/genmodsrc.sh 'normal' $< > $@ || (rm -f $@; exit 1)
-+ifneq ($(normal_mod_EXPORTS),no)
- def-normal.lst: pre-normal.o
-       $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 normal/' > $@
-+endif
- und-normal.lst: pre-normal.o
-       echo 'normal' > $@
-       $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
- normal_mod-normal_arg.o: normal/arg.c
--      $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
- normal_mod-normal_arg.d: normal/arg.c
--      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -M $<      | sed 's,arg\.o[ :]*,normal_mod-normal_arg.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -M $<         | sed 's,arg\.o[ :]*,normal_mod-normal_arg.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
- -include normal_mod-normal_arg.d
-@@ -1032,17 +1017,17 @@
- FSFILES += fs-normal_mod-normal_arg.lst
- cmd-normal_mod-normal_arg.lst: normal/arg.c gencmdlist.sh
--      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $<         | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
- fs-normal_mod-normal_arg.lst: normal/arg.c genfslist.sh
--      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $<         | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
- normal_mod-normal_cmdline.o: normal/cmdline.c
--      $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
- normal_mod-normal_cmdline.d: normal/cmdline.c
--      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -M $<      | sed 's,cmdline\.o[ :]*,normal_mod-normal_cmdline.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -M $<         | sed 's,cmdline\.o[ :]*,normal_mod-normal_cmdline.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
- -include normal_mod-normal_cmdline.d
-@@ -1051,17 +1036,17 @@
- FSFILES += fs-normal_mod-normal_cmdline.lst
- cmd-normal_mod-normal_cmdline.lst: normal/cmdline.c gencmdlist.sh
--      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $<         | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
- fs-normal_mod-normal_cmdline.lst: normal/cmdline.c genfslist.sh
--      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $<         | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
- normal_mod-normal_command.o: normal/command.c
--      $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
- normal_mod-normal_command.d: normal/command.c
--      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -M $<      | sed 's,command\.o[ :]*,normal_mod-normal_command.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -M $<         | sed 's,command\.o[ :]*,normal_mod-normal_command.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
- -include normal_mod-normal_command.d
-@@ -1070,17 +1055,17 @@
- FSFILES += fs-normal_mod-normal_command.lst
- cmd-normal_mod-normal_command.lst: normal/command.c gencmdlist.sh
--      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $<         | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
- fs-normal_mod-normal_command.lst: normal/command.c genfslist.sh
--      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $<         | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
- normal_mod-normal_completion.o: normal/completion.c
--      $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
- normal_mod-normal_completion.d: normal/completion.c
--      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -M $<      | sed 's,completion\.o[ :]*,normal_mod-normal_completion.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -M $<         | sed 's,completion\.o[ :]*,normal_mod-normal_completion.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
- -include normal_mod-normal_completion.d
-@@ -1089,36 +1074,17 @@
- FSFILES += fs-normal_mod-normal_completion.lst
- cmd-normal_mod-normal_completion.lst: normal/completion.c gencmdlist.sh
--      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $<         | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
- fs-normal_mod-normal_completion.lst: normal/completion.c genfslist.sh
--      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
--
--
--normal_mod-normal_context.o: normal/context.c
--      $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
--
--normal_mod-normal_context.d: normal/context.c
--      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -M $<      | sed 's,context\.o[ :]*,normal_mod-normal_context.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
--
---include normal_mod-normal_context.d
--
--CLEANFILES += cmd-normal_mod-normal_context.lst fs-normal_mod-normal_context.lst
--COMMANDFILES += cmd-normal_mod-normal_context.lst
--FSFILES += fs-normal_mod-normal_context.lst
--
--cmd-normal_mod-normal_context.lst: normal/context.c gencmdlist.sh
--      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
--
--fs-normal_mod-normal_context.lst: normal/context.c genfslist.sh
--      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $<         | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
- normal_mod-normal_execute.o: normal/execute.c
--      $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
- normal_mod-normal_execute.d: normal/execute.c
--      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -M $<      | sed 's,execute\.o[ :]*,normal_mod-normal_execute.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -M $<         | sed 's,execute\.o[ :]*,normal_mod-normal_execute.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
- -include normal_mod-normal_execute.d
-@@ -1127,17 +1093,17 @@
- FSFILES += fs-normal_mod-normal_execute.lst
- cmd-normal_mod-normal_execute.lst: normal/execute.c gencmdlist.sh
--      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $<         | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
- fs-normal_mod-normal_execute.lst: normal/execute.c genfslist.sh
--      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $<         | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
- normal_mod-normal_function.o: normal/function.c
--      $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
- normal_mod-normal_function.d: normal/function.c
--      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -M $<      | sed 's,function\.o[ :]*,normal_mod-normal_function.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -M $<         | sed 's,function\.o[ :]*,normal_mod-normal_function.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
- -include normal_mod-normal_function.d
-@@ -1146,17 +1112,17 @@
- FSFILES += fs-normal_mod-normal_function.lst
- cmd-normal_mod-normal_function.lst: normal/function.c gencmdlist.sh
--      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $<         | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
- fs-normal_mod-normal_function.lst: normal/function.c genfslist.sh
--      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $<         | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
- normal_mod-normal_lexer.o: normal/lexer.c
--      $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
- normal_mod-normal_lexer.d: normal/lexer.c
--      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -M $<      | sed 's,lexer\.o[ :]*,normal_mod-normal_lexer.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -M $<         | sed 's,lexer\.o[ :]*,normal_mod-normal_lexer.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
- -include normal_mod-normal_lexer.d
-@@ -1165,17 +1131,17 @@
- FSFILES += fs-normal_mod-normal_lexer.lst
- cmd-normal_mod-normal_lexer.lst: normal/lexer.c gencmdlist.sh
--      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $<         | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
- fs-normal_mod-normal_lexer.lst: normal/lexer.c genfslist.sh
--      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $<         | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
- normal_mod-normal_main.o: normal/main.c
--      $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
- normal_mod-normal_main.d: normal/main.c
--      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -M $<      | sed 's,main\.o[ :]*,normal_mod-normal_main.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -M $<         | sed 's,main\.o[ :]*,normal_mod-normal_main.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
- -include normal_mod-normal_main.d
-@@ -1184,17 +1150,17 @@
- FSFILES += fs-normal_mod-normal_main.lst
- cmd-normal_mod-normal_main.lst: normal/main.c gencmdlist.sh
--      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $<         | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
- fs-normal_mod-normal_main.lst: normal/main.c genfslist.sh
--      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $<         | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
- normal_mod-normal_menu.o: normal/menu.c
--      $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
- normal_mod-normal_menu.d: normal/menu.c
--      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -M $<      | sed 's,menu\.o[ :]*,normal_mod-normal_menu.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -M $<         | sed 's,menu\.o[ :]*,normal_mod-normal_menu.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
- -include normal_mod-normal_menu.d
-@@ -1203,17 +1169,17 @@
- FSFILES += fs-normal_mod-normal_menu.lst
- cmd-normal_mod-normal_menu.lst: normal/menu.c gencmdlist.sh
--      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $<         | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
- fs-normal_mod-normal_menu.lst: normal/menu.c genfslist.sh
--      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $<         | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
- normal_mod-normal_menu_entry.o: normal/menu_entry.c
--      $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
- normal_mod-normal_menu_entry.d: normal/menu_entry.c
--      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -M $<      | sed 's,menu_entry\.o[ :]*,normal_mod-normal_menu_entry.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -M $<         | sed 's,menu_entry\.o[ :]*,normal_mod-normal_menu_entry.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
- -include normal_mod-normal_menu_entry.d
-@@ -1222,17 +1188,17 @@
- FSFILES += fs-normal_mod-normal_menu_entry.lst
- cmd-normal_mod-normal_menu_entry.lst: normal/menu_entry.c gencmdlist.sh
--      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $<         | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
- fs-normal_mod-normal_menu_entry.lst: normal/menu_entry.c genfslist.sh
--      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $<         | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
- normal_mod-normal_misc.o: normal/misc.c
--      $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
- normal_mod-normal_misc.d: normal/misc.c
--      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -M $<      | sed 's,misc\.o[ :]*,normal_mod-normal_misc.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -M $<         | sed 's,misc\.o[ :]*,normal_mod-normal_misc.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
- -include normal_mod-normal_misc.d
-@@ -1241,17 +1207,17 @@
- FSFILES += fs-normal_mod-normal_misc.lst
- cmd-normal_mod-normal_misc.lst: normal/misc.c gencmdlist.sh
--      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $<         | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
- fs-normal_mod-normal_misc.lst: normal/misc.c genfslist.sh
--      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $<         | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
- normal_mod-grub_script_tab.o: grub_script.tab.c
--      $(CC) -I. -I$(srcdir)/. $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
- normal_mod-grub_script_tab.d: grub_script.tab.c
--      set -e;           $(CC) -I. -I$(srcdir)/. $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -M $<        | sed 's,grub_script\.tab\.o[ :]*,normal_mod-grub_script_tab.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -M $<           | sed 's,grub_script\.tab\.o[ :]*,normal_mod-grub_script_tab.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
- -include normal_mod-grub_script_tab.d
-@@ -1260,17 +1226,17 @@
- FSFILES += fs-normal_mod-grub_script_tab.lst
- cmd-normal_mod-grub_script_tab.lst: grub_script.tab.c gencmdlist.sh
--      set -e;           $(CC) -I. -I$(srcdir)/. $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<        | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $<           | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
- fs-normal_mod-grub_script_tab.lst: grub_script.tab.c genfslist.sh
--      set -e;           $(CC) -I. -I$(srcdir)/. $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<        | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $<           | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
- normal_mod-normal_script.o: normal/script.c
--      $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
- normal_mod-normal_script.d: normal/script.c
--      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -M $<      | sed 's,script\.o[ :]*,normal_mod-normal_script.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -M $<         | sed 's,script\.o[ :]*,normal_mod-normal_script.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
- -include normal_mod-normal_script.d
-@@ -1279,17 +1245,17 @@
- FSFILES += fs-normal_mod-normal_script.lst
- cmd-normal_mod-normal_script.lst: normal/script.c gencmdlist.sh
--      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $<         | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
- fs-normal_mod-normal_script.lst: normal/script.c genfslist.sh
--      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $<         | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
- normal_mod-normal_powerpc_setjmp.o: normal/powerpc/setjmp.S
--      $(CC) -Inormal/powerpc -I$(srcdir)/normal/powerpc $(CPPFLAGS) $(ASFLAGS) $(normal_mod_ASFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Inormal/powerpc -I$(srcdir)/normal/powerpc $(TARGET_CPPFLAGS) $(TARGET_ASFLAGS) $(normal_mod_ASFLAGS) -c -o $@ $<
- normal_mod-normal_powerpc_setjmp.d: normal/powerpc/setjmp.S
--      set -e;           $(CC) -Inormal/powerpc -I$(srcdir)/normal/powerpc $(CPPFLAGS) $(ASFLAGS) $(normal_mod_ASFLAGS) -M $<    | sed 's,setjmp\.o[ :]*,normal_mod-normal_powerpc_setjmp.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Inormal/powerpc -I$(srcdir)/normal/powerpc $(TARGET_CPPFLAGS) $(TARGET_ASFLAGS) $(normal_mod_ASFLAGS) -M $<       | sed 's,setjmp\.o[ :]*,normal_mod-normal_powerpc_setjmp.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
- -include normal_mod-normal_powerpc_setjmp.d
-@@ -1298,49 +1264,55 @@
- FSFILES += fs-normal_mod-normal_powerpc_setjmp.lst
- cmd-normal_mod-normal_powerpc_setjmp.lst: normal/powerpc/setjmp.S gencmdlist.sh
--      set -e;           $(CC) -Inormal/powerpc -I$(srcdir)/normal/powerpc $(CPPFLAGS) $(ASFLAGS) $(normal_mod_ASFLAGS) -E $<    | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Inormal/powerpc -I$(srcdir)/normal/powerpc $(TARGET_CPPFLAGS) $(TARGET_ASFLAGS) $(normal_mod_ASFLAGS) -E $<       | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
- fs-normal_mod-normal_powerpc_setjmp.lst: normal/powerpc/setjmp.S genfslist.sh
--      set -e;           $(CC) -Inormal/powerpc -I$(srcdir)/normal/powerpc $(CPPFLAGS) $(ASFLAGS) $(normal_mod_ASFLAGS) -E $<    | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Inormal/powerpc -I$(srcdir)/normal/powerpc $(TARGET_CPPFLAGS) $(TARGET_ASFLAGS) $(normal_mod_ASFLAGS) -E $<       | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
- normal_mod_CFLAGS = $(COMMON_CFLAGS)
-+normal_mod_LDFLAGS = $(COMMON_LDFLAGS)
- normal_mod_ASFLAGS = $(COMMON_ASFLAGS)
- # For suspend.mod
- suspend_mod_SOURCES = commands/ieee1275/suspend.c
--CLEANFILES += suspend.mod mod-suspend.o mod-suspend.c pre-suspend.o suspend_mod-commands_ieee1275_suspend.o def-suspend.lst und-suspend.lst
--MOSTLYCLEANFILES += suspend_mod-commands_ieee1275_suspend.d
-+CLEANFILES += suspend.mod mod-suspend.o mod-suspend.c pre-suspend.o suspend_mod-commands_ieee1275_suspend.o und-suspend.lst
-+ifneq ($(suspend_mod_EXPORTS),no)
-+CLEANFILES += def-suspend.lst
- DEFSYMFILES += def-suspend.lst
-+endif
-+MOSTLYCLEANFILES += suspend_mod-commands_ieee1275_suspend.d
- UNDSYMFILES += und-suspend.lst
- suspend.mod: pre-suspend.o mod-suspend.o
-       -rm -f $@
--      $(LD) $(suspend_mod_LDFLAGS) $(LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(suspend_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
-       $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
- pre-suspend.o: suspend_mod-commands_ieee1275_suspend.o
-       -rm -f $@
--      $(LD) $(suspend_mod_LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(suspend_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
- mod-suspend.o: mod-suspend.c
--      $(CC) $(CPPFLAGS) $(CFLAGS) $(suspend_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(suspend_mod_CFLAGS) -c -o $@ $<
- mod-suspend.c: moddep.lst genmodsrc.sh
-       sh $(srcdir)/genmodsrc.sh 'suspend' $< > $@ || (rm -f $@; exit 1)
-+ifneq ($(suspend_mod_EXPORTS),no)
- def-suspend.lst: pre-suspend.o
-       $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 suspend/' > $@
-+endif
- und-suspend.lst: pre-suspend.o
-       echo 'suspend' > $@
-       $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
- suspend_mod-commands_ieee1275_suspend.o: commands/ieee1275/suspend.c
--      $(CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(CPPFLAGS) $(CFLAGS) $(suspend_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(suspend_mod_CFLAGS) -c -o $@ $<
- suspend_mod-commands_ieee1275_suspend.d: commands/ieee1275/suspend.c
--      set -e;           $(CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(CPPFLAGS) $(CFLAGS) $(suspend_mod_CFLAGS) -M $<       | sed 's,suspend\.o[ :]*,suspend_mod-commands_ieee1275_suspend.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(suspend_mod_CFLAGS) -M $<          | sed 's,suspend\.o[ :]*,suspend_mod-commands_ieee1275_suspend.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
- -include suspend_mod-commands_ieee1275_suspend.d
-@@ -1349,48 +1321,54 @@
- FSFILES += fs-suspend_mod-commands_ieee1275_suspend.lst
- cmd-suspend_mod-commands_ieee1275_suspend.lst: commands/ieee1275/suspend.c gencmdlist.sh
--      set -e;           $(CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(CPPFLAGS) $(CFLAGS) $(suspend_mod_CFLAGS) -E $<       | sh $(srcdir)/gencmdlist.sh suspend > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(suspend_mod_CFLAGS) -E $<          | sh $(srcdir)/gencmdlist.sh suspend > $@ || (rm -f $@; exit 1)
- fs-suspend_mod-commands_ieee1275_suspend.lst: commands/ieee1275/suspend.c genfslist.sh
--      set -e;           $(CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(CPPFLAGS) $(CFLAGS) $(suspend_mod_CFLAGS) -E $<       | sh $(srcdir)/genfslist.sh suspend > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(suspend_mod_CFLAGS) -E $<          | sh $(srcdir)/genfslist.sh suspend > $@ || (rm -f $@; exit 1)
- suspend_mod_CFLAGS = $(COMMON_CFLAGS)
-+suspend_mod_LDFLAGS = $(COMMON_LDFLAGS)
- # For reboot.mod
- reboot_mod_SOURCES = commands/ieee1275/reboot.c
--CLEANFILES += reboot.mod mod-reboot.o mod-reboot.c pre-reboot.o reboot_mod-commands_ieee1275_reboot.o def-reboot.lst und-reboot.lst
--MOSTLYCLEANFILES += reboot_mod-commands_ieee1275_reboot.d
-+CLEANFILES += reboot.mod mod-reboot.o mod-reboot.c pre-reboot.o reboot_mod-commands_ieee1275_reboot.o und-reboot.lst
-+ifneq ($(reboot_mod_EXPORTS),no)
-+CLEANFILES += def-reboot.lst
- DEFSYMFILES += def-reboot.lst
-+endif
-+MOSTLYCLEANFILES += reboot_mod-commands_ieee1275_reboot.d
- UNDSYMFILES += und-reboot.lst
- reboot.mod: pre-reboot.o mod-reboot.o
-       -rm -f $@
--      $(LD) $(reboot_mod_LDFLAGS) $(LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(reboot_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
-       $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
- pre-reboot.o: reboot_mod-commands_ieee1275_reboot.o
-       -rm -f $@
--      $(LD) $(reboot_mod_LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(reboot_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
- mod-reboot.o: mod-reboot.c
--      $(CC) $(CPPFLAGS) $(CFLAGS) $(reboot_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -c -o $@ $<
- mod-reboot.c: moddep.lst genmodsrc.sh
-       sh $(srcdir)/genmodsrc.sh 'reboot' $< > $@ || (rm -f $@; exit 1)
-+ifneq ($(reboot_mod_EXPORTS),no)
- def-reboot.lst: pre-reboot.o
-       $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 reboot/' > $@
-+endif
- und-reboot.lst: pre-reboot.o
-       echo 'reboot' > $@
-       $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
- reboot_mod-commands_ieee1275_reboot.o: commands/ieee1275/reboot.c
--      $(CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(CPPFLAGS) $(CFLAGS) $(reboot_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -c -o $@ $<
- reboot_mod-commands_ieee1275_reboot.d: commands/ieee1275/reboot.c
--      set -e;           $(CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(CPPFLAGS) $(CFLAGS) $(reboot_mod_CFLAGS) -M $<        | sed 's,reboot\.o[ :]*,reboot_mod-commands_ieee1275_reboot.o $@ : ,g' > $@;    [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -M $<           | sed 's,reboot\.o[ :]*,reboot_mod-commands_ieee1275_reboot.o $@ : ,g' > $@;    [ -s $@ ] || rm -f $@
- -include reboot_mod-commands_ieee1275_reboot.d
-@@ -1399,48 +1377,54 @@
- FSFILES += fs-reboot_mod-commands_ieee1275_reboot.lst
- cmd-reboot_mod-commands_ieee1275_reboot.lst: commands/ieee1275/reboot.c gencmdlist.sh
--      set -e;           $(CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(CPPFLAGS) $(CFLAGS) $(reboot_mod_CFLAGS) -E $<        | sh $(srcdir)/gencmdlist.sh reboot > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -E $<           | sh $(srcdir)/gencmdlist.sh reboot > $@ || (rm -f $@; exit 1)
- fs-reboot_mod-commands_ieee1275_reboot.lst: commands/ieee1275/reboot.c genfslist.sh
--      set -e;           $(CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(CPPFLAGS) $(CFLAGS) $(reboot_mod_CFLAGS) -E $<        | sh $(srcdir)/genfslist.sh reboot > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -E $<           | sh $(srcdir)/genfslist.sh reboot > $@ || (rm -f $@; exit 1)
- reboot_mod_CFLAGS = $(COMMON_CFLAGS)
-+reboot_mod_LDFLAGS = $(COMMON_LDFLAGS)
- # For halt.mod
- halt_mod_SOURCES = commands/ieee1275/halt.c
--CLEANFILES += halt.mod mod-halt.o mod-halt.c pre-halt.o halt_mod-commands_ieee1275_halt.o def-halt.lst und-halt.lst
--MOSTLYCLEANFILES += halt_mod-commands_ieee1275_halt.d
-+CLEANFILES += halt.mod mod-halt.o mod-halt.c pre-halt.o halt_mod-commands_ieee1275_halt.o und-halt.lst
-+ifneq ($(halt_mod_EXPORTS),no)
-+CLEANFILES += def-halt.lst
- DEFSYMFILES += def-halt.lst
-+endif
-+MOSTLYCLEANFILES += halt_mod-commands_ieee1275_halt.d
- UNDSYMFILES += und-halt.lst
- halt.mod: pre-halt.o mod-halt.o
-       -rm -f $@
--      $(LD) $(halt_mod_LDFLAGS) $(LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(halt_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
-       $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
- pre-halt.o: halt_mod-commands_ieee1275_halt.o
-       -rm -f $@
--      $(LD) $(halt_mod_LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(halt_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
- mod-halt.o: mod-halt.c
--      $(CC) $(CPPFLAGS) $(CFLAGS) $(halt_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -c -o $@ $<
- mod-halt.c: moddep.lst genmodsrc.sh
-       sh $(srcdir)/genmodsrc.sh 'halt' $< > $@ || (rm -f $@; exit 1)
-+ifneq ($(halt_mod_EXPORTS),no)
- def-halt.lst: pre-halt.o
-       $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 halt/' > $@
-+endif
- und-halt.lst: pre-halt.o
-       echo 'halt' > $@
-       $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
- halt_mod-commands_ieee1275_halt.o: commands/ieee1275/halt.c
--      $(CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(CPPFLAGS) $(CFLAGS) $(halt_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -c -o $@ $<
- halt_mod-commands_ieee1275_halt.d: commands/ieee1275/halt.c
--      set -e;           $(CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(CPPFLAGS) $(CFLAGS) $(halt_mod_CFLAGS) -M $<          | sed 's,halt\.o[ :]*,halt_mod-commands_ieee1275_halt.o $@ : ,g' > $@;          [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -M $<     | sed 's,halt\.o[ :]*,halt_mod-commands_ieee1275_halt.o $@ : ,g' > $@;          [ -s $@ ] || rm -f $@
- -include halt_mod-commands_ieee1275_halt.d
-@@ -1449,12 +1433,13 @@
- FSFILES += fs-halt_mod-commands_ieee1275_halt.lst
- cmd-halt_mod-commands_ieee1275_halt.lst: commands/ieee1275/halt.c gencmdlist.sh
--      set -e;           $(CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(CPPFLAGS) $(CFLAGS) $(halt_mod_CFLAGS) -E $<          | sh $(srcdir)/gencmdlist.sh halt > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -E $<     | sh $(srcdir)/gencmdlist.sh halt > $@ || (rm -f $@; exit 1)
- fs-halt_mod-commands_ieee1275_halt.lst: commands/ieee1275/halt.c genfslist.sh
--      set -e;           $(CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(CPPFLAGS) $(CFLAGS) $(halt_mod_CFLAGS) -E $<          | sh $(srcdir)/genfslist.sh halt > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -E $<     | sh $(srcdir)/genfslist.sh halt > $@ || (rm -f $@; exit 1)
- halt_mod_CFLAGS = $(COMMON_CFLAGS)
-+halt_mod_LDFLAGS = $(COMMON_LDFLAGS)
- include $(srcdir)/conf/common.mk
-Index: conf/powerpc-ieee1275.rmk
-===================================================================
-RCS file: /cvsroot/grub/grub2/conf/powerpc-ieee1275.rmk,v
-retrieving revision 1.52
-retrieving revision 1.58
-diff -u -r1.52 -r1.58
---- conf/powerpc-ieee1275.rmk  25 Dec 2005 15:59:50 -0000      1.52
-+++ conf/powerpc-ieee1275.rmk  28 May 2006 23:01:43 -0000      1.58
-@@ -3,31 +3,31 @@
- COMMON_ASFLAGS = -nostdinc -D__ASSEMBLY__
- COMMON_CFLAGS = -ffreestanding -msoft-float
-+COMMON_LDFLAGS += -nostdlib
- # Images.
--MOSTLYCLEANFILES += grubof_symlist.c kernel_syms.lst
-+MOSTLYCLEANFILES += kernel_elf_symlist.c kernel_syms.lst
- DEFSYMFILES += kernel_syms.lst
--grubof_HEADERS = arg.h boot.h device.h disk.h dl.h elf.h env.h err.h \
-+kernel_elf_HEADERS = arg.h boot.h device.h disk.h dl.h elf.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 types.h powerpc/libgcc.h loader.h \
-       partition.h pc_partition.h ieee1275/ieee1275.h machine/time.h \
-       machine/kernel.h
--grubof_symlist.c: $(addprefix include/grub/,$(grubof_HEADERS)) gensymlist.sh
--      sh $(srcdir)/gensymlist.sh $(filter %.h,$^) > $@
-+kernel_elf_symlist.c: $(addprefix include/grub/,$(kernel_elf_HEADERS)) config.h gensymlist.sh
-+      /bin/sh gensymlist.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1)
--kernel_syms.lst: $(addprefix include/grub/,$(grubof_HEADERS)) genkernsyms.sh
--      sh $(srcdir)/genkernsyms.sh $(filter %h,$^) > $@
-+kernel_syms.lst: $(addprefix include/grub/,$(kernel_elf_HEADERS)) config.h genkernsyms.sh
-+      /bin/sh genkernsyms.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1)
- # Programs
--pkgdata_PROGRAMS = grubof
-+pkgdata_PROGRAMS = kernel.elf
- # Utilities.
- bin_UTILITIES = grub-emu
- sbin_UTILITIES = grub-mkimage
--noinst_UTILITIES = genmoddep
- # For grub-mkimage.
- grub_mkimage_SOURCES = util/powerpc/ieee1275/grub-mkimage.c util/misc.c \
-@@ -35,9 +35,9 @@
- # For grub-emu
- grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c      \
--      commands/configfile.c commands/default.c commands/help.c        \
-+      commands/configfile.c commands/help.c                           \
-       commands/search.c commands/terminal.c commands/test.c           \
--      commands/ls.c commands/timeout.c                                \
-+      commands/ls.c commands/blocklist.c                              \
-       commands/ieee1275/halt.c commands/ieee1275/reboot.c             \
-       disk/loopback.c                                                 \
-       fs/affs.c fs/ext2.c fs/fat.c fs/fshelp.c fs/hfs.c fs/iso9660.c  \
-@@ -47,7 +47,7 @@
-       kern/file.c kern/fs.c kern/loader.c kern/main.c kern/misc.c     \
-       kern/parser.c kern/partition.c kern/rescue.c kern/term.c        \
-       normal/arg.c normal/cmdline.c normal/command.c                  \
--      normal/completion.c normal/context.c normal/execute.c           \
-+      normal/completion.c normal/execute.c                            \
-       normal/function.c normal/lexer.c normal/main.c normal/menu.c    \
-       normal/menu_entry.c normal/misc.c normal/script.c               \
-       partmap/amiga.c partmap/apple.c partmap/pc.c partmap/sun.c      \
-@@ -58,21 +58,19 @@
- grub_emu_LDFLAGS = $(LIBCURSES)
--grubof_SOURCES = kern/powerpc/ieee1275/crt0.S kern/powerpc/ieee1275/cmain.c \
-+kernel_elf_SOURCES = kern/powerpc/ieee1275/crt0.S kern/powerpc/ieee1275/cmain.c \
-       kern/ieee1275/ieee1275.c kern/main.c kern/device.c              \
-       kern/disk.c kern/dl.c kern/file.c kern/fs.c kern/err.c          \
-       kern/misc.c kern/mm.c kern/loader.c kern/rescue.c kern/term.c   \
-       kern/powerpc/ieee1275/init.c term/ieee1275/ofconsole.c          \
-       kern/powerpc/ieee1275/openfw.c disk/ieee1275/ofdisk.c           \
-       kern/parser.c kern/partition.c kern/env.c kern/powerpc/dl.c     \
--      grubof_symlist.c kern/powerpc/cache.S
--grubof_HEADERS = grub/powerpc/ieee1275/ieee1275.h
--grubof_CFLAGS = $(COMMON_CFLAGS)
--grubof_ASFLAGS = $(COMMON_ASFLAGS)
--grubof_LDFLAGS = -nostdlib -static-libgcc -lgcc -Wl,-N,-S,-Ttext,0x200000,-Bstatic
--
--# For genmoddep.
--genmoddep_SOURCES = util/genmoddep.c
-+      kernel_elf_symlist.c kern/powerpc/cache.S
-+kernel_elf_HEADERS = grub/powerpc/ieee1275/ieee1275.h
-+kernel_elf_CFLAGS = $(COMMON_CFLAGS)
-+kernel_elf_ASFLAGS = $(COMMON_ASFLAGS)
-+kernel_elf_LDFLAGS = $(COMMON_LDFLAGS) -static-libgcc -lgcc \
-+      -Wl,-N,-S,-Ttext,0x200000,-Bstatic
- # Scripts.
- sbin_SCRIPTS = grub-install
-@@ -91,30 +89,36 @@
- # For _linux.mod.
- _linux_mod_SOURCES = loader/powerpc/ieee1275/linux.c
- _linux_mod_CFLAGS = $(COMMON_CFLAGS)
-+_linux_mod_LDFLAGS = $(COMMON_LDFLAGS)
- # For linux.mod.
- linux_mod_SOURCES = loader/powerpc/ieee1275/linux_normal.c
- linux_mod_CFLAGS = $(COMMON_CFLAGS)
-+linux_mod_LDFLAGS = $(COMMON_LDFLAGS)
- # For normal.mod.
- normal_mod_SOURCES = normal/arg.c normal/cmdline.c normal/command.c   \
--      normal/completion.c normal/context.c normal/execute.c           \
-+      normal/completion.c normal/execute.c                            \
-       normal/function.c normal/lexer.c normal/main.c normal/menu.c    \
-       normal/menu_entry.c normal/misc.c grub_script.tab.c             \
-       normal/script.c normal/powerpc/setjmp.S
- normal_mod_CFLAGS = $(COMMON_CFLAGS)
-+normal_mod_LDFLAGS = $(COMMON_LDFLAGS)
- normal_mod_ASFLAGS = $(COMMON_ASFLAGS)
- # For suspend.mod
- suspend_mod_SOURCES = commands/ieee1275/suspend.c
- suspend_mod_CFLAGS = $(COMMON_CFLAGS)
-+suspend_mod_LDFLAGS = $(COMMON_LDFLAGS)
- # For reboot.mod
- reboot_mod_SOURCES = commands/ieee1275/reboot.c
- reboot_mod_CFLAGS = $(COMMON_CFLAGS)
-+reboot_mod_LDFLAGS = $(COMMON_LDFLAGS)
- # For halt.mod
- halt_mod_SOURCES = commands/ieee1275/halt.c
- halt_mod_CFLAGS = $(COMMON_CFLAGS)
-+halt_mod_LDFLAGS = $(COMMON_LDFLAGS)
- include $(srcdir)/conf/common.mk
-Index: conf/sparc64-ieee1275.mk
-===================================================================
-RCS file: /cvsroot/grub/grub2/conf/sparc64-ieee1275.mk,v
-retrieving revision 1.8
-retrieving revision 1.18
-diff -u -r1.8 -r1.18
---- conf/sparc64-ieee1275.mk   18 Nov 2005 14:56:55 -0000      1.8
-+++ conf/sparc64-ieee1275.mk   4 Jun 2006 12:59:19 -0000       1.18
-@@ -3,35 +3,34 @@
- COMMON_ASFLAGS = -nostdinc
- COMMON_CFLAGS = -ggdb -ffreestanding -m64 -mno-app-regs
--COMMON_LDFLAGS = -melf64_sparc
-+COMMON_LDFLAGS = -melf64_sparc -nostdlib
- # Images.
--MOSTLYCLEANFILES += grubof_symlist.c kernel_syms.lst
-+MOSTLYCLEANFILES += kernel_elf_symlist.c kernel_syms.lst
- DEFSYMFILES += kernel_syms.lst
--grubof_HEADERS = arg.h boot.h device.h disk.h dl.h elf.h env.h err.h \
-+kernel_elf_HEADERS = arg.h boot.h device.h disk.h dl.h elf.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 types.h sparc64/libgcc.h loader.h \
-       partition.h pc_partition.h ieee1275/ieee1275.h machine/time.h \
-       machine/kernel.h
--grubof_symlist.c: $(addprefix include/grub/,$(grubof_HEADERS)) gensymlist.sh
--      sh $(srcdir)/gensymlist.sh $(filter %.h,$^) > $@
-+kernel_elf_symlist.c: $(addprefix include/grub/,$(kernel_elf_HEADERS)) config.h gensymlist.sh
-+      /bin/sh gensymlist.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1)
- # For the parser.
- grub_script.tab.c grub_script.tab.h: normal/parser.y
-       $(YACC) -d -p grub_script_yy -b grub_script $(srcdir)/normal/parser.y
--kernel_syms.lst: $(addprefix include/grub/,$(grubof_HEADERS)) genkernsyms.sh
--      sh $(srcdir)/genkernsyms.sh $(filter %h,$^) > $@
-+kernel_syms.lst: $(addprefix include/grub/,$(kernel_elf_HEADERS)) config.h genkernsyms.sh
-+      /bin/sh genkernsyms.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1)
- # Programs
--pkgdata_PROGRAMS = grubof
-+pkgdata_PROGRAMS = kernel.elf
- # Utilities.
- #bin_UTILITIES = grub-emu grub-mkimage
--noinst_UTILITIES = genmoddep
- # For grub-mkimage.
- grub_mkimage_SOURCES = util/sparc64/ieee1275/grub-mkimage.c util/misc.c \
-@@ -63,224 +62,207 @@
- grub_emu_LDFLAGS = $(LIBCURSES)
--grubof_SOURCES = kern/sparc64/ieee1275/init.c kern/ieee1275/ieee1275.c \
-+kernel_elf_SOURCES = kern/sparc64/ieee1275/init.c kern/ieee1275/ieee1275.c \
-       kern/main.c kern/device.c kern/disk.c kern/dl.c kern/file.c \
-       kern/fs.c kern/err.c kern/misc.c kern/mm.c kern/loader.c \
-       kern/rescue.c kern/term.c term/ieee1275/ofconsole.c \
-       kern/sparc64/ieee1275/openfw.c disk/ieee1275/ofdisk.c \
--      kern/partition.c kern/env.c kern/sparc64/dl.c grubof_symlist.c \
-+      kern/partition.c kern/env.c kern/sparc64/dl.c kernel_elf_symlist.c \
-       kern/sparc64/cache.S kern/parser.c
--CLEANFILES += grubof grubof-kern_sparc64_ieee1275_init.o grubof-kern_ieee1275_ieee1275.o grubof-kern_main.o grubof-kern_device.o grubof-kern_disk.o grubof-kern_dl.o grubof-kern_file.o grubof-kern_fs.o grubof-kern_err.o grubof-kern_misc.o grubof-kern_mm.o grubof-kern_loader.o grubof-kern_rescue.o grubof-kern_term.o grubof-term_ieee1275_ofconsole.o grubof-kern_sparc64_ieee1275_openfw.o grubof-disk_ieee1275_ofdisk.o grubof-kern_partition.o grubof-kern_env.o grubof-kern_sparc64_dl.o grubof-grubof_symlist.o grubof-kern_sparc64_cache.o grubof-kern_parser.o
--MOSTLYCLEANFILES += grubof-kern_sparc64_ieee1275_init.d grubof-kern_ieee1275_ieee1275.d grubof-kern_main.d grubof-kern_device.d grubof-kern_disk.d grubof-kern_dl.d grubof-kern_file.d grubof-kern_fs.d grubof-kern_err.d grubof-kern_misc.d grubof-kern_mm.d grubof-kern_loader.d grubof-kern_rescue.d grubof-kern_term.d grubof-term_ieee1275_ofconsole.d grubof-kern_sparc64_ieee1275_openfw.d grubof-disk_ieee1275_ofdisk.d grubof-kern_partition.d grubof-kern_env.d grubof-kern_sparc64_dl.d grubof-grubof_symlist.d grubof-kern_sparc64_cache.d grubof-kern_parser.d
-+CLEANFILES += kernel.elf kernel_elf-kern_sparc64_ieee1275_init.o kernel_elf-kern_ieee1275_ieee1275.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_err.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-term_ieee1275_ofconsole.o kernel_elf-kern_sparc64_ieee1275_openfw.o kernel_elf-disk_ieee1275_ofdisk.o kernel_elf-kern_partition.o kernel_elf-kern_env.o kernel_elf-kern_sparc64_dl.o kernel_elf-kernel_elf_symlist.o kernel_elf-kern_sparc64_cache.o kernel_elf-kern_parser.o
-+MOSTLYCLEANFILES += kernel_elf-kern_sparc64_ieee1275_init.d kernel_elf-kern_ieee1275_ieee1275.d kernel_elf-kern_main.d kernel_elf-kern_device.d kernel_elf-kern_disk.d kernel_elf-kern_dl.d kernel_elf-kern_file.d kernel_elf-kern_fs.d kernel_elf-kern_err.d kernel_elf-kern_misc.d kernel_elf-kern_mm.d kernel_elf-kern_loader.d kernel_elf-kern_rescue.d kernel_elf-kern_term.d kernel_elf-term_ieee1275_ofconsole.d kernel_elf-kern_sparc64_ieee1275_openfw.d kernel_elf-disk_ieee1275_ofdisk.d kernel_elf-kern_partition.d kernel_elf-kern_env.d kernel_elf-kern_sparc64_dl.d kernel_elf-kernel_elf_symlist.d kernel_elf-kern_sparc64_cache.d kernel_elf-kern_parser.d
--grubof: grubof-kern_sparc64_ieee1275_init.o grubof-kern_ieee1275_ieee1275.o grubof-kern_main.o grubof-kern_device.o grubof-kern_disk.o grubof-kern_dl.o grubof-kern_file.o grubof-kern_fs.o grubof-kern_err.o grubof-kern_misc.o grubof-kern_mm.o grubof-kern_loader.o grubof-kern_rescue.o grubof-kern_term.o grubof-term_ieee1275_ofconsole.o grubof-kern_sparc64_ieee1275_openfw.o grubof-disk_ieee1275_ofdisk.o grubof-kern_partition.o grubof-kern_env.o grubof-kern_sparc64_dl.o grubof-grubof_symlist.o grubof-kern_sparc64_cache.o grubof-kern_parser.o
--      $(CC) -o $@ $^ $(LDFLAGS) $(grubof_LDFLAGS)
-+kernel.elf: kernel_elf-kern_sparc64_ieee1275_init.o kernel_elf-kern_ieee1275_ieee1275.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_err.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-term_ieee1275_ofconsole.o kernel_elf-kern_sparc64_ieee1275_openfw.o kernel_elf-disk_ieee1275_ofdisk.o kernel_elf-kern_partition.o kernel_elf-kern_env.o kernel_elf-kern_sparc64_dl.o kernel_elf-kernel_elf_symlist.o kernel_elf-kern_sparc64_cache.o kernel_elf-kern_parser.o
-+      $(TARGET_CC) -o $@ $^ $(TARGET_LDFLAGS) $(kernel_elf_LDFLAGS)
--grubof-kern_sparc64_ieee1275_init.o: kern/sparc64/ieee1275/init.c
--      $(CC) -Ikern/sparc64/ieee1275 -I$(srcdir)/kern/sparc64/ieee1275 $(CPPFLAGS) $(CFLAGS) $(grubof_CFLAGS) -c -o $@ $<
-+kernel_elf-kern_sparc64_ieee1275_init.o: kern/sparc64/ieee1275/init.c
-+      $(TARGET_CC) -Ikern/sparc64/ieee1275 -I$(srcdir)/kern/sparc64/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
--grubof-kern_sparc64_ieee1275_init.d: kern/sparc64/ieee1275/init.c
--      set -e;           $(CC) -Ikern/sparc64/ieee1275 -I$(srcdir)/kern/sparc64/ieee1275 $(CPPFLAGS) $(CFLAGS) $(grubof_CFLAGS) -M $<    | sed 's,init\.o[ :]*,grubof-kern_sparc64_ieee1275_init.o $@ : ,g' > $@;        [ -s $@ ] || rm -f $@
-+kernel_elf-kern_sparc64_ieee1275_init.d: kern/sparc64/ieee1275/init.c
-+      set -e;           $(TARGET_CC) -Ikern/sparc64/ieee1275 -I$(srcdir)/kern/sparc64/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -M $<           | sed 's,init\.o[ :]*,kernel_elf-kern_sparc64_ieee1275_init.o $@ : ,g' > $@;    [ -s $@ ] || rm -f $@
---include grubof-kern_sparc64_ieee1275_init.d
-+-include kernel_elf-kern_sparc64_ieee1275_init.d
--grubof-kern_ieee1275_ieee1275.o: kern/ieee1275/ieee1275.c
--      $(CC) -Ikern/ieee1275 -I$(srcdir)/kern/ieee1275 $(CPPFLAGS) $(CFLAGS) $(grubof_CFLAGS) -c -o $@ $<
-+kernel_elf-kern_ieee1275_ieee1275.o: kern/ieee1275/ieee1275.c
-+      $(TARGET_CC) -Ikern/ieee1275 -I$(srcdir)/kern/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
--grubof-kern_ieee1275_ieee1275.d: kern/ieee1275/ieee1275.c
--      set -e;           $(CC) -Ikern/ieee1275 -I$(srcdir)/kern/ieee1275 $(CPPFLAGS) $(CFLAGS) $(grubof_CFLAGS) -M $<    | sed 's,ieee1275\.o[ :]*,grubof-kern_ieee1275_ieee1275.o $@ : ,g' > $@;        [ -s $@ ] || rm -f $@
-+kernel_elf-kern_ieee1275_ieee1275.d: kern/ieee1275/ieee1275.c
-+      set -e;           $(TARGET_CC) -Ikern/ieee1275 -I$(srcdir)/kern/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -M $<           | sed 's,ieee1275\.o[ :]*,kernel_elf-kern_ieee1275_ieee1275.o $@ : ,g' > $@;    [ -s $@ ] || rm -f $@
---include grubof-kern_ieee1275_ieee1275.d
-+-include kernel_elf-kern_ieee1275_ieee1275.d
--grubof-kern_main.o: kern/main.c
--      $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(grubof_CFLAGS) -c -o $@ $<
-+kernel_elf-kern_main.o: kern/main.c
-+      $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
--grubof-kern_main.d: kern/main.c
--      set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(grubof_CFLAGS) -M $<      | sed 's,main\.o[ :]*,grubof-kern_main.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
-+kernel_elf-kern_main.d: kern/main.c
-+      set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -M $<     | sed 's,main\.o[ :]*,kernel_elf-kern_main.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
---include grubof-kern_main.d
-+-include kernel_elf-kern_main.d
--grubof-kern_device.o: kern/device.c
--      $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(grubof_CFLAGS) -c -o $@ $<
-+kernel_elf-kern_device.o: kern/device.c
-+      $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
--grubof-kern_device.d: kern/device.c
--      set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(grubof_CFLAGS) -M $<      | sed 's,device\.o[ :]*,grubof-kern_device.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
-+kernel_elf-kern_device.d: kern/device.c
-+      set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -M $<     | sed 's,device\.o[ :]*,kernel_elf-kern_device.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
---include grubof-kern_device.d
-+-include kernel_elf-kern_device.d
--grubof-kern_disk.o: kern/disk.c
--      $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(grubof_CFLAGS) -c -o $@ $<
-+kernel_elf-kern_disk.o: kern/disk.c
-+      $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
--grubof-kern_disk.d: kern/disk.c
--      set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(grubof_CFLAGS) -M $<      | sed 's,disk\.o[ :]*,grubof-kern_disk.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
-+kernel_elf-kern_disk.d: kern/disk.c
-+      set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -M $<     | sed 's,disk\.o[ :]*,kernel_elf-kern_disk.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
---include grubof-kern_disk.d
-+-include kernel_elf-kern_disk.d
--grubof-kern_dl.o: kern/dl.c
--      $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(grubof_CFLAGS) -c -o $@ $<
-+kernel_elf-kern_dl.o: kern/dl.c
-+      $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
--grubof-kern_dl.d: kern/dl.c
--      set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(grubof_CFLAGS) -M $<      | sed 's,dl\.o[ :]*,grubof-kern_dl.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
-+kernel_elf-kern_dl.d: kern/dl.c
-+      set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -M $<     | sed 's,dl\.o[ :]*,kernel_elf-kern_dl.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
---include grubof-kern_dl.d
-+-include kernel_elf-kern_dl.d
--grubof-kern_file.o: kern/file.c
--      $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(grubof_CFLAGS) -c -o $@ $<
-+kernel_elf-kern_file.o: kern/file.c
-+      $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
--grubof-kern_file.d: kern/file.c
--      set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(grubof_CFLAGS) -M $<      | sed 's,file\.o[ :]*,grubof-kern_file.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
-+kernel_elf-kern_file.d: kern/file.c
-+      set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -M $<     | sed 's,file\.o[ :]*,kernel_elf-kern_file.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
---include grubof-kern_file.d
-+-include kernel_elf-kern_file.d
--grubof-kern_fs.o: kern/fs.c
--      $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(grubof_CFLAGS) -c -o $@ $<
-+kernel_elf-kern_fs.o: kern/fs.c
-+      $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
--grubof-kern_fs.d: kern/fs.c
--      set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(grubof_CFLAGS) -M $<      | sed 's,fs\.o[ :]*,grubof-kern_fs.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
-+kernel_elf-kern_fs.d: kern/fs.c
-+      set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -M $<     | sed 's,fs\.o[ :]*,kernel_elf-kern_fs.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
---include grubof-kern_fs.d
-+-include kernel_elf-kern_fs.d
--grubof-kern_err.o: kern/err.c
--      $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(grubof_CFLAGS) -c -o $@ $<
-+kernel_elf-kern_err.o: kern/err.c
-+      $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
--grubof-kern_err.d: kern/err.c
--      set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(grubof_CFLAGS) -M $<      | sed 's,err\.o[ :]*,grubof-kern_err.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
-+kernel_elf-kern_err.d: kern/err.c
-+      set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -M $<     | sed 's,err\.o[ :]*,kernel_elf-kern_err.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
---include grubof-kern_err.d
-+-include kernel_elf-kern_err.d
--grubof-kern_misc.o: kern/misc.c
--      $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(grubof_CFLAGS) -c -o $@ $<
-+kernel_elf-kern_misc.o: kern/misc.c
-+      $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
--grubof-kern_misc.d: kern/misc.c
--      set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(grubof_CFLAGS) -M $<      | sed 's,misc\.o[ :]*,grubof-kern_misc.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
-+kernel_elf-kern_misc.d: kern/misc.c
-+      set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -M $<     | sed 's,misc\.o[ :]*,kernel_elf-kern_misc.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
---include grubof-kern_misc.d
-+-include kernel_elf-kern_misc.d
--grubof-kern_mm.o: kern/mm.c
--      $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(grubof_CFLAGS) -c -o $@ $<
-+kernel_elf-kern_mm.o: kern/mm.c
-+      $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
--grubof-kern_mm.d: kern/mm.c
--      set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(grubof_CFLAGS) -M $<      | sed 's,mm\.o[ :]*,grubof-kern_mm.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
-+kernel_elf-kern_mm.d: kern/mm.c
-+      set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -M $<     | sed 's,mm\.o[ :]*,kernel_elf-kern_mm.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
---include grubof-kern_mm.d
-+-include kernel_elf-kern_mm.d
--grubof-kern_loader.o: kern/loader.c
--      $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(grubof_CFLAGS) -c -o $@ $<
-+kernel_elf-kern_loader.o: kern/loader.c
-+      $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
--grubof-kern_loader.d: kern/loader.c
--      set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(grubof_CFLAGS) -M $<      | sed 's,loader\.o[ :]*,grubof-kern_loader.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
-+kernel_elf-kern_loader.d: kern/loader.c
-+      set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -M $<     | sed 's,loader\.o[ :]*,kernel_elf-kern_loader.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
---include grubof-kern_loader.d
-+-include kernel_elf-kern_loader.d
--grubof-kern_rescue.o: kern/rescue.c
--      $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(grubof_CFLAGS) -c -o $@ $<
-+kernel_elf-kern_rescue.o: kern/rescue.c
-+      $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
--grubof-kern_rescue.d: kern/rescue.c
--      set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(grubof_CFLAGS) -M $<      | sed 's,rescue\.o[ :]*,grubof-kern_rescue.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
-+kernel_elf-kern_rescue.d: kern/rescue.c
-+      set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -M $<     | sed 's,rescue\.o[ :]*,kernel_elf-kern_rescue.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
---include grubof-kern_rescue.d
-+-include kernel_elf-kern_rescue.d
--grubof-kern_term.o: kern/term.c
--      $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(grubof_CFLAGS) -c -o $@ $<
-+kernel_elf-kern_term.o: kern/term.c
-+      $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
--grubof-kern_term.d: kern/term.c
--      set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(grubof_CFLAGS) -M $<      | sed 's,term\.o[ :]*,grubof-kern_term.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
-+kernel_elf-kern_term.d: kern/term.c
-+      set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -M $<     | sed 's,term\.o[ :]*,kernel_elf-kern_term.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
---include grubof-kern_term.d
-+-include kernel_elf-kern_term.d
--grubof-term_ieee1275_ofconsole.o: term/ieee1275/ofconsole.c
--      $(CC) -Iterm/ieee1275 -I$(srcdir)/term/ieee1275 $(CPPFLAGS) $(CFLAGS) $(grubof_CFLAGS) -c -o $@ $<
-+kernel_elf-term_ieee1275_ofconsole.o: term/ieee1275/ofconsole.c
-+      $(TARGET_CC) -Iterm/ieee1275 -I$(srcdir)/term/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
--grubof-term_ieee1275_ofconsole.d: term/ieee1275/ofconsole.c
--      set -e;           $(CC) -Iterm/ieee1275 -I$(srcdir)/term/ieee1275 $(CPPFLAGS) $(CFLAGS) $(grubof_CFLAGS) -M $<    | sed 's,ofconsole\.o[ :]*,grubof-term_ieee1275_ofconsole.o $@ : ,g' > $@;      [ -s $@ ] || rm -f $@
-+kernel_elf-term_ieee1275_ofconsole.d: term/ieee1275/ofconsole.c
-+      set -e;           $(TARGET_CC) -Iterm/ieee1275 -I$(srcdir)/term/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -M $<           | sed 's,ofconsole\.o[ :]*,kernel_elf-term_ieee1275_ofconsole.o $@ : ,g' > $@;          [ -s $@ ] || rm -f $@
---include grubof-term_ieee1275_ofconsole.d
-+-include kernel_elf-term_ieee1275_ofconsole.d
--grubof-kern_sparc64_ieee1275_openfw.o: kern/sparc64/ieee1275/openfw.c
--      $(CC) -Ikern/sparc64/ieee1275 -I$(srcdir)/kern/sparc64/ieee1275 $(CPPFLAGS) $(CFLAGS) $(grubof_CFLAGS) -c -o $@ $<
-+kernel_elf-kern_sparc64_ieee1275_openfw.o: kern/sparc64/ieee1275/openfw.c
-+      $(TARGET_CC) -Ikern/sparc64/ieee1275 -I$(srcdir)/kern/sparc64/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
--grubof-kern_sparc64_ieee1275_openfw.d: kern/sparc64/ieee1275/openfw.c
--      set -e;           $(CC) -Ikern/sparc64/ieee1275 -I$(srcdir)/kern/sparc64/ieee1275 $(CPPFLAGS) $(CFLAGS) $(grubof_CFLAGS) -M $<    | sed 's,openfw\.o[ :]*,grubof-kern_sparc64_ieee1275_openfw.o $@ : ,g' > $@;    [ -s $@ ] || rm -f $@
-+kernel_elf-kern_sparc64_ieee1275_openfw.d: kern/sparc64/ieee1275/openfw.c
-+      set -e;           $(TARGET_CC) -Ikern/sparc64/ieee1275 -I$(srcdir)/kern/sparc64/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -M $<           | sed 's,openfw\.o[ :]*,kernel_elf-kern_sparc64_ieee1275_openfw.o $@ : ,g' > $@;        [ -s $@ ] || rm -f $@
---include grubof-kern_sparc64_ieee1275_openfw.d
-+-include kernel_elf-kern_sparc64_ieee1275_openfw.d
--grubof-disk_ieee1275_ofdisk.o: disk/ieee1275/ofdisk.c
--      $(CC) -Idisk/ieee1275 -I$(srcdir)/disk/ieee1275 $(CPPFLAGS) $(CFLAGS) $(grubof_CFLAGS) -c -o $@ $<
-+kernel_elf-disk_ieee1275_ofdisk.o: disk/ieee1275/ofdisk.c
-+      $(TARGET_CC) -Idisk/ieee1275 -I$(srcdir)/disk/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
--grubof-disk_ieee1275_ofdisk.d: disk/ieee1275/ofdisk.c
--      set -e;           $(CC) -Idisk/ieee1275 -I$(srcdir)/disk/ieee1275 $(CPPFLAGS) $(CFLAGS) $(grubof_CFLAGS) -M $<    | sed 's,ofdisk\.o[ :]*,grubof-disk_ieee1275_ofdisk.o $@ : ,g' > $@;    [ -s $@ ] || rm -f $@
-+kernel_elf-disk_ieee1275_ofdisk.d: disk/ieee1275/ofdisk.c
-+      set -e;           $(TARGET_CC) -Idisk/ieee1275 -I$(srcdir)/disk/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -M $<           | sed 's,ofdisk\.o[ :]*,kernel_elf-disk_ieee1275_ofdisk.o $@ : ,g' > $@;        [ -s $@ ] || rm -f $@
---include grubof-disk_ieee1275_ofdisk.d
-+-include kernel_elf-disk_ieee1275_ofdisk.d
--grubof-kern_partition.o: kern/partition.c
--      $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(grubof_CFLAGS) -c -o $@ $<
-+kernel_elf-kern_partition.o: kern/partition.c
-+      $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
--grubof-kern_partition.d: kern/partition.c
--      set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(grubof_CFLAGS) -M $<      | sed 's,partition\.o[ :]*,grubof-kern_partition.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
-+kernel_elf-kern_partition.d: kern/partition.c
-+      set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -M $<     | sed 's,partition\.o[ :]*,kernel_elf-kern_partition.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
---include grubof-kern_partition.d
-+-include kernel_elf-kern_partition.d
--grubof-kern_env.o: kern/env.c
--      $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(grubof_CFLAGS) -c -o $@ $<
-+kernel_elf-kern_env.o: kern/env.c
-+      $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
--grubof-kern_env.d: kern/env.c
--      set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(grubof_CFLAGS) -M $<      | sed 's,env\.o[ :]*,grubof-kern_env.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
-+kernel_elf-kern_env.d: kern/env.c
-+      set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -M $<     | sed 's,env\.o[ :]*,kernel_elf-kern_env.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
---include grubof-kern_env.d
-+-include kernel_elf-kern_env.d
--grubof-kern_sparc64_dl.o: kern/sparc64/dl.c
--      $(CC) -Ikern/sparc64 -I$(srcdir)/kern/sparc64 $(CPPFLAGS) $(CFLAGS) $(grubof_CFLAGS) -c -o $@ $<
-+kernel_elf-kern_sparc64_dl.o: kern/sparc64/dl.c
-+      $(TARGET_CC) -Ikern/sparc64 -I$(srcdir)/kern/sparc64 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
--grubof-kern_sparc64_dl.d: kern/sparc64/dl.c
--      set -e;           $(CC) -Ikern/sparc64 -I$(srcdir)/kern/sparc64 $(CPPFLAGS) $(CFLAGS) $(grubof_CFLAGS) -M $<      | sed 's,dl\.o[ :]*,grubof-kern_sparc64_dl.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
-+kernel_elf-kern_sparc64_dl.d: kern/sparc64/dl.c
-+      set -e;           $(TARGET_CC) -Ikern/sparc64 -I$(srcdir)/kern/sparc64 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -M $<     | sed 's,dl\.o[ :]*,kernel_elf-kern_sparc64_dl.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
---include grubof-kern_sparc64_dl.d
-+-include kernel_elf-kern_sparc64_dl.d
--grubof-grubof_symlist.o: grubof_symlist.c
--      $(CC) -I. -I$(srcdir)/. $(CPPFLAGS) $(CFLAGS) $(grubof_CFLAGS) -c -o $@ $<
-+kernel_elf-kernel_elf_symlist.o: kernel_elf_symlist.c
-+      $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
--grubof-grubof_symlist.d: grubof_symlist.c
--      set -e;           $(CC) -I. -I$(srcdir)/. $(CPPFLAGS) $(CFLAGS) $(grubof_CFLAGS) -M $<    | sed 's,grubof_symlist\.o[ :]*,grubof-grubof_symlist.o $@ : ,g' > $@;          [ -s $@ ] || rm -f $@
-+kernel_elf-kernel_elf_symlist.d: kernel_elf_symlist.c
-+      set -e;           $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -M $<           | sed 's,kernel_elf_symlist\.o[ :]*,kernel_elf-kernel_elf_symlist.o $@ : ,g' > $@;      [ -s $@ ] || rm -f $@
---include grubof-grubof_symlist.d
-+-include kernel_elf-kernel_elf_symlist.d
--grubof-kern_sparc64_cache.o: kern/sparc64/cache.S
--      $(CC) -Ikern/sparc64 -I$(srcdir)/kern/sparc64 $(CPPFLAGS) $(CFLAGS) $(grubof_CFLAGS) -c -o $@ $<
-+kernel_elf-kern_sparc64_cache.o: kern/sparc64/cache.S
-+      $(TARGET_CC) -Ikern/sparc64 -I$(srcdir)/kern/sparc64 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
--grubof-kern_sparc64_cache.d: kern/sparc64/cache.S
--      set -e;           $(CC) -Ikern/sparc64 -I$(srcdir)/kern/sparc64 $(CPPFLAGS) $(CFLAGS) $(grubof_CFLAGS) -M $<      | sed 's,cache\.o[ :]*,grubof-kern_sparc64_cache.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
-+kernel_elf-kern_sparc64_cache.d: kern/sparc64/cache.S
-+      set -e;           $(TARGET_CC) -Ikern/sparc64 -I$(srcdir)/kern/sparc64 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -M $<     | sed 's,cache\.o[ :]*,kernel_elf-kern_sparc64_cache.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
---include grubof-kern_sparc64_cache.d
-+-include kernel_elf-kern_sparc64_cache.d
--grubof-kern_parser.o: kern/parser.c
--      $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(grubof_CFLAGS) -c -o $@ $<
-+kernel_elf-kern_parser.o: kern/parser.c
-+      $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
--grubof-kern_parser.d: kern/parser.c
--      set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(grubof_CFLAGS) -M $<      | sed 's,parser\.o[ :]*,grubof-kern_parser.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
-+kernel_elf-kern_parser.d: kern/parser.c
-+      set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -M $<     | sed 's,parser\.o[ :]*,kernel_elf-kern_parser.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
---include grubof-kern_parser.d
--
--grubof_HEADERS = grub/sparc64/ieee1275/ieee1275.h
--grubof_CFLAGS = $(COMMON_CFLAGS)
--grubof_ASFLAGS = $(COMMON_ASFLAGS)
--grubof_LDFLAGS = -mno-app-regs -nostdlib -Wl,-N,-Ttext,0x200000,-Bstatic,-melf64_sparc
--
--# For genmoddep.
--genmoddep_SOURCES = util/genmoddep.c
--CLEANFILES += genmoddep genmoddep-util_genmoddep.o
--MOSTLYCLEANFILES += genmoddep-util_genmoddep.d
--
--genmoddep: genmoddep-util_genmoddep.o
--      $(BUILD_CC) -o $@ $^ $(BUILD_LDFLAGS) $(genmoddep_LDFLAGS)
--
--genmoddep-util_genmoddep.o: util/genmoddep.c
--      $(BUILD_CC) -Iutil -I$(srcdir)/util $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(genmoddep_CFLAGS) -c -o $@ $<
--
--genmoddep-util_genmoddep.d: util/genmoddep.c
--      set -e;           $(BUILD_CC) -Iutil -I$(srcdir)/util $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(genmoddep_CFLAGS) -M $<           | sed 's,genmoddep\.o[ :]*,genmoddep-util_genmoddep.o $@ : ,g' > $@;    [ -s $@ ] || rm -f $@
--
---include genmoddep-util_genmoddep.d
-+-include kernel_elf-kern_parser.d
-+kernel_elf_HEADERS = grub/sparc64/ieee1275/ieee1275.h
-+kernel_elf_CFLAGS = $(COMMON_CFLAGS)
-+kernel_elf_ASFLAGS = $(COMMON_ASFLAGS)
-+kernel_elf_LDFLAGS = -mno-app-regs -nostdlib -Wl,-N,-Ttext,0x200000,-Bstatic,-melf64_sparc
- # Modules.
- #_linux.mod linux.mod
-@@ -288,43 +270,48 @@
-       hfs.mod jfs.mod normal.mod hello.mod font.mod ls.mod \
-       boot.mod cmp.mod cat.mod terminal.mod fshelp.mod amiga.mod apple.mod \
-       pc.mod suspend.mod loopback.mod help.mod reboot.mod halt.mod sun.mod \
--      default.mod timeout.mod configfile.mod search.mod gzio.mod xfs.mod \
-+      configfile.mod search.mod gzio.mod xfs.mod \
-       affs.mod sfs.mod acorn.mod
- # For fshelp.mod.
- fshelp_mod_SOURCES = fs/fshelp.c
--CLEANFILES += fshelp.mod mod-fshelp.o mod-fshelp.c pre-fshelp.o fshelp_mod-fs_fshelp.o def-fshelp.lst und-fshelp.lst
--MOSTLYCLEANFILES += fshelp_mod-fs_fshelp.d
-+CLEANFILES += fshelp.mod mod-fshelp.o mod-fshelp.c pre-fshelp.o fshelp_mod-fs_fshelp.o und-fshelp.lst
-+ifneq ($(fshelp_mod_EXPORTS),no)
-+CLEANFILES += def-fshelp.lst
- DEFSYMFILES += def-fshelp.lst
-+endif
-+MOSTLYCLEANFILES += fshelp_mod-fs_fshelp.d
- UNDSYMFILES += und-fshelp.lst
- fshelp.mod: pre-fshelp.o mod-fshelp.o
-       -rm -f $@
--      $(LD) $(fshelp_mod_LDFLAGS) $(LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(fshelp_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
-       $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
- pre-fshelp.o: fshelp_mod-fs_fshelp.o
-       -rm -f $@
--      $(LD) $(fshelp_mod_LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(fshelp_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
- mod-fshelp.o: mod-fshelp.c
--      $(CC) $(CPPFLAGS) $(CFLAGS) $(fshelp_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fshelp_mod_CFLAGS) -c -o $@ $<
- mod-fshelp.c: moddep.lst genmodsrc.sh
-       sh $(srcdir)/genmodsrc.sh 'fshelp' $< > $@ || (rm -f $@; exit 1)
-+ifneq ($(fshelp_mod_EXPORTS),no)
- def-fshelp.lst: pre-fshelp.o
-       $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 fshelp/' > $@
-+endif
- und-fshelp.lst: pre-fshelp.o
-       echo 'fshelp' > $@
-       $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
- fshelp_mod-fs_fshelp.o: fs/fshelp.c
--      $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(fshelp_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fshelp_mod_CFLAGS) -c -o $@ $<
- fshelp_mod-fs_fshelp.d: fs/fshelp.c
--      set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(fshelp_mod_CFLAGS) -M $<      | sed 's,fshelp\.o[ :]*,fshelp_mod-fs_fshelp.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fshelp_mod_CFLAGS) -M $<         | sed 's,fshelp\.o[ :]*,fshelp_mod-fs_fshelp.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
- -include fshelp_mod-fs_fshelp.d
-@@ -333,10 +320,10 @@
- FSFILES += fs-fshelp_mod-fs_fshelp.lst
- cmd-fshelp_mod-fs_fshelp.lst: fs/fshelp.c gencmdlist.sh
--      set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(fshelp_mod_CFLAGS) -E $<      | sh $(srcdir)/gencmdlist.sh fshelp > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fshelp_mod_CFLAGS) -E $<         | sh $(srcdir)/gencmdlist.sh fshelp > $@ || (rm -f $@; exit 1)
- fs-fshelp_mod-fs_fshelp.lst: fs/fshelp.c genfslist.sh
--      set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(fshelp_mod_CFLAGS) -E $<      | sh $(srcdir)/genfslist.sh fshelp > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fshelp_mod_CFLAGS) -E $<         | sh $(srcdir)/genfslist.sh fshelp > $@ || (rm -f $@; exit 1)
- fshelp_mod_CFLAGS = $(COMMON_CFLAGS)
-@@ -344,38 +331,43 @@
- # For fat.mod.
- fat_mod_SOURCES = fs/fat.c
--CLEANFILES += fat.mod mod-fat.o mod-fat.c pre-fat.o fat_mod-fs_fat.o def-fat.lst und-fat.lst
--MOSTLYCLEANFILES += fat_mod-fs_fat.d
-+CLEANFILES += fat.mod mod-fat.o mod-fat.c pre-fat.o fat_mod-fs_fat.o und-fat.lst
-+ifneq ($(fat_mod_EXPORTS),no)
-+CLEANFILES += def-fat.lst
- DEFSYMFILES += def-fat.lst
-+endif
-+MOSTLYCLEANFILES += fat_mod-fs_fat.d
- UNDSYMFILES += und-fat.lst
- fat.mod: pre-fat.o mod-fat.o
-       -rm -f $@
--      $(LD) $(fat_mod_LDFLAGS) $(LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(fat_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
-       $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
- pre-fat.o: fat_mod-fs_fat.o
-       -rm -f $@
--      $(LD) $(fat_mod_LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(fat_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
- mod-fat.o: mod-fat.c
--      $(CC) $(CPPFLAGS) $(CFLAGS) $(fat_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fat_mod_CFLAGS) -c -o $@ $<
- mod-fat.c: moddep.lst genmodsrc.sh
-       sh $(srcdir)/genmodsrc.sh 'fat' $< > $@ || (rm -f $@; exit 1)
-+ifneq ($(fat_mod_EXPORTS),no)
- def-fat.lst: pre-fat.o
-       $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 fat/' > $@
-+endif
- und-fat.lst: pre-fat.o
-       echo 'fat' > $@
-       $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
- fat_mod-fs_fat.o: fs/fat.c
--      $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(fat_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fat_mod_CFLAGS) -c -o $@ $<
- fat_mod-fs_fat.d: fs/fat.c
--      set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(fat_mod_CFLAGS) -M $<         | sed 's,fat\.o[ :]*,fat_mod-fs_fat.o $@ : ,g' > $@;    [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fat_mod_CFLAGS) -M $<    | sed 's,fat\.o[ :]*,fat_mod-fs_fat.o $@ : ,g' > $@;    [ -s $@ ] || rm -f $@
- -include fat_mod-fs_fat.d
-@@ -384,10 +376,10 @@
- FSFILES += fs-fat_mod-fs_fat.lst
- cmd-fat_mod-fs_fat.lst: fs/fat.c gencmdlist.sh
--      set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(fat_mod_CFLAGS) -E $<         | sh $(srcdir)/gencmdlist.sh fat > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fat_mod_CFLAGS) -E $<    | sh $(srcdir)/gencmdlist.sh fat > $@ || (rm -f $@; exit 1)
- fs-fat_mod-fs_fat.lst: fs/fat.c genfslist.sh
--      set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(fat_mod_CFLAGS) -E $<         | sh $(srcdir)/genfslist.sh fat > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fat_mod_CFLAGS) -E $<    | sh $(srcdir)/genfslist.sh fat > $@ || (rm -f $@; exit 1)
- fat_mod_CFLAGS = $(COMMON_CFLAGS)
-@@ -395,38 +387,43 @@
- # For ext2.mod.
- ext2_mod_SOURCES = fs/ext2.c
--CLEANFILES += ext2.mod mod-ext2.o mod-ext2.c pre-ext2.o ext2_mod-fs_ext2.o def-ext2.lst und-ext2.lst
--MOSTLYCLEANFILES += ext2_mod-fs_ext2.d
-+CLEANFILES += ext2.mod mod-ext2.o mod-ext2.c pre-ext2.o ext2_mod-fs_ext2.o und-ext2.lst
-+ifneq ($(ext2_mod_EXPORTS),no)
-+CLEANFILES += def-ext2.lst
- DEFSYMFILES += def-ext2.lst
-+endif
-+MOSTLYCLEANFILES += ext2_mod-fs_ext2.d
- UNDSYMFILES += und-ext2.lst
- ext2.mod: pre-ext2.o mod-ext2.o
-       -rm -f $@
--      $(LD) $(ext2_mod_LDFLAGS) $(LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(ext2_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
-       $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
- pre-ext2.o: ext2_mod-fs_ext2.o
-       -rm -f $@
--      $(LD) $(ext2_mod_LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(ext2_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
- mod-ext2.o: mod-ext2.c
--      $(CC) $(CPPFLAGS) $(CFLAGS) $(ext2_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ext2_mod_CFLAGS) -c -o $@ $<
- mod-ext2.c: moddep.lst genmodsrc.sh
-       sh $(srcdir)/genmodsrc.sh 'ext2' $< > $@ || (rm -f $@; exit 1)
-+ifneq ($(ext2_mod_EXPORTS),no)
- def-ext2.lst: pre-ext2.o
-       $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 ext2/' > $@
-+endif
- und-ext2.lst: pre-ext2.o
-       echo 'ext2' > $@
-       $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
- ext2_mod-fs_ext2.o: fs/ext2.c
--      $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(ext2_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ext2_mod_CFLAGS) -c -o $@ $<
- ext2_mod-fs_ext2.d: fs/ext2.c
--      set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(ext2_mod_CFLAGS) -M $<        | sed 's,ext2\.o[ :]*,ext2_mod-fs_ext2.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ext2_mod_CFLAGS) -M $<           | sed 's,ext2\.o[ :]*,ext2_mod-fs_ext2.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
- -include ext2_mod-fs_ext2.d
-@@ -435,10 +432,10 @@
- FSFILES += fs-ext2_mod-fs_ext2.lst
- cmd-ext2_mod-fs_ext2.lst: fs/ext2.c gencmdlist.sh
--      set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(ext2_mod_CFLAGS) -E $<        | sh $(srcdir)/gencmdlist.sh ext2 > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ext2_mod_CFLAGS) -E $<           | sh $(srcdir)/gencmdlist.sh ext2 > $@ || (rm -f $@; exit 1)
- fs-ext2_mod-fs_ext2.lst: fs/ext2.c genfslist.sh
--      set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(ext2_mod_CFLAGS) -E $<        | sh $(srcdir)/genfslist.sh ext2 > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ext2_mod_CFLAGS) -E $<           | sh $(srcdir)/genfslist.sh ext2 > $@ || (rm -f $@; exit 1)
- ext2_mod_CFLAGS = $(COMMON_CFLAGS)
-@@ -446,38 +443,43 @@
- # For ufs.mod.
- ufs_mod_SOURCES = fs/ufs.c
--CLEANFILES += ufs.mod mod-ufs.o mod-ufs.c pre-ufs.o ufs_mod-fs_ufs.o def-ufs.lst und-ufs.lst
--MOSTLYCLEANFILES += ufs_mod-fs_ufs.d
-+CLEANFILES += ufs.mod mod-ufs.o mod-ufs.c pre-ufs.o ufs_mod-fs_ufs.o und-ufs.lst
-+ifneq ($(ufs_mod_EXPORTS),no)
-+CLEANFILES += def-ufs.lst
- DEFSYMFILES += def-ufs.lst
-+endif
-+MOSTLYCLEANFILES += ufs_mod-fs_ufs.d
- UNDSYMFILES += und-ufs.lst
- ufs.mod: pre-ufs.o mod-ufs.o
-       -rm -f $@
--      $(LD) $(ufs_mod_LDFLAGS) $(LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(ufs_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
-       $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
- pre-ufs.o: ufs_mod-fs_ufs.o
-       -rm -f $@
--      $(LD) $(ufs_mod_LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(ufs_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
- mod-ufs.o: mod-ufs.c
--      $(CC) $(CPPFLAGS) $(CFLAGS) $(ufs_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ufs_mod_CFLAGS) -c -o $@ $<
- mod-ufs.c: moddep.lst genmodsrc.sh
-       sh $(srcdir)/genmodsrc.sh 'ufs' $< > $@ || (rm -f $@; exit 1)
-+ifneq ($(ufs_mod_EXPORTS),no)
- def-ufs.lst: pre-ufs.o
-       $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 ufs/' > $@
-+endif
- und-ufs.lst: pre-ufs.o
-       echo 'ufs' > $@
-       $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
- ufs_mod-fs_ufs.o: fs/ufs.c
--      $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(ufs_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ufs_mod_CFLAGS) -c -o $@ $<
- ufs_mod-fs_ufs.d: fs/ufs.c
--      set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(ufs_mod_CFLAGS) -M $<         | sed 's,ufs\.o[ :]*,ufs_mod-fs_ufs.o $@ : ,g' > $@;    [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ufs_mod_CFLAGS) -M $<    | sed 's,ufs\.o[ :]*,ufs_mod-fs_ufs.o $@ : ,g' > $@;    [ -s $@ ] || rm -f $@
- -include ufs_mod-fs_ufs.d
-@@ -486,10 +488,10 @@
- FSFILES += fs-ufs_mod-fs_ufs.lst
- cmd-ufs_mod-fs_ufs.lst: fs/ufs.c gencmdlist.sh
--      set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(ufs_mod_CFLAGS) -E $<         | sh $(srcdir)/gencmdlist.sh ufs > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ufs_mod_CFLAGS) -E $<    | sh $(srcdir)/gencmdlist.sh ufs > $@ || (rm -f $@; exit 1)
- fs-ufs_mod-fs_ufs.lst: fs/ufs.c genfslist.sh
--      set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(ufs_mod_CFLAGS) -E $<         | sh $(srcdir)/genfslist.sh ufs > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ufs_mod_CFLAGS) -E $<    | sh $(srcdir)/genfslist.sh ufs > $@ || (rm -f $@; exit 1)
- ufs_mod_CFLAGS = $(COMMON_CFLAGS)
-@@ -497,38 +499,43 @@
- # For minix.mod.
- minix_mod_SOURCES = fs/minix.c
--CLEANFILES += minix.mod mod-minix.o mod-minix.c pre-minix.o minix_mod-fs_minix.o def-minix.lst und-minix.lst
--MOSTLYCLEANFILES += minix_mod-fs_minix.d
-+CLEANFILES += minix.mod mod-minix.o mod-minix.c pre-minix.o minix_mod-fs_minix.o und-minix.lst
-+ifneq ($(minix_mod_EXPORTS),no)
-+CLEANFILES += def-minix.lst
- DEFSYMFILES += def-minix.lst
-+endif
-+MOSTLYCLEANFILES += minix_mod-fs_minix.d
- UNDSYMFILES += und-minix.lst
- minix.mod: pre-minix.o mod-minix.o
-       -rm -f $@
--      $(LD) $(minix_mod_LDFLAGS) $(LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(minix_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
-       $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
- pre-minix.o: minix_mod-fs_minix.o
-       -rm -f $@
--      $(LD) $(minix_mod_LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(minix_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
- mod-minix.o: mod-minix.c
--      $(CC) $(CPPFLAGS) $(CFLAGS) $(minix_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(minix_mod_CFLAGS) -c -o $@ $<
- mod-minix.c: moddep.lst genmodsrc.sh
-       sh $(srcdir)/genmodsrc.sh 'minix' $< > $@ || (rm -f $@; exit 1)
-+ifneq ($(minix_mod_EXPORTS),no)
- def-minix.lst: pre-minix.o
-       $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 minix/' > $@
-+endif
- und-minix.lst: pre-minix.o
-       echo 'minix' > $@
-       $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
- minix_mod-fs_minix.o: fs/minix.c
--      $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(minix_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(minix_mod_CFLAGS) -c -o $@ $<
- minix_mod-fs_minix.d: fs/minix.c
--      set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(minix_mod_CFLAGS) -M $<       | sed 's,minix\.o[ :]*,minix_mod-fs_minix.o $@ : ,g' > $@;      [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(minix_mod_CFLAGS) -M $<          | sed 's,minix\.o[ :]*,minix_mod-fs_minix.o $@ : ,g' > $@;      [ -s $@ ] || rm -f $@
- -include minix_mod-fs_minix.d
-@@ -537,10 +544,10 @@
- FSFILES += fs-minix_mod-fs_minix.lst
- cmd-minix_mod-fs_minix.lst: fs/minix.c gencmdlist.sh
--      set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(minix_mod_CFLAGS) -E $<       | sh $(srcdir)/gencmdlist.sh minix > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(minix_mod_CFLAGS) -E $<          | sh $(srcdir)/gencmdlist.sh minix > $@ || (rm -f $@; exit 1)
- fs-minix_mod-fs_minix.lst: fs/minix.c genfslist.sh
--      set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(minix_mod_CFLAGS) -E $<       | sh $(srcdir)/genfslist.sh minix > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(minix_mod_CFLAGS) -E $<          | sh $(srcdir)/genfslist.sh minix > $@ || (rm -f $@; exit 1)
- minix_mod_CFLAGS = $(COMMON_CFLAGS)
-@@ -548,38 +555,43 @@
- # For hfs.mod.
- hfs_mod_SOURCES = fs/hfs.c
--CLEANFILES += hfs.mod mod-hfs.o mod-hfs.c pre-hfs.o hfs_mod-fs_hfs.o def-hfs.lst und-hfs.lst
--MOSTLYCLEANFILES += hfs_mod-fs_hfs.d
-+CLEANFILES += hfs.mod mod-hfs.o mod-hfs.c pre-hfs.o hfs_mod-fs_hfs.o und-hfs.lst
-+ifneq ($(hfs_mod_EXPORTS),no)
-+CLEANFILES += def-hfs.lst
- DEFSYMFILES += def-hfs.lst
-+endif
-+MOSTLYCLEANFILES += hfs_mod-fs_hfs.d
- UNDSYMFILES += und-hfs.lst
- hfs.mod: pre-hfs.o mod-hfs.o
-       -rm -f $@
--      $(LD) $(hfs_mod_LDFLAGS) $(LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(hfs_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
-       $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
- pre-hfs.o: hfs_mod-fs_hfs.o
-       -rm -f $@
--      $(LD) $(hfs_mod_LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(hfs_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
- mod-hfs.o: mod-hfs.c
--      $(CC) $(CPPFLAGS) $(CFLAGS) $(hfs_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hfs_mod_CFLAGS) -c -o $@ $<
- mod-hfs.c: moddep.lst genmodsrc.sh
-       sh $(srcdir)/genmodsrc.sh 'hfs' $< > $@ || (rm -f $@; exit 1)
-+ifneq ($(hfs_mod_EXPORTS),no)
- def-hfs.lst: pre-hfs.o
-       $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 hfs/' > $@
-+endif
- und-hfs.lst: pre-hfs.o
-       echo 'hfs' > $@
-       $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
- hfs_mod-fs_hfs.o: fs/hfs.c
--      $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(hfs_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hfs_mod_CFLAGS) -c -o $@ $<
- hfs_mod-fs_hfs.d: fs/hfs.c
--      set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(hfs_mod_CFLAGS) -M $<         | sed 's,hfs\.o[ :]*,hfs_mod-fs_hfs.o $@ : ,g' > $@;    [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hfs_mod_CFLAGS) -M $<    | sed 's,hfs\.o[ :]*,hfs_mod-fs_hfs.o $@ : ,g' > $@;    [ -s $@ ] || rm -f $@
- -include hfs_mod-fs_hfs.d
-@@ -588,10 +600,10 @@
- FSFILES += fs-hfs_mod-fs_hfs.lst
- cmd-hfs_mod-fs_hfs.lst: fs/hfs.c gencmdlist.sh
--      set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(hfs_mod_CFLAGS) -E $<         | sh $(srcdir)/gencmdlist.sh hfs > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hfs_mod_CFLAGS) -E $<    | sh $(srcdir)/gencmdlist.sh hfs > $@ || (rm -f $@; exit 1)
- fs-hfs_mod-fs_hfs.lst: fs/hfs.c genfslist.sh
--      set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(hfs_mod_CFLAGS) -E $<         | sh $(srcdir)/genfslist.sh hfs > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hfs_mod_CFLAGS) -E $<    | sh $(srcdir)/genfslist.sh hfs > $@ || (rm -f $@; exit 1)
- hfs_mod_CFLAGS = $(COMMON_CFLAGS)
-@@ -599,38 +611,43 @@
- # For jfs.mod.
- jfs_mod_SOURCES = fs/jfs.c
--CLEANFILES += jfs.mod mod-jfs.o mod-jfs.c pre-jfs.o jfs_mod-fs_jfs.o def-jfs.lst und-jfs.lst
--MOSTLYCLEANFILES += jfs_mod-fs_jfs.d
-+CLEANFILES += jfs.mod mod-jfs.o mod-jfs.c pre-jfs.o jfs_mod-fs_jfs.o und-jfs.lst
-+ifneq ($(jfs_mod_EXPORTS),no)
-+CLEANFILES += def-jfs.lst
- DEFSYMFILES += def-jfs.lst
-+endif
-+MOSTLYCLEANFILES += jfs_mod-fs_jfs.d
- UNDSYMFILES += und-jfs.lst
- jfs.mod: pre-jfs.o mod-jfs.o
-       -rm -f $@
--      $(LD) $(jfs_mod_LDFLAGS) $(LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(jfs_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
-       $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
- pre-jfs.o: jfs_mod-fs_jfs.o
-       -rm -f $@
--      $(LD) $(jfs_mod_LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(jfs_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
- mod-jfs.o: mod-jfs.c
--      $(CC) $(CPPFLAGS) $(CFLAGS) $(jfs_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(jfs_mod_CFLAGS) -c -o $@ $<
- mod-jfs.c: moddep.lst genmodsrc.sh
-       sh $(srcdir)/genmodsrc.sh 'jfs' $< > $@ || (rm -f $@; exit 1)
-+ifneq ($(jfs_mod_EXPORTS),no)
- def-jfs.lst: pre-jfs.o
-       $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 jfs/' > $@
-+endif
- und-jfs.lst: pre-jfs.o
-       echo 'jfs' > $@
-       $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
- jfs_mod-fs_jfs.o: fs/jfs.c
--      $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(jfs_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(jfs_mod_CFLAGS) -c -o $@ $<
- jfs_mod-fs_jfs.d: fs/jfs.c
--      set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(jfs_mod_CFLAGS) -M $<         | sed 's,jfs\.o[ :]*,jfs_mod-fs_jfs.o $@ : ,g' > $@;    [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(jfs_mod_CFLAGS) -M $<    | sed 's,jfs\.o[ :]*,jfs_mod-fs_jfs.o $@ : ,g' > $@;    [ -s $@ ] || rm -f $@
- -include jfs_mod-fs_jfs.d
-@@ -639,10 +656,10 @@
- FSFILES += fs-jfs_mod-fs_jfs.lst
- cmd-jfs_mod-fs_jfs.lst: fs/jfs.c gencmdlist.sh
--      set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(jfs_mod_CFLAGS) -E $<         | sh $(srcdir)/gencmdlist.sh jfs > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(jfs_mod_CFLAGS) -E $<    | sh $(srcdir)/gencmdlist.sh jfs > $@ || (rm -f $@; exit 1)
- fs-jfs_mod-fs_jfs.lst: fs/jfs.c genfslist.sh
--      set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(jfs_mod_CFLAGS) -E $<         | sh $(srcdir)/genfslist.sh jfs > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(jfs_mod_CFLAGS) -E $<    | sh $(srcdir)/genfslist.sh jfs > $@ || (rm -f $@; exit 1)
- jfs_mod_CFLAGS = $(COMMON_CFLAGS)
-@@ -655,38 +672,43 @@
- # For xfs.mod.
- xfs_mod_SOURCES = fs/xfs.c
--CLEANFILES += xfs.mod mod-xfs.o mod-xfs.c pre-xfs.o xfs_mod-fs_xfs.o def-xfs.lst und-xfs.lst
--MOSTLYCLEANFILES += xfs_mod-fs_xfs.d
-+CLEANFILES += xfs.mod mod-xfs.o mod-xfs.c pre-xfs.o xfs_mod-fs_xfs.o und-xfs.lst
-+ifneq ($(xfs_mod_EXPORTS),no)
-+CLEANFILES += def-xfs.lst
- DEFSYMFILES += def-xfs.lst
-+endif
-+MOSTLYCLEANFILES += xfs_mod-fs_xfs.d
- UNDSYMFILES += und-xfs.lst
- xfs.mod: pre-xfs.o mod-xfs.o
-       -rm -f $@
--      $(LD) $(xfs_mod_LDFLAGS) $(LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(xfs_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
-       $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
- pre-xfs.o: xfs_mod-fs_xfs.o
-       -rm -f $@
--      $(LD) $(xfs_mod_LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(xfs_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
- mod-xfs.o: mod-xfs.c
--      $(CC) $(CPPFLAGS) $(CFLAGS) $(xfs_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(xfs_mod_CFLAGS) -c -o $@ $<
- mod-xfs.c: moddep.lst genmodsrc.sh
-       sh $(srcdir)/genmodsrc.sh 'xfs' $< > $@ || (rm -f $@; exit 1)
-+ifneq ($(xfs_mod_EXPORTS),no)
- def-xfs.lst: pre-xfs.o
-       $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 xfs/' > $@
-+endif
- und-xfs.lst: pre-xfs.o
-       echo 'xfs' > $@
-       $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
- xfs_mod-fs_xfs.o: fs/xfs.c
--      $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(xfs_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(xfs_mod_CFLAGS) -c -o $@ $<
- xfs_mod-fs_xfs.d: fs/xfs.c
--      set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(xfs_mod_CFLAGS) -M $<         | sed 's,xfs\.o[ :]*,xfs_mod-fs_xfs.o $@ : ,g' > $@;    [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(xfs_mod_CFLAGS) -M $<    | sed 's,xfs\.o[ :]*,xfs_mod-fs_xfs.o $@ : ,g' > $@;    [ -s $@ ] || rm -f $@
- -include xfs_mod-fs_xfs.d
-@@ -695,10 +717,10 @@
- FSFILES += fs-xfs_mod-fs_xfs.lst
- cmd-xfs_mod-fs_xfs.lst: fs/xfs.c gencmdlist.sh
--      set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(xfs_mod_CFLAGS) -E $<         | sh $(srcdir)/gencmdlist.sh xfs > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(xfs_mod_CFLAGS) -E $<    | sh $(srcdir)/gencmdlist.sh xfs > $@ || (rm -f $@; exit 1)
- fs-xfs_mod-fs_xfs.lst: fs/xfs.c genfslist.sh
--      set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(xfs_mod_CFLAGS) -E $<         | sh $(srcdir)/genfslist.sh xfs > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(xfs_mod_CFLAGS) -E $<    | sh $(srcdir)/genfslist.sh xfs > $@ || (rm -f $@; exit 1)
- xfs_mod_CFLAGS = $(COMMON_CFLAGS)
-@@ -706,38 +728,43 @@
- # For affs.mod.
- affs_mod_SOURCES = fs/affs.c
--CLEANFILES += affs.mod mod-affs.o mod-affs.c pre-affs.o affs_mod-fs_affs.o def-affs.lst und-affs.lst
--MOSTLYCLEANFILES += affs_mod-fs_affs.d
-+CLEANFILES += affs.mod mod-affs.o mod-affs.c pre-affs.o affs_mod-fs_affs.o und-affs.lst
-+ifneq ($(affs_mod_EXPORTS),no)
-+CLEANFILES += def-affs.lst
- DEFSYMFILES += def-affs.lst
-+endif
-+MOSTLYCLEANFILES += affs_mod-fs_affs.d
- UNDSYMFILES += und-affs.lst
- affs.mod: pre-affs.o mod-affs.o
-       -rm -f $@
--      $(LD) $(affs_mod_LDFLAGS) $(LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(affs_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
-       $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
- pre-affs.o: affs_mod-fs_affs.o
-       -rm -f $@
--      $(LD) $(affs_mod_LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(affs_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
- mod-affs.o: mod-affs.c
--      $(CC) $(CPPFLAGS) $(CFLAGS) $(affs_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(affs_mod_CFLAGS) -c -o $@ $<
- mod-affs.c: moddep.lst genmodsrc.sh
-       sh $(srcdir)/genmodsrc.sh 'affs' $< > $@ || (rm -f $@; exit 1)
-+ifneq ($(affs_mod_EXPORTS),no)
- def-affs.lst: pre-affs.o
-       $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 affs/' > $@
-+endif
- und-affs.lst: pre-affs.o
-       echo 'affs' > $@
-       $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
- affs_mod-fs_affs.o: fs/affs.c
--      $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(affs_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(affs_mod_CFLAGS) -c -o $@ $<
- affs_mod-fs_affs.d: fs/affs.c
--      set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(affs_mod_CFLAGS) -M $<        | sed 's,affs\.o[ :]*,affs_mod-fs_affs.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(affs_mod_CFLAGS) -M $<           | sed 's,affs\.o[ :]*,affs_mod-fs_affs.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
- -include affs_mod-fs_affs.d
-@@ -746,10 +773,10 @@
- FSFILES += fs-affs_mod-fs_affs.lst
- cmd-affs_mod-fs_affs.lst: fs/affs.c gencmdlist.sh
--      set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(affs_mod_CFLAGS) -E $<        | sh $(srcdir)/gencmdlist.sh affs > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(affs_mod_CFLAGS) -E $<           | sh $(srcdir)/gencmdlist.sh affs > $@ || (rm -f $@; exit 1)
- fs-affs_mod-fs_affs.lst: fs/affs.c genfslist.sh
--      set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(affs_mod_CFLAGS) -E $<        | sh $(srcdir)/genfslist.sh affs > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(affs_mod_CFLAGS) -E $<           | sh $(srcdir)/genfslist.sh affs > $@ || (rm -f $@; exit 1)
- affs_mod_CFLAGS = $(COMMON_CFLAGS)
-@@ -757,38 +784,43 @@
- # For sfs.mod.
- sfs_mod_SOURCES = fs/sfs.c
--CLEANFILES += sfs.mod mod-sfs.o mod-sfs.c pre-sfs.o sfs_mod-fs_sfs.o def-sfs.lst und-sfs.lst
--MOSTLYCLEANFILES += sfs_mod-fs_sfs.d
-+CLEANFILES += sfs.mod mod-sfs.o mod-sfs.c pre-sfs.o sfs_mod-fs_sfs.o und-sfs.lst
-+ifneq ($(sfs_mod_EXPORTS),no)
-+CLEANFILES += def-sfs.lst
- DEFSYMFILES += def-sfs.lst
-+endif
-+MOSTLYCLEANFILES += sfs_mod-fs_sfs.d
- UNDSYMFILES += und-sfs.lst
- sfs.mod: pre-sfs.o mod-sfs.o
-       -rm -f $@
--      $(LD) $(sfs_mod_LDFLAGS) $(LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(sfs_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
-       $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
- pre-sfs.o: sfs_mod-fs_sfs.o
-       -rm -f $@
--      $(LD) $(sfs_mod_LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(sfs_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
- mod-sfs.o: mod-sfs.c
--      $(CC) $(CPPFLAGS) $(CFLAGS) $(sfs_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sfs_mod_CFLAGS) -c -o $@ $<
- mod-sfs.c: moddep.lst genmodsrc.sh
-       sh $(srcdir)/genmodsrc.sh 'sfs' $< > $@ || (rm -f $@; exit 1)
-+ifneq ($(sfs_mod_EXPORTS),no)
- def-sfs.lst: pre-sfs.o
-       $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 sfs/' > $@
-+endif
- und-sfs.lst: pre-sfs.o
-       echo 'sfs' > $@
-       $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
- sfs_mod-fs_sfs.o: fs/sfs.c
--      $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(sfs_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sfs_mod_CFLAGS) -c -o $@ $<
- sfs_mod-fs_sfs.d: fs/sfs.c
--      set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(sfs_mod_CFLAGS) -M $<         | sed 's,sfs\.o[ :]*,sfs_mod-fs_sfs.o $@ : ,g' > $@;    [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sfs_mod_CFLAGS) -M $<    | sed 's,sfs\.o[ :]*,sfs_mod-fs_sfs.o $@ : ,g' > $@;    [ -s $@ ] || rm -f $@
- -include sfs_mod-fs_sfs.d
-@@ -797,10 +829,10 @@
- FSFILES += fs-sfs_mod-fs_sfs.lst
- cmd-sfs_mod-fs_sfs.lst: fs/sfs.c gencmdlist.sh
--      set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(sfs_mod_CFLAGS) -E $<         | sh $(srcdir)/gencmdlist.sh sfs > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sfs_mod_CFLAGS) -E $<    | sh $(srcdir)/gencmdlist.sh sfs > $@ || (rm -f $@; exit 1)
- fs-sfs_mod-fs_sfs.lst: fs/sfs.c genfslist.sh
--      set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(sfs_mod_CFLAGS) -E $<         | sh $(srcdir)/genfslist.sh sfs > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sfs_mod_CFLAGS) -E $<    | sh $(srcdir)/genfslist.sh sfs > $@ || (rm -f $@; exit 1)
- sfs_mod_CFLAGS = $(COMMON_CFLAGS)
-@@ -818,43 +850,48 @@
- # For normal.mod.
- normal_mod_SOURCES = normal/arg.c normal/cmdline.c normal/command.c   \
--      normal/completion.c normal/context.c normal/execute.c           \
-+      normal/completion.c normal/execute.c                            \
-       normal/function.c normal/lexer.c normal/main.c normal/menu.c    \
-       normal/menu_entry.c normal/misc.c normal/script.c               \
-       normal/sparc64/setjmp.S                                         \
-       grub_script.tab.c
--CLEANFILES += normal.mod mod-normal.o mod-normal.c pre-normal.o normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_context.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-normal_script.o normal_mod-normal_sparc64_setjmp.o normal_mod-grub_script_tab.o def-normal.lst und-normal.lst
--MOSTLYCLEANFILES += normal_mod-normal_arg.d normal_mod-normal_cmdline.d normal_mod-normal_command.d normal_mod-normal_completion.d normal_mod-normal_context.d normal_mod-normal_execute.d normal_mod-normal_function.d normal_mod-normal_lexer.d normal_mod-normal_main.d normal_mod-normal_menu.d normal_mod-normal_menu_entry.d normal_mod-normal_misc.d normal_mod-normal_script.d normal_mod-normal_sparc64_setjmp.d normal_mod-grub_script_tab.d
-+CLEANFILES += normal.mod mod-normal.o mod-normal.c pre-normal.o normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-normal_script.o normal_mod-normal_sparc64_setjmp.o normal_mod-grub_script_tab.o und-normal.lst
-+ifneq ($(normal_mod_EXPORTS),no)
-+CLEANFILES += def-normal.lst
- DEFSYMFILES += def-normal.lst
-+endif
-+MOSTLYCLEANFILES += normal_mod-normal_arg.d normal_mod-normal_cmdline.d normal_mod-normal_command.d normal_mod-normal_completion.d normal_mod-normal_execute.d normal_mod-normal_function.d normal_mod-normal_lexer.d normal_mod-normal_main.d normal_mod-normal_menu.d normal_mod-normal_menu_entry.d normal_mod-normal_misc.d normal_mod-normal_script.d normal_mod-normal_sparc64_setjmp.d normal_mod-grub_script_tab.d
- UNDSYMFILES += und-normal.lst
- normal.mod: pre-normal.o mod-normal.o
-       -rm -f $@
--      $(LD) $(normal_mod_LDFLAGS) $(LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(normal_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
-       $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
--pre-normal.o: normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_context.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-normal_script.o normal_mod-normal_sparc64_setjmp.o normal_mod-grub_script_tab.o
-+pre-normal.o: normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-normal_script.o normal_mod-normal_sparc64_setjmp.o normal_mod-grub_script_tab.o
-       -rm -f $@
--      $(LD) $(normal_mod_LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(normal_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
- mod-normal.o: mod-normal.c
--      $(CC) $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
- mod-normal.c: moddep.lst genmodsrc.sh
-       sh $(srcdir)/genmodsrc.sh 'normal' $< > $@ || (rm -f $@; exit 1)
-+ifneq ($(normal_mod_EXPORTS),no)
- def-normal.lst: pre-normal.o
-       $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 normal/' > $@
-+endif
- und-normal.lst: pre-normal.o
-       echo 'normal' > $@
-       $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
- normal_mod-normal_arg.o: normal/arg.c
--      $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
- normal_mod-normal_arg.d: normal/arg.c
--      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -M $<      | sed 's,arg\.o[ :]*,normal_mod-normal_arg.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -M $<         | sed 's,arg\.o[ :]*,normal_mod-normal_arg.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
- -include normal_mod-normal_arg.d
-@@ -863,17 +900,17 @@
- FSFILES += fs-normal_mod-normal_arg.lst
- cmd-normal_mod-normal_arg.lst: normal/arg.c gencmdlist.sh
--      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $<         | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
- fs-normal_mod-normal_arg.lst: normal/arg.c genfslist.sh
--      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $<         | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
- normal_mod-normal_cmdline.o: normal/cmdline.c
--      $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
- normal_mod-normal_cmdline.d: normal/cmdline.c
--      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -M $<      | sed 's,cmdline\.o[ :]*,normal_mod-normal_cmdline.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -M $<         | sed 's,cmdline\.o[ :]*,normal_mod-normal_cmdline.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
- -include normal_mod-normal_cmdline.d
-@@ -882,17 +919,17 @@
- FSFILES += fs-normal_mod-normal_cmdline.lst
- cmd-normal_mod-normal_cmdline.lst: normal/cmdline.c gencmdlist.sh
--      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $<         | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
- fs-normal_mod-normal_cmdline.lst: normal/cmdline.c genfslist.sh
--      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $<         | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
- normal_mod-normal_command.o: normal/command.c
--      $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
- normal_mod-normal_command.d: normal/command.c
--      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -M $<      | sed 's,command\.o[ :]*,normal_mod-normal_command.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -M $<         | sed 's,command\.o[ :]*,normal_mod-normal_command.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
- -include normal_mod-normal_command.d
-@@ -901,17 +938,17 @@
- FSFILES += fs-normal_mod-normal_command.lst
- cmd-normal_mod-normal_command.lst: normal/command.c gencmdlist.sh
--      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $<         | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
- fs-normal_mod-normal_command.lst: normal/command.c genfslist.sh
--      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $<         | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
- normal_mod-normal_completion.o: normal/completion.c
--      $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
- normal_mod-normal_completion.d: normal/completion.c
--      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -M $<      | sed 's,completion\.o[ :]*,normal_mod-normal_completion.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -M $<         | sed 's,completion\.o[ :]*,normal_mod-normal_completion.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
- -include normal_mod-normal_completion.d
-@@ -920,36 +957,17 @@
- FSFILES += fs-normal_mod-normal_completion.lst
- cmd-normal_mod-normal_completion.lst: normal/completion.c gencmdlist.sh
--      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $<         | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
- fs-normal_mod-normal_completion.lst: normal/completion.c genfslist.sh
--      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
--
--
--normal_mod-normal_context.o: normal/context.c
--      $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
--
--normal_mod-normal_context.d: normal/context.c
--      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -M $<      | sed 's,context\.o[ :]*,normal_mod-normal_context.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
--
---include normal_mod-normal_context.d
--
--CLEANFILES += cmd-normal_mod-normal_context.lst fs-normal_mod-normal_context.lst
--COMMANDFILES += cmd-normal_mod-normal_context.lst
--FSFILES += fs-normal_mod-normal_context.lst
--
--cmd-normal_mod-normal_context.lst: normal/context.c gencmdlist.sh
--      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
--
--fs-normal_mod-normal_context.lst: normal/context.c genfslist.sh
--      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $<         | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
- normal_mod-normal_execute.o: normal/execute.c
--      $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
- normal_mod-normal_execute.d: normal/execute.c
--      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -M $<      | sed 's,execute\.o[ :]*,normal_mod-normal_execute.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -M $<         | sed 's,execute\.o[ :]*,normal_mod-normal_execute.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
- -include normal_mod-normal_execute.d
-@@ -958,17 +976,17 @@
- FSFILES += fs-normal_mod-normal_execute.lst
- cmd-normal_mod-normal_execute.lst: normal/execute.c gencmdlist.sh
--      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $<         | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
- fs-normal_mod-normal_execute.lst: normal/execute.c genfslist.sh
--      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $<         | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
- normal_mod-normal_function.o: normal/function.c
--      $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
- normal_mod-normal_function.d: normal/function.c
--      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -M $<      | sed 's,function\.o[ :]*,normal_mod-normal_function.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -M $<         | sed 's,function\.o[ :]*,normal_mod-normal_function.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
- -include normal_mod-normal_function.d
-@@ -977,17 +995,17 @@
- FSFILES += fs-normal_mod-normal_function.lst
- cmd-normal_mod-normal_function.lst: normal/function.c gencmdlist.sh
--      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $<         | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
- fs-normal_mod-normal_function.lst: normal/function.c genfslist.sh
--      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $<         | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
- normal_mod-normal_lexer.o: normal/lexer.c
--      $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
- normal_mod-normal_lexer.d: normal/lexer.c
--      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -M $<      | sed 's,lexer\.o[ :]*,normal_mod-normal_lexer.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -M $<         | sed 's,lexer\.o[ :]*,normal_mod-normal_lexer.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
- -include normal_mod-normal_lexer.d
-@@ -996,17 +1014,17 @@
- FSFILES += fs-normal_mod-normal_lexer.lst
- cmd-normal_mod-normal_lexer.lst: normal/lexer.c gencmdlist.sh
--      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $<         | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
- fs-normal_mod-normal_lexer.lst: normal/lexer.c genfslist.sh
--      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $<         | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
- normal_mod-normal_main.o: normal/main.c
--      $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
- normal_mod-normal_main.d: normal/main.c
--      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -M $<      | sed 's,main\.o[ :]*,normal_mod-normal_main.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -M $<         | sed 's,main\.o[ :]*,normal_mod-normal_main.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
- -include normal_mod-normal_main.d
-@@ -1015,17 +1033,17 @@
- FSFILES += fs-normal_mod-normal_main.lst
- cmd-normal_mod-normal_main.lst: normal/main.c gencmdlist.sh
--      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $<         | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
- fs-normal_mod-normal_main.lst: normal/main.c genfslist.sh
--      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $<         | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
- normal_mod-normal_menu.o: normal/menu.c
--      $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
- normal_mod-normal_menu.d: normal/menu.c
--      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -M $<      | sed 's,menu\.o[ :]*,normal_mod-normal_menu.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -M $<         | sed 's,menu\.o[ :]*,normal_mod-normal_menu.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
- -include normal_mod-normal_menu.d
-@@ -1034,17 +1052,17 @@
- FSFILES += fs-normal_mod-normal_menu.lst
- cmd-normal_mod-normal_menu.lst: normal/menu.c gencmdlist.sh
--      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $<         | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
- fs-normal_mod-normal_menu.lst: normal/menu.c genfslist.sh
--      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $<         | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
- normal_mod-normal_menu_entry.o: normal/menu_entry.c
--      $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
- normal_mod-normal_menu_entry.d: normal/menu_entry.c
--      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -M $<      | sed 's,menu_entry\.o[ :]*,normal_mod-normal_menu_entry.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -M $<         | sed 's,menu_entry\.o[ :]*,normal_mod-normal_menu_entry.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
- -include normal_mod-normal_menu_entry.d
-@@ -1053,17 +1071,17 @@
- FSFILES += fs-normal_mod-normal_menu_entry.lst
- cmd-normal_mod-normal_menu_entry.lst: normal/menu_entry.c gencmdlist.sh
--      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $<         | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
- fs-normal_mod-normal_menu_entry.lst: normal/menu_entry.c genfslist.sh
--      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $<         | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
- normal_mod-normal_misc.o: normal/misc.c
--      $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
- normal_mod-normal_misc.d: normal/misc.c
--      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -M $<      | sed 's,misc\.o[ :]*,normal_mod-normal_misc.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -M $<         | sed 's,misc\.o[ :]*,normal_mod-normal_misc.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
- -include normal_mod-normal_misc.d
-@@ -1072,17 +1090,17 @@
- FSFILES += fs-normal_mod-normal_misc.lst
- cmd-normal_mod-normal_misc.lst: normal/misc.c gencmdlist.sh
--      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $<         | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
- fs-normal_mod-normal_misc.lst: normal/misc.c genfslist.sh
--      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $<         | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
- normal_mod-normal_script.o: normal/script.c
--      $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
- normal_mod-normal_script.d: normal/script.c
--      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -M $<      | sed 's,script\.o[ :]*,normal_mod-normal_script.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -M $<         | sed 's,script\.o[ :]*,normal_mod-normal_script.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
- -include normal_mod-normal_script.d
-@@ -1091,17 +1109,17 @@
- FSFILES += fs-normal_mod-normal_script.lst
- cmd-normal_mod-normal_script.lst: normal/script.c gencmdlist.sh
--      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $<         | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
- fs-normal_mod-normal_script.lst: normal/script.c genfslist.sh
--      set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $<         | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
- normal_mod-normal_sparc64_setjmp.o: normal/sparc64/setjmp.S
--      $(CC) -Inormal/sparc64 -I$(srcdir)/normal/sparc64 $(CPPFLAGS) $(ASFLAGS) $(normal_mod_ASFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Inormal/sparc64 -I$(srcdir)/normal/sparc64 $(TARGET_CPPFLAGS) $(TARGET_ASFLAGS) $(normal_mod_ASFLAGS) -c -o $@ $<
- normal_mod-normal_sparc64_setjmp.d: normal/sparc64/setjmp.S
--      set -e;           $(CC) -Inormal/sparc64 -I$(srcdir)/normal/sparc64 $(CPPFLAGS) $(ASFLAGS) $(normal_mod_ASFLAGS) -M $<    | sed 's,setjmp\.o[ :]*,normal_mod-normal_sparc64_setjmp.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Inormal/sparc64 -I$(srcdir)/normal/sparc64 $(TARGET_CPPFLAGS) $(TARGET_ASFLAGS) $(normal_mod_ASFLAGS) -M $<       | sed 's,setjmp\.o[ :]*,normal_mod-normal_sparc64_setjmp.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
- -include normal_mod-normal_sparc64_setjmp.d
-@@ -1110,17 +1128,17 @@
- FSFILES += fs-normal_mod-normal_sparc64_setjmp.lst
- cmd-normal_mod-normal_sparc64_setjmp.lst: normal/sparc64/setjmp.S gencmdlist.sh
--      set -e;           $(CC) -Inormal/sparc64 -I$(srcdir)/normal/sparc64 $(CPPFLAGS) $(ASFLAGS) $(normal_mod_ASFLAGS) -E $<    | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Inormal/sparc64 -I$(srcdir)/normal/sparc64 $(TARGET_CPPFLAGS) $(TARGET_ASFLAGS) $(normal_mod_ASFLAGS) -E $<       | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
- fs-normal_mod-normal_sparc64_setjmp.lst: normal/sparc64/setjmp.S genfslist.sh
--      set -e;           $(CC) -Inormal/sparc64 -I$(srcdir)/normal/sparc64 $(CPPFLAGS) $(ASFLAGS) $(normal_mod_ASFLAGS) -E $<    | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Inormal/sparc64 -I$(srcdir)/normal/sparc64 $(TARGET_CPPFLAGS) $(TARGET_ASFLAGS) $(normal_mod_ASFLAGS) -E $<       | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
- normal_mod-grub_script_tab.o: grub_script.tab.c
--      $(CC) -I. -I$(srcdir)/. $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
- normal_mod-grub_script_tab.d: grub_script.tab.c
--      set -e;           $(CC) -I. -I$(srcdir)/. $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -M $<        | sed 's,grub_script\.tab\.o[ :]*,normal_mod-grub_script_tab.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -M $<           | sed 's,grub_script\.tab\.o[ :]*,normal_mod-grub_script_tab.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
- -include normal_mod-grub_script_tab.d
-@@ -1129,10 +1147,10 @@
- FSFILES += fs-normal_mod-grub_script_tab.lst
- cmd-normal_mod-grub_script_tab.lst: grub_script.tab.c gencmdlist.sh
--      set -e;           $(CC) -I. -I$(srcdir)/. $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<        | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $<           | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
- fs-normal_mod-grub_script_tab.lst: grub_script.tab.c genfslist.sh
--      set -e;           $(CC) -I. -I$(srcdir)/. $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<        | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $<           | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
- normal_mod_CFLAGS = $(COMMON_CFLAGS)
-@@ -1141,38 +1159,43 @@
- # For hello.mod.
- hello_mod_SOURCES = hello/hello.c
--CLEANFILES += hello.mod mod-hello.o mod-hello.c pre-hello.o hello_mod-hello_hello.o def-hello.lst und-hello.lst
--MOSTLYCLEANFILES += hello_mod-hello_hello.d
-+CLEANFILES += hello.mod mod-hello.o mod-hello.c pre-hello.o hello_mod-hello_hello.o und-hello.lst
-+ifneq ($(hello_mod_EXPORTS),no)
-+CLEANFILES += def-hello.lst
- DEFSYMFILES += def-hello.lst
-+endif
-+MOSTLYCLEANFILES += hello_mod-hello_hello.d
- UNDSYMFILES += und-hello.lst
- hello.mod: pre-hello.o mod-hello.o
-       -rm -f $@
--      $(LD) $(hello_mod_LDFLAGS) $(LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(hello_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
-       $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
- pre-hello.o: hello_mod-hello_hello.o
-       -rm -f $@
--      $(LD) $(hello_mod_LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(hello_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
- mod-hello.o: mod-hello.c
--      $(CC) $(CPPFLAGS) $(CFLAGS) $(hello_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hello_mod_CFLAGS) -c -o $@ $<
- mod-hello.c: moddep.lst genmodsrc.sh
-       sh $(srcdir)/genmodsrc.sh 'hello' $< > $@ || (rm -f $@; exit 1)
-+ifneq ($(hello_mod_EXPORTS),no)
- def-hello.lst: pre-hello.o
-       $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 hello/' > $@
-+endif
- und-hello.lst: pre-hello.o
-       echo 'hello' > $@
-       $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
- hello_mod-hello_hello.o: hello/hello.c
--      $(CC) -Ihello -I$(srcdir)/hello $(CPPFLAGS) $(CFLAGS) $(hello_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Ihello -I$(srcdir)/hello $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hello_mod_CFLAGS) -c -o $@ $<
- hello_mod-hello_hello.d: hello/hello.c
--      set -e;           $(CC) -Ihello -I$(srcdir)/hello $(CPPFLAGS) $(CFLAGS) $(hello_mod_CFLAGS) -M $<         | sed 's,hello\.o[ :]*,hello_mod-hello_hello.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Ihello -I$(srcdir)/hello $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hello_mod_CFLAGS) -M $<    | sed 's,hello\.o[ :]*,hello_mod-hello_hello.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
- -include hello_mod-hello_hello.d
-@@ -1181,10 +1204,10 @@
- FSFILES += fs-hello_mod-hello_hello.lst
- cmd-hello_mod-hello_hello.lst: hello/hello.c gencmdlist.sh
--      set -e;           $(CC) -Ihello -I$(srcdir)/hello $(CPPFLAGS) $(CFLAGS) $(hello_mod_CFLAGS) -E $<         | sh $(srcdir)/gencmdlist.sh hello > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Ihello -I$(srcdir)/hello $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hello_mod_CFLAGS) -E $<    | sh $(srcdir)/gencmdlist.sh hello > $@ || (rm -f $@; exit 1)
- fs-hello_mod-hello_hello.lst: hello/hello.c genfslist.sh
--      set -e;           $(CC) -Ihello -I$(srcdir)/hello $(CPPFLAGS) $(CFLAGS) $(hello_mod_CFLAGS) -E $<         | sh $(srcdir)/genfslist.sh hello > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Ihello -I$(srcdir)/hello $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hello_mod_CFLAGS) -E $<    | sh $(srcdir)/genfslist.sh hello > $@ || (rm -f $@; exit 1)
- hello_mod_CFLAGS = $(COMMON_CFLAGS)
-@@ -1192,38 +1215,43 @@
- # For boot.mod.
- boot_mod_SOURCES = commands/boot.c
--CLEANFILES += boot.mod mod-boot.o mod-boot.c pre-boot.o boot_mod-commands_boot.o def-boot.lst und-boot.lst
--MOSTLYCLEANFILES += boot_mod-commands_boot.d
-+CLEANFILES += boot.mod mod-boot.o mod-boot.c pre-boot.o boot_mod-commands_boot.o und-boot.lst
-+ifneq ($(boot_mod_EXPORTS),no)
-+CLEANFILES += def-boot.lst
- DEFSYMFILES += def-boot.lst
-+endif
-+MOSTLYCLEANFILES += boot_mod-commands_boot.d
- UNDSYMFILES += und-boot.lst
- boot.mod: pre-boot.o mod-boot.o
-       -rm -f $@
--      $(LD) $(boot_mod_LDFLAGS) $(LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(boot_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
-       $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
- pre-boot.o: boot_mod-commands_boot.o
-       -rm -f $@
--      $(LD) $(boot_mod_LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(boot_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
- mod-boot.o: mod-boot.c
--      $(CC) $(CPPFLAGS) $(CFLAGS) $(boot_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(boot_mod_CFLAGS) -c -o $@ $<
- mod-boot.c: moddep.lst genmodsrc.sh
-       sh $(srcdir)/genmodsrc.sh 'boot' $< > $@ || (rm -f $@; exit 1)
-+ifneq ($(boot_mod_EXPORTS),no)
- def-boot.lst: pre-boot.o
-       $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 boot/' > $@
-+endif
- und-boot.lst: pre-boot.o
-       echo 'boot' > $@
-       $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
- boot_mod-commands_boot.o: commands/boot.c
--      $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(boot_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(boot_mod_CFLAGS) -c -o $@ $<
- boot_mod-commands_boot.d: commands/boot.c
--      set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(boot_mod_CFLAGS) -M $<    | sed 's,boot\.o[ :]*,boot_mod-commands_boot.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(boot_mod_CFLAGS) -M $<       | sed 's,boot\.o[ :]*,boot_mod-commands_boot.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
- -include boot_mod-commands_boot.d
-@@ -1232,10 +1260,10 @@
- FSFILES += fs-boot_mod-commands_boot.lst
- cmd-boot_mod-commands_boot.lst: commands/boot.c gencmdlist.sh
--      set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(boot_mod_CFLAGS) -E $<    | sh $(srcdir)/gencmdlist.sh boot > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(boot_mod_CFLAGS) -E $<       | sh $(srcdir)/gencmdlist.sh boot > $@ || (rm -f $@; exit 1)
- fs-boot_mod-commands_boot.lst: commands/boot.c genfslist.sh
--      set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(boot_mod_CFLAGS) -E $<    | sh $(srcdir)/genfslist.sh boot > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(boot_mod_CFLAGS) -E $<       | sh $(srcdir)/genfslist.sh boot > $@ || (rm -f $@; exit 1)
- boot_mod_CFLAGS = $(COMMON_CFLAGS)
-@@ -1243,38 +1271,43 @@
- # For terminal.mod.
- terminal_mod_SOURCES = commands/terminal.c
--CLEANFILES += terminal.mod mod-terminal.o mod-terminal.c pre-terminal.o terminal_mod-commands_terminal.o def-terminal.lst und-terminal.lst
--MOSTLYCLEANFILES += terminal_mod-commands_terminal.d
-+CLEANFILES += terminal.mod mod-terminal.o mod-terminal.c pre-terminal.o terminal_mod-commands_terminal.o und-terminal.lst
-+ifneq ($(terminal_mod_EXPORTS),no)
-+CLEANFILES += def-terminal.lst
- DEFSYMFILES += def-terminal.lst
-+endif
-+MOSTLYCLEANFILES += terminal_mod-commands_terminal.d
- UNDSYMFILES += und-terminal.lst
- terminal.mod: pre-terminal.o mod-terminal.o
-       -rm -f $@
--      $(LD) $(terminal_mod_LDFLAGS) $(LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(terminal_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
-       $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
- pre-terminal.o: terminal_mod-commands_terminal.o
-       -rm -f $@
--      $(LD) $(terminal_mod_LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(terminal_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
- mod-terminal.o: mod-terminal.c
--      $(CC) $(CPPFLAGS) $(CFLAGS) $(terminal_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(terminal_mod_CFLAGS) -c -o $@ $<
- mod-terminal.c: moddep.lst genmodsrc.sh
-       sh $(srcdir)/genmodsrc.sh 'terminal' $< > $@ || (rm -f $@; exit 1)
-+ifneq ($(terminal_mod_EXPORTS),no)
- def-terminal.lst: pre-terminal.o
-       $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 terminal/' > $@
-+endif
- und-terminal.lst: pre-terminal.o
-       echo 'terminal' > $@
-       $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
- terminal_mod-commands_terminal.o: commands/terminal.c
--      $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(terminal_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(terminal_mod_CFLAGS) -c -o $@ $<
- terminal_mod-commands_terminal.d: commands/terminal.c
--      set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(terminal_mod_CFLAGS) -M $<        | sed 's,terminal\.o[ :]*,terminal_mod-commands_terminal.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(terminal_mod_CFLAGS) -M $<           | sed 's,terminal\.o[ :]*,terminal_mod-commands_terminal.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
- -include terminal_mod-commands_terminal.d
-@@ -1283,10 +1316,10 @@
- FSFILES += fs-terminal_mod-commands_terminal.lst
- cmd-terminal_mod-commands_terminal.lst: commands/terminal.c gencmdlist.sh
--      set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(terminal_mod_CFLAGS) -E $<        | sh $(srcdir)/gencmdlist.sh terminal > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(terminal_mod_CFLAGS) -E $<           | sh $(srcdir)/gencmdlist.sh terminal > $@ || (rm -f $@; exit 1)
- fs-terminal_mod-commands_terminal.lst: commands/terminal.c genfslist.sh
--      set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(terminal_mod_CFLAGS) -E $<        | sh $(srcdir)/genfslist.sh terminal > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(terminal_mod_CFLAGS) -E $<           | sh $(srcdir)/genfslist.sh terminal > $@ || (rm -f $@; exit 1)
- terminal_mod_CFLAGS = $(COMMON_CFLAGS)
-@@ -1294,38 +1327,43 @@
- # For ls.mod.
- ls_mod_SOURCES = commands/ls.c
--CLEANFILES += ls.mod mod-ls.o mod-ls.c pre-ls.o ls_mod-commands_ls.o def-ls.lst und-ls.lst
--MOSTLYCLEANFILES += ls_mod-commands_ls.d
-+CLEANFILES += ls.mod mod-ls.o mod-ls.c pre-ls.o ls_mod-commands_ls.o und-ls.lst
-+ifneq ($(ls_mod_EXPORTS),no)
-+CLEANFILES += def-ls.lst
- DEFSYMFILES += def-ls.lst
-+endif
-+MOSTLYCLEANFILES += ls_mod-commands_ls.d
- UNDSYMFILES += und-ls.lst
- ls.mod: pre-ls.o mod-ls.o
-       -rm -f $@
--      $(LD) $(ls_mod_LDFLAGS) $(LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(ls_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
-       $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
- pre-ls.o: ls_mod-commands_ls.o
-       -rm -f $@
--      $(LD) $(ls_mod_LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(ls_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
- mod-ls.o: mod-ls.c
--      $(CC) $(CPPFLAGS) $(CFLAGS) $(ls_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ls_mod_CFLAGS) -c -o $@ $<
- mod-ls.c: moddep.lst genmodsrc.sh
-       sh $(srcdir)/genmodsrc.sh 'ls' $< > $@ || (rm -f $@; exit 1)
-+ifneq ($(ls_mod_EXPORTS),no)
- def-ls.lst: pre-ls.o
-       $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 ls/' > $@
-+endif
- und-ls.lst: pre-ls.o
-       echo 'ls' > $@
-       $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
- ls_mod-commands_ls.o: commands/ls.c
--      $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(ls_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ls_mod_CFLAGS) -c -o $@ $<
- ls_mod-commands_ls.d: commands/ls.c
--      set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(ls_mod_CFLAGS) -M $<      | sed 's,ls\.o[ :]*,ls_mod-commands_ls.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ls_mod_CFLAGS) -M $<         | sed 's,ls\.o[ :]*,ls_mod-commands_ls.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
- -include ls_mod-commands_ls.d
-@@ -1334,10 +1372,10 @@
- FSFILES += fs-ls_mod-commands_ls.lst
- cmd-ls_mod-commands_ls.lst: commands/ls.c gencmdlist.sh
--      set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(ls_mod_CFLAGS) -E $<      | sh $(srcdir)/gencmdlist.sh ls > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ls_mod_CFLAGS) -E $<         | sh $(srcdir)/gencmdlist.sh ls > $@ || (rm -f $@; exit 1)
- fs-ls_mod-commands_ls.lst: commands/ls.c genfslist.sh
--      set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(ls_mod_CFLAGS) -E $<      | sh $(srcdir)/genfslist.sh ls > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ls_mod_CFLAGS) -E $<         | sh $(srcdir)/genfslist.sh ls > $@ || (rm -f $@; exit 1)
- ls_mod_CFLAGS = $(COMMON_CFLAGS)
-@@ -1345,38 +1383,43 @@
- # For cmp.mod.
- cmp_mod_SOURCES = commands/cmp.c
--CLEANFILES += cmp.mod mod-cmp.o mod-cmp.c pre-cmp.o cmp_mod-commands_cmp.o def-cmp.lst und-cmp.lst
--MOSTLYCLEANFILES += cmp_mod-commands_cmp.d
-+CLEANFILES += cmp.mod mod-cmp.o mod-cmp.c pre-cmp.o cmp_mod-commands_cmp.o und-cmp.lst
-+ifneq ($(cmp_mod_EXPORTS),no)
-+CLEANFILES += def-cmp.lst
- DEFSYMFILES += def-cmp.lst
-+endif
-+MOSTLYCLEANFILES += cmp_mod-commands_cmp.d
- UNDSYMFILES += und-cmp.lst
- cmp.mod: pre-cmp.o mod-cmp.o
-       -rm -f $@
--      $(LD) $(cmp_mod_LDFLAGS) $(LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(cmp_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
-       $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
- pre-cmp.o: cmp_mod-commands_cmp.o
-       -rm -f $@
--      $(LD) $(cmp_mod_LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(cmp_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
- mod-cmp.o: mod-cmp.c
--      $(CC) $(CPPFLAGS) $(CFLAGS) $(cmp_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cmp_mod_CFLAGS) -c -o $@ $<
- mod-cmp.c: moddep.lst genmodsrc.sh
-       sh $(srcdir)/genmodsrc.sh 'cmp' $< > $@ || (rm -f $@; exit 1)
-+ifneq ($(cmp_mod_EXPORTS),no)
- def-cmp.lst: pre-cmp.o
-       $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 cmp/' > $@
-+endif
- und-cmp.lst: pre-cmp.o
-       echo 'cmp' > $@
-       $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
- cmp_mod-commands_cmp.o: commands/cmp.c
--      $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(cmp_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cmp_mod_CFLAGS) -c -o $@ $<
- cmp_mod-commands_cmp.d: commands/cmp.c
--      set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(cmp_mod_CFLAGS) -M $<     | sed 's,cmp\.o[ :]*,cmp_mod-commands_cmp.o $@ : ,g' > $@;      [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cmp_mod_CFLAGS) -M $<        | sed 's,cmp\.o[ :]*,cmp_mod-commands_cmp.o $@ : ,g' > $@;      [ -s $@ ] || rm -f $@
- -include cmp_mod-commands_cmp.d
-@@ -1385,10 +1428,10 @@
- FSFILES += fs-cmp_mod-commands_cmp.lst
- cmd-cmp_mod-commands_cmp.lst: commands/cmp.c gencmdlist.sh
--      set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(cmp_mod_CFLAGS) -E $<     | sh $(srcdir)/gencmdlist.sh cmp > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cmp_mod_CFLAGS) -E $<        | sh $(srcdir)/gencmdlist.sh cmp > $@ || (rm -f $@; exit 1)
- fs-cmp_mod-commands_cmp.lst: commands/cmp.c genfslist.sh
--      set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(cmp_mod_CFLAGS) -E $<     | sh $(srcdir)/genfslist.sh cmp > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cmp_mod_CFLAGS) -E $<        | sh $(srcdir)/genfslist.sh cmp > $@ || (rm -f $@; exit 1)
- cmp_mod_CFLAGS = $(COMMON_CFLAGS)
-@@ -1396,38 +1439,43 @@
- # For cat.mod.
- cat_mod_SOURCES = commands/cat.c
--CLEANFILES += cat.mod mod-cat.o mod-cat.c pre-cat.o cat_mod-commands_cat.o def-cat.lst und-cat.lst
--MOSTLYCLEANFILES += cat_mod-commands_cat.d
-+CLEANFILES += cat.mod mod-cat.o mod-cat.c pre-cat.o cat_mod-commands_cat.o und-cat.lst
-+ifneq ($(cat_mod_EXPORTS),no)
-+CLEANFILES += def-cat.lst
- DEFSYMFILES += def-cat.lst
-+endif
-+MOSTLYCLEANFILES += cat_mod-commands_cat.d
- UNDSYMFILES += und-cat.lst
- cat.mod: pre-cat.o mod-cat.o
-       -rm -f $@
--      $(LD) $(cat_mod_LDFLAGS) $(LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(cat_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
-       $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
- pre-cat.o: cat_mod-commands_cat.o
-       -rm -f $@
--      $(LD) $(cat_mod_LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(cat_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
- mod-cat.o: mod-cat.c
--      $(CC) $(CPPFLAGS) $(CFLAGS) $(cat_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cat_mod_CFLAGS) -c -o $@ $<
- mod-cat.c: moddep.lst genmodsrc.sh
-       sh $(srcdir)/genmodsrc.sh 'cat' $< > $@ || (rm -f $@; exit 1)
-+ifneq ($(cat_mod_EXPORTS),no)
- def-cat.lst: pre-cat.o
-       $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 cat/' > $@
-+endif
- und-cat.lst: pre-cat.o
-       echo 'cat' > $@
-       $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
- cat_mod-commands_cat.o: commands/cat.c
--      $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(cat_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cat_mod_CFLAGS) -c -o $@ $<
- cat_mod-commands_cat.d: commands/cat.c
--      set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(cat_mod_CFLAGS) -M $<     | sed 's,cat\.o[ :]*,cat_mod-commands_cat.o $@ : ,g' > $@;      [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cat_mod_CFLAGS) -M $<        | sed 's,cat\.o[ :]*,cat_mod-commands_cat.o $@ : ,g' > $@;      [ -s $@ ] || rm -f $@
- -include cat_mod-commands_cat.d
-@@ -1436,10 +1484,10 @@
- FSFILES += fs-cat_mod-commands_cat.lst
- cmd-cat_mod-commands_cat.lst: commands/cat.c gencmdlist.sh
--      set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(cat_mod_CFLAGS) -E $<     | sh $(srcdir)/gencmdlist.sh cat > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cat_mod_CFLAGS) -E $<        | sh $(srcdir)/gencmdlist.sh cat > $@ || (rm -f $@; exit 1)
- fs-cat_mod-commands_cat.lst: commands/cat.c genfslist.sh
--      set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(cat_mod_CFLAGS) -E $<     | sh $(srcdir)/genfslist.sh cat > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cat_mod_CFLAGS) -E $<        | sh $(srcdir)/genfslist.sh cat > $@ || (rm -f $@; exit 1)
- cat_mod_CFLAGS = $(COMMON_CFLAGS)
-@@ -1447,38 +1495,43 @@
- # For font.mod.
- font_mod_SOURCES = font/manager.c
--CLEANFILES += font.mod mod-font.o mod-font.c pre-font.o font_mod-font_manager.o def-font.lst und-font.lst
--MOSTLYCLEANFILES += font_mod-font_manager.d
-+CLEANFILES += font.mod mod-font.o mod-font.c pre-font.o font_mod-font_manager.o und-font.lst
-+ifneq ($(font_mod_EXPORTS),no)
-+CLEANFILES += def-font.lst
- DEFSYMFILES += def-font.lst
-+endif
-+MOSTLYCLEANFILES += font_mod-font_manager.d
- UNDSYMFILES += und-font.lst
- font.mod: pre-font.o mod-font.o
-       -rm -f $@
--      $(LD) $(font_mod_LDFLAGS) $(LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(font_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
-       $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
- pre-font.o: font_mod-font_manager.o
-       -rm -f $@
--      $(LD) $(font_mod_LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(font_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
- mod-font.o: mod-font.c
--      $(CC) $(CPPFLAGS) $(CFLAGS) $(font_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(font_mod_CFLAGS) -c -o $@ $<
- mod-font.c: moddep.lst genmodsrc.sh
-       sh $(srcdir)/genmodsrc.sh 'font' $< > $@ || (rm -f $@; exit 1)
-+ifneq ($(font_mod_EXPORTS),no)
- def-font.lst: pre-font.o
-       $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 font/' > $@
-+endif
- und-font.lst: pre-font.o
-       echo 'font' > $@
-       $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
- font_mod-font_manager.o: font/manager.c
--      $(CC) -Ifont -I$(srcdir)/font $(CPPFLAGS) $(CFLAGS) $(font_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Ifont -I$(srcdir)/font $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(font_mod_CFLAGS) -c -o $@ $<
- font_mod-font_manager.d: font/manager.c
--      set -e;           $(CC) -Ifont -I$(srcdir)/font $(CPPFLAGS) $(CFLAGS) $(font_mod_CFLAGS) -M $<    | sed 's,manager\.o[ :]*,font_mod-font_manager.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Ifont -I$(srcdir)/font $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(font_mod_CFLAGS) -M $<       | sed 's,manager\.o[ :]*,font_mod-font_manager.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
- -include font_mod-font_manager.d
-@@ -1487,10 +1540,10 @@
- FSFILES += fs-font_mod-font_manager.lst
- cmd-font_mod-font_manager.lst: font/manager.c gencmdlist.sh
--      set -e;           $(CC) -Ifont -I$(srcdir)/font $(CPPFLAGS) $(CFLAGS) $(font_mod_CFLAGS) -E $<    | sh $(srcdir)/gencmdlist.sh font > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Ifont -I$(srcdir)/font $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(font_mod_CFLAGS) -E $<       | sh $(srcdir)/gencmdlist.sh font > $@ || (rm -f $@; exit 1)
- fs-font_mod-font_manager.lst: font/manager.c genfslist.sh
--      set -e;           $(CC) -Ifont -I$(srcdir)/font $(CPPFLAGS) $(CFLAGS) $(font_mod_CFLAGS) -E $<    | sh $(srcdir)/genfslist.sh font > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Ifont -I$(srcdir)/font $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(font_mod_CFLAGS) -E $<       | sh $(srcdir)/genfslist.sh font > $@ || (rm -f $@; exit 1)
- font_mod_CFLAGS = $(COMMON_CFLAGS)
-@@ -1498,38 +1551,43 @@
- # For amiga.mod
- amiga_mod_SOURCES = partmap/amiga.c
--CLEANFILES += amiga.mod mod-amiga.o mod-amiga.c pre-amiga.o amiga_mod-partmap_amiga.o def-amiga.lst und-amiga.lst
--MOSTLYCLEANFILES += amiga_mod-partmap_amiga.d
-+CLEANFILES += amiga.mod mod-amiga.o mod-amiga.c pre-amiga.o amiga_mod-partmap_amiga.o und-amiga.lst
-+ifneq ($(amiga_mod_EXPORTS),no)
-+CLEANFILES += def-amiga.lst
- DEFSYMFILES += def-amiga.lst
-+endif
-+MOSTLYCLEANFILES += amiga_mod-partmap_amiga.d
- UNDSYMFILES += und-amiga.lst
- amiga.mod: pre-amiga.o mod-amiga.o
-       -rm -f $@
--      $(LD) $(amiga_mod_LDFLAGS) $(LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(amiga_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
-       $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
- pre-amiga.o: amiga_mod-partmap_amiga.o
-       -rm -f $@
--      $(LD) $(amiga_mod_LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(amiga_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
- mod-amiga.o: mod-amiga.c
--      $(CC) $(CPPFLAGS) $(CFLAGS) $(amiga_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(amiga_mod_CFLAGS) -c -o $@ $<
- mod-amiga.c: moddep.lst genmodsrc.sh
-       sh $(srcdir)/genmodsrc.sh 'amiga' $< > $@ || (rm -f $@; exit 1)
-+ifneq ($(amiga_mod_EXPORTS),no)
- def-amiga.lst: pre-amiga.o
-       $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 amiga/' > $@
-+endif
- und-amiga.lst: pre-amiga.o
-       echo 'amiga' > $@
-       $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
- amiga_mod-partmap_amiga.o: partmap/amiga.c
--      $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) $(amiga_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(amiga_mod_CFLAGS) -c -o $@ $<
- amiga_mod-partmap_amiga.d: partmap/amiga.c
--      set -e;           $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) $(amiga_mod_CFLAGS) -M $<     | sed 's,amiga\.o[ :]*,amiga_mod-partmap_amiga.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(amiga_mod_CFLAGS) -M $<        | sed 's,amiga\.o[ :]*,amiga_mod-partmap_amiga.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
- -include amiga_mod-partmap_amiga.d
-@@ -1538,10 +1596,10 @@
- FSFILES += fs-amiga_mod-partmap_amiga.lst
- cmd-amiga_mod-partmap_amiga.lst: partmap/amiga.c gencmdlist.sh
--      set -e;           $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) $(amiga_mod_CFLAGS) -E $<     | sh $(srcdir)/gencmdlist.sh amiga > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(amiga_mod_CFLAGS) -E $<        | sh $(srcdir)/gencmdlist.sh amiga > $@ || (rm -f $@; exit 1)
- fs-amiga_mod-partmap_amiga.lst: partmap/amiga.c genfslist.sh
--      set -e;           $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) $(amiga_mod_CFLAGS) -E $<     | sh $(srcdir)/genfslist.sh amiga > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(amiga_mod_CFLAGS) -E $<        | sh $(srcdir)/genfslist.sh amiga > $@ || (rm -f $@; exit 1)
- amiga_mod_CFLAGS = $(COMMON_CFLAGS)
-@@ -1549,38 +1607,43 @@
- # For apple.mod
- apple_mod_SOURCES = partmap/apple.c
--CLEANFILES += apple.mod mod-apple.o mod-apple.c pre-apple.o apple_mod-partmap_apple.o def-apple.lst und-apple.lst
--MOSTLYCLEANFILES += apple_mod-partmap_apple.d
-+CLEANFILES += apple.mod mod-apple.o mod-apple.c pre-apple.o apple_mod-partmap_apple.o und-apple.lst
-+ifneq ($(apple_mod_EXPORTS),no)
-+CLEANFILES += def-apple.lst
- DEFSYMFILES += def-apple.lst
-+endif
-+MOSTLYCLEANFILES += apple_mod-partmap_apple.d
- UNDSYMFILES += und-apple.lst
- apple.mod: pre-apple.o mod-apple.o
-       -rm -f $@
--      $(LD) $(apple_mod_LDFLAGS) $(LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(apple_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
-       $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
- pre-apple.o: apple_mod-partmap_apple.o
-       -rm -f $@
--      $(LD) $(apple_mod_LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(apple_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
- mod-apple.o: mod-apple.c
--      $(CC) $(CPPFLAGS) $(CFLAGS) $(apple_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(apple_mod_CFLAGS) -c -o $@ $<
- mod-apple.c: moddep.lst genmodsrc.sh
-       sh $(srcdir)/genmodsrc.sh 'apple' $< > $@ || (rm -f $@; exit 1)
-+ifneq ($(apple_mod_EXPORTS),no)
- def-apple.lst: pre-apple.o
-       $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 apple/' > $@
-+endif
- und-apple.lst: pre-apple.o
-       echo 'apple' > $@
-       $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
- apple_mod-partmap_apple.o: partmap/apple.c
--      $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) $(apple_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(apple_mod_CFLAGS) -c -o $@ $<
- apple_mod-partmap_apple.d: partmap/apple.c
--      set -e;           $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) $(apple_mod_CFLAGS) -M $<     | sed 's,apple\.o[ :]*,apple_mod-partmap_apple.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(apple_mod_CFLAGS) -M $<        | sed 's,apple\.o[ :]*,apple_mod-partmap_apple.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
- -include apple_mod-partmap_apple.d
-@@ -1589,10 +1652,10 @@
- FSFILES += fs-apple_mod-partmap_apple.lst
- cmd-apple_mod-partmap_apple.lst: partmap/apple.c gencmdlist.sh
--      set -e;           $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) $(apple_mod_CFLAGS) -E $<     | sh $(srcdir)/gencmdlist.sh apple > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(apple_mod_CFLAGS) -E $<        | sh $(srcdir)/gencmdlist.sh apple > $@ || (rm -f $@; exit 1)
- fs-apple_mod-partmap_apple.lst: partmap/apple.c genfslist.sh
--      set -e;           $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) $(apple_mod_CFLAGS) -E $<     | sh $(srcdir)/genfslist.sh apple > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(apple_mod_CFLAGS) -E $<        | sh $(srcdir)/genfslist.sh apple > $@ || (rm -f $@; exit 1)
- apple_mod_CFLAGS = $(COMMON_CFLAGS)
-@@ -1600,38 +1663,43 @@
- # For pc.mod
- pc_mod_SOURCES = partmap/pc.c
--CLEANFILES += pc.mod mod-pc.o mod-pc.c pre-pc.o pc_mod-partmap_pc.o def-pc.lst und-pc.lst
--MOSTLYCLEANFILES += pc_mod-partmap_pc.d
-+CLEANFILES += pc.mod mod-pc.o mod-pc.c pre-pc.o pc_mod-partmap_pc.o und-pc.lst
-+ifneq ($(pc_mod_EXPORTS),no)
-+CLEANFILES += def-pc.lst
- DEFSYMFILES += def-pc.lst
-+endif
-+MOSTLYCLEANFILES += pc_mod-partmap_pc.d
- UNDSYMFILES += und-pc.lst
- pc.mod: pre-pc.o mod-pc.o
-       -rm -f $@
--      $(LD) $(pc_mod_LDFLAGS) $(LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(pc_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
-       $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
- pre-pc.o: pc_mod-partmap_pc.o
-       -rm -f $@
--      $(LD) $(pc_mod_LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(pc_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
- mod-pc.o: mod-pc.c
--      $(CC) $(CPPFLAGS) $(CFLAGS) $(pc_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pc_mod_CFLAGS) -c -o $@ $<
- mod-pc.c: moddep.lst genmodsrc.sh
-       sh $(srcdir)/genmodsrc.sh 'pc' $< > $@ || (rm -f $@; exit 1)
-+ifneq ($(pc_mod_EXPORTS),no)
- def-pc.lst: pre-pc.o
-       $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 pc/' > $@
-+endif
- und-pc.lst: pre-pc.o
-       echo 'pc' > $@
-       $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
- pc_mod-partmap_pc.o: partmap/pc.c
--      $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) $(pc_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pc_mod_CFLAGS) -c -o $@ $<
- pc_mod-partmap_pc.d: partmap/pc.c
--      set -e;           $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) $(pc_mod_CFLAGS) -M $<        | sed 's,pc\.o[ :]*,pc_mod-partmap_pc.o $@ : ,g' > $@;          [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pc_mod_CFLAGS) -M $<           | sed 's,pc\.o[ :]*,pc_mod-partmap_pc.o $@ : ,g' > $@;          [ -s $@ ] || rm -f $@
- -include pc_mod-partmap_pc.d
-@@ -1640,10 +1708,10 @@
- FSFILES += fs-pc_mod-partmap_pc.lst
- cmd-pc_mod-partmap_pc.lst: partmap/pc.c gencmdlist.sh
--      set -e;           $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) $(pc_mod_CFLAGS) -E $<        | sh $(srcdir)/gencmdlist.sh pc > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pc_mod_CFLAGS) -E $<           | sh $(srcdir)/gencmdlist.sh pc > $@ || (rm -f $@; exit 1)
- fs-pc_mod-partmap_pc.lst: partmap/pc.c genfslist.sh
--      set -e;           $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) $(pc_mod_CFLAGS) -E $<        | sh $(srcdir)/genfslist.sh pc > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pc_mod_CFLAGS) -E $<           | sh $(srcdir)/genfslist.sh pc > $@ || (rm -f $@; exit 1)
- pc_mod_CFLAGS = $(COMMON_CFLAGS)
-@@ -1651,38 +1719,43 @@
- # For sun.mod
- sun_mod_SOURCES = partmap/sun.c
--CLEANFILES += sun.mod mod-sun.o mod-sun.c pre-sun.o sun_mod-partmap_sun.o def-sun.lst und-sun.lst
--MOSTLYCLEANFILES += sun_mod-partmap_sun.d
-+CLEANFILES += sun.mod mod-sun.o mod-sun.c pre-sun.o sun_mod-partmap_sun.o und-sun.lst
-+ifneq ($(sun_mod_EXPORTS),no)
-+CLEANFILES += def-sun.lst
- DEFSYMFILES += def-sun.lst
-+endif
-+MOSTLYCLEANFILES += sun_mod-partmap_sun.d
- UNDSYMFILES += und-sun.lst
- sun.mod: pre-sun.o mod-sun.o
-       -rm -f $@
--      $(LD) $(sun_mod_LDFLAGS) $(LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(sun_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
-       $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
- pre-sun.o: sun_mod-partmap_sun.o
-       -rm -f $@
--      $(LD) $(sun_mod_LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(sun_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
- mod-sun.o: mod-sun.c
--      $(CC) $(CPPFLAGS) $(CFLAGS) $(sun_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sun_mod_CFLAGS) -c -o $@ $<
- mod-sun.c: moddep.lst genmodsrc.sh
-       sh $(srcdir)/genmodsrc.sh 'sun' $< > $@ || (rm -f $@; exit 1)
-+ifneq ($(sun_mod_EXPORTS),no)
- def-sun.lst: pre-sun.o
-       $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 sun/' > $@
-+endif
- und-sun.lst: pre-sun.o
-       echo 'sun' > $@
-       $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
- sun_mod-partmap_sun.o: partmap/sun.c
--      $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) $(sun_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sun_mod_CFLAGS) -c -o $@ $<
- sun_mod-partmap_sun.d: partmap/sun.c
--      set -e;           $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) $(sun_mod_CFLAGS) -M $<       | sed 's,sun\.o[ :]*,sun_mod-partmap_sun.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sun_mod_CFLAGS) -M $<          | sed 's,sun\.o[ :]*,sun_mod-partmap_sun.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
- -include sun_mod-partmap_sun.d
-@@ -1691,10 +1764,10 @@
- FSFILES += fs-sun_mod-partmap_sun.lst
- cmd-sun_mod-partmap_sun.lst: partmap/sun.c gencmdlist.sh
--      set -e;           $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) $(sun_mod_CFLAGS) -E $<       | sh $(srcdir)/gencmdlist.sh sun > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sun_mod_CFLAGS) -E $<          | sh $(srcdir)/gencmdlist.sh sun > $@ || (rm -f $@; exit 1)
- fs-sun_mod-partmap_sun.lst: partmap/sun.c genfslist.sh
--      set -e;           $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) $(sun_mod_CFLAGS) -E $<       | sh $(srcdir)/genfslist.sh sun > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sun_mod_CFLAGS) -E $<          | sh $(srcdir)/genfslist.sh sun > $@ || (rm -f $@; exit 1)
- sun_mod_CFLAGS = $(COMMON_CFLAGS)
-@@ -1702,38 +1775,43 @@
- # For acorn.mod
- acorn_mod_SOURCES = partmap/acorn.c
--CLEANFILES += acorn.mod mod-acorn.o mod-acorn.c pre-acorn.o acorn_mod-partmap_acorn.o def-acorn.lst und-acorn.lst
--MOSTLYCLEANFILES += acorn_mod-partmap_acorn.d
-+CLEANFILES += acorn.mod mod-acorn.o mod-acorn.c pre-acorn.o acorn_mod-partmap_acorn.o und-acorn.lst
-+ifneq ($(acorn_mod_EXPORTS),no)
-+CLEANFILES += def-acorn.lst
- DEFSYMFILES += def-acorn.lst
-+endif
-+MOSTLYCLEANFILES += acorn_mod-partmap_acorn.d
- UNDSYMFILES += und-acorn.lst
- acorn.mod: pre-acorn.o mod-acorn.o
-       -rm -f $@
--      $(LD) $(acorn_mod_LDFLAGS) $(LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(acorn_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
-       $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
- pre-acorn.o: acorn_mod-partmap_acorn.o
-       -rm -f $@
--      $(LD) $(acorn_mod_LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(acorn_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
- mod-acorn.o: mod-acorn.c
--      $(CC) $(CPPFLAGS) $(CFLAGS) $(acorn_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(acorn_mod_CFLAGS) -c -o $@ $<
- mod-acorn.c: moddep.lst genmodsrc.sh
-       sh $(srcdir)/genmodsrc.sh 'acorn' $< > $@ || (rm -f $@; exit 1)
-+ifneq ($(acorn_mod_EXPORTS),no)
- def-acorn.lst: pre-acorn.o
-       $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 acorn/' > $@
-+endif
- und-acorn.lst: pre-acorn.o
-       echo 'acorn' > $@
-       $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
- acorn_mod-partmap_acorn.o: partmap/acorn.c
--      $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) $(acorn_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(acorn_mod_CFLAGS) -c -o $@ $<
- acorn_mod-partmap_acorn.d: partmap/acorn.c
--      set -e;           $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) $(acorn_mod_CFLAGS) -M $<     | sed 's,acorn\.o[ :]*,acorn_mod-partmap_acorn.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(acorn_mod_CFLAGS) -M $<        | sed 's,acorn\.o[ :]*,acorn_mod-partmap_acorn.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
- -include acorn_mod-partmap_acorn.d
-@@ -1742,48 +1820,53 @@
- FSFILES += fs-acorn_mod-partmap_acorn.lst
- cmd-acorn_mod-partmap_acorn.lst: partmap/acorn.c gencmdlist.sh
--      set -e;           $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) $(acorn_mod_CFLAGS) -E $<     | sh $(srcdir)/gencmdlist.sh acorn > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(acorn_mod_CFLAGS) -E $<        | sh $(srcdir)/gencmdlist.sh acorn > $@ || (rm -f $@; exit 1)
- fs-acorn_mod-partmap_acorn.lst: partmap/acorn.c genfslist.sh
--      set -e;           $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) $(acorn_mod_CFLAGS) -E $<     | sh $(srcdir)/genfslist.sh acorn > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(acorn_mod_CFLAGS) -E $<        | sh $(srcdir)/genfslist.sh acorn > $@ || (rm -f $@; exit 1)
- acorn_mod_CFLAGS = $(COMMON_CFLAGS)
- # For loopback.mod
- loopback_mod_SOURCES = disk/loopback.c
--CLEANFILES += loopback.mod mod-loopback.o mod-loopback.c pre-loopback.o loopback_mod-disk_loopback.o def-loopback.lst und-loopback.lst
--MOSTLYCLEANFILES += loopback_mod-disk_loopback.d
-+CLEANFILES += loopback.mod mod-loopback.o mod-loopback.c pre-loopback.o loopback_mod-disk_loopback.o und-loopback.lst
-+ifneq ($(loopback_mod_EXPORTS),no)
-+CLEANFILES += def-loopback.lst
- DEFSYMFILES += def-loopback.lst
-+endif
-+MOSTLYCLEANFILES += loopback_mod-disk_loopback.d
- UNDSYMFILES += und-loopback.lst
- loopback.mod: pre-loopback.o mod-loopback.o
-       -rm -f $@
--      $(LD) $(loopback_mod_LDFLAGS) $(LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(loopback_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
-       $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
- pre-loopback.o: loopback_mod-disk_loopback.o
-       -rm -f $@
--      $(LD) $(loopback_mod_LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(loopback_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
- mod-loopback.o: mod-loopback.c
--      $(CC) $(CPPFLAGS) $(CFLAGS) $(loopback_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(loopback_mod_CFLAGS) -c -o $@ $<
- mod-loopback.c: moddep.lst genmodsrc.sh
-       sh $(srcdir)/genmodsrc.sh 'loopback' $< > $@ || (rm -f $@; exit 1)
-+ifneq ($(loopback_mod_EXPORTS),no)
- def-loopback.lst: pre-loopback.o
-       $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 loopback/' > $@
-+endif
- und-loopback.lst: pre-loopback.o
-       echo 'loopback' > $@
-       $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
- loopback_mod-disk_loopback.o: disk/loopback.c
--      $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) $(loopback_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(loopback_mod_CFLAGS) -c -o $@ $<
- loopback_mod-disk_loopback.d: disk/loopback.c
--      set -e;           $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) $(loopback_mod_CFLAGS) -M $<        | sed 's,loopback\.o[ :]*,loopback_mod-disk_loopback.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(loopback_mod_CFLAGS) -M $<           | sed 's,loopback\.o[ :]*,loopback_mod-disk_loopback.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
- -include loopback_mod-disk_loopback.d
-@@ -1792,10 +1875,10 @@
- FSFILES += fs-loopback_mod-disk_loopback.lst
- cmd-loopback_mod-disk_loopback.lst: disk/loopback.c gencmdlist.sh
--      set -e;           $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) $(loopback_mod_CFLAGS) -E $<        | sh $(srcdir)/gencmdlist.sh loopback > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(loopback_mod_CFLAGS) -E $<           | sh $(srcdir)/gencmdlist.sh loopback > $@ || (rm -f $@; exit 1)
- fs-loopback_mod-disk_loopback.lst: disk/loopback.c genfslist.sh
--      set -e;           $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) $(loopback_mod_CFLAGS) -E $<        | sh $(srcdir)/genfslist.sh loopback > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(loopback_mod_CFLAGS) -E $<           | sh $(srcdir)/genfslist.sh loopback > $@ || (rm -f $@; exit 1)
- loopback_mod_CFLAGS = $(COMMON_CFLAGS)
-@@ -1803,38 +1886,43 @@
- # For suspend.mod
- suspend_mod_SOURCES = commands/ieee1275/suspend.c
--CLEANFILES += suspend.mod mod-suspend.o mod-suspend.c pre-suspend.o suspend_mod-commands_ieee1275_suspend.o def-suspend.lst und-suspend.lst
--MOSTLYCLEANFILES += suspend_mod-commands_ieee1275_suspend.d
-+CLEANFILES += suspend.mod mod-suspend.o mod-suspend.c pre-suspend.o suspend_mod-commands_ieee1275_suspend.o und-suspend.lst
-+ifneq ($(suspend_mod_EXPORTS),no)
-+CLEANFILES += def-suspend.lst
- DEFSYMFILES += def-suspend.lst
-+endif
-+MOSTLYCLEANFILES += suspend_mod-commands_ieee1275_suspend.d
- UNDSYMFILES += und-suspend.lst
- suspend.mod: pre-suspend.o mod-suspend.o
-       -rm -f $@
--      $(LD) $(suspend_mod_LDFLAGS) $(LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(suspend_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
-       $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
- pre-suspend.o: suspend_mod-commands_ieee1275_suspend.o
-       -rm -f $@
--      $(LD) $(suspend_mod_LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(suspend_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
- mod-suspend.o: mod-suspend.c
--      $(CC) $(CPPFLAGS) $(CFLAGS) $(suspend_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(suspend_mod_CFLAGS) -c -o $@ $<
- mod-suspend.c: moddep.lst genmodsrc.sh
-       sh $(srcdir)/genmodsrc.sh 'suspend' $< > $@ || (rm -f $@; exit 1)
-+ifneq ($(suspend_mod_EXPORTS),no)
- def-suspend.lst: pre-suspend.o
-       $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 suspend/' > $@
-+endif
- und-suspend.lst: pre-suspend.o
-       echo 'suspend' > $@
-       $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
- suspend_mod-commands_ieee1275_suspend.o: commands/ieee1275/suspend.c
--      $(CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(CPPFLAGS) $(CFLAGS) $(suspend_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(suspend_mod_CFLAGS) -c -o $@ $<
- suspend_mod-commands_ieee1275_suspend.d: commands/ieee1275/suspend.c
--      set -e;           $(CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(CPPFLAGS) $(CFLAGS) $(suspend_mod_CFLAGS) -M $<       | sed 's,suspend\.o[ :]*,suspend_mod-commands_ieee1275_suspend.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(suspend_mod_CFLAGS) -M $<          | sed 's,suspend\.o[ :]*,suspend_mod-commands_ieee1275_suspend.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
- -include suspend_mod-commands_ieee1275_suspend.d
-@@ -1843,10 +1931,10 @@
- FSFILES += fs-suspend_mod-commands_ieee1275_suspend.lst
- cmd-suspend_mod-commands_ieee1275_suspend.lst: commands/ieee1275/suspend.c gencmdlist.sh
--      set -e;           $(CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(CPPFLAGS) $(CFLAGS) $(suspend_mod_CFLAGS) -E $<       | sh $(srcdir)/gencmdlist.sh suspend > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(suspend_mod_CFLAGS) -E $<          | sh $(srcdir)/gencmdlist.sh suspend > $@ || (rm -f $@; exit 1)
- fs-suspend_mod-commands_ieee1275_suspend.lst: commands/ieee1275/suspend.c genfslist.sh
--      set -e;           $(CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(CPPFLAGS) $(CFLAGS) $(suspend_mod_CFLAGS) -E $<       | sh $(srcdir)/genfslist.sh suspend > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(suspend_mod_CFLAGS) -E $<          | sh $(srcdir)/genfslist.sh suspend > $@ || (rm -f $@; exit 1)
- suspend_mod_CFLAGS = $(COMMON_CFLAGS)
-@@ -1854,38 +1942,43 @@
- # For reboot.mod
- reboot_mod_SOURCES = commands/ieee1275/reboot.c
--CLEANFILES += reboot.mod mod-reboot.o mod-reboot.c pre-reboot.o reboot_mod-commands_ieee1275_reboot.o def-reboot.lst und-reboot.lst
--MOSTLYCLEANFILES += reboot_mod-commands_ieee1275_reboot.d
-+CLEANFILES += reboot.mod mod-reboot.o mod-reboot.c pre-reboot.o reboot_mod-commands_ieee1275_reboot.o und-reboot.lst
-+ifneq ($(reboot_mod_EXPORTS),no)
-+CLEANFILES += def-reboot.lst
- DEFSYMFILES += def-reboot.lst
-+endif
-+MOSTLYCLEANFILES += reboot_mod-commands_ieee1275_reboot.d
- UNDSYMFILES += und-reboot.lst
- reboot.mod: pre-reboot.o mod-reboot.o
-       -rm -f $@
--      $(LD) $(reboot_mod_LDFLAGS) $(LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(reboot_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
-       $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
- pre-reboot.o: reboot_mod-commands_ieee1275_reboot.o
-       -rm -f $@
--      $(LD) $(reboot_mod_LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(reboot_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
- mod-reboot.o: mod-reboot.c
--      $(CC) $(CPPFLAGS) $(CFLAGS) $(reboot_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -c -o $@ $<
- mod-reboot.c: moddep.lst genmodsrc.sh
-       sh $(srcdir)/genmodsrc.sh 'reboot' $< > $@ || (rm -f $@; exit 1)
-+ifneq ($(reboot_mod_EXPORTS),no)
- def-reboot.lst: pre-reboot.o
-       $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 reboot/' > $@
-+endif
- und-reboot.lst: pre-reboot.o
-       echo 'reboot' > $@
-       $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
- reboot_mod-commands_ieee1275_reboot.o: commands/ieee1275/reboot.c
--      $(CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(CPPFLAGS) $(CFLAGS) $(reboot_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -c -o $@ $<
- reboot_mod-commands_ieee1275_reboot.d: commands/ieee1275/reboot.c
--      set -e;           $(CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(CPPFLAGS) $(CFLAGS) $(reboot_mod_CFLAGS) -M $<        | sed 's,reboot\.o[ :]*,reboot_mod-commands_ieee1275_reboot.o $@ : ,g' > $@;    [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -M $<           | sed 's,reboot\.o[ :]*,reboot_mod-commands_ieee1275_reboot.o $@ : ,g' > $@;    [ -s $@ ] || rm -f $@
- -include reboot_mod-commands_ieee1275_reboot.d
-@@ -1894,10 +1987,10 @@
- FSFILES += fs-reboot_mod-commands_ieee1275_reboot.lst
- cmd-reboot_mod-commands_ieee1275_reboot.lst: commands/ieee1275/reboot.c gencmdlist.sh
--      set -e;           $(CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(CPPFLAGS) $(CFLAGS) $(reboot_mod_CFLAGS) -E $<        | sh $(srcdir)/gencmdlist.sh reboot > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -E $<           | sh $(srcdir)/gencmdlist.sh reboot > $@ || (rm -f $@; exit 1)
- fs-reboot_mod-commands_ieee1275_reboot.lst: commands/ieee1275/reboot.c genfslist.sh
--      set -e;           $(CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(CPPFLAGS) $(CFLAGS) $(reboot_mod_CFLAGS) -E $<        | sh $(srcdir)/genfslist.sh reboot > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -E $<           | sh $(srcdir)/genfslist.sh reboot > $@ || (rm -f $@; exit 1)
- reboot_mod_CFLAGS = $(COMMON_CFLAGS)
-@@ -1905,38 +1998,43 @@
- # For halt.mod
- halt_mod_SOURCES = commands/ieee1275/halt.c
--CLEANFILES += halt.mod mod-halt.o mod-halt.c pre-halt.o halt_mod-commands_ieee1275_halt.o def-halt.lst und-halt.lst
--MOSTLYCLEANFILES += halt_mod-commands_ieee1275_halt.d
-+CLEANFILES += halt.mod mod-halt.o mod-halt.c pre-halt.o halt_mod-commands_ieee1275_halt.o und-halt.lst
-+ifneq ($(halt_mod_EXPORTS),no)
-+CLEANFILES += def-halt.lst
- DEFSYMFILES += def-halt.lst
-+endif
-+MOSTLYCLEANFILES += halt_mod-commands_ieee1275_halt.d
- UNDSYMFILES += und-halt.lst
- halt.mod: pre-halt.o mod-halt.o
-       -rm -f $@
--      $(LD) $(halt_mod_LDFLAGS) $(LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(halt_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
-       $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
- pre-halt.o: halt_mod-commands_ieee1275_halt.o
-       -rm -f $@
--      $(LD) $(halt_mod_LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(halt_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
- mod-halt.o: mod-halt.c
--      $(CC) $(CPPFLAGS) $(CFLAGS) $(halt_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -c -o $@ $<
- mod-halt.c: moddep.lst genmodsrc.sh
-       sh $(srcdir)/genmodsrc.sh 'halt' $< > $@ || (rm -f $@; exit 1)
-+ifneq ($(halt_mod_EXPORTS),no)
- def-halt.lst: pre-halt.o
-       $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 halt/' > $@
-+endif
- und-halt.lst: pre-halt.o
-       echo 'halt' > $@
-       $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
- halt_mod-commands_ieee1275_halt.o: commands/ieee1275/halt.c
--      $(CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(CPPFLAGS) $(CFLAGS) $(halt_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -c -o $@ $<
- halt_mod-commands_ieee1275_halt.d: commands/ieee1275/halt.c
--      set -e;           $(CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(CPPFLAGS) $(CFLAGS) $(halt_mod_CFLAGS) -M $<          | sed 's,halt\.o[ :]*,halt_mod-commands_ieee1275_halt.o $@ : ,g' > $@;          [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -M $<     | sed 's,halt\.o[ :]*,halt_mod-commands_ieee1275_halt.o $@ : ,g' > $@;          [ -s $@ ] || rm -f $@
- -include halt_mod-commands_ieee1275_halt.d
-@@ -1945,10 +2043,10 @@
- FSFILES += fs-halt_mod-commands_ieee1275_halt.lst
- cmd-halt_mod-commands_ieee1275_halt.lst: commands/ieee1275/halt.c gencmdlist.sh
--      set -e;           $(CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(CPPFLAGS) $(CFLAGS) $(halt_mod_CFLAGS) -E $<          | sh $(srcdir)/gencmdlist.sh halt > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -E $<     | sh $(srcdir)/gencmdlist.sh halt > $@ || (rm -f $@; exit 1)
- fs-halt_mod-commands_ieee1275_halt.lst: commands/ieee1275/halt.c genfslist.sh
--      set -e;           $(CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(CPPFLAGS) $(CFLAGS) $(halt_mod_CFLAGS) -E $<          | sh $(srcdir)/genfslist.sh halt > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -E $<     | sh $(srcdir)/genfslist.sh halt > $@ || (rm -f $@; exit 1)
- halt_mod_CFLAGS = $(COMMON_CFLAGS)
-@@ -1956,38 +2054,43 @@
- # For help.mod.
- help_mod_SOURCES = commands/help.c
--CLEANFILES += help.mod mod-help.o mod-help.c pre-help.o help_mod-commands_help.o def-help.lst und-help.lst
--MOSTLYCLEANFILES += help_mod-commands_help.d
-+CLEANFILES += help.mod mod-help.o mod-help.c pre-help.o help_mod-commands_help.o und-help.lst
-+ifneq ($(help_mod_EXPORTS),no)
-+CLEANFILES += def-help.lst
- DEFSYMFILES += def-help.lst
-+endif
-+MOSTLYCLEANFILES += help_mod-commands_help.d
- UNDSYMFILES += und-help.lst
- help.mod: pre-help.o mod-help.o
-       -rm -f $@
--      $(LD) $(help_mod_LDFLAGS) $(LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(help_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
-       $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
- pre-help.o: help_mod-commands_help.o
-       -rm -f $@
--      $(LD) $(help_mod_LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(help_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
- mod-help.o: mod-help.c
--      $(CC) $(CPPFLAGS) $(CFLAGS) $(help_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(help_mod_CFLAGS) -c -o $@ $<
- mod-help.c: moddep.lst genmodsrc.sh
-       sh $(srcdir)/genmodsrc.sh 'help' $< > $@ || (rm -f $@; exit 1)
-+ifneq ($(help_mod_EXPORTS),no)
- def-help.lst: pre-help.o
-       $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 help/' > $@
-+endif
- und-help.lst: pre-help.o
-       echo 'help' > $@
-       $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
- help_mod-commands_help.o: commands/help.c
--      $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(help_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(help_mod_CFLAGS) -c -o $@ $<
- help_mod-commands_help.d: commands/help.c
--      set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(help_mod_CFLAGS) -M $<    | sed 's,help\.o[ :]*,help_mod-commands_help.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(help_mod_CFLAGS) -M $<       | sed 's,help\.o[ :]*,help_mod-commands_help.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
- -include help_mod-commands_help.d
-@@ -1996,10 +2099,10 @@
- FSFILES += fs-help_mod-commands_help.lst
- cmd-help_mod-commands_help.lst: commands/help.c gencmdlist.sh
--      set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(help_mod_CFLAGS) -E $<    | sh $(srcdir)/gencmdlist.sh help > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(help_mod_CFLAGS) -E $<       | sh $(srcdir)/gencmdlist.sh help > $@ || (rm -f $@; exit 1)
- fs-help_mod-commands_help.lst: commands/help.c genfslist.sh
--      set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(help_mod_CFLAGS) -E $<    | sh $(srcdir)/genfslist.sh help > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(help_mod_CFLAGS) -E $<       | sh $(srcdir)/genfslist.sh help > $@ || (rm -f $@; exit 1)
- help_mod_CFLAGS = $(COMMON_CFLAGS)
-@@ -2007,140 +2110,53 @@
- # For default.mod
- default_mod_SOURCES = commands/default.c
--CLEANFILES += default.mod mod-default.o mod-default.c pre-default.o default_mod-commands_default.o def-default.lst und-default.lst
--MOSTLYCLEANFILES += default_mod-commands_default.d
--DEFSYMFILES += def-default.lst
--UNDSYMFILES += und-default.lst
--
--default.mod: pre-default.o mod-default.o
--      -rm -f $@
--      $(LD) $(default_mod_LDFLAGS) $(LDFLAGS) -r -d -o $@ $^
--      $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
--
--pre-default.o: default_mod-commands_default.o
--      -rm -f $@
--      $(LD) $(default_mod_LDFLAGS) -r -d -o $@ $^
--
--mod-default.o: mod-default.c
--      $(CC) $(CPPFLAGS) $(CFLAGS) $(default_mod_CFLAGS) -c -o $@ $<
--
--mod-default.c: moddep.lst genmodsrc.sh
--      sh $(srcdir)/genmodsrc.sh 'default' $< > $@ || (rm -f $@; exit 1)
--
--def-default.lst: pre-default.o
--      $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 default/' > $@
--
--und-default.lst: pre-default.o
--      echo 'default' > $@
--      $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
--
--default_mod-commands_default.o: commands/default.c
--      $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(default_mod_CFLAGS) -c -o $@ $<
--
--default_mod-commands_default.d: commands/default.c
--      set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(default_mod_CFLAGS) -M $<         | sed 's,default\.o[ :]*,default_mod-commands_default.o $@ : ,g' > $@;          [ -s $@ ] || rm -f $@
--
---include default_mod-commands_default.d
--
--CLEANFILES += cmd-default_mod-commands_default.lst fs-default_mod-commands_default.lst
--COMMANDFILES += cmd-default_mod-commands_default.lst
--FSFILES += fs-default_mod-commands_default.lst
--
--cmd-default_mod-commands_default.lst: commands/default.c gencmdlist.sh
--      set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(default_mod_CFLAGS) -E $<         | sh $(srcdir)/gencmdlist.sh default > $@ || (rm -f $@; exit 1)
--
--fs-default_mod-commands_default.lst: commands/default.c genfslist.sh
--      set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(default_mod_CFLAGS) -E $<         | sh $(srcdir)/genfslist.sh default > $@ || (rm -f $@; exit 1)
--
--
- default_mod_CFLAGS =  $(COMMON_CFLAGS)
- default_mod_LDFLAGS = $(COMMON_LDFLAGS)
- # For timeout.mod
- timeout_mod_SOURCES = commands/timeout.c
--CLEANFILES += timeout.mod mod-timeout.o mod-timeout.c pre-timeout.o timeout_mod-commands_timeout.o def-timeout.lst und-timeout.lst
--MOSTLYCLEANFILES += timeout_mod-commands_timeout.d
--DEFSYMFILES += def-timeout.lst
--UNDSYMFILES += und-timeout.lst
--
--timeout.mod: pre-timeout.o mod-timeout.o
--      -rm -f $@
--      $(LD) $(timeout_mod_LDFLAGS) $(LDFLAGS) -r -d -o $@ $^
--      $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
--
--pre-timeout.o: timeout_mod-commands_timeout.o
--      -rm -f $@
--      $(LD) $(timeout_mod_LDFLAGS) -r -d -o $@ $^
--
--mod-timeout.o: mod-timeout.c
--      $(CC) $(CPPFLAGS) $(CFLAGS) $(timeout_mod_CFLAGS) -c -o $@ $<
--
--mod-timeout.c: moddep.lst genmodsrc.sh
--      sh $(srcdir)/genmodsrc.sh 'timeout' $< > $@ || (rm -f $@; exit 1)
--
--def-timeout.lst: pre-timeout.o
--      $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 timeout/' > $@
--
--und-timeout.lst: pre-timeout.o
--      echo 'timeout' > $@
--      $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
--
--timeout_mod-commands_timeout.o: commands/timeout.c
--      $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(timeout_mod_CFLAGS) -c -o $@ $<
--
--timeout_mod-commands_timeout.d: commands/timeout.c
--      set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(timeout_mod_CFLAGS) -M $<         | sed 's,timeout\.o[ :]*,timeout_mod-commands_timeout.o $@ : ,g' > $@;          [ -s $@ ] || rm -f $@
--
---include timeout_mod-commands_timeout.d
--
--CLEANFILES += cmd-timeout_mod-commands_timeout.lst fs-timeout_mod-commands_timeout.lst
--COMMANDFILES += cmd-timeout_mod-commands_timeout.lst
--FSFILES += fs-timeout_mod-commands_timeout.lst
--
--cmd-timeout_mod-commands_timeout.lst: commands/timeout.c gencmdlist.sh
--      set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(timeout_mod_CFLAGS) -E $<         | sh $(srcdir)/gencmdlist.sh timeout > $@ || (rm -f $@; exit 1)
--
--fs-timeout_mod-commands_timeout.lst: commands/timeout.c genfslist.sh
--      set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(timeout_mod_CFLAGS) -E $<         | sh $(srcdir)/genfslist.sh timeout > $@ || (rm -f $@; exit 1)
--
--
- timeout_mod_CFLAGS =  $(COMMON_CFLAGS)
- timeout_mod_LDFLAGS = $(COMMON_LDFLAGS)
- # For configfile.mod
- configfile_mod_SOURCES = commands/configfile.c
--CLEANFILES += configfile.mod mod-configfile.o mod-configfile.c pre-configfile.o configfile_mod-commands_configfile.o def-configfile.lst und-configfile.lst
--MOSTLYCLEANFILES += configfile_mod-commands_configfile.d
-+CLEANFILES += configfile.mod mod-configfile.o mod-configfile.c pre-configfile.o configfile_mod-commands_configfile.o und-configfile.lst
-+ifneq ($(configfile_mod_EXPORTS),no)
-+CLEANFILES += def-configfile.lst
- DEFSYMFILES += def-configfile.lst
-+endif
-+MOSTLYCLEANFILES += configfile_mod-commands_configfile.d
- UNDSYMFILES += und-configfile.lst
- configfile.mod: pre-configfile.o mod-configfile.o
-       -rm -f $@
--      $(LD) $(configfile_mod_LDFLAGS) $(LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(configfile_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
-       $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
- pre-configfile.o: configfile_mod-commands_configfile.o
-       -rm -f $@
--      $(LD) $(configfile_mod_LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(configfile_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
- mod-configfile.o: mod-configfile.c
--      $(CC) $(CPPFLAGS) $(CFLAGS) $(configfile_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(configfile_mod_CFLAGS) -c -o $@ $<
- mod-configfile.c: moddep.lst genmodsrc.sh
-       sh $(srcdir)/genmodsrc.sh 'configfile' $< > $@ || (rm -f $@; exit 1)
-+ifneq ($(configfile_mod_EXPORTS),no)
- def-configfile.lst: pre-configfile.o
-       $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 configfile/' > $@
-+endif
- und-configfile.lst: pre-configfile.o
-       echo 'configfile' > $@
-       $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
- configfile_mod-commands_configfile.o: commands/configfile.c
--      $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(configfile_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(configfile_mod_CFLAGS) -c -o $@ $<
- configfile_mod-commands_configfile.d: commands/configfile.c
--      set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(configfile_mod_CFLAGS) -M $<      | sed 's,configfile\.o[ :]*,configfile_mod-commands_configfile.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(configfile_mod_CFLAGS) -M $<         | sed 's,configfile\.o[ :]*,configfile_mod-commands_configfile.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
- -include configfile_mod-commands_configfile.d
-@@ -2149,10 +2165,10 @@
- FSFILES += fs-configfile_mod-commands_configfile.lst
- cmd-configfile_mod-commands_configfile.lst: commands/configfile.c gencmdlist.sh
--      set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(configfile_mod_CFLAGS) -E $<      | sh $(srcdir)/gencmdlist.sh configfile > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(configfile_mod_CFLAGS) -E $<         | sh $(srcdir)/gencmdlist.sh configfile > $@ || (rm -f $@; exit 1)
- fs-configfile_mod-commands_configfile.lst: commands/configfile.c genfslist.sh
--      set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(configfile_mod_CFLAGS) -E $<      | sh $(srcdir)/genfslist.sh configfile > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(configfile_mod_CFLAGS) -E $<         | sh $(srcdir)/genfslist.sh configfile > $@ || (rm -f $@; exit 1)
- configfile_mod_CFLAGS = $(COMMON_CFLAGS)
-@@ -2160,38 +2176,43 @@
- # For search.mod.
- search_mod_SOURCES = commands/search.c
--CLEANFILES += search.mod mod-search.o mod-search.c pre-search.o search_mod-commands_search.o def-search.lst und-search.lst
--MOSTLYCLEANFILES += search_mod-commands_search.d
-+CLEANFILES += search.mod mod-search.o mod-search.c pre-search.o search_mod-commands_search.o und-search.lst
-+ifneq ($(search_mod_EXPORTS),no)
-+CLEANFILES += def-search.lst
- DEFSYMFILES += def-search.lst
-+endif
-+MOSTLYCLEANFILES += search_mod-commands_search.d
- UNDSYMFILES += und-search.lst
- search.mod: pre-search.o mod-search.o
-       -rm -f $@
--      $(LD) $(search_mod_LDFLAGS) $(LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(search_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
-       $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
- pre-search.o: search_mod-commands_search.o
-       -rm -f $@
--      $(LD) $(search_mod_LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(search_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
- mod-search.o: mod-search.c
--      $(CC) $(CPPFLAGS) $(CFLAGS) $(search_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(search_mod_CFLAGS) -c -o $@ $<
- mod-search.c: moddep.lst genmodsrc.sh
-       sh $(srcdir)/genmodsrc.sh 'search' $< > $@ || (rm -f $@; exit 1)
-+ifneq ($(search_mod_EXPORTS),no)
- def-search.lst: pre-search.o
-       $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 search/' > $@
-+endif
- und-search.lst: pre-search.o
-       echo 'search' > $@
-       $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
- search_mod-commands_search.o: commands/search.c
--      $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(search_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(search_mod_CFLAGS) -c -o $@ $<
- search_mod-commands_search.d: commands/search.c
--      set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(search_mod_CFLAGS) -M $<          | sed 's,search\.o[ :]*,search_mod-commands_search.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(search_mod_CFLAGS) -M $<     | sed 's,search\.o[ :]*,search_mod-commands_search.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
- -include search_mod-commands_search.d
-@@ -2200,10 +2221,10 @@
- FSFILES += fs-search_mod-commands_search.lst
- cmd-search_mod-commands_search.lst: commands/search.c gencmdlist.sh
--      set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(search_mod_CFLAGS) -E $<          | sh $(srcdir)/gencmdlist.sh search > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(search_mod_CFLAGS) -E $<     | sh $(srcdir)/gencmdlist.sh search > $@ || (rm -f $@; exit 1)
- fs-search_mod-commands_search.lst: commands/search.c genfslist.sh
--      set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(search_mod_CFLAGS) -E $<          | sh $(srcdir)/genfslist.sh search > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(search_mod_CFLAGS) -E $<     | sh $(srcdir)/genfslist.sh search > $@ || (rm -f $@; exit 1)
- search_mod_CFLAGS = $(COMMON_CFLAGS)
-@@ -2211,38 +2232,43 @@
- # For gzio.mod.
- gzio_mod_SOURCES = io/gzio.c
--CLEANFILES += gzio.mod mod-gzio.o mod-gzio.c pre-gzio.o gzio_mod-io_gzio.o def-gzio.lst und-gzio.lst
--MOSTLYCLEANFILES += gzio_mod-io_gzio.d
-+CLEANFILES += gzio.mod mod-gzio.o mod-gzio.c pre-gzio.o gzio_mod-io_gzio.o und-gzio.lst
-+ifneq ($(gzio_mod_EXPORTS),no)
-+CLEANFILES += def-gzio.lst
- DEFSYMFILES += def-gzio.lst
-+endif
-+MOSTLYCLEANFILES += gzio_mod-io_gzio.d
- UNDSYMFILES += und-gzio.lst
- gzio.mod: pre-gzio.o mod-gzio.o
-       -rm -f $@
--      $(LD) $(gzio_mod_LDFLAGS) $(LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(gzio_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
-       $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
- pre-gzio.o: gzio_mod-io_gzio.o
-       -rm -f $@
--      $(LD) $(gzio_mod_LDFLAGS) -r -d -o $@ $^
-+      $(TARGET_CC) $(gzio_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
- mod-gzio.o: mod-gzio.c
--      $(CC) $(CPPFLAGS) $(CFLAGS) $(gzio_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(gzio_mod_CFLAGS) -c -o $@ $<
- mod-gzio.c: moddep.lst genmodsrc.sh
-       sh $(srcdir)/genmodsrc.sh 'gzio' $< > $@ || (rm -f $@; exit 1)
-+ifneq ($(gzio_mod_EXPORTS),no)
- def-gzio.lst: pre-gzio.o
-       $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 gzio/' > $@
-+endif
- und-gzio.lst: pre-gzio.o
-       echo 'gzio' > $@
-       $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
- gzio_mod-io_gzio.o: io/gzio.c
--      $(CC) -Iio -I$(srcdir)/io $(CPPFLAGS) $(CFLAGS) $(gzio_mod_CFLAGS) -c -o $@ $<
-+      $(TARGET_CC) -Iio -I$(srcdir)/io $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(gzio_mod_CFLAGS) -c -o $@ $<
- gzio_mod-io_gzio.d: io/gzio.c
--      set -e;           $(CC) -Iio -I$(srcdir)/io $(CPPFLAGS) $(CFLAGS) $(gzio_mod_CFLAGS) -M $<        | sed 's,gzio\.o[ :]*,gzio_mod-io_gzio.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
-+      set -e;           $(TARGET_CC) -Iio -I$(srcdir)/io $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(gzio_mod_CFLAGS) -M $<           | sed 's,gzio\.o[ :]*,gzio_mod-io_gzio.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
- -include gzio_mod-io_gzio.d
-@@ -2251,10 +2277,10 @@
- FSFILES += fs-gzio_mod-io_gzio.lst
- cmd-gzio_mod-io_gzio.lst: io/gzio.c gencmdlist.sh
--      set -e;           $(CC) -Iio -I$(srcdir)/io $(CPPFLAGS) $(CFLAGS) $(gzio_mod_CFLAGS) -E $<        | sh $(srcdir)/gencmdlist.sh gzio > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Iio -I$(srcdir)/io $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(gzio_mod_CFLAGS) -E $<           | sh $(srcdir)/gencmdlist.sh gzio > $@ || (rm -f $@; exit 1)
- fs-gzio_mod-io_gzio.lst: io/gzio.c genfslist.sh
--      set -e;           $(CC) -Iio -I$(srcdir)/io $(CPPFLAGS) $(CFLAGS) $(gzio_mod_CFLAGS) -E $<        | sh $(srcdir)/genfslist.sh gzio > $@ || (rm -f $@; exit 1)
-+      set -e;           $(TARGET_CC) -Iio -I$(srcdir)/io $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(gzio_mod_CFLAGS) -E $<           | sh $(srcdir)/genfslist.sh gzio > $@ || (rm -f $@; exit 1)
- gzio_mod_CFLAGS = $(COMMON_CFLAGS)
-Index: conf/sparc64-ieee1275.rmk
-===================================================================
-RCS file: /cvsroot/grub/grub2/conf/sparc64-ieee1275.rmk,v
-retrieving revision 1.8
-retrieving revision 1.13
-diff -u -r1.8 -r1.13
---- conf/sparc64-ieee1275.rmk  18 Nov 2005 10:51:00 -0000      1.8
-+++ conf/sparc64-ieee1275.rmk  28 May 2006 23:01:43 -0000      1.13
-@@ -3,35 +3,34 @@
- COMMON_ASFLAGS = -nostdinc
- COMMON_CFLAGS = -ggdb -ffreestanding -m64 -mno-app-regs
--COMMON_LDFLAGS = -melf64_sparc
-+COMMON_LDFLAGS = -melf64_sparc -nostdlib
- # Images.
--MOSTLYCLEANFILES += grubof_symlist.c kernel_syms.lst
-+MOSTLYCLEANFILES += kernel_elf_symlist.c kernel_syms.lst
- DEFSYMFILES += kernel_syms.lst
--grubof_HEADERS = arg.h boot.h device.h disk.h dl.h elf.h env.h err.h \
-+kernel_elf_HEADERS = arg.h boot.h device.h disk.h dl.h elf.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 types.h sparc64/libgcc.h loader.h \
-       partition.h pc_partition.h ieee1275/ieee1275.h machine/time.h \
-       machine/kernel.h
--grubof_symlist.c: $(addprefix include/grub/,$(grubof_HEADERS)) gensymlist.sh
--      sh $(srcdir)/gensymlist.sh $(filter %.h,$^) > $@
-+kernel_elf_symlist.c: $(addprefix include/grub/,$(kernel_elf_HEADERS)) config.h gensymlist.sh
-+      /bin/sh gensymlist.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1)
- # For the parser.
- grub_script.tab.c grub_script.tab.h: normal/parser.y
-       $(YACC) -d -p grub_script_yy -b grub_script $(srcdir)/normal/parser.y
--kernel_syms.lst: $(addprefix include/grub/,$(grubof_HEADERS)) genkernsyms.sh
--      sh $(srcdir)/genkernsyms.sh $(filter %h,$^) > $@
-+kernel_syms.lst: $(addprefix include/grub/,$(kernel_elf_HEADERS)) config.h genkernsyms.sh
-+      /bin/sh genkernsyms.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1)
- # Programs
--pkgdata_PROGRAMS = grubof
-+pkgdata_PROGRAMS = kernel.elf
- # Utilities.
- #bin_UTILITIES = grub-emu grub-mkimage
--noinst_UTILITIES = genmoddep
- # For grub-mkimage.
- grub_mkimage_SOURCES = util/sparc64/ieee1275/grub-mkimage.c util/misc.c \
-@@ -63,20 +62,17 @@
- grub_emu_LDFLAGS = $(LIBCURSES)
--grubof_SOURCES = kern/sparc64/ieee1275/init.c kern/ieee1275/ieee1275.c \
-+kernel_elf_SOURCES = kern/sparc64/ieee1275/init.c kern/ieee1275/ieee1275.c \
-       kern/main.c kern/device.c kern/disk.c kern/dl.c kern/file.c \
-       kern/fs.c kern/err.c kern/misc.c kern/mm.c kern/loader.c \
-       kern/rescue.c kern/term.c term/ieee1275/ofconsole.c \
-       kern/sparc64/ieee1275/openfw.c disk/ieee1275/ofdisk.c \
--      kern/partition.c kern/env.c kern/sparc64/dl.c grubof_symlist.c \
-+      kern/partition.c kern/env.c kern/sparc64/dl.c kernel_elf_symlist.c \
-       kern/sparc64/cache.S kern/parser.c
--grubof_HEADERS = grub/sparc64/ieee1275/ieee1275.h
--grubof_CFLAGS = $(COMMON_CFLAGS)
--grubof_ASFLAGS = $(COMMON_ASFLAGS)
--grubof_LDFLAGS = -mno-app-regs -nostdlib -Wl,-N,-Ttext,0x200000,-Bstatic,-melf64_sparc
--
--# For genmoddep.
--genmoddep_SOURCES = util/genmoddep.c
-+kernel_elf_HEADERS = grub/sparc64/ieee1275/ieee1275.h
-+kernel_elf_CFLAGS = $(COMMON_CFLAGS)
-+kernel_elf_ASFLAGS = $(COMMON_ASFLAGS)
-+kernel_elf_LDFLAGS = -mno-app-regs -nostdlib -Wl,-N,-Ttext,0x200000,-Bstatic,-melf64_sparc
- # Modules.
- #_linux.mod linux.mod
-@@ -84,7 +80,7 @@
-       hfs.mod jfs.mod normal.mod hello.mod font.mod ls.mod \
-       boot.mod cmp.mod cat.mod terminal.mod fshelp.mod amiga.mod apple.mod \
-       pc.mod suspend.mod loopback.mod help.mod reboot.mod halt.mod sun.mod \
--      default.mod timeout.mod configfile.mod search.mod gzio.mod xfs.mod \
-+      configfile.mod search.mod gzio.mod xfs.mod \
-       affs.mod sfs.mod acorn.mod
- # For fshelp.mod.
-@@ -154,7 +150,7 @@
- # For normal.mod.
- normal_mod_SOURCES = normal/arg.c normal/cmdline.c normal/command.c   \
--      normal/completion.c normal/context.c normal/execute.c           \
-+      normal/completion.c normal/execute.c                            \
-       normal/function.c normal/lexer.c normal/main.c normal/menu.c    \
-       normal/menu_entry.c normal/misc.c normal/script.c               \
-       normal/sparc64/setjmp.S                                         \
-Index: disk/loopback.c
-===================================================================
-RCS file: /cvsroot/grub/grub2/disk/loopback.c,v
-retrieving revision 1.3
-retrieving revision 1.4
-diff -u -r1.3 -r1.4
---- disk/loopback.c    13 Nov 2005 15:47:09 -0000      1.3
-+++ disk/loopback.c    4 Jun 2006 15:56:54 -0000       1.4
-@@ -1,7 +1,7 @@
- /* loopback.c - command to add loopback devices.  */
- /*
-  *  GRUB  --  GRand Unified Bootloader
-- *  Copyright (C) 2005  Free Software Foundation, Inc.
-+ *  Copyright (C) 2005,2006  Free Software Foundation, Inc.
-  *
-  *  GRUB is free software; you can redistribute it and/or modify
-  *  it under the terms of the GNU General Public License as published by
-@@ -53,10 +53,12 @@
-   /* Search for the device.  */
-   for (dev = loopback_list, prev = &loopback_list;
--       dev; prev = &dev->next, dev = dev->next)
--    if (!grub_strcmp (dev->devname, name))
-+       dev;
-+       prev = &dev->next, dev = dev->next)
-+    if (grub_strcmp (dev->devname, name) == 0)
-       break;
--  if (!dev)
-+  
-+  if (! dev)
-     return grub_error (GRUB_ERR_BAD_DEVICE, "Device not found");
-   
-   /* Remove the device from the list.  */
-@@ -96,12 +98,13 @@
-   
-   /* First try to replace the old device.  */
-   for (newdev = loopback_list; newdev; newdev = newdev->next)
--    if (!grub_strcmp (newdev->devname, args[0]))
-+    if (grub_strcmp (newdev->devname, args[0]) == 0)
-       break;
-+  
-   if (newdev)
-     {
-       char *newname = grub_strdup (args[1]);
--      if (!newname)
-+      if (! newname)
-       return grub_errno;
-       
-       grub_free (newdev->filename);
-@@ -115,18 +118,18 @@
-   
-   /* Unable to replace it, make a new entry.  */
-   newdev = grub_malloc (sizeof (struct grub_loopback));
--  if (!newdev)
-+  if (! newdev)
-     return grub_errno;
-   
-   newdev->devname = grub_strdup (args[0]);
--  if (!newdev->devname)
-+  if (! newdev->devname)
-     {
-       grub_free (newdev);
-       return grub_errno;
-     }
-   
-   newdev->filename = grub_strdup (args[1]);
--  if (!newdev->devname)
-+  if (! newdev->filename)
-     {
-       grub_free (newdev->devname);
-       grub_free (newdev);
-@@ -163,7 +166,7 @@
-   struct grub_loopback *dev;
-     
-   for (dev = loopback_list; dev; dev = dev->next)
--    if (!grub_strcmp (dev->devname, name))
-+    if (grub_strcmp (dev->devname, name) == 0)
-       break;
-   
-   if (! dev)
-@@ -193,26 +196,26 @@
- }
- static grub_err_t
--grub_loopback_read (grub_disk_t disk, unsigned long sector,
--                  unsigned long size, char *buf)
-+grub_loopback_read (grub_disk_t disk, grub_disk_addr_t sector,
-+                  grub_size_t size, char *buf)
- {
-   grub_file_t file = (grub_file_t) disk->data;
--  long pos;
-+  grub_off_t pos;
-   
--  grub_file_seek (file, sector * GRUB_DISK_SECTOR_SIZE);
-+  grub_file_seek (file, sector << GRUB_DISK_SECTOR_BITS);
-   
--  grub_file_read (file, buf, size * GRUB_DISK_SECTOR_SIZE);
-+  grub_file_read (file, buf, size << GRUB_DISK_SECTOR_BITS);
-   if (grub_errno)
-     return grub_errno;
-   
-   /* In case there is more data read than there is available, in case
-      of files that are not a multiple of GRUB_DISK_SECTOR_SIZE, fill
-      the rest with zeros.  */
--  pos = sector * GRUB_DISK_SECTOR_SIZE + size * GRUB_DISK_SECTOR_SIZE;
-+  pos = (sector + size) << GRUB_DISK_SECTOR_BITS;
-   if (pos > file->size)
-     {
--      unsigned long amount = pos - file->size;
--      grub_memset (buf + pos - amount, amount, 0);
-+      grub_size_t amount = pos - file->size;
-+      grub_memset (buf + size - amount, 0, amount);
-     }
-   
-   return 0;
-@@ -220,9 +223,9 @@
- static grub_err_t
- grub_loopback_write (grub_disk_t disk __attribute ((unused)),
--                 unsigned long sector __attribute ((unused)),
--                 unsigned long size __attribute ((unused)),
--                 const char *buf __attribute ((unused)))
-+                   grub_disk_addr_t sector __attribute ((unused)),
-+                   grub_size_t size __attribute ((unused)),
-+                   const char *buf __attribute ((unused)))
- {
-   return GRUB_ERR_NOT_IMPLEMENTED_YET;
- }
-@@ -243,7 +246,7 @@
- GRUB_MOD_INIT(loop)
- {
--  (void)mod;                  /* To stop warning. */
-+  (void) mod;                 /* To stop warning. */
-   grub_register_command ("loopback", grub_cmd_loopback, GRUB_COMMAND_FLAG_BOTH,
-                        "loopback [-d|-p] DEVICENAME FILE",
-                        "Make a device of a file.", options);
-@@ -255,4 +258,3 @@
-   grub_unregister_command ("loopback");
-   grub_disk_dev_unregister (&grub_loopback_dev);
- }
--
-Index: disk/efi/efidisk.c
-===================================================================
-RCS file: disk/efi/efidisk.c
-diff -N disk/efi/efidisk.c
---- /dev/null  1 Jan 1970 00:00:00 -0000
-+++ disk/efi/efidisk.c 4 Jun 2006 15:56:54 -0000       1.4
-@@ -0,0 +1,860 @@
-+/*
-+ *  GRUB  --  GRand Unified Bootloader
-+ *  Copyright (C) 2006  Free Software Foundation, Inc.
-+ *
-+ *  GRUB is free software; you can redistribute it and/or modify
-+ *  it under the terms of the GNU General Public License as published by
-+ *  the Free Software Foundation; either version 2 of the License, or
-+ *  (at your option) any later version.
-+ *
-+ *  This program is distributed in the hope that it will be useful,
-+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+ *  GNU General Public License for more details.
-+ *
-+ *  You should have received a copy of the GNU General Public License
-+ *  along with GRUB; if not, write to the Free Software
-+ *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-+ */
-+
-+#include <grub/disk.h>
-+#include <grub/partition.h>
-+#include <grub/mm.h>
-+#include <grub/types.h>
-+#include <grub/misc.h>
-+#include <grub/err.h>
-+#include <grub/term.h>
-+#include <grub/efi/api.h>
-+#include <grub/efi/efi.h>
-+#include <grub/efi/disk.h>
-+
-+struct grub_efidisk_data
-+{
-+  grub_efi_handle_t handle;
-+  grub_efi_device_path_t *device_path;
-+  grub_efi_device_path_t *last_device_path;
-+  grub_efi_block_io_t *block_io;
-+  grub_efi_disk_io_t *disk_io;
-+  struct grub_efidisk_data *next;
-+};
-+
-+/* GUIDs.  */
-+static grub_efi_guid_t disk_io_guid = GRUB_EFI_DISK_IO_GUID;
-+static grub_efi_guid_t block_io_guid = GRUB_EFI_BLOCK_IO_GUID;
-+
-+static struct grub_efidisk_data *fd_devices;
-+static struct grub_efidisk_data *hd_devices;
-+static struct grub_efidisk_data *cd_devices;
-+
-+/* Duplicate a device path.  */
-+static grub_efi_device_path_t *
-+duplicate_device_path (const grub_efi_device_path_t *dp)
-+{
-+  grub_efi_device_path_t *p;
-+  grub_size_t total_size = 0;
-+  
-+  for (p = (grub_efi_device_path_t *) dp;
-+       ;
-+       p = GRUB_EFI_NEXT_DEVICE_PATH (p))
-+    {
-+      total_size += GRUB_EFI_DEVICE_PATH_LENGTH (p);
-+      if (GRUB_EFI_END_ENTIRE_DEVICE_PATH (p))
-+      break;
-+    }
-+
-+  p = grub_malloc (total_size);
-+  if (! p)
-+    return 0;
-+
-+  grub_memcpy (p, dp, total_size);
-+  return p;
-+}
-+
-+/* Return the device path node right before the end node.  */
-+static grub_efi_device_path_t *
-+find_last_device_path (const grub_efi_device_path_t *dp)
-+{
-+  grub_efi_device_path_t *next, *p;
-+
-+  if (GRUB_EFI_END_ENTIRE_DEVICE_PATH (dp))
-+    return 0;
-+
-+  for (p = (grub_efi_device_path_t *) dp, next = GRUB_EFI_NEXT_DEVICE_PATH (p);
-+       ! GRUB_EFI_END_ENTIRE_DEVICE_PATH (next);
-+       p = next, next = GRUB_EFI_NEXT_DEVICE_PATH (next))
-+    ;
-+
-+  return p;
-+}
-+
-+/* Compare device paths.  */
-+static int
-+compare_device_paths (const grub_efi_device_path_t *dp1,
-+                    const grub_efi_device_path_t *dp2)
-+{
-+  if (! dp1 || ! dp2)
-+    /* Return non-zero.  */
-+    return 1;
-+  
-+  while (1)
-+    {
-+      grub_efi_uint8_t type1, type2;
-+      grub_efi_uint8_t subtype1, subtype2;
-+      grub_efi_uint16_t len1, len2;
-+      int ret;
-+      
-+      type1 = GRUB_EFI_DEVICE_PATH_TYPE (dp1);
-+      type2 = GRUB_EFI_DEVICE_PATH_TYPE (dp2);
-+
-+      if (type1 != type2)
-+      return (int) type2 - (int) type1;
-+
-+      subtype1 = GRUB_EFI_DEVICE_PATH_SUBTYPE (dp1);
-+      subtype2 = GRUB_EFI_DEVICE_PATH_SUBTYPE (dp2);
-+      
-+      if (subtype1 != subtype2)
-+      return (int) subtype1 - (int) subtype2;
-+
-+      len1 = GRUB_EFI_DEVICE_PATH_LENGTH (dp1);
-+      len2 = GRUB_EFI_DEVICE_PATH_LENGTH (dp2);
-+
-+      if (len1 != len2)
-+      return (int) len1 - (int) len2;
-+
-+      ret = grub_memcmp (dp1, dp2, len1);
-+      if (ret != 0)
-+      return ret;
-+
-+      if (GRUB_EFI_END_ENTIRE_DEVICE_PATH (dp1))
-+      break;
-+
-+      dp1 = (grub_efi_device_path_t *) ((char *) dp1 + len1);
-+      dp2 = (grub_efi_device_path_t *) ((char *) dp2 + len2);
-+    }
-+
-+  return 0;
-+}
-+
-+static struct grub_efidisk_data *
-+make_devices (void)
-+{
-+  grub_efi_uintn_t num_handles;
-+  grub_efi_handle_t *handles;
-+  grub_efi_handle_t *handle;
-+  struct grub_efidisk_data *devices = 0;
-+  
-+  /* Find handles which support the disk io interface.  */
-+  handles = grub_efi_locate_handle (GRUB_EFI_BY_PROTOCOL, &disk_io_guid,
-+                                  0, &num_handles);
-+  if (! handles)
-+    return 0;
-+
-+  /* Make a linked list of devices.  */
-+  for (handle = handles; num_handles--; handle++)
-+    {
-+      grub_efi_device_path_t *dp;
-+      grub_efi_device_path_t *ldp;
-+      struct grub_efidisk_data *d;
-+      grub_efi_block_io_t *bio;
-+      grub_efi_disk_io_t *dio;
-+      
-+      dp = grub_efi_get_device_path (*handle);
-+      if (! dp)
-+      continue;
-+
-+      ldp = find_last_device_path (dp);
-+      if (! ldp)
-+      /* This is empty. Why?  */
-+      continue;
-+      
-+      bio = grub_efi_open_protocol (*handle, &block_io_guid,
-+                                  GRUB_EFI_OPEN_PROTOCOL_GET_PROTOCOL);
-+      dio = grub_efi_open_protocol (*handle, &disk_io_guid,
-+                                  GRUB_EFI_OPEN_PROTOCOL_GET_PROTOCOL);
-+      if (! bio || ! dio)
-+      /* This should not happen... Why?  */
-+      continue;
-+      
-+      d = grub_malloc (sizeof (*d));
-+      if (! d)
-+      {
-+        /* Uggh.  */
-+        grub_free (handles);
-+        return 0;
-+      }
-+
-+      d->handle = *handle;
-+      d->device_path = dp;
-+      d->last_device_path = ldp;
-+      d->block_io = bio;
-+      d->disk_io = dio;
-+      d->next = devices;
-+      devices = d;
-+    }
-+
-+  grub_free (handles);
-+  
-+  return devices;
-+}
-+
-+/* Find the parent device.  */
-+static struct grub_efidisk_data *
-+find_parent_device (struct grub_efidisk_data *devices,
-+                  struct grub_efidisk_data *d)
-+{
-+  grub_efi_device_path_t *dp, *ldp;
-+  struct grub_efidisk_data *parent;
-+  
-+  dp = duplicate_device_path (d->device_path);
-+  if (! dp)
-+    return 0;
-+
-+  ldp = find_last_device_path (dp);
-+  ldp->type = GRUB_EFI_END_DEVICE_PATH_TYPE;
-+  ldp->subtype = GRUB_EFI_END_ENTIRE_DEVICE_PATH_SUBTYPE;
-+  ldp->length[0] = sizeof (*ldp);
-+  ldp->length[1] = 0;
-+
-+  for (parent = devices; parent; parent = parent->next)
-+    {
-+      /* Ignore itself.  */
-+      if (parent == d)
-+      continue;
-+      
-+      if (compare_device_paths (parent->device_path, dp) == 0)
-+      {
-+        /* Found.  */
-+        if (! parent->last_device_path)
-+          parent = 0;
-+        
-+        break;
-+      }
-+    }
-+
-+  grub_free (dp);
-+  return parent;
-+}
-+
-+static int
-+iterate_child_devices (struct grub_efidisk_data *devices,
-+                     struct grub_efidisk_data *d,
-+                     int (*hook) (struct grub_efidisk_data *child))
-+{
-+  struct grub_efidisk_data *p;
-+  
-+  for (p = devices; p; p = p->next)
-+    {
-+      grub_efi_device_path_t *dp, *ldp;
-+
-+      dp = duplicate_device_path (p->device_path);
-+      if (! dp)
-+      return 0;
-+      
-+      ldp = find_last_device_path (dp);
-+      ldp->type = GRUB_EFI_END_DEVICE_PATH_TYPE;
-+      ldp->subtype = GRUB_EFI_END_ENTIRE_DEVICE_PATH_SUBTYPE;
-+      ldp->length[0] = sizeof (*ldp);
-+      ldp->length[1] = 0;
-+      
-+      if (compare_device_paths (dp, d->device_path) == 0)
-+      if (hook (p))
-+        {
-+          grub_free (dp);
-+          return 1;
-+        }
-+
-+      grub_free (dp);
-+    }
-+
-+  return 0;
-+}
-+
-+/* Add a device into a list of devices in an ascending order.  */
-+static void
-+add_device (struct grub_efidisk_data **devices, struct grub_efidisk_data *d)
-+{
-+  struct grub_efidisk_data **p;
-+  struct grub_efidisk_data *n;
-+
-+  for (p = devices; *p; p = &((*p)->next))
-+    {
-+      int ret;
-+
-+      ret = compare_device_paths (find_last_device_path ((*p)->device_path),
-+                                find_last_device_path (d->device_path));
-+      if (ret == 0)
-+      ret = compare_device_paths ((*p)->device_path,
-+                                  d->device_path);
-+      if (ret == 0)
-+      return;
-+      else if (ret > 0)
-+      break;
-+    }
-+
-+  n = grub_malloc (sizeof (*n));
-+  if (! n)
-+    return;
-+
-+  grub_memcpy (n, d, sizeof (*n));
-+  n->next = (*p);
-+  (*p) = n;
-+}
-+
-+/* Name the devices.  */
-+static void
-+name_devices (struct grub_efidisk_data *devices)
-+{
-+  struct grub_efidisk_data *d;
-+  
-+  /* First, identify devices by media device paths.  */
-+  for (d = devices; d; d = d->next)
-+    {
-+      grub_efi_device_path_t *dp;
-+
-+      dp = d->last_device_path;
-+      if (! dp)
-+      continue;
-+      
-+      if (GRUB_EFI_DEVICE_PATH_TYPE (dp) == GRUB_EFI_MEDIA_DEVICE_PATH_TYPE)
-+      {
-+        int is_hard_drive = 0;
-+        
-+        switch (GRUB_EFI_DEVICE_PATH_SUBTYPE (dp))
-+          {
-+          case GRUB_EFI_HARD_DRIVE_DEVICE_PATH_SUBTYPE:
-+            is_hard_drive = 1;
-+            /* Fall through by intention.  */
-+          case GRUB_EFI_CDROM_DEVICE_PATH_SUBTYPE:
-+            {
-+              struct grub_efidisk_data *parent;
-+
-+              parent = find_parent_device (devices, d);
-+              if (parent)
-+                {
-+                  if (is_hard_drive)
-+                    {
-+#if 0
-+                      grub_printf ("adding a hard drive by a partition: ");
-+                      grub_print_device_path (parent->device_path);
-+#endif
-+                      add_device (&hd_devices, parent);
-+                    }
-+                  else
-+                    {
-+#if 0
-+                      grub_printf ("adding a cdrom by a partition: ");
-+                      grub_print_device_path (parent->device_path);
-+#endif
-+                      add_device (&cd_devices, parent);
-+                    }
-+                  
-+                  /* Mark the parent as used.  */
-+                  parent->last_device_path = 0;
-+                }
-+            }
-+            /* Mark itself as used.  */
-+            d->last_device_path = 0;
-+            break;
-+
-+          default:
-+            /* For now, ignore the others.  */
-+            break;
-+          }
-+      }
-+    }
-+
-+  /* Let's see what can be added more.  */
-+  for (d = devices; d; d = d->next)
-+    {
-+      grub_efi_device_path_t *dp;
-+      grub_efi_block_io_media_t *m;
-+      
-+      dp = d->last_device_path;
-+      if (! dp)
-+      continue;
-+
-+      m = d->block_io->media;
-+      if (m->logical_partition)
-+      {
-+        /* Only one partition in a non-media device. Assume that this
-+           is a floppy drive.  */
-+#if 0
-+        grub_printf ("adding a floppy by guessing: ");
-+        grub_print_device_path (d->device_path);
-+#endif
-+        add_device (&fd_devices, d);
-+      }
-+      else if (m->read_only && m->block_size > GRUB_DISK_SECTOR_SIZE)
-+      {
-+        /* This check is too heuristic, but assume that this is a
-+           CDROM drive.  */
-+#if 0
-+        grub_printf ("adding a cdrom by guessing: ");
-+        grub_print_device_path (d->device_path);
-+#endif
-+        add_device (&cd_devices, d);
-+      }
-+      else
-+      {
-+        /* The default is a hard drive.  */
-+#if 0
-+        grub_printf ("adding a hard drive by guessing: ");
-+        grub_print_device_path (d->device_path);
-+#endif
-+        add_device (&hd_devices, d);
-+      }
-+    }
-+}
-+
-+static void
-+free_devices (struct grub_efidisk_data *devices)
-+{
-+  struct grub_efidisk_data *p, *q;
-+  
-+  for (p = devices; p; p = q)
-+    {
-+      q = p->next;
-+      grub_free (p);
-+    }
-+}
-+
-+/* Enumerate all disks to name devices.  */
-+static void
-+enumerate_disks (void)
-+{
-+  struct grub_efidisk_data *devices;
-+  
-+  devices = make_devices ();
-+  if (! devices)
-+    return;
-+  
-+  name_devices (devices);
-+  free_devices (devices);
-+}
-+
-+static int
-+grub_efidisk_iterate (int (*hook) (const char *name))
-+{
-+  struct grub_efidisk_data *d;
-+  char buf[16];
-+  int count;
-+  
-+  for (d = fd_devices, count = 0; d; d = d->next, count++)
-+    {
-+      grub_sprintf (buf, "fd%d", count);
-+      grub_dprintf ("efidisk", "iterating %s\n", buf);
-+      if (hook (buf))
-+      return 1;
-+    }
-+  
-+  for (d = hd_devices, count = 0; d; d = d->next, count++)
-+    {
-+      grub_sprintf (buf, "hd%d", count);
-+      grub_dprintf ("efidisk", "iterating %s\n", buf);
-+      if (hook (buf))
-+      return 1;
-+    }
-+  
-+  for (d = cd_devices, count = 0; d; d = d->next, count++)
-+    {
-+      grub_sprintf (buf, "cd%d", count);
-+      grub_dprintf ("efidisk", "iterating %s\n", buf);
-+      if (hook (buf))
-+      return 1;
-+    }
-+
-+  return 0;
-+}
-+
-+static int
-+get_drive_number (const char *name)
-+{
-+  unsigned long drive;
-+
-+  if ((name[0] != 'f' && name[0] != 'h' && name[0] != 'c') || name[1] != 'd')
-+    goto fail;
-+
-+  drive = grub_strtoul (name + 2, 0, 10);
-+  if (grub_errno != GRUB_ERR_NONE)
-+    goto fail;
-+
-+  return (int) drive ;
-+
-+ fail:
-+  grub_error (GRUB_ERR_UNKNOWN_DEVICE, "not a efidisk");
-+  return -1;
-+}
-+
-+static struct grub_efidisk_data *
-+get_device (struct grub_efidisk_data *devices, int num)
-+{
-+  struct grub_efidisk_data *d;
-+
-+  for (d = devices; d && num; d = d->next, num--)
-+    ;
-+
-+  if (num == 0)
-+    return d;
-+
-+  return 0;
-+}
-+
-+static grub_err_t
-+grub_efidisk_open (const char *name, struct grub_disk *disk)
-+{
-+  int num;
-+  struct grub_efidisk_data *d = 0;
-+  grub_efi_block_io_media_t *m;
-+
-+  grub_dprintf ("efidisk", "opening %s\n", name);
-+  
-+  num = get_drive_number (name);
-+  if (num < 0)
-+    return grub_errno;
-+
-+  switch (name[0])
-+    {
-+    case 'f':
-+      disk->has_partitions = 0;
-+      d = get_device (fd_devices, num);
-+      break;
-+    case 'c':
-+      /* FIXME: a CDROM should have partitions, but not implemented yet.  */
-+      disk->has_partitions = 0;
-+      d = get_device (cd_devices, num);
-+      break;
-+    case 'h':
-+      disk->has_partitions = 1;
-+      d = get_device (hd_devices, num);
-+      break;
-+    default:
-+      /* Never reach here.  */
-+      break;
-+    }
-+
-+  if (! d)
-+    return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "no such device");
-+
-+  disk->id = ((num << 8) | name[0]);
-+  m = d->block_io->media;
-+  /* FIXME: Probably it is better to store the block size in the disk,
-+     and total sectors should be replaced with total blocks.  */
-+  grub_dprintf ("efidisk", "m = %p, last block = %llx, block size = %x\n",
-+              m, m->last_block, m->block_size);
-+  disk->total_sectors = (m->last_block
-+                       * (m->block_size >> GRUB_DISK_SECTOR_BITS));
-+  disk->data = d;
-+
-+  grub_dprintf ("efidisk", "opening %s succeeded\n", name);
-+
-+  return GRUB_ERR_NONE;
-+}
-+
-+static void
-+grub_efidisk_close (struct grub_disk *disk __attribute__ ((unused)))
-+{
-+  /* EFI disks do not allocate extra memory, so nothing to do here.  */
-+  grub_dprintf ("efidisk", "closing %s\n", disk->name);
-+}
-+
-+static grub_err_t
-+grub_efidisk_read (struct grub_disk *disk, grub_disk_addr_t sector,
-+                 grub_size_t size, char *buf)
-+{
-+  /* For now, use the disk io interface rather than the block io's.  */
-+  struct grub_efidisk_data *d;
-+  grub_efi_disk_io_t *dio;
-+  grub_efi_block_io_t *bio;
-+  grub_efi_status_t status;
-+  
-+  d = disk->data;
-+  dio = d->disk_io;
-+  bio = d->block_io;
-+
-+  grub_dprintf ("efidisk",
-+              "reading 0x%x sectors at the sector 0x%llx from %s\n",
-+              size, sector, disk->name);
-+  
-+  status = dio->read (dio, bio->media->media_id,
-+                    (grub_efi_uint64_t) sector << GRUB_DISK_SECTOR_BITS,
-+                    (grub_efi_uintn_t) size << GRUB_DISK_SECTOR_BITS,
-+                    buf);
-+  if (status != GRUB_EFI_SUCCESS)
-+    return grub_error (GRUB_ERR_READ_ERROR, "efidisk read error");
-+  
-+  return GRUB_ERR_NONE;
-+}
-+
-+static grub_err_t
-+grub_efidisk_write (struct grub_disk *disk, grub_disk_addr_t sector,
-+                  grub_size_t size, const char *buf)
-+{
-+  /* For now, use the disk io interface rather than the block io's.  */
-+  struct grub_efidisk_data *d;
-+  grub_efi_disk_io_t *dio;
-+  grub_efi_block_io_t *bio;
-+  grub_efi_status_t status;
-+  
-+  d = disk->data;
-+  dio = d->disk_io;
-+  bio = d->block_io;
-+  
-+  grub_dprintf ("efidisk",
-+              "writing 0x%x sectors at the sector 0x%llx to %s\n",
-+              size, sector, disk->name);
-+  
-+  status = dio->write (dio, bio->media->media_id,
-+                     (grub_efi_uint64_t) sector << GRUB_DISK_SECTOR_BITS,
-+                     (grub_efi_uintn_t) size << GRUB_DISK_SECTOR_BITS,
-+                     (void *) buf);
-+  if (status != GRUB_EFI_SUCCESS)
-+    return grub_error (GRUB_ERR_WRITE_ERROR, "efidisk write error");
-+  
-+  return GRUB_ERR_NONE;
-+}
-+
-+static struct grub_disk_dev grub_efidisk_dev =
-+  {
-+    .name = "efidisk",
-+    .id = GRUB_DISK_DEVICE_EFIDISK_ID,
-+    .iterate = grub_efidisk_iterate,
-+    .open = grub_efidisk_open,
-+    .close = grub_efidisk_close,
-+    .read = grub_efidisk_read,
-+    .write = grub_efidisk_write,
-+    .next = 0
-+  };
-+
-+void
-+grub_efidisk_init (void)
-+{
-+  enumerate_disks ();
-+  grub_disk_dev_register (&grub_efidisk_dev);
-+}
-+
-+void
-+grub_efidisk_fini (void)
-+{
-+  free_devices (fd_devices);
-+  free_devices (hd_devices);
-+  free_devices (cd_devices);
-+  grub_disk_dev_unregister (&grub_efidisk_dev);
-+}
-+
-+/* Some utility functions to map GRUB devices with EFI devices.  */
-+grub_efi_handle_t
-+grub_efidisk_get_device_handle (grub_disk_t disk)
-+{
-+  struct grub_efidisk_data *d;
-+  char type;
-+  
-+  if (disk->dev->id != GRUB_DISK_DEVICE_EFIDISK_ID)
-+    return 0;
-+  
-+  d = disk->data;
-+  type = disk->name[0];
-+  
-+  switch (type)
-+    {
-+    case 'f':
-+      /* This is the simplest case.  */
-+      return d->handle;
-+
-+    case 'c':
-+      /* FIXME: probably this is not correct.  */
-+      return d->handle;
-+
-+    case 'h':
-+      /* If this is the whole disk, just return its own data.  */
-+      if (! disk->partition)
-+      return d->handle;
-+
-+      /* Otherwise, we must query the corresponding device to the firmware.  */
-+      {
-+      struct grub_efidisk_data *devices;
-+      grub_efi_handle_t handle = 0;
-+      auto int find_partition (struct grub_efidisk_data *c);
-+
-+      int find_partition (struct grub_efidisk_data *c)
-+        {
-+          grub_efi_hard_drive_device_path_t hd;
-+
-+          grub_memcpy (&hd, c->last_device_path, sizeof (hd));
-+          
-+          if ((GRUB_EFI_DEVICE_PATH_TYPE (c->last_device_path)
-+               == GRUB_EFI_MEDIA_DEVICE_PATH_TYPE)
-+              && (GRUB_EFI_DEVICE_PATH_SUBTYPE (c->last_device_path)
-+                  == GRUB_EFI_HARD_DRIVE_DEVICE_PATH_SUBTYPE)
-+              && (grub_partition_get_start (disk->partition)
-+                  == hd.partition_start)
-+              && (grub_partition_get_len (disk->partition)
-+                  == hd.partition_size))
-+            {
-+              handle = c->handle;
-+              return 1;
-+            }
-+            
-+          return 0;
-+        }
-+      
-+      devices = make_devices ();
-+      iterate_child_devices (devices, d, find_partition);
-+      free_devices (devices);
-+      
-+      if (handle != 0)
-+        return handle;
-+      }
-+      break;
-+
-+    default:
-+      break;
-+    }
-+  
-+  return 0;
-+}
-+
-+char *
-+grub_efidisk_get_device_name (grub_efi_handle_t *handle)
-+{
-+  grub_efi_device_path_t *dp, *ldp;
-+
-+  dp = grub_efi_get_device_path (handle);
-+  if (! dp)
-+    return 0;
-+
-+  ldp = find_last_device_path (dp);
-+  if (! ldp)
-+    return 0;
-+
-+  if (GRUB_EFI_DEVICE_PATH_TYPE (ldp) == GRUB_EFI_MEDIA_DEVICE_PATH_TYPE
-+      && (GRUB_EFI_DEVICE_PATH_SUBTYPE (ldp)
-+        == GRUB_EFI_HARD_DRIVE_DEVICE_PATH_SUBTYPE))
-+    {
-+      /* This is a hard disk partition.  */
-+      grub_disk_t parent = 0;
-+      char *partition_name = 0;
-+      char *device_name;
-+      grub_efi_device_path_t *dup_dp, *dup_ldp;
-+      grub_efi_hard_drive_device_path_t hd;
-+      auto int find_parent_disk (const char *name);
-+      auto int find_partition (grub_disk_t disk, const grub_partition_t part);
-+
-+      /* Find the disk which is the parent of a given hard disk partition.  */
-+      int find_parent_disk (const char *name)
-+      {
-+        grub_disk_t disk;
-+
-+        disk = grub_disk_open (name);
-+        if (! disk)
-+          return 1;
-+
-+        if (disk->dev->id == GRUB_DISK_DEVICE_EFIDISK_ID)
-+          {
-+            struct grub_efidisk_data *d;
-+            
-+            d = disk->data;
-+            if (compare_device_paths (d->device_path, dup_dp) == 0)
-+              {
-+                parent = disk;
-+                return 1;
-+              }
-+          }
-+
-+        grub_disk_close (disk);
-+        return 0;
-+      }
-+
-+      /* Find the identical partition.  */
-+      int find_partition (grub_disk_t disk __attribute__ ((unused)),
-+                        const grub_partition_t part)
-+      {
-+        if (grub_partition_get_start (part) == hd.partition_start
-+            && grub_partition_get_len (part) == hd.partition_size)
-+          {
-+            partition_name = grub_partition_get_name (part);
-+            return 1;
-+          }
-+
-+        return 0;
-+      }
-+
-+      /* It is necessary to duplicate the device path so that GRUB
-+       can overwrite it.  */
-+      dup_dp = duplicate_device_path (dp);
-+      if (! dup_dp)
-+      return 0;
-+
-+      dup_ldp = find_last_device_path (dup_dp);
-+      dup_ldp->type = GRUB_EFI_END_DEVICE_PATH_TYPE;
-+      dup_ldp->subtype = GRUB_EFI_END_ENTIRE_DEVICE_PATH_SUBTYPE;
-+      dup_ldp->length[0] = sizeof (*dup_ldp);
-+      dup_ldp->length[1] = 0;
-+
-+      grub_efidisk_iterate (find_parent_disk);
-+      grub_free (dup_dp);
-+
-+      if (! parent)
-+      return 0;
-+
-+      /* Find a partition which matches the hard drive device path.  */
-+      grub_memcpy (&hd, ldp, sizeof (hd));
-+      grub_partition_iterate (parent, find_partition);
-+      
-+      if (! partition_name)
-+      {
-+        grub_disk_close (parent);
-+        return 0;
-+      }
-+
-+      device_name = grub_malloc (grub_strlen (parent->name) + 1
-+                               + grub_strlen (partition_name) + 1);
-+      if (! device_name)
-+      {
-+        grub_free (partition_name);
-+        grub_disk_close (parent);
-+        return 0;
-+      }
-+
-+      grub_sprintf (device_name, "%s,%s", parent->name, partition_name);
-+      grub_free (partition_name);
-+      grub_disk_close (parent);
-+      return device_name;
-+    }
-+  else
-+    {
-+      /* This should be an entire disk.  */
-+      auto int find_disk (const char *name);
-+      char *device_name = 0;
-+      
-+      int find_disk (const char *name)
-+      {
-+        grub_disk_t disk;
-+        
-+        disk = grub_disk_open (name);
-+        if (! disk)
-+          return 1;
-+
-+        if (disk->id == GRUB_DISK_DEVICE_EFIDISK_ID)
-+          {
-+            struct grub_efidisk_data *d;
-+            
-+            d = disk->data;
-+            if (compare_device_paths (d->device_path, dp) == 0)
-+              {
-+                device_name = grub_strdup (disk->name);
-+                grub_disk_close (disk);
-+                return 1;
-+              }
-+          }
-+
-+        grub_disk_close (disk);
-+        return 0;
-+        
-+      }
-+      
-+      grub_efidisk_iterate (find_disk);
-+      return device_name;
-+    }
-+
-+  return 0;
-+}
-Index: disk/i386/pc/biosdisk.c
-===================================================================
-RCS file: /cvsroot/grub/grub2/disk/i386/pc/biosdisk.c,v
-retrieving revision 1.7
-retrieving revision 1.8
-diff -u -r1.7 -r1.8
---- disk/i386/pc/biosdisk.c    15 Feb 2005 00:07:01 -0000      1.7
-+++ disk/i386/pc/biosdisk.c    4 Jun 2006 15:56:54 -0000       1.8
-@@ -1,6 +1,6 @@
- /*
-  *  GRUB  --  GRand Unified Bootloader
-- *  Copyright (C) 1999,2000,2001,2002,2003,2004,2005  Free Software Foundation, Inc.
-+ *  Copyright (C) 1999,2000,2001,2002,2003,2004,2005,2006  Free Software Foundation, Inc.
-  *
-  *  GRUB is free software; you can redistribute it and/or modify
-  *  it under the terms of the GNU General Public License as published by
-@@ -126,7 +126,7 @@
- static grub_err_t
- grub_biosdisk_open (const char *name, grub_disk_t disk)
- {
--  unsigned long total_sectors = 0;
-+  grub_uint64_t total_sectors = 0;
-   int drive;
-   struct grub_biosdisk_data *data;
-@@ -158,13 +158,12 @@
-         /* Clear out the DRP.  */
-         grub_memset (drp, 0, sizeof (*drp));
-         drp->size = sizeof (*drp);
--        if (!grub_biosdisk_get_diskinfo_int13_extensions (drive, drp))
-+        if (! grub_biosdisk_get_diskinfo_int13_extensions (drive, drp))
-           {
-             data->flags = GRUB_BIOSDISK_FLAG_LBA;
--            /* FIXME: 2TB limit.  */
-             if (drp->total_sectors)
--              total_sectors = drp->total_sectors & ~0L;
-+              total_sectors = drp->total_sectors;
-             else
-                 /* Some buggy BIOSes doesn't return the total sectors
-                    correctly but returns zero. So if it is zero, compute
-@@ -204,7 +203,7 @@
- static grub_err_t
- grub_biosdisk_rw (int cmd, grub_disk_t disk,
--                unsigned long sector, unsigned long size,
-+                grub_disk_addr_t sector, grub_size_t size,
-                 unsigned segment)
- {
-   struct grub_biosdisk_data *data = disk->data;
-@@ -234,9 +233,15 @@
-     {
-       unsigned coff, hoff, soff;
-       unsigned head;
-+      unsigned real_sector = (unsigned) sector;
-       
--      soff = sector % data->sectors + 1;
--      head = sector / data->sectors;
-+      /* It is impossible to reach over 2TB with the traditional
-+       CHS access.  */
-+      if (sector > ~0UL)
-+      return grub_error (GRUB_ERR_OUT_OF_RANGE, "out of disk");
-+
-+      soff = real_sector % data->sectors + 1;
-+      head = real_sector / data->sectors;
-       hoff = head % data->heads;
-       coff = head / data->heads;
-@@ -259,17 +264,36 @@
-   return GRUB_ERR_NONE;
- }
-+/* Return the number of sectors which can be read safely at a time.  */
-+static grub_size_t
-+get_safe_sectors (grub_disk_addr_t sector, grub_uint32_t sectors)
-+{
-+  grub_size_t size;
-+  grub_uint32_t offset;
-+
-+  /* OFFSET = SECTOR % SECTORS */
-+  grub_divmod64 (sector, sectors, &offset);
-+
-+  size = sectors - offset;
-+
-+  /* Limit the max to 0x7f because of Phoenix EDD.  */
-+  if (size > 0x7f)
-+    size = 0x7f;
-+
-+  return size;
-+}
-+
- static grub_err_t
--grub_biosdisk_read (grub_disk_t disk, unsigned long sector,
--                  unsigned long size, char *buf)
-+grub_biosdisk_read (grub_disk_t disk, grub_disk_addr_t sector,
-+                  grub_size_t size, char *buf)
- {
-   struct grub_biosdisk_data *data = disk->data;
-   while (size)
-     {
--      unsigned long len;
-+      grub_size_t len;
--      len = data->sectors - (sector % data->sectors);
-+      len = get_safe_sectors (sector, data->sectors);
-       if (len > size)
-       len = size;
-@@ -288,16 +312,16 @@
- }
- static grub_err_t
--grub_biosdisk_write (grub_disk_t disk, unsigned long sector,
--                   unsigned long size, const char *buf)
-+grub_biosdisk_write (grub_disk_t disk, grub_disk_addr_t sector,
-+                   grub_size_t size, const char *buf)
- {
-   struct grub_biosdisk_data *data = disk->data;
-   while (size)
-     {
--      unsigned long len;
-+      grub_size_t len;
--      len = data->sectors - (sector % data->sectors);
-+      len = get_safe_sectors (sector, data->sectors);
-       if (len > size)
-       len = size;
-Index: disk/ieee1275/ofdisk.c
-===================================================================
-RCS file: /cvsroot/grub/grub2/disk/ieee1275/ofdisk.c,v
-retrieving revision 1.2
-retrieving revision 1.3
-diff -u -r1.2 -r1.3
---- disk/ieee1275/ofdisk.c     21 Aug 2005 18:42:53 -0000      1.2
-+++ disk/ieee1275/ofdisk.c     4 Jun 2006 15:56:54 -0000       1.3
-@@ -1,7 +1,7 @@
- /* ofdisk.c - Open Firmware disk access.  */
- /*
-  *  GRUB  --  GRand Unified Bootloader
-- *  Copyright (C) 2004  Free Software Foundation, Inc.
-+ *  Copyright (C) 2004,2006  Free Software Foundation, Inc.
-  *
-  *  This program is free software; you can redistribute it and/or modify
-  *  it under the terms of the GNU General Public License as published by
-@@ -122,35 +122,37 @@
- }
- static grub_err_t
--grub_ofdisk_read (grub_disk_t disk, unsigned long sector,
--                unsigned long size, char *buf)
-+grub_ofdisk_read (grub_disk_t disk, grub_disk_addr_t sector,
-+                grub_size_t size, char *buf)
- {
-   grub_ssize_t status, actual;
-   unsigned long long pos;
-   grub_dprintf ("disk",
--              "Reading handle %p: sector 0x%lx, size 0x%lx, buf %p.\n",
-+              "Reading handle %p: sector 0x%llx, size 0x%lx, buf %p.\n",
-               (void *) disk->data, sector, size, buf);
--  pos = (unsigned long long) sector * 512UL;
-+  pos = sector * 512UL;
-   grub_ieee1275_seek ((grub_ieee1275_ihandle_t) disk->data, (int) (pos >> 32),
-                     (int) pos & 0xFFFFFFFFUL, &status);
-   if (status != 0)
-     return grub_error (GRUB_ERR_READ_ERROR,
--                     "Seek error, can't seek block %d", sector);
-+                     "Seek error, can't seek block %llu",
-+                     sector);
-   grub_ieee1275_read ((grub_ieee1275_ihandle_t) disk->data, buf,
-                     size * 512UL, &actual);
-   if (actual != actual)
--    return grub_error (GRUB_ERR_READ_ERROR, "Read error on block: %d", sector);
-+    return grub_error (GRUB_ERR_READ_ERROR, "Read error on block: %llu",
-+                     sector);
-     
-   return 0;
- }
- static grub_err_t
- grub_ofdisk_write (grub_disk_t disk __attribute ((unused)),
--                 unsigned long sector __attribute ((unused)),
--                 unsigned long size __attribute ((unused)),
-+                 grub_disk_addr_t sector __attribute ((unused)),
-+                 grub_size_t size __attribute ((unused)),
-                  const char *buf __attribute ((unused)))
- {
-   return GRUB_ERR_NOT_IMPLEMENTED_YET;
-Index: font/manager.c
-===================================================================
-RCS file: /cvsroot/grub/grub2/font/manager.c,v
-retrieving revision 1.6
-retrieving revision 1.9
-diff -u -r1.6 -r1.9
---- font/manager.c     13 Nov 2005 15:47:09 -0000      1.6
-+++ font/manager.c     4 Jun 2006 15:56:54 -0000       1.9
-@@ -1,6 +1,6 @@
- /*
-  *  GRUB  --  GRand Unified Bootloader
-- *  Copyright (C) 2003,2005  Free Software Foundation, Inc.
-+ *  Copyright (C) 2003,2005,2006  Free Software Foundation, Inc.
-  *
-  *  This program is free software; you can redistribute it and/or modify
-  *  it under the terms of the GNU General Public License as published by
-@@ -121,7 +121,7 @@
- }
- /* Return the offset of the glyph corresponding to the codepoint CODE
--   in the font FONT. If no found, return zero.  */
-+   in the font FONT.  If no found, return zero.  */
- static grub_uint32_t
- find_glyph (const struct font *font, grub_uint32_t code)
- {
-@@ -151,26 +151,27 @@
- /* Set the glyph to something stupid.  */
- static void
--fill_with_default_glyph (unsigned char bitmap[32], unsigned *width)
-+fill_with_default_glyph (grub_font_glyph_t glyph)
- {
--  if (bitmap)
--    {
--      unsigned i;
-+  unsigned i;
--      for (i = 0; i < 16; i++)
--      bitmap[i] = (i & 1) ? 0x55 : 0xaa;
--    }
--      
--  *width = 1;
-+  for (i = 0; i < 16; i++)
-+    glyph->bitmap[i] = (i & 1) ? 0x55 : 0xaa;
-+
-+  glyph->char_width = 1;
-+  glyph->width = glyph->char_width * 8;
-+  glyph->height = 16;
-+  glyph->baseline = (16 * 3) / 4;
- }
--/* Get a glyph corresponding to the codepoint CODE. Always fill BITMAP
--   and WIDTH with something, even if no glyph is found.  */
-+/* Get a glyph corresponding to the codepoint CODE.  Always fill glyph
-+   information with something, even if no glyph is found.  */
- int
- grub_font_get_glyph (grub_uint32_t code,
--                   unsigned char bitmap[32], unsigned *width)
-+                   grub_font_glyph_t glyph)
- {
-   struct font *font;
-+  grub_uint8_t bitmap[32];
-   /* FIXME: It is necessary to cache glyphs!  */
-   
-@@ -183,12 +184,18 @@
-       if (offset)
-       {
-         grub_uint32_t w;
-+        int len;
-+
-+          /* Make sure we can find glyphs for error messages.  Push active
-+             error message to error stack and reset error message.  */
-+          grub_error_push ();
-         
-         grub_file_seek (font->file, offset);
--        if (grub_file_read (font->file, (char *) &w, 4) != 4)
-+        if ((len = grub_file_read (font->file, (char *) &w, sizeof (w)))
-+            != sizeof (w))
-           {
--            remove_font (font);
--            goto restart;
-+              remove_font (font);
-+              goto restart;
-           }
-         w = grub_le_to_cpu32 (w);
-@@ -200,20 +207,30 @@
-           }
-         if (bitmap
--            && (grub_file_read (font->file, bitmap, w * 16)
-+            && (grub_file_read (font->file, (char *) bitmap, w * 16)
-                 != (grub_ssize_t) w * 16))
-           {
-             remove_font (font);
-             goto restart;
-           }
--        *width = w;
-+          /* Fill glyph with information.  */     
-+          grub_memcpy (glyph->bitmap, bitmap, w * 16);
-+          
-+        glyph->char_width = w;
-+        glyph->width = glyph->char_width * 8;
-+        glyph->height = 16;
-+        glyph->baseline = (16 * 3) / 4;
-+        
-+        /* Restore old error message.  */
-+          grub_error_pop ();
-+          
-         return 1;
-       }
-     }
--  /* Uggh... No font was found.  */
--  fill_with_default_glyph (bitmap, width);
-+  /* Uggh...  No font was found.  */
-+  fill_with_default_glyph (glyph);
-   return 0;
- }
-@@ -232,15 +249,14 @@
-   return 0;
- }
--GRUB_MOD_INIT(fontmanager)
-+GRUB_MOD_INIT(font_manager)
- {
--  (void) mod; /* Stop warning.  */
-   grub_register_command ("font", font_command, GRUB_COMMAND_FLAG_BOTH,
-                        "font FILE...",
-                        "Specify one or more font files to display.", 0);
- }
--GRUB_MOD_FINI(fontmanager)
-+GRUB_MOD_FINI(font_manager)
- {
-   grub_unregister_command ("font");
- }
-Index: fs/affs.c
-===================================================================
-RCS file: /cvsroot/grub/grub2/fs/affs.c,v
-retrieving revision 1.2
-retrieving revision 1.4
-diff -u -r1.2 -r1.4
---- fs/affs.c  13 Nov 2005 15:47:09 -0000      1.2
-+++ fs/affs.c  4 Jun 2006 15:56:54 -0000       1.4
-@@ -1,7 +1,7 @@
- /* affs.c - Amiga Fast FileSystem.  */
- /*
-  *  GRUB  --  GRand Unified Bootloader
-- *  Copyright (C) 2005  Free Software Foundation, Inc.
-+ *  Copyright (C) 2005,2006  Free Software Foundation, Inc.
-  *
-  *  This program is free software; you can redistribute it and/or modify
-  *  it under the terms of the GNU General Public License as published by
-@@ -150,9 +150,9 @@
-    POS.  Return the amount of read bytes in READ.  */
- static grub_ssize_t
- grub_affs_read_file (grub_fshelp_node_t node,
--                   void (*read_hook) (unsigned long sector,
-+                   void (*read_hook) (grub_disk_addr_t sector,
-                                       unsigned offset, unsigned length),
--                   int pos, unsigned int len, char *buf)
-+                   int pos, grub_size_t len, char *buf)
- {
-   return grub_fshelp_read_file (node->data->disk, node, read_hook,
-                               pos, len, buf, grub_affs_read_block,
-@@ -182,7 +182,7 @@
-     goto fail;
-   /* Make sure this is an affs filesystem.  */
--  if (grub_strncmp (data->bblock.type, "DOS", 3))
-+  if (grub_strncmp ((char *) (data->bblock.type), "DOS", 3))
-     {
-       grub_error (GRUB_ERR_BAD_FS, "not an affs filesystem");
-       goto fail;
-@@ -364,7 +364,7 @@
-         else
-           type = GRUB_FSHELP_UNKNOWN;
--        if (grub_affs_create_node (file.name, next,
-+        if (grub_affs_create_node ((char *) (file.name), next,
-                                    grub_be_to_cpu32 (file.size), type))
-           return 1;
-@@ -439,7 +439,7 @@
- /* Read LEN bytes data from FILE into BUF.  */
- static grub_ssize_t
--grub_affs_read (grub_file_t file, char *buf, grub_ssize_t len)
-+grub_affs_read (grub_file_t file, char *buf, grub_size_t len)
- {
-   struct grub_affs_data *data = 
-     (struct grub_affs_data *) file->data;
-@@ -527,7 +527,7 @@
-       if (grub_errno)
-       return 0;
--      *label = grub_strndup (file.name, file.namelen);
-+      *label = grub_strndup ((char *) (file.name), file.namelen);
-     }
-   else
-     *label = 0;
-Index: fs/ext2.c
-===================================================================
-RCS file: /cvsroot/grub/grub2/fs/ext2.c,v
-retrieving revision 1.12
-retrieving revision 1.13
-diff -u -r1.12 -r1.13
---- fs/ext2.c  13 Nov 2005 15:47:09 -0000      1.12
-+++ fs/ext2.c  4 Jun 2006 15:56:54 -0000       1.13
-@@ -241,7 +241,7 @@
-     {
-       grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET,
-                 "ext2fs doesn't support tripple indirect blocks");
--      return grub_errno;
-+      blknr = -1;
-     }
-   return blknr;
-@@ -252,9 +252,9 @@
-    POS.  Return the amount of read bytes in READ.  */
- static grub_ssize_t
- grub_ext2_read_file (grub_fshelp_node_t node,
--                   void (*read_hook) (unsigned long sector,
-+                   void (*read_hook) (grub_disk_addr_t sector,
-                                       unsigned offset, unsigned length),
--                   int pos, unsigned int len, char *buf)
-+                   int pos, grub_size_t len, char *buf)
- {
-   return grub_fshelp_read_file (node->data->disk, node, read_hook,
-                               pos, len, buf, grub_ext2_read_block,
-@@ -534,7 +534,7 @@
- /* Read LEN bytes data from FILE into BUF.  */
- static grub_ssize_t
--grub_ext2_read (grub_file_t file, char *buf, grub_ssize_t len)
-+grub_ext2_read (grub_file_t file, char *buf, grub_size_t len)
- {
-   struct grub_ext2_data *data = 
-     (struct grub_ext2_data *) file->data;
-Index: fs/fat.c
-===================================================================
-RCS file: /cvsroot/grub/grub2/fs/fat.c,v
-retrieving revision 1.13
-retrieving revision 1.15
-diff -u -r1.13 -r1.15
---- fs/fat.c   13 Nov 2005 15:47:09 -0000      1.13
-+++ fs/fat.c   4 Jun 2006 15:56:54 -0000       1.15
-@@ -310,11 +310,11 @@
- static grub_ssize_t
- grub_fat_read_data (grub_disk_t disk, struct grub_fat_data *data,
--                  void (*read_hook) (unsigned long sector,
-+                  void (*read_hook) (grub_disk_addr_t sector,
-                                      unsigned offset, unsigned length),
--                  grub_ssize_t offset, grub_ssize_t len, char *buf)
-+                  grub_off_t offset, grub_size_t len, char *buf)
- {
--  grub_ssize_t size;
-+  grub_size_t size;
-   grub_uint32_t logical_cluster;
-   unsigned logical_cluster_bits;
-   grub_ssize_t ret = 0;
-@@ -557,7 +557,8 @@
-             for (u = 0; u < slots * 13; u++)
-               unibuf[u] = grub_le_to_cpu16 (unibuf[u]);
-             
--            *grub_utf16_to_utf8 (filename, unibuf, slots * 13) = '\0';
-+            *grub_utf16_to_utf8 ((grub_uint8_t *) filename, unibuf,
-+                                 slots * 13) = '\0';
-             
-             if (*dirname == '\0' && call_hook)
-               {
-@@ -715,7 +716,7 @@
- }
- static grub_ssize_t
--grub_fat_read (grub_file_t file, char *buf, grub_ssize_t len)
-+grub_fat_read (grub_file_t file, char *buf, grub_size_t len)
- {
-   return grub_fat_read_data (file->device->disk, file->data, file->read_hook,
-                            file->offset, len, buf);
-@@ -779,7 +780,7 @@
-       if (dir.attr == GRUB_FAT_ATTR_VOLUME_ID)
-       {
--        *label = grub_strndup (dir.name, 11);
-+        *label = grub_strndup ((char *) dir.name, 11);
-         return GRUB_ERR_NONE;
-       }
-     }
-Index: fs/fshelp.c
-===================================================================
-RCS file: /cvsroot/grub/grub2/fs/fshelp.c,v
-retrieving revision 1.5
-retrieving revision 1.6
-diff -u -r1.5 -r1.6
---- fs/fshelp.c        25 Dec 2005 15:59:50 -0000      1.5
-+++ fs/fshelp.c        4 Jun 2006 15:56:54 -0000       1.6
-@@ -1,7 +1,7 @@
- /* fshelp.c -- Filesystem helper functions */
- /*
-  *  GRUB  --  GRand Unified Bootloader
-- *  Copyright (C) 2004, 2005  Free Software Foundation, Inc.
-+ *  Copyright (C) 2004,2005,2006  Free Software Foundation, Inc.
-  *
-  *  GRUB is free software; you can redistribute it and/or modify
-  *  it under the terms of the GNU General Public License as published by
-@@ -222,11 +222,11 @@
-    blocks have a size of LOG2BLOCKSIZE (in log2).  */
- grub_ssize_t
- grub_fshelp_read_file (grub_disk_t disk, grub_fshelp_node_t node,
--                     void (*read_hook) (unsigned long sector,
-+                     void (*read_hook) (grub_disk_addr_t sector,
-                                         unsigned offset, unsigned length),
--                     int pos, unsigned int len, char *buf,
-+                     int pos, grub_size_t len, char *buf,
-                      int (*get_block) (grub_fshelp_node_t node, int block),
--                     unsigned int filesize, int log2blocksize)
-+                     grub_off_t filesize, int log2blocksize)
- {
-   int i;
-   int blockcnt;
-Index: fs/hfs.c
-===================================================================
-RCS file: /cvsroot/grub/grub2/fs/hfs.c,v
-retrieving revision 1.5
-retrieving revision 1.7
-diff -u -r1.5 -r1.7
---- fs/hfs.c   3 Jan 2006 14:30:56 -0000       1.5
-+++ fs/hfs.c   4 Jun 2006 15:56:54 -0000       1.7
-@@ -229,9 +229,9 @@
-    POS.  Return the amount of read bytes in READ.  */
- static grub_ssize_t
- grub_hfs_read_file (struct grub_hfs_data *data,
--                  void (*read_hook) (unsigned long sector,
-+                  void (*read_hook) (grub_disk_addr_t sector,
-                                      unsigned offset, unsigned length),
--                   int pos, unsigned int len, char *buf)
-+                   int pos, grub_size_t len, char *buf)
- {
-   int i;
-   int blockcnt;
-@@ -261,7 +261,7 @@
-         blockend = (len + pos) % data->blksz;
-         
-         /* The last portion is exactly EXT2_BLOCK_SIZE (data).  */
--        if (!blockend)
-+        if (! blockend)
-           blockend = data->blksz;
-       }
-@@ -357,7 +357,7 @@
-      volume name.  */
-   key.parent_dir = grub_cpu_to_be32 (1);
-   key.strlen = data->sblock.volname[0];
--  grub_strcpy (key.str, data->sblock.volname + 1);
-+  grub_strcpy ((char *) key.str, (char *) (data->sblock.volname + 1));
-   
-   if (grub_hfs_find_node (data, (char *) &key, data->cat_root,
-                         0, (char *) &dir, sizeof (dir)) == 0)
-@@ -393,7 +393,7 @@
-   if (cmp != 0)
-     return cmp;
-   
--  cmp = grub_strncasecmp (k1->str, k2->str, k1->strlen);
-+  cmp = grub_strncasecmp ((char *) (k1->str), (char *) (k2->str), k1->strlen);
-   
-   /* This is required because the compared strings are not of equal
-      length.  */
-@@ -673,11 +673,11 @@
-       
-       key.parent_dir = grub_cpu_to_be32 (inode);
-       key.strlen = grub_strlen (path);
--      grub_strcpy (key.str, path);
-+      grub_strcpy ((char *) (key.str), path);
-       
-       /* Lookup this node.  */
--      if (!grub_hfs_find_node (data, (char *) &key, data->cat_root,
--                             0, (char *) &frec, sizeof (frec)))
-+      if (! grub_hfs_find_node (data, (char *) &key, data->cat_root,
-+                              0, (char *) &frec, sizeof (frec)))
-       {
-         grub_error (GRUB_ERR_FILE_NOT_FOUND, "file not found");
-         goto fail;
-@@ -717,7 +717,7 @@
-       char *filetype = rec->data;
-       struct grub_hfs_catalog_key *ckey = rec->key;
-       
--      grub_strncpy (fname, ckey->str, ckey->strlen);
-+      grub_strncpy (fname, (char *) (ckey->str), ckey->strlen);
-       
-       if (*filetype == GRUB_HFS_FILETYPE_DIR)
-       return hook (fname, 1);
-@@ -804,7 +804,7 @@
- }
- static grub_ssize_t
--grub_hfs_read (grub_file_t file, char *buf, grub_ssize_t len)
-+grub_hfs_read (grub_file_t file, char *buf, grub_size_t len)
- {
-   struct grub_hfs_data *data = 
-     (struct grub_hfs_data *) file->data;
-@@ -834,7 +834,8 @@
-   data = grub_hfs_mount (device->disk);
-   
-   if (data)
--    *label = grub_strndup (data->sblock.volname + 1, *data->sblock.volname);
-+    *label = grub_strndup ((char *) (data->sblock.volname + 1),
-+                         *data->sblock.volname);
-   else
-     *label = 0;
-Index: fs/hfsplus.c
-===================================================================
-RCS file: /cvsroot/grub/grub2/fs/hfsplus.c,v
-retrieving revision 1.3
-retrieving revision 1.8
-diff -u -r1.3 -r1.8
---- fs/hfsplus.c       3 Jan 2006 16:27:31 -0000       1.3
-+++ fs/hfsplus.c       4 Jun 2006 15:56:54 -0000       1.8
-@@ -226,15 +226,41 @@
- #endif
\f
-+/* Return the offset of the record with the index INDEX, in the node
-+   NODE which is part of the B+ tree BTREE.  */
-+static inline unsigned int
-+grub_hfsplus_btree_recoffset (struct grub_hfsplus_btree *btree,
-+                         struct grub_hfsplus_btnode *node, int index)
-+{
-+  char *cnode = (char *) node;
-+  grub_uint16_t *recptr;
-+  recptr = (grub_uint16_t *) (&cnode[btree->nodesize
-+                                   - index * sizeof (grub_uint16_t) - 2]);
-+  return grub_be_to_cpu16 (*recptr);
-+}
-+
-+/* Return a pointer to the record with the index INDEX, in the node
-+   NODE which is part of the B+ tree BTREE.  */
-+static inline struct grub_hfsplus_key *
-+grub_hfsplus_btree_recptr (struct grub_hfsplus_btree *btree,
-+                         struct grub_hfsplus_btnode *node, int index)
-+{
-+  char *cnode = (char *) node;
-+  unsigned int offset;
-+  offset = grub_hfsplus_btree_recoffset (btree, node, index);
-+  return (struct grub_hfsplus_key *) &cnode[offset];
-+}
-+
-+
- /* Find the extent that points to FILEBLOCK.  If it is not in one of
-    the 8 extents described by EXTENT, return -1.  In that case set
--   RETRY to the last block that was found in the last extent.  */
-+   FILEBLOCK to the next block.  */
- static int
- grub_hfsplus_find_block (struct grub_hfsplus_extent *extent,
--                       int fileblock, int *retry)
-+                       int *fileblock)
- {
-   int i;
--  grub_size_t blksleft = fileblock;
-+  grub_size_t blksleft = *fileblock;
-   /* First lookup the file in the given extents.  */
-   for (i = 0; i < 8; i++)
-@@ -244,7 +270,7 @@
-       blksleft -= grub_be_to_cpu32 (extent[i].count);
-     }
--  *retry = fileblock - blksleft;
-+  *fileblock = blksleft;
-   return -1;
- }
-@@ -263,62 +289,64 @@
- static int
- grub_hfsplus_read_block (grub_fshelp_node_t node, int fileblock)
- {
--  struct grub_hfsplus_extkey_internal extoverflow;
--  struct grub_hfsplus_extkey *keyfound;
--  int blk;
-   struct grub_hfsplus_btnode *nnode = 0;
--  int ptr;
--  int retry = 0;
--
-+  int blksleft = fileblock;
-   struct grub_hfsplus_extent *extents = &node->extents[0];
-   while (1)
-     {
--      char *cnode;
-+      struct grub_hfsplus_extkey *key;
-+      struct grub_hfsplus_extkey_internal extoverflow;
-+      int blk;
-+      int ptr;
-       /* Try to find this block in the current set of extents.  */
--      blk = grub_hfsplus_find_block (extents, fileblock, &retry);
--      if (blk != -1)
--      return blk + (node->data->embedded_offset >> (node->data->log2blksize
--                                                    - GRUB_DISK_SECTOR_BITS));
-+      blk = grub_hfsplus_find_block (extents, &blksleft);
-       /* The previous iteration of this loop allocated memory.  The
-        code above used this memory, it can be free'ed now.  */
--      if (nnode)
--      grub_free (nnode);
-+      grub_free (nnode);
-+      nnode = 0;
-+      
-+      if (blk != -1)
-+      return (blk
-+              + (node->data->embedded_offset >> (node->data->log2blksize
-+                                                 - GRUB_DISK_SECTOR_BITS)));
-       /* For the extent overflow file, extra extents can't be found in
-        the extent overflow file.  If this happens, you found a
-        bug...  */
-       if (node->fileid == GRUB_HFSPLUS_FILEID_OVERFLOW)
--      return -1;
-+      {
-+        grub_error (GRUB_ERR_READ_ERROR,
-+                    "extra extents found in an extend overflow file");
-+        break;
-+      }
-       /* Set up the key to look for in the extent overflow file.  */
-       extoverflow.fileid = node->fileid;
--      extoverflow.start = retry;
-+      extoverflow.start = fileblock - blksleft;
-       if (grub_hfsplus_btree_search (&node->data->extoverflow_tree,
-                                    (struct grub_hfsplus_key_internal *) &extoverflow,
-                                    grub_hfsplus_cmp_extkey, &nnode, &ptr))
--      return -1;
--
--      cnode = (char *) nnode;
-+      {
-+        grub_error (GRUB_ERR_READ_ERROR,
-+                    "no block found for the file id 0x%x and the block offset 0x%x",
-+                    node->fileid, fileblock);
-+        break;
-+      }
--      /* The extent overflow file has a 8 extents right after the key.  */
--      keyfound = (struct grub_hfsplus_extkey *) 
--      &cnode[(int) cnode[node->data->extoverflow_tree.nodesize - ptr - 1]];
--      extents = (struct grub_hfsplus_extent *) 
--      ((char *) keyfound + sizeof (struct grub_hfsplus_extkey));
-+      /* The extent overflow file has 8 extents right after the key.  */
-+      key = (struct grub_hfsplus_extkey *)
-+      grub_hfsplus_btree_recptr (&node->data->extoverflow_tree, nnode, ptr);
-+      extents = (struct grub_hfsplus_extent *) (key + 1);
-       /* The block wasn't found.  Perhaps the next iteration will find
--       it.  The last block we found is stored in FILEBLOCK now.  */
--      /* XXX: Multiple iterations for locating the right extent was
--       not tested enough... */
--      fileblock = retry;
-+       it.  The last block we found is stored in BLKSLEFT now.  */
-     }
--  if (nnode)
--    grub_free (nnode);
-+  grub_free (nnode);
-   /* Too bad, you lose.  */
-   return -1;
-@@ -329,9 +357,9 @@
-    POS.  Return the amount of read bytes in READ.  */
- static grub_ssize_t
- grub_hfsplus_read_file (grub_fshelp_node_t node,
--                      void (*read_hook) (unsigned long sector,
-+                      void (*read_hook) (grub_disk_addr_t sector,
-                                          unsigned offset, unsigned length),
--                      int pos, unsigned int len, char *buf)
-+                      int pos, grub_size_t len, char *buf)
- {
-   return grub_fshelp_read_file (node->data->disk, node, read_hook,
-                               pos, len, buf, grub_hfsplus_read_block,
-@@ -480,7 +508,7 @@
-   filename = grub_malloc (grub_be_to_cpu16 (catkey_a->namelen) + 1);
--  if (! grub_utf16_to_utf8 (filename, catkey_a->name,
-+  if (! grub_utf16_to_utf8 ((grub_uint8_t *) filename, catkey_a->name,
-                           grub_be_to_cpu16 (catkey_a->namelen)))
-     return -1; /* XXX: This error never occurs, but in case it happens
-                 just skip this entry.  */
-@@ -516,32 +544,6 @@
-   return diff;
- }
--/* Return the offset of the record with the index INDEX, in the node
--   NODE which is part of the B+ tree BTREE.  */
--static inline unsigned int
--grub_hfsplus_btree_recoffset (struct grub_hfsplus_btree *btree,
--                         struct grub_hfsplus_btnode *node, int index)
--{
--  char *cnode = (char *) node;
--  grub_uint16_t *recptr;
--  recptr = (grub_uint16_t *) (&cnode[btree->nodesize
--                                   - index * sizeof (grub_uint16_t) - 2]);
--  return grub_be_to_cpu16 (*recptr);
--}
--
--/* Return a pointer to the record with the index INDEX, in the node
--   NODE which is part of the B+ tree BTREE.  */
--static inline struct grub_hfsplus_key *
--grub_hfsplus_btree_recptr (struct grub_hfsplus_btree *btree,
--                         struct grub_hfsplus_btnode *node, int index)
--{
--  char *cnode = (char *) node;
--  unsigned int offset;
--  offset = grub_hfsplus_btree_recoffset (btree, node, index);
--  return (struct grub_hfsplus_key *) &cnode[offset];
--}
--
--
- static char *
- grub_hfsplus_read_symlink (grub_fshelp_node_t node)
- {
-@@ -563,7 +565,7 @@
-   return symlink;
- }
--int
-+static int
- grub_hfsplus_btree_iterate_node (struct grub_hfsplus_btree *btree,
-                                struct grub_hfsplus_btnode *first_node,
-                                int first_rec,
-@@ -638,8 +640,8 @@
-       for (rec = 0; rec < grub_be_to_cpu16 (nodedesc->count); rec++)
-       {
-         struct grub_hfsplus_key *currkey;
--        currkey = grub_hfsplus_btree_recptr (btree, nodedesc, rec);
--        
-+        currkey = grub_hfsplus_btree_recptr (btree, nodedesc, rec);   
-+  
-         /* The action that has to be taken depend on the type of
-            record.  */
-         if (nodedesc->type == GRUB_HFSPLUS_BTNODE_TYPE_LEAF
-@@ -674,13 +676,13 @@
-           }
-       }
--      /* No match was found, no record with this key exists in the
-+      /* No match is found, no record with this key exists in the
-        tree.  */
-       if (! match)
-       {
-         *matchnode = 0;
-         grub_free (node);
--        return 0;
-+        return 1;
-       }
-     }
- }
-@@ -692,13 +694,14 @@
-                                  enum grub_fshelp_filetype filetype,
-                                  grub_fshelp_node_t node))
- {
-+  int ret = 0;
-+  
-   auto int list_nodes (void *record);
-   int list_nodes (void *record)
-     {
-       struct grub_hfsplus_catkey *catkey;
-       char *filename;
-       int i;
--      int ret = 0;
-       struct grub_fshelp_node *node;
-       struct grub_hfsplus_catfile *fileinfo;
-       enum grub_fshelp_filetype type = GRUB_FSHELP_UNKNOWN;
-@@ -711,19 +714,44 @@
-                                        + 2 + (grub_be_to_cpu16(catkey->keylen)
-                                               % 2));
--      /* Stop iterating when the last directory entry was found.  */
-+      /* Stop iterating when the last directory entry is found.  */
-       if (grub_be_to_cpu32 (catkey->parent) != dir->fileid)
--      return 0;
-+      return 1;
--      filename = grub_malloc (grub_be_to_cpu16 (catkey->namelen) + 1);
--      if (! filename)
-+      /* Determine the type of the node that is found.  */
-+      if (grub_be_to_cpu16 (fileinfo->type) == GRUB_HFSPLUS_FILETYPE_REG)
-+      {
-+        int mode = (grub_be_to_cpu16 (fileinfo->mode)
-+                    & GRUB_HFSPLUS_FILEMODE_MASK);
-+
-+        if (mode == GRUB_HFSPLUS_FILEMODE_REG)
-+          type = GRUB_FSHELP_REG;
-+        else if (mode == GRUB_HFSPLUS_FILEMODE_SYMLINK)
-+          type = GRUB_FSHELP_SYMLINK;
-+        else
-+          type = GRUB_FSHELP_UNKNOWN;
-+      }
-+      else if (grub_be_to_cpu16 (fileinfo->type) == GRUB_HFSPLUS_FILETYPE_DIR)
-+      type = GRUB_FSHELP_DIR;
-+
-+      if (type == GRUB_FSHELP_UNKNOWN)
-       return 0;
-       /* Make sure the byte order of the UTF16 string is correct.  */
-       for (i = 0; i < grub_be_to_cpu16 (catkey->namelen); i++)
--      catkey->name[i] = grub_be_to_cpu16 (catkey->name[i]);
-+      {
-+        catkey->name[i] = grub_be_to_cpu16 (catkey->name[i]);
-+
-+        /* If the name is obviously invalid, skip this node.  */
-+        if (catkey->name[i] == 0)
-+          return 0;
-+      }
--      if (! grub_utf16_to_utf8 (filename, catkey->name,
-+      filename = grub_malloc (grub_be_to_cpu16 (catkey->namelen) + 1);
-+      if (! filename)
-+      return 0;
-+
-+      if (! grub_utf16_to_utf8 ((grub_uint8_t *) filename, catkey->name,
-                               grub_be_to_cpu16 (catkey->namelen)))
-       {
-         grub_free (filename);
-@@ -736,32 +764,16 @@
-       for (i = 0; i < grub_be_to_cpu16 (catkey->namelen); i++)
-       catkey->name[i] = grub_be_to_cpu16 (catkey->name[i]);
--      /* Determine the type of the node that was found.  */
--      if (grub_be_to_cpu16 (fileinfo->type) == GRUB_HFSPLUS_FILETYPE_REG)
--      {
--        int mode = (grub_be_to_cpu16 (fileinfo->mode)
--                    & GRUB_HFSPLUS_FILEMODE_MASK);
--
--        if (mode == GRUB_HFSPLUS_FILEMODE_REG)
--          type = GRUB_FSHELP_REG;
--        else if (mode == GRUB_HFSPLUS_FILEMODE_SYMLINK)
--          type = GRUB_FSHELP_SYMLINK;
--        else
--          type = GRUB_FSHELP_UNKNOWN;
--      }
--      else if (grub_be_to_cpu16 (fileinfo->type) == GRUB_HFSPLUS_FILETYPE_DIR)
--      type = GRUB_FSHELP_DIR;
--
-       /* Only accept valid nodes.  */
--      if (type && grub_strlen (filename) == grub_be_to_cpu16 (catkey->namelen))
-+      if (grub_strlen (filename) == grub_be_to_cpu16 (catkey->namelen))
-       {
--        /* A valid node was found; setup the node and call the
-+        /* A valid node is found; setup the node and call the
-            callback function.  */
-         node = grub_malloc (sizeof (*node));
-         node->data = dir->data;
-         
-         grub_memcpy (node->extents, fileinfo->data.extents,
--                     sizeof (*node->extents));
-+                     sizeof (node->extents));
-         node->size = grub_be_to_cpu64 (fileinfo->data.size);
-         node->fileid = grub_be_to_cpu32 (fileinfo->fileid);
-@@ -776,7 +788,6 @@
-   struct grub_hfsplus_key_internal intern;
-   struct grub_hfsplus_btnode *node;
-   int ptr;
--  int ret;
-   /* Create a key that points to the first entry in the directory.  */
-   intern.catkey.parent = dir->fileid;
-@@ -788,8 +799,8 @@
-     return 0;
-   /* Iterate over all entries in this directory.  */
--  ret = grub_hfsplus_btree_iterate_node (&dir->data->catalog_tree, node, ptr,
--                                       list_nodes);
-+  grub_hfsplus_btree_iterate_node (&dir->data->catalog_tree, node, ptr,
-+                                 list_nodes);
-   grub_free (node);
-@@ -854,7 +865,7 @@
- /* Read LEN bytes data from FILE into BUF.  */
- static grub_ssize_t
--grub_hfsplus_read (grub_file_t file, char *buf, grub_ssize_t len)
-+grub_hfsplus_read (grub_file_t file, char *buf, grub_size_t len)
- {
-   struct grub_hfsplus_data *data = 
-     (struct grub_hfsplus_data *) file->data;
-Index: fs/iso9660.c
-===================================================================
-RCS file: /cvsroot/grub/grub2/fs/iso9660.c,v
-retrieving revision 1.2
-retrieving revision 1.3
-diff -u -r1.2 -r1.3
---- fs/iso9660.c       13 Nov 2005 15:47:09 -0000      1.2
-+++ fs/iso9660.c       4 Jun 2006 15:56:54 -0000       1.3
-@@ -2,7 +2,7 @@
-    SUSP, Rock Ridge.  */
- /*
-  *  GRUB  --  GRand Unified Bootloader
-- *  Copyright (C) 2004, 2005  Free Software Foundation, Inc.
-+ *  Copyright (C) 2004,2005,2006  Free Software Foundation, Inc.
-  *
-  *  This program is free software; you can redistribute it and/or modify
-  *  it under the terms of the GNU General Public License as published by
-@@ -169,11 +169,11 @@
-        ((char *) entry + entry->len))
-     {
-       /* The last entry.  */
--      if (!grub_strncmp (entry->sig, "ST", 2))
-+      if (grub_strncmp ((char *) entry->sig, "ST", 2) == 0)
-       break;
-       
-       /* Additional entries are stored elsewhere.  */
--      if (!grub_strncmp (entry->sig, "CE", 2))
-+      if (grub_strncmp ((char *) entry->sig, "CE", 2) == 0)
-       {
-         struct grub_iso9660_susp_ce *ce;
-         
-@@ -215,7 +215,7 @@
-     {
-       /* The "ER" entry is used to detect extensions.  The
-        `IEEE_P1285' extension means Rock ridge.  */
--      if (!grub_strncmp (susp_entry->sig, "ER", 2))
-+      if (grub_strncmp ((char *) susp_entry->sig, "ER", 2) == 0)
-       {
-         data->rockridge = 1;
-         return 1;
-@@ -224,7 +224,7 @@
-     }
-   
-   data = grub_malloc (sizeof (struct grub_iso9660_data));
--  if (!data)
-+  if (! data)
-     return 0;
-   
-   /* Read the superblock.  */
-@@ -236,7 +236,7 @@
-       goto fail;
-     }
--  if (grub_strncmp (data->voldesc.voldesc.magic, "CD001", 5))
-+  if (grub_strncmp ((char *) data->voldesc.voldesc.magic, "CD001", 5) == 0)
-     {
-       grub_error (GRUB_ERR_BAD_FS, "not a iso9660 filesystem");
-       goto fail;
-@@ -282,7 +282,7 @@
-   entry = (struct grub_iso9660_susp_entry *) sua;
-   
-   /* Test if the SUSP protocol is used on this filesystem.  */
--  if (!grub_strncmp (entry->sig, "SP", 2))
-+  if (grub_strncmp ((char *) entry->sig, "SP", 2) == 0)
-     {
-       /* The 2nd data byte stored how many bytes are skipped everytime
-        to get to the SUA (System Usage Area).  */
-@@ -324,17 +324,16 @@
-       int size = grub_strlen (symlink);
-       
-       symlink = grub_realloc (symlink, size + len + 1);
--      if (!symlink)
-+      if (! symlink)
-       return;
-+      
-       grub_strncat (symlink, part, len);
--
--      return;
-     }
-     
-   /* Read in a symlink.  */
-   grub_err_t susp_iterate_sl (struct grub_iso9660_susp_entry *entry)
-     {
--      if (!grub_strncmp ("SL", entry->sig, 2))
-+      if (grub_strncmp ("SL", (char *) entry->sig, 2) == 0)
-       {
-         unsigned int pos = 1;
-@@ -355,7 +354,7 @@
-                   /* The data on pos + 2 is the actual data, pos + 1
-                      is the length.  Both are part of the `Component
-                      Record'.  */
--                  add_part (&entry->data[pos + 2],
-+                  add_part ((char *) &entry->data[pos + 2],
-                             entry->data[pos + 1]);
-                   if ((entry->data[pos] & 1))
-                     addslash = 1;
-@@ -432,7 +431,7 @@
-   grub_err_t susp_iterate_dir (struct grub_iso9660_susp_entry *entry)
-     {
-       /* The filename in the rock ridge entry.  */
--      if (!grub_strncmp ("NM", entry->sig, 2))
-+      if (grub_strncmp ("NM", (char *) entry->sig, 2) == 0)
-       {
-         /* The flags are stored at the data position 0, here the
-            filename type is stored.  */
-@@ -457,12 +456,12 @@
-                 filename[0] = '\0';
-               }
-             filename_alloc = 1;
--            grub_strncpy (filename, &entry->data[1], size);
--            filename [size] = '\0';
-+            grub_strncpy (filename, (char *) &entry->data[1], size);
-+            filename[size] = '\0';
-           }
-       }
-       /* The mode information (st_mode).  */
--      else if (!grub_strncmp (entry->sig, "PX", 2))
-+      else if (grub_strncmp ((char *) entry->sig, "PX", 2) == 0)
-       {
-         /* At position 0 of the PX record the st_mode information is
-            stored.  */
-@@ -704,7 +703,7 @@
- static grub_ssize_t
--grub_iso9660_read (grub_file_t file, char *buf, grub_ssize_t len)
-+grub_iso9660_read (grub_file_t file, char *buf, grub_size_t len)
- {
-   struct grub_iso9660_data *data = 
-     (struct grub_iso9660_data *) file->data;
-@@ -742,7 +741,7 @@
-   
-   if (data)
-     {
--      *label = grub_strndup (data->voldesc.volname, 32);
-+      *label = grub_strndup ((char *) data->voldesc.volname, 32);
-       grub_free (data);
-     }
-   else
-Index: fs/jfs.c
-===================================================================
-RCS file: /cvsroot/grub/grub2/fs/jfs.c,v
-retrieving revision 1.3
-retrieving revision 1.5
-diff -u -r1.3 -r1.5
---- fs/jfs.c   13 Nov 2005 15:47:09 -0000      1.3
-+++ fs/jfs.c   4 Jun 2006 15:56:54 -0000       1.5
-@@ -1,7 +1,7 @@
- /* jfs.c - JFS.  */
- /*
-  *  GRUB  --  GRand Unified Bootloader
-- *  Copyright (C) 2004, 2005  Free Software Foundation, Inc.
-+ *  Copyright (C) 2004,2005,2006  Free Software Foundation, Inc.
-  *
-  *  This program is free software; you can redistribute it and/or modify
-  *  it under the terms of the GNU General Public License as published by
-@@ -342,7 +342,7 @@
-                     sizeof (struct grub_jfs_sblock), (char *) &data->sblock))
-     goto fail;
-   
--  if (grub_strncmp (data->sblock.magic, "JFS1", 4))
-+  if (grub_strncmp ((char *) (data->sblock.magic), "JFS1", 4))
-     {
-       grub_error (GRUB_ERR_BAD_FS, "not a jfs filesystem");
-       goto fail;
-@@ -398,7 +398,7 @@
-     {
-       diro->leaf = inode->dir.dirents;
-       diro->next_leaf = (struct grub_jfs_leaf_next_dirent *) de;
--      diro->sorted = inode->dir.header.sorted;
-+      diro->sorted = (char *) (inode->dir.header.sorted);
-       diro->count = inode->dir.header.count;
-       diro->dirpage = 0;
-@@ -530,7 +530,7 @@
-   diro->index++;
-   /* Convert the temporary UTF16 filename to UTF8.  */
--  *grub_utf16_to_utf8 (diro->name, filename, strpos) = '\0';
-+  *grub_utf16_to_utf8 ((grub_uint8_t *) (diro->name), filename, strpos) = '\0';
-   
-   return 0;
- }
-@@ -540,9 +540,9 @@
-    POS.  Return the amount of read bytes in READ.  */
- static grub_ssize_t
- grub_jfs_read_file (struct grub_jfs_data *data,
--                  void (*read_hook) (unsigned long sector,
-+                  void (*read_hook) (grub_disk_addr_t sector,
-                                      unsigned offset, unsigned length),
--                  int pos, unsigned int len, char *buf)
-+                  int pos, grub_size_t len, char *buf)
- {
-   int i;
-   int blockcnt;
-@@ -703,7 +703,7 @@
-     return grub_error (GRUB_ERR_SYMLINK_LOOP, "too deep nesting of symlinks");
-   
-   if (size <= 128)
--    grub_strncpy (symlink, data->currinode.symlink.path, 128);
-+    grub_strncpy (symlink, (char *) (data->currinode.symlink.path), 128);
-   else if (grub_jfs_read_file (data, 0, 0, size, symlink) < 0)
-     return grub_errno;
-@@ -822,7 +822,7 @@
- static grub_ssize_t
--grub_jfs_read (grub_file_t file, char *buf, grub_ssize_t len)
-+grub_jfs_read (grub_file_t file, char *buf, grub_size_t len)
- {
-   struct grub_jfs_data *data = 
-     (struct grub_jfs_data *) file->data;
-@@ -851,7 +851,7 @@
-   data = grub_jfs_mount (device->disk);
-   
-   if (data)
--    *label = grub_strndup (data->sblock.volname, 11);
-+    *label = grub_strndup ((char *) (data->sblock.volname), 11);
-   else
-     *label = 0;
-   
-Index: fs/minix.c
-===================================================================
-RCS file: /cvsroot/grub/grub2/fs/minix.c,v
-retrieving revision 1.4
-retrieving revision 1.5
-diff -u -r1.4 -r1.5
---- fs/minix.c 13 Nov 2005 15:47:09 -0000      1.4
-+++ fs/minix.c 4 Jun 2006 15:56:54 -0000       1.5
-@@ -1,7 +1,7 @@
- /* minix.c - The minix filesystem, version 1 and 2.  */
- /*
-  *  GRUB  --  GRand Unified Bootloader
-- *  Copyright (C) 2004, 2005  Free Software Foundation, Inc.
-+ *  Copyright (C) 2004,2005,2006  Free Software Foundation, Inc.
-  *
-  *  This program is free software; you can redistribute it and/or modify
-  *  it under the terms of the GNU General Public License as published by
-@@ -187,9 +187,9 @@
-    POS.  Return the amount of read bytes in READ.  */
- static grub_ssize_t
- grub_minix_read_file (struct grub_minix_data *data,
--                    void (*read_hook) (unsigned long sector,
-+                    void (*read_hook) (grub_disk_addr_t sector,
-                                        unsigned offset, unsigned length),
--                    int pos, unsigned int len, char *buf)
-+                    int pos, grub_disk_addr_t len, char *buf)
- {
-   struct grub_minix_sblock *sblock = &data->sblock;
-   int i;
-@@ -560,7 +560,7 @@
- static grub_ssize_t
--grub_minix_read (grub_file_t file, char *buf, grub_ssize_t len)
-+grub_minix_read (grub_file_t file, char *buf, grub_size_t len)
- {
-   struct grub_minix_data *data = 
-     (struct grub_minix_data *) file->data;
-Index: fs/sfs.c
-===================================================================
-RCS file: /cvsroot/grub/grub2/fs/sfs.c,v
-retrieving revision 1.3
-retrieving revision 1.5
-diff -u -r1.3 -r1.5
---- fs/sfs.c   13 Nov 2005 15:47:09 -0000      1.3
-+++ fs/sfs.c   4 Jun 2006 15:56:54 -0000       1.5
-@@ -1,7 +1,7 @@
- /* sfs.c - Amiga Smart FileSystem.  */
- /*
-  *  GRUB  --  GRand Unified Bootloader
-- *  Copyright (C) 2005  Free Software Foundation, Inc.
-+ *  Copyright (C) 2005,2006  Free Software Foundation, Inc.
-  *
-  *  This program is free software; you can redistribute it and/or modify
-  *  it under the terms of the GNU General Public License as published by
-@@ -259,9 +259,9 @@
-    POS.  Return the amount of read bytes in READ.  */
- static grub_ssize_t
- grub_sfs_read_file (grub_fshelp_node_t node,
--                  void (*read_hook) (unsigned long sector,
-+                  void (*read_hook) (grub_disk_addr_t sector,
-                                      unsigned offset, unsigned length),
--                  int pos, unsigned int len, char *buf)
-+                  int pos, grub_size_t len, char *buf)
- {
-   return grub_fshelp_read_file (node->data->disk, node, read_hook,
-                               pos, len, buf, grub_sfs_read_block,
-@@ -288,7 +288,7 @@
-     goto fail;
-   /* Make sure this is a sfs filesystem.  */
--  if (grub_strncmp (data->rblock.header.magic, "SFS", 4))
-+  if (grub_strncmp ((char *) (data->rblock.header.magic), "SFS", 4))
-     {
-       grub_error (GRUB_ERR_BAD_FS, "not a sfs filesystem");
-       goto fail;
-@@ -296,7 +296,7 @@
-   data->blocksize = grub_be_to_cpu32 (data->rblock.blocksize);
-   rootobjc_data = grub_malloc (data->blocksize);
--  if (!rootobjc_data)
-+  if (! rootobjc_data)
-     goto fail;
-   /* Read the root object container.  */
-@@ -312,7 +312,7 @@
-   data->diropen.block = blk;
-   data->diropen.data = data;
-   data->disk = disk;
--  data->label = grub_strdup (rootobjc->objects[0].filename);
-+  data->label = grub_strdup ((char *) (rootobjc->objects[0].filename));
-   return data;
-@@ -403,7 +403,7 @@
-       {
-         struct grub_sfs_obj *obj;
-         obj = (struct grub_sfs_obj *) ((char *) objc + pos);
--        char *filename = obj->filename;
-+        char *filename = (char *) (obj->filename);
-         int len;
-         enum grub_fshelp_filetype type;
-         unsigned int block;
-@@ -512,7 +512,7 @@
- /* Read LEN bytes data from FILE into BUF.  */
- static grub_ssize_t
--grub_sfs_read (grub_file_t file, char *buf, grub_ssize_t len)
-+grub_sfs_read (grub_file_t file, char *buf, grub_size_t len)
- {
-   struct grub_sfs_data *data = (struct grub_sfs_data *) file->data;
-Index: fs/ufs.c
-===================================================================
-RCS file: /cvsroot/grub/grub2/fs/ufs.c,v
-retrieving revision 1.4
-retrieving revision 1.6
-diff -u -r1.4 -r1.6
---- fs/ufs.c   23 Nov 2005 03:36:24 -0000      1.4
-+++ fs/ufs.c   4 Jun 2006 15:56:54 -0000       1.6
-@@ -241,9 +241,9 @@
-    POS.  Return the amount of read bytes in READ.  */
- static grub_ssize_t
- grub_ufs_read_file (struct grub_ufs_data *data,
--                  void (*read_hook) (unsigned long sector,
-+                  void (*read_hook) (grub_disk_addr_t sector,
-                                      unsigned offset, unsigned length),
--                  int pos, unsigned int len, char *buf)
-+                  int pos, grub_size_t len, char *buf)
- {
-   struct grub_ufs_sblock *sblock = &data->sblock;
-   int i;
-@@ -363,7 +363,7 @@
-   
-   if (INODE_SIZE (data) < (GRUB_UFS_DIRBLKS + GRUB_UFS_INDIRBLKS
-                         * INODE_BLKSZ (data)))
--    grub_strcpy (symlink, INODE (data, symlink));
-+    grub_strcpy (symlink, (char *) INODE (data, symlink));
-   else
-     {
-       grub_disk_read (data->disk, 
-@@ -631,7 +631,7 @@
- static grub_ssize_t
--grub_ufs_read (grub_file_t file, char *buf, grub_ssize_t len)
-+grub_ufs_read (grub_file_t file, char *buf, grub_size_t len)
- {
-   struct grub_ufs_data *data = 
-     (struct grub_ufs_data *) file->data;
-Index: fs/xfs.c
-===================================================================
-RCS file: /cvsroot/grub/grub2/fs/xfs.c,v
-retrieving revision 1.6
-retrieving revision 1.8
-diff -u -r1.6 -r1.8
---- fs/xfs.c   13 Nov 2005 15:47:09 -0000      1.6
-+++ fs/xfs.c   4 Jun 2006 15:56:54 -0000       1.8
-@@ -1,7 +1,7 @@
- /* xfs.c - XFS.  */
- /*
-  *  GRUB  --  GRand Unified Bootloader
-- *  Copyright (C) 2005  Free Software Foundation, Inc.
-+ *  Copyright (C) 2005,2006  Free Software Foundation, Inc.
-  *
-  *  This program is free software; you can redistribute it and/or modify
-  *  it under the terms of the GNU General Public License as published by
-@@ -191,7 +191,7 @@
-                     sizeof (struct grub_xfs_inode), (char *) inode))
-     return grub_errno;
--  if (grub_strncmp (inode->magic, "IN", 2))
-+  if (grub_strncmp ((char *) inode->magic, "IN", 2))
-     return grub_error (GRUB_ERR_BAD_FS, "not a correct XFS inode.\n");
-   return 0;
-@@ -237,9 +237,9 @@
-    POS.  Return the amount of read bytes in READ.  */
- static grub_ssize_t
- grub_xfs_read_file (grub_fshelp_node_t node,
--                   void (*read_hook) (unsigned long sector,
-+                   void (*read_hook) (grub_disk_addr_t sector,
-                                       unsigned offset, unsigned length),
--                   int pos, unsigned int len, char *buf)
-+                   int pos, grub_size_t len, char *buf)
- {
-   return grub_fshelp_read_file (node->data->disk, node, read_hook,
-                               pos, len, buf, grub_xfs_read_block,
-@@ -494,7 +494,7 @@
-                     sizeof (struct grub_xfs_sblock), (char *) &data->sblock))
-     goto fail;
-   
--  if (grub_strncmp (data->sblock.magic, "XFSB", 4))
-+  if (grub_strncmp ((char *) (data->sblock.magic), "XFSB", 4))
-     {
-       grub_error (GRUB_ERR_BAD_FS, "not a xfs filesystem");
-       goto fail;
-@@ -628,7 +628,7 @@
- static grub_ssize_t
--grub_xfs_read (grub_file_t file, char *buf, grub_ssize_t len)
-+grub_xfs_read (grub_file_t file, char *buf, grub_size_t len)
- {
-   struct grub_xfs_data *data = 
-     (struct grub_xfs_data *) file->data;
-@@ -663,7 +663,7 @@
-   data = grub_xfs_mount (disk);
-   if (data)
--    *label = grub_strndup (data->sblock.label, 12);
-+    *label = grub_strndup ((char *) (data->sblock.label), 12);
-   else
-     *label = 0;
-Index: include/grub/disk.h
-===================================================================
-RCS file: /cvsroot/grub/grub2/include/grub/disk.h,v
-retrieving revision 1.8
-retrieving revision 1.10
-diff -u -r1.8 -r1.10
---- include/grub/disk.h        18 Aug 2005 03:14:39 -0000      1.8
-+++ include/grub/disk.h        4 Jun 2006 15:56:54 -0000       1.10
-@@ -1,6 +1,6 @@
- /*
-  *  GRUB  --  GRand Unified Bootloader
-- *  Copyright (C) 2002, 2003, 2004, 2005  Free Software Foundation, Inc.
-+ *  Copyright (C) 2002,2003,2004,2005,2006  Free Software Foundation, Inc.
-  *
-  *  GRUB is free software; you can redistribute it and/or modify
-  *  it under the terms of the GNU General Public License as published by
-@@ -31,7 +31,8 @@
-   {
-     GRUB_DISK_DEVICE_BIOSDISK_ID,
-     GRUB_DISK_DEVICE_OFDISK_ID,
--    GRUB_DISK_DEVICE_LOOPBACK_ID
-+    GRUB_DISK_DEVICE_LOOPBACK_ID,
-+    GRUB_DISK_DEVICE_EFIDISK_ID
-   };
- struct grub_disk;
-@@ -55,12 +56,12 @@
-   void (*close) (struct grub_disk *disk);
-   /* Read SIZE sectors from the sector SECTOR of the disk DISK into BUF.  */
--  grub_err_t (*read) (struct grub_disk *disk, unsigned long sector,
--                    unsigned long size, char *buf);
-+  grub_err_t (*read) (struct grub_disk *disk, grub_disk_addr_t sector,
-+                    grub_size_t size, char *buf);
-   /* Write SIZE sectors from BUF into the sector SECTOR of the disk DISK.  */
--  grub_err_t (*write) (struct grub_disk *disk, unsigned long sector,
--                     unsigned long size, const char *buf);
-+  grub_err_t (*write) (struct grub_disk *disk, grub_disk_addr_t sector,
-+                     grub_size_t size, const char *buf);
-   /* The next disk device.  */
-   struct grub_disk_dev *next;
-@@ -79,7 +80,7 @@
-   grub_disk_dev_t dev;
-   /* The total number of sectors.  */
--  unsigned long total_sectors;
-+  grub_uint64_t total_sectors;
-   /* If partitions can be stored.  */
-   int has_partitions;
-@@ -90,8 +91,10 @@
-   /* The partition information. This is machine-specific.  */
-   struct grub_partition *partition;
--  /* Called when a sector was read.  */
--  void (*read_hook) (unsigned long sector, unsigned offset, unsigned length);
-+  /* Called when a sector was read. OFFSET is between 0 and
-+     the sector size minus 1, and LENGTH is between 0 and the sector size.  */
-+  void (*read_hook) (grub_disk_addr_t sector,
-+                   unsigned offset, unsigned length);
-   /* Device-specific data.  */
-   void *data;
-@@ -119,14 +122,14 @@
- grub_disk_t EXPORT_FUNC(grub_disk_open) (const char *name);
- void EXPORT_FUNC(grub_disk_close) (grub_disk_t disk);
- grub_err_t EXPORT_FUNC(grub_disk_read) (grub_disk_t disk,
--                                      unsigned long sector,
--                                      unsigned long offset,
--                                      unsigned long size,
-+                                      grub_disk_addr_t sector,
-+                                      grub_off_t offset,
-+                                      grub_size_t size,
-                                       char *buf);
- grub_err_t EXPORT_FUNC(grub_disk_write) (grub_disk_t disk,
--                                       unsigned long sector,
--                                       unsigned long offset,
--                                       unsigned long size,
-+                                       grub_disk_addr_t sector,
-+                                       grub_off_t offset,
-+                                       grub_size_t size,
-                                        const char *buf);
-Index: include/grub/env.h
-===================================================================
-RCS file: /cvsroot/grub/grub2/include/grub/env.h,v
-retrieving revision 1.3
-retrieving revision 1.6
-diff -u -r1.3 -r1.6
---- include/grub/env.h 20 Jul 2005 20:30:45 -0000      1.3
-+++ include/grub/env.h 1 May 2006 23:30:51 -0000       1.6
-@@ -1,6 +1,6 @@
- /*
-  *  GRUB  --  GRand Unified Bootloader
-- *  Copyright (C) 2003,2005  Free Software Foundation, Inc.
-+ *  Copyright (C) 2003,2005,2006  Free Software Foundation, Inc.
-  *
-  *  GRUB is free software; you can redistribute it and/or modify
-  *  it under the terms of the GNU General Public License as published by
-@@ -31,6 +31,18 @@
- typedef char *(*grub_env_write_hook_t) (struct grub_env_var *var,
-                                       const char *val);
-+enum grub_env_var_type
-+  {
-+    /* The default variable type which is local in current context.  */
-+    GRUB_ENV_VAR_LOCAL,
-+
-+    /* The exported type, which is passed to new contexts.  */
-+    GRUB_ENV_VAR_GLOBAL,
-+
-+    /* The data slot type, which is used to store arbitrary data.  */
-+    GRUB_ENV_VAR_DATA
-+  };
-+
- struct grub_env_var
- {
-   char *name;
-@@ -39,16 +51,23 @@
-   grub_env_write_hook_t write_hook;
-   struct grub_env_var *next;
-   struct grub_env_var **prevp;
--  struct grub_env_var *sort_next;
--  struct grub_env_var **sort_prevp;
-+  enum grub_env_var_type type;
- };
--grub_err_t EXPORT_FUNC(grub_env_set) (const char *var, const char *val);
-+grub_err_t EXPORT_FUNC(grub_env_set) (const char *name, const char *val);
- char *EXPORT_FUNC(grub_env_get) (const char *name);
- void EXPORT_FUNC(grub_env_unset) (const char *name);
--void EXPORT_FUNC(grub_env_iterate) (int (* func) (struct grub_env_var *var));
--grub_err_t EXPORT_FUNC(grub_register_variable_hook) (const char *var,
-+void EXPORT_FUNC(grub_env_iterate) (int (*func) (struct grub_env_var *var));
-+grub_err_t EXPORT_FUNC(grub_register_variable_hook) (const char *name,
-                                                    grub_env_read_hook_t read_hook,
-                                                    grub_env_write_hook_t write_hook);
-+grub_err_t EXPORT_FUNC(grub_env_context_open) (void);
-+grub_err_t EXPORT_FUNC(grub_env_context_close) (void);
-+grub_err_t EXPORT_FUNC(grub_env_export) (const char *name);
-+
-+grub_err_t EXPORT_FUNC(grub_env_set_data_slot) (const char *name,
-+                                              const void *ptr);
-+void *EXPORT_FUNC(grub_env_get_data_slot) (const char *name);
-+void EXPORT_FUNC(grub_env_unset_data_slot) (const char *name);
- #endif /* ! GRUB_ENV_HEADER */
-Index: include/grub/file.h
-===================================================================
-RCS file: /cvsroot/grub/grub2/include/grub/file.h,v
-retrieving revision 1.3
-retrieving revision 1.4
-diff -u -r1.3 -r1.4
---- include/grub/file.h        4 Apr 2004 13:46:00 -0000       1.3
-+++ include/grub/file.h        4 Jun 2006 15:56:54 -0000       1.4
-@@ -35,16 +35,17 @@
-   grub_fs_t fs;
-   /* The current offset.  */
--  grub_ssize_t offset;
-+  grub_off_t offset;
-   /* The file size.  */
--  grub_ssize_t size;
-+  grub_off_t size;
-   /* Filesystem-specific data.  */
-   void *data;
-   /* This is called when a sector is read. Used only for a disk device.  */
--  void (*read_hook) (unsigned long sector, unsigned offset, unsigned length);
-+  void (*read_hook) (grub_disk_addr_t sector,
-+                   unsigned offset, unsigned length);
- };
- typedef struct grub_file *grub_file_t;
-@@ -53,18 +54,17 @@
- grub_file_t EXPORT_FUNC(grub_file_open) (const char *name);
- grub_ssize_t EXPORT_FUNC(grub_file_read) (grub_file_t file, char *buf,
--                                        grub_ssize_t len);
--grub_ssize_t EXPORT_FUNC(grub_file_seek) (grub_file_t file,
--                                        grub_ssize_t offset);
-+                                        grub_size_t len);
-+grub_off_t EXPORT_FUNC(grub_file_seek) (grub_file_t file, grub_off_t offset);
- grub_err_t EXPORT_FUNC(grub_file_close) (grub_file_t file);
--static inline grub_ssize_t
-+static inline grub_off_t
- grub_file_size (const grub_file_t file)
- {
-   return file->size;
- }
--static inline grub_ssize_t
-+static inline grub_off_t
- grub_file_tell (const grub_file_t file)
- {
-   return file->offset;
-Index: include/grub/font.h
-===================================================================
-RCS file: /cvsroot/grub/grub2/include/grub/font.h,v
-retrieving revision 1.3
-retrieving revision 1.4
-diff -u -r1.3 -r1.4
---- include/grub/font.h        4 Apr 2004 13:46:00 -0000       1.3
-+++ include/grub/font.h        14 Mar 2006 19:08:33 -0000      1.4
-@@ -24,7 +24,31 @@
- #define GRUB_FONT_MAGIC       "PPF\x7f"
-+struct grub_font_glyph
-+{
-+  /* Glyph width in pixels.  */
-+  grub_uint8_t width;
-+  
-+  /* Glyph height in pixels.  */
-+  grub_uint8_t height;
-+  
-+  /* Glyph width in characters.  */
-+  grub_uint8_t char_width;
-+  
-+  /* Glyph baseline position in pixels (from up).  */
-+  grub_uint8_t baseline;
-+  
-+  /* Glyph bitmap data array of bytes in ((width + 7) / 8) * height.
-+     Bitmap is formulated by height scanlines, each scanline having
-+     width number of pixels. Pixels are coded as bits, value 1 meaning
-+     of opaque pixel and 0 is transparent. If width does not fit byte
-+     boundary, it will be padded with 0 to make it fit.  */
-+  grub_uint8_t bitmap[32];
-+};
-+
-+typedef struct grub_font_glyph *grub_font_glyph_t;
-+
- int grub_font_get_glyph (grub_uint32_t code,
--                       unsigned char bitmap[32], unsigned *width);
-+                       grub_font_glyph_t glyph);
- #endif /* ! GRUB_FONT_HEADER */
-Index: include/grub/fs.h
-===================================================================
-RCS file: /cvsroot/grub/grub2/include/grub/fs.h,v
-retrieving revision 1.14
-retrieving revision 1.15
-diff -u -r1.14 -r1.15
---- include/grub/fs.h  9 Oct 2005 13:03:53 -0000       1.14
-+++ include/grub/fs.h  4 Jun 2006 15:56:54 -0000       1.15
-@@ -42,7 +42,7 @@
-   grub_err_t (*open) (struct grub_file *file, const char *name);
-   
-   /* Read LEN bytes data from FILE into BUF.  */
--  grub_ssize_t (*read) (struct grub_file *file, char *buf, grub_ssize_t len);
-+  grub_ssize_t (*read) (struct grub_file *file, char *buf, grub_size_t len);
-   
-   /* Close the file FILE.  */
-   grub_err_t (*close) (struct grub_file *file);
-Index: include/grub/fshelp.h
-===================================================================
-RCS file: /cvsroot/grub/grub2/include/grub/fshelp.h,v
-retrieving revision 1.2
-retrieving revision 1.3
-diff -u -r1.2 -r1.3
---- include/grub/fshelp.h      25 Dec 2005 15:59:50 -0000      1.2
-+++ include/grub/fshelp.h      4 Jun 2006 15:56:54 -0000       1.3
-@@ -1,7 +1,7 @@
- /* fshelp.h -- Filesystem helper functions */
- /*
-  *  GRUB  --  GRand Unified Bootloader
-- *  Copyright (C) 2004, 2005  Free Software Foundation, Inc.
-+ *  Copyright (C) 2004,2005,2006  Free Software Foundation, Inc.
-  *
-  *  GRUB is free software; you can redistribute it and/or modify
-  *  it under the terms of the GNU General Public License as published by
-@@ -64,13 +64,13 @@
-    blocks have a size of LOG2BLOCKSIZE (in log2).  */
- grub_ssize_t
- EXPORT_FUNC(grub_fshelp_read_file) (grub_disk_t disk, grub_fshelp_node_t node,
--                                  void (*read_hook) (unsigned long sector,
-+                                  void (*read_hook) (grub_disk_addr_t sector,
-                                                      unsigned offset,
-                                                      unsigned length),
--                                  int pos, unsigned int len, char *buf,
-+                                  int pos, grub_size_t len, char *buf,
-                                   int (*get_block) (grub_fshelp_node_t node,
-                                                     int block),
--                                  unsigned int filesize, int log2blocksize);
-+                                  grub_off_t filesize, int log2blocksize);
- unsigned int
- EXPORT_FUNC(grub_fshelp_log2blksize) (unsigned int blksize,
-Index: include/grub/kernel.h
-===================================================================
-RCS file: /cvsroot/grub/grub2/include/grub/kernel.h,v
-retrieving revision 1.7
-retrieving revision 1.8
-diff -u -r1.7 -r1.8
---- include/grub/kernel.h      1 Oct 2005 19:49:55 -0000       1.7
-+++ include/grub/kernel.h      25 Apr 2006 20:08:31 -0000      1.8
-@@ -1,6 +1,6 @@
- /*
-  *  GRUB  --  GRand Unified Bootloader
-- *  Copyright (C) 2002, 2005  Free Software Foundation, Inc.
-+ *  Copyright (C) 2002,2005,2006  Free Software Foundation, Inc.
-  *
-  *  This program is free software; you can redistribute it and/or modify
-  *  it under the terms of the GNU General Public License as published by
-@@ -55,6 +55,9 @@
- /* The machine-specific finalization.  */
- void grub_machine_fini (void);
-+/* The machine-specific prefix initialization.  */
-+void grub_machine_set_prefix (void);
-+
- /* Register all the exported symbols. This is automatically generated.  */
- void grub_register_exported_symbols (void);
-Index: include/grub/loader.h
-===================================================================
-RCS file: /cvsroot/grub/grub2/include/grub/loader.h,v
-retrieving revision 1.7
-retrieving revision 1.8
-diff -u -r1.7 -r1.8
---- include/grub/loader.h      27 Dec 2004 13:46:20 -0000      1.7
-+++ include/grub/loader.h      30 Apr 2006 21:09:37 -0000      1.8
-@@ -1,7 +1,7 @@
- /* loader.h - OS loaders */
- /*
-  *  GRUB  --  GRand Unified Bootloader
-- *  Copyright (C) 2002,2003,2004  Free Software Foundation, Inc.
-+ *  Copyright (C) 2002,2003,2004,2006  Free Software Foundation, Inc.
-  *
-  *  This program is free software; you can redistribute it and/or modify
-  *  it under the terms of the GNU General Public License as published by
-@@ -26,11 +26,20 @@
- #include <grub/err.h>
- #include <grub/types.h>
-+/* Check if a loader is loaded.  */
- int EXPORT_FUNC(grub_loader_is_loaded) (void);
-+
-+/* Set loader functions. NORETURN must be set to true, if BOOT won't return
-+   to the original state.  */
- void EXPORT_FUNC(grub_loader_set) (grub_err_t (*boot) (void),
--                                 grub_err_t (*unload) (void));
-+                                 grub_err_t (*unload) (void),
-+                                 int noreturn);
-+
-+/* Unset current loader, if any.  */
- void EXPORT_FUNC(grub_loader_unset) (void);
-+/* Call the boot hook in current loader. This may or may not return,
-+   depending on the setting by grub_loader_set.  */
- grub_err_t EXPORT_FUNC(grub_loader_boot) (void);
- #endif /* ! GRUB_LOADER_HEADER */
-Index: include/grub/misc.h
-===================================================================
-RCS file: /cvsroot/grub/grub2/include/grub/misc.h,v
-retrieving revision 1.17
-retrieving revision 1.20
-diff -u -r1.17 -r1.20
---- include/grub/misc.h        24 Oct 2005 10:23:46 -0000      1.17
-+++ include/grub/misc.h        4 Jun 2006 15:56:54 -0000       1.20
-@@ -56,6 +56,7 @@
- int EXPORT_FUNC(grub_isdigit) (int c);
- int EXPORT_FUNC(grub_tolower) (int c);
- unsigned long EXPORT_FUNC(grub_strtoul) (const char *str, char **end, int base);
-+unsigned long long EXPORT_FUNC(grub_strtoull) (const char *str, char **end, int base);
- 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);
-@@ -68,12 +69,25 @@
- int EXPORT_FUNC(grub_vprintf) (const char *fmt, va_list args);
- int EXPORT_FUNC(grub_sprintf) (char *str, const char *fmt, ...) __attribute__ ((format (printf, 2, 3)));
- int EXPORT_FUNC(grub_vsprintf) (char *str, const char *fmt, va_list args);
--void EXPORT_FUNC(grub_stop) (void) __attribute__ ((noreturn));
-+void EXPORT_FUNC(grub_exit) (void) __attribute__ ((noreturn));
-+void EXPORT_FUNC(grub_abort) (void) __attribute__ ((noreturn));
- grub_uint8_t *EXPORT_FUNC(grub_utf16_to_utf8) (grub_uint8_t *dest,
-                                              grub_uint16_t *src,
-                                              grub_size_t size);
- grub_ssize_t EXPORT_FUNC(grub_utf8_to_ucs4) (grub_uint32_t *dest,
-                                            const grub_uint8_t *src,
-                                            grub_size_t size);
-+grub_uint64_t EXPORT_FUNC(grub_divmod64) (grub_uint64_t n,
-+                                        grub_uint32_t d, grub_uint32_t *r);
-+
-+/* Inline functions.  */
-+static inline unsigned int
-+grub_abs (int x)
-+{
-+  if (x < 0)
-+    return (unsigned int) (-x);
-+  else
-+    return (unsigned int) x;
-+}
- #endif /* ! GRUB_MISC_HEADER */
-Index: include/grub/mm.h
-===================================================================
-RCS file: /cvsroot/grub/grub2/include/grub/mm.h,v
-retrieving revision 1.5
-retrieving revision 1.6
-diff -u -r1.5 -r1.6
---- include/grub/mm.h  22 Aug 2005 17:28:59 -0000      1.5
-+++ include/grub/mm.h  25 Apr 2006 20:08:31 -0000      1.6
-@@ -23,6 +23,7 @@
- #include <grub/types.h>
- #include <grub/symbol.h>
-+#include <config.h>
- #ifndef NULL
- # define NULL ((void *) 0)
-@@ -35,9 +36,31 @@
- void *EXPORT_FUNC(grub_memalign) (grub_size_t align, grub_size_t size);
- /* For debugging.  */
--#define MM_DEBUG       1
--#if MM_DEBUG
-+#if defined(MM_DEBUG) && !defined(GRUB_UTIL)
-+/* Set this variable to 1 when you want to trace all memory function calls.  */
-+extern int EXPORT_VAR(grub_mm_debug);
-+
- void grub_mm_dump (unsigned lineno);
--#endif
-+
-+#define grub_malloc(size)     \
-+  grub_debug_malloc (__FILE__, __LINE__, size)
-+
-+#define grub_realloc(ptr,size)        \
-+  grub_debug_realloc (__FILE__, __LINE__, ptr, size)
-+
-+#define grub_memalign(align,size)     \
-+  grub_debug_memalign (__FILE__, __LINE__, align, size)
-+
-+#define grub_free(ptr)        \
-+  grub_debug_free (__FILE__, __LINE__, ptr)
-+
-+void *EXPORT_FUNC(grub_debug_malloc) (const char *file, int line,
-+                                    grub_size_t size);
-+void EXPORT_FUNC(grub_debug_free) (const char *file, int line, void *ptr);
-+void *EXPORT_FUNC(grub_debug_realloc) (const char *file, int line, void *ptr,
-+                                     grub_size_t size);
-+void *EXPORT_FUNC(grub_debug_memalign) (const char *file, int line,
-+                                      grub_size_t align, grub_size_t size);
-+#endif /* MM_DEBUG && ! GRUB_UTIL */
- #endif /* ! GRUB_MM_H */
-Index: include/grub/normal.h
-===================================================================
-RCS file: /cvsroot/grub/grub2/include/grub/normal.h,v
-retrieving revision 1.24
-retrieving revision 1.26
-diff -u -r1.24 -r1.26
---- include/grub/normal.h      17 Jan 2006 09:50:47 -0000      1.24
-+++ include/grub/normal.h      27 May 2006 21:09:25 -0000      1.26
-@@ -1,7 +1,7 @@
- /* normal.h - prototypes for the normal mode */
- /*
-  *  GRUB  --  GRand Unified Bootloader
-- *  Copyright (C) 2002,2003,2005  Free Software Foundation, Inc.
-+ *  Copyright (C) 2002,2003,2005,2006  Free Software Foundation, Inc.
-  *
-  *  This program is free software; you can redistribute it and/or modify
-  *  it under the terms of the GNU General Public License as published by
-@@ -105,15 +105,6 @@
- /* The menu.  */
- struct grub_menu
- {
--  /* The default entry number.  */
--  int default_entry;
--
--  /* The fallback entry number.  */
--  int fallback_entry;
--
--  /* The timeout to boot the default entry automatically.  */
--  int timeout;
--  
-   /* The size of a menu.  */
-   int size;
-@@ -122,22 +113,6 @@
- };
- typedef struct grub_menu *grub_menu_t;
--/* A list of menus.  */
--struct grub_menu_list
--{
--  grub_menu_t menu;
--  struct grub_menu_list *next;
--};
--typedef struct grub_menu_list *grub_menu_list_t;
--
--/* The context.  A context holds some global information.  */
--struct grub_context
--{
--  /* The menu list.  */
--  grub_menu_list_t menu_list;
--};
--typedef struct grub_context *grub_context_t;
--
- /* This is used to store the names of filesystem modules for auto-loading.  */
- struct grub_fs_module_list
- {
-@@ -175,10 +150,6 @@
- int grub_arg_parse (grub_command_t parser, int argc, char **argv,
-                   struct grub_arg_list *usr, char ***args, int *argnum);
- void grub_arg_show_help (grub_command_t cmd);
--grub_context_t grub_context_get (void);
--grub_menu_t grub_context_get_current_menu (void);
--grub_menu_t grub_context_push_menu (grub_menu_t menu);
--void grub_context_pop_menu (void);
- char *grub_normal_do_completion (char *buf, int *restore,
-                                void (*hook) (const char *item, grub_completion_type_t type, int count));
- grub_err_t grub_normal_print_device_info (const char *name);
-@@ -209,16 +180,14 @@
- void grub_halt_fini (void);
- void grub_reboot_init (void);
- void grub_reboot_fini (void);
--void grub_default_init (void);
--void grub_default_fini (void);
--void grub_timeout_init (void);
--void grub_timeout_fini (void);
- void grub_configfile_init (void);
- void grub_configfile_fini (void);
- void grub_search_init (void);
- void grub_search_fini (void);
- void grub_test_init (void);
- void grub_test_fini (void);
-+void grub_blocklist_init (void);
-+void grub_blocklist_fini (void);
- #endif
- #endif /* ! GRUB_NORMAL_HEADER */
-Index: include/grub/partition.h
-===================================================================
-RCS file: /cvsroot/grub/grub2/include/grub/partition.h,v
-retrieving revision 1.5
-retrieving revision 1.6
-diff -u -r1.5 -r1.6
---- include/grub/partition.h   20 Aug 2005 07:49:01 -0000      1.5
-+++ include/grub/partition.h   4 Jun 2006 15:56:54 -0000       1.6
-@@ -1,6 +1,6 @@
- /*
-  *  GRUB  --  GRand Unified Bootloader
-- *  Copyright (C) 1999,2000,2001,2002,2004  Free Software Foundation, Inc.
-+ *  Copyright (C) 1999,2000,2001,2002,2004,2006  Free Software Foundation, Inc.
-  *
-  *  GRUB is free software; you can redistribute it and/or modify
-  *  it under the terms of the GNU General Public License as published by
-@@ -34,7 +34,8 @@
-   
-   /* Call HOOK with each partition, until HOOK returns non-zero.  */
-   grub_err_t (*iterate) (struct grub_disk *disk,
--                       int (*hook) (struct grub_disk *disk, const grub_partition_t partition));
-+                       int (*hook) (struct grub_disk *disk,
-+                                    const grub_partition_t partition));
-   
-   /* Return the partition named STR on the disk DISK.  */
-   grub_partition_t (*probe) (struct grub_disk *disk,
-@@ -52,13 +53,13 @@
- struct grub_partition
- {
-   /* The start sector.  */
--  unsigned long start;
-+  grub_disk_addr_t start;
-   /* The length in sector units.  */
--  unsigned long len;
-+  grub_uint64_t len;
-   /* The offset of the partition table.  */
--  unsigned long offset;
-+  grub_disk_addr_t offset;
-   /* The index of this partition in the partition table.  */
-   int index;
-@@ -94,13 +95,13 @@
- void grub_sun_partition_map_fini (void);
- #endif
\f
--static inline unsigned long
-+static inline grub_disk_addr_t
- grub_partition_get_start (const grub_partition_t p)
- {
-   return p->start;
- }
--static inline unsigned long
-+static inline grub_uint64_t
- grub_partition_get_len (const grub_partition_t p)
- {
-   return p->len;
-Index: include/grub/script.h
-===================================================================
-RCS file: /cvsroot/grub/grub2/include/grub/script.h,v
-retrieving revision 1.2
-retrieving revision 1.4
-diff -u -r1.2 -r1.4
---- include/grub/script.h      17 Jan 2006 09:50:47 -0000      1.2
-+++ include/grub/script.h      28 May 2006 21:58:34 -0000      1.4
-@@ -23,6 +23,8 @@
- #include <grub/types.h>
- #include <grub/err.h>
-+#include <grub/parser.h>
-+#include "grub_script.tab.h"
- struct grub_script_mem;
-@@ -98,14 +100,14 @@
- {
-   struct grub_script_cmd cmd;
--  /* The command used to check if the if is true or false.  */
--  struct grub_script_cmd *bool;
-+  /* The command used to check if the 'if' is true or false.  */
-+  struct grub_script_cmd *exec_to_evaluate;
--  /* The code executed in case the result if bool was true.  */
--  struct grub_script_cmd *true;
-+  /* The code executed in case the result of 'if' was true.  */
-+  struct grub_script_cmd *exec_on_true;
--  /* The code executed in case the result if bool was false.  */
--  struct grub_script_cmd *false;
-+  /* The code executed in case the result of 'if' was false.  */
-+  struct grub_script_cmd *exec_on_false;
- };
- /* A menu entry generate statement.  */
-@@ -123,33 +125,98 @@
-   int options;
- };
-+/* State of the lexer as passed to the lexer.  */
-+struct grub_lexer_param
-+{
-+  /* Set to 0 when the lexer is done.  */
-+  int done;
-+
-+  /* State of the state machine.  */
-+  grub_parser_state_t state;
-+
-+  /* Function used by the lexer to get a new line when more input is
-+     expected, but not available.  */
-+  grub_err_t (*getline) (char **);
-+
-+  /* A reference counter.  If this is >0 it means that the parser
-+     expects more tokens and `getline' should be called to fetch more.
-+     Otherwise the lexer can stop processing if the current buffer is
-+     depleted.  */
-+  int refs;
-+
-+  /* The character stream that has to be parsed.  */
-+  char *script;
-+  char *newscript; /* XXX */
-+
-+  /* While walking through the databuffer, `record' the characters to
-+     this other buffer.  It can be used to edit the menu entry at a
-+     later moment.  */
-+
-+  /* If true, recording is enabled.  */
-+  int record;
-+
-+  /* Points to the recording.  */
-+  char *recording;
-+
-+  /* index in the RECORDING.  */ 
-+  int recordpos;
-+
-+  /* Size of RECORDING.  */
-+  int recordlen;
-+};
-+
-+/* State of the parser as passes to the parser.  */
-+struct grub_parser_param
-+{
-+  /* Keep track of the memory allocated for this specific
-+     function.  */
-+  struct grub_script_mem *func_mem;
-+
-+  /* When set to 0, no errors have occured during parsing.  */
-+  int err;
-+
-+  /* The memory that was used while parsing and scanning.  */
-+  struct grub_script_mem *memused;
-+
-+  /* The result of the parser.  */
-+  struct grub_script_cmd *parsed;
-+
-+  struct grub_lexer_param *lexerstate;
-+};
-+
- struct grub_script_arglist *
--grub_script_create_arglist (void);
-+grub_script_create_arglist (struct grub_parser_param *state);
- struct grub_script_arglist *
--grub_script_add_arglist (struct grub_script_arglist *list,
-+grub_script_add_arglist (struct grub_parser_param *state,
-+                       struct grub_script_arglist *list,
-                        struct grub_script_arg *arg);
- struct grub_script_cmd *
--grub_script_create_cmdline (char *cmdname,
-+grub_script_create_cmdline (struct grub_parser_param *state,
-+                          char *cmdname,
-                           struct grub_script_arglist *arglist);
- struct grub_script_cmd *
--grub_script_create_cmdblock (void);
-+grub_script_create_cmdblock (struct grub_parser_param *state);
- struct grub_script_cmd *
--grub_script_create_cmdif (struct grub_script_cmd *bool,
--                        struct grub_script_cmd *true,
--                        struct grub_script_cmd *false);
-+grub_script_create_cmdif (struct grub_parser_param *state,
-+                        struct grub_script_cmd *exec_to_evaluate,
-+                        struct grub_script_cmd *exec_on_true,
-+                        struct grub_script_cmd *exec_on_false);
- struct grub_script_cmd *
--grub_script_create_cmdmenu (struct grub_script_arg *title,
-+grub_script_create_cmdmenu (struct grub_parser_param *state,
-+                          struct grub_script_arg *title,
-                           char *sourcecode,
-                           int options);
- struct grub_script_cmd *
--grub_script_add_cmd (struct grub_script_cmdblock *cmdblock,
-+grub_script_add_cmd (struct grub_parser_param *state,
-+                   struct grub_script_cmdblock *cmdblock,
-                    struct grub_script_cmd *cmd);
- struct grub_script_arg *
--grub_script_arg_add (struct grub_script_arg *arg,
-+grub_script_arg_add (struct grub_parser_param *state,
-+                   struct grub_script_arg *arg,
-                    grub_script_arg_type_t type, char *str);
- struct grub_script *grub_script_parse (char *script,
-@@ -158,21 +225,23 @@
- struct grub_script *grub_script_create (struct grub_script_cmd *cmd,
-                                       struct grub_script_mem *mem);
--void grub_script_lexer_init (char *s, grub_err_t (*getline) (char **));
--void grub_script_lexer_ref (void);
--void grub_script_lexer_deref (void);
--void grub_script_lexer_record_start (void);
--char *grub_script_lexer_record_stop (void);
-+struct grub_lexer_param *grub_script_lexer_init (char *s,
-+                                               grub_err_t (*getline) (char **));
-+void grub_script_lexer_ref (struct grub_lexer_param *);
-+void grub_script_lexer_deref (struct grub_lexer_param *);
-+void grub_script_lexer_record_start (struct grub_lexer_param *);
-+char *grub_script_lexer_record_stop (struct grub_lexer_param *);
- /* Functions to track allocated memory.  */
--void *grub_script_malloc (grub_size_t size);
--struct grub_script_mem *grub_script_mem_record (void);
--struct grub_script_mem *grub_script_mem_record_stop (struct grub_script_mem *restore);
-+struct grub_script_mem *grub_script_mem_record (struct grub_parser_param *state);
-+struct grub_script_mem *grub_script_mem_record_stop (struct grub_parser_param *state, 
-+                                                   struct grub_script_mem *restore);
-+void *grub_script_malloc (struct grub_parser_param *state, grub_size_t size);
- /* Functions used by bison.  */
--int grub_script_yylex (void);
--int grub_script_yyparse (void);
--void grub_script_yyerror (char const *err);
-+int grub_script_yylex (YYSTYPE *, struct grub_parser_param *);
-+int grub_script_yyparse (struct grub_parser_param *);
-+void grub_script_yyerror (struct grub_parser_param *, char const *);
- /* Commands to execute, don't use these directly.  */
- grub_err_t grub_script_execute_cmdline (struct grub_script_cmd *cmd);
-Index: include/grub/symbol.h
-===================================================================
-RCS file: /cvsroot/grub/grub2/include/grub/symbol.h,v
-retrieving revision 1.5
-retrieving revision 1.6
-diff -u -r1.5 -r1.6
---- include/grub/symbol.h      13 Nov 2005 21:37:16 -0000      1.5
-+++ include/grub/symbol.h      26 Apr 2006 21:58:36 -0000      1.6
-@@ -1,6 +1,6 @@
- /*
-  *  GRUB  --  GRand Unified Bootloader
-- *  Copyright (C) 1999,2000,2001,2002  Free Software Foundation, Inc.
-+ *  Copyright (C) 1999,2000,2001,2002,2006  Free Software Foundation, Inc.
-  *
-  *  GRUB is free software; you can redistribute it and/or modify
-  *  it under the terms of the GNU General Public License as published by
-@@ -33,7 +33,9 @@
- #define VARIABLE(x)   .globl EXT_C(x) ; .type EXT_C(x), "object" ; EXT_C(x):
- /* Mark an exported symbol.  */
--#define EXPORT_FUNC(x)        x
--#define EXPORT_VAR(x) x
-+#ifndef GRUB_SYMBOL_GENERATOR
-+# define EXPORT_FUNC(x)       x
-+# define EXPORT_VAR(x)        x
-+#endif /* ! GRUB_SYMBOL_GENERATOR */
- #endif /* ! GRUB_SYMBOL_HEADER */
-Index: include/grub/types.h
-===================================================================
-RCS file: /cvsroot/grub/grub2/include/grub/types.h,v
-retrieving revision 1.7
-retrieving revision 1.9
-diff -u -r1.7 -r1.9
---- include/grub/types.h       13 Nov 2005 19:45:12 -0000      1.7
-+++ include/grub/types.h       4 Jun 2006 15:56:54 -0000       1.9
-@@ -1,6 +1,6 @@
- /*
-  *  GRUB  --  GRand Unified Bootloader
-- *  Copyright (C) 2002, 2005  Free Software Foundation, Inc.
-+ *  Copyright (C) 2002,2005,2006  Free Software Foundation, Inc.
-  *
-  *  This program is free software; you can redistribute it and/or modify
-  *  it under the terms of the GNU General Public License as published by
-@@ -32,9 +32,9 @@
- #  undef GRUB_CPU_WORDS_BIGENDIAN
- # endif
- #else /* ! GRUB_UTIL */
--# define GRUB_CPU_SIZEOF_VOID_P       GRUB_HOST_SIZEOF_VOID_P
--# define GRUB_CPU_SIZEOF_LONG GRUB_HOST_SIZEOF_LONG
--# ifdef GRUB_HOST_WORDS_BIGENDIAN
-+# define GRUB_CPU_SIZEOF_VOID_P       GRUB_TARGET_SIZEOF_VOID_P
-+# define GRUB_CPU_SIZEOF_LONG GRUB_TARGET_SIZEOF_LONG
-+# ifdef GRUB_TARGET_WORDS_BIGENDIAN
- #  define GRUB_CPU_WORDS_BIGENDIAN    1
- # else
- #  undef GRUB_CPU_WORDS_BIGENDIAN
-@@ -69,7 +69,7 @@
- #endif
- /* Misc types.  */
--#if GRUB_HOST_SIZEOF_VOID_P == 8
-+#if SIZEOF_VOID_P == 8
- typedef grub_uint64_t grub_host_addr_t;
- typedef grub_uint64_t grub_host_off_t;
- typedef grub_uint64_t grub_host_size_t;
-@@ -83,18 +83,19 @@
- #if GRUB_CPU_SIZEOF_VOID_P == 8
- typedef grub_uint64_t grub_addr_t;
--typedef grub_uint64_t grub_off_t;
- typedef grub_uint64_t grub_size_t;
- typedef grub_int64_t  grub_ssize_t;
- #else
- typedef grub_uint32_t grub_addr_t;
--typedef grub_uint32_t grub_off_t;
- typedef grub_uint32_t grub_size_t;
- typedef grub_int32_t  grub_ssize_t;
- #endif
--/* FIXME: Will be grub_uint64_t */
--typedef unsigned long grub_disk_addr_t;
-+/* The type for representing a file offset.  */
-+typedef grub_uint64_t grub_off_t;
-+
-+/* The type for representing a disk block address.  */
-+typedef grub_uint64_t grub_disk_addr_t;
- /* Byte-orders.  */
- #define grub_swap_bytes16(x)  \
-Index: include/grub/video.h
-===================================================================
-RCS file: include/grub/video.h
-diff -N include/grub/video.h
---- /dev/null  1 Jan 1970 00:00:00 -0000
-+++ include/grub/video.h       26 Apr 2006 21:58:36 -0000      1.3
-@@ -0,0 +1,328 @@
-+/*
-+ *  GRUB  --  GRand Unified Bootloader
-+ *  Copyright (C) 2006  Free Software Foundation, Inc.
-+ *
-+ *  GRUB is free software; you can redistribute it and/or modify
-+ *  it under the terms of the GNU General Public License as published by
-+ *  the Free Software Foundation; either version 2 of the License, or
-+ *  (at your option) any later version.
-+ *
-+ *  This program is distributed in the hope that it will be useful,
-+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+ *  GNU General Public License for more details.
-+ *
-+ *  You should have received a copy of the GNU General Public License
-+ *  along with GRUB; if not, write to the Free Software
-+ *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-+ */
-+
-+#ifndef GRUB_VIDEO_HEADER
-+#define GRUB_VIDEO_HEADER     1
-+
-+#include <grub/err.h>
-+#include <grub/types.h>
-+
-+typedef grub_uint32_t grub_video_color_t;
-+
-+struct grub_video_render_target;
-+
-+/* Defines used to describe video mode or rendering target.  */
-+#define GRUB_VIDEO_MODE_TYPE_ALPHA            0x00000008
-+#define GRUB_VIDEO_MODE_TYPE_DOUBLE_BUFFERED  0x00000004
-+#define GRUB_VIDEO_MODE_TYPE_INDEX_COLOR      0x00000002
-+#define GRUB_VIDEO_MODE_TYPE_RGB              0x00000001
-+
-+/* Defines used to mask flags.  */
-+#define GRUB_VIDEO_MODE_TYPE_COLOR_MASK               0x00000003
-+
-+/* Defines used to specify requested bit depth.  */
-+#define GRUB_VIDEO_MODE_TYPE_DEPTH_MASK               0x0000ff00
-+#define GRUB_VIDEO_MODE_TYPE_DEPTH_POS                8
-+
-+/* Defined predefined render targets.  */
-+#define GRUB_VIDEO_RENDER_TARGET_DISPLAY      ((struct grub_video_render_target *) 0)
-+#define GRUB_VIDEO_RENDER_TARGET_FRONT_BUFFER ((struct grub_video_render_target *) 0)
-+#define GRUB_VIDEO_RENDER_TARGET_BACK_BUFFER  ((struct grub_video_render_target *) 1)
-+
-+/* Defined blitting formats.  */
-+enum grub_video_blit_format
-+  {
-+    /* Follow exactly field & mask information.  */
-+    GRUB_VIDEO_BLIT_FORMAT_RGBA,
-+    /* Make optimization assumption.  */
-+    GRUB_VIDEO_BLIT_FORMAT_R8G8B8A8,
-+    /* Follow exactly field & mask information.  */
-+    GRUB_VIDEO_BLIT_FORMAT_RGB,
-+    /* Make optimization assumption.  */
-+    GRUB_VIDEO_BLIT_FORMAT_R8G8B8,
-+    /* When needed, decode color or just use value as is.  */
-+    GRUB_VIDEO_BLIT_FORMAT_INDEXCOLOR
-+  };
-+
-+struct grub_video_mode_info
-+{
-+  /* Width of the screen.  */
-+  unsigned int width;
-+  
-+  /* Height of the screen.  */
-+  unsigned int height;
-+
-+  /* Mode type bitmask.  Contains information like is it Index color or 
-+     RGB mode.  */
-+  unsigned int mode_type;
-+
-+  /* Bits per pixel.  */
-+  unsigned int bpp;
-+  
-+  /* Bytes per pixel.  */
-+  unsigned int bytes_per_pixel;
-+  
-+  /* Pitch of one scanline.  How many bytes there are for scanline.  */
-+  unsigned int pitch;
-+
-+  /* In index color mode, number of colors.  In RGB mode this is 256.  */
-+  unsigned int number_of_colors;
-+
-+  /* Optimization hint how binary data is coded.  */
-+  enum grub_video_blit_format blit_format;
-+
-+  /* How many bits are reserved for red color.  */
-+  unsigned int red_mask_size;
-+
-+  /* What is location of red color bits.  In Index Color mode, this is 0.  */
-+  unsigned int red_field_pos;
-+
-+  /* How many bits are reserved for green color.  */
-+  unsigned int green_mask_size;
-+
-+  /* What is location of green color bits.  In Index Color mode, this is 0.  */
-+  unsigned int green_field_pos;
-+
-+  /* How many bits are reserved for blue color.  */
-+  unsigned int blue_mask_size;
-+
-+  /* What is location of blue color bits.  In Index Color mode, this is 0.  */
-+  unsigned int blue_field_pos;
-+
-+  /* How many bits are reserved in color.  */
-+  unsigned int reserved_mask_size;
-+
-+  /* What is location of reserved color bits.  In Index Color mode, 
-+     this is 0.  */
-+  unsigned int reserved_field_pos;
-+};
-+
-+struct grub_video_render_target
-+{
-+  /* Copy of the screen's mode info structure, except that width, height and
-+     mode_type has been re-adjusted to requested render target settings.  */
-+  struct grub_video_mode_info mode_info;
-+
-+  struct
-+  {
-+    unsigned int x;
-+    unsigned int y;
-+    unsigned int width;
-+    unsigned int height;      
-+  } viewport;
-+
-+  /* Indicates wether the data has been allocated by us and must be freed 
-+     when render target is destroyed.  */
-+  int is_allocated;
-+  
-+  /* Pointer to data.  Can either be in video card memory or in local host's
-+     memory.  */
-+  void *data;
-+};
-+
-+struct grub_video_palette_data
-+{
-+  grub_uint8_t r; /* Red color value (0-255).  */
-+  grub_uint8_t g; /* Green color value (0-255).  */
-+  grub_uint8_t b; /* Blue color value (0-255).  */
-+  grub_uint8_t a; /* Reserved bits value (0-255).  */
-+};
-+
-+struct grub_font_glyph;
-+struct grub_video_bitmap;
-+
-+struct grub_video_adapter
-+{
-+  /* The video adapter name.  */
-+  const char *name;
-+
-+  /* Initialize the video adapter.  */
-+  grub_err_t (*init) (void);
-+
-+  /* Clean up the video adapter.  */
-+  grub_err_t (*fini) (void);
-+
-+  grub_err_t (*setup) (unsigned int width, 
-+                     unsigned int height,
-+                     unsigned int mode_type);
-+
-+  grub_err_t (*get_info) (struct grub_video_mode_info *mode_info);
-+  
-+  grub_err_t (*set_palette) (unsigned int start,
-+                           unsigned int count,
-+                           struct grub_video_palette_data *palette_data);
-+
-+  grub_err_t (*get_palette) (unsigned int start,
-+                           unsigned int count,
-+                           struct grub_video_palette_data *palette_data);
-+
-+  grub_err_t (*set_viewport) (unsigned int x,
-+                            unsigned int y,
-+                            unsigned int width,
-+                            unsigned int height);
-+
-+  grub_err_t (*get_viewport) (unsigned int *x,
-+                            unsigned int *y,
-+                            unsigned int *width,
-+                            unsigned int *height);
-+
-+  grub_video_color_t (*map_color) (grub_uint32_t color_name);
-+  
-+  grub_video_color_t (*map_rgb) (grub_uint8_t red,
-+                               grub_uint8_t green,
-+                               grub_uint8_t blue);
-+
-+  grub_video_color_t (*map_rgba) (grub_uint8_t red,
-+                                grub_uint8_t green,
-+                                grub_uint8_t blue,
-+                                grub_uint8_t alpha);
-+
-+  grub_err_t (*fill_rect) (grub_video_color_t color,
-+                         int x,
-+                         int y,
-+                         unsigned int width,
-+                         unsigned int height);
-+
-+  grub_err_t (*blit_glyph) (struct grub_font_glyph *glyph,
-+                          grub_video_color_t color,
-+                          int x,
-+                          int y);
-+
-+  grub_err_t (*blit_bitmap) (struct grub_video_bitmap *bitmap,
-+                           int x,
-+                           int y,
-+                           int offset_x,
-+                           int offset_y,
-+                           unsigned int width,
-+                           unsigned int height);
-+
-+  grub_err_t (*blit_render_target) (struct grub_video_render_target *source,
-+                                  int x,
-+                                  int y,
-+                                  int offset_x,
-+                                  int offset_y,
-+                                  unsigned int width,
-+                                  unsigned int height);
-+
-+  grub_err_t (*scroll) (grub_video_color_t color,
-+                      int dx,
-+                      int dy);
-+
-+  grub_err_t (*swap_buffers) (void);
-+
-+  grub_err_t (*create_render_target) (struct grub_video_render_target **result,
-+                                    unsigned int width,
-+                                    unsigned int height,
-+                                    unsigned int mode_type);
-+
-+  grub_err_t (*delete_render_target) (struct grub_video_render_target *target);
-+
-+  grub_err_t (*set_active_render_target) (struct grub_video_render_target *target);
-+
-+  /* The next video adapter.  */
-+  struct grub_video_adapter *next;
-+};
-+typedef struct grub_video_adapter *grub_video_adapter_t;
-+
-+void grub_video_register (grub_video_adapter_t adapter);
-+void grub_video_unregister (grub_video_adapter_t adapter);
-+void grub_video_iterate (int (*hook) (grub_video_adapter_t adapter));
-+
-+grub_err_t grub_video_setup (unsigned int width,
-+                           unsigned int height,
-+                           unsigned int mode_type);
-+
-+grub_err_t grub_video_restore (void);
-+
-+grub_err_t grub_video_get_info (struct grub_video_mode_info *mode_info);
-+
-+enum grub_video_blit_format grub_video_get_blit_format (struct grub_video_mode_info *mode_info);
-+
-+grub_err_t grub_video_set_palette (unsigned int start,
-+                                 unsigned int count,
-+                                 struct grub_video_palette_data *palette_data);
-+
-+grub_err_t grub_video_get_palette (unsigned int start,
-+                                 unsigned int count,
-+                                 struct grub_video_palette_data *palette_data);
-+
-+grub_err_t grub_video_set_viewport (unsigned int x,
-+                                  unsigned int y,
-+                                  unsigned int width,
-+                                  unsigned int height);
-+
-+grub_err_t grub_video_get_viewport (unsigned int *x,
-+                                  unsigned int *y,
-+                                  unsigned int *width,
-+                                  unsigned int *height);
-+
-+grub_video_color_t grub_video_map_color (grub_uint32_t color_name);
-+
-+grub_video_color_t grub_video_map_rgb (grub_uint8_t red,
-+                                     grub_uint8_t green,
-+                                     grub_uint8_t blue);
-+
-+grub_video_color_t grub_video_map_rgba (grub_uint8_t red,
-+                                      grub_uint8_t green,
-+                                      grub_uint8_t blue,
-+                                      grub_uint8_t alpha);
-+
-+grub_err_t grub_video_fill_rect (grub_video_color_t color,
-+                               int x,
-+                               int y,
-+                               unsigned int width,
-+                               unsigned int height);
-+
-+grub_err_t grub_video_blit_glyph (struct grub_font_glyph *glyph,
-+                                grub_video_color_t color,
-+                                int x,
-+                                int y);
-+
-+grub_err_t grub_video_blit_bitmap (struct grub_video_bitmap *bitmap,
-+                                 int x,
-+                                 int y,
-+                                 int offset_x,
-+                                 int offset_y,
-+                                 unsigned int width,
-+                                 unsigned int height);
-+
-+grub_err_t grub_video_blit_render_target (struct grub_video_render_target *source,
-+                                        int x,
-+                                        int y,
-+                                        int offset_x,
-+                                        int offset_y,
-+                                        unsigned int width,
-+                                        unsigned int height);
-+
-+grub_err_t grub_video_scroll (grub_video_color_t color,
-+                            int dx,
-+                            int dy);
-+
-+grub_err_t grub_video_swap_buffers (void);
-+
-+grub_err_t grub_video_create_render_target (struct grub_video_render_target **result,
-+                                          unsigned int width,
-+                                          unsigned int height,
-+                                          unsigned int mode_type);
-+
-+grub_err_t grub_video_delete_render_target (struct grub_video_render_target *target);
-+
-+grub_err_t grub_video_set_active_render_target (struct grub_video_render_target *target);
-+
-+#endif /* ! GRUB_VIDEO_HEADER */
-Index: include/grub/efi/api.h
-===================================================================
-RCS file: include/grub/efi/api.h
-diff -N include/grub/efi/api.h
---- /dev/null  1 Jan 1970 00:00:00 -0000
-+++ include/grub/efi/api.h     27 May 2006 21:09:25 -0000      1.5
-@@ -0,0 +1,1099 @@
-+/* efi.h - declare EFI types and functions */
-+/*
-+ *  GRUB  --  GRand Unified Bootloader
-+ *  Copyright (C) 2006  Free Software Foundation, Inc.
-+ *
-+ *  This program is free software; you can redistribute it and/or modify
-+ *  it under the terms of the GNU General Public License as published by
-+ *  the Free Software Foundation; either version 2 of the License, or
-+ *  (at your option) any later version.
-+ *
-+ *  This program is distributed in the hope that it will be useful,
-+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+ *  GNU General Public License for more details.
-+ *
-+ *  You should have received a copy of the GNU General Public License
-+ *  along with this program; if not, write to the Free Software
-+ *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-+ */
-+
-+#ifndef GRUB_EFI_API_HEADER
-+#define GRUB_EFI_API_HEADER   1
-+
-+#include <grub/types.h>
-+
-+/* For consistency and safety, we name the EFI-defined types differently.
-+   All names are transformed into lower case, _t appended, and
-+   grub_efi_ prepended.  */
-+
-+/* Constants.  */
-+#define GRUB_EFI_EVT_TIMER                            0x80000000
-+#define GRUB_EFI_EVT_RUNTIME                          0x40000000
-+#define GRUB_EFI_EVT_RUNTIME_CONTEXT                  0x20000000
-+#define GRUB_EFI_EVT_NOTIFY_WAIT                      0x00000100
-+#define GRUB_EFI_EVT_NOTIFY_SIGNAL                    0x00000200
-+#define GRUB_EFI_EVT_SIGNAL_EXIT_BOOT_SERVICES                0x00000201
-+#define GRUB_EFI_EVT_SIGNAL_VIRTUAL_ADDRESS_CHANGE    0x60000202
-+
-+#define GRUB_EFI_TPL_APPLICATION      4
-+#define GRUB_EFI_TPL_CALLBACK         8
-+#define GRUB_EFI_TPL_NOTIFY           16
-+#define GRUB_EFI_TPL_HIGH_LEVEL               31
-+
-+#define GRUB_EFI_MEMORY_UC    0x0000000000000001
-+#define GRUB_EFI_MEMORY_WC    0x0000000000000002
-+#define GRUB_EFI_MEMORY_WT    0x0000000000000004
-+#define GRUB_EFI_MEMORY_WB    0x0000000000000008
-+#define GRUB_EFI_MEMORY_UCE   0x0000000000000010
-+#define GRUB_EFI_MEMORY_WP    0x0000000000001000
-+#define GRUB_EFI_MEMORY_RP    0x0000000000002000
-+#define GRUB_EFI_MEMORY_XP    0x0000000000004000
-+#define GRUB_EFI_MEMORY_RUNTIME       0x8000000000000000
-+
-+#define GRUB_EFI_OPEN_PROTOCOL_BY_HANDLE_PROTOCOL     0x00000001
-+#define GRUB_EFI_OPEN_PROTOCOL_GET_PROTOCOL           0x00000002
-+#define GRUB_EFI_OPEN_PROTOCOL_TEST_PROTOCOL          0x00000004
-+#define GRUB_EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER    0x00000008
-+#define GRUB_EFI_OPEN_PROTOCOL_BY_DRIVER              0x00000010
-+#define GRUB_EFI_OPEN_PROTOCOL_BY_EXCLUSIVE           0x00000020
-+
-+#define GRUB_EFI_VARIABLE_NON_VOLATILE                0x0000000000000001
-+#define GRUB_EFI_VARIABLE_BOOTSERVICE_ACCESS  0x0000000000000002
-+#define GRUB_EFI_VARIABLE_RUNTIME_ACCESS      0x0000000000000004
-+
-+#define GRUB_EFI_TIME_ADJUST_DAYLIGHT 0x01
-+#define GRUB_EFI_TIME_IN_DAYLIGHT     0x02
-+
-+#define GRUB_EFI_UNSPECIFIED_TIMEZONE 0x07FF
-+
-+#define GRUB_EFI_OPTIONAL_PTR 0x00000001
-+
-+#define GRUB_EFI_LOADED_IMAGE_GUID    \
-+  { 0x5b1b31a1, 0x9562, 0x11d2, \
-+    { 0x8e, 0x3f, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b } \
-+  }
-+
-+#define GRUB_EFI_DISK_IO_GUID \
-+  { 0xce345171, 0xba0b, 0x11d2, \
-+    { 0x8e, 0x4f, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b } \
-+  }
-+
-+#define GRUB_EFI_BLOCK_IO_GUID        \
-+  { 0x964e5b21, 0x6459, 0x11d2, \
-+    { 0x8e, 0x39, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b } \
-+  }
-+
-+#define GRUB_EFI_DEVICE_PATH_GUID     \
-+  { 0x09576e91, 0x6d3f, 0x11d2, \
-+    { 0x8e, 0x39, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b } \
-+  }
-+
-+/* Enumerations.  */
-+enum grub_efi_timer_delay
-+  {
-+    GRUB_EFI_TIMER_CANCEL,
-+    GRUB_EFI_TIMER_PERIODIC,
-+    GRUB_EFI_TIMER_RELATIVE
-+  };
-+typedef enum grub_efi_timer_delay grub_efi_timer_delay_t;
-+
-+enum grub_efi_allocate_type
-+  {
-+    GRUB_EFI_ALLOCATE_ANY_PAGES,
-+    GRUB_EFI_ALLOCATE_MAX_ADDRESS,
-+    GRUB_EFI_ALLOCATE_ADDRESS,
-+    GRUB_EFI_MAX_ALLOCATION_TYPE
-+  };
-+typedef enum grub_efi_allocate_type grub_efi_allocate_type_t;
-+
-+enum grub_efi_memory_type
-+  {
-+    GRUB_EFI_RESERVED_MEMORY_TYPE,
-+    GRUB_EFI_LOADER_CODE,
-+    GRUB_EFI_LOADER_DATA,
-+    GRUB_EFI_BOOT_SERVICES_CODE,
-+    GRUB_EFI_BOOT_SERVICES_DATA,
-+    GRUB_EFI_RUNTIME_SERVICES_CODE,
-+    GRUB_EFI_RUNTIME_SERVICES_DATA,
-+    GRUB_EFI_CONVENTIONAL_MEMORY,
-+    GRUB_EFI_UNUSABLE_MEMORY,
-+    GRUB_EFI_ACPI_RECLAIM_MEMORY,
-+    GRUB_EFI_ACPI_MEMORY_NVS,
-+    GRUB_EFI_MEMORY_MAPPED_IO,
-+    GRUB_EFI_MEMORY_MAPPED_IO_PORT_SPACE,
-+    GRUB_EFI_PAL_CODE,
-+    GRUB_EFI_MAX_MEMORY_TYPE
-+  };
-+typedef enum grub_efi_memory_type grub_efi_memory_type_t;
-+
-+enum grub_efi_interface_type
-+  {
-+    GRUB_EFI_NATIVE_INTERFACE
-+  };
-+typedef enum grub_efi_interface_type grub_efi_interface_type_t;
-+
-+enum grub_efi_locate_search_type
-+  {
-+    GRUB_EFI_ALL_HANDLES,
-+    GRUB_EFI_BY_REGISTER_NOTIFY,
-+    GRUB_EFI_BY_PROTOCOL
-+  };
-+typedef enum grub_efi_locate_search_type grub_efi_locate_search_type_t;
-+
-+enum grub_efi_reset_type
-+  {
-+    GRUB_EFI_RESET_COLD,
-+    GRUB_EFI_RESET_WARM,
-+    GRUB_EFI_RESET_SHUTDOWN
-+  };
-+typedef enum grub_efi_reset_type grub_efi_reset_type_t;
-+
-+/* Types.  */
-+typedef char grub_efi_boolean_t;
-+typedef long grub_efi_intn_t;
-+typedef unsigned long grub_efi_uintn_t;
-+typedef grub_int8_t grub_efi_int8_t;
-+typedef grub_uint8_t grub_efi_uint8_t;
-+typedef grub_int16_t grub_efi_int16_t;
-+typedef grub_uint16_t grub_efi_uint16_t;
-+typedef grub_int32_t grub_efi_int32_t;
-+typedef grub_uint32_t grub_efi_uint32_t;
-+typedef grub_int64_t grub_efi_int64_t;
-+typedef grub_uint64_t grub_efi_uint64_t;
-+typedef grub_uint8_t grub_efi_char8_t;
-+typedef grub_uint16_t grub_efi_char16_t;
-+
-+typedef grub_efi_intn_t grub_efi_status_t;
-+
-+#define GRUB_EFI_ERROR_CODE(value)    \
-+  ((1 << (sizeof (grub_efi_status_t) * 8 - 1)) | (value))
-+
-+#define GRUB_EFI_WARNING_CODE(value)  (value)
-+
-+#define GRUB_EFI_SUCCESS              0
-+
-+#define GRUB_EFI_LOAD_ERROR           GRUB_EFI_ERROR_CODE (1)
-+#define GRUB_EFI_INVALID_PARAMETER    GRUB_EFI_ERROR_CODE (2)
-+#define GRUB_EFI_UNSUPPORTED          GRUB_EFI_ERROR_CODE (3)
-+#define GRUB_EFI_BAD_BUFFER_SIZE      GRUB_EFI_ERROR_CODE (4)
-+#define GRUB_EFI_BUFFER_TOO_SMALL     GRUB_EFI_ERROR_CODE (5)
-+#define GRUB_EFI_NOT_READY            GRUB_EFI_ERROR_CODE (6)
-+#define GRUB_EFI_DEVICE_ERROR         GRUB_EFI_ERROR_CODE (7)
-+#define GRUB_EFI_WRITE_PROTECTED      GRUB_EFI_ERROR_CODE (8)
-+#define GRUB_EFI_OUT_OF_RESOURCES     GRUB_EFI_ERROR_CODE (9)
-+#define GRUB_EFI_VOLUME_CORRUPTED     GRUB_EFI_ERROR_CODE (10)
-+#define GRUB_EFI_VOLUME_FULL          GRUB_EFI_ERROR_CODE (11)
-+#define GRUB_EFI_NO_MEDIA             GRUB_EFI_ERROR_CODE (12)
-+#define GRUB_EFI_MEDIA_CHANGED                GRUB_EFI_ERROR_CODE (13)
-+#define GRUB_EFI_NOT_FOUND            GRUB_EFI_ERROR_CODE (14)
-+#define GRUB_EFI_ACCESS_DENIED                GRUB_EFI_ERROR_CODE (15)
-+#define GRUB_EFI_NO_RESPONSE          GRUB_EFI_ERROR_CODE (16)
-+#define GRUB_EFI_NO_MAPPING           GRUB_EFI_ERROR_CODE (17)
-+#define GRUB_EFI_TIMEOUT              GRUB_EFI_ERROR_CODE (18)
-+#define GRUB_EFI_NOT_STARTED          GRUB_EFI_ERROR_CODE (19)
-+#define GRUB_EFI_ALREADY_STARTED      GRUB_EFI_ERROR_CODE (20)
-+#define GRUB_EFI_ABORTED              GRUB_EFI_ERROR_CODE (21)
-+#define GRUB_EFI_ICMP_ERROR           GRUB_EFI_ERROR_CODE (22)
-+#define GRUB_EFI_TFTP_ERROR           GRUB_EFI_ERROR_CODE (23)
-+#define GRUB_EFI_PROTOCOL_ERROR               GRUB_EFI_ERROR_CODE (24)
-+#define GRUB_EFI_INCOMPATIBLE_VERSION GRUB_EFI_ERROR_CODE (25)
-+#define GRUB_EFI_SECURITY_VIOLATION   GRUB_EFI_ERROR_CODE (26)
-+#define GRUB_EFI_CRC_ERROR            GRUB_EFI_ERROR_CODE (27)
-+
-+#define GRUB_EFI_WARN_UNKNOWN_GLYPH   GRUB_EFI_WARNING_CODE (1)
-+#define GRUB_EFI_WARN_DELETE_FAILURE  GRUB_EFI_WARNING_CODE (2)
-+#define GRUB_EFI_WARN_WRITE_FAILURE   GRUB_EFI_WARNING_CODE (3)
-+#define GRUB_EFI_WARN_BUFFER_TOO_SMALL        GRUB_EFI_WARNING_CODE (4)
-+
-+typedef void *grub_efi_handle_t;
-+typedef void *grub_efi_event_t;
-+typedef grub_efi_uint64_t grub_efi_lba_t;
-+typedef grub_efi_uintn_t grub_efi_tpl_t;
-+typedef grub_uint8_t grub_efi_mac_address_t[32];
-+typedef grub_uint8_t grub_efi_ipv4_address_t[4];
-+typedef grub_uint16_t grub_efi_ipv6_address_t[8];
-+typedef grub_uint8_t grub_efi_ip_address_t[8] __attribute__ ((aligned(4)));
-+typedef grub_efi_uint64_t grub_efi_physical_address_t;
-+typedef grub_efi_uint64_t grub_efi_virtual_address_t;
-+
-+struct grub_efi_guid
-+{
-+  grub_uint32_t data1;
-+  grub_uint16_t data2;
-+  grub_uint16_t data3;
-+  grub_uint8_t data4[8];
-+} __attribute__ ((aligned(8)));
-+typedef struct grub_efi_guid grub_efi_guid_t;
-+
-+/* XXX although the spec does not specify the padding, this actually
-+   must have the padding!  */
-+struct grub_efi_memory_descriptor
-+{
-+  grub_efi_uint32_t type;
-+  grub_efi_uint32_t padding;
-+  grub_efi_physical_address_t physical_start;
-+  grub_efi_virtual_address_t virtual_start;
-+  grub_efi_uint64_t num_pages;
-+  grub_efi_uint64_t attribute;
-+};
-+typedef struct grub_efi_memory_descriptor grub_efi_memory_descriptor_t;
-+
-+/* Device Path definitions.  */
-+struct grub_efi_device_path
-+{
-+  grub_efi_uint8_t type;
-+  grub_efi_uint8_t subtype;
-+  grub_efi_uint8_t length[2];
-+};
-+typedef struct grub_efi_device_path grub_efi_device_path_t;
-+/* XXX EFI does not define EFI_DEVICE_PATH_PROTOCOL but uses it.
-+   It seems to be identical to EFI_DEVICE_PATH.  */
-+typedef struct grub_efi_device_path grub_efi_device_path_protocol_t;
-+
-+#define GRUB_EFI_DEVICE_PATH_TYPE(dp)         ((dp)->type & 0x7f)
-+#define GRUB_EFI_DEVICE_PATH_SUBTYPE(dp)      ((dp)->subtype)
-+#define GRUB_EFI_DEVICE_PATH_LENGTH(dp)               \
-+  ((dp)->length[0] | ((grub_efi_uint16_t) ((dp)->length[1]) << 8))
-+
-+/* The End of Device Path nodes.  */
-+#define GRUB_EFI_END_DEVICE_PATH_TYPE                 (0xff & 0x7f)
-+
-+#define GRUB_EFI_END_ENTIRE_DEVICE_PATH_SUBTYPE               0xff
-+#define GRUB_EFI_END_THIS_DEVICE_PATH_SUBTYPE         0x01
-+
-+#define GRUB_EFI_END_ENTIRE_DEVICE_PATH(dp)   \
-+  (GRUB_EFI_DEVICE_PATH_TYPE (dp) == GRUB_EFI_END_DEVICE_PATH_TYPE \
-+   && (GRUB_EFI_DEVICE_PATH_SUBTYPE (dp) \
-+       == GRUB_EFI_END_ENTIRE_DEVICE_PATH_SUBTYPE))
-+
-+#define GRUB_EFI_NEXT_DEVICE_PATH(dp) \
-+  ((grub_efi_device_path_t *) ((char *) (dp) \
-+                               + GRUB_EFI_DEVICE_PATH_LENGTH (dp)))
-+
-+/* Hardware Device Path.  */
-+#define GRUB_EFI_HARDWARE_DEVICE_PATH_TYPE            1
-+
-+#define GRUB_EFI_PCI_DEVICE_PATH_SUBTYPE              1
-+
-+struct grub_efi_pci_device_path
-+{
-+  grub_efi_device_path_t header;
-+  grub_efi_uint8_t function;
-+  grub_efi_uint8_t device;
-+};
-+typedef struct grub_efi_pci_device_path grub_efi_pci_device_path_t;
-+
-+#define GRUB_EFI_PCCARD_DEVICE_PATH_SUBTYPE           2
-+
-+struct grub_efi_pccard_device_path
-+{
-+  grub_efi_device_path_t header;
-+  grub_efi_uint8_t function;
-+};
-+typedef struct grub_efi_pccard_device_path grub_efi_pccard_device_path_t;
-+
-+#define GRUB_EFI_MEMORY_MAPPED_DEVICE_PATH_SUBTYPE    3
-+
-+struct grub_efi_memory_mapped_device_path
-+{
-+  grub_efi_device_path_t header;
-+  grub_efi_memory_type_t memory_type;
-+  grub_efi_physical_address_t start_address;
-+  grub_efi_physical_address_t end_address;
-+};
-+typedef struct grub_efi_memory_mapped_device_path grub_efi_memory_mapped_device_path_t;
-+
-+#define GRUB_EFI_VENDOR_DEVICE_PATH_SUBTYPE           4
-+
-+struct grub_efi_vendor_device_path
-+{
-+  grub_efi_device_path_t header;
-+  grub_efi_guid_t vendor_guid;
-+  grub_efi_uint8_t vendor_defined_data[0];
-+};
-+typedef struct grub_efi_vendor_device_path grub_efi_vendor_device_path_t;
-+
-+#define GRUB_EFI_CONTROLLER_DEVICE_PATH_SUBTYPE               5
-+
-+struct grub_efi_controller_device_path
-+{
-+  grub_efi_device_path_t header;
-+  grub_efi_uint32_t controller_number;
-+};
-+typedef struct grub_efi_controller_device_path grub_efi_controller_device_path_t;
-+
-+/* ACPI Device Path.  */
-+#define GRUB_EFI_ACPI_DEVICE_PATH_TYPE                        2
-+
-+#define GRUB_EFI_ACPI_DEVICE_PATH_SUBTYPE             1
-+
-+struct grub_efi_acpi_device_path
-+{
-+  grub_efi_device_path_t header;
-+  grub_efi_uint32_t hid;
-+  grub_efi_uint32_t uid;
-+};
-+typedef struct grub_efi_acpi_device_path grub_efi_acpi_device_path_t;
-+
-+#define GRUB_EFI_EXPANDED_ACPI_DEVICE_PATH_SUBTYPE    2
-+
-+struct grub_efi_expanded_acpi_device_path
-+{
-+  grub_efi_device_path_t header;
-+  grub_efi_uint32_t hid;
-+  grub_efi_uint32_t uid;
-+  grub_efi_uint32_t cid;
-+  char hidstr[1];
-+};
-+typedef struct grub_efi_expanded_acpi_device_path grub_efi_expanded_acpi_device_path_t;
-+
-+#define GRUB_EFI_EXPANDED_ACPI_HIDSTR(dp)     \
-+  (((grub_efi_expanded_acpi_device_path_t *) dp)->hidstr)
-+#define GRUB_EFI_EXPANDED_ACPI_UIDSTR(dp)     \
-+  (GRUB_EFI_EXPANDED_ACPI_HIDSTR(dp) \
-+   + grub_strlen (GRUB_EFI_EXPANDED_ACPI_HIDSTR(dp)) + 1)
-+#define GRUB_EFI_EXPANDED_ACPI_CIDSTR(dp)     \
-+  (GRUB_EFI_EXPANDED_ACPI_UIDSTR(dp) \
-+   + grub_strlen (GRUB_EFI_EXPANDED_ACPI_UIDSTR(dp)) + 1)
-+
-+/* Messaging Device Path.  */
-+#define GRUB_EFI_MESSAGING_DEVICE_PATH_TYPE           3
-+
-+#define GRUB_EFI_ATAPI_DEVICE_PATH_SUBTYPE            1
-+
-+struct grub_efi_atapi_device_path
-+{
-+  grub_efi_device_path_t header;
-+  grub_efi_uint8_t primary_secondary;
-+  grub_efi_uint8_t slave_master;
-+  grub_efi_uint16_t lun;
-+};
-+typedef struct grub_efi_atapi_device_path grub_efi_atapi_device_path_t;
-+
-+#define GRUB_EFI_SCSI_DEVICE_PATH_SUBTYPE             2
-+
-+struct grub_efi_scsi_device_path
-+{
-+  grub_efi_device_path_t header;
-+  grub_efi_uint16_t pun;
-+  grub_efi_uint16_t lun;
-+};
-+typedef struct grub_efi_scsi_device_path grub_efi_scsi_device_path_t;
-+
-+#define GRUB_EFI_FIBRE_CHANNEL_DEVICE_PATH_SUBTYPE    3
-+
-+struct grub_efi_fibre_channel_device_path
-+{
-+  grub_efi_device_path_t header;
-+  grub_efi_uint32_t reserved;
-+  grub_efi_uint64_t wwn;
-+  grub_efi_uint64_t lun;
-+};
-+typedef struct grub_efi_fibre_channel_device_path grub_efi_fibre_channel_device_path_t;
-+
-+#define GRUB_EFI_1394_DEVICE_PATH_SUBTYPE             4
-+
-+struct grub_efi_1394_device_path
-+{
-+  grub_efi_device_path_t header;
-+  grub_efi_uint32_t reserved;
-+  grub_efi_uint64_t guid;
-+};
-+typedef struct grub_efi_1394_device_path grub_efi_1394_device_path_t;
-+
-+#define GRUB_EFI_USB_DEVICE_PATH_SUBTYPE              5
-+
-+struct grub_efi_usb_device_path
-+{
-+  grub_efi_device_path_t header;
-+  grub_efi_uint8_t parent_port_number;
-+  grub_efi_uint8_t interface;
-+};
-+typedef struct grub_efi_usb_device_path grub_efi_usb_device_path_t;
-+
-+#define GRUB_EFI_USB_CLASS_DEVICE_PATH_SUBTYPE                15
-+
-+struct grub_efi_usb_class_device_path
-+{
-+  grub_efi_device_path_t header;
-+  grub_efi_uint16_t vendor_id;
-+  grub_efi_uint16_t product_id;
-+  grub_efi_uint8_t device_class;
-+  grub_efi_uint8_t device_subclass;
-+  grub_efi_uint8_t device_protocol;
-+};
-+typedef struct grub_efi_usb_class_device_path grub_efi_usb_class_device_path_t;
-+
-+#define GRUB_EFI_I2O_DEVICE_PATH_SUBTYPE              6
-+
-+struct grub_efi_i2o_device_path
-+{
-+  grub_efi_device_path_t header;
-+  grub_efi_uint32_t tid;
-+};
-+typedef struct grub_efi_i2o_device_path grub_efi_i2o_device_path_t;
-+
-+#define GRUB_EFI_MAC_ADDRESS_DEVICE_PATH_SUBTYPE      11
-+
-+struct grub_efi_mac_address_device_path
-+{
-+  grub_efi_device_path_t header;
-+  grub_efi_mac_address_t mac_address;
-+  grub_efi_uint8_t if_type;
-+};
-+typedef struct grub_efi_mac_address_device_path grub_efi_mac_address_device_path_t;
-+
-+#define GRUB_EFI_IPV4_DEVICE_PATH_SUBTYPE             12
-+
-+struct grub_efi_ipv4_device_path
-+{
-+  grub_efi_device_path_t header;
-+  grub_efi_ipv4_address_t local_ip_address;
-+  grub_efi_ipv4_address_t remote_ip_address;
-+  grub_efi_uint16_t local_port;
-+  grub_efi_uint16_t remote_port;
-+  grub_efi_uint16_t protocol;
-+  grub_efi_uint8_t static_ip_address;
-+};
-+typedef struct grub_efi_ipv4_device_path grub_efi_ipv4_device_path_t;
-+
-+#define GRUB_EFI_IPV6_DEVICE_PATH_SUBTYPE             13
-+
-+struct grub_efi_ipv6_device_path
-+{
-+  grub_efi_device_path_t header;
-+  grub_efi_ipv6_address_t local_ip_address;
-+  grub_efi_ipv6_address_t remote_ip_address;
-+  grub_efi_uint16_t local_port;
-+  grub_efi_uint16_t remote_port;
-+  grub_efi_uint16_t protocol;
-+  grub_efi_uint8_t static_ip_address;
-+};
-+typedef struct grub_efi_ipv6_device_path grub_efi_ipv6_device_path_t;
-+
-+#define GRUB_EFI_INFINIBAND_DEVICE_PATH_SUBTYPE               9
-+
-+struct grub_efi_infiniband_device_path
-+{
-+  grub_efi_device_path_t header;
-+  grub_efi_uint32_t resource_flags;
-+  grub_efi_uint8_t port_gid[16];
-+  grub_efi_uint64_t remote_id;
-+  grub_efi_uint64_t target_port_id;
-+  grub_efi_uint64_t device_id;
-+};
-+typedef struct grub_efi_infiniband_device_path grub_efi_infiniband_device_path_t;
-+
-+#define GRUB_EFI_UART_DEVICE_PATH_SUBTYPE             14
-+
-+struct grub_efi_uart_device_path
-+{
-+  grub_efi_device_path_t header;
-+  grub_efi_uint32_t reserved;
-+  grub_efi_uint64_t baud_rate;
-+  grub_efi_uint8_t data_bits;
-+  grub_efi_uint8_t parity;
-+  grub_efi_uint8_t stop_bits;
-+};
-+typedef struct grub_efi_uart_device_path grub_efi_uart_device_path_t;
-+
-+#define GRUB_EFI_VENDOR_MESSAGING_DEVICE_PATH_SUBTYPE 10
-+
-+struct grub_efi_vendor_messaging_device_path
-+{
-+  grub_efi_device_path_t header;
-+  grub_efi_guid_t vendor_guid;
-+  grub_efi_uint8_t vendor_defined_data[0];
-+};
-+typedef struct grub_efi_vendor_messaging_device_path grub_efi_vendor_messaging_device_path_t;
-+
-+/* Media Device Path.  */
-+#define GRUB_EFI_MEDIA_DEVICE_PATH_TYPE                       4
-+
-+#define GRUB_EFI_HARD_DRIVE_DEVICE_PATH_SUBTYPE               1
-+
-+struct grub_efi_hard_drive_device_path
-+{
-+  grub_efi_device_path_t header;
-+  grub_efi_uint32_t partition_number;
-+  grub_efi_lba_t partition_start;
-+  grub_efi_lba_t partition_size;
-+  grub_efi_uint8_t partition_signature[8];
-+  grub_efi_uint8_t mbr_type;
-+  grub_efi_uint8_t signature_type;
-+};
-+typedef struct grub_efi_hard_drive_device_path grub_efi_hard_drive_device_path_t;
-+
-+#define GRUB_EFI_CDROM_DEVICE_PATH_SUBTYPE            2
-+
-+struct grub_efi_cdrom_device_path
-+{
-+  grub_efi_device_path_t header;
-+  grub_efi_uint32_t boot_entry;
-+  grub_efi_lba_t partition_start;
-+  grub_efi_lba_t partition_size;
-+};
-+typedef struct grub_efi_cdrom_device_path grub_efi_cdrom_device_path_t;
-+
-+#define GRUB_EFI_VENDOR_MEDIA_DEVICE_PATH_SUBTYPE     3
-+
-+struct grub_efi_vendor_media_device_path
-+{
-+  grub_efi_device_path_t header;
-+  grub_efi_guid_t vendor_guid;
-+  grub_efi_uint8_t vendor_defined_data[0];
-+};
-+typedef struct grub_efi_vendor_media_device_path grub_efi_vendor_media_device_path_t;
-+
-+#define GRUB_EFI_FILE_PATH_DEVICE_PATH_SUBTYPE                4
-+
-+struct grub_efi_file_path_device_path
-+{
-+  grub_efi_device_path_t header;
-+  grub_efi_char16_t path_name[0];
-+};
-+typedef struct grub_efi_file_path_device_path grub_efi_file_path_device_path_t;
-+
-+#define GRUB_EFI_PROTOCOL_DEVICE_PATH_SUBTYPE         5
-+
-+struct grub_efi_protocol_device_path
-+{
-+  grub_efi_device_path_t header;
-+  grub_efi_guid_t guid;
-+};
-+typedef struct grub_efi_protocol_device_path grub_efi_protocol_device_path_t;
-+
-+/* BIOS Boot Specification Device Path.  */
-+#define GRUB_EFI_BIOS_DEVICE_PATH_TYPE                        5
-+
-+#define GRUB_EFI_BIOS_DEVICE_PATH_SUBTYPE             1
-+
-+struct grub_efi_bios_device_path
-+{
-+  grub_efi_device_path_t header;
-+  grub_efi_uint16_t device_type;
-+  grub_efi_uint16_t status_flags;
-+  char description[0];
-+};
-+typedef struct grub_efi_bios_device_path grub_efi_bios_device_path_t;
-+
-+struct grub_efi_open_protocol_information_entry
-+{
-+  grub_efi_handle_t agent_handle;
-+  grub_efi_handle_t controller_handle;
-+  grub_efi_uint32_t attributes;
-+  grub_efi_uint32_t open_count;
-+};
-+typedef struct grub_efi_open_protocol_information_entry grub_efi_open_protocol_information_entry_t;
-+
-+struct grub_efi_time
-+{
-+  grub_efi_uint16_t year;
-+  grub_efi_uint8_t month;
-+  grub_efi_uint8_t day;
-+  grub_efi_uint8_t hour;
-+  grub_efi_uint8_t minute;
-+  grub_efi_uint8_t second;
-+  grub_efi_uint8_t pad1;
-+  grub_efi_uint32_t nanosecond;
-+  grub_efi_int16_t time_zone;
-+  grub_efi_uint8_t daylight;
-+  grub_efi_uint8_t pad2;
-+};
-+typedef struct grub_efi_time grub_efi_time_t;
-+
-+struct grub_efi_time_capabilities
-+{
-+  grub_efi_uint32_t resolution;
-+  grub_efi_uint32_t accuracy;
-+  grub_efi_boolean_t sets_to_zero;
-+};
-+typedef struct grub_efi_time_capabilities grub_efi_time_capabilities_t;
-+
-+struct grub_efi_input_key
-+{
-+  grub_efi_uint16_t scan_code;
-+  grub_efi_char16_t unicode_char;
-+};
-+typedef struct grub_efi_input_key grub_efi_input_key_t;
-+
-+struct grub_efi_simple_text_output_mode
-+{
-+  grub_efi_int32_t max_mode;
-+  grub_efi_int32_t mode;
-+  grub_efi_int32_t attribute;
-+  grub_efi_int32_t cursor_column;
-+  grub_efi_int32_t cursor_row;
-+  grub_efi_boolean_t cursor_visible;
-+};
-+typedef struct grub_efi_simple_text_output_mode grub_efi_simple_text_output_mode_t;
-+
-+/* Tables.  */
-+struct grub_efi_table_header
-+{
-+  grub_efi_uint64_t signature;
-+  grub_efi_uint32_t revision;
-+  grub_efi_uint32_t header_size;
-+  grub_efi_uint32_t crc32;
-+  grub_efi_uint32_t reserved;
-+};
-+typedef struct grub_efi_table_header grub_efi_table_header_t;
-+
-+struct grub_efi_boot_services
-+{
-+  grub_efi_table_header_t hdr;
-+  
-+  grub_efi_tpl_t
-+  (*raise_tpl) (grub_efi_tpl_t new_tpl);
-+  
-+  void
-+  (*restore_tpl) (grub_efi_tpl_t old_tpl);
-+  
-+  grub_efi_status_t
-+  (*allocate_pages) (grub_efi_allocate_type_t type,
-+                   grub_efi_memory_type_t memory_type,
-+                   grub_efi_uintn_t pages,
-+                   grub_efi_physical_address_t *memory);
-+  
-+  grub_efi_status_t
-+  (*free_pages) (grub_efi_physical_address_t memory,
-+               grub_efi_uintn_t pages);
-+  
-+  grub_efi_status_t
-+  (*get_memory_map) (grub_efi_uintn_t *memory_map_size,
-+                   grub_efi_memory_descriptor_t *memory_map,
-+                   grub_efi_uintn_t *map_key,
-+                   grub_efi_uintn_t *descriptor_size,
-+                   grub_efi_uint32_t *descriptor_version);
-+  
-+  grub_efi_status_t
-+  (*allocate_pool) (grub_efi_memory_type_t pool_type,
-+                  grub_efi_uintn_t size,
-+                  void **buffer);
-+  
-+  grub_efi_status_t
-+  (*free_pool) (void *buffer);
-+  
-+  grub_efi_status_t
-+  (*create_event) (grub_efi_uint32_t type,
-+                 grub_efi_tpl_t notify_tpl,
-+                 void (*notify_function) (grub_efi_event_t event,
-+                                          void *context),
-+                 void *notify_context,
-+                 grub_efi_event_t *event);
-+
-+  grub_efi_status_t
-+  (*set_timer) (grub_efi_event_t event,
-+              grub_efi_timer_delay_t type,
-+              grub_efi_uint64_t trigger_time);
-+  
-+   grub_efi_status_t
-+   (*wait_for_event) (grub_efi_uintn_t num_events,
-+                    grub_efi_event_t *event,
-+                    grub_efi_uintn_t *index);
-+
-+  grub_efi_status_t
-+  (*signal_event) (grub_efi_event_t event);
-+  
-+  grub_efi_status_t
-+  (*close_event) (grub_efi_event_t event);
-+  
-+  grub_efi_status_t
-+  (*check_event) (grub_efi_event_t event);
-+
-+   grub_efi_status_t
-+   (*install_protocol_interface) (grub_efi_handle_t *handle,
-+                                grub_efi_guid_t *protocol,
-+                                grub_efi_interface_type_t interface_type,
-+                                void *interface);
-+  
-+  grub_efi_status_t
-+  (*reinstall_protocol_interface) (grub_efi_handle_t handle,
-+                                 grub_efi_guid_t *protocol,
-+                                 void *old_interface,
-+                                 void *new_inteface);
-+  
-+  grub_efi_status_t
-+  (*uninstall_protocol_interface) (grub_efi_handle_t handle,
-+                                 grub_efi_guid_t *protocol,
-+                                 void *interface);
-+
-+  grub_efi_status_t
-+  (*handle_protocol) (grub_efi_handle_t handle,
-+                    grub_efi_guid_t *protocol,
-+                    void **interface);
-+  
-+  void *reserved;
-+  
-+  grub_efi_status_t
-+  (*register_protocol_notify) (grub_efi_guid_t *protocol,
-+                             grub_efi_event_t event,
-+                             void **registration);
-+
-+  grub_efi_status_t
-+  (*locate_handle) (grub_efi_locate_search_type_t search_type,
-+                  grub_efi_guid_t *protocol,
-+                  void *search_key,
-+                  grub_efi_uintn_t *buffer_size,
-+                  grub_efi_handle_t *buffer);
-+
-+  grub_efi_status_t
-+  (*locate_device_path) (grub_efi_guid_t *protocol,
-+                       grub_efi_device_path_t **device_path,
-+                       grub_efi_handle_t *device);
-+
-+  grub_efi_status_t
-+  (*install_configuration_table) (grub_efi_guid_t *guid, void *table);
-+
-+  grub_efi_status_t
-+  (*load_image) (grub_efi_boolean_t boot_policy,
-+               grub_efi_handle_t parent_image_handle,
-+               grub_efi_device_path_t *file_path,
-+               void *source_buffer,
-+               grub_efi_uintn_t source_size,
-+               grub_efi_handle_t *image_handle);
-+
-+  grub_efi_status_t
-+  (*start_image) (grub_efi_handle_t image_handle,
-+                grub_efi_uintn_t *exit_data_size,
-+                grub_efi_char16_t **exit_data);
-+
-+  grub_efi_status_t
-+  (*exit) (grub_efi_handle_t image_handle,
-+         grub_efi_status_t exit_status,
-+         grub_efi_uintn_t exit_data_size,
-+         grub_efi_char16_t *exit_data) __attribute__((noreturn));
-+
-+  grub_efi_status_t
-+  (*unload_image) (grub_efi_handle_t image_handle);
-+
-+  grub_efi_status_t
-+  (*exit_boot_services) (grub_efi_handle_t image_handle,
-+                       grub_efi_uintn_t map_key);
-+
-+  grub_efi_status_t
-+  (*get_next_monotonic_count) (grub_efi_uint64_t *count);
-+
-+  grub_efi_status_t
-+  (*stall) (grub_efi_uintn_t microseconds);
-+
-+  grub_efi_status_t
-+  (*set_watchdog_timer) (grub_efi_uintn_t timeout,
-+                       grub_efi_uint64_t watchdog_code,
-+                       grub_efi_uintn_t data_size,
-+                       grub_efi_char16_t *watchdog_data);
-+
-+  grub_efi_status_t
-+  (*connect_controller) (grub_efi_handle_t controller_handle,
-+                       grub_efi_handle_t *driver_image_handle,
-+                       grub_efi_device_path_protocol_t *remaining_device_path,
-+                       grub_efi_boolean_t recursive);
-+
-+  grub_efi_status_t
-+  (*disconnect_controller) (grub_efi_handle_t controller_handle,
-+                          grub_efi_handle_t driver_image_handle,
-+                          grub_efi_handle_t child_handle);
-+
-+  grub_efi_status_t
-+  (*open_protocol) (grub_efi_handle_t handle,
-+                  grub_efi_guid_t *protocol,
-+                  void **interface,
-+                  grub_efi_handle_t agent_handle,
-+                  grub_efi_handle_t controller_handle,
-+                  grub_efi_uint32_t attributes);
-+
-+  grub_efi_status_t
-+  (*close_protocol) (grub_efi_handle_t handle,
-+                   grub_efi_guid_t *protocol,
-+                   grub_efi_handle_t agent_handle,
-+                   grub_efi_handle_t controller_handle);
-+
-+  grub_efi_status_t
-+  (*open_protocol_information) (grub_efi_handle_t handle,
-+                              grub_efi_guid_t *protocol,
-+                              grub_efi_open_protocol_information_entry_t **entry_buffer,
-+                              grub_efi_uintn_t *entry_count);
-+
-+  grub_efi_status_t
-+  (*protocols_per_handle) (grub_efi_handle_t handle,
-+                         grub_efi_guid_t ***protocol_buffer,
-+                         grub_efi_uintn_t *protocol_buffer_count);
-+
-+  grub_efi_status_t
-+  (*locate_handle_buffer) (grub_efi_locate_search_type_t search_type,
-+                         grub_efi_guid_t *protocol,
-+                         void *search_key,
-+                         grub_efi_uintn_t *no_handles,
-+                         grub_efi_handle_t **buffer);
-+
-+  grub_efi_status_t
-+  (*locate_protocol) (grub_efi_guid_t *protocol,
-+                    void *registration,
-+                    void **interface);
-+
-+  grub_efi_status_t
-+  (*install_multiple_protocol_interfaces) (grub_efi_handle_t *handle, ...);
-+
-+  grub_efi_status_t
-+  (*uninstall_multiple_protocol_interfaces) (grub_efi_handle_t handle, ...);
-+
-+  grub_efi_status_t
-+  (*calculate_crc32) (void *data,
-+                    grub_efi_uintn_t data_size,
-+                    grub_efi_uint32_t *crc32);
-+
-+  void
-+  (*copy_mem) (void *destination, void *source, grub_efi_uintn_t length);
-+
-+  void
-+  (*set_mem) (void *buffer, grub_efi_uintn_t size, grub_efi_uint8_t value);
-+};
-+typedef struct grub_efi_boot_services grub_efi_boot_services_t;
-+
-+struct grub_efi_runtime_services
-+{
-+  grub_efi_table_header_t hdr;
-+
-+  grub_efi_status_t 
-+  (*get_time) (grub_efi_time_t *time,
-+             grub_efi_time_capabilities_t *capabilities);
-+
-+  grub_efi_status_t
-+  (*set_time) (grub_efi_time_t *time);
-+
-+  grub_efi_status_t
-+  (*get_wakeup_time) (grub_efi_boolean_t *enabled,
-+                    grub_efi_boolean_t *pending,
-+                    grub_efi_time_t *time);
-+
-+  grub_efi_status_t
-+  (*set_wakeup_time) (grub_efi_boolean_t enabled,
-+                    grub_efi_time_t *time);
-+
-+  grub_efi_status_t
-+  (*set_virtual_address_map) (grub_efi_uintn_t memory_map_size,
-+                            grub_efi_uintn_t descriptor_size,
-+                            grub_efi_uint32_t descriptor_version,
-+                            grub_efi_memory_descriptor_t *virtual_map);
-+
-+  grub_efi_status_t
-+  (*convert_pointer) (grub_efi_uintn_t debug_disposition, void **address);
-+
-+  grub_efi_status_t
-+  (*get_variable) (grub_efi_char16_t *variable_name,
-+                 grub_efi_guid_t *vendor_guid,
-+                 grub_efi_uint32_t *attributes,
-+                 grub_efi_uintn_t *data_size,
-+                 void *data);
-+
-+  grub_efi_status_t
-+  (*get_next_variable_name) (grub_efi_uintn_t *variable_name_size,
-+                           grub_efi_char16_t *variable_name,
-+                           grub_efi_guid_t *vendor_guid);
-+
-+  grub_efi_status_t
-+  (*set_variable) (grub_efi_char16_t *variable_name,
-+                 grub_efi_guid_t *vendor_guid,
-+                 grub_efi_uint32_t attributes,
-+                 grub_efi_uintn_t data_size,
-+                 void *data);
-+
-+  grub_efi_status_t
-+  (*get_next_high_monotonic_count) (grub_efi_uint32_t *high_count);
-+
-+  void
-+  (*reset_system) (grub_efi_reset_type_t reset_type,
-+                 grub_efi_status_t reset_status,
-+                 grub_efi_uintn_t data_size,
-+                 grub_efi_char16_t *reset_data);
-+};
-+typedef struct grub_efi_runtime_services grub_efi_runtime_services_t;
-+
-+struct grub_efi_configuration_table
-+{
-+  grub_efi_guid_t vendor_guid;
-+  void *vendor_table;
-+};
-+typedef struct grub_efi_configuration_table grub_efi_configuration_table_t;
-+
-+struct grub_efi_simple_input_interface
-+{
-+  grub_efi_status_t
-+  (*reset) (struct grub_efi_simple_input_interface *this,
-+          grub_efi_boolean_t extended_verification);
-+  
-+  grub_efi_status_t
-+  (*read_key_stroke) (struct grub_efi_simple_input_interface *this,
-+                    grub_efi_input_key_t *key);
-+  
-+  grub_efi_event_t wait_for_key;
-+};
-+typedef struct grub_efi_simple_input_interface grub_efi_simple_input_interface_t;
-+
-+struct grub_efi_simple_text_output_interface
-+{
-+  grub_efi_status_t
-+  (*reset) (struct grub_efi_simple_text_output_interface *this,
-+          grub_efi_boolean_t extended_verification);
-+
-+  grub_efi_status_t
-+  (*output_string) (struct grub_efi_simple_text_output_interface *this,
-+                  grub_efi_char16_t *string);
-+
-+  grub_efi_status_t
-+  (*test_string) (struct grub_efi_simple_text_output_interface *this,
-+                grub_efi_char16_t *string);
-+
-+  grub_efi_status_t
-+  (*query_mode) (struct grub_efi_simple_text_output_interface *this,
-+               grub_efi_uintn_t mode_number,
-+               grub_efi_uintn_t *columns,
-+               grub_efi_uintn_t *rows);
-+
-+  grub_efi_status_t 
-+  (*set_mode) (struct grub_efi_simple_text_output_interface *this,
-+             grub_efi_uintn_t mode_number);
-+
-+  grub_efi_status_t
-+  (*set_attributes) (struct grub_efi_simple_text_output_interface *this,
-+                   grub_efi_uintn_t attribute);
-+
-+  grub_efi_status_t
-+  (*clear_screen) (struct grub_efi_simple_text_output_interface *this);
-+
-+  grub_efi_status_t
-+  (*set_cursor_position) (struct grub_efi_simple_text_output_interface *this,
-+                        grub_efi_uintn_t column,
-+                        grub_efi_uintn_t row);
-+
-+  grub_efi_status_t
-+  (*enable_cursor) (struct grub_efi_simple_text_output_interface *this,
-+                  grub_efi_boolean_t visible);
-+  
-+  grub_efi_simple_text_output_mode_t *mode;
-+};
-+typedef struct grub_efi_simple_text_output_interface grub_efi_simple_text_output_interface_t;
-+
-+#define GRUB_EFI_BLACK                0x00
-+#define GRUB_EFI_BLUE         0x01
-+#define GRUB_EFI_GREEN                0x02
-+#define GRUB_EFI_CYAN         0x03
-+#define GRUB_EFI_RED          0x04
-+#define GRUB_EFI_MAGENTA      0x05
-+#define GRUB_EFI_BROWN                0x06
-+#define GRUB_EFI_LIGHTGRAY    0x07
-+#define GRUB_EFI_BRIGHT               0x08
-+#define GRUB_EFI_DARKGRAY     0x08
-+#define GRUB_EFI_LIGHTBLUE    0x09
-+#define GRUB_EFI_LIGHTGREEN   0x0A
-+#define GRUB_EFI_LIGHTCYAN    0x0B
-+#define GRUB_EFI_LIGHTRED     0x0C
-+#define GRUB_EFI_LIGHTMAGENTA 0x0D
-+#define GRUB_EFI_YELLOW               0x0E
-+#define GRUB_EFI_WHITE                0x0F
-+
-+#define GRUB_EFI_BACKGROUND_BLACK     0x00
-+#define GRUB_EFI_BACKGROUND_BLUE      0x10
-+#define GRUB_EFI_BACKGROUND_GREEN     0x20
-+#define GRUB_EFI_BACKGROUND_CYAN      0x30
-+#define GRUB_EFI_BACKGROUND_RED               0x40
-+#define GRUB_EFI_BACKGROUND_MAGENTA   0x50
-+#define GRUB_EFI_BACKGROUND_BROWN     0x60
-+#define GRUB_EFI_BACKGROUND_LIGHTGRAY 0x70
-+
-+#define GRUB_EFI_TEXT_ATTR(fg, bg)    ((fg) | ((bg)))
-+
-+struct grub_efi_system_table
-+{
-+  grub_efi_table_header_t hdr;
-+  grub_efi_char16_t *firmware_vendor;
-+  grub_efi_uint32_t firmware_revision;
-+  grub_efi_handle_t console_in_handler;
-+  grub_efi_simple_input_interface_t *con_in;
-+  grub_efi_handle_t console_out_handler;
-+  grub_efi_simple_text_output_interface_t *con_out;
-+  grub_efi_handle_t standard_error_handle;
-+  grub_efi_simple_text_output_interface_t *std_err;
-+  grub_efi_runtime_services_t *runtime_services;
-+  grub_efi_boot_services_t *boot_services;
-+  grub_efi_uintn_t num_table_entries;
-+  grub_efi_configuration_table_t *configuration_table;
-+};
-+typedef struct grub_efi_system_table  grub_efi_system_table_t;
-+
-+struct grub_efi_loaded_image
-+{
-+  grub_efi_uint32_t revision;
-+  grub_efi_handle_t parent_handle;
-+  grub_efi_system_table_t *system_table;
-+
-+  grub_efi_handle_t device_handle;
-+  grub_efi_device_path_t *file_path;
-+  void *reserved;
-+
-+  grub_efi_uint32_t load_options_size;
-+  void *load_options;
-+
-+  void *image_base;
-+  grub_efi_uint64_t image_size;
-+  grub_efi_memory_type_t image_code_type;
-+  grub_efi_memory_type_t image_data_type;
-+
-+  grub_efi_status_t (*unload) (grub_efi_handle_t image_handle);
-+};
-+typedef struct grub_efi_loaded_image grub_efi_loaded_image_t;
-+
-+struct grub_efi_disk_io
-+{
-+  grub_efi_uint64_t revision;
-+  grub_efi_status_t (*read) (struct grub_efi_disk_io *this,
-+                           grub_efi_uint32_t media_id,
-+                           grub_efi_uint64_t offset,
-+                           grub_efi_uintn_t buffer_size,
-+                           void *buffer);
-+  grub_efi_status_t (*write) (struct grub_efi_disk_io *this,
-+                           grub_efi_uint32_t media_id,
-+                           grub_efi_uint64_t offset,
-+                           grub_efi_uintn_t buffer_size,
-+                           void *buffer);
-+};
-+typedef struct grub_efi_disk_io grub_efi_disk_io_t;
-+
-+struct grub_efi_block_io_media
-+{
-+  grub_efi_uint32_t media_id;
-+  grub_efi_boolean_t removable_media;
-+  grub_efi_boolean_t media_present;
-+  grub_efi_boolean_t logical_partition;
-+  grub_efi_boolean_t read_only;
-+  grub_efi_boolean_t write_caching;
-+  grub_efi_uint8_t pad[3];
-+  grub_efi_uint32_t block_size;
-+  grub_efi_uint32_t io_align;
-+  grub_efi_uint8_t pad2[4];
-+  grub_efi_lba_t last_block;
-+};
-+typedef struct grub_efi_block_io_media grub_efi_block_io_media_t;
-+
-+struct grub_efi_block_io
-+{
-+  grub_efi_uint64_t revision;
-+  grub_efi_block_io_media_t *media;
-+  grub_efi_status_t (*reset) (struct grub_efi_block_io *this,
-+                            grub_efi_boolean_t extended_verification);
-+  grub_efi_status_t (*read_blocks) (struct grub_efi_block_io *this,
-+                                  grub_efi_uint32_t media_id,
-+                                  grub_efi_lba_t lba,
-+                                  grub_efi_uintn_t buffer_size,
-+                                  void *buffer);
-+  grub_efi_status_t (*write_blocks) (struct grub_efi_block_io *this,
-+                                   grub_efi_uint32_t media_id,
-+                                   grub_efi_lba_t lba,
-+                                   grub_efi_uintn_t buffer_size,
-+                                   void *buffer);
-+  grub_efi_status_t (*flush_blocks) (struct grub_efi_block_io *this);
-+};
-+typedef struct grub_efi_block_io grub_efi_block_io_t;
-+
-+#endif /* ! GRUB_EFI_API_HEADER */
-Index: include/grub/efi/chainloader.h
-===================================================================
-RCS file: include/grub/efi/chainloader.h
-diff -N include/grub/efi/chainloader.h
---- /dev/null  1 Jan 1970 00:00:00 -0000
-+++ include/grub/efi/chainloader.h     30 Apr 2006 21:09:37 -0000      1.1
-@@ -0,0 +1,25 @@
-+/*
-+ *  GRUB  --  GRand Unified Bootloader
-+ *  Copyright (C) 2006  Free Software Foundation, Inc.
-+ *
-+ *  This program is free software; you can redistribute it and/or modify
-+ *  it under the terms of the GNU General Public License as published by
-+ *  the Free Software Foundation; either version 2 of the License, or
-+ *  (at your option) any later version.
-+ *
-+ *  This program is distributed in the hope that it will be useful,
-+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+ *  GNU General Public License for more details.
-+ *
-+ *  You should have received a copy of the GNU General Public License
-+ *  along with this program; if not, write to the Free Software
-+ *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-+ */
-+
-+#ifndef GRUB_EFI_CHAINLOADER_HEADER
-+#define GRUB_EFI_CHAINLOADER_HEADER   1
-+
-+void grub_chainloader_cmd (const char *filename);
-+
-+#endif /* ! GRUB_EFI_CHAINLOADER_HEADER */
-Index: include/grub/efi/console.h
-===================================================================
-RCS file: include/grub/efi/console.h
-diff -N include/grub/efi/console.h
---- /dev/null  1 Jan 1970 00:00:00 -0000
-+++ include/grub/efi/console.h 19 Apr 2006 08:59:44 -0000      1.1
-@@ -0,0 +1,45 @@
-+/*
-+ *  GRUB  --  GRand Unified Bootloader
-+ *  Copyright (C) 2002,2005,2006  Free Software Foundation, Inc.
-+ *
-+ *  This program is free software; you can redistribute it and/or modify
-+ *  it under the terms of the GNU General Public License as published by
-+ *  the Free Software Foundation; either version 2 of the License, or
-+ *  (at your option) any later version.
-+ *
-+ *  This program is distributed in the hope that it will be useful,
-+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+ *  GNU General Public License for more details.
-+ *
-+ *  You should have received a copy of the GNU General Public License
-+ *  along with this program; if not, write to the Free Software
-+ *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-+ */
-+
-+#ifndef GRUB_EFI_CONSOLE_HEADER
-+#define GRUB_EFI_CONSOLE_HEADER       1
-+
-+/* Define scan codes.  */
-+#define GRUB_CONSOLE_KEY_LEFT         0x4B00
-+#define GRUB_CONSOLE_KEY_RIGHT                0x4D00
-+#define GRUB_CONSOLE_KEY_UP           0x4800
-+#define GRUB_CONSOLE_KEY_DOWN         0x5000
-+#define GRUB_CONSOLE_KEY_IC           0x5200
-+#define GRUB_CONSOLE_KEY_DC           0x5300
-+#define GRUB_CONSOLE_KEY_BACKSPACE    0x0008
-+#define GRUB_CONSOLE_KEY_HOME         0x4700
-+#define GRUB_CONSOLE_KEY_END          0x4F00
-+#define GRUB_CONSOLE_KEY_NPAGE                0x4900
-+#define GRUB_CONSOLE_KEY_PPAGE                0x5100
-+
-+#include <grub/types.h>
-+#include <grub/symbol.h>
-+
-+/* Initialize the console system.  */
-+void grub_console_init (void);
-+
-+/* Finish the console system.  */
-+void grub_console_fini (void);
-+
-+#endif /* ! GRUB_EFI_CONSOLE_HEADER */
-Index: include/grub/efi/console_control.h
-===================================================================
-RCS file: include/grub/efi/console_control.h
-diff -N include/grub/efi/console_control.h
---- /dev/null  1 Jan 1970 00:00:00 -0000
-+++ include/grub/efi/console_control.h 23 Apr 2006 13:37:36 -0000      1.2
-@@ -0,0 +1,58 @@
-+/* console_control.h - definitions of the console control protocol */
-+/*
-+ *  GRUB  --  GRand Unified Bootloader
-+ *  Copyright (C) 2006  Free Software Foundation, Inc.
-+ *
-+ *  This program is free software; you can redistribute it and/or modify
-+ *  it under the terms of the GNU General Public License as published by
-+ *  the Free Software Foundation; either version 2 of the License, or
-+ *  (at your option) any later version.
-+ *
-+ *  This program is distributed in the hope that it will be useful,
-+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+ *  GNU General Public License for more details.
-+ *
-+ *  You should have received a copy of the GNU General Public License
-+ *  along with this program; if not, write to the Free Software
-+ *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-+ */
-+
-+/* The console control protocol is not a part of the EFI spec,
-+   but defined in Intel's Sample Implementation.  */
-+
-+#ifndef GRUB_EFI_CONSOLE_CONTROL_HEADER
-+#define GRUB_EFI_CONSOLE_CONTROL_HEADER       1
-+
-+#define GRUB_EFI_CONSOLE_CONTROL_GUID \
-+  { 0xf42f7782, 0x12e, 0x4c12, \
-+    { 0x99, 0x56, 0x49, 0xf9, 0x43, 0x4, 0xf7, 0x21 } \
-+  }
-+
-+enum grub_efi_screen_mode
-+  {
-+    GRUB_EFI_SCREEN_TEXT,
-+    GRUB_EFI_SCREEN_GRAPHICS,
-+    GRUB_EFI_SCREEN_TEXT_MAX_VALUE
-+  };
-+typedef enum grub_efi_screen_mode grub_efi_screen_mode_t;
-+
-+struct grub_efi_console_control_protocol
-+{
-+  grub_efi_status_t
-+  (*get_mode) (struct grub_efi_console_control_protocol *this,
-+             grub_efi_screen_mode_t *mode,
-+             grub_efi_boolean_t *uga_exists,
-+             grub_efi_boolean_t *std_in_locked);
-+
-+  grub_efi_status_t
-+  (*set_mode) (struct grub_efi_console_control_protocol *this,
-+             grub_efi_screen_mode_t mode);
-+
-+  grub_efi_status_t
-+  (*lock_std_in) (struct grub_efi_console_control_protocol *this,
-+                grub_efi_char16_t *password);
-+};
-+typedef struct grub_efi_console_control_protocol grub_efi_console_control_protocol_t;
-+
-+#endif /* ! GRUB_EFI_CONSOLE_CONTROL_HEADER */
-Index: include/grub/efi/disk.h
-===================================================================
-RCS file: include/grub/efi/disk.h
-diff -N include/grub/efi/disk.h
---- /dev/null  1 Jan 1970 00:00:00 -0000
-+++ include/grub/efi/disk.h    25 Apr 2006 20:08:31 -0000      1.2
-@@ -0,0 +1,34 @@
-+/*
-+ *  GRUB  --  GRand Unified Bootloader
-+ *  Copyright (C) 2006  Free Software Foundation, Inc.
-+ *
-+ *  GRUB is free software; you can redistribute it and/or modify
-+ *  it under the terms of the GNU General Public License as published by
-+ *  the Free Software Foundation; either version 2 of the License, or
-+ *  (at your option) any later version.
-+ *
-+ *  This program is distributed in the hope that it will be useful,
-+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+ *  GNU General Public License for more details.
-+ *
-+ *  You should have received a copy of the GNU General Public License
-+ *  along with GRUB; if not, write to the Free Software
-+ *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-+ */
-+
-+#ifndef GRUB_EFI_DISK_HEADER
-+#define GRUB_EFI_DISK_HEADER  1
-+
-+#include <grub/efi/api.h>
-+#include <grub/symbol.h>
-+#include <grub/disk.h>
-+
-+grub_efi_handle_t
-+EXPORT_FUNC(grub_efidisk_get_device_handle) (grub_disk_t disk);
-+char *EXPORT_FUNC(grub_efidisk_get_device_name) (grub_efi_handle_t *handle);
-+
-+void grub_efidisk_init (void);
-+void grub_efidisk_fini (void);
-+
-+#endif /* ! GRUB_EFI_DISK_HEADER */
-Index: include/grub/efi/efi.h
-===================================================================
-RCS file: include/grub/efi/efi.h
-diff -N include/grub/efi/efi.h
---- /dev/null  1 Jan 1970 00:00:00 -0000
-+++ include/grub/efi/efi.h     27 May 2006 21:09:25 -0000      1.7
-@@ -0,0 +1,69 @@
-+/* efi.h - declare variables and functions for EFI support */
-+/*
-+ *  GRUB  --  GRand Unified Bootloader
-+ *  Copyright (C) 2006  Free Software Foundation, Inc.
-+ *
-+ *  This program is free software; you can redistribute it and/or modify
-+ *  it under the terms of the GNU General Public License as published by
-+ *  the Free Software Foundation; either version 2 of the License, or
-+ *  (at your option) any later version.
-+ *
-+ *  This program is distributed in the hope that it will be useful,
-+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+ *  GNU General Public License for more details.
-+ *
-+ *  You should have received a copy of the GNU General Public License
-+ *  along with this program; if not, write to the Free Software
-+ *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-+ */
-+
-+#ifndef GRUB_EFI_EFI_HEADER
-+#define GRUB_EFI_EFI_HEADER   1
-+
-+#include <grub/types.h>
-+#include <grub/dl.h>
-+#include <grub/efi/api.h>
-+
-+/* Functions.  */
-+void *EXPORT_FUNC(grub_efi_locate_protocol) (grub_efi_guid_t *protocol,
-+                                           void *registration);
-+grub_efi_handle_t *
-+EXPORT_FUNC(grub_efi_locate_handle) (grub_efi_locate_search_type_t search_type,
-+                                   grub_efi_guid_t *protocol,
-+                                   void *search_key,
-+                                   grub_efi_uintn_t *num_handles);
-+void *EXPORT_FUNC(grub_efi_open_protocol) (grub_efi_handle_t handle,
-+                                         grub_efi_guid_t *protocol,
-+                                         grub_efi_uint32_t attributes);
-+int EXPORT_FUNC(grub_efi_set_text_mode) (int on);
-+void EXPORT_FUNC(grub_efi_stall) (grub_efi_uintn_t microseconds);
-+void *
-+EXPORT_FUNC(grub_efi_allocate_pages) (grub_efi_physical_address_t address,
-+                                    grub_efi_uintn_t pages);
-+void EXPORT_FUNC(grub_efi_free_pages) (grub_efi_physical_address_t address,
-+                                     grub_efi_uintn_t pages);
-+int
-+EXPORT_FUNC(grub_efi_get_memory_map) (grub_efi_uintn_t *memory_map_size,
-+                                    grub_efi_memory_descriptor_t *memory_map,
-+                                    grub_efi_uintn_t *map_key,
-+                                    grub_efi_uintn_t *descriptor_size,
-+                                    grub_efi_uint32_t *descriptor_version);
-+grub_efi_loaded_image_t *EXPORT_FUNC(grub_efi_get_loaded_image) (grub_efi_handle_t image_handle);
-+void EXPORT_FUNC(grub_efi_print_device_path) (grub_efi_device_path_t *dp);
-+char *EXPORT_FUNC(grub_efi_get_filename) (grub_efi_device_path_t *dp);
-+grub_efi_device_path_t *
-+EXPORT_FUNC(grub_efi_get_device_path) (grub_efi_handle_t handle);
-+int EXPORT_FUNC(grub_efi_exit_boot_services) (grub_efi_uintn_t map_key);
-+
-+void grub_efi_mm_init (void);
-+void grub_efi_mm_fini (void);
-+void grub_efi_init (void);
-+void grub_efi_fini (void);
-+void grub_efi_set_prefix (void);
-+
-+/* Variables.  */
-+extern grub_efi_system_table_t *EXPORT_VAR(grub_efi_system_table);
-+extern grub_efi_handle_t EXPORT_VAR(grub_efi_image_handle);
-+
-+#endif /* ! GRUB_EFI_EFI_HEADER */
-Index: include/grub/efi/pe32.h
-===================================================================
-RCS file: include/grub/efi/pe32.h
-diff -N include/grub/efi/pe32.h
---- /dev/null  1 Jan 1970 00:00:00 -0000
-+++ include/grub/efi/pe32.h    18 Apr 2006 06:18:15 -0000      1.1
-@@ -0,0 +1,199 @@
-+/*
-+ *  GRUB  --  GRand Unified Bootloader
-+ *  Copyright (C) 2006  Free Software Foundation, Inc.
-+ *
-+ *  This program is free software; you can redistribute it and/or modify
-+ *  it under the terms of the GNU General Public License as published by
-+ *  the Free Software Foundation; either version 2 of the License, or
-+ *  (at your option) any later version.
-+ *
-+ *  This program is distributed in the hope that it will be useful,
-+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+ *  GNU General Public License for more details.
-+ *
-+ *  You should have received a copy of the GNU General Public License
-+ *  along with this program; if not, write to the Free Software
-+ *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-+ */
-+
-+#ifndef GRUB_EFI_PE32_HEADER
-+#define GRUB_EFI_PE32_HEADER  1
-+
-+#include <grub/types.h>
-+
-+/* The MSDOS compatibility stub. This was copied from the output of
-+   objcopy, and it is not necessary to care about what this means.  */
-+#define GRUB_PE32_MSDOS_STUB \
-+  { \
-+    0x4d, 0x5a, 0x90, 0x00, 0x03, 0x00, 0x00, 0x00, \
-+    0x04, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, \
-+    0xb8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
-+    0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
-+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
-+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
-+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
-+    0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, \
-+    0x0e, 0x1f, 0xba, 0x0e, 0x00, 0xb4, 0x09, 0xcd, \
-+    0x21, 0xb8, 0x01, 0x4c, 0xcd, 0x21, 0x54, 0x68, \
-+    0x69, 0x73, 0x20, 0x70, 0x72, 0x6f, 0x67, 0x72, \
-+    0x61, 0x6d, 0x20, 0x63, 0x61, 0x6e, 0x6e, 0x6f, \
-+    0x74, 0x20, 0x62, 0x65, 0x20, 0x72, 0x75, 0x6e, \
-+    0x20, 0x69, 0x6e, 0x20, 0x44, 0x4f, 0x53, 0x20, \
-+    0x6d, 0x6f, 0x64, 0x65, 0x2e, 0x0d, 0x0d, 0x0a, \
-+    0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00  \
-+  }
-+
-+#define GRUB_PE32_MSDOS_STUB_SIZE     0x80
-+
-+/* According to the spec, the minimal alignment is 512 bytes...
-+   But some examples (such as EFI drivers in the Intel
-+   Sample Implementation) use 32 bytes (0x20) instead, and it seems
-+   to be working. For now, GRUB uses 512 bytes for safety.  */
-+#define GRUB_PE32_SECTION_ALIGNMENT   0x200
-+#define GRUB_PE32_FILE_ALIGNMENT      GRUB_PE32_SECTION_ALIGNMENT
-+
-+struct grub_pe32_coff_header
-+{
-+  grub_uint16_t machine;
-+  grub_uint16_t num_sections;
-+  grub_uint32_t time;
-+  grub_uint32_t symtab_offset;
-+  grub_uint32_t num_symbols;
-+  grub_uint16_t optional_header_size;
-+  grub_uint16_t characteristics;
-+};
-+
-+#define GRUB_PE32_MACHINE_I386                0x14c
-+
-+#define GRUB_PE32_RELOCS_STRIPPED             0x0001
-+#define GRUB_PE32_EXECUTABLE_IMAGE            0x0002
-+#define GRUB_PE32_LINE_NUMS_STRIPPED          0x0004
-+#define GRUB_PE32_LOCAL_SYMS_STRIPPED         0x0008
-+#define GRUB_PE32_AGGRESSIVE_WS_TRIM          0x0010
-+#define GRUB_PE32_LARGE_ADDRESS_AWARE         0x0020
-+#define GRUB_PE32_16BIT_MACHINE                       0x0040
-+#define GRUB_PE32_BYTES_REVERSED_LO           0x0080
-+#define GRUB_PE32_32BIT_MACHINE                       0x0100
-+#define GRUB_PE32_DEBUG_STRIPPED              0x0200
-+#define GRUB_PE32_REMOVABLE_RUN_FROM_SWAP     0x0400
-+#define GRUB_PE32_SYSTEM                      0x1000
-+#define GRUB_PE32_DLL                         0x2000
-+#define GRUB_PE32_UP_SYSTEM_ONLY              0x4000
-+#define GRUB_PE32_BYTES_REVERSED_HI           0x8000
-+
-+struct grub_pe32_data_directory
-+{
-+  grub_uint32_t rva;
-+  grub_uint32_t size;
-+};
-+
-+struct grub_pe32_optional_header
-+{
-+  grub_uint16_t magic;
-+  grub_uint8_t major_linker_version;
-+  grub_uint8_t minor_linker_version;
-+  grub_uint32_t code_size;
-+  grub_uint32_t data_size;
-+  grub_uint32_t bss_size;
-+  grub_uint32_t entry_addr;
-+  grub_uint32_t code_base;
-+  
-+  grub_uint32_t data_base;
-+
-+  grub_uint32_t image_base;
-+  grub_uint32_t section_alignment;
-+  grub_uint32_t file_alignment;
-+  grub_uint16_t major_os_version;
-+  grub_uint16_t minor_os_version;
-+  grub_uint16_t major_image_version;
-+  grub_uint16_t minor_image_version;
-+  grub_uint16_t major_subsystem_version;
-+  grub_uint16_t minor_subsystem_version;
-+  grub_uint32_t reserved;
-+  grub_uint32_t image_size;
-+  grub_uint32_t header_size;
-+  grub_uint32_t checksum;
-+  grub_uint16_t subsystem;
-+  grub_uint16_t dll_characteristics;
-+  grub_uint32_t stack_reserve_size;
-+  grub_uint32_t stack_commit_size;
-+  grub_uint32_t heap_reserve_size;
-+  grub_uint32_t heap_commit_size;
-+  grub_uint32_t loader_flags;
-+  grub_uint32_t num_data_directories;
-+  
-+  /* Data directories.  */
-+  struct grub_pe32_data_directory export_table;
-+  struct grub_pe32_data_directory import_table;
-+  struct grub_pe32_data_directory resource_table;
-+  struct grub_pe32_data_directory exception_table;
-+  struct grub_pe32_data_directory certificate_table;
-+  struct grub_pe32_data_directory base_relocation_table;
-+  struct grub_pe32_data_directory debug;
-+  struct grub_pe32_data_directory architecture;
-+  struct grub_pe32_data_directory global_ptr;
-+  struct grub_pe32_data_directory tls_table;
-+  struct grub_pe32_data_directory load_config_table;
-+  struct grub_pe32_data_directory bound_import;
-+  struct grub_pe32_data_directory iat;
-+  struct grub_pe32_data_directory delay_import_descriptor;
-+  struct grub_pe32_data_directory com_runtime_header;
-+  struct grub_pe32_data_directory reserved_entry;
-+};
-+
-+#define GRUB_PE32_PE32_MAGIC  0x10b
-+
-+#define GRUB_PE32_SUBSYSTEM_EFI_APPLICATION   10
-+
-+#define GRUB_PE32_NUM_DATA_DIRECTORIES        16
-+
-+struct grub_pe32_section_table
-+{
-+  char name[8];
-+  grub_uint32_t virtual_size;
-+  grub_uint32_t virtual_address;
-+  grub_uint32_t raw_data_size;
-+  grub_uint32_t raw_data_offset;
-+  grub_uint32_t relocations_offset;
-+  grub_uint32_t line_numbers_offset;
-+  grub_uint16_t num_relocations;
-+  grub_uint16_t num_line_numbers;
-+  grub_uint32_t characteristics;
-+};
-+
-+#define GRUB_PE32_SCN_CNT_CODE                        0x00000020
-+#define GRUB_PE32_SCN_CNT_INITIALIZED_DATA    0x00000040
-+#define GRUB_PE32_SCN_MEM_DISCARDABLE         0x02000000
-+#define GRUB_PE32_SCN_MEM_EXECUTE             0x20000000
-+#define GRUB_PE32_SCN_MEM_READ                        0x40000000
-+#define GRUB_PE32_SCN_MEM_WRITE                       0x80000000
-+
-+struct grub_pe32_header
-+{
-+  /* This should be filled in with GRUB_PE32_MSDOS_STUB.  */
-+  grub_uint8_t msdos_stub[GRUB_PE32_MSDOS_STUB_SIZE];
-+  
-+  /* This is always PE\0\0.  */
-+  char signature[4];
-+
-+  /* The COFF file header.  */
-+  struct grub_pe32_coff_header coff_header;
-+
-+  /* The Optional header.  */
-+  struct grub_pe32_optional_header optional_header;
-+};
-+
-+struct grub_pe32_fixup_block
-+{
-+  grub_uint32_t page_rva;
-+  grub_uint32_t block_size;
-+  grub_uint16_t entries[0];
-+};
-+
-+#define GRUB_PE32_FIXUP_ENTRY(type, offset)   (((type) << 12) | (offset))
-+
-+#define GRUB_PE32_REL_BASED_ABSOLUTE  0
-+#define GRUB_PE32_REL_BASED_HIGHLOW   3
-+
-+#endif /* ! GRUB_EFI_PE32_HEADER */
-Index: include/grub/efi/time.h
-===================================================================
-RCS file: include/grub/efi/time.h
-diff -N include/grub/efi/time.h
---- /dev/null  1 Jan 1970 00:00:00 -0000
-+++ include/grub/efi/time.h    19 Apr 2006 08:59:44 -0000      1.1
-@@ -0,0 +1,32 @@
-+/*
-+ *  GRUB  --  GRand Unified Bootloader
-+ *  Copyright (C) 2006  Free Software Foundation, Inc.
-+ *
-+ *  This program is free software; you can redistribute it and/or modify
-+ *  it under the terms of the GNU General Public License as published by
-+ *  the Free Software Foundation; either version 2 of the License, or
-+ *  (at your option) any later version.
-+ *
-+ *  This program is distributed in the hope that it will be useful,
-+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+ *  GNU General Public License for more details.
-+ *
-+ *  You should have received a copy of the GNU General Public License
-+ *  along with this program; if not, write to the Free Software
-+ *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-+ *  MA  02110-1301, USA.
-+ */
-+
-+#ifndef GRUB_EFI_TIME_HEADER
-+#define GRUB_EFI_TIME_HEADER  1
-+
-+#include <grub/symbol.h>
-+
-+/* This is destined to overflow when one minute passes by.  */
-+#define GRUB_TICKS_PER_SECOND ((1UL << 31) / 60 / 60 * 2)
-+
-+/* Return the real time in ticks.  */
-+grub_uint32_t EXPORT_FUNC (grub_get_rtc) (void);
-+
-+#endif /* ! GRUB_EFI_TIME_HEADER */
-Index: include/grub/i386/linux.h
-===================================================================
-RCS file: include/grub/i386/linux.h
-diff -N include/grub/i386/linux.h
---- /dev/null  1 Jan 1970 00:00:00 -0000
-+++ include/grub/i386/linux.h  27 May 2006 21:09:25 -0000      1.2
-@@ -0,0 +1,181 @@
-+/*
-+ *  GRUB  --  GRand Unified Bootloader
-+ *  Copyright (C) 1999,2000,2001,2002,2003,2004  Free Software Foundation, Inc.
-+ *
-+ *  This program is free software; you can redistribute it and/or modify
-+ *  it under the terms of the GNU General Public License as published by
-+ *  the Free Software Foundation; either version 2 of the License, or
-+ *  (at your option) any later version.
-+ *
-+ *  This program is distributed in the hope that it will be useful,
-+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+ *  GNU General Public License for more details.
-+ *
-+ *  You should have received a copy of the GNU General Public License
-+ *  along with this program; if not, write to the Free Software
-+ *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-+ */
-+
-+#ifndef GRUB_LINUX_MACHINE_HEADER
-+#define GRUB_LINUX_MACHINE_HEADER     1
-+
-+#define GRUB_LINUX_MAGIC_SIGNATURE    0x53726448      /* "HdrS" */
-+#define GRUB_LINUX_DEFAULT_SETUP_SECTS        4
-+#define GRUB_LINUX_FLAG_CAN_USE_HEAP  0x80
-+#define GRUB_LINUX_INITRD_MAX_ADDRESS 0x37FFFFFF
-+#define GRUB_LINUX_MAX_SETUP_SECTS    64
-+#define GRUB_LINUX_BOOT_LOADER_TYPE   0x72
-+#define GRUB_LINUX_HEAP_END_OFFSET    (0x9000 - 0x200)
-+
-+#define GRUB_LINUX_BZIMAGE_ADDR               0x100000
-+#define GRUB_LINUX_ZIMAGE_ADDR                0x10000
-+#define GRUB_LINUX_OLD_REAL_MODE_ADDR 0x90000
-+#define GRUB_LINUX_SETUP_STACK                0x9000
-+
-+#define GRUB_LINUX_FLAG_BIG_KERNEL    0x1
-+
-+/* Linux's video mode selection support. Actually I hate it!  */
-+#define GRUB_LINUX_VID_MODE_NORMAL    0xFFFF
-+#define GRUB_LINUX_VID_MODE_EXTENDED  0xFFFE
-+#define GRUB_LINUX_VID_MODE_ASK               0xFFFD
-+
-+#define GRUB_LINUX_CL_OFFSET          0x9000
-+#define GRUB_LINUX_CL_END_OFFSET      0x90FF
-+#define GRUB_LINUX_SETUP_MOVE_SIZE    0x9100
-+#define GRUB_LINUX_CL_MAGIC           0xA33F
-+
-+#define GRUB_LINUX_EFI_SIGNATURE      \
-+  ('E' << 24 | 'F' << 16 | 'I' << 8 | 'L')
-+
-+#ifndef ASM_FILE
-+
-+/* For the Linux/i386 boot protocol version 2.03.  */
-+struct linux_kernel_header
-+{ 
-+  grub_uint8_t code1[0x0020];
-+  grub_uint16_t cl_magic;             /* Magic number 0xA33F */
-+  grub_uint16_t cl_offset;            /* The offset of command line */
-+  grub_uint8_t code2[0x01F1 - 0x0020 - 2 - 2];
-+  grub_uint8_t setup_sects;           /* The size of the setup in sectors */
-+  grub_uint16_t root_flags;           /* If the root is mounted readonly */
-+  grub_uint16_t syssize;              /* obsolete */
-+  grub_uint16_t swap_dev;             /* obsolete */
-+  grub_uint16_t ram_size;             /* obsolete */
-+  grub_uint16_t vid_mode;             /* Video mode control */
-+  grub_uint16_t root_dev;             /* Default root device number */
-+  grub_uint16_t boot_flag;            /* 0xAA55 magic number */
-+  grub_uint16_t jump;                 /* Jump instruction */
-+  grub_uint32_t header;                       /* Magic signature "HdrS" */
-+  grub_uint16_t version;              /* Boot protocol version supported */
-+  grub_uint32_t realmode_swtch;               /* Boot loader hook */
-+  grub_uint16_t start_sys;            /* The load-low segment (obsolete) */
-+  grub_uint16_t kernel_version;               /* Points to kernel version string */
-+  grub_uint8_t type_of_loader;                /* Boot loader identifier */
-+  grub_uint8_t loadflags;             /* Boot protocol option flags */
-+  grub_uint16_t setup_move_size;      /* Move to high memory size */
-+  grub_uint32_t code32_start;         /* Boot loader hook */
-+  grub_uint32_t ramdisk_image;                /* initrd load address */
-+  grub_uint32_t ramdisk_size;         /* initrd size */
-+  grub_uint32_t bootsect_kludge;      /* obsolete */
-+  grub_uint16_t heap_end_ptr;         /* Free memory after setup end */
-+  grub_uint16_t pad1;                 /* Unused */
-+  char *cmd_line_ptr;                 /* Points to the kernel command line */
-+  grub_uint32_t initrd_addr_max;        /* Highest address for initrd */
-+} __attribute__ ((packed));
-+
-+/* Boot parameters for Linux based on 2.6.12. This is used by the setup
-+   sectors of Linux, and must be simulated by GRUB on EFI, because
-+   the setup sectors depend on BIOS.  */
-+struct linux_kernel_params
-+{
-+  grub_uint8_t video_cursor_x;                /* 0 */
-+  grub_uint8_t video_cursor_y;
-+
-+  grub_uint16_t ext_mem;              /* 2 */
-+  
-+  grub_uint16_t video_page;           /* 4 */
-+  grub_uint8_t video_mode;            /* 6 */
-+  grub_uint8_t video_width;           /* 7 */
-+  
-+  grub_uint8_t padding1[0xa - 0x8];
-+  
-+  grub_uint16_t video_ega_bx;         /* a */
-+  
-+  grub_uint8_t padding2[0xe - 0xc];
-+  
-+  grub_uint8_t video_height;          /* e */
-+  grub_uint8_t have_vga;              /* f */
-+  grub_uint16_t font_size;            /* 10 */
-+  
-+  grub_uint16_t lfb_width;            /* 12 */
-+  grub_uint16_t lfb_height;           /* 14 */
-+  grub_uint16_t lfb_depth;            /* 16 */
-+  grub_uint32_t lfb_base;             /* 18 */
-+  grub_uint32_t lfb_size;             /* 1c */
-+
-+  grub_uint16_t cl_magic;             /* 20 */
-+  grub_uint16_t cl_offset;
-+
-+  grub_uint16_t lfb_line_len;         /* 24 */
-+  grub_uint8_t red_mask_size;         /* 26 */
-+  grub_uint8_t red_field_pos;
-+  grub_uint8_t green_mask_size;
-+  grub_uint8_t green_field_pos;
-+  grub_uint8_t blue_mask_size;
-+  grub_uint8_t blue_field_pos;
-+  grub_uint8_t reserved_mask_size;
-+  grub_uint8_t reserved_field_pos;
-+  grub_uint16_t vesapm_segment;               /* 2e */
-+  grub_uint16_t vesapm_offset;                /* 30 */
-+  grub_uint16_t lfb_pages;            /* 32 */
-+  grub_uint16_t vesa_attrib;          /* 34 */
-+
-+  grub_uint8_t padding3[0x40 - 0x36];
-+
-+  grub_uint16_t apm_version;          /* 40 */
-+  grub_uint16_t apm_code_segment;     /* 42 */
-+  grub_uint32_t apm_entry;            /* 44 */
-+  grub_uint16_t apm_16bit_code_segment;       /* 48 */
-+  grub_uint16_t apm_data_segment;     /* 4a */
-+  grub_uint16_t apm_flags;            /* 4c */
-+  grub_uint32_t apm_code_len;         /* 4e */
-+  grub_uint16_t apm_data_len;         /* 52 */
-+  
-+  grub_uint8_t padding4[0x60 - 0x54];
-+  
-+  grub_uint32_t ist_signature;                /* 60 */
-+  grub_uint32_t ist_command;          /* 64 */
-+  grub_uint32_t ist_event;            /* 68 */
-+  grub_uint32_t ist_perf_level;               /* 6c */
-+
-+  grub_uint8_t padding5[0x80 - 0x70];
-+  
-+  grub_uint8_t hd0_drive_info[0x10];  /* 80 */
-+  grub_uint8_t hd1_drive_info[0x10];  /* 90 */
-+  grub_uint16_t rom_config_len;               /* a0 */
-+
-+  grub_uint8_t padding6[0x1c0 - 0xa2];
-+  
-+  grub_uint32_t efi_signature;                /* 1c0 */
-+  grub_uint32_t efi_system_table;     /* 1c4 */
-+  grub_uint32_t efi_mem_desc_size;    /* 1c8 */
-+  grub_uint32_t efi_mem_desc_version; /* 1cc */
-+  grub_uint32_t efi_mmap;             /* 1d0 */
-+  grub_uint32_t efi_mmap_size;                /* 1d4 */
-+  
-+  grub_uint8_t padding7[0x1e0 - 0x1d8];
-+  
-+  grub_uint32_t alt_mem;              /* 1e0 */
-+  
-+  grub_uint8_t padding8[0x1e8 - 0x1e4];
-+  
-+  grub_uint32_t mmap_size;            /* 1e8 */
-+
-+  grub_uint8_t padding9[0x1ff - 0x1ec];
-+  
-+  grub_uint8_t ps_mouse;              /* 1ff */
-+} __attribute__ ((packed));
-+#endif /* ! ASM_FILE */
-+
-+#endif /* ! GRUB_LINUX_MACHINE_HEADER */
-Index: include/grub/i386/types.h
-===================================================================
-RCS file: /cvsroot/grub/grub2/include/grub/i386/types.h,v
-retrieving revision 1.3
-retrieving revision 1.4
-diff -u -r1.3 -r1.4
---- include/grub/i386/types.h  4 Apr 2004 13:46:01 -0000       1.3
-+++ include/grub/i386/types.h  28 May 2006 23:01:43 -0000      1.4
-@@ -1,6 +1,6 @@
- /*
-  *  GRUB  --  GRand Unified Bootloader
-- *  Copyright (C) 2002  Free Software Foundation, Inc.
-+ *  Copyright (C) 2002,2006  Free Software Foundation, Inc.
-  *
-  *  GRUB is free software; you can redistribute it and/or modify
-  *  it under the terms of the GNU General Public License as published by
-@@ -21,12 +21,12 @@
- #define GRUB_TYPES_CPU_HEADER 1
- /* The size of void *.  */
--#define GRUB_HOST_SIZEOF_VOID_P       4
-+#define GRUB_TARGET_SIZEOF_VOID_P     4
- /* The size of long.  */
--#define GRUB_HOST_SIZEOF_LONG 4
-+#define GRUB_TARGET_SIZEOF_LONG               4
- /* i386 is little-endian.  */
--#undef GRUB_HOST_WORDS_BIGENDIAN
-+#undef GRUB_TARGET_WORDS_BIGENDIAN
- #endif /* ! GRUB_TYPES_CPU_HEADER */
-Index: include/grub/i386/efi/kernel.h
-===================================================================
-RCS file: include/grub/i386/efi/kernel.h
-diff -N include/grub/i386/efi/kernel.h
---- /dev/null  1 Jan 1970 00:00:00 -0000
-+++ include/grub/i386/efi/kernel.h     19 Apr 2006 08:59:44 -0000      1.1
-@@ -0,0 +1,28 @@
-+/*
-+ *  GRUB  --  GRand Unified Bootloader
-+ *  Copyright (C) 2002,2003  Free Software Foundation, Inc.
-+ *
-+ *  This program is free software; you can redistribute it and/or modify
-+ *  it under the terms of the GNU General Public License as published by
-+ *  the Free Software Foundation; either version 2 of the License, or
-+ *  (at your option) any later version.
-+ *
-+ *  This program is distributed in the hope that it will be useful,
-+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+ *  GNU General Public License for more details.
-+ *
-+ *  You should have received a copy of the GNU General Public License
-+ *  along with this program; if not, write to the Free Software
-+ *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-+ */
-+
-+#ifndef GRUB_MACHINE_KERNEL_HEADER
-+#define GRUB_MACHINE_KERNEL_HEADER   1
-+
-+/* The prefix which points to the directory where GRUB modules and its
-+   configuration file are located.  */
-+extern char grub_prefix[];
-+
-+#endif /* ! GRUB_MACHINE_KERNEL_HEADER */
-+
-Index: include/grub/i386/efi/loader.h
-===================================================================
-RCS file: include/grub/i386/efi/loader.h
-diff -N include/grub/i386/efi/loader.h
---- /dev/null  1 Jan 1970 00:00:00 -0000
-+++ include/grub/i386/efi/loader.h     28 May 2006 03:20:18 -0000      1.1
-@@ -0,0 +1,28 @@
-+/*
-+ *  GRUB  --  GRand Unified Bootloader
-+ *  Copyright (C) 2002,2003,2004,2006  Free Software Foundation, Inc.
-+ *
-+ *  This program is free software; you can redistribute it and/or modify
-+ *  it under the terms of the GNU General Public License as published by
-+ *  the Free Software Foundation; either version 2 of the License, or
-+ *  (at your option) any later version.
-+ *
-+ *  This program is distributed in the hope that it will be useful,
-+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+ *  GNU General Public License for more details.
-+ *
-+ *  You should have received a copy of the GNU General Public License
-+ *  along with this program; if not, write to the Free Software
-+ *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-+ */
-+
-+#ifndef GRUB_LOADER_MACHINE_HEADER
-+#define GRUB_LOADER_MACHINE_HEADER    1
-+
-+/* It is necessary to export these functions, because normal mode commands
-+   reuse rescue mode commands.  */
-+void grub_rescue_cmd_linux (int argc, char *argv[]);
-+void grub_rescue_cmd_initrd (int argc, char *argv[]);
-+
-+#endif /* ! GRUB_LOADER_MACHINE_HEADER */
-Index: include/grub/i386/efi/time.h
-===================================================================
-RCS file: include/grub/i386/efi/time.h
-diff -N include/grub/i386/efi/time.h
---- /dev/null  1 Jan 1970 00:00:00 -0000
-+++ include/grub/i386/efi/time.h       19 Apr 2006 08:59:44 -0000      1.2
-@@ -0,0 +1,26 @@
-+/*
-+ *  GRUB  --  GRand Unified Bootloader
-+ *  Copyright (C) 2006  Free Software Foundation, Inc.
-+ *
-+ *  This program is free software; you can redistribute it and/or modify
-+ *  it under the terms of the GNU General Public License as published by
-+ *  the Free Software Foundation; either version 2 of the License, or
-+ *  (at your option) any later version.
-+ *
-+ *  This program is distributed in the hope that it will be useful,
-+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+ *  GNU General Public License for more details.
-+ *
-+ *  You should have received a copy of the GNU General Public License
-+ *  along with this program; if not, write to the Free Software
-+ *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-+ *  MA  02110-1301, USA.
-+ */
-+
-+#ifndef GRUB_MACHINE_TIME_HEADER
-+#define GRUB_MACHINE_TIME_HEADER      1
-+
-+#include <grub/efi/time.h>
-+
-+#endif /* ! GRUB_MACHINE_TIME_HEADER */
-Index: include/grub/i386/pc/boot.h
-===================================================================
-RCS file: /cvsroot/grub/grub2/include/grub/i386/pc/boot.h,v
-retrieving revision 1.6
-retrieving revision 1.7
-diff -u -r1.6 -r1.7
---- include/grub/i386/pc/boot.h        25 Dec 2005 19:40:31 -0000      1.6
-+++ include/grub/i386/pc/boot.h        4 Jun 2006 15:56:54 -0000       1.7
-@@ -1,6 +1,6 @@
- /*
-  *  GRUB  --  GRand Unified Bootloader
-- *  Copyright (C) 1999,2000,2002,2005   Free Software Foundation, Inc.
-+ *  Copyright (C) 1999,2000,2002,2005,2006   Free Software Foundation, Inc.
-  *
-  *  This program is free software; you can redistribute it and/or modify
-  *  it under the terms of the GNU General Public License as published by
-@@ -33,22 +33,19 @@
- #define GRUB_BOOT_MACHINE_VER_MAJ     0x3e
- /* The offset of BOOT_DRIVE.  */
--#define GRUB_BOOT_MACHINE_BOOT_DRIVE  0x40
--
--/* The offset of FORCE_LBA.  */
--#define GRUB_BOOT_MACHINE_FORCE_LBA   0x41
-+#define GRUB_BOOT_MACHINE_BOOT_DRIVE  0x4c
- /* The offset of KERNEL_ADDRESS.  */
--#define GRUB_BOOT_MACHINE_KERNEL_ADDRESS      0x42
-+#define GRUB_BOOT_MACHINE_KERNEL_ADDRESS      0x40
- /* The offset of KERNEL_SECTOR.  */
- #define GRUB_BOOT_MACHINE_KERNEL_SECTOR       0x44
- /* The offset of KERNEL_SEGMENT.  */
--#define GRUB_BOOT_MACHINE_KERNEL_SEGMENT      0x48
-+#define GRUB_BOOT_MACHINE_KERNEL_SEGMENT      0x42
- /* The offset of BOOT_DRIVE_CHECK.  */
--#define GRUB_BOOT_MACHINE_DRIVE_CHECK 0x4b
-+#define GRUB_BOOT_MACHINE_DRIVE_CHECK 0x4e
- /* The offset of a magic number used by Windows NT.  */
- #define GRUB_BOOT_MACHINE_WINDOWS_NT_MAGIC    0x1b8
-@@ -77,6 +74,6 @@
- #define GRUB_BOOT_MACHINE_KERNEL_ADDR (GRUB_BOOT_MACHINE_KERNEL_SEG << 4)
- /* The size of a block list used in the kernel startup code.  */
--#define GRUB_BOOT_MACHINE_LIST_SIZE   8
-+#define GRUB_BOOT_MACHINE_LIST_SIZE   12
- #endif /* ! BOOT_MACHINE_HEADER */
-Index: include/grub/i386/pc/linux.h
-===================================================================
-RCS file: include/grub/i386/pc/linux.h
-diff -N include/grub/i386/pc/linux.h
---- include/grub/i386/pc/linux.h       4 Apr 2004 13:46:01 -0000       1.4
-+++ /dev/null  1 Jan 1970 00:00:00 -0000
-@@ -1,86 +0,0 @@
--/*
-- *  GRUB  --  GRand Unified Bootloader
-- *  Copyright (C) 1999,2000,2001,2002,2003,2004  Free Software Foundation, Inc.
-- *
-- *  This program is free software; you can redistribute it and/or modify
-- *  it under the terms of the GNU General Public License as published by
-- *  the Free Software Foundation; either version 2 of the License, or
-- *  (at your option) any later version.
-- *
-- *  This program is distributed in the hope that it will be useful,
-- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
-- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-- *  GNU General Public License for more details.
-- *
-- *  You should have received a copy of the GNU General Public License
-- *  along with this program; if not, write to the Free Software
-- *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-- */
--
--#ifndef GRUB_LINUX_MACHINE_HEADER
--#define GRUB_LINUX_MACHINE_HEADER     1
--
--#define GRUB_LINUX_MAGIC_SIGNATURE    0x53726448      /* "HdrS" */
--#define GRUB_LINUX_DEFAULT_SETUP_SECTS        4
--#define GRUB_LINUX_FLAG_CAN_USE_HEAP  0x80
--#define GRUB_LINUX_INITRD_MAX_ADDRESS 0x37FFFFFF
--#define GRUB_LINUX_MAX_SETUP_SECTS    64
--#define GRUB_LINUX_BOOT_LOADER_TYPE   0x72
--#define GRUB_LINUX_HEAP_END_OFFSET    (0x9000 - 0x200)
--
--#define GRUB_LINUX_BZIMAGE_ADDR               0x100000
--#define GRUB_LINUX_ZIMAGE_ADDR                0x10000
--#define GRUB_LINUX_OLD_REAL_MODE_ADDR 0x90000
--#define GRUB_LINUX_SETUP_STACK                0x9000
--
--#define GRUB_LINUX_FLAG_BIG_KERNEL    0x1
--
--/* Linux's video mode selection support. Actually I hate it!  */
--#define GRUB_LINUX_VID_MODE_NORMAL    0xFFFF
--#define GRUB_LINUX_VID_MODE_EXTENDED  0xFFFE
--#define GRUB_LINUX_VID_MODE_ASK               0xFFFD
--
--#define GRUB_LINUX_CL_OFFSET          0x9000
--#define GRUB_LINUX_CL_END_OFFSET      0x90FF
--#define GRUB_LINUX_SETUP_MOVE_SIZE    0x9100
--#define GRUB_LINUX_CL_MAGIC           0xA33F
--
--#ifndef ASM_FILE
--
--/* For the Linux/i386 boot protocol version 2.03.  */
--struct linux_kernel_header
--{ 
--  grub_uint8_t code1[0x0020];
--  grub_uint16_t cl_magic;             /* Magic number 0xA33F */
--  grub_uint16_t cl_offset;            /* The offset of command line */
--  grub_uint8_t code2[0x01F1 - 0x0020 - 2 - 2];
--  grub_uint8_t setup_sects;           /* The size of the setup in sectors */
--  grub_uint16_t root_flags;           /* If the root is mounted readonly */
--  grub_uint16_t syssize;              /* obsolete */
--  grub_uint16_t swap_dev;             /* obsolete */
--  grub_uint16_t ram_size;             /* obsolete */
--  grub_uint16_t vid_mode;             /* Video mode control */
--  grub_uint16_t root_dev;             /* Default root device number */
--  grub_uint16_t boot_flag;            /* 0xAA55 magic number */
--  grub_uint16_t jump;                 /* Jump instruction */
--  grub_uint32_t header;                       /* Magic signature "HdrS" */
--  grub_uint16_t version;              /* Boot protocol version supported */
--  grub_uint32_t realmode_swtch;               /* Boot loader hook */
--  grub_uint16_t start_sys;            /* The load-low segment (obsolete) */
--  grub_uint16_t kernel_version;               /* Points to kernel version string */
--  grub_uint8_t type_of_loader;                /* Boot loader identifier */
--  grub_uint8_t loadflags;             /* Boot protocol option flags */
--  grub_uint16_t setup_move_size;      /* Move to high memory size */
--  grub_uint32_t code32_start;         /* Boot loader hook */
--  grub_uint32_t ramdisk_image;                /* initrd load address */
--  grub_uint32_t ramdisk_size;         /* initrd size */
--  grub_uint32_t bootsect_kludge;      /* obsolete */
--  grub_uint16_t heap_end_ptr;         /* Free memory after setup end */
--  grub_uint16_t pad1;                 /* Unused */
--  char *cmd_line_ptr;                 /* Points to the kernel command line */
--  grub_uint32_t initrd_addr_max;        /* Highest address for initrd */
--} __attribute__ ((packed));
--
--#endif /* ! ASM_FILE */
--
--#endif /* ! GRUB_LINUX_MACHINE_HEADER */
-Index: include/grub/i386/pc/vbe.h
-===================================================================
-RCS file: /cvsroot/grub/grub2/include/grub/i386/pc/vbe.h,v
-retrieving revision 1.3
-retrieving revision 1.5
-diff -u -r1.3 -r1.5
---- include/grub/i386/pc/vbe.h 16 Aug 2005 18:34:17 -0000      1.3
-+++ include/grub/i386/pc/vbe.h 31 Mar 2006 14:26:34 -0000      1.5
-@@ -1,6 +1,6 @@
- /*
-  *  GRUB  --  GRand Unified Bootloader
-- *  Copyright (C) 2005  Free Software Foundation, Inc.
-+ *  Copyright (C) 2005,2006  Free Software Foundation, Inc.
-  *
-  *  This program is free software; you can redistribute it and/or modify
-  *  it under the terms of the GNU General Public License as published by
-@@ -23,10 +23,18 @@
- #include <grub/symbol.h>
- #include <grub/types.h>
- #include <grub/err.h>
-+#include <grub/video.h>
- /* Default video mode to be used.  */
- #define GRUB_VBE_DEFAULT_VIDEO_MODE     0x101
-+/* VBE status codes.  */
-+#define GRUB_VBE_STATUS_OK            0x004f
-+
-+/* VBE memory model types.  */
-+#define GRUB_VBE_MEMORY_MODEL_PACKED_PIXEL    0x04
-+#define GRUB_VBE_MEMORY_MODEL_DIRECT_COLOR    0x06
-+
- /* Note:
-  
-    Please refer to VESA BIOS Extension 3.0 Specification for more descriptive
-@@ -117,7 +125,7 @@
-   /* Reserved field to make structure to be 256 bytes long, VESA BIOS 
-      Extension 3.0 Specification says to reserve 189 bytes here but 
--     that doesn't make structure to be 256 bytes. So additional one is 
-+     that doesn't make structure to be 256 bytes.  So additional one is 
-      added here.  */
-   grub_uint8_t reserved4[189 + 1];
- } __attribute__ ((packed));
-@@ -147,45 +155,45 @@
- /* Prototypes for kernel real mode thunks.  */
- /* Call VESA BIOS 0x4f00 to get VBE Controller Information, return status.  */
--grub_vbe_status_t EXPORT_FUNC(grub_vbe_get_controller_info) (struct grub_vbe_info_block *controller_info);
-+grub_vbe_status_t EXPORT_FUNC(grub_vbe_bios_get_controller_info) (struct grub_vbe_info_block *controller_info);
- /* Call VESA BIOS 0x4f01 to get VBE Mode Information, return status.  */
--grub_vbe_status_t EXPORT_FUNC(grub_vbe_get_mode_info) (grub_uint32_t mode,
--                                                       struct grub_vbe_mode_info_block *mode_info);
-+grub_vbe_status_t EXPORT_FUNC(grub_vbe_bios_get_mode_info) (grub_uint32_t mode,
-+                                                            struct grub_vbe_mode_info_block *mode_info);
- /* Call VESA BIOS 0x4f02 to set video mode, return status.  */
--grub_vbe_status_t EXPORT_FUNC(grub_vbe_set_mode) (grub_uint32_t mode,
--                                                  struct grub_vbe_crtc_info_block *crtc_info);
-+grub_vbe_status_t EXPORT_FUNC(grub_vbe_bios_set_mode) (grub_uint32_t mode,
-+                                                       struct grub_vbe_crtc_info_block *crtc_info);
- /* Call VESA BIOS 0x4f03 to return current VBE Mode, return status.  */
--grub_vbe_status_t EXPORT_FUNC(grub_vbe_get_mode) (grub_uint32_t *mode);
-+grub_vbe_status_t EXPORT_FUNC(grub_vbe_bios_get_mode) (grub_uint32_t *mode);
- /* Call VESA BIOS 0x4f05 to set memory window, return status.  */
--grub_vbe_status_t EXPORT_FUNC(grub_vbe_set_memory_window) (grub_uint32_t window,
--                                                           grub_uint32_t position);
-+grub_vbe_status_t EXPORT_FUNC(grub_vbe_bios_set_memory_window) (grub_uint32_t window,
-+                                                                grub_uint32_t position);
- /* Call VESA BIOS 0x4f05 to return memory window, return status.  */
--grub_vbe_status_t EXPORT_FUNC(grub_vbe_get_memory_window) (grub_uint32_t window,
--                                                           grub_uint32_t *position);
-+grub_vbe_status_t EXPORT_FUNC(grub_vbe_bios_get_memory_window) (grub_uint32_t window,
-+                                                                grub_uint32_t *position);
- /* Call VESA BIOS 0x4f06 to set scanline length (in bytes), return status.  */
--grub_vbe_status_t EXPORT_FUNC(grub_vbe_set_scanline_length) (grub_uint32_t length);
-+grub_vbe_status_t EXPORT_FUNC(grub_vbe_bios_set_scanline_length) (grub_uint32_t length);
- /* Call VESA BIOS 0x4f06 to return scanline length (in bytes), return status.  */
--grub_vbe_status_t EXPORT_FUNC(grub_vbe_get_scanline_length) (grub_uint32_t *length);
-+grub_vbe_status_t EXPORT_FUNC(grub_vbe_bios_get_scanline_length) (grub_uint32_t *length);
- /* Call VESA BIOS 0x4f07 to set display start, return status.  */
--grub_vbe_status_t EXPORT_FUNC(grub_vbe_set_display_start) (grub_uint32_t x,
--                                                           grub_uint32_t y);
-+grub_vbe_status_t EXPORT_FUNC(grub_vbe_bios_set_display_start) (grub_uint32_t x,
-+                                                                grub_uint32_t y);
- /* Call VESA BIOS 0x4f07 to get display start, return status.  */
--grub_vbe_status_t EXPORT_FUNC(grub_vbe_get_display_start) (grub_uint32_t *x,
--                                                           grub_uint32_t *y);
-+grub_vbe_status_t EXPORT_FUNC(grub_vbe_bios_get_display_start) (grub_uint32_t *x,
-+                                                                grub_uint32_t *y);
- /* Call VESA BIOS 0x4f09 to set palette data, return status.  */
--grub_vbe_status_t EXPORT_FUNC(grub_vbe_set_palette_data) (grub_uint32_t color_count,
--                                                          grub_uint32_t start_index,
--                                                          struct grub_vbe_palette_data *palette_data);
-+grub_vbe_status_t EXPORT_FUNC(grub_vbe_bios_set_palette_data) (grub_uint32_t color_count,
-+                                                               grub_uint32_t start_index,
-+                                                               struct grub_vbe_palette_data *palette_data);
- /* Prototypes for helper functions.  */
-@@ -195,13 +203,19 @@
- grub_err_t grub_vbe_get_video_mode (grub_uint32_t *mode);
- grub_err_t grub_vbe_get_video_mode_info (grub_uint32_t mode,
-                                          struct grub_vbe_mode_info_block *mode_info);
--void grub_vbe_set_pixel_rgb (grub_uint32_t x,
--                             grub_uint32_t y,
--                             grub_uint8_t red,
--                             grub_uint8_t green,
--                             grub_uint8_t blue);
--void grub_vbe_set_pixel_index (grub_uint32_t x,
--                               grub_uint32_t y,
--                               grub_uint8_t color);
-+
-+/* VBE module internal prototypes (should not be used from elsewhere).  */
-+grub_uint8_t * grub_video_vbe_get_video_ptr (struct grub_video_render_target *source,
-+                                             grub_uint32_t x,
-+                                             grub_uint32_t y);
-+
-+grub_video_color_t grub_video_vbe_map_rgb (grub_uint8_t red, 
-+                                           grub_uint8_t green,
-+                                           grub_uint8_t blue);
-+
-+void grub_video_vbe_unmap_color (struct grub_video_render_target * source,
-+                                 grub_video_color_t color, grub_uint8_t *red,
-+                                 grub_uint8_t *green, grub_uint8_t *blue,
-+                                 grub_uint8_t *alpha);
- #endif /* ! GRUB_VBE_MACHINE_HEADER */
-Index: include/grub/i386/pc/vbeblit.h
-===================================================================
-RCS file: include/grub/i386/pc/vbeblit.h
-diff -N include/grub/i386/pc/vbeblit.h
---- /dev/null  1 Jan 1970 00:00:00 -0000
-+++ include/grub/i386/pc/vbeblit.h     31 Mar 2006 14:26:34 -0000      1.1
-@@ -0,0 +1,66 @@
-+/*
-+ *  GRUB  --  GRand Unified Bootloader
-+ *  Copyright (C) 2006  Free Software Foundation, Inc.
-+ *
-+ *  This program is free software; you can redistribute it and/or modify
-+ *  it under the terms of the GNU General Public License as published by
-+ *  the Free Software Foundation; either version 2 of the License, or
-+ *  (at your option) any later version.
-+ *
-+ *  This program is distributed in the hope that it will be useful,
-+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+ *  GNU General Public License for more details.
-+ *
-+ *  You should have received a copy of the GNU General Public License
-+ *  along with this program; if not, write to the Free Software
-+ *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-+ */
-+
-+#ifndef GRUB_VBEBLIT_MACHINE_HEADER
-+#define GRUB_VBEBLIT_MACHINE_HEADER   1
-+
-+void
-+grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8 (struct grub_video_render_target *dst,
-+                                           struct grub_video_render_target *src,
-+                                           int x, int y, int width, int height,
-+                                           int offset_x, int offset_y);
-+
-+void
-+grub_video_i386_vbeblit_R8G8B8_R8G8B8A8 (struct grub_video_render_target *dst,
-+                                         struct grub_video_render_target *src,
-+                                         int x, int y, int width, int height,
-+                                         int offset_x, int offset_y);
-+
-+void
-+grub_video_i386_vbeblit_index_R8G8B8A8 (struct grub_video_render_target *dst,
-+                                        struct grub_video_render_target *src,
-+                                        int x, int y, int width, int height,
-+                                        int offset_x, int offset_y);
-+
-+
-+void
-+grub_video_i386_vbeblit_R8G8B8A8_R8G8B8 (struct grub_video_render_target *dst,
-+                                         struct grub_video_render_target *src,
-+                                         int x, int y, int width, int height,
-+                                         int offset_x, int offset_y);
-+
-+void
-+grub_video_i386_vbeblit_R8G8B8_R8G8B8 (struct grub_video_render_target *dst,
-+                                       struct grub_video_render_target *src,
-+                                       int x, int y, int width, int height,
-+                                       int offset_x, int offset_y);
-+
-+void
-+grub_video_i386_vbeblit_index_R8G8B8 (struct grub_video_render_target *dst,
-+                                      struct grub_video_render_target *src,
-+                                      int x, int y, int width, int height,
-+                                      int offset_x, int offset_y);
-+
-+void
-+grub_video_i386_vbeblit_index_index (struct grub_video_render_target *dst,
-+                                     struct grub_video_render_target *src,
-+                                     int x, int y, int width, int height,
-+                                     int offset_x, int offset_y);
-+
-+#endif /* ! GRUB_VBEBLIT_MACHINE_HEADER */
-Index: include/grub/i386/pc/vbefill.h
-===================================================================
-RCS file: include/grub/i386/pc/vbefill.h
-diff -N include/grub/i386/pc/vbefill.h
---- /dev/null  1 Jan 1970 00:00:00 -0000
-+++ include/grub/i386/pc/vbefill.h     31 Mar 2006 14:26:34 -0000      1.1
-@@ -0,0 +1,40 @@
-+/*
-+ *  GRUB  --  GRand Unified Bootloader
-+ *  Copyright (C) 2006  Free Software Foundation, Inc.
-+ *
-+ *  This program is free software; you can redistribute it and/or modify
-+ *  it under the terms of the GNU General Public License as published by
-+ *  the Free Software Foundation; either version 2 of the License, or
-+ *  (at your option) any later version.
-+ *
-+ *  This program is distributed in the hope that it will be useful,
-+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+ *  GNU General Public License for more details.
-+ *
-+ *  You should have received a copy of the GNU General Public License
-+ *  along with this program; if not, write to the Free Software
-+ *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-+ */
-+
-+#ifndef GRUB_VBEFILL_MACHINE_HEADER
-+#define GRUB_VBEFILL_MACHINE_HEADER   1
-+
-+#include <grub/video.h>
-+
-+void
-+grub_video_i386_vbefill_R8G8B8A8 (struct grub_video_render_target *dst,
-+                                  grub_video_color_t color,  int x, int y,
-+                                  int width, int height);
-+
-+void
-+grub_video_i386_vbefill_R8G8B8 (struct grub_video_render_target *dst,
-+                                grub_video_color_t color, int x, int y,
-+                                int width, int height);
-+
-+void
-+grub_video_i386_vbefill_index (struct grub_video_render_target *dst,
-+                               grub_video_color_t color, int x, int y,
-+                               int width, int height);
-+
-+#endif /* ! GRUB_VBEFILL_MACHINE_HEADER */
-Index: include/grub/powerpc/types.h
-===================================================================
-RCS file: /cvsroot/grub/grub2/include/grub/powerpc/types.h,v
-retrieving revision 1.3
-retrieving revision 1.4
-diff -u -r1.3 -r1.4
---- include/grub/powerpc/types.h       27 Dec 2004 13:46:20 -0000      1.3
-+++ include/grub/powerpc/types.h       28 May 2006 23:01:43 -0000      1.4
-@@ -1,6 +1,6 @@
- /*
-  *  GRUB  --  GRand Unified Bootloader
-- *  Copyright (C) 2002, 2004  Free Software Foundation, Inc.
-+ *  Copyright (C) 2002,2004,2006  Free Software Foundation, Inc.
-  *
-  *  GRUB is free software; you can redistribute it and/or modify
-  *  it under the terms of the GNU General Public License as published by
-@@ -21,13 +21,13 @@
- #define GRUB_TYPES_CPU_HEADER 1
- /* The size of void *.  */
--#define GRUB_HOST_SIZEOF_VOID_P       4
-+#define GRUB_TARGET_SIZEOF_VOID_P     4
- /* The size of long.  */
--#define GRUB_HOST_SIZEOF_LONG 4
-+#define GRUB_TARGET_SIZEOF_LONG               4
- /* powerpc is big-endian.  */
--#define GRUB_HOST_WORDS_BIGENDIAN     1
-+#define GRUB_TARGET_WORDS_BIGENDIAN   1
- #endif /* ! GRUB_TYPES_CPU_HEADER */
-Index: include/grub/powerpc/ieee1275/kernel.h
-===================================================================
-RCS file: /cvsroot/grub/grub2/include/grub/powerpc/ieee1275/kernel.h,v
-retrieving revision 1.3
-retrieving revision 1.4
-diff -u -r1.3 -r1.4
---- include/grub/powerpc/ieee1275/kernel.h     3 Aug 2005 22:53:50 -0000       1.3
-+++ include/grub/powerpc/ieee1275/kernel.h     23 Apr 2006 13:37:36 -0000      1.4
-@@ -1,6 +1,6 @@
- /*
-  *  GRUB  --  GRand Unified Bootloader
-- *  Copyright (C) 2005  Free Software Foundation, Inc.
-+ *  Copyright (C) 2005,2006  Free Software Foundation, Inc.
-  *
-  *  This program is free software; you can redistribute it and/or modify
-  *  it under the terms of the GNU General Public License as published by
-@@ -22,7 +22,6 @@
- #include <grub/symbol.h>
--void EXPORT_FUNC (abort) (void);
- void EXPORT_FUNC (grub_reboot) (void);
- void EXPORT_FUNC (grub_halt) (void);
-Index: include/grub/sparc64/types.h
-===================================================================
-RCS file: /cvsroot/grub/grub2/include/grub/sparc64/types.h,v
-retrieving revision 1.1
-retrieving revision 1.2
-diff -u -r1.1 -r1.2
---- include/grub/sparc64/types.h       21 Aug 2005 18:42:53 -0000      1.1
-+++ include/grub/sparc64/types.h       28 May 2006 23:01:43 -0000      1.2
-@@ -1,6 +1,6 @@
- /*
-  *  GRUB  --  GRand Unified Bootloader
-- *  Copyright (C) 2002, 2004  Free Software Foundation, Inc.
-+ *  Copyright (C) 2002,2004,2006  Free Software Foundation, Inc.
-  *
-  *  GRUB is free software; you can redistribute it and/or modify
-  *  it under the terms of the GNU General Public License as published by
-@@ -21,13 +21,13 @@
- #define GRUB_TYPES_CPU_HEADER 1
- /* The size of void *.  */
--#define GRUB_HOST_SIZEOF_VOID_P       8
-+#define GRUB_TARGET_SIZEOF_VOID_P     8
- /* The size of long.  */
--#define GRUB_HOST_SIZEOF_LONG 8
-+#define GRUB_TARGET_SIZEOF_LONG               8
- /* sparc64 is big-endian.  */
--#define GRUB_HOST_WORDS_BIGENDIAN     1
-+#define GRUB_TARGET_WORDS_BIGENDIAN   1
- #endif /* ! GRUB_TYPES_CPU_HEADER */
-Index: include/grub/sparc64/ieee1275/kernel.h
-===================================================================
-RCS file: /cvsroot/grub/grub2/include/grub/sparc64/ieee1275/kernel.h,v
-retrieving revision 1.1
-retrieving revision 1.2
-diff -u -r1.1 -r1.2
---- include/grub/sparc64/ieee1275/kernel.h     21 Aug 2005 18:42:54 -0000      1.1
-+++ include/grub/sparc64/ieee1275/kernel.h     23 Apr 2006 13:37:36 -0000      1.2
-@@ -22,7 +22,6 @@
- #include <grub/symbol.h>
--void EXPORT_FUNC (abort) (void);
- void EXPORT_FUNC (grub_reboot) (void);
- void EXPORT_FUNC (grub_halt) (void);
-Index: io/gzio.c
-===================================================================
-RCS file: /cvsroot/grub/grub2/io/gzio.c,v
-retrieving revision 1.3
-retrieving revision 1.4
-diff -u -r1.3 -r1.4
---- io/gzio.c  19 Oct 2005 23:16:03 -0000      1.3
-+++ io/gzio.c  4 Jun 2006 15:56:54 -0000       1.4
-@@ -1,7 +1,7 @@
- /* gzio.c - decompression support for gzip */
- /*
-  *  GRUB  --  GRand Unified Bootloader
-- *  Copyright (C) 1999,2005  Free Software Foundation, Inc.
-+ *  Copyright (C) 1999,2005,2006  Free Software Foundation, Inc.
-  *
-  *  This program is free software; you can redistribute it and/or modify
-  *  it under the terms of the GNU General Public License as published by
-@@ -60,7 +60,7 @@
-   /* The underlyding file object.  */
-   grub_file_t file;
-   /* The offset at which the data starts in the underlyding file.  */
--  grub_ssize_t data_offset;
-+  grub_off_t data_offset;
-   /* The type of current block.  */
-   int block_type;
-   /* The length of current block.  */
-@@ -93,7 +93,7 @@
-   /* The lookup bits for the distance code table.  */
-   int bd;
-   /* The original offset value.  */
--  grub_ssize_t saved_offset;
-+  grub_off_t saved_offset;
- };
- typedef struct grub_gzio *grub_gzio_t;
-@@ -176,7 +176,7 @@
-    *  (other than a real error with the disk) then we don't think it
-    *  is a compressed file, and simply mark it as such.
-    */
--  if (grub_file_read (gzio->file, buf, 10) != 10
-+  if (grub_file_read (gzio->file, (char *) buf, 10) != 10
-       || ((*((grub_uint16_t *) buf) != GZIP_MAGIC)
-         && (*((grub_uint16_t *) buf) != OLD_GZIP_MAGIC)))
-     {
-@@ -192,7 +192,7 @@
-   if (buf[2] != DEFLATED
-       || (buf[3] & UNSUPPORTED_FLAGS)
-       || ((buf[3] & EXTRA_FIELD)
--        && (grub_file_read (gzio->file, buf, 2) != 2
-+        && (grub_file_read (gzio->file, (char *) buf, 2) != 2
-             || eat_field (gzio->file,
-                           grub_le_to_cpu16 (*((grub_uint16_t *) buf)))))
-       || ((buf[3] & ORIG_NAME) && eat_field (gzio->file, -1))
-@@ -206,12 +206,14 @@
-   
-   grub_file_seek (gzio->file, grub_file_size (gzio->file) - 8);
-   
--  if (grub_file_read (gzio->file, buf, 8) != 8)
-+  if (grub_file_read (gzio->file, (char *) buf, 8) != 8)
-     {
-       grub_error (GRUB_ERR_BAD_FILE_TYPE, "unsupported gzip format");
-       return 0;
-     }
-+  /* FIXME: this does not handle files whose original size is over 4GB.
-+     But how can we know the real original size?  */
-   file->size = grub_le_to_cpu32 (*((grub_uint32_t *) (buf + 4)));
-   initialize_tables (file);
-@@ -362,11 +364,11 @@
- {
-   grub_gzio_t gzio = file->data;
-   
--  if (grub_file_tell (gzio->file) == gzio->data_offset
-+  if (grub_file_tell (gzio->file) == (grub_off_t) gzio->data_offset
-       || gzio->inbuf_d == INBUFSIZ)
-     {
-       gzio->inbuf_d = 0;
--      grub_file_read (gzio->file, gzio->inbuf, INBUFSIZ);
-+      grub_file_read (gzio->file, (char *) gzio->inbuf, INBUFSIZ);
-     }
-   return gzio->inbuf[gzio->inbuf_d++];
-@@ -1166,11 +1168,11 @@
- }
- static grub_ssize_t
--grub_gzio_read (grub_file_t file, char *buf, grub_ssize_t len)
-+grub_gzio_read (grub_file_t file, char *buf, grub_size_t len)
- {
-   grub_ssize_t ret = 0;
-   grub_gzio_t gzio = file->data;
--  grub_ssize_t offset;
-+  grub_off_t offset;
-   
-   /* Do we reset decompression to the beginning of the file?  */
-   if (gzio->saved_offset > file->offset + WSIZE)
-@@ -1186,7 +1188,7 @@
-   
-   while (len > 0 && grub_errno == GRUB_ERR_NONE)
-     {
--      register grub_ssize_t size;
-+      register grub_size_t size;
-       register char *srcaddr;
-       while (offset >= gzio->saved_offset)
-Index: kern/disk.c
-===================================================================
-RCS file: /cvsroot/grub/grub2/kern/disk.c,v
-retrieving revision 1.12
-retrieving revision 1.13
-diff -u -r1.12 -r1.13
---- kern/disk.c        18 Aug 2005 03:14:39 -0000      1.12
-+++ kern/disk.c        4 Jun 2006 15:56:54 -0000       1.13
-@@ -37,7 +37,7 @@
- {
-   unsigned long dev_id;
-   unsigned long disk_id;
--  unsigned long sector;
-+  grub_disk_addr_t sector;
-   char *data;
-   int lock;
- };
-@@ -58,16 +58,16 @@
- static unsigned
- grub_disk_cache_get_index (unsigned long dev_id, unsigned long disk_id,
--                         unsigned long sector)
-+                         grub_disk_addr_t sector)
- {
-   return ((dev_id * 524287UL + disk_id * 2606459UL
--         + (sector >> GRUB_DISK_CACHE_BITS))
-+         + ((unsigned) (sector >> GRUB_DISK_CACHE_BITS)))
-         % GRUB_DISK_CACHE_NUM);
- }
- static void
- grub_disk_cache_invalidate (unsigned long dev_id, unsigned long disk_id,
--                          unsigned long sector)
-+                          grub_disk_addr_t sector)
- {
-   unsigned index;
-   struct grub_disk_cache *cache;
-@@ -105,7 +105,7 @@
- static char *
- grub_disk_cache_fetch (unsigned long dev_id, unsigned long disk_id,
--                     unsigned long sector)
-+                     grub_disk_addr_t sector)
- {
-   struct grub_disk_cache *cache;
-   unsigned index;
-@@ -132,7 +132,7 @@
- static void
- grub_disk_cache_unlock (unsigned long dev_id, unsigned long disk_id,
--                      unsigned long sector)
-+                      grub_disk_addr_t sector)
- {
-   struct grub_disk_cache *cache;
-   unsigned index;
-@@ -147,7 +147,7 @@
- static grub_err_t
- grub_disk_cache_store (unsigned long dev_id, unsigned long disk_id,
--                     unsigned long sector, const char *data)
-+                     grub_disk_addr_t sector, const char *data)
- {
-   unsigned index;
-   struct grub_disk_cache *cache;
-@@ -306,15 +306,16 @@
- }
- static grub_err_t
--grub_disk_check_range (grub_disk_t disk, unsigned long *sector,
--                     unsigned long *offset, grub_ssize_t size)
-+grub_disk_check_range (grub_disk_t disk, grub_disk_addr_t *sector,
-+                     grub_off_t *offset, grub_size_t size)
- {
-   *sector += *offset >> GRUB_DISK_SECTOR_BITS;
-   *offset &= GRUB_DISK_SECTOR_SIZE - 1;
-   
-   if (disk->partition)
-     {
--      unsigned long start, len;
-+      grub_disk_addr_t start;
-+      grub_uint64_t len;
-       start = grub_partition_get_start (disk->partition);
-       len = grub_partition_get_len (disk->partition);
-@@ -337,15 +338,18 @@
- /* Read data from the disk.  */
- grub_err_t
--grub_disk_read (grub_disk_t disk, unsigned long sector,
--              unsigned long offset, unsigned long size, char *buf)
-+grub_disk_read (grub_disk_t disk, grub_disk_addr_t sector,
-+              grub_off_t offset, grub_size_t size, char *buf)
- {
-   char *tmp_buf;
--
-+  unsigned real_offset;
-+  
-   /* First of all, check if the region is within the disk.  */
-   if (grub_disk_check_range (disk, &sector, &offset, size) != GRUB_ERR_NONE)
-     return grub_errno;
-+  real_offset = offset;
-+  
-   /* Allocate a temporary buffer.  */
-   tmp_buf = grub_malloc (GRUB_DISK_SECTOR_SIZE << GRUB_DISK_CACHE_BITS);
-   if (! tmp_buf)
-@@ -355,14 +359,15 @@
-   while (size)
-     {
-       char *data;
--      unsigned long start_sector;
--      unsigned long len;
--      unsigned long pos;
-+      grub_disk_addr_t start_sector;
-+      grub_size_t len;
-+      grub_size_t pos;
-       /* For reading bulk data.  */
-       start_sector = sector & ~(GRUB_DISK_CACHE_SIZE - 1);
-       pos = (sector - start_sector) << GRUB_DISK_SECTOR_BITS;
--      len = (GRUB_DISK_SECTOR_SIZE << GRUB_DISK_CACHE_BITS) - pos - offset;
-+      len = ((GRUB_DISK_SECTOR_SIZE << GRUB_DISK_CACHE_BITS)
-+           - pos - real_offset);
-       if (len > size)
-       len = size;
-@@ -371,7 +376,7 @@
-       if (data)
-       {
-         /* Just copy it!  */
--        grub_memcpy (buf, data + pos + offset, len);
-+        grub_memcpy (buf, data + pos + real_offset, len);
-         grub_disk_cache_unlock (disk->dev->id, disk->id, start_sector);
-       }
-       else
-@@ -396,19 +401,19 @@
-             if ((disk->dev->read) (disk, sector, num, tmp_buf))
-               goto finish;
--            grub_memcpy (buf, tmp_buf + offset, size);
-+            grub_memcpy (buf, tmp_buf + real_offset, size);
-             /* Call the read hook, if any.  */
-             if (disk->read_hook)
-               while (size)
-                 {
--                  (disk->read_hook) (sector, offset,
-+                  (disk->read_hook) (sector, real_offset,
-                                      ((size > GRUB_DISK_SECTOR_SIZE)
-                                       ? GRUB_DISK_SECTOR_SIZE
-                                       : size));
-                   sector++;
--                  size -= GRUB_DISK_SECTOR_SIZE - offset;
--                  offset = 0;
-+                  size -= GRUB_DISK_SECTOR_SIZE - real_offset;
-+                  real_offset = 0;
-                 }
-             /* This must be the end.  */
-@@ -416,7 +421,7 @@
-           }
-         /* Copy it and store it in the disk cache.  */
--        grub_memcpy (buf, tmp_buf + pos + offset, len);
-+        grub_memcpy (buf, tmp_buf + pos + real_offset, len);
-         grub_disk_cache_store (disk->dev->id, disk->id,
-                                start_sector, tmp_buf);
-       }
-@@ -424,29 +429,29 @@
-       /* Call the read hook, if any.  */
-       if (disk->read_hook)
-       {
--        unsigned long s = sector;
--        unsigned long l = len;
-+        grub_disk_addr_t s = sector;
-+        grub_size_t l = len;
-         
-         while (l)
-           {
--            (disk->read_hook) (s, offset,
-+            (disk->read_hook) (s, real_offset,
-                                ((l > GRUB_DISK_SECTOR_SIZE)
-                                 ? GRUB_DISK_SECTOR_SIZE
-                                 : l));
-             
--            if (l < GRUB_DISK_SECTOR_SIZE - offset)
-+            if (l < GRUB_DISK_SECTOR_SIZE - real_offset)
-               break;
-             
-             s++;
--            l -= GRUB_DISK_SECTOR_SIZE - offset;
--            offset = 0;
-+            l -= GRUB_DISK_SECTOR_SIZE - real_offset;
-+            real_offset = 0;
-           }
-       }
-       
-       sector = start_sector + GRUB_DISK_CACHE_SIZE;
-       buf += len;
-       size -= len;
--      offset = 0;
-+      real_offset = 0;
-     }
-   
-  finish:
-@@ -457,28 +462,32 @@
- }
- grub_err_t
--grub_disk_write (grub_disk_t disk, unsigned long sector,
--               unsigned long offset, unsigned long size, const char *buf)
-+grub_disk_write (grub_disk_t disk, grub_disk_addr_t sector,
-+               grub_off_t offset, grub_size_t size, const char *buf)
- {
-+  unsigned real_offset;
-+  
-   if (grub_disk_check_range (disk, &sector, &offset, size) != GRUB_ERR_NONE)
-     return -1;
-+  real_offset = offset;
-+  
-   while (size)
-     {
--      if (offset != 0 || (size < GRUB_DISK_SECTOR_SIZE && size != 0))
-+      if (real_offset != 0 || (size < GRUB_DISK_SECTOR_SIZE && size != 0))
-       {
-         char tmp_buf[GRUB_DISK_SECTOR_SIZE];
--        unsigned long len;
-+        grub_size_t len;
-         
-         if (grub_disk_read (disk, sector, 0, GRUB_DISK_SECTOR_SIZE, tmp_buf)
-             != GRUB_ERR_NONE)
-           goto finish;
--        len = GRUB_DISK_SECTOR_SIZE - offset;
-+        len = GRUB_DISK_SECTOR_SIZE - real_offset;
-         if (len > size)
-           len = size;
-         
--        grub_memcpy (tmp_buf + offset, buf, len);
-+        grub_memcpy (tmp_buf + real_offset, buf, len);
-         grub_disk_cache_invalidate (disk->dev->id, disk->id, sector);
-@@ -488,12 +497,12 @@
-         sector++;
-         buf += len;
-         size -= len;
--        offset = 0;
-+        real_offset = 0;
-       }
-       else
-       {
--        unsigned long len;
--        unsigned long n;
-+        grub_size_t len;
-+        grub_size_t n;
-         len = size & ~(GRUB_DISK_SECTOR_SIZE - 1);
-         n = size >> GRUB_DISK_SECTOR_BITS;
-Index: kern/dl.c
-===================================================================
-RCS file: /cvsroot/grub/grub2/kern/dl.c,v
-retrieving revision 1.11
-retrieving revision 1.12
-diff -u -r1.11 -r1.12
---- kern/dl.c  10 Dec 2005 05:24:59 -0000      1.11
-+++ kern/dl.c  28 May 2006 23:01:43 -0000      1.12
-@@ -30,7 +30,7 @@
- #include <grub/env.h>
- #include <grub/cache.h>
--#if GRUB_HOST_SIZEOF_VOID_P == 4
-+#if GRUB_CPU_SIZEOF_VOID_P == 4
- typedef Elf32_Word Elf_Word;
- typedef Elf32_Addr Elf_Addr;
-@@ -41,7 +41,7 @@
- # define ELF_ST_BIND(val)     ELF32_ST_BIND (val)
- # define ELF_ST_TYPE(val)     ELF32_ST_TYPE (val)
--#elif GRUB_HOST_SIZEOF_VOID_P == 8
-+#elif GRUB_CPU_SIZEOF_VOID_P == 8
- typedef Elf64_Word Elf_Word;
- typedef Elf64_Addr Elf_Addr;
-Index: kern/env.c
-===================================================================
-RCS file: /cvsroot/grub/grub2/kern/env.c,v
-retrieving revision 1.5
-retrieving revision 1.7
-diff -u -r1.5 -r1.7
---- kern/env.c 25 Dec 2005 17:21:52 -0000      1.5
-+++ kern/env.c 1 May 2006 23:30:51 -0000       1.7
-@@ -1,7 +1,7 @@
- /* env.c - Environment variables */
- /*
-  *  GRUB  --  GRand Unified Bootloader
-- *  Copyright (C) 2003,2005  Free Software Foundation, Inc.
-+ *  Copyright (C) 2003,2005,2006  Free Software Foundation, Inc.
-  *
-  *  GRUB is free software; you can redistribute it and/or modify
-  *  it under the terms of the GNU General Public License as published by
-@@ -26,13 +26,31 @@
- #define       HASHSZ  13
- /* A hashtable for quick lookup of variables.  */
--static struct grub_env_var *grub_env[HASHSZ];
-+struct grub_env_context
-+{
-+  /* A hash table for variables.  */
-+  struct grub_env_var *vars[HASHSZ];
-+  
-+  /* One level deeper on the stack.  */
-+  struct grub_env_context *prev;
-+};
-+
-+/* This is used for sorting only.  */
-+struct grub_env_sorted_var
-+{
-+  struct grub_env_var *var;
-+  struct grub_env_sorted_var *next;
-+};
-+
-+/* The initial context.  */
-+static struct grub_env_context initial_context;
--/* The variables in a sorted list.  */
--static struct grub_env_var *grub_env_sorted;
-+/* The current context.  */
-+static struct grub_env_context *current_context = &initial_context;
- /* Return the hash representation of the string S.  */
--static unsigned int grub_env_hashval (const char *s)
-+static unsigned int
-+grub_env_hashval (const char *s)
- {
-   unsigned int i = 0;
-@@ -49,86 +67,164 @@
-   struct grub_env_var *var;
-   int idx = grub_env_hashval (name);
--  for (var = grub_env[idx]; var; var = var->next)
--    if (! grub_strcmp (var->name, name))
-+  /* Look for the variable in the current context.  */
-+  for (var = current_context->vars[idx]; var; var = var->next)
-+    if (grub_strcmp (var->name, name) == 0)
-       return var;
-+
-   return 0;
- }
- grub_err_t
--grub_env_set (const char *var, const char *val)
-+grub_env_context_open (void)
-+{
-+  struct grub_env_context *context;
-+  int i;
-+
-+  context = grub_malloc (sizeof (*context));
-+  if (! context)
-+    return grub_errno;
-+
-+  grub_memset (context, 0, sizeof (*context));
-+  context->prev = current_context;
-+  current_context = context;
-+
-+  /* Copy exported variables.  */
-+  for (i = 0; i < HASHSZ; i++)
-+    {
-+      struct grub_env_var *var;
-+      
-+      for (var = context->prev->vars[i]; var; var = var->next)
-+      {
-+        if (var->type == GRUB_ENV_VAR_GLOBAL)
-+          if (grub_env_set (var->name, var->value) != GRUB_ERR_NONE)
-+            {
-+              grub_env_context_close ();
-+              return grub_errno;
-+            }
-+      }
-+    }
-+  
-+  return GRUB_ERR_NONE;
-+}
-+
-+grub_err_t
-+grub_env_context_close (void)
- {
--  int idx = grub_env_hashval (var);
--  struct grub_env_var *env;
--  struct grub_env_var *sort;
--  struct grub_env_var **sortp;
-+  struct grub_env_context *context;
-+  int i;
-+
-+  if (! current_context->prev)
-+    grub_fatal ("cannot close the initial context");
-   
-+  /* Free the variables associated with this context.  */
-+  for (i = 0; i < HASHSZ; i++)
-+    {
-+      struct grub_env_var *p, *q;
-+      
-+      for (p = current_context->prev->vars[i]; p; p = q)
-+      {
-+        q = p->next;
-+        grub_free (p);
-+      }
-+    }
-+
-+  /* Restore the previous context.  */
-+  context = current_context->prev;
-+  grub_free (current_context);
-+  current_context = context;
-+
-+  return GRUB_ERR_NONE;
-+}
-+
-+static void
-+grub_env_insert (struct grub_env_context *context,
-+               struct grub_env_var *var)
-+{
-+  int idx = grub_env_hashval (var->name);
-+
-+  /* Insert the variable into the hashtable.  */
-+  var->prevp = &context->vars[idx];;
-+  var->next = context->vars[idx];
-+  if (var->next)
-+    var->next->prevp = &var;
-+  context->vars[idx] = var;
-+}
-+
-+static void
-+grub_env_remove (struct grub_env_var *var)
-+{
-+  /* Remove the entry from the variable table.  */
-+  *var->prevp = var->next;
-+  if (var->next)
-+    var->next->prevp = var->prevp;
-+}
-+
-+grub_err_t
-+grub_env_export (const char *name)
-+{
-+  struct grub_env_var *var;
-+
-+  var = grub_env_find (name);
-+  if (var)
-+    var->type = GRUB_ENV_VAR_GLOBAL;
-+
-+  return GRUB_ERR_NONE;
-+}
-+
-+grub_err_t
-+grub_env_set (const char *name, const char *val)
-+{
-+  struct grub_env_var *var;
-+
-   /* If the variable does already exist, just update the variable.  */
--  env = grub_env_find (var);
--  if (env)
-+  var = grub_env_find (name);
-+  if (var)
-     {
--      char *old = env->value;
-+      char *old = var->value;
--      if (env->write_hook)
--      env->value = env->write_hook (env, val);
-+      if (var->write_hook)
-+      var->value = var->write_hook (var, val);
-       else
--      env->value = grub_strdup (val);
-+      var->value = grub_strdup (val);
-       
--      if (! env->value)
-+      if (! var->value)
-       {
--        env->value = old;
-+        var->value = old;
-         return grub_errno;
-       }
-       grub_free (old);
--      return 0;
-+      return GRUB_ERR_NONE;
-     }
--  /* The variable does not exist, create it.  */
--  env = grub_malloc (sizeof (struct grub_env_var));
--  if (! env)
-+  /* The variable does not exist, so create a new one.  */
-+  var = grub_malloc (sizeof (*var));
-+  if (! var)
-     return grub_errno;
-   
--  grub_memset (env, 0, sizeof (struct grub_env_var));
-+  grub_memset (var, 0, sizeof (*var));
-+
-+  /* This is not necessary, because GRUB_ENV_VAR_LOCAL == 0. But leave
-+     this for readability.  */
-+  var->type = GRUB_ENV_VAR_LOCAL;
-   
--  env->name = grub_strdup (var);
--  if (! env->name)
-+  var->name = grub_strdup (name);
-+  if (! var->name)
-     goto fail;
-   
--  env->value = grub_strdup (val);
--  if (! env->value)
-+  var->value = grub_strdup (val);
-+  if (! var->value)
-     goto fail;
--  
--  /* Insert it in the hashtable.  */
--  env->prevp = &grub_env[idx];
--  env->next = grub_env[idx];
--  if (grub_env[idx])
--    grub_env[idx]->prevp = &env->next;
--  grub_env[idx] = env;
--  
--  /* Insert it in the sorted list.  */
--  sortp = &grub_env_sorted;
--  sort = grub_env_sorted;
--  while (sort)
--    {
--      if (grub_strcmp (sort->name, var) > 0)
--      break;
--      
--      sortp = &sort->sort_next;
--      sort = sort->sort_next;
--    }
--  env->sort_prevp = sortp;
--  env->sort_next = sort;
--  if (sort)
--    sort->sort_prevp = &env->sort_next;
--  *sortp = env;
--  return 0;
-+  grub_env_insert (current_context, var);
-+
-+  return GRUB_ERR_NONE;
-  fail:
--  grub_free (env->name);
--  grub_free (env->value);
--  grub_free (env);
-+  grub_free (var->name);
-+  grub_free (var->value);
-+  grub_free (var);
-   return grub_errno;
- }
-@@ -136,77 +232,199 @@
- char *
- grub_env_get (const char *name)
- {
--  struct grub_env_var *env;
--  env = grub_env_find (name);
--  if (! env)
-+  struct grub_env_var *var;
-+  
-+  var = grub_env_find (name);
-+  if (! var)
-     return 0;
--  if (env->read_hook)
--    return env->read_hook (env, env->value);
-+  if (var->read_hook)
-+    return var->read_hook (var, var->value);
--  return env->value;
-+  return var->value;
- }
- void
- grub_env_unset (const char *name)
- {
--  struct grub_env_var *env;
--  env = grub_env_find (name);
--  if (! env)
-+  struct grub_env_var *var;
-+  
-+  var = grub_env_find (name);
-+  if (! var)
-     return;
-   /* XXX: It is not possible to unset variables with a read or write
-      hook.  */
--  if (env->read_hook || env->write_hook)
-+  if (var->read_hook || var->write_hook)
-     return;
--  *env->prevp = env->next;
--  if (env->next)
--    env->next->prevp = env->prevp;
--
--  *env->sort_prevp = env->sort_next;
--  if (env->sort_next)
--    env->sort_next->sort_prevp = env->sort_prevp;
--
--  grub_free (env->name);
--  grub_free (env->value);
--  grub_free (env);
--  return;
-+  grub_env_remove (var);
-+
-+  grub_free (var->name);
-+  grub_free (var->value);
-+  grub_free (var);
- }
- void
--grub_env_iterate (int (* func) (struct grub_env_var *var))
-+grub_env_iterate (int (*func) (struct grub_env_var *var))
- {
--  struct grub_env_var *env;
-+  struct grub_env_sorted_var *sorted_list = 0;
-+  struct grub_env_sorted_var *sorted_var;
-+  int i;
-   
--  for (env = grub_env_sorted; env; env = env->sort_next)
--    if (func (env))
--      return;
-+  /* Add variables associated with this context into a sorted list.  */
-+  for (i = 0; i < HASHSZ; i++)
-+    {
-+      struct grub_env_var *var;
-+      
-+      for (var = current_context->vars[i]; var; var = var->next)
-+      {
-+        struct grub_env_sorted_var *p, **q;
-+
-+        /* Ignore data slots.  */
-+        if (var->type == GRUB_ENV_VAR_DATA)
-+          continue;
-+        
-+        sorted_var = grub_malloc (sizeof (*sorted_var));
-+        if (! sorted_var)
-+          goto fail;
-+
-+        sorted_var->var = var;
-+
-+        for (q = &sorted_list, p = *q; p; q = &((*q)->next), p = *q)
-+          {
-+            if (grub_strcmp (p->var->name, var->name) > 0)
-+              break;
-+          }
-+        
-+        sorted_var->next = *q;
-+        *q = sorted_var;
-+      }
-+    }
-+
-+  /* Iterate FUNC on the sorted list.  */
-+  for (sorted_var = sorted_list; sorted_var; sorted_var = sorted_var->next)
-+    if (func (sorted_var->var))
-+      break;
-+
-+ fail:
-+
-+  /* Free the sorted list.  */
-+  for (sorted_var = sorted_list; sorted_var; )
-+    {
-+      struct grub_env_sorted_var *tmp = sorted_var->next;
-+
-+      grub_free (sorted_var);
-+      sorted_var = tmp;
-+    }
- }
- grub_err_t
--grub_register_variable_hook (const char *var,
-+grub_register_variable_hook (const char *name,
-                            grub_env_read_hook_t read_hook,
-                            grub_env_write_hook_t write_hook)
- {
--  struct grub_env_var *env = grub_env_find (var);
-+  struct grub_env_var *var = grub_env_find (name);
--  if (! env)
-+  if (! var)
-     {
-       char *val = grub_strdup ("");
-       if (! val)
-       return grub_errno;
-       
--      if (grub_env_set (var, val) != GRUB_ERR_NONE)
-+      if (grub_env_set (name, val) != GRUB_ERR_NONE)
-       return grub_errno;
-+      
-+      var = grub_env_find (name);
-+      /* XXX Insert an assertion?  */
-     }
-   
--  env = grub_env_find (var);
--  /* XXX Insert an assertion?  */
-+  var->read_hook = read_hook;
-+  var->write_hook = write_hook;
-+
-+  return GRUB_ERR_NONE;
-+}
-+
-+static char *
-+mangle_data_slot_name (const char *name)
-+{
-+  char *mangled_name;
-+
-+  mangled_name = grub_malloc (grub_strlen (name) + 2);
-+  if (! mangled_name)
-+    return 0;
-   
--  env->read_hook = read_hook;
--  env->write_hook = write_hook;
-+  grub_sprintf (mangled_name, "\e%s", name);
-+  return mangled_name;
-+}
-+
-+grub_err_t
-+grub_env_set_data_slot (const char *name, const void *ptr)
-+{
-+  char *mangled_name;
-+  struct grub_env_var *var;
-+
-+  mangled_name = mangle_data_slot_name (name);
-+  if (! mangled_name)
-+    goto fail;
-+
-+  /* If the variable does already exist, just update the variable.  */
-+  var = grub_env_find (mangled_name);
-+  if (var)
-+    {
-+      var->value = (char *) ptr;
-+      return GRUB_ERR_NONE;
-+    }
-+
-+  /* The variable does not exist, so create a new one.  */
-+  var = grub_malloc (sizeof (*var));
-+  if (! var)
-+    goto fail;
-+  
-+  grub_memset (var, 0, sizeof (*var));
-+
-+  var->type = GRUB_ENV_VAR_DATA;
-+  var->name = mangled_name;
-+  var->value = (char *) ptr;
-+
-+  grub_env_insert (current_context, var);
-   return GRUB_ERR_NONE;
-+
-+ fail:
-+
-+  grub_free (mangled_name);
-+  return grub_errno;
-+}
-+
-+void *
-+grub_env_get_data_slot (const char *name)
-+{
-+  char *mangled_name;
-+  void *ptr = 0;
-+  
-+  mangled_name = mangle_data_slot_name (name);
-+  if (! mangled_name)
-+    goto fail;
-+
-+  ptr = grub_env_get (mangled_name);
-+  grub_free (mangled_name);
-+
-+ fail:
-+  
-+  return ptr;
-+}
-+
-+void
-+grub_env_unset_data_slot (const char *name)
-+{
-+  char *mangled_name;
-+  
-+  mangled_name = mangle_data_slot_name (name);
-+  if (! mangled_name)
-+    return;
-+
-+  grub_env_unset (mangled_name);
-+  grub_free (mangled_name);
- }
-Index: kern/err.c
-===================================================================
-RCS file: /cvsroot/grub/grub2/kern/err.c,v
-retrieving revision 1.4
-retrieving revision 1.5
-diff -u -r1.4 -r1.5
---- kern/err.c 23 Dec 2005 22:59:12 -0000      1.4
-+++ kern/err.c 23 Apr 2006 13:37:36 -0000      1.5
-@@ -60,7 +60,7 @@
-   grub_vprintf (fmt, ap);
-   va_end (ap);
--  grub_stop ();
-+  grub_abort ();
- }
- void
-Index: kern/file.c
-===================================================================
-RCS file: /cvsroot/grub/grub2/kern/file.c,v
-retrieving revision 1.5
-retrieving revision 1.6
-diff -u -r1.5 -r1.6
---- kern/file.c        15 Oct 2005 17:28:36 -0000      1.5
-+++ kern/file.c        4 Jun 2006 15:56:54 -0000       1.6
-@@ -1,7 +1,7 @@
- /* file.c - file I/O functions */
- /*
-  *  GRUB  --  GRand Unified Bootloader
-- *  Copyright (C) 2002  Free Software Foundation, Inc.
-+ *  Copyright (C) 2002,2006  Free Software Foundation, Inc.
-  *
-  *  GRUB is free software; you can redistribute it and/or modify
-  *  it under the terms of the GNU General Public License as published by
-@@ -112,13 +112,17 @@
- }
- grub_ssize_t
--grub_file_read (grub_file_t file, char *buf, grub_ssize_t len)
-+grub_file_read (grub_file_t file, char *buf, grub_size_t len)
- {
-   grub_ssize_t res;
-   
-   if (len == 0 || len > file->size - file->offset)
-     len = file->size - file->offset;
-+  /* Prevent an overflow.  */
-+  if ((grub_ssize_t) len < 0)
-+    len >>= 1;
-+  
-   if (len == 0)
-     return 0;
-   
-@@ -141,12 +145,12 @@
-   return grub_errno;
- }
--grub_ssize_t
--grub_file_seek (grub_file_t file, grub_ssize_t offset)
-+grub_off_t
-+grub_file_seek (grub_file_t file, grub_off_t offset)
- {
--  grub_ssize_t old;
-+  grub_off_t old;
--  if (offset < 0 || offset > file->size)
-+  if (offset > file->size)
-     {
-       grub_error (GRUB_ERR_OUT_OF_RANGE,
-                 "attempt to seek outside of the file");
-Index: kern/fs.c
-===================================================================
-RCS file: /cvsroot/grub/grub2/kern/fs.c,v
-retrieving revision 1.4
-retrieving revision 1.5
-diff -u -r1.4 -r1.5
---- kern/fs.c  3 Jul 2005 18:06:56 -0000       1.4
-+++ kern/fs.c  4 Jun 2006 15:56:54 -0000       1.5
-@@ -132,7 +132,7 @@
- struct grub_fs_block
- {
--  unsigned long offset;
-+  grub_disk_addr_t offset;
-   unsigned long length;
- };
-@@ -150,6 +150,8 @@
-     {
-       num++;
-       p = grub_strchr (p, ',');
-+      if (p)
-+      p++;
-     }
-   while (p);
-@@ -164,7 +166,7 @@
-     {
-       if (*p != '+')
-       {
--        blocks[i].offset = grub_strtoul (p, &p, 0);
-+        blocks[i].offset = grub_strtoull (p, &p, 0);
-         if (grub_errno != GRUB_ERR_NONE || *p != '+')
-           {
-             grub_error (GRUB_ERR_BAD_FILENAME,
-@@ -207,11 +209,11 @@
- }
- static grub_ssize_t
--grub_fs_blocklist_read (grub_file_t file, char *buf, grub_ssize_t len)
-+grub_fs_blocklist_read (grub_file_t file, char *buf, grub_size_t len)
- {
-   struct grub_fs_block *p;
--  unsigned long sector;
--  unsigned long offset;
-+  grub_disk_addr_t sector;
-+  grub_off_t offset;
-   grub_ssize_t ret = 0;
-   if (len > file->size - file->offset)
-@@ -223,7 +225,7 @@
-     {
-       if (sector < p->length)
-       {
--        grub_ssize_t size;
-+        grub_size_t size;
-         size = len;
-         if (((size + offset + GRUB_DISK_SECTOR_SIZE - 1)
-Index: kern/loader.c
-===================================================================
-RCS file: /cvsroot/grub/grub2/kern/loader.c,v
-retrieving revision 1.7
-retrieving revision 1.8
-diff -u -r1.7 -r1.8
---- kern/loader.c      27 Feb 2005 21:19:05 -0000      1.7
-+++ kern/loader.c      30 Apr 2006 21:09:37 -0000      1.8
-@@ -1,6 +1,6 @@
- /*
-  *  GRUB  --  GRand Unified Bootloader
-- *  Copyright (C) 2002,2003,2004  Free Software Foundation, Inc.
-+ *  Copyright (C) 2002,2003,2004,2006  Free Software Foundation, Inc.
-  *
-  *  GRUB is free software; you can redistribute it and/or modify
-  *  it under the terms of the GNU General Public License as published by
-@@ -25,6 +25,7 @@
- static grub_err_t (*grub_loader_boot_func) (void);
- static grub_err_t (*grub_loader_unload_func) (void);
-+static int grub_loader_noreturn;
- static int grub_loader_loaded;
-@@ -36,14 +37,16 @@
- void
- grub_loader_set (grub_err_t (*boot) (void),
--               grub_err_t (*unload) (void))
-+               grub_err_t (*unload) (void),
-+               int noreturn)
- {
-   if (grub_loader_loaded && grub_loader_unload_func)
-     grub_loader_unload_func ();
-   
-   grub_loader_boot_func = boot;
-   grub_loader_unload_func = unload;
--
-+  grub_loader_noreturn = noreturn;
-+  
-   grub_loader_loaded = 1;
- }
-@@ -65,7 +68,8 @@
-   if (! grub_loader_loaded)
-     return grub_error (GRUB_ERR_NO_KERNEL, "no loaded kernel");
--  grub_machine_fini ();
-+  if (grub_loader_noreturn)
-+    grub_machine_fini ();
-   
-   return (grub_loader_boot_func) ();
- }
-Index: kern/main.c
-===================================================================
-RCS file: /cvsroot/grub/grub2/kern/main.c,v
-retrieving revision 1.11
-retrieving revision 1.12
-diff -u -r1.11 -r1.12
---- kern/main.c        12 Aug 2005 19:53:32 -0000      1.11
-+++ kern/main.c        25 Apr 2006 20:08:31 -0000      1.12
-@@ -118,14 +118,15 @@
-   grub_printf ("Welcome to GRUB!\n\n");
-   grub_setcolorstate (GRUB_TERM_COLOR_STANDARD);
--  /* It is better to set the root device as soon as possible,
--     for convenience.  */
--  grub_set_root_dev ();
--
-   /* Load pre-loaded modules and free the space.  */
-   grub_register_exported_symbols ();
-   grub_load_modules ();
-+  /* It is better to set the root device as soon as possible,
-+     for convenience.  */
-+  grub_machine_set_prefix ();
-+  grub_set_root_dev ();
-+
-   /* Load the normal mode module.  */
-   grub_load_normal_mode ();
-   
-Index: kern/misc.c
-===================================================================
-RCS file: /cvsroot/grub/grub2/kern/misc.c,v
-retrieving revision 1.25
-retrieving revision 1.31
-diff -u -r1.25 -r1.31
---- kern/misc.c        28 Oct 2005 03:14:33 -0000      1.25
-+++ kern/misc.c        4 Jun 2006 15:56:54 -0000       1.31
-@@ -129,16 +129,18 @@
- }  
- void
--grub_real_dprintf(const char *file, const int line, const char *condition,
--                  const char *fmt, ...)
-+grub_real_dprintf (const char *file, const int line, const char *condition,
-+                 const char *fmt, ...)
- {
-   va_list args;
-   const char *debug = grub_env_get ("debug");
-+  
-   if (! debug)
-     return;
-+  
-   if (grub_strword (debug, "all") || grub_strword (debug, condition))
-     {
--      grub_printf ("%s,%d : ", file, line);
-+      grub_printf ("%s:%d: ", file, line);
-       va_start (args, fmt);
-       grub_vprintf (fmt, args);
-       va_end (args);
-@@ -336,10 +338,26 @@
-   return c;
- }
-+
- unsigned long
- grub_strtoul (const char *str, char **end, int base)
- {
--  unsigned long num = 0;
-+  unsigned long long num;
-+
-+  num = grub_strtoull (str, end, base);
-+  if (num > ~0UL)
-+    {
-+      grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
-+      return ~0UL;
-+    }
-+
-+  return (unsigned long) num;
-+}
-+
-+unsigned long long
-+grub_strtoull (const char *str, char **end, int base)
-+{
-+  unsigned long long num = 0;
-   int found = 0;
-   
-   /* Skip white spaces.  */
-@@ -378,11 +396,12 @@
-       }
-       found = 1;
--      
--      if (num > (~0UL - digit) / base)
-+
-+      /* NUM * BASE + DIGIT > ~0ULL */
-+      if (num > grub_divmod64 (~0ULL - digit, base, 0))
-       {
-         grub_error (GRUB_ERR_OUT_OF_RANGE, "overflow is detected");
--        return 0;
-+        return ~0ULL;
-       }
-       num = num * base + digit;
-@@ -499,6 +518,90 @@
-   return p;
- }
-+/* Divide N by D, return the quotient, and store the remainder in *R.  */
-+grub_uint64_t
-+grub_divmod64 (grub_uint64_t n, grub_uint32_t d, grub_uint32_t *r)
-+{
-+  /* This algorithm is typically implemented by hardware. The idea
-+     is to get the highest bit in N, 64 times, by keeping
-+     upper(N * 2^i) = upper((Q * 10 + M) * 2^i), where upper
-+     represents the high 64 bits in 128-bits space.  */
-+  unsigned bits = 64;
-+  unsigned long long q = 0;
-+  unsigned m = 0;
-+
-+  /* Skip the slow computation, if 32-bit arithmetics are possible.  */
-+  if (n < 0xffffffff)
-+    {
-+      if (r)
-+      *r = ((grub_uint32_t) n) % d;
-+
-+      return ((grub_uint32_t) n) / d;
-+    }
-+  
-+  while (bits--)
-+    {
-+      m <<= 1;
-+      
-+      if (n & (1ULL << 63))
-+      m |= 1;
-+      
-+      q <<= 1;
-+      n <<= 1;
-+      
-+      if (m >= d)
-+      {
-+        q |= 1;
-+        m -= d;
-+      }
-+    }
-+
-+  if (r)
-+    *r = m;
-+  
-+  return q;
-+}
-+
-+/* Convert a long long value to a string. This function avoids 64-bit
-+   modular arithmetic or divisions.  */
-+static char *
-+grub_lltoa (char *str, int c, unsigned long long n)
-+{
-+  unsigned base = (c == 'x') ? 16 : 10;
-+  char *p;
-+  
-+  if ((long long) n < 0 && c == 'd')
-+    {
-+      n = (unsigned long long) (-((long long) n));
-+      *str++ = '-';
-+    }
-+
-+  p = str;
-+
-+  if (base == 16)
-+    do
-+      {
-+      unsigned d = (unsigned) (n & 0xf);
-+      *p++ = (d > 9) ? d + 'a' - 10 : d + '0';
-+      }
-+    while (n >>= 4);
-+  else
-+    /* BASE == 10 */
-+    do
-+      {
-+      unsigned m;
-+      
-+      n = grub_divmod64 (n, 10, &m);
-+      *p++ = m + '0';
-+      }
-+    while (n);
-+  
-+  *p = 0;
-+
-+  grub_reverse (str);
-+  return p;
-+}
-+
- static char *
- grub_ftoa (char *str, double f, int round)
- {
-@@ -555,7 +658,7 @@
-       write_char (c);
-       else
-       {
--        char tmp[16];
-+        char tmp[32];
-         char *p;
-         unsigned int format1 = 0;
-         unsigned int format2 = 3;
-@@ -563,6 +666,7 @@
-         int rightfill = 0;
-         int n;
-         int longfmt = 0;
-+        int longlongfmt = 0;
-         if (*fmt && *fmt =='-')
-           {
-@@ -606,6 +710,11 @@
-           {
-             longfmt = 1;
-             c = *fmt++;
-+            if (c == 'l')
-+              {
-+                longlongfmt = 1;
-+                c = *fmt++;
-+              }
-           }
-         switch (c)
-@@ -613,16 +722,27 @@
-           case 'p':
-             write_str ("0x");
-             c = 'x';
-+            longlongfmt = (sizeof (void *) == sizeof (long long));
-             /* fall through */
-           case 'x':
-           case 'u':
-           case 'd':
--            if (longfmt)
--              n = va_arg (args, long);
-+            if (longlongfmt)
-+              {
-+                long long ll;
-+
-+                ll = va_arg (args, long long);
-+                grub_lltoa (tmp, c, ll);
-+              }
-             else
--              n = va_arg (args, int);
--            grub_itoa (tmp, c, n);
--            if (!rightfill && grub_strlen (tmp) < format1)
-+              {
-+                if (longfmt)
-+                  n = va_arg (args, long);
-+                else
-+                  n = va_arg (args, int);
-+                grub_itoa (tmp, c, n);
-+              }
-+            if (! rightfill && grub_strlen (tmp) < format1)
-               write_fill (zerofill, format1 - grub_strlen (tmp));
-             write_str (tmp);
-             if (rightfill && grub_strlen (tmp) < format1)
-@@ -875,3 +995,18 @@
-   return p - dest;
- }
-+
-+/* Abort GRUB. This function does not return.  */
-+void
-+grub_abort (void)
-+{
-+  if (grub_term_get_current ())
-+    {
-+      grub_printf ("\nAborted. Press any key to exit.");
-+      grub_getkey ();
-+    }
-+
-+  grub_exit ();
-+}
-+/* GCC emits references to abort().  */
-+void abort (void) __attribute__ ((alias ("grub_abort")));
-Index: kern/mm.c
-===================================================================
-RCS file: /cvsroot/grub/grub2/kern/mm.c,v
-retrieving revision 1.13
-retrieving revision 1.14
-diff -u -r1.13 -r1.14
---- kern/mm.c  21 Aug 2005 18:42:54 -0000      1.13
-+++ kern/mm.c  25 Apr 2006 20:08:31 -0000      1.14
-@@ -67,6 +67,13 @@
- #include <grub/disk.h>
- #include <grub/dl.h>
-+#ifdef MM_DEBUG
-+# undef grub_malloc
-+# undef grub_realloc
-+# undef grub_free
-+# undef grub_memalign
-+#endif
-+
- /* Magic words.  */
- #define GRUB_MM_FREE_MAGIC    0x2d3c2808
- #define GRUB_MM_ALLOC_MAGIC   0x6db08fa4
-@@ -388,7 +395,9 @@
-   return q;
- }
--#if MM_DEBUG
-+#ifdef MM_DEBUG
-+grub_mm_debug = 0;
-+
- void
- grub_mm_dump (unsigned lineno)
- {
-@@ -419,4 +428,51 @@
-   grub_printf ("\n");
- }
-+
-+void *
-+grub_debug_malloc (const char *file, int line, grub_size_t size)
-+{
-+  void *ptr;
-+
-+  if (grub_mm_debug)
-+    grub_printf ("%s:%d: malloc (0x%x) = ", file, line, size);
-+  ptr = grub_malloc (size);
-+  if (grub_mm_debug)
-+    grub_printf ("%p\n", ptr);
-+  return ptr;
-+}
-+
-+void
-+grub_debug_free (const char *file, int line, void *ptr)
-+{
-+  if (grub_mm_debug)
-+    grub_printf ("%s:%d: free (%p)\n", file, line, ptr);
-+}
-+
-+void *
-+grub_debug_realloc (const char *file, int line, void *ptr, grub_size_t size)
-+{
-+  if (grub_mm_debug)
-+    grub_printf ("%s:%d: realloc (%p, 0x%x) = ", file, line, ptr, size);
-+  ptr = grub_realloc (ptr, size);
-+  if (grub_mm_debug)
-+    grub_printf ("%p\n", ptr);
-+  return ptr;
-+}
-+
-+void *
-+grub_debug_memalign (const char *file, int line, grub_size_t align,
-+                  grub_size_t size)
-+{
-+  void *ptr;
-+  
-+  if (grub_mm_debug)
-+    grub_printf ("%s:%d: memalign (0x%x, 0x%x) = ",
-+               file, line, align, size);
-+  ptr = grub_memalign (align, size);
-+  if (grub_mm_debug)
-+    grub_printf ("%p\n", ptr);
-+  return ptr;
-+}
-+
- #endif /* MM_DEBUG */
-Index: kern/rescue.c
-===================================================================
-RCS file: /cvsroot/grub/grub2/kern/rescue.c,v
-retrieving revision 1.16
-retrieving revision 1.17
-diff -u -r1.16 -r1.17
---- kern/rescue.c      24 Oct 2005 10:23:46 -0000      1.16
-+++ kern/rescue.c      23 Apr 2006 13:37:36 -0000      1.17
-@@ -580,6 +580,14 @@
-   grub_env_unset (argv[0]);
- }
-+/* exit */
-+static void
-+grub_rescue_cmd_exit (int argc __attribute__ ((unused)),
-+                    char *argv[] __attribute__ ((unused)))
-+{
-+  grub_exit ();
-+}
-+
- static void
- attempt_normal_mode (void)
- {
-@@ -635,6 +643,8 @@
-                               "set an environment variable");
-   grub_rescue_register_command ("unset", grub_rescue_cmd_unset,
-                               "remove an environment variable");
-+  grub_rescue_register_command ("exit", grub_rescue_cmd_exit,
-+                              "exit from GRUB");
-   
-   while (1)
-     {
-Index: kern/efi/efi.c
-===================================================================
-RCS file: kern/efi/efi.c
-diff -N kern/efi/efi.c
---- /dev/null  1 Jan 1970 00:00:00 -0000
-+++ kern/efi/efi.c     27 May 2006 21:09:25 -0000      1.7
-@@ -0,0 +1,720 @@
-+/* efi.c - generic EFI support */
-+/*
-+ *  GRUB  --  GRand Unified Bootloader
-+ *  Copyright (C) 2006  Free Software Foundation, Inc.
-+ *
-+ *  This program is free software; you can redistribute it and/or modify
-+ *  it under the terms of the GNU General Public License as published by
-+ *  the Free Software Foundation; either version 2 of the License, or
-+ *  (at your option) any later version.
-+ *
-+ *  This program is distributed in the hope that it will be useful,
-+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+ *  GNU General Public License for more details.
-+ *
-+ *  You should have received a copy of the GNU General Public License
-+ *  along with this program; if not, write to the Free Software
-+ *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-+ */
-+
-+#include <grub/misc.h>
-+#include <grub/efi/api.h>
-+#include <grub/efi/efi.h>
-+#include <grub/efi/console_control.h>
-+#include <grub/efi/pe32.h>
-+#include <grub/machine/time.h>
-+#include <grub/term.h>
-+#include <grub/kernel.h>
-+#include <grub/mm.h>
-+
-+/* The handle of GRUB itself. Filled in by the startup code.  */
-+grub_efi_handle_t grub_efi_image_handle;
-+
-+/* The pointer to a system table. Filled in by the startup code.  */
-+grub_efi_system_table_t *grub_efi_system_table;
-+
-+static grub_efi_guid_t console_control_guid = GRUB_EFI_CONSOLE_CONTROL_GUID;
-+static grub_efi_guid_t loaded_image_guid = GRUB_EFI_LOADED_IMAGE_GUID;
-+static grub_efi_guid_t device_path_guid = GRUB_EFI_DEVICE_PATH_GUID;
-+
-+void *
-+grub_efi_locate_protocol (grub_efi_guid_t *protocol, void *registration)
-+{
-+  void *interface;
-+  grub_efi_status_t status;
-+  
-+  status = grub_efi_system_table->boot_services->locate_protocol (protocol,
-+                                                                registration,
-+                                                                &interface);
-+  if (status != GRUB_EFI_SUCCESS)
-+    return 0;
-+  
-+  return interface;
-+}
-+
-+/* Return the array of handles which meet the requirement. If successful,
-+   the number of handles is stored in NUM_HANDLES. The array is allocated
-+   from the heap.  */
-+grub_efi_handle_t *
-+grub_efi_locate_handle (grub_efi_locate_search_type_t search_type,
-+                      grub_efi_guid_t *protocol,
-+                      void *search_key,
-+                      grub_efi_uintn_t *num_handles)
-+{
-+  grub_efi_boot_services_t *b;
-+  grub_efi_status_t status;
-+  grub_efi_handle_t *buffer;
-+  grub_efi_uintn_t buffer_size = 8 * sizeof (grub_efi_handle_t);
-+  
-+  buffer = grub_malloc (buffer_size);
-+  if (! buffer)
-+    return 0;
-+  
-+  b = grub_efi_system_table->boot_services;
-+  status = b->locate_handle (search_type, protocol, search_key,
-+                           &buffer_size, buffer);
-+  if (status == GRUB_EFI_BUFFER_TOO_SMALL)
-+    {
-+      grub_free (buffer);
-+      buffer = grub_malloc (buffer_size);
-+      if (! buffer)
-+      return 0;
-+      
-+      status = b->locate_handle (search_type, protocol, search_key,
-+                               &buffer_size, buffer);
-+    }
-+
-+  if (status != GRUB_EFI_SUCCESS)
-+    {
-+      grub_free (buffer);
-+      return 0;
-+    }
-+
-+  *num_handles = buffer_size / sizeof (grub_efi_handle_t);
-+  return buffer;
-+}
-+
-+void *
-+grub_efi_open_protocol (grub_efi_handle_t handle,
-+                      grub_efi_guid_t *protocol,
-+                      grub_efi_uint32_t attributes)
-+{
-+  grub_efi_boot_services_t *b;
-+  grub_efi_status_t status;
-+  void *interface;
-+  
-+  b = grub_efi_system_table->boot_services;
-+  status = b->open_protocol (handle,
-+                           protocol,
-+                           &interface,
-+                           grub_efi_image_handle,
-+                           0,
-+                           attributes);
-+  if (status != GRUB_EFI_SUCCESS)
-+    return 0;
-+
-+  return interface;
-+}
-+
-+int
-+grub_efi_set_text_mode (int on)
-+{
-+  grub_efi_console_control_protocol_t *c;
-+  grub_efi_screen_mode_t mode, new_mode;
-+
-+  c = grub_efi_locate_protocol (&console_control_guid, 0);
-+  if (! c)
-+    return 0;
-+  
-+  if (c->get_mode (c, &mode, 0, 0) != GRUB_EFI_SUCCESS)
-+    return 0;
-+
-+  new_mode = on ? GRUB_EFI_SCREEN_TEXT : GRUB_EFI_SCREEN_GRAPHICS;
-+  if (mode != new_mode)
-+    if (c->set_mode (c, new_mode) != GRUB_EFI_SUCCESS)
-+      return 0;
-+
-+  return 1;
-+}
-+
-+void
-+grub_efi_stall (grub_efi_uintn_t microseconds)
-+{
-+  grub_efi_system_table->boot_services->stall (microseconds);
-+}
-+
-+grub_efi_loaded_image_t *
-+grub_efi_get_loaded_image (grub_efi_handle_t image_handle)
-+{
-+  return grub_efi_open_protocol (image_handle,
-+                               &loaded_image_guid,
-+                               GRUB_EFI_OPEN_PROTOCOL_GET_PROTOCOL);
-+}
-+
-+void
-+grub_exit (void)
-+{
-+  grub_efi_fini ();
-+  grub_efi_system_table->boot_services->exit (grub_efi_image_handle,
-+                                            GRUB_EFI_SUCCESS,
-+                                            0, 0);
-+}
-+
-+int
-+grub_efi_exit_boot_services (grub_efi_uintn_t map_key)
-+{
-+  grub_efi_boot_services_t *b;
-+  grub_efi_status_t status;
-+  
-+  b = grub_efi_system_table->boot_services;
-+  status = b->exit_boot_services (grub_efi_image_handle, map_key);
-+  return status == GRUB_EFI_SUCCESS;
-+}
-+
-+grub_uint32_t
-+grub_get_rtc (void)
-+{
-+  grub_efi_time_t time;
-+  grub_efi_runtime_services_t *r;
-+
-+  r = grub_efi_system_table->runtime_services;
-+  if (r->get_time (&time, 0) != GRUB_EFI_SUCCESS)
-+    /* What is possible in this case?  */
-+    return 0;
-+
-+  return (((time.minute * 60 + time.second) * 1000
-+         + time.nanosecond / 1000000)
-+        * GRUB_TICKS_PER_SECOND / 1000);
-+}
-+
-+/* Search the mods section from the PE32/PE32+ image. This code uses
-+   a PE32 header, but should work with PE32+ as well.  */
-+grub_addr_t
-+grub_arch_modules_addr (void)
-+{
-+  grub_efi_loaded_image_t *image;
-+  struct grub_pe32_header *header;
-+  struct grub_pe32_coff_header *coff_header;
-+  struct grub_pe32_section_table *sections;
-+  struct grub_pe32_section_table *section;
-+  struct grub_module_info *info;
-+  grub_uint16_t i;
-+  
-+  image = grub_efi_get_loaded_image (grub_efi_image_handle);
-+  if (! image)
-+    return 0;
-+
-+  header = image->image_base;
-+  coff_header = &(header->coff_header);
-+  sections
-+    = (struct grub_pe32_section_table *) ((char *) coff_header
-+                                        + sizeof (*coff_header)
-+                                        + coff_header->optional_header_size);
-+
-+  for (i = 0, section = sections;
-+       i < coff_header->num_sections;
-+       i++, section++)
-+    {
-+      if (grub_strcmp (section->name, "mods") == 0)
-+      break;
-+    }
-+
-+  if (i == coff_header->num_sections)
-+    return 0;
-+
-+  info = (struct grub_module_info *) ((char *) image->image_base
-+                                    + section->virtual_address);
-+  if (info->magic != GRUB_MODULE_MAGIC)
-+    return 0;
-+
-+  return (grub_addr_t) info;
-+}
-+
-+char *
-+grub_efi_get_filename (grub_efi_device_path_t *dp)
-+{
-+  char *name = 0;
-+  
-+  while (1)
-+    {
-+      grub_efi_uint8_t type = GRUB_EFI_DEVICE_PATH_TYPE (dp);
-+      grub_efi_uint8_t subtype = GRUB_EFI_DEVICE_PATH_SUBTYPE (dp);
-+
-+      if (type == GRUB_EFI_END_DEVICE_PATH_TYPE)
-+      break;
-+      else if (type == GRUB_EFI_MEDIA_DEVICE_PATH_TYPE
-+             && subtype == GRUB_EFI_FILE_PATH_DEVICE_PATH_SUBTYPE)
-+      {
-+        grub_efi_file_path_device_path_t *fp;
-+        grub_efi_uint16_t len;
-+        char *p;
-+        grub_size_t size;
-+
-+        if (name)
-+          {
-+            size = grub_strlen (name);
-+            name[size] = '/';
-+            size++;
-+          }
-+        else
-+          size = 0;
-+        
-+        len = ((GRUB_EFI_DEVICE_PATH_LENGTH (dp) - 4)
-+               / sizeof (grub_efi_char16_t));
-+        p = grub_realloc (name, size + len * 4 + 1);
-+        if (! p)
-+          {
-+            grub_free (name);
-+            return 0;
-+          }
-+
-+        name = p;
-+        fp = (grub_efi_file_path_device_path_t *) dp;
-+        *grub_utf16_to_utf8 ((grub_uint8_t *) name + size,
-+                             fp->path_name, len) = '\0';
-+      }
-+
-+      dp = GRUB_EFI_NEXT_DEVICE_PATH (dp);
-+    }
-+
-+  if (name)
-+    {
-+      /* EFI breaks paths with backslashes.  */
-+      char *p;
-+
-+      for (p = name; *p; p++)
-+      if (*p == '\\')
-+        *p = '/';
-+    }
-+
-+  return name;
-+}
-+
-+grub_efi_device_path_t *
-+grub_efi_get_device_path (grub_efi_handle_t handle)
-+{
-+  return grub_efi_open_protocol (handle, &device_path_guid,
-+                               GRUB_EFI_OPEN_PROTOCOL_GET_PROTOCOL);
-+}
-+
-+/* Print the chain of Device Path nodes. This is mainly for debugging. */
-+void
-+grub_efi_print_device_path (grub_efi_device_path_t *dp)
-+{
-+  while (1)
-+    {
-+      grub_efi_uint8_t type = GRUB_EFI_DEVICE_PATH_TYPE (dp);
-+      grub_efi_uint8_t subtype = GRUB_EFI_DEVICE_PATH_SUBTYPE (dp);
-+      grub_efi_uint16_t len = GRUB_EFI_DEVICE_PATH_LENGTH (dp);
-+
-+      switch (type)
-+      {
-+      case GRUB_EFI_END_DEVICE_PATH_TYPE:
-+        switch (subtype)
-+          {
-+          case GRUB_EFI_END_ENTIRE_DEVICE_PATH_SUBTYPE:
-+            grub_printf ("/EndEntire\n");
-+            //grub_putchar ('\n');
-+            break;
-+          case GRUB_EFI_END_THIS_DEVICE_PATH_SUBTYPE:
-+            grub_printf ("/EndThis\n");
-+            //grub_putchar ('\n');
-+            break;
-+          default:
-+            grub_printf ("/EndUnknown(%x)\n", (unsigned) subtype);
-+            break;
-+          }
-+        break;
-+
-+      case GRUB_EFI_HARDWARE_DEVICE_PATH_TYPE:
-+        switch (subtype)
-+          {
-+          case GRUB_EFI_PCI_DEVICE_PATH_SUBTYPE:
-+            {
-+              grub_efi_pci_device_path_t pci;
-+              grub_memcpy (&pci, dp, len);
-+              grub_printf ("/PCI(%x,%x)",
-+                           (unsigned) pci.function, (unsigned) pci.device);
-+            }
-+            break;
-+          case GRUB_EFI_PCCARD_DEVICE_PATH_SUBTYPE:
-+            {
-+              grub_efi_pccard_device_path_t pccard;
-+              grub_memcpy (&pccard, dp, len);
-+              grub_printf ("/PCCARD(%x)",
-+                           (unsigned) pccard.function);
-+            }
-+            break;
-+          case GRUB_EFI_MEMORY_MAPPED_DEVICE_PATH_SUBTYPE:
-+            {
-+              grub_efi_memory_mapped_device_path_t mmapped;
-+              grub_memcpy (&mmapped, dp, len);
-+              grub_printf ("/MMap(%x,%llx,%llx)",
-+                           (unsigned) mmapped.memory_type,
-+                           mmapped.start_address,
-+                           mmapped.end_address);
-+            }
-+            break;
-+          case GRUB_EFI_VENDOR_DEVICE_PATH_SUBTYPE:
-+            {
-+              grub_efi_vendor_device_path_t vendor;
-+              grub_memcpy (&vendor, dp, sizeof (vendor));
-+              grub_printf ("/Vendor(%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x)",
-+                           (unsigned) vendor.vendor_guid.data1,
-+                           (unsigned) vendor.vendor_guid.data2,
-+                           (unsigned) vendor.vendor_guid.data3,
-+                           (unsigned) vendor.vendor_guid.data4[0],
-+                           (unsigned) vendor.vendor_guid.data4[1],
-+                           (unsigned) vendor.vendor_guid.data4[2],
-+                           (unsigned) vendor.vendor_guid.data4[3],
-+                           (unsigned) vendor.vendor_guid.data4[4],
-+                           (unsigned) vendor.vendor_guid.data4[5],
-+                           (unsigned) vendor.vendor_guid.data4[6],
-+                           (unsigned) vendor.vendor_guid.data4[7]);
-+            }
-+            break;
-+          case GRUB_EFI_CONTROLLER_DEVICE_PATH_SUBTYPE:
-+            {
-+              grub_efi_controller_device_path_t controller;
-+              grub_memcpy (&controller, dp, len);
-+              grub_printf ("/Ctrl(%x)",
-+                           (unsigned) controller.controller_number);
-+            }
-+            break;
-+          default:
-+            grub_printf ("/UnknownHW(%x)", (unsigned) subtype);
-+            break;
-+          }
-+        break;
-+
-+      case GRUB_EFI_ACPI_DEVICE_PATH_TYPE:
-+        switch (subtype)
-+          {
-+          case GRUB_EFI_ACPI_DEVICE_PATH_SUBTYPE:
-+            {
-+              grub_efi_acpi_device_path_t acpi;
-+              grub_memcpy (&acpi, dp, len);
-+              grub_printf ("/ACPI(%x,%x)",
-+                           (unsigned) acpi.hid,
-+                           (unsigned) acpi.uid);
-+            }
-+            break;
-+          case GRUB_EFI_EXPANDED_ACPI_DEVICE_PATH_SUBTYPE:
-+            {
-+              grub_efi_expanded_acpi_device_path_t eacpi;
-+              grub_memcpy (&eacpi, dp, sizeof (eacpi));
-+              grub_printf ("/ACPI(");
-+              
-+              if (GRUB_EFI_EXPANDED_ACPI_HIDSTR (dp)[0] == '\0')
-+                grub_printf ("%x,", (unsigned) eacpi.hid);
-+              else
-+                grub_printf ("%s,", GRUB_EFI_EXPANDED_ACPI_HIDSTR (dp));
-+              
-+              if (GRUB_EFI_EXPANDED_ACPI_UIDSTR (dp)[0] == '\0')
-+                grub_printf ("%x,", (unsigned) eacpi.uid);
-+              else
-+                grub_printf ("%s,", GRUB_EFI_EXPANDED_ACPI_UIDSTR (dp));
-+              
-+              if (GRUB_EFI_EXPANDED_ACPI_CIDSTR (dp)[0] == '\0')
-+                grub_printf ("%x)", (unsigned) eacpi.cid);
-+              else
-+                grub_printf ("%s)", GRUB_EFI_EXPANDED_ACPI_CIDSTR (dp));
-+            }
-+            break;
-+          default:
-+            grub_printf ("/UnknownACPI(%x)", (unsigned) subtype);
-+            break;
-+          }
-+        break;
-+
-+      case GRUB_EFI_MESSAGING_DEVICE_PATH_TYPE:
-+        switch (subtype)
-+          {
-+          case GRUB_EFI_ATAPI_DEVICE_PATH_SUBTYPE:
-+            {
-+              grub_efi_atapi_device_path_t atapi;
-+              grub_memcpy (&atapi, dp, len);
-+              grub_printf ("/ATAPI(%x,%x,%x)",
-+                           (unsigned) atapi.primary_secondary,
-+                           (unsigned) atapi.slave_master,
-+                           (unsigned) atapi.lun);
-+            }
-+            break;
-+          case GRUB_EFI_SCSI_DEVICE_PATH_SUBTYPE:
-+            {
-+              grub_efi_scsi_device_path_t scsi;
-+              grub_memcpy (&scsi, dp, len);
-+              grub_printf ("/SCSI(%x,%x)",
-+                           (unsigned) scsi.pun,
-+                           (unsigned) scsi.lun);
-+            }
-+            break;
-+          case GRUB_EFI_FIBRE_CHANNEL_DEVICE_PATH_SUBTYPE:
-+            {
-+              grub_efi_fibre_channel_device_path_t fc;
-+              grub_memcpy (&fc, dp, len);
-+              grub_printf ("/FibreChannel(%llx,%llx)",
-+                           fc.wwn, fc.lun);
-+            }
-+            break;
-+          case GRUB_EFI_1394_DEVICE_PATH_SUBTYPE:
-+            {
-+              grub_efi_1394_device_path_t firewire;
-+              grub_memcpy (&firewire, dp, len);
-+              grub_printf ("/1394(%llx)", firewire.guid);
-+            }
-+            break;
-+          case GRUB_EFI_USB_DEVICE_PATH_SUBTYPE:
-+            {
-+              grub_efi_usb_device_path_t usb;
-+              grub_memcpy (&usb, dp, len);
-+              grub_printf ("/USB(%x,%x)",
-+                           (unsigned) usb.parent_port_number,
-+                           (unsigned) usb.interface);
-+            }
-+            break;
-+          case GRUB_EFI_USB_CLASS_DEVICE_PATH_SUBTYPE:
-+            {
-+              grub_efi_usb_class_device_path_t usb_class;
-+              grub_memcpy (&usb_class, dp, len);
-+              grub_printf ("/USBClass(%x,%x,%x,%x,%x)",
-+                           (unsigned) usb_class.vendor_id,
-+                           (unsigned) usb_class.product_id,
-+                           (unsigned) usb_class.device_class,
-+                           (unsigned) usb_class.device_subclass,
-+                           (unsigned) usb_class.device_protocol);
-+            }
-+            break;
-+          case GRUB_EFI_I2O_DEVICE_PATH_SUBTYPE:
-+            {
-+              grub_efi_i2o_device_path_t i2o;
-+              grub_memcpy (&i2o, dp, len);
-+              grub_printf ("/I2O(%x)", (unsigned) i2o.tid);
-+            }
-+            break;
-+          case GRUB_EFI_MAC_ADDRESS_DEVICE_PATH_SUBTYPE:
-+            {
-+              grub_efi_mac_address_device_path_t mac;
-+              grub_memcpy (&mac, dp, len);
-+              grub_printf ("/MacAddr(%02x:%02x:%02x:%02x:%02x:%02x,%x)",
-+                           (unsigned) mac.mac_address[0],
-+                           (unsigned) mac.mac_address[1],
-+                           (unsigned) mac.mac_address[2],
-+                           (unsigned) mac.mac_address[3],
-+                           (unsigned) mac.mac_address[4],
-+                           (unsigned) mac.mac_address[5],
-+                           (unsigned) mac.if_type);
-+            }
-+            break;
-+          case GRUB_EFI_IPV4_DEVICE_PATH_SUBTYPE:
-+            {
-+              grub_efi_ipv4_device_path_t ipv4;
-+              grub_memcpy (&ipv4, dp, len);
-+              grub_printf ("/IPv4(%u.%u.%u.%u,%u.%u.%u.%u,%u,%u,%x,%x)",
-+                           (unsigned) ipv4.local_ip_address[0],
-+                           (unsigned) ipv4.local_ip_address[1],
-+                           (unsigned) ipv4.local_ip_address[2],
-+                           (unsigned) ipv4.local_ip_address[3],
-+                           (unsigned) ipv4.remote_ip_address[0],
-+                           (unsigned) ipv4.remote_ip_address[1],
-+                           (unsigned) ipv4.remote_ip_address[2],
-+                           (unsigned) ipv4.remote_ip_address[3],
-+                           (unsigned) ipv4.local_port,
-+                           (unsigned) ipv4.remote_port,
-+                           (unsigned) ipv4.protocol,
-+                           (unsigned) ipv4.static_ip_address);
-+            }
-+            break;
-+          case GRUB_EFI_IPV6_DEVICE_PATH_SUBTYPE:
-+            {
-+              grub_efi_ipv6_device_path_t ipv6;
-+              grub_memcpy (&ipv6, dp, len);
-+              grub_printf ("/IPv6(%x:%x:%x:%x:%x:%x:%x:%x,%x:%x:%x:%x:%x:%x:%x:%x,%u,%u,%x,%x)",
-+                           (unsigned) ipv6.local_ip_address[0],
-+                           (unsigned) ipv6.local_ip_address[1],
-+                           (unsigned) ipv6.local_ip_address[2],
-+                           (unsigned) ipv6.local_ip_address[3],
-+                           (unsigned) ipv6.local_ip_address[4],
-+                           (unsigned) ipv6.local_ip_address[5],
-+                           (unsigned) ipv6.local_ip_address[6],
-+                           (unsigned) ipv6.local_ip_address[7],
-+                           (unsigned) ipv6.remote_ip_address[0],
-+                           (unsigned) ipv6.remote_ip_address[1],
-+                           (unsigned) ipv6.remote_ip_address[2],
-+                           (unsigned) ipv6.remote_ip_address[3],
-+                           (unsigned) ipv6.remote_ip_address[4],
-+                           (unsigned) ipv6.remote_ip_address[5],
-+                           (unsigned) ipv6.remote_ip_address[6],
-+                           (unsigned) ipv6.remote_ip_address[7],
-+                           (unsigned) ipv6.local_port,
-+                           (unsigned) ipv6.remote_port,
-+                           (unsigned) ipv6.protocol,
-+                           (unsigned) ipv6.static_ip_address);
-+            }
-+            break;
-+          case GRUB_EFI_INFINIBAND_DEVICE_PATH_SUBTYPE:
-+            {
-+              grub_efi_infiniband_device_path_t ib;
-+              grub_memcpy (&ib, dp, len);
-+              grub_printf ("/InfiniBand(%x,%llx,%llx,%llx)",
-+                           (unsigned) ib.port_gid[0], /* XXX */
-+                           ib.remote_id,
-+                           ib.target_port_id,
-+                           ib.device_id);
-+            }
-+            break;
-+          case GRUB_EFI_UART_DEVICE_PATH_SUBTYPE:
-+            {
-+              grub_efi_uart_device_path_t uart;
-+              grub_memcpy (&uart, dp, len);
-+              grub_printf ("/UART(%llu,%u,%x,%x)",
-+                           uart.baud_rate,
-+                           uart.data_bits,
-+                           uart.parity,
-+                           uart.stop_bits);
-+            }
-+            break;
-+          case GRUB_EFI_VENDOR_MESSAGING_DEVICE_PATH_SUBTYPE:
-+            {
-+              grub_efi_vendor_messaging_device_path_t vendor;
-+              grub_memcpy (&vendor, dp, sizeof (vendor));
-+              grub_printf ("/Vendor(%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x)",
-+                           (unsigned) vendor.vendor_guid.data1,
-+                           (unsigned) vendor.vendor_guid.data2,
-+                           (unsigned) vendor.vendor_guid.data3,
-+                           (unsigned) vendor.vendor_guid.data4[0],
-+                           (unsigned) vendor.vendor_guid.data4[1],
-+                           (unsigned) vendor.vendor_guid.data4[2],
-+                           (unsigned) vendor.vendor_guid.data4[3],
-+                           (unsigned) vendor.vendor_guid.data4[4],
-+                           (unsigned) vendor.vendor_guid.data4[5],
-+                           (unsigned) vendor.vendor_guid.data4[6],
-+                           (unsigned) vendor.vendor_guid.data4[7]);
-+            }
-+            break;
-+          default:
-+            grub_printf ("/UnknownMessaging(%x)", (unsigned) subtype);
-+            break;
-+          }
-+        break;
-+
-+      case GRUB_EFI_MEDIA_DEVICE_PATH_TYPE:
-+        switch (subtype)
-+          {
-+          case GRUB_EFI_HARD_DRIVE_DEVICE_PATH_SUBTYPE:
-+            {
-+              grub_efi_hard_drive_device_path_t hd;
-+              grub_memcpy (&hd, dp, len);
-+              grub_printf ("/HD(%u,%llx,%llx,%02x%02x%02x%02x%02x%02x%02x%02x,%x,%x)",
-+                           hd.partition_number,
-+                           hd.partition_start,
-+                           hd.partition_size,
-+                           (unsigned) hd.partition_signature[0],
-+                           (unsigned) hd.partition_signature[1],
-+                           (unsigned) hd.partition_signature[2],
-+                           (unsigned) hd.partition_signature[3],
-+                           (unsigned) hd.partition_signature[4],
-+                           (unsigned) hd.partition_signature[5],
-+                           (unsigned) hd.partition_signature[6],
-+                           (unsigned) hd.partition_signature[7],
-+                           (unsigned) hd.mbr_type,
-+                           (unsigned) hd.signature_type);
-+            }
-+            break;
-+          case GRUB_EFI_CDROM_DEVICE_PATH_SUBTYPE:
-+            {
-+              grub_efi_cdrom_device_path_t cd;
-+              grub_memcpy (&cd, dp, len);
-+              grub_printf ("/CD(%u,%llx,%llx)",
-+                           cd.boot_entry,
-+                           cd.partition_start,
-+                           cd.partition_size);
-+            }
-+            break;
-+          case GRUB_EFI_VENDOR_MEDIA_DEVICE_PATH_SUBTYPE:
-+            {
-+              grub_efi_vendor_media_device_path_t vendor;
-+              grub_memcpy (&vendor, dp, sizeof (vendor));
-+              grub_printf ("/Vendor(%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x)",
-+                           (unsigned) vendor.vendor_guid.data1,
-+                           (unsigned) vendor.vendor_guid.data2,
-+                           (unsigned) vendor.vendor_guid.data3,
-+                           (unsigned) vendor.vendor_guid.data4[0],
-+                           (unsigned) vendor.vendor_guid.data4[1],
-+                           (unsigned) vendor.vendor_guid.data4[2],
-+                           (unsigned) vendor.vendor_guid.data4[3],
-+                           (unsigned) vendor.vendor_guid.data4[4],
-+                           (unsigned) vendor.vendor_guid.data4[5],
-+                           (unsigned) vendor.vendor_guid.data4[6],
-+                           (unsigned) vendor.vendor_guid.data4[7]);
-+            }
-+            break;
-+          case GRUB_EFI_FILE_PATH_DEVICE_PATH_SUBTYPE:
-+            {
-+              grub_efi_file_path_device_path_t *fp;
-+              grub_uint8_t buf[(len - 4) * 2 + 1];
-+              fp = (grub_efi_file_path_device_path_t *) dp;
-+              *grub_utf16_to_utf8 (buf, fp->path_name,
-+                                   (len - 4) / sizeof (grub_efi_char16_t))
-+                = '\0';
-+              grub_printf ("/File(%s)", buf);
-+            }
-+            break;
-+          case GRUB_EFI_PROTOCOL_DEVICE_PATH_SUBTYPE:
-+            {
-+              grub_efi_protocol_device_path_t proto;
-+              grub_memcpy (&proto, dp, sizeof (proto));
-+              grub_printf ("/Protocol(%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x)",
-+                           (unsigned) proto.guid.data1,
-+                           (unsigned) proto.guid.data2,
-+                           (unsigned) proto.guid.data3,
-+                           (unsigned) proto.guid.data4[0],
-+                           (unsigned) proto.guid.data4[1],
-+                           (unsigned) proto.guid.data4[2],
-+                           (unsigned) proto.guid.data4[3],
-+                           (unsigned) proto.guid.data4[4],
-+                           (unsigned) proto.guid.data4[5],
-+                           (unsigned) proto.guid.data4[6],
-+                           (unsigned) proto.guid.data4[7]);
-+            }
-+            break;
-+          default:
-+            grub_printf ("/UnknownMedia(%x)", (unsigned) subtype);
-+            break;
-+          }
-+        break;
-+
-+      case GRUB_EFI_BIOS_DEVICE_PATH_TYPE:
-+        switch (subtype)
-+          {
-+          case GRUB_EFI_BIOS_DEVICE_PATH_SUBTYPE:
-+            {
-+              grub_efi_bios_device_path_t bios;
-+              grub_memcpy (&bios, dp, sizeof (bios));
-+              grub_printf ("/BIOS(%x,%x,%s)",
-+                           (unsigned) bios.device_type,
-+                           (unsigned) bios.status_flags,
-+                           (char *) (dp + 1));
-+            }
-+            break;
-+          default:
-+            grub_printf ("/UnknownBIOS(%x)", (unsigned) subtype);
-+            break;
-+          }
-+        break;
-+
-+      default:
-+        grub_printf ("/UnknownType(%x,%x)\n",
-+                     (unsigned) type,
-+                     (unsigned) subtype);
-+        return;
-+        break;
-+      }
-+      
-+      if (GRUB_EFI_END_ENTIRE_DEVICE_PATH (dp))
-+      break;
-+
-+      dp = (grub_efi_device_path_t *) ((char *) dp + len);
-+    }
-+}
-Index: kern/efi/init.c
-===================================================================
-RCS file: kern/efi/init.c
-diff -N kern/efi/init.c
---- /dev/null  1 Jan 1970 00:00:00 -0000
-+++ kern/efi/init.c    30 Apr 2006 21:09:37 -0000      1.4
-@@ -0,0 +1,89 @@
-+/* init.c - generic EFI initialization and finalization */
-+/*
-+ *  GRUB  --  GRand Unified Bootloader
-+ *  Copyright (C) 2006  Free Software Foundation, Inc.
-+ *
-+ *  This program is free software; you can redistribute it and/or modify
-+ *  it under the terms of the GNU General Public License as published by
-+ *  the Free Software Foundation; either version 2 of the License, or
-+ *  (at your option) any later version.
-+ *
-+ *  This program is distributed in the hope that it will be useful,
-+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+ *  GNU General Public License for more details.
-+ *
-+ *  You should have received a copy of the GNU General Public License
-+ *  along with this program; if not, write to the Free Software
-+ *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-+ *  MA  02110-1301, USA.
-+ */
-+
-+#include <grub/efi/efi.h>
-+#include <grub/efi/console.h>
-+#include <grub/efi/disk.h>
-+#include <grub/term.h>
-+#include <grub/misc.h>
-+#include <grub/env.h>
-+#include <grub/mm.h>
-+#include <grub/machine/kernel.h>
-+
-+void
-+grub_efi_init (void)
-+{
-+  /* First of all, initialize the console so that GRUB can display
-+     messages.  */
-+  grub_console_init ();
-+
-+  /* Initialize the memory management system.  */
-+  grub_efi_mm_init ();
-+
-+  grub_efidisk_init ();
-+}
-+
-+void
-+grub_efi_set_prefix (void)
-+{
-+  grub_efi_loaded_image_t *image;
-+  
-+  image = grub_efi_get_loaded_image (grub_efi_image_handle);
-+  if (image)
-+    {
-+      char *device;
-+      char *file;
-+
-+      device = grub_efidisk_get_device_name (image->device_handle);
-+      file = grub_efi_get_filename (image->file_path);
-+      
-+      if (device && file)
-+      {
-+        char *p;
-+        char *prefix;
-+        
-+        /* Get the directory.  */
-+        p = grub_strrchr (file, '/');
-+        if (p)
-+          *p = '\0';
-+
-+        prefix = grub_malloc (1 + grub_strlen (device) + 1
-+                              + grub_strlen (file) + 1);
-+        if (prefix)
-+          {
-+            grub_sprintf (prefix, "(%s)%s", device, file);
-+            grub_env_set ("prefix", prefix);
-+            grub_free (prefix);
-+          }
-+      }
-+      
-+      grub_free (device);
-+      grub_free (file);
-+    }
-+}
-+
-+void
-+grub_efi_fini (void)
-+{
-+  grub_efidisk_fini ();
-+  grub_efi_mm_fini ();
-+  grub_console_fini ();
-+}
-Index: kern/efi/mm.c
-===================================================================
-RCS file: kern/efi/mm.c
-diff -N kern/efi/mm.c
---- /dev/null  1 Jan 1970 00:00:00 -0000
-+++ kern/efi/mm.c      28 May 2006 23:01:43 -0000      1.3
-@@ -0,0 +1,431 @@
-+/* mm.c - generic EFI memory management */
-+/*
-+ *  GRUB  --  GRand Unified Bootloader
-+ *  Copyright (C) 2006  Free Software Foundation, Inc.
-+ *
-+ *  This program is free software; you can redistribute it and/or modify
-+ *  it under the terms of the GNU General Public License as published by
-+ *  the Free Software Foundation; either version 2 of the License, or
-+ *  (at your option) any later version.
-+ *
-+ *  This program is distributed in the hope that it will be useful,
-+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+ *  GNU General Public License for more details.
-+ *
-+ *  You should have received a copy of the GNU General Public License
-+ *  along with this program; if not, write to the Free Software
-+ *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-+ *  MA  02110-1301, USA.
-+ */
-+
-+#include <grub/misc.h>
-+#include <grub/mm.h>
-+#include <grub/efi/api.h>
-+#include <grub/efi/efi.h>
-+
-+#define NEXT_MEMORY_DESCRIPTOR(desc, size)    \
-+  ((grub_efi_memory_descriptor_t *) ((char *) (desc) + (size)))
-+
-+#define BYTES_TO_PAGES(bytes) ((bytes) >> 12)
-+#define PAGES_TO_BYTES(pages) ((pages) << 12)
-+
-+/* The size of a memory map obtained from the firmware. This must be
-+   a multiplier of 4KB.  */
-+#define MEMORY_MAP_SIZE       0x1000
-+
-+/* Maintain the list of allocated pages.  */
-+struct allocated_page
-+{
-+  grub_efi_physical_address_t addr;
-+  grub_efi_uint64_t num_pages;
-+};
-+
-+#define ALLOCATED_PAGES_SIZE  0x1000
-+#define MAX_ALLOCATED_PAGES   \
-+  (ALLOCATED_PAGES_SIZE / sizeof (struct allocated_page))
-+
-+static struct allocated_page *allocated_pages = 0;
-+
-+/* The minimum and maximum heap size for GRUB itself.  */
-+#define MIN_HEAP_SIZE 0x100000
-+#define MAX_HEAP_SIZE (16 * 0x100000)
-+
-+
-+/* Allocate pages. Return the pointer to the first of allocated pages.  */
-+void *
-+grub_efi_allocate_pages (grub_efi_physical_address_t address,
-+                       grub_efi_uintn_t pages)
-+{
-+  grub_efi_allocate_type_t type;
-+  grub_efi_status_t status;
-+  grub_efi_boot_services_t *b;
-+
-+#if GRUB_CPU_SIZEOF_VOID_P < 8
-+  /* Limit the memory access to less than 4GB for 32-bit platforms.  */
-+  if (address > 0xffffffff)
-+    return 0;
-+  
-+  if (address == 0)
-+    {
-+      type = GRUB_EFI_ALLOCATE_MAX_ADDRESS;
-+      address = 0xffffffff;
-+    }
-+  else
-+    type = GRUB_EFI_ALLOCATE_ADDRESS;
-+#else
-+  if (address == 0)
-+    type = GRUB_EFI_ALLOCATE_ANY_PAGES;
-+  else
-+    type = GRUB_EFI_ALLOCATE_ADDRESS;
-+#endif
-+
-+  b = grub_efi_system_table->boot_services;
-+  status = b->allocate_pages (type, GRUB_EFI_LOADER_DATA, pages, &address);
-+  if (status != GRUB_EFI_SUCCESS)
-+    return 0;
-+
-+  if (address == 0)
-+    {
-+      /* Uggh, the address 0 was allocated... This is too annoying,
-+       so reallocate another one.  */
-+      address = 0xffffffff;
-+      status = b->allocate_pages (type, GRUB_EFI_LOADER_DATA, pages, &address);
-+      grub_efi_free_pages (0, pages);
-+      if (status != GRUB_EFI_SUCCESS)
-+      return 0;
-+    }
-+      
-+  if (allocated_pages)
-+    {
-+      unsigned i;
-+
-+      for (i = 0; i < MAX_ALLOCATED_PAGES; i++)
-+      if (allocated_pages[i].addr == 0)
-+        {
-+          allocated_pages[i].addr = address;
-+          allocated_pages[i].num_pages = pages;
-+          break;
-+        }
-+
-+      if (i == MAX_ALLOCATED_PAGES)
-+      grub_fatal ("too many page allocations");
-+    }
-+  
-+  return (void *) ((grub_addr_t) address);
-+}
-+
-+/* Free pages starting from ADDRESS.  */
-+void
-+grub_efi_free_pages (grub_efi_physical_address_t address,
-+                   grub_efi_uintn_t pages)
-+{
-+  grub_efi_boot_services_t *b;
-+
-+  if (allocated_pages
-+      && ((grub_efi_physical_address_t) ((grub_addr_t) allocated_pages)
-+        != address))
-+    {
-+      unsigned i;
-+      
-+      for (i = 0; i < MAX_ALLOCATED_PAGES; i++)
-+      if (allocated_pages[i].addr == address)
-+        {
-+          allocated_pages[i].addr = 0;
-+          break;
-+        }
-+    }
-+  
-+  b = grub_efi_system_table->boot_services;
-+  b->free_pages (address, pages);
-+}
-+
-+/* Get the memory map as defined in the EFI spec. Return 1 if successful,
-+   return 0 if partial, or return -1 if an error occurs.  */
-+int
-+grub_efi_get_memory_map (grub_efi_uintn_t *memory_map_size,
-+                       grub_efi_memory_descriptor_t *memory_map,
-+                       grub_efi_uintn_t *map_key,
-+                       grub_efi_uintn_t *descriptor_size,
-+                       grub_efi_uint32_t *descriptor_version)
-+{
-+  grub_efi_status_t status;
-+  grub_efi_boot_services_t *b;
-+  grub_efi_uintn_t key;
-+  grub_efi_uint32_t version;
-+
-+  /* Allow some parameters to be missing.  */
-+  if (! map_key)
-+    map_key = &key;
-+  if (! descriptor_version)
-+    descriptor_version = &version;
-+  
-+  b = grub_efi_system_table->boot_services;
-+  status = b->get_memory_map (memory_map_size, memory_map, map_key,
-+                            descriptor_size, descriptor_version);
-+  if (status == GRUB_EFI_SUCCESS)
-+    return 1;
-+  else if (status == GRUB_EFI_BUFFER_TOO_SMALL)
-+    return 0;
-+  else
-+    return -1;
-+}
-+
-+/* Sort the memory map in place.  */
-+static void
-+sort_memory_map (grub_efi_memory_descriptor_t *memory_map,
-+               grub_efi_uintn_t desc_size,
-+               grub_efi_memory_descriptor_t *memory_map_end)
-+{
-+  grub_efi_memory_descriptor_t *d1;
-+  grub_efi_memory_descriptor_t *d2;
-+  
-+  for (d1 = memory_map;
-+       d1 < memory_map_end;
-+       d1 = NEXT_MEMORY_DESCRIPTOR (d1, desc_size))
-+    {
-+      grub_efi_memory_descriptor_t *max_desc = d1;
-+      
-+      for (d2 = NEXT_MEMORY_DESCRIPTOR (d1, desc_size);
-+         d2 < memory_map_end;
-+         d2 = NEXT_MEMORY_DESCRIPTOR (d2, desc_size))
-+      {
-+        if (max_desc->num_pages < d2->num_pages)
-+          max_desc = d2;
-+      }
-+
-+      if (max_desc != d1)
-+      {
-+        grub_efi_memory_descriptor_t tmp;
-+
-+        tmp = *d1;
-+        *d1 = *max_desc;
-+        *max_desc = tmp;
-+      }
-+    }
-+}
-+
-+/* Filter the descriptors. GRUB needs only available memory.  */
-+static grub_efi_memory_descriptor_t *
-+filter_memory_map (grub_efi_memory_descriptor_t *memory_map,
-+                 grub_efi_memory_descriptor_t *filtered_memory_map,
-+                 grub_efi_uintn_t desc_size,
-+                 grub_efi_memory_descriptor_t *memory_map_end)
-+{
-+  grub_efi_memory_descriptor_t *desc;
-+  grub_efi_memory_descriptor_t *filtered_desc;
-+
-+  for (desc = memory_map, filtered_desc = filtered_memory_map;
-+       desc < memory_map_end;
-+       desc = NEXT_MEMORY_DESCRIPTOR (desc, desc_size))
-+    {
-+      if (desc->type == GRUB_EFI_CONVENTIONAL_MEMORY
-+#if GRUB_CPU_SIZEOF_VOID_P < 8
-+        && desc->physical_start <= 0xffffffff
-+#endif
-+        && desc->physical_start + PAGES_TO_BYTES (desc->num_pages) > 0x100000
-+        && desc->num_pages != 0)
-+      {
-+        grub_memcpy (filtered_desc, desc, desc_size);
-+        
-+        /* Avoid less than 1MB, because some loaders seem to be confused.  */
-+        if (desc->physical_start < 0x100000)
-+          {
-+            desc->num_pages -= BYTES_TO_PAGES (0x100000
-+                                               - desc->physical_start);
-+            desc->physical_start = 0x100000;
-+          }
-+        
-+#if GRUB_CPU_SIZEOF_VOID_P < 8
-+        if (BYTES_TO_PAGES (filtered_desc->physical_start)
-+            + filtered_desc->num_pages
-+            > BYTES_TO_PAGES (0x100000000LL))
-+          filtered_desc->num_pages
-+            = (BYTES_TO_PAGES (0x100000000LL)
-+               - BYTES_TO_PAGES (filtered_desc->physical_start));
-+#endif
-+        
-+        if (filtered_desc->num_pages == 0)
-+          continue;
-+        
-+        filtered_desc = NEXT_MEMORY_DESCRIPTOR (filtered_desc, desc_size);
-+      }
-+    }
-+
-+  return filtered_desc;
-+}
-+
-+/* Return the total number of pages.  */
-+static grub_efi_uint64_t
-+get_total_pages (grub_efi_memory_descriptor_t *memory_map,
-+               grub_efi_uintn_t desc_size,
-+               grub_efi_memory_descriptor_t *memory_map_end)
-+{
-+  grub_efi_memory_descriptor_t *desc;
-+  grub_efi_uint64_t total = 0;
-+  
-+  for (desc = memory_map;
-+       desc < memory_map_end;
-+       desc = NEXT_MEMORY_DESCRIPTOR (desc, desc_size))
-+    total += desc->num_pages;
-+
-+  return total;
-+}
-+
-+/* Add memory regions.  */
-+static void
-+add_memory_regions (grub_efi_memory_descriptor_t *memory_map,
-+                  grub_efi_uintn_t desc_size,
-+                  grub_efi_memory_descriptor_t *memory_map_end,
-+                  grub_efi_uint64_t required_pages)
-+{
-+  grub_efi_memory_descriptor_t *desc;
-+  
-+  for (desc = memory_map;
-+       desc < memory_map_end;
-+       desc = NEXT_MEMORY_DESCRIPTOR (desc, desc_size))
-+    {
-+      grub_efi_uint64_t pages;
-+      grub_efi_physical_address_t start;
-+      void *addr;
-+
-+      start = desc->physical_start;
-+      pages = desc->num_pages;
-+      if (pages > required_pages)
-+      {
-+        start += PAGES_TO_BYTES (pages - required_pages);
-+        pages = required_pages;
-+      }
-+
-+      addr = grub_efi_allocate_pages (start, pages);
-+      if (! addr)
-+      grub_fatal ("cannot allocate conventional memory %p with %u pages",
-+                  (void *) ((grub_addr_t) start),
-+                  (unsigned) pages);
-+
-+      grub_mm_init_region (addr, PAGES_TO_BYTES (pages));
-+
-+      required_pages -= pages;
-+      if (required_pages == 0)
-+      break;
-+    }
-+
-+  if (required_pages > 0)
-+    grub_fatal ("too little memory");
-+}
-+
-+#if 0
-+/* Print the memory map.  */
-+static void
-+print_memory_map (grub_efi_memory_descriptor_t *memory_map,
-+                grub_efi_uintn_t desc_size,
-+                grub_efi_memory_descriptor_t *memory_map_end)
-+{
-+  grub_efi_memory_descriptor_t *desc;
-+  int i;
-+  
-+  for (desc = memory_map, i = 0;
-+       desc < memory_map_end;
-+       desc = NEXT_MEMORY_DESCRIPTOR (desc, desc_size), i++)
-+    {
-+      grub_printf ("MD: t=%x, p=%llx, v=%llx, n=%llx, a=%llx\n",
-+                 desc->type, desc->physical_start, desc->virtual_start,
-+                 desc->num_pages, desc->attribute);
-+    }
-+}
-+#endif
-+
-+void
-+grub_efi_mm_init (void)
-+{
-+  grub_efi_memory_descriptor_t *memory_map;
-+  grub_efi_memory_descriptor_t *memory_map_end;
-+  grub_efi_memory_descriptor_t *filtered_memory_map;
-+  grub_efi_memory_descriptor_t *filtered_memory_map_end;
-+  grub_efi_uintn_t map_size;
-+  grub_efi_uintn_t desc_size;
-+  grub_efi_uint64_t total_pages;
-+  grub_efi_uint64_t required_pages;
-+
-+  /* First of all, allocate pages to maintain allocations.  */
-+  allocated_pages
-+    = grub_efi_allocate_pages (0, BYTES_TO_PAGES (ALLOCATED_PAGES_SIZE));
-+  if (! allocated_pages)
-+    grub_fatal ("cannot allocate memory");
-+
-+  grub_memset (allocated_pages, 0, ALLOCATED_PAGES_SIZE);
-+  
-+  /* Prepare a memory region to store two memory maps.  */
-+  memory_map = grub_efi_allocate_pages (0,
-+                                      2 * BYTES_TO_PAGES (MEMORY_MAP_SIZE));
-+  if (! memory_map)
-+    grub_fatal ("cannot allocate memory");
-+
-+  filtered_memory_map = NEXT_MEMORY_DESCRIPTOR (memory_map, MEMORY_MAP_SIZE);
-+
-+  /* Obtain descriptors for available memory.  */
-+  map_size = MEMORY_MAP_SIZE;
-+
-+  if (grub_efi_get_memory_map (&map_size, memory_map, 0, &desc_size, 0) < 0)
-+    grub_fatal ("cannot get memory map");
-+
-+  memory_map_end = NEXT_MEMORY_DESCRIPTOR (memory_map, map_size);
-+  
-+  filtered_memory_map_end = filter_memory_map (memory_map, filtered_memory_map,
-+                                             desc_size, memory_map_end);
-+  
-+  /* By default, request a quarter of the available memory.  */
-+  total_pages = get_total_pages (filtered_memory_map, desc_size,
-+                               filtered_memory_map_end);
-+  required_pages = (total_pages >> 2);
-+  if (required_pages < BYTES_TO_PAGES (MIN_HEAP_SIZE))
-+    required_pages = BYTES_TO_PAGES (MIN_HEAP_SIZE);
-+  else if (required_pages > BYTES_TO_PAGES (MAX_HEAP_SIZE))
-+    required_pages = BYTES_TO_PAGES (MAX_HEAP_SIZE);
-+
-+  /* Sort the filtered descriptors, so that GRUB can allocate pages
-+     from smaller regions.  */
-+  sort_memory_map (filtered_memory_map, desc_size, filtered_memory_map_end);
-+
-+  /* Allocate memory regions for GRUB's memory management.  */
-+  add_memory_regions (filtered_memory_map, desc_size,
-+                    filtered_memory_map_end, required_pages);
-+
-+#if 0
-+  /* For debug.  */
-+  map_size = MEMORY_MAP_SIZE;
-+
-+  if (grub_efi_get_memory_map (&map_size, memory_map, 0, &desc_size, 0) < 0)
-+    grub_fatal ("cannot get memory map");
-+
-+  grub_printf ("printing memory map\n");
-+  print_memory_map (memory_map, desc_size,
-+                  NEXT_MEMORY_DESCRIPTOR (memory_map, map_size));
-+  grub_abort ();
-+#endif
-+  
-+  /* Release the memory maps.  */
-+  grub_efi_free_pages ((grub_addr_t) memory_map,
-+                     2 * BYTES_TO_PAGES (MEMORY_MAP_SIZE));
-+}
-+
-+void
-+grub_efi_mm_fini (void)
-+{
-+  if (allocated_pages)
-+    {
-+      unsigned i;
-+
-+      for (i = 0; i < MAX_ALLOCATED_PAGES; i++)
-+      {
-+        struct allocated_page *p;
-+
-+        p = allocated_pages + i;
-+        if (p->addr != 0)
-+          grub_efi_free_pages ((grub_addr_t) p->addr, p->num_pages);
-+      }
-+
-+      grub_efi_free_pages ((grub_addr_t) allocated_pages,
-+                         BYTES_TO_PAGES (ALLOCATED_PAGES_SIZE));
-+    }
-+}
-Index: kern/i386/efi/init.c
-===================================================================
-RCS file: kern/i386/efi/init.c
-diff -N kern/i386/efi/init.c
---- /dev/null  1 Jan 1970 00:00:00 -0000
-+++ kern/i386/efi/init.c       25 Apr 2006 20:08:31 -0000      1.4
-@@ -0,0 +1,53 @@
-+/* init.c - initialize an x86-based EFI system */
-+/*
-+ *  GRUB  --  GRand Unified Bootloader
-+ *  Copyright (C) 2006  Free Software Foundation, Inc.
-+ *
-+ *  This program is free software; you can redistribute it and/or modify
-+ *  it under the terms of the GNU General Public License as published by
-+ *  the Free Software Foundation; either version 2 of the License, or
-+ *  (at your option) any later version.
-+ *
-+ *  This program is distributed in the hope that it will be useful,
-+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+ *  GNU General Public License for more details.
-+ *
-+ *  You should have received a copy of the GNU General Public License
-+ *  along with this program; if not, write to the Free Software
-+ *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-+ *  MA  02110-1301, USA.
-+ */
-+
-+#include <grub/types.h>
-+#include <grub/misc.h>
-+#include <grub/mm.h>
-+#include <grub/err.h>
-+#include <grub/dl.h>
-+#include <grub/cache.h>
-+#include <grub/kernel.h>
-+#include <grub/efi/efi.h>
-+
-+void
-+grub_machine_init (void)
-+{
-+  grub_efi_init ();
-+}
-+
-+void
-+grub_machine_fini (void)
-+{
-+  grub_efi_fini ();
-+}
-+
-+void
-+grub_machine_set_prefix (void)
-+{
-+  grub_efi_set_prefix ();
-+}
-+
-+void
-+grub_arch_sync_caches (void *address __attribute__ ((unused)),
-+                       grub_size_t len __attribute__ ((unused)))
-+{
-+}
-Index: kern/i386/efi/startup.S
-===================================================================
-RCS file: kern/i386/efi/startup.S
-diff -N kern/i386/efi/startup.S
---- /dev/null  1 Jan 1970 00:00:00 -0000
-+++ kern/i386/efi/startup.S    18 Apr 2006 06:18:15 -0000      1.1
-@@ -0,0 +1,65 @@
-+/* startup.S - bootstrap GRUB itself */
-+/*
-+ *  GRUB  --  GRand Unified Bootloader
-+ *  Copyright (C) 2006  Free Software Foundation, Inc.
-+ *
-+ *  This program is free software; you can redistribute it and/or modify
-+ *  it under the terms of the GNU General Public License as published by
-+ *  the Free Software Foundation; either version 2 of the License, or
-+ *  (at your option) any later version.
-+ *
-+ *  This program is distributed in the hope that it will be useful,
-+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+ *  GNU General Public License for more details.
-+ *
-+ *  You should have received a copy of the GNU General Public License
-+ *  along with this program; if not, write to the Free Software
-+ *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-+ */
-+
-+#include <config.h>
-+#include <grub/symbol.h>
-+#include <grub/boot.h>
-+
-+        .file   "startup.S"
-+        .text
-+        .globl  start, _start
-+start:
-+_start:
-+      jmp codestart
-+
-+        /*
-+         *  Compatibility version number
-+         *
-+         *  These MUST be at byte offset 6 and 7 of the executable
-+         *  DO NOT MOVE !!!
-+         */
-+        . = EXT_C(start) + 0x6
-+        .byte   GRUB_BOOT_VERSION_MAJOR, GRUB_BOOT_VERSION_MINOR
-+
-+        /*
-+         *  This is a special data area 8 bytes from the beginning.
-+         */
-+
-+        . = EXT_C(start) + 0x8
-+
-+VARIABLE(grub_prefix)
-+        .string "/boot/grub"
-+
-+        /*
-+         *  Leave some breathing room for the prefix.
-+         */
-+
-+        . = EXT_C(start) + 0x50
-+
-+codestart:
-+      /*
-+       *  EFI_SYSTEM_TABLE * and EFI_HANDLE are passed on the stack.
-+       */
-+      movl    4(%esp), %eax
-+      movl    %eax, EXT_C(grub_efi_image_handle)
-+      movl    8(%esp), %eax
-+      movl    %eax, EXT_C(grub_efi_system_table)
-+      call    EXT_C(grub_main)
-+      ret
-Index: kern/i386/pc/init.c
-===================================================================
-RCS file: /cvsroot/grub/grub2/kern/i386/pc/init.c,v
-retrieving revision 1.11
-retrieving revision 1.12
-diff -u -r1.11 -r1.12
---- kern/i386/pc/init.c        15 Feb 2005 00:07:01 -0000      1.11
-+++ kern/i386/pc/init.c        25 Apr 2006 20:08:31 -0000      1.12
-@@ -226,8 +226,11 @@
-   
-   /* The memory system was initialized, thus register built-in devices.  */
-   grub_biosdisk_init ();
-+}
--
-+void
-+grub_machine_set_prefix (void)
-+{
-   /* Initialize the prefix.  */
-   grub_env_set ("prefix", make_install_device ());
- }
-Index: kern/i386/pc/startup.S
-===================================================================
-RCS file: /cvsroot/grub/grub2/kern/i386/pc/startup.S,v
-retrieving revision 1.19
-retrieving revision 1.23
-diff -u -r1.19 -r1.23
---- kern/i386/pc/startup.S     15 Oct 2005 17:28:36 -0000      1.19
-+++ kern/i386/pc/startup.S     14 May 2006 21:16:19 -0000      1.23
-@@ -1,6 +1,6 @@
- /*
-  *  GRUB  --  GRand Unified Bootloader
-- *  Copyright (C) 1999,2000,2001,2002,2003,2005 Free Software Foundation, Inc.
-+ *  Copyright (C) 1999,2000,2001,2002,2003,2005,2006 Free Software Foundation, Inc.
-  *
-  *  This program is free software; you can redistribute it and/or modify
-  *  it under the terms of the GNU General Public License as published by
-@@ -48,7 +48,7 @@
- #include <grub/machine/boot.h>
- #include <grub/machine/memory.h>
- #include <grub/machine/console.h>
--#include <grub/machine/linux.h>
-+#include <grub/cpu/linux.h>
- #include <grub/machine/kernel.h>
- #include <grub/machine/multiboot.h>
-               
-@@ -626,6 +626,19 @@
-       ret
- /*
-+ * grub_exit()
-+ *
-+ * Exit the system.
-+ */
-+FUNCTION(grub_exit)
-+      call    prot_to_real
-+      .code16
-+      /* Tell the BIOS a boot failure. If this does not work, reboot.  */
-+      int     $0x18
-+      jmp     cold_reboot
-+      .code32
-+      
-+/*
-  * grub_reboot()
-  *
-  * Reboot the system. At the moment, rely on BIOS.
-@@ -633,6 +646,7 @@
- FUNCTION(grub_reboot)
-       call    prot_to_real
-       .code16
-+cold_reboot:  
-       /* cold boot */
-       movw    $0x0472, %di
-       movw    %ax, (%di)
-@@ -1758,14 +1772,15 @@
-       ret
- /*
-- * grub_vbe_status_t grub_vbe_get_controller_info (struct grub_vbe_info_block *controller_info)
-+ * grub_vbe_bios_status_t grub_vbe_get_controller_info (struct grub_vbe_info_block *controller_info)
-  *
-  * Register allocations for parameters:
-  * %eax               *controller_info
-  */
--FUNCTION(grub_vbe_get_controller_info)
-+FUNCTION(grub_vbe_bios_get_controller_info)
-       pushl   %ebp
-       pushl   %edi
-+      pushl   %edx
-       movw    %ax, %di        /* Store *controller_info to %edx:%di.  */
-       xorw    %ax, %ax
-@@ -1791,19 +1806,20 @@
-       movl    %edx, %eax
-       andl    $0x0FFFF, %eax  /* Return value in %eax.  */
-       
-+      pop     %edx
-       popl    %edi
-       popl    %ebp
-       ret
- /*
-- * grub_vbe_status_t grub_vbe_get_mode_info (grub_uint32_t mode,
-- *                                         struct grub_vbe_mode_info_block *mode_info)
-+ * grub_vbe_status_t grub_vbe_bios_get_mode_info (grub_uint32_t mode,
-+ *                                              struct grub_vbe_mode_info_block *mode_info)
-  *
-  * Register allocations for parameters:
-  * %eax               mode
-  * %edx               *mode_info
-  */
--FUNCTION(grub_vbe_get_mode_info)
-+FUNCTION(grub_vbe_bios_get_mode_info)
-       pushl   %ebp
-       pushl   %edi
-@@ -1837,16 +1853,17 @@
-       ret
- /*
-- * grub_vbe_status_t grub_vbe_set_mode (grub_uint32_t mode,
-- *                                    struct grub_vbe_crtc_info_block *crtc_info)
-+ * grub_vbe_status_t grub_vbe_bios_set_mode (grub_uint32_t mode,
-+ *                                         struct grub_vbe_crtc_info_block *crtc_info)
-  *
-  * Register allocations for parameters:
-  * %eax               mode
-  * %edx               *crtc_info
-  */
--FUNCTION(grub_vbe_set_mode)
-+FUNCTION(grub_vbe_bios_set_mode)
-       pushl   %ebp
-       pushl   %ebx
-+      pushl   %edi
-       movl    %eax, %ebx      /* Store mode in %ebx.  */
-@@ -1874,19 +1891,22 @@
-       movw    %dx, %ax
-       andl    $0xFFFF, %eax   /* Return value in %eax.  */
-+      popl    %edi
-       popl    %ebx
-       popl    %ebp
-       ret
- /*
-- * grub_vbe_status_t grub_vbe_get_mode (grub_uint32_t *mode)
-+ * grub_vbe_status_t grub_vbe_bios_get_mode (grub_uint32_t *mode)
-  *
-  * Register allocations for parameters:
-  * %eax               *mode
-  */
--FUNCTION(grub_vbe_get_mode)
-+FUNCTION(grub_vbe_bios_get_mode)
-       pushl   %ebp
-       pushl   %ebx
-+      pushl   %edi
-+      pushl   %edx
-       pushl   %eax            /* Push *mode to stack.  */
-       call    prot_to_real
-@@ -1907,19 +1927,21 @@
-       movw    %dx, %ax
-       andl    $0xFFFF, %eax   /* Return value in %eax.  */
-+      popl    %edx
-+      popl    %edi
-       popl    %ebx
-       popl    %ebp
-       ret
- /*
-- * grub_vbe_status_t grub_vbe_set_memory_window (grub_uint32_t window,
-- *                                             grub_uint32_t position);
-+ * grub_vbe_status_t grub_vbe_bios_set_memory_window (grub_uint32_t window,
-+ *                                                  grub_uint32_t position);
-  *
-  * Register allocations for parameters:
-  * %eax               window
-  * %edx               position
-  */
--FUNCTION(grub_vbe_set_memory_window)
-+FUNCTION(grub_vbe_bios_set_memory_window)
-       pushl   %ebp
-       pushl   %ebx
-@@ -1945,16 +1967,17 @@
-       ret
- /*
-- * grub_vbe_status_t grub_vbe_get_memory_window (grub_uint32_t window,
-- *                                             grub_uint32_t *position);
-+ * grub_vbe_status_t grub_vbe_bios_get_memory_window (grub_uint32_t window,
-+ *                                                  grub_uint32_t *position);
-  *
-  * Register allocations for parameters:
-  * %eax               window
-  * %edx               *position
-  */
--FUNCTION(grub_vbe_get_memory_window)
-+FUNCTION(grub_vbe_bios_get_memory_window)
-       pushl   %ebp
-       pushl   %ebx
-+      pushl   %edi
-       pushl   %edx            /* Push *position to stack.  */
-       movl    %eax, %ebx      /* Store window in %ebx.  */
-@@ -1979,19 +2002,21 @@
-       movw    %bx, %ax
-       andl    $0xFFFF, %eax   /* Return value in %eax.  */
-+      popl    %edi
-       popl    %ebx
-       popl    %ebp
-       ret
- /*
-- * grub_vbe_status_t grub_vbe_set_scanline_length (grub_uint32_t length)
-+ * grub_vbe_status_t grub_vbe_bios_set_scanline_length (grub_uint32_t length)
-  *
-  * Register allocations for parameters:
-  * %eax               length
-  */
--FUNCTION(grub_vbe_set_scanline_length)
-+FUNCTION(grub_vbe_bios_set_scanline_length)
-       pushl   %ebp
-       pushl   %ebx
-+      pushl   %edx
-       movl    %eax, %ecx      /* Store length in %ecx.  */
-@@ -2010,19 +2035,21 @@
-       movw    %dx, %ax
-       andl    $0xFFFF, %eax   /* Return value in %eax.  */
-+      popl    %edx
-       popl    %ebx
-       popl    %ebp
-       ret
- /*
-- * grub_vbe_status_t grub_vbe_get_scanline_length (grub_uint32_t *length)
-+ * grub_vbe_status_t grub_vbe_bios_get_scanline_length (grub_uint32_t *length)
-  *
-  * Register allocations for parameters:
-  * %eax               *length
-  */
--FUNCTION(grub_vbe_get_scanline_length)
-+FUNCTION(grub_vbe_bios_get_scanline_length)
-       pushl   %ebp
-       pushl   %ebx
-+      pushl   %edi
-       pushl   %edx            /* Push *length to stack.  */
-       call    prot_to_real
-@@ -2044,19 +2071,20 @@
-       movw    %dx, %ax
-       andl    $0xFFFF, %eax   /* Return value in %eax.  */
-+      popl    %edi
-       popl    %ebx
-       popl    %ebp
-       ret
- /*
-- * grub_vbe_status_t grub_vbe_set_display_start (grub_uint32_t x,
-- *                                             grub_uint32_t y)
-+ * grub_vbe_status_t grub_vbe_bios_set_display_start (grub_uint32_t x,
-+ *                                                  grub_uint32_t y)
-  *
-  * Register allocations for parameters:
-  * %eax               x
-  * %edx               y
-  */
--FUNCTION(grub_vbe_set_display_start)
-+FUNCTION(grub_vbe_bios_set_display_start)
-       pushl   %ebp
-       pushl   %ebx
-@@ -2083,16 +2111,17 @@
-       ret
- /*
-- * grub_vbe_status_t grub_vbe_get_display_start (grub_uint32_t *x,
-- *                                             grub_uint32_t *y)
-+ * grub_vbe_status_t grub_vbe_bios_get_display_start (grub_uint32_t *x,
-+ *                                                  grub_uint32_t *y)
-  *
-  * Register allocations for parameters:
-  * %eax               *x
-  * %edx               *y
-  */
--FUNCTION(grub_vbe_get_display_start)
-+FUNCTION(grub_vbe_bios_get_display_start)
-       pushl   %ebp
-       pushl   %ebx
-+      pushl   %edi
-       pushl   %eax            /* Push *x to stack.  */
-       pushl   %edx            /* Push *y to stack.  */
-@@ -2119,23 +2148,25 @@
-       movw    %bx, %ax
-       andl    $0xFFFF, %eax   /* Return value in %eax.  */
-+      popl    %edi
-       popl    %ebx
-       popl    %ebp
-       ret
- /*
-- * grub_vbe_status_t grub_vbe_set_palette_data (grub_uint32_t color_count,
-- *                                            grub_uint32_t start_index,
-- *                                            struct grub_vbe_palette_data *palette_data)
-+ * grub_vbe_status_t grub_vbe_bios_set_palette_data (grub_uint32_t color_count,
-+ *                                                 grub_uint32_t start_index,
-+ *                                                 struct grub_vbe_palette_data *palette_data)
-  *
-  * Register allocations for parameters:
-  * %eax               color_count
-  * %edx               start_index
-  * %ecx               *palette_data
-  */
--FUNCTION(grub_vbe_set_palette_data)
-+FUNCTION(grub_vbe_bios_set_palette_data)
-       pushl   %ebp
-       pushl   %ebx
-+      pushl   %edi
-       movl    %eax, %ebx      /* Store color_count in %ebx.  */
-@@ -2165,6 +2196,7 @@
-       movw    %dx, %ax
-       andl    $0xFFFF, %eax   /* Return value in %eax.  */
-+      popl    %edi
-       popl    %ebx
-       popl    %ebp
-       ret
-Index: kern/powerpc/ieee1275/cmain.c
-===================================================================
-RCS file: /cvsroot/grub/grub2/kern/powerpc/ieee1275/cmain.c,v
-retrieving revision 1.1
-retrieving revision 1.2
-diff -u -r1.1 -r1.2
---- kern/powerpc/ieee1275/cmain.c      31 Aug 2005 16:51:15 -0000      1.1
-+++ kern/powerpc/ieee1275/cmain.c      23 Apr 2006 13:37:36 -0000      1.2
-@@ -1,7 +1,7 @@
- /* cmain.c - Startup code for the PowerPC.  */
- /*
-  *  GRUB  --  GRand Unified Bootloader
-- *  Copyright (C) 2003, 2004, 2005  Free Software Foundation, Inc.
-+ *  Copyright (C) 2003,2004,2005,2006  Free Software Foundation, Inc.
-  *
-  *  This program is free software; you can redistribute it and/or modify
-  *  it under the terms of the GNU General Public License as published by
-@@ -86,7 +86,7 @@
-       /* Need to claim ourselves so we don't cannibalize our memory later.  */
-       if (grub_ieee1275_claim ((grub_addr_t) &_start, (grub_addr_t) &_end
-           - (grub_addr_t) &_start, 0, 0))
--      abort();
-+      grub_abort ();
-     }
-   else
-     {
-Index: kern/powerpc/ieee1275/init.c
-===================================================================
-RCS file: /cvsroot/grub/grub2/kern/powerpc/ieee1275/init.c,v
-retrieving revision 1.22
-retrieving revision 1.25
-diff -u -r1.22 -r1.25
---- kern/powerpc/ieee1275/init.c       4 Nov 2005 04:50:14 -0000       1.22
-+++ kern/powerpc/ieee1275/init.c       26 Apr 2006 02:20:12 -0000      1.25
-@@ -39,7 +39,7 @@
- static grub_addr_t grub_heap_len;
- void
--abort (void)
-+grub_exit (void)
- {
-   /* Trap to Open Firmware.  */
-   asm ("trap");
-@@ -62,13 +62,17 @@
-     }
- }
--static void
--grub_set_prefix (void)
-+void
-+grub_machine_set_prefix (void)
- {
-   char bootpath[64]; /* XXX check length */
-   char *filename;
-   char *prefix;
-+  if (grub_env_get ("prefix"))
-+    /* We already set prefix in grub_machine_init().  */
-+    return;
-+
-   if (grub_ieee1275_get_property (grub_ieee1275_chosen, "bootpath", &bootpath,
-                                 sizeof (bootpath), 0))
-     {
-@@ -126,12 +130,10 @@
-     {
-       grub_printf ("Failed to claim heap at 0x%x, len 0x%x\n", grub_heap_start,
-                  grub_heap_len);
--      abort ();
-+      grub_abort ();
-     }
-   grub_mm_init_region ((void *) grub_heap_start, grub_heap_len);
--  grub_set_prefix ();
--
-   grub_ofdisk_init ();
-   /* Process commandline.  */
-@@ -177,12 +179,6 @@
-   grub_console_fini ();
- }
--void
--grub_stop (void)
--{
--  for (;;);
--}
--
- grub_uint32_t
- grub_get_rtc (void)
- {
-Index: kern/sparc64/ieee1275/init.c
-===================================================================
-RCS file: /cvsroot/grub/grub2/kern/sparc64/ieee1275/init.c,v
-retrieving revision 1.1
-retrieving revision 1.2
-diff -u -r1.1 -r1.2
---- kern/sparc64/ieee1275/init.c       21 Aug 2005 18:42:55 -0000      1.1
-+++ kern/sparc64/ieee1275/init.c       25 Apr 2006 20:08:31 -0000      1.2
-@@ -79,13 +79,6 @@
-   grub_ieee1275_flags |= (1 << flag);
- }
--void
--abort (void)
--{
--  /* Trap to Open Firmware.  */
--  grub_ieee1275_enter ();
--}
--
- /* Translate an OF filesystem path (separated by backslashes), into a GRUB
-    path (separated by forward slashes).  */
- static void
-@@ -101,8 +94,8 @@
-     }
- }
--static void
--grub_set_prefix (void)
-+void
-+grub_machine_set_prefix (void)
- {
-   char bootpath[64]; /* XXX check length */
-   char *filename;
-@@ -163,8 +156,6 @@
-                  grub_heap_len);
-   grub_mm_init_region ((void *) grub_heap_start, grub_heap_len);
--  grub_set_prefix ();
--
-   grub_ofdisk_init ();
-   /* Process commandline.  */
-@@ -215,9 +206,9 @@
- }
- void
--grub_stop (void)
-+grub_exit (void)
- {
--  grub_ieee1275_exit ();
-+  grub_ieee1275_enter ();
- }
- grub_uint32_t
-Index: loader/efi/chainloader.c
-===================================================================
-RCS file: loader/efi/chainloader.c
-diff -N loader/efi/chainloader.c
---- /dev/null  1 Jan 1970 00:00:00 -0000
-+++ loader/efi/chainloader.c   30 Apr 2006 21:09:37 -0000      1.1
-@@ -0,0 +1,315 @@
-+/* chainloader.c - boot another boot loader */
-+/*
-+ *  GRUB  --  GRand Unified Bootloader
-+ *  Copyright (C) 2002,2004,2006  Free Software Foundation, Inc.
-+ *
-+ *  This program is free software; you can redistribute it and/or modify
-+ *  it under the terms of the GNU General Public License as published by
-+ *  the Free Software Foundation; either version 2 of the License, or
-+ *  (at your option) any later version.
-+ *
-+ *  This program is distributed in the hope that it will be useful,
-+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+ *  GNU General Public License for more details.
-+ *
-+ *  You should have received a copy of the GNU General Public License
-+ *  along with this program; if not, write to the Free Software
-+ *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-+ */
-+
-+/* TODO: support load options.  */
-+
-+#include <grub/loader.h>
-+#include <grub/file.h>
-+#include <grub/err.h>
-+#include <grub/device.h>
-+#include <grub/disk.h>
-+#include <grub/misc.h>
-+#include <grub/mm.h>
-+#include <grub/types.h>
-+#include <grub/rescue.h>
-+#include <grub/dl.h>
-+#include <grub/efi/api.h>
-+#include <grub/efi/efi.h>
-+#include <grub/efi/disk.h>
-+#include <grub/efi/chainloader.h>
-+
-+static grub_dl_t my_mod;
-+
-+static grub_efi_physical_address_t address;
-+static grub_efi_uintn_t pages;
-+static grub_efi_device_path_t *file_path;
-+static grub_efi_handle_t image_handle;
-+
-+static grub_err_t
-+grub_chainloader_unload (void)
-+{
-+  grub_efi_boot_services_t *b;
-+  
-+  b = grub_efi_system_table->boot_services;
-+  b->unload_image (image_handle);
-+  b->free_pages (address, pages);
-+  grub_free (file_path);
-+  
-+  grub_dl_unref (my_mod);
-+  return GRUB_ERR_NONE;
-+}
-+
-+static grub_err_t
-+grub_chainloader_boot (void)
-+{
-+  grub_efi_boot_services_t *b;
-+  grub_efi_status_t status;
-+  grub_efi_uintn_t exit_data_size;
-+  grub_efi_char16_t *exit_data;
-+  
-+  b = grub_efi_system_table->boot_services;
-+  status = b->start_image (image_handle, &exit_data_size, &exit_data);
-+  if (status != GRUB_EFI_SUCCESS)
-+    {
-+      if (exit_data)
-+      {
-+        char *buf;
-+        
-+        buf = grub_malloc (exit_data_size * 4 + 1);
-+        if (buf)
-+          {
-+            *grub_utf16_to_utf8 ((grub_uint8_t *) buf,
-+                                 exit_data, exit_data_size) = 0;
-+            
-+            grub_error (GRUB_ERR_BAD_OS, buf);
-+            grub_free (buf);
-+          }
-+        else
-+          grub_error (GRUB_ERR_BAD_OS, "unknown error");
-+      }
-+    }
-+
-+  if (exit_data)
-+    b->free_pool (exit_data);
-+
-+  grub_chainloader_unload ();
-+  
-+  return grub_errno;
-+}
-+
-+static void
-+copy_file_path (grub_efi_file_path_device_path_t *fp,
-+              const char *str, grub_efi_uint16_t len)
-+{
-+  grub_efi_char16_t *p;
-+  grub_efi_uint16_t size;
-+  
-+  fp->header.type = GRUB_EFI_MEDIA_DEVICE_PATH_TYPE;
-+  fp->header.subtype = GRUB_EFI_FILE_PATH_DEVICE_PATH_SUBTYPE;
-+  size = len * sizeof (grub_efi_char16_t) + sizeof (*fp);
-+  fp->header.length[0] = (grub_efi_uint8_t) (size & 0xff);
-+  fp->header.length[1] = (grub_efi_uint8_t) (size >> 8);
-+  for (p = fp->path_name; len > 0; len--, p++, str++)
-+    {
-+      /* FIXME: this assumes that the path is in ASCII.  */
-+      *p = (grub_efi_char16_t) (*str == '/' ? '\\' : *str);
-+    }
-+}
-+
-+static grub_efi_device_path_t *
-+make_file_path (grub_efi_device_path_t *dp, const char *filename)
-+{
-+  char *dir_start;
-+  char *dir_end;
-+  grub_size_t size;
-+  grub_efi_device_path_t *d;
-+
-+  dir_start = grub_strchr (filename, ')');
-+  if (! dir_start)
-+    dir_start = (char *) filename;
-+  else
-+    dir_start++;
-+
-+  dir_end = grub_strrchr (dir_start, '/');
-+  if (! dir_end)
-+    {
-+      grub_error (GRUB_ERR_BAD_FILENAME, "invalid EFI file path");
-+      return 0;
-+    }
-+  
-+  size = 0;
-+  d = dp;
-+  while (1)
-+    {
-+      size += GRUB_EFI_DEVICE_PATH_LENGTH (d);
-+      if ((GRUB_EFI_END_ENTIRE_DEVICE_PATH (d)))
-+      break;
-+      d = GRUB_EFI_NEXT_DEVICE_PATH (d);
-+    }
-+  
-+  file_path = grub_malloc (size
-+                         + ((grub_strlen (dir_start) + 1)
-+                            * sizeof (grub_efi_char16_t))
-+                         + sizeof (grub_efi_file_path_device_path_t) * 2);
-+  if (! file_path)
-+    return 0;
-+
-+  grub_memcpy (file_path, dp, size);
-+  
-+  /* Fill the file path for the directory.  */
-+  d = (grub_efi_device_path_t *) ((char *) file_path
-+                                + ((char *) d - (char *) dp));
-+  grub_efi_print_device_path (d);
-+  copy_file_path ((grub_efi_file_path_device_path_t *) d,
-+                dir_start, dir_end - dir_start);
-+
-+  /* Fill the file path for the file.  */
-+  d = GRUB_EFI_NEXT_DEVICE_PATH (d);
-+  copy_file_path ((grub_efi_file_path_device_path_t *) d,
-+                dir_end + 1, grub_strlen (dir_end + 1));
-+
-+  /* Fill the end of device path nodes.  */
-+  d = GRUB_EFI_NEXT_DEVICE_PATH (d);
-+  d->type = GRUB_EFI_END_DEVICE_PATH_TYPE;
-+  d->subtype = GRUB_EFI_END_ENTIRE_DEVICE_PATH_SUBTYPE;
-+  d->length[0] = sizeof (*d);
-+  d->length[1] = 0;
-+
-+  return file_path;
-+}
-+
-+void
-+grub_chainloader_cmd (const char *filename)
-+{
-+  grub_file_t file = 0;
-+  grub_ssize_t size;
-+  grub_efi_status_t status;
-+  grub_efi_boot_services_t *b;
-+  grub_efi_handle_t dev_handle = 0;
-+  grub_device_t dev = 0;
-+  grub_efi_device_path_t *dp = 0;
-+  grub_efi_loaded_image_t *loaded_image;
-+  
-+  grub_dl_ref (my_mod);
-+
-+  /* Initialize some global variables.  */
-+  address = 0;
-+  image_handle = 0;
-+  file_path = 0;
-+  
-+  b = grub_efi_system_table->boot_services;
-+
-+  file = grub_file_open (filename);
-+  if (! file)
-+    goto fail;
-+
-+  /* Get the root device's device path.  */
-+  dev = grub_device_open (0);
-+  if (! dev)
-+    goto fail;
-+
-+  if (dev->disk)
-+    {
-+      dev_handle = grub_efidisk_get_device_handle (dev->disk);
-+      if (dev_handle)
-+      dp = grub_efi_get_device_path (dev_handle);
-+    }
-+  
-+  if (! dev->disk || ! dev_handle || ! dp)
-+    {
-+      grub_error (GRUB_ERR_BAD_DEVICE, "not a valid root device");
-+      goto fail;
-+    }
-+
-+  file_path = make_file_path (dp, filename);
-+  if (! file_path)
-+    goto fail;
-+
-+  grub_printf ("file path: ");
-+  grub_efi_print_device_path (file_path);
-+  
-+  size = grub_file_size (file);
-+  pages = (((grub_efi_uintn_t) size + ((1 << 12) - 1)) >> 12);
-+  
-+  status = b->allocate_pages (GRUB_EFI_ALLOCATE_ANY_PAGES,
-+                            GRUB_EFI_LOADER_CODE,
-+                            pages, &address);
-+  if (status != GRUB_EFI_SUCCESS)
-+    {
-+      grub_error (GRUB_ERR_OUT_OF_MEMORY, "cannot allocate %u pages", pages);
-+      goto fail;
-+    }
-+
-+  if (grub_file_read (file, (void *) ((grub_addr_t) address), size) != size)
-+    {
-+      if (grub_errno == GRUB_ERR_NONE)
-+      grub_error (GRUB_ERR_BAD_OS, "too small");
-+
-+      goto fail;
-+    }
-+
-+  status = b->load_image (0, grub_efi_image_handle, file_path,
-+                        (void *) ((grub_addr_t) address), size,
-+                        &image_handle);
-+  if (status != GRUB_EFI_SUCCESS)
-+    {
-+      if (status == GRUB_EFI_OUT_OF_RESOURCES)
-+      grub_error (GRUB_ERR_OUT_OF_MEMORY, "out of resources");
-+      else
-+      grub_error (GRUB_ERR_BAD_OS, "cannot load image");
-+      
-+      goto fail;
-+    }
-+
-+  /* LoadImage does not set a device handler when the image is
-+     loaded from memory, so it is necessary to set it explicitly here.
-+     This is a mess.  */
-+  loaded_image = grub_efi_get_loaded_image (image_handle);
-+  if (! loaded_image)
-+    {
-+      grub_error (GRUB_ERR_BAD_OS, "no loaded image available");
-+      goto fail;
-+    }
-+  loaded_image->device_handle = dev_handle;
-+  
-+  grub_file_close (file);
-+  grub_loader_set (grub_chainloader_boot, grub_chainloader_unload, 0);
-+  return;
-+  
-+ fail:
-+
-+  if (dev)
-+    grub_device_close (dev);
-+  
-+  if (file)
-+    grub_file_close (file);
-+
-+  if (file_path)
-+    grub_free (file_path);
-+  
-+  if (address)
-+    b->free_pages (address, pages);
-+  
-+  grub_dl_unref (my_mod);
-+}
-+
-+static void
-+grub_rescue_cmd_chainloader (int argc, char *argv[])
-+{
-+  if (argc == 0)
-+    grub_error (GRUB_ERR_BAD_ARGUMENT, "no file specified");
-+  else
-+    grub_chainloader_cmd (argv[0]);
-+}
-+
-+static const char loader_name[] = "chainloader";
-+
-+GRUB_MOD_INIT(chainloader)
-+{
-+  grub_rescue_register_command (loader_name,
-+                              grub_rescue_cmd_chainloader,
-+                              "load another boot loader");
-+  my_mod = mod;
-+}
-+
-+GRUB_MOD_FINI(chainloader)
-+{
-+  grub_rescue_unregister_command (loader_name);
-+}
-Index: loader/efi/chainloader_normal.c
-===================================================================
-RCS file: loader/efi/chainloader_normal.c
-diff -N loader/efi/chainloader_normal.c
---- /dev/null  1 Jan 1970 00:00:00 -0000
-+++ loader/efi/chainloader_normal.c    30 Apr 2006 21:09:37 -0000      1.1
-@@ -0,0 +1,49 @@
-+/* chainloader_normal.c - boot another boot loader */
-+/*
-+ *  GRUB  --  GRand Unified Bootloader
-+ *  Copyright (C) 2004,2006  Free Software Foundation, Inc.
-+ *
-+ *  This program is free software; you can redistribute it and/or modify
-+ *  it under the terms of the GNU General Public License as published by
-+ *  the Free Software Foundation; either version 2 of the License, or
-+ *  (at your option) any later version.
-+ *
-+ *  This program is distributed in the hope that it will be useful,
-+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+ *  GNU General Public License for more details.
-+ *
-+ *  You should have received a copy of the GNU General Public License
-+ *  along with this program; if not, write to the Free Software
-+ *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-+ */
-+
-+#include <grub/efi/chainloader.h>
-+#include <grub/err.h>
-+#include <grub/normal.h>
-+#include <grub/dl.h>
-+
-+static grub_err_t
-+chainloader_command (struct grub_arg_list *state __attribute__ ((unused)),
-+                   int argc, char **args)
-+{
-+  if (argc == 0)
-+    grub_error (GRUB_ERR_BAD_ARGUMENT, "no file specified");
-+  else
-+    grub_chainloader_cmd (args[0]);
-+  return grub_errno;
-+}
-+
-+GRUB_MOD_INIT(chainloader_normal)
-+{
-+  (void) mod; /* To stop warning.  */
-+  grub_register_command ("chainloader", chainloader_command,
-+                       GRUB_COMMAND_FLAG_BOTH,
-+                       "chainloader FILE",
-+                       "Prepare to boot another boot loader.", 0);
-+}
-+
-+GRUB_MOD_FINI(chainloader_normal)
-+{
-+  grub_unregister_command ("chainloader");
-+}
-Index: loader/i386/efi/linux.c
-===================================================================
-RCS file: loader/i386/efi/linux.c
-diff -N loader/i386/efi/linux.c
---- /dev/null  1 Jan 1970 00:00:00 -0000
-+++ loader/i386/efi/linux.c    28 May 2006 03:20:18 -0000      1.1
-@@ -0,0 +1,688 @@
-+/*
-+ *  GRUB  --  GRand Unified Bootloader
-+ *  Copyright (C) 2006  Free Software Foundation, Inc.
-+ *
-+ *  This program is free software; you can redistribute it and/or modify
-+ *  it under the terms of the GNU General Public License as published by
-+ *  the Free Software Foundation; either version 2 of the License, or
-+ *  (at your option) any later version.
-+ *
-+ *  This program is distributed in the hope that it will be useful,
-+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+ *  GNU General Public License for more details.
-+ *
-+ *  You should have received a copy of the GNU General Public License
-+ *  along with this program; if not, write to the Free Software
-+ *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-+ */
-+
-+#include <grub/loader.h>
-+#include <grub/machine/loader.h>
-+#include <grub/file.h>
-+#include <grub/disk.h>
-+#include <grub/err.h>
-+#include <grub/misc.h>
-+#include <grub/types.h>
-+#include <grub/rescue.h>
-+#include <grub/dl.h>
-+#include <grub/mm.h>
-+#include <grub/term.h>
-+#include <grub/cpu/linux.h>
-+#include <grub/efi/api.h>
-+#include <grub/efi/efi.h>
-+
-+#define NEXT_MEMORY_DESCRIPTOR(desc, size)      \
-+  ((grub_efi_memory_descriptor_t *) ((char *) (desc) + (size)))
-+
-+static grub_dl_t my_mod;
-+
-+static grub_size_t linux_mem_size;
-+static int loaded;
-+static void *real_mode_mem;
-+static void *prot_mode_mem;
-+static void *initrd_mem;
-+static grub_efi_uintn_t real_mode_pages;
-+static grub_efi_uintn_t prot_mode_pages;
-+static grub_efi_uintn_t initrd_pages;
-+static void *mmap_buf;
-+
-+static grub_uint8_t gdt[] __attribute__ ((aligned(16))) =
-+  {
-+    /* NULL.  */
-+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-+    /* Reserved.  */
-+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-+    /* Code segment.  */
-+    0xFF, 0xFF, 0x00, 0x00, 0x00, 0x9A, 0xCF, 0x00,
-+    /* Data segment.  */
-+    0xFF, 0xFF, 0x00, 0x00, 0x00, 0x92, 0xCF, 0x00
-+  };
-+
-+struct gdt_descriptor
-+{
-+  grub_uint16_t dummy;
-+  grub_uint16_t limit;
-+  grub_uint32_t base;
-+} __attribute__ ((aligned(4), packed));
-+
-+static struct gdt_descriptor gdt_desc =
-+  {
-+    0,
-+    sizeof (gdt) - 1,
-+    (grub_addr_t) gdt
-+  };
-+
-+struct idt_descriptor
-+{
-+  grub_uint16_t dummy;
-+  grub_uint16_t limit;
-+  grub_uint32_t base;
-+} __attribute__ ((aligned(4)));
-+
-+static struct idt_descriptor idt_desc =
-+  {
-+    0,
-+    0,
-+    0
-+  };
-+
-+static inline grub_size_t
-+page_align (grub_size_t size)
-+{
-+  return (size + (1 << 12) - 1) & (~((1 << 12) - 1));
-+}
-+
-+/* Find the optimal number of pages for the memory map. Is it better to
-+   move this code to efi/mm.c?  */
-+static grub_efi_uintn_t
-+find_mmap_size (void)
-+{
-+  static grub_efi_uintn_t mmap_size = 0;
-+
-+  if (mmap_size != 0)
-+    return mmap_size;
-+  
-+  mmap_size = (1 << 12);
-+  while (1)
-+    {
-+      int ret;
-+      grub_efi_memory_descriptor_t *mmap;
-+      grub_efi_uintn_t desc_size;
-+      
-+      mmap = grub_malloc (mmap_size);
-+      if (! mmap)
-+      return 0;
-+
-+      ret = grub_efi_get_memory_map (&mmap_size, mmap, 0, &desc_size, 0);
-+      grub_free (mmap);
-+      
-+      if (ret < 0)
-+      grub_fatal ("cannot get memory map");
-+      else if (ret > 0)
-+      break;
-+
-+      mmap_size += (1 << 12);
-+    }
-+
-+  /* Increase the size a bit for safety, because GRUB allocates more on
-+     later, and EFI itself may allocate more.  */
-+  mmap_size += (1 << 12);
-+
-+  return page_align (mmap_size);
-+}
-+
-+static void
-+free_pages (void)
-+{
-+  if (real_mode_mem)
-+    {
-+      grub_efi_free_pages ((grub_addr_t) real_mode_mem, real_mode_pages);
-+      real_mode_mem = 0;
-+    }
-+
-+  if (prot_mode_mem)
-+    {
-+      grub_efi_free_pages ((grub_addr_t) prot_mode_mem, prot_mode_pages);
-+      prot_mode_mem = 0;
-+    }
-+  
-+  if (initrd_mem)
-+    {
-+      grub_efi_free_pages ((grub_addr_t) initrd_mem, initrd_pages);
-+      initrd_mem = 0;
-+    }
-+}
-+
-+/* Allocate pages for the real mode code and the protected mode code
-+   for linux as well as a memory map buffer.  */
-+static int
-+allocate_pages (grub_size_t real_size, grub_size_t prot_size)
-+{
-+  grub_efi_uintn_t desc_size;
-+  grub_efi_memory_descriptor_t *mmap, *mmap_end;
-+  grub_efi_uintn_t mmap_size, tmp_mmap_size;
-+  grub_efi_memory_descriptor_t *desc;
-+  
-+  /* Make sure that each size is aligned to a page boundary.  */
-+  real_size = page_align (real_size + GRUB_DISK_SECTOR_SIZE);
-+  prot_size = page_align (prot_size);
-+  mmap_size = find_mmap_size ();
-+
-+  grub_dprintf ("linux", "real_size = %x, prot_size = %x, mmap_size = %x\n",
-+              real_size, prot_size, mmap_size);
-+  
-+  /* Calculate the number of pages; Combine the real mode code with
-+     the memory map buffer for simplicity.  */
-+  real_mode_pages = ((real_size + mmap_size) >> 12);
-+  prot_mode_pages = (prot_size >> 12);
-+  
-+  /* Initialize the memory pointers with NULL for convenience.  */
-+  real_mode_mem = 0;
-+  prot_mode_mem = 0;
-+  
-+  /* Read the memory map temporarily, to find free space.  */
-+  mmap = grub_malloc (mmap_size);
-+  if (! mmap)
-+    return 0;
-+
-+  tmp_mmap_size = mmap_size;
-+  if (grub_efi_get_memory_map (&tmp_mmap_size, mmap, 0, &desc_size, 0) <= 0)
-+    grub_fatal ("cannot get memory map");
-+
-+  mmap_end = NEXT_MEMORY_DESCRIPTOR (mmap, tmp_mmap_size);
-+  
-+  /* First, find free pages for the real mode code
-+     and the memory map buffer.  */
-+  for (desc = mmap;
-+       desc < mmap_end;
-+       desc = NEXT_MEMORY_DESCRIPTOR (desc, desc_size))
-+    {
-+      /* Probably it is better to put the real mode code in the traditional
-+       space for safety.  */
-+      if (desc->type == GRUB_EFI_CONVENTIONAL_MEMORY
-+        && desc->physical_start <= 0x90000
-+        && desc->num_pages >= real_mode_pages)
-+      {
-+        grub_efi_physical_address_t physical_end;
-+        grub_efi_physical_address_t addr;
-+        
-+        physical_end = desc->physical_start + (desc->num_pages << 12);
-+        if (physical_end > 0x90000)
-+          physical_end = 0x90000;
-+
-+        grub_dprintf ("linux", "physical_start = %x, physical_end = %x\n",
-+                      (unsigned) desc->physical_start,
-+                      (unsigned) physical_end);
-+        addr = physical_end - real_size - mmap_size;
-+        if (addr < 0x10000)
-+          continue;
-+
-+        grub_dprintf ("linux", "trying to allocate %u pages at %x\n",
-+                      real_mode_pages, (unsigned) addr);
-+        real_mode_mem = grub_efi_allocate_pages (addr, real_mode_pages);
-+        if (! real_mode_mem)
-+          grub_fatal ("cannot allocate pages");
-+        
-+        desc->num_pages -= real_mode_pages;
-+        break;
-+      }
-+    }
-+
-+  if (! real_mode_mem)
-+    {
-+      grub_error (GRUB_ERR_OUT_OF_MEMORY, "cannot allocate real mode pages");
-+      goto fail;
-+    }
-+
-+  mmap_buf = (void *) ((char *) real_mode_mem + real_size);
-+            
-+  /* Next, find free pages for the protected mode code.  */
-+  /* XXX what happens if anything is using this address?  */
-+  prot_mode_mem = grub_efi_allocate_pages (0x100000, prot_mode_pages);
-+  if (! prot_mode_mem)
-+    {
-+      grub_error (GRUB_ERR_OUT_OF_MEMORY,
-+                "cannot allocate protected mode pages");
-+      goto fail;
-+    }
-+
-+  grub_free (mmap);
-+  return 1;
-+
-+ fail:
-+  grub_free (mmap);
-+  free_pages ();
-+  return 0;
-+}
-+
-+static grub_err_t
-+grub_linux_boot (void)
-+{
-+  struct linux_kernel_header *lh;
-+  struct linux_kernel_params *params;
-+  grub_efi_uintn_t mmap_size;
-+  grub_efi_uintn_t map_key;
-+  grub_efi_uintn_t desc_size;
-+  grub_efi_uint32_t desc_version;
-+  
-+  lh = real_mode_mem;
-+  params = real_mode_mem;
-+
-+  grub_dprintf ("linux", "code32_start = %x, idt_desc = %x, gdt_desc = %x\n",
-+              (unsigned) lh->code32_start, (grub_addr_t) &(idt_desc.limit),
-+              (grub_addr_t) &(gdt_desc.limit));
-+  grub_dprintf ("linux", "idt = %x:%x, gdt = %x:%x\n",
-+              (unsigned) idt_desc.limit, (unsigned) idt_desc.base,
-+              (unsigned) gdt_desc.limit, (unsigned) gdt_desc.base);
-+  mmap_size = find_mmap_size ();
-+  if (grub_efi_get_memory_map (&mmap_size, mmap_buf, &map_key,
-+                             &desc_size, &desc_version) <= 0)
-+    grub_fatal ("cannot get memory map");
-+
-+  if (! grub_efi_exit_boot_services (map_key))
-+    grub_fatal ("cannot exit boot services");
-+
-+  /* Note that no boot services are available from here.  */
-+
-+  /* Hardware interrupts are not safe any longer.  */
-+  asm volatile ("cli" : : );
-+  
-+  /* Pass EFI parameters.  */
-+  params->efi_mem_desc_size = desc_size;
-+  params->efi_mem_desc_version = desc_version;
-+  params->efi_mmap = (grub_addr_t) mmap_buf;
-+  params->efi_mmap_size = mmap_size;
-+
-+  /* Pass parameters.  */
-+  asm volatile ("movl %0, %%esi" : : "m" (real_mode_mem));
-+  asm volatile ("movl %0, %%ecx" : : "m" (lh->code32_start));
-+  asm volatile ("xorl %%ebx, %%ebx" : : );
-+
-+  /* Load the IDT and the GDT for the bootstrap.  */
-+  asm volatile ("lidt %0" : : "m" (idt_desc.limit));
-+  asm volatile ("lgdt %0" : : "m" (gdt_desc.limit));
-+
-+  /* Enter Linux.  */
-+  asm volatile ("jmp *%%ecx" : : );
-+  
-+  /* Never reach here.  */
-+  return GRUB_ERR_NONE;
-+}
-+
-+static grub_err_t
-+grub_linux_unload (void)
-+{
-+  free_pages ();
-+  grub_dl_unref (my_mod);
-+  loaded = 0;
-+  return GRUB_ERR_NONE;
-+}
-+
-+void
-+grub_rescue_cmd_linux (int argc, char *argv[])
-+{
-+  grub_file_t file = 0;
-+  struct linux_kernel_header lh;
-+  struct linux_kernel_params *params;
-+  grub_uint8_t setup_sects;
-+  grub_size_t real_size, prot_size;
-+  grub_ssize_t len;
-+  int i;
-+  char *dest;
-+
-+  grub_dl_ref (my_mod);
-+  
-+  if (argc == 0)
-+    {
-+      grub_error (GRUB_ERR_BAD_ARGUMENT, "no kernel specified");
-+      goto fail;
-+    }
-+
-+  file = grub_file_open (argv[0]);
-+  if (! file)
-+    goto fail;
-+
-+  if (grub_file_read (file, (char *) &lh, sizeof (lh)) != sizeof (lh))
-+    {
-+      grub_error (GRUB_ERR_READ_ERROR, "cannot read the linux header");
-+      goto fail;
-+    }
-+
-+  if (lh.boot_flag != grub_cpu_to_le16 (0xaa55))
-+    {
-+      grub_error (GRUB_ERR_BAD_OS, "invalid magic number");
-+      goto fail;
-+    }
-+
-+  if (lh.setup_sects > GRUB_LINUX_MAX_SETUP_SECTS)
-+    {
-+      grub_error (GRUB_ERR_BAD_OS, "too many setup sectors");
-+      goto fail;
-+    }
-+
-+  /* EFI support is quite new, so reject old versions.  */
-+  if (lh.header != grub_cpu_to_le32 (GRUB_LINUX_MAGIC_SIGNATURE)
-+      || grub_le_to_cpu16 (lh.version) < 0x0203)
-+    {
-+      grub_error (GRUB_ERR_BAD_OS, "too old version");
-+      goto fail;
-+    }
-+
-+  /* I'm not sure how to support zImage on EFI.  */
-+  if (! (lh.loadflags & GRUB_LINUX_FLAG_BIG_KERNEL))
-+    {
-+      grub_error (GRUB_ERR_BAD_OS, "zImage is not supported");
-+      goto fail;
-+    }
-+
-+  setup_sects = lh.setup_sects;
-+  
-+  /* If SETUP_SECTS is not set, set it to the default (4).  */
-+  if (! setup_sects)
-+    setup_sects = GRUB_LINUX_DEFAULT_SETUP_SECTS;
-+
-+  real_size = setup_sects << GRUB_DISK_SECTOR_BITS;
-+  prot_size = grub_file_size (file) - real_size - GRUB_DISK_SECTOR_SIZE;
-+  
-+  if (! allocate_pages (real_size, prot_size))
-+    goto fail;
-+  
-+  /* XXX Linux assumes that only elilo can boot Linux on EFI!!!  */
-+  lh.type_of_loader = 0x50;
-+
-+  lh.cl_magic = GRUB_LINUX_CL_MAGIC;
-+  lh.cl_offset = GRUB_LINUX_CL_END_OFFSET;
-+  lh.cmd_line_ptr = (char *) real_mode_mem + GRUB_LINUX_CL_OFFSET;
-+  lh.ramdisk_image = 0;
-+  lh.ramdisk_size = 0;
-+
-+  params = (struct linux_kernel_params *) &lh;
-+
-+  /* These are not needed to be precise, because Linux uses these values
-+     only to raise an error when the decompression code cannot find good
-+     space.  */
-+  params->ext_mem = ((32 * 0x100000) >> 10);
-+  params->alt_mem = ((32 * 0x100000) >> 10);
-+  
-+  params->video_cursor_x = grub_efi_system_table->con_out->mode->cursor_column;
-+  params->video_cursor_y = grub_efi_system_table->con_out->mode->cursor_row;
-+  params->video_page = 0; /* ??? */
-+  params->video_mode = grub_efi_system_table->con_out->mode->mode;
-+  params->video_width = (grub_getwh () >> 8);
-+  params->video_ega_bx = 0;
-+  params->video_height = (grub_getwh () & 0xff);
-+  params->have_vga = 0;
-+  params->font_size = 16; /* XXX */
-+
-+  /* No VBE on EFI.  */
-+  params->lfb_width = 0;
-+  params->lfb_height = 0;
-+  params->lfb_depth = 0;
-+  params->lfb_base = 0;
-+  params->lfb_size = 0;
-+  params->lfb_line_len = 0;
-+  params->red_mask_size = 0;
-+  params->red_field_pos = 0;
-+  params->green_mask_size = 0;
-+  params->green_field_pos = 0;
-+  params->blue_mask_size = 0;
-+  params->blue_field_pos = 0;
-+  params->reserved_mask_size = 0;
-+  params->reserved_field_pos = 0;
-+  params->vesapm_segment = 0;
-+  params->vesapm_offset = 0;
-+  params->lfb_pages = 0;
-+  params->vesa_attrib = 0;
-+
-+  /* No APM on EFI.  */
-+  params->apm_version = 0;
-+  params->apm_code_segment = 0;
-+  params->apm_entry = 0;
-+  params->apm_16bit_code_segment = 0;
-+  params->apm_data_segment = 0;
-+  params->apm_flags = 0;
-+  params->apm_code_len = 0;
-+  params->apm_data_len = 0;
-+
-+  /* XXX is there any way to use SpeedStep on EFI?  */
-+  params->ist_signature = 0;
-+  params->ist_command = 0;
-+  params->ist_event = 0;
-+  params->ist_perf_level = 0;
-+
-+  /* Let the kernel probe the information.  */
-+  grub_memset (params->hd0_drive_info, 0, sizeof (params->hd0_drive_info));
-+  grub_memset (params->hd1_drive_info, 0, sizeof (params->hd1_drive_info));
-+
-+  /* No MCA on EFI.  */
-+  params->rom_config_len = 0;
-+
-+  params->efi_signature = GRUB_LINUX_EFI_SIGNATURE; /* XXX not used */
-+  params->efi_system_table = (grub_addr_t) grub_efi_system_table;
-+  /* The other EFI parameters are filled when booting.  */
-+
-+  /* No need to fake the BIOS's memory map.  */
-+  params->mmap_size = 0;
-+
-+  /* Let the kernel probe the information.  */
-+  params->ps_mouse = 0;
-+
-+  /* Clear padding for future compatibility.  */
-+  grub_memset (params->padding1, 0, sizeof (params->padding1));
-+  grub_memset (params->padding2, 0, sizeof (params->padding2));
-+  grub_memset (params->padding3, 0, sizeof (params->padding3));
-+  grub_memset (params->padding4, 0, sizeof (params->padding4));
-+  grub_memset (params->padding5, 0, sizeof (params->padding5));
-+  grub_memset (params->padding6, 0, sizeof (params->padding6));
-+  grub_memset (params->padding7, 0, sizeof (params->padding7));
-+  grub_memset (params->padding8, 0, sizeof (params->padding8));
-+  grub_memset (params->padding9, 0, sizeof (params->padding9));
-+  
-+  /* Put the real mode code at the real location.  */
-+  grub_memmove (real_mode_mem, &lh, sizeof (lh));
-+
-+  len = real_size + GRUB_DISK_SECTOR_SIZE - sizeof (lh);
-+  if (grub_file_read (file, (char *) real_mode_mem + sizeof (lh), len) != len)
-+    {
-+      grub_error (GRUB_ERR_FILE_READ_ERROR, "Couldn't read file");
-+      goto fail;
-+    }
-+
-+  /* XXX there is no way to know if the kernel really supports EFI.  */
-+  grub_printf ("   [Linux-EFI, setup=0x%x, size=0x%x]\n",
-+             real_size, prot_size);
-+
-+  /* Detect explicitly specified memory size, if any.  */
-+  linux_mem_size = 0;
-+  for (i = 1; i < argc; i++)
-+    if (grub_memcmp (argv[i], "mem=", 4) == 0)
-+      {
-+      char *val = argv[i] + 4;
-+        
-+      linux_mem_size = grub_strtoul (val, &val, 0);
-+      
-+      if (grub_errno)
-+        {
-+          grub_errno = GRUB_ERR_NONE;
-+          linux_mem_size = 0;
-+        }
-+      else
-+        {
-+          int shift = 0;
-+          
-+          switch (grub_tolower (val[0]))
-+            {
-+            case 'g':
-+              shift += 10;
-+            case 'm':
-+              shift += 10;
-+            case 'k':
-+              shift += 10;
-+            default:
-+              break;
-+            }
-+
-+          /* Check an overflow.  */
-+          if (linux_mem_size > (~0UL >> shift))
-+            linux_mem_size = 0;
-+          else
-+            linux_mem_size <<= shift;
-+        }
-+      }
-+
-+  /* Specify the boot file.  */
-+  dest = grub_stpcpy ((char *) real_mode_mem + GRUB_LINUX_CL_OFFSET,
-+                    "BOOT_IMAGE=");
-+  dest = grub_stpcpy (dest, argv[0]);
-+  
-+  /* Copy kernel parameters.  */
-+  for (i = 1;
-+       i < argc
-+       && dest + grub_strlen (argv[i]) + 1 < ((char *) real_mode_mem
-+                                              + GRUB_LINUX_CL_END_OFFSET);
-+       i++)
-+    {
-+      *dest++ = ' ';
-+      dest = grub_stpcpy (dest, argv[i]);
-+    }
-+
-+  len = prot_size;
-+  if (grub_file_read (file, (char *) GRUB_LINUX_BZIMAGE_ADDR, len) != len)
-+    grub_error (GRUB_ERR_FILE_READ_ERROR, "Couldn't read file");
-+
-+  if (grub_errno == GRUB_ERR_NONE)
-+    {
-+      grub_loader_set (grub_linux_boot, grub_linux_unload, 1);
-+      loaded = 1;
-+    }
-+
-+ fail:
-+  
-+  if (file)
-+    grub_file_close (file);
-+
-+  if (grub_errno != GRUB_ERR_NONE)
-+    {
-+      grub_dl_unref (my_mod);
-+      loaded = 0;
-+    }
-+}
-+
-+void
-+grub_rescue_cmd_initrd (int argc, char *argv[])
-+{
-+  grub_file_t file = 0;
-+  grub_ssize_t size;
-+  grub_addr_t addr_min, addr_max;
-+  grub_addr_t addr;
-+  grub_efi_uintn_t mmap_size;
-+  grub_efi_memory_descriptor_t *desc;
-+  grub_efi_uintn_t desc_size;
-+  struct linux_kernel_header *lh;
-+  
-+  if (argc == 0)
-+    {
-+      grub_error (GRUB_ERR_BAD_ARGUMENT, "No module specified");
-+      goto fail;
-+    }
-+  
-+  if (! loaded)
-+    {
-+      grub_error (GRUB_ERR_BAD_ARGUMENT, "You need to load the kernel first.");
-+      goto fail;
-+    }
-+
-+  file = grub_file_open (argv[0]);
-+  if (! file)
-+    goto fail;
-+
-+  size = grub_file_size (file);
-+  initrd_pages = (page_align (size) >> 12);
-+
-+  lh = (struct linux_kernel_header *) real_mode_mem;
-+  
-+  addr_max = grub_cpu_to_le32 (lh->initrd_addr_max);
-+  if (linux_mem_size != 0 && linux_mem_size < addr_max)
-+    addr_max = linux_mem_size;
-+  
-+  /* Linux 2.3.xx has a bug in the memory range check, so avoid
-+     the last page.
-+     Linux 2.2.xx has a bug in the memory range check, which is
-+     worse than that of Linux 2.3.xx, so avoid the last 64kb.  */
-+  addr_max -= 0x10000;
-+
-+  /* Usually, the compression ratio is about 50%.  */
-+  addr_min = (grub_addr_t) prot_mode_mem + ((prot_mode_pages * 3) << 12);
-+  
-+  /* Find the highest address to put the initrd.  */
-+  mmap_size = find_mmap_size ();
-+  if (grub_efi_get_memory_map (&mmap_size, mmap_buf, 0, &desc_size, 0) <= 0)
-+    grub_fatal ("cannot get memory map");
-+
-+  addr = 0;
-+  for (desc = mmap_buf;
-+       desc < NEXT_MEMORY_DESCRIPTOR (mmap_buf, mmap_size);
-+       desc = NEXT_MEMORY_DESCRIPTOR (desc, desc_size))
-+    {
-+      if (desc->type == GRUB_EFI_CONVENTIONAL_MEMORY
-+        && desc->physical_start >= addr_min
-+        && desc->physical_start + size < addr_max
-+        && desc->num_pages >= initrd_pages)
-+      {
-+        grub_efi_physical_address_t physical_end;
-+        
-+        physical_end = desc->physical_start + (desc->num_pages << 12);
-+        if (physical_end > addr_max)
-+          physical_end = addr_max;
-+
-+        if (physical_end > addr)
-+          addr = physical_end - page_align (size);
-+      }
-+    }
-+
-+  if (addr == 0)
-+    {
-+      grub_error (GRUB_ERR_OUT_OF_MEMORY, "no free pages available");
-+      goto fail;
-+    }
-+  
-+  initrd_mem = grub_efi_allocate_pages (addr, initrd_pages);
-+  if (! initrd_mem)
-+    grub_fatal ("cannot allocate pages");
-+  
-+  if (grub_file_read (file, initrd_mem, size) != size)
-+    {
-+      grub_error (GRUB_ERR_FILE_READ_ERROR, "Couldn't read file");
-+      goto fail;
-+    }
-+
-+  grub_printf ("   [Initrd, addr=0x%x, size=0x%x]\n",
-+             addr, size);
-+  
-+  lh->ramdisk_image = addr;
-+  lh->ramdisk_size = size;
-+  lh->root_dev = 0x0100; /* XXX */
-+  
-+ fail:
-+  if (file)
-+    grub_file_close (file);
-+}
-+
-+
-+GRUB_MOD_INIT(linux)
-+{
-+  grub_rescue_register_command ("linux",
-+                              grub_rescue_cmd_linux,
-+                              "load linux");
-+  grub_rescue_register_command ("initrd",
-+                              grub_rescue_cmd_initrd,
-+                              "load initrd");
-+  my_mod = mod;
-+}
-+
-+GRUB_MOD_FINI(linux)
-+{
-+  grub_rescue_unregister_command ("linux");
-+  grub_rescue_unregister_command ("initrd");
-+}
-Index: loader/i386/efi/linux_normal.c
-===================================================================
-RCS file: loader/i386/efi/linux_normal.c
-diff -N loader/i386/efi/linux_normal.c
---- /dev/null  1 Jan 1970 00:00:00 -0000
-+++ loader/i386/efi/linux_normal.c     28 May 2006 03:20:18 -0000      1.1
-@@ -0,0 +1,61 @@
-+/* linux_normal.c - boot linux */
-+/*
-+ *  GRUB  --  GRand Unified Bootloader
-+ *  Copyright (C) 2004,2005,2006  Free Software Foundation, Inc.
-+ *
-+ *  This program is free software; you can redistribute it and/or modify
-+ *  it under the terms of the GNU General Public License as published by
-+ *  the Free Software Foundation; either version 2 of the License, or
-+ *  (at your option) any later version.
-+ *
-+ *  This program is distributed in the hope that it will be useful,
-+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+ *  GNU General Public License for more details.
-+ *
-+ *  You should have received a copy of the GNU General Public License
-+ *  along with this program; if not, write to the Free Software
-+ *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-+ */
-+
-+#include <grub/machine/loader.h>
-+#include <grub/err.h>
-+#include <grub/normal.h>
-+#include <grub/dl.h>
-+
-+static grub_err_t
-+grub_normal_linux_command (struct grub_arg_list *state __attribute__ ((unused)),
-+                         int argc, char **args)
-+{
-+  grub_rescue_cmd_linux (argc, args);
-+  return grub_errno;
-+}
-+
-+
-+static grub_err_t
-+grub_normal_initrd_command (struct grub_arg_list *state __attribute__ ((unused)),
-+                          int argc, char **args)
-+{
-+  grub_rescue_cmd_initrd (argc, args);
-+  return grub_errno;
-+}
-+
-+GRUB_MOD_INIT(linux_normal)
-+{
-+  (void) mod; /* To stop warning.  */
-+  grub_register_command ("linux", grub_normal_linux_command,
-+                       GRUB_COMMAND_FLAG_BOTH,
-+                       "linux FILE [ARGS...]",
-+                       "Load a linux kernel.", 0);
-+  
-+  grub_register_command ("initrd", grub_normal_initrd_command,
-+                       GRUB_COMMAND_FLAG_BOTH,
-+                       "initrd FILE",
-+                       "Load an initrd.", 0);
-+}
-+
-+GRUB_MOD_FINI(linux_normal)
-+{
-+  grub_unregister_command ("linux");
-+  grub_unregister_command ("initrd");
-+}
-Index: loader/i386/pc/chainloader.c
-===================================================================
-RCS file: /cvsroot/grub/grub2/loader/i386/pc/chainloader.c,v
-retrieving revision 1.9
-retrieving revision 1.10
-diff -u -r1.9 -r1.10
---- loader/i386/pc/chainloader.c       13 Nov 2005 15:47:09 -0000      1.9
-+++ loader/i386/pc/chainloader.c       30 Apr 2006 21:09:37 -0000      1.10
-@@ -114,7 +114,7 @@
-     }
-   grub_file_close (file);
--  grub_loader_set (grub_chainloader_boot, grub_chainloader_unload);
-+  grub_loader_set (grub_chainloader_boot, grub_chainloader_unload, 1);
-   return;
-   
-  fail:
-Index: loader/i386/pc/linux.c
-===================================================================
-RCS file: /cvsroot/grub/grub2/loader/i386/pc/linux.c,v
-retrieving revision 1.9
-retrieving revision 1.12
-diff -u -r1.9 -r1.12
---- loader/i386/pc/linux.c     13 Nov 2005 15:47:09 -0000      1.9
-+++ loader/i386/pc/linux.c     14 May 2006 21:16:20 -0000      1.12
-@@ -30,7 +30,7 @@
- #include <grub/machine/memory.h>
- #include <grub/rescue.h>
- #include <grub/dl.h>
--#include <grub/machine/linux.h>
-+#include <grub/cpu/linux.h>
- static grub_dl_t my_mod;
-@@ -81,9 +81,11 @@
-   if (! file)
-     goto fail;
--  if (grub_file_size (file) > (grub_ssize_t) grub_os_area_size)
-+  if ((grub_size_t) grub_file_size (file) > grub_os_area_size)
-     {
--      grub_error (GRUB_ERR_OUT_OF_RANGE, "too big kernel");
-+      grub_error (GRUB_ERR_OUT_OF_RANGE, "too big kernel (0x%x > 0x%x)",
-+                (grub_size_t) grub_file_size (file),
-+                grub_os_area_size);
-       goto fail;
-     }
-@@ -273,7 +275,7 @@
-   if (grub_errno == GRUB_ERR_NONE)
-     {
-       grub_linux_prot_size = prot_size;
--      grub_loader_set (grub_linux_boot, grub_linux_unload);
-+      grub_loader_set (grub_linux_boot, grub_linux_unload, 1);
-       loaded = 1;
-     }
-Index: loader/i386/pc/multiboot.c
-===================================================================
-RCS file: /cvsroot/grub/grub2/loader/i386/pc/multiboot.c,v
-retrieving revision 1.9
-retrieving revision 1.11
-diff -u -r1.9 -r1.11
---- loader/i386/pc/multiboot.c 13 Nov 2005 15:47:09 -0000      1.9
-+++ loader/i386/pc/multiboot.c 4 Jun 2006 15:56:54 -0000       1.11
-@@ -127,7 +127,8 @@
-           return grub_error (GRUB_ERR_BAD_OS,
-                              "segment doesn't fit in memory reserved for the OS");
--          if (grub_file_seek (file, phdr->p_offset) == -1)
-+          if (grub_file_seek (file, (grub_off_t) phdr->p_offset)
-+            == (grub_off_t) -1)
-           return grub_error (GRUB_ERR_BAD_OS,
-                              "invalid offset in program header");
-         
-@@ -201,7 +202,8 @@
-           return grub_error (GRUB_ERR_BAD_OS,
-                              "segment doesn't fit in memory reserved for the OS");
-         
--        if (grub_file_seek (file, phdr->p_offset) == -1)
-+        if (grub_file_seek (file, (grub_off_t) phdr->p_offset)
-+            == (grub_off_t) -1)
-           return grub_error (GRUB_ERR_BAD_OS,
-                              "invalid offset in program header");
-@@ -326,7 +328,7 @@
-   mbi->flags |= GRUB_MB_INFO_BOOT_LOADER_NAME;
-   mbi->boot_loader_name = (grub_uint32_t) grub_strdup (PACKAGE_STRING);
--  grub_loader_set (grub_multiboot_boot, grub_multiboot_unload);
-+  grub_loader_set (grub_multiboot_boot, grub_multiboot_unload, 1);
-  fail:
-   if (file)
-Index: loader/powerpc/ieee1275/linux.c
-===================================================================
-RCS file: /cvsroot/grub/grub2/loader/powerpc/ieee1275/linux.c,v
-retrieving revision 1.12
-retrieving revision 1.13
-diff -u -r1.12 -r1.13
---- loader/powerpc/ieee1275/linux.c    23 Nov 2005 04:25:16 -0000      1.12
-+++ loader/powerpc/ieee1275/linux.c    30 Apr 2006 21:09:37 -0000      1.13
-@@ -250,7 +250,7 @@
-     }
-   else
-     {
--      grub_loader_set (grub_linux_boot, grub_linux_unload);
-+      grub_loader_set (grub_linux_boot, grub_linux_unload, 1);
-       initrd_addr = 0;
-       loaded = 1;
-     }
-Index: normal/cmdline.c
-===================================================================
-RCS file: /cvsroot/grub/grub2/normal/cmdline.c,v
-retrieving revision 1.19
-retrieving revision 1.20
-diff -u -r1.19 -r1.20
---- normal/cmdline.c   28 Aug 2005 17:01:16 -0000      1.19
-+++ normal/cmdline.c   14 Mar 2006 19:08:34 -0000      1.20
-@@ -231,6 +231,8 @@
-       xpos = (plen + lpos) % 79;
-       ypos = ystart + (plen + lpos) / 79;
-       grub_gotoxy (xpos, ypos);
-+      
-+      grub_refresh ();
-     }
-   
-   void cl_print (int pos, int c)
-@@ -271,6 +273,8 @@
-         cl_print (lpos - len, echo_char);
-         cl_set_pos ();
-       }
-+      
-+      grub_refresh ();
-     }
-   void cl_delete (unsigned len)
-@@ -290,6 +294,8 @@
-         cl_print (lpos, echo_char);
-         cl_set_pos ();
-       }
-+      
-+      grub_refresh ();
-     }
-   
-   plen = grub_strlen (prompt);
-Index: normal/command.c
-===================================================================
-RCS file: /cvsroot/grub/grub2/normal/command.c,v
-retrieving revision 1.15
-retrieving revision 1.17
-diff -u -r1.15 -r1.17
---- normal/command.c   18 Nov 2005 10:51:00 -0000      1.15
-+++ normal/command.c   29 Apr 2006 20:29:42 -0000      1.17
-@@ -1,6 +1,6 @@
- /*
-  *  GRUB  --  GRand Unified Bootloader
-- *  Copyright (C) 2003,2005  Free Software Foundation, Inc.
-+ *  Copyright (C) 2003,2005,2006  Free Software Foundation, Inc.
-  *
-  *  This program is free software; you can redistribute it and/or modify
-  *  it under the terms of the GNU General Public License as published by
-@@ -284,6 +284,18 @@
- }
- static grub_err_t
-+export_command (struct grub_arg_list *state __attribute__ ((unused)),
-+              int argc, char **args)
-+{
-+  if (argc < 1)
-+    return grub_error (GRUB_ERR_BAD_ARGUMENT,
-+                     "no environment variable specified");
-+
-+  grub_env_export (args[0]);
-+  return 0;
-+}
-+
-+static grub_err_t
- insmod_command (struct grub_arg_list *state __attribute__ ((unused)),
-               int argc, char **args)
- {
-@@ -357,9 +369,6 @@
- void
- grub_command_init (void)
- {
--  /* This is a special command, because this never be called actually.  */
--  grub_register_command ("title", 0, GRUB_COMMAND_FLAG_TITLE, 0, 0, 0);
--
-   grub_register_command ("rescue", rescue_command, GRUB_COMMAND_FLAG_BOTH,
-                        "rescue", "Go back to the rescue mode.", 0);
-@@ -370,6 +379,9 @@
-   grub_register_command ("unset", unset_command, GRUB_COMMAND_FLAG_BOTH,
-                        "unset ENVVAR", "Remove an environment variable.", 0);
-+  grub_register_command ("export", export_command, GRUB_COMMAND_FLAG_BOTH,
-+                       "export ENVVAR", "Export a variable.", 0);
-+
-   grub_register_command ("insmod", insmod_command, GRUB_COMMAND_FLAG_BOTH,
-                        "insmod MODULE",
-                        "Insert a module. The argument can be a file or a module name.",
-Index: normal/context.c
-===================================================================
-RCS file: normal/context.c
-diff -N normal/context.c
---- normal/context.c   27 Feb 2005 21:19:05 -0000      1.1
-+++ /dev/null  1 Jan 1970 00:00:00 -0000
-@@ -1,75 +0,0 @@
--/*
-- *  GRUB  --  GRand Unified Bootloader
-- *  Copyright (C) 2005  Free Software Foundation, Inc.
-- *
-- *  This program is free software; you can redistribute it and/or modify
-- *  it under the terms of the GNU General Public License as published by
-- *  the Free Software Foundation; either version 2 of the License, or
-- *  (at your option) any later version.
-- *
-- *  This program is distributed in the hope that it will be useful,
-- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
-- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-- *  GNU General Public License for more details.
-- *
-- *  You should have received a copy of the GNU General Public License
-- *  along with this program; if not, write to the Free Software
-- *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-- */
--
--#include <grub/normal.h>
--#include <grub/mm.h>
--
--static struct grub_context context =
--  {
--    .menu_list = 0
--  };
--
--/* Return a pointer to the context.  */
--grub_context_t
--grub_context_get (void)
--{
--  return &context;
--}
--
--/* Return the current menu.  */
--grub_menu_t
--grub_context_get_current_menu (void)
--{
--  if (context.menu_list)
--    return context.menu_list->menu;
--
--  return 0;
--}
--
--/* Push a new menu. Return this menu. If any error occurs, return NULL.  */
--grub_menu_t
--grub_context_push_menu (grub_menu_t menu)
--{
--  grub_menu_list_t menu_list;
--
--  menu_list = grub_malloc (sizeof (*menu_list));
--  if (! menu_list)
--    return 0;
--
--  menu_list->menu = menu;
--  menu_list->next = context.menu_list;
--  context.menu_list = menu_list;
--
--  return menu;
--}
--
--/* Pop a menu.  */
--void
--grub_context_pop_menu (void)
--{
--  grub_menu_list_t menu_list;
--
--  menu_list = context.menu_list;
--  if (menu_list)
--    {
--      context.menu_list = menu_list->next;
--      grub_free (menu_list);
--    }
--}
--
-Index: normal/execute.c
-===================================================================
-RCS file: /cvsroot/grub/grub2/normal/execute.c,v
-retrieving revision 1.2
-retrieving revision 1.4
-diff -u -r1.2 -r1.4
---- normal/execute.c   17 Jan 2006 09:50:47 -0000      1.2
-+++ normal/execute.c   28 May 2006 21:58:34 -0000      1.4
-@@ -25,14 +25,13 @@
- #include <grub/env.h>
- #include <grub/script.h>
--static int
-+static grub_err_t
- grub_script_execute_cmd (struct grub_script_cmd *cmd)
- {
-   if (cmd == 0)
-     return 0;
--  cmd->exec (cmd);
--  return 0;
-+  return cmd->exec (cmd);
- }
- /* Parse ARG and return the textual representation.  Add strings are
-@@ -104,7 +103,24 @@
-       /* It's not a GRUB command, try all functions.  */
-       func = grub_script_function_find (cmdline->cmdname);
-       if (! func)
--      return 0;
-+      {
-+        /* As a last resort, try if it is an assignment.  */
-+        char *assign = grub_strdup (cmdline->cmdname);
-+        char *eq = grub_strchr (assign, '=');
-+
-+        if (eq)
-+          {
-+            /* Create two strings and set the variable.  */
-+            *eq = '\0';
-+            eq++;
-+            grub_env_set (assign, eq);
-+
-+            /* This was set because the command was not found.  */
-+            grub_errno = GRUB_ERR_NONE;
-+          }
-+        grub_free (assign);
-+        return 0;
-+      }
-     }
-   if (cmdline->arglist)
-@@ -176,19 +192,19 @@
- grub_script_execute_cmdif (struct grub_script_cmd *cmd)
- {
-   struct grub_script_cmdif *cmdif = (struct grub_script_cmdif *) cmd;
--  char *bool;
-+  char *result;
-   /* Check if the commands results in a true or a false.  The value is
--     read from the env variable `RESULT'.  */
--  grub_script_execute_cmd (cmdif->bool);
--  bool = grub_env_get ("?");
-+     read from the env variable `?'.  */
-+  grub_script_execute_cmd (cmdif->exec_to_evaluate);
-+  result = grub_env_get ("?");
-   /* Execute the `if' or the `else' part depending on the value of
--     `RESULT'.  */
--  if (bool && ! grub_strcmp (bool, "0"))
--    return grub_script_execute_cmd (cmdif->true);
-+     `?'.  */
-+  if (result && ! grub_strcmp (result, "0"))
-+    return grub_script_execute_cmd (cmdif->exec_on_true);
-   else
--    return grub_script_execute_cmd (cmdif->false);
-+    return grub_script_execute_cmd (cmdif->exec_on_false);
- }
- /* Execute the menu entry generate statement.  */
-Index: normal/lexer.c
-===================================================================
-RCS file: /cvsroot/grub/grub2/normal/lexer.c,v
-retrieving revision 1.2
-retrieving revision 1.6
-diff -u -r1.2 -r1.6
---- normal/lexer.c     17 Jan 2006 09:50:47 -0000      1.2
-+++ normal/lexer.c     4 Jun 2006 15:56:55 -0000       1.6
-@@ -1,7 +1,7 @@
- /* lexer.c - The scripting lexer.  */
- /*
-  *  GRUB  --  GRand Unified Bootloader
-- *  Copyright (C) 2005  Free Software Foundation, Inc.
-+ *  Copyright (C) 2005, 2006  Free Software Foundation, Inc.
-  *
-  *  This program is free software; you can redistribute it and/or modify
-  *  it under the terms of the GNU General Public License as published by
-@@ -25,10 +25,6 @@
- #include "grub_script.tab.h"
--static grub_parser_state_t grub_script_lexer_state;
--static int grub_script_lexer_done = 0;
--static grub_err_t (*grub_script_lexer_getline) (char **);
--
- static int
- check_varstate (grub_parser_state_t state)
- {
-@@ -48,141 +44,159 @@
-         || state == GRUB_PARSER_STATE_DQUOTE);
- }
--/* The amount of references to the lexer by the parser.  If the parser
--   expects tokens the lexer is referenced.  */
--static int grub_script_lexer_refs = 0;
--static char *script;
--static char *newscript;
--
--static int record = 0;
--static char *recording = 0;
--static int recordpos = 0;
--static int recordlen = 0;
--
--/* XXX: The lexer is not reentrant.  */
--void
--grub_script_lexer_init (char *s, grub_err_t (*getline) (char **))
-+struct grub_lexer_param *
-+grub_script_lexer_init (char *script, grub_err_t (*getline) (char **))
- {
--  grub_script_lexer_state = GRUB_PARSER_STATE_TEXT;
--  grub_script_lexer_getline = getline;
--  grub_script_lexer_refs = 0;
--  grub_script_lexer_done = 0;
--  newscript = 0;
--  script = s;
-+  struct grub_lexer_param *param;
-+
-+  param = grub_malloc (sizeof (*param));
-+  if (! param)
-+    return 0;
-+
-+  param->state = GRUB_PARSER_STATE_TEXT;
-+  param->getline = getline;
-+  param->refs = 0;
-+  param->done = 0;
-+  param->newscript = 0;
-+  param->script = script;
-+  param->record = 0;
-+  param->recording = 0;
-+  param->recordpos = 0;
-+  param->recordlen = 0;
-+
-+  return param;
- }
- void
--grub_script_lexer_ref (void)
-+grub_script_lexer_ref (struct grub_lexer_param *state)
- {
--  grub_script_lexer_refs++;
-+  state->refs++;
- }
- void
--grub_script_lexer_deref (void)
-+grub_script_lexer_deref (struct grub_lexer_param *state)
- {
--  grub_script_lexer_refs--;
-+  state->refs--;
- }
- /* Start recording all characters passing through the lexer.  */
- void
--grub_script_lexer_record_start (void)
-+grub_script_lexer_record_start (struct grub_lexer_param *state)
- {
--  record = 1;
--  recordlen = 100;
--  recording = grub_malloc (recordlen);
--  recordpos = 0;
-+  state->record = 1;
-+  state->recordlen = 100;
-+  state->recording = grub_malloc (state->recordlen);
-+  state->recordpos = 0;
- }
- char *
--grub_script_lexer_record_stop (void)
-+grub_script_lexer_record_stop (struct grub_lexer_param *state)
- {
--  record = 0;
-+  state->record = 0;
-   /* Delete the last character, it is a `}'.  */
--  if (recordpos > 0)
-+  if (state->recordpos > 0)
-     {
--      if (recording[--recordpos] != '}')
-+      if (state->recording[--state->recordpos] != '}')
-       {
-         grub_printf ("Internal error while parsing menu entry");
-         for (;;); /* XXX */
-       }
--      recording[recordpos] = '\0';
-+      state->recording[state->recordpos] = '\0';
-     }
--  return recording;
-+  return state->recording;
- }
- /* When recording is enabled, record the character C as the next item
-    in the character stream.  */
- static void
--recordchar (char c)
-+recordchar (struct grub_lexer_param *state, char c)
- {
--  if (recordpos == recordlen)
-+  if (state->recordpos == state->recordlen)
-     {
--      char *old = recording;
--      recordlen += 100;
--      recording = grub_realloc (recording, recordlen);
--      if (! recording)
-+      char *old = state->recording;
-+      state->recordlen += 100;
-+      state->recording = grub_realloc (state->recording, state->recordlen);
-+      if (! state->recording)
-       {
-         grub_free (old);
--        record = 0;
-+        state->record = 0;
-       }
-     }
--  recording[recordpos++] = c;
-+  state->recording[state->recordpos++] = c;
- }
- /* Fetch the next character for the lexer.  */
- static void
--nextchar (void)
-+nextchar (struct grub_lexer_param *state)
-+{
-+  if (state->record)
-+    recordchar (state, *state->script);
-+  state->script++;
-+}
-+
-+int
-+grub_script_yylex2 (YYSTYPE *yylval, struct grub_parser_param *parsestate);
-+
-+int
-+grub_script_yylex (YYSTYPE *yylval, struct grub_parser_param *parsestate)
- {
--  if (record)
--    recordchar (*script);
--  script++;
-+  int r = -1;
-+
-+  while (r == -1)
-+    {
-+      r = grub_script_yylex2 (yylval, parsestate);
-+      if (r == ' ')
-+      r = -1;
-+    }
-+  return r;
- }
- int
--grub_script_yylex (void)
-+grub_script_yylex2 (YYSTYPE *yylval, struct grub_parser_param *parsestate)
- {
-   grub_parser_state_t newstate;
-   char use;
-   char *buffer;
-   char *bp;
-+  struct grub_lexer_param *state = parsestate->lexerstate;
--  if (grub_script_lexer_done)
-+  if (state->done)
-     return 0;
--  if (! *script)
-+  if (! *state->script)
-     {
-       /* Check if more tokens are requested by the parser.  */
--      if ((grub_script_lexer_refs
--         || grub_script_lexer_state == GRUB_PARSER_STATE_ESC)
--        && grub_script_lexer_getline)
-+      if ((state->refs
-+         || state->state == GRUB_PARSER_STATE_ESC)
-+        && state->getline)
-       {
--        while (!script || ! grub_strlen (script))
-+        while (!state->script || ! grub_strlen (state->script))
-           {
--            grub_free (newscript);
--            newscript = 0;
--            grub_script_lexer_getline (&newscript);
--            script = newscript;
--            if (! script)
-+            grub_free (state->newscript);
-+            state->newscript = 0;
-+            state->getline (&state->newscript);
-+            state->script = state->newscript;
-+            if (! state->script)
-               return 0;
-           }
-         grub_dprintf ("scripting", "token=`\\n'\n");
--        recordchar ('\n');
--        if (grub_script_lexer_state != GRUB_PARSER_STATE_ESC)
-+        recordchar (state, '\n');
-+        if (state->state != GRUB_PARSER_STATE_ESC)
-           return '\n';
-       }
-       else
-       {
--        grub_free (newscript);
--        newscript = 0;
--        grub_script_lexer_done = 1;
-+        grub_free (state->newscript);
-+        state->newscript = 0;
-+        state->done = 1;
-         grub_dprintf ("scripting", "token=`\\n'\n");
-         return '\n';
-       }
-     }
--  newstate = grub_parser_cmdline_state (grub_script_lexer_state, *script, &use);
-+  newstate = grub_parser_cmdline_state (state->state, *state->script, &use);
-   /* Check if it is a text.  */
-   if (check_textstate (newstate))
-@@ -191,21 +205,21 @@
-        length symbol.  */
-       if (newstate == GRUB_PARSER_STATE_TEXT)
-       {
--        switch (*script)
-+        switch (*state->script)
-           {
-           case ' ':
--            while (*script)
-+            while (*state->script)
-               {
--                newstate = grub_parser_cmdline_state (grub_script_lexer_state,
--                                                      *script, &use);
--                if (! (grub_script_lexer_state == GRUB_PARSER_STATE_TEXT
--                       && *script == ' '))
-+                newstate = grub_parser_cmdline_state (state->state,
-+                                                      *state->script, &use);
-+                if (! (state->state == GRUB_PARSER_STATE_TEXT
-+                       && *state->script == ' '))
-                   {
-                     grub_dprintf ("scripting", "token=` '\n");
-                     return ' ';
-                   }
--                grub_script_lexer_state = newstate;
--                nextchar ();
-+                state->state = newstate;
-+                nextchar (state);
-               }
-             grub_dprintf ("scripting", "token=` '\n");
-             return ' ';
-@@ -215,26 +229,26 @@
-           case '\n':
-             {
-               char c;
--              grub_dprintf ("scripting", "token=`%c'\n", *script);
--              c = *script;;
--              nextchar ();
-+              grub_dprintf ("scripting", "token=`%c'\n", *state->script);
-+              c = *state->script;;
-+              nextchar (state);
-               return c;
-             }
-           }
-       }
-       /* XXX: Use a better size.  */
--      buffer = grub_script_malloc (2048);
-+      buffer = grub_script_malloc (parsestate, 2048);
-       if (! buffer)
-       return 0;
-       bp = buffer;
-       /* Read one token, possible quoted.  */
--      while (*script)
-+      while (*state->script)
-       {
--        newstate = grub_parser_cmdline_state (grub_script_lexer_state,
--                                              *script, &use);
-+        newstate = grub_parser_cmdline_state (state->state,
-+                                              *state->script, &use);
-         /* Check if a variable name starts.  */
-         if (check_varstate (newstate))
-@@ -244,7 +258,7 @@
-            when a special token was found.  It will be recognised
-            next time when this function is called.  */
-         if (newstate == GRUB_PARSER_STATE_TEXT
--            && grub_script_lexer_state != GRUB_PARSER_STATE_ESC)
-+            && state->state != GRUB_PARSER_STATE_ESC)
-           {
-             int breakout = 0;
-@@ -264,14 +278,14 @@
-         else if (use)
-           *(bp++) = use;
--        grub_script_lexer_state = newstate;
--        nextchar ();
-+        state->state = newstate;
-+        nextchar (state);
-       }
-       /* A string of text was read in.  */
-       *bp = '\0';
-       grub_dprintf ("scripting", "token=`%s'\n", buffer);
--      grub_script_yylval.string = buffer;
-+      yylval->string = buffer;
-       /* Detect some special tokens.  */
-       if (! grub_strcmp (buffer, "while"))
-@@ -297,38 +311,38 @@
-          || newstate == GRUB_PARSER_STATE_QVAR)
-     {
-       /* XXX: Use a better size.  */
--      buffer = grub_script_malloc (2096);
-+      buffer = grub_script_malloc (parsestate, 2096);
-       if (! buffer)
-       return 0;
-       bp = buffer;
-       /* This is a variable, read the variable name.  */
--      while (*script)
-+      while (*state->script)
-       {
--        newstate = grub_parser_cmdline_state (grub_script_lexer_state,
--                                              *script, &use);
-+        newstate = grub_parser_cmdline_state (state->state,
-+                                              *state->script, &use);
-         /* Check if this character is not part of the variable name
-            anymore.  */
-         if (! (check_varstate (newstate)))
-           {
--            if (grub_script_lexer_state == GRUB_PARSER_STATE_VARNAME2
--                || grub_script_lexer_state == GRUB_PARSER_STATE_QVARNAME2)
--              nextchar ();
--            grub_script_lexer_state = newstate;
-+            if (state->state == GRUB_PARSER_STATE_VARNAME2
-+                || state->state == GRUB_PARSER_STATE_QVARNAME2)
-+              nextchar (state);
-+            state->state = newstate;
-             break;
-           }
-         if (use)
-           *(bp++) = use;
--        nextchar ();
--        grub_script_lexer_state = newstate;
-+        nextchar (state);
-+        state->state = newstate;
-       }
-       *bp = '\0';
--      grub_script_lexer_state = newstate;
--      grub_script_yylval.string = buffer;
-+      state->state = newstate;
-+      yylval->string = buffer;
-       grub_dprintf ("scripting", "vartoken=`%s'\n", buffer);
-       return GRUB_PARSER_TOKEN_VAR;
-@@ -343,7 +357,8 @@
- }
- void
--grub_script_yyerror (char const *err)
-+grub_script_yyerror (struct grub_parser_param *lex __attribute__ ((unused)),
-+                   char const *err)
- {
--  grub_printf (err);
-+  grub_printf ("%s\n", err);
- }
-Index: normal/main.c
-===================================================================
-RCS file: /cvsroot/grub/grub2/normal/main.c,v
-retrieving revision 1.14
-retrieving revision 1.17
-diff -u -r1.14 -r1.17
---- normal/main.c      17 Jan 2006 09:50:47 -0000      1.14
-+++ normal/main.c      7 May 2006 18:28:24 -0000       1.17
-@@ -1,7 +1,7 @@
- /* main.c - the normal mode main routine */
- /*
-  *  GRUB  --  GRand Unified Bootloader
-- *  Copyright (C) 2000,2001,2002,2003,2005  Free Software Foundation, Inc.
-+ *  Copyright (C) 2000,2001,2002,2003,2005,2006  Free Software Foundation, Inc.
-  *
-  *  This program is free software; you can redistribute it and/or modify
-  *  it under the terms of the GNU General Public License as published by
-@@ -153,6 +153,8 @@
-   (*last)->next = 0;
-   (*last)->sourcecode = sourcecode;
-+  current_menu->size++;
-+
-   return GRUB_ERR_NONE;
- }
-@@ -162,6 +164,7 @@
-   grub_file_t file;
-   auto grub_err_t getline (char **line);
-   int currline = 0;
-+  int errors = 0;
-   
-   grub_err_t getline (char **line)
-     {
-@@ -184,9 +187,6 @@
-   newmenu = grub_malloc (sizeof (*newmenu));
-   if (! newmenu)
-     return 0;
--  newmenu->default_entry = 0;
--  newmenu->fallback_entry = -1;
--  newmenu->timeout = -1;
-   newmenu->size = 0;
-   newmenu->entry_list = 0;
-   current_menu = newmenu;
-@@ -199,21 +199,18 @@
-   while (get_line (file, cmdline, sizeof (cmdline)))
-     {
-       struct grub_script *parsed_script;
-+      int startline;
-       
--      currline++;
-+      startline = ++currline;
-       /* Execute the script, line for line.  */
-       parsed_script = grub_script_parse (cmdline, getline);
-       if (! parsed_script)
-       {
--        /* Wait until the user pushes any key so that the user can
--           see what happened.  */
--        grub_printf ("\nPress any key to continue...");
--        (void) grub_getkey ();
--
--        grub_file_close (file);
--        return 0;
-+        grub_printf ("(line %d-%d)\n", startline, currline);
-+        errors++;
-+        continue;
-       }
-       /* Execute the command(s).  */
-@@ -223,10 +220,24 @@
-       grub_script_free (parsed_script);
-     }
--  return newmenu;
--
-   grub_file_close (file);
--  return 0;
-+
-+  if (errors > 0)
-+    {
-+      /* Wait until the user pushes any key so that the user can
-+       see what happened.  */
-+      grub_printf ("\nPress any key to continue...");
-+      (void) grub_getkey ();
-+    }
-+
-+  /* If the menu is empty, just drop it.  */
-+  if (current_menu->size == 0)
-+    {
-+      grub_free (current_menu);
-+      return 0;
-+    }
-+
-+  return newmenu;
- }
- /* This starts the normal mode.  */
-@@ -417,8 +428,9 @@
-   if (menu)
-     {
-+      grub_env_set_data_slot ("menu", menu);
-       grub_menu_run (menu, nested);
--      grub_context_pop_menu ();
-+      grub_env_unset_data_slot ("menu");
-       free_menu (menu);
-     }
-   else
-Index: normal/menu.c
-===================================================================
-RCS file: /cvsroot/grub/grub2/normal/menu.c,v
-retrieving revision 1.15
-retrieving revision 1.16
-diff -u -r1.15 -r1.16
---- normal/menu.c      17 Jan 2006 09:50:47 -0000      1.15
-+++ normal/menu.c      7 May 2006 18:28:24 -0000       1.16
-@@ -1,6 +1,6 @@
- /*
-  *  GRUB  --  GRand Unified Bootloader
-- *  Copyright (C) 2003,2004,2005  Free Software Foundation, Inc.
-+ *  Copyright (C) 2003,2004,2005,2006  Free Software Foundation, Inc.
-  *
-  *  This program is free software; you can redistribute it and/or modify
-  *  it under the terms of the GNU General Public License as published by
-@@ -23,6 +23,7 @@
- #include <grub/loader.h>
- #include <grub/mm.h>
- #include <grub/machine/time.h>
-+#include <grub/env.h>
- static void
- draw_border (void)
-@@ -111,7 +112,8 @@
-     /* XXX How to show this error?  */
-     return;
-   
--  len = grub_utf8_to_ucs4 (unicode_title, title, grub_strlen (title));
-+  len = grub_utf8_to_ucs4 (unicode_title, (grub_uint8_t *) title,
-+                         grub_strlen (title));
-   if (len < 0)
-     {
-       /* It is an invalid sequence.  */
-@@ -202,14 +204,92 @@
-   print_message (nested, edit);
- }
-+/* Return the current timeout. If the variable "timeout" is not set or
-+   invalid, return -1.  */
-+static int
-+get_timeout (void)
-+{
-+  char *val;
-+  int timeout;
-+  
-+  val = grub_env_get ("timeout");
-+  if (! val)
-+    return -1;
-+  
-+  grub_error_push ();
-+  
-+  timeout = (int) grub_strtoul (val, 0, 0);
-+
-+  /* If the value is invalid, unset the variable.  */
-+  if (grub_errno != GRUB_ERR_NONE)
-+    {
-+      grub_env_unset ("timeout");
-+      grub_errno = GRUB_ERR_NONE;
-+      timeout = -1;
-+    }
-+
-+  grub_error_pop ();
-+  
-+  return timeout;
-+}
-+
-+/* Set current timeout in the variable "timeout".  */
-+static void
-+set_timeout (int timeout)
-+{
-+  /* Ignore TIMEOUT if it is zero, because it will be unset really soon.  */
-+  if (timeout > 0)
-+    {
-+      char buf[16];
-+      
-+      grub_sprintf (buf, "%d", timeout);
-+      grub_env_set ("timeout", buf);
-+    }
-+}
-+
-+/* Get the entry number from the variable NAME.  */
-+static int
-+get_entry_number (const char *name)
-+{
-+  char *val;
-+  int entry;
-+  
-+  val = grub_env_get (name);
-+  if (! val)
-+    return -1;
-+  
-+  grub_error_push ();
-+  
-+  entry = (int) grub_strtoul (val, 0, 0);
-+
-+  if (grub_errno != GRUB_ERR_NONE)
-+    {
-+      grub_errno = GRUB_ERR_NONE;
-+      entry = -1;
-+    }
-+
-+  grub_error_pop ();
-+  
-+  return entry;
-+}
-+
- static int
- run_menu (grub_menu_t menu, int nested)
- {
-   int first, offset;
-   unsigned long saved_time;
-+  int default_entry;
-   
-   first = 0;
--  offset = menu->default_entry;
-+  
-+  default_entry = get_entry_number ("default");
-+
-+  /* If DEFAULT_ENTRY is not within the menu entries, fall back to
-+     the first entry.  */
-+  if (default_entry < 0 || default_entry >= menu->size)
-+    default_entry = 0;
-+
-+  offset = default_entry;
-   if (offset > GRUB_TERM_NUM_ENTRIES - 1)
-     {
-       first = offset - (GRUB_TERM_NUM_ENTRIES - 1);
-@@ -228,15 +308,19 @@
-   while (1)
-     {
-       int c;
-+      int timeout;
--      if (menu->timeout > 0)
-+      timeout = get_timeout ();
-+      
-+      if (timeout > 0)
-       {
-         unsigned long current_time;
-         current_time = grub_get_rtc ();
-         if (current_time - saved_time >= GRUB_TICKS_PER_SECOND)
-           {
--            menu->timeout--;
-+            timeout--;
-+            set_timeout (timeout);
-             saved_time = current_time;
-           }
-         
-@@ -245,28 +329,28 @@
-            They are required to clear the line.  */
-         grub_printf ("\
-    The highlighted entry will be booted automatically in %d seconds.    ",
--                     menu->timeout);
-+                     timeout);
-         grub_gotoxy (GRUB_TERM_CURSOR_X, GRUB_TERM_FIRST_ENTRY_Y + offset);
-         grub_refresh ();
-       }
--      if (menu->timeout == 0)
-+      if (timeout == 0)
-       {
--        menu->timeout = -1;
--        return menu->default_entry;
-+        grub_env_unset ("timeout");
-+        return default_entry;
-       }
-       
--      if (grub_checkkey () >= 0 || menu->timeout < 0)
-+      if (grub_checkkey () >= 0 || timeout < 0)
-       {
-         c = GRUB_TERM_ASCII_CHAR (grub_getkey ());
-         
--        if (menu->timeout >= 0)
-+        if (timeout >= 0)
-           {
-             grub_gotoxy (0, GRUB_TERM_HEIGHT - 3);
-               grub_printf ("\
-                                                                         ");
--              menu->timeout = -1;
--              menu->fallback_entry = -1;
-+            grub_env_unset ("timeout");
-+            grub_env_unset ("fallback");
-             grub_gotoxy (GRUB_TERM_CURSOR_X, GRUB_TERM_FIRST_ENTRY_Y + offset);
-           }
-         
-@@ -361,6 +445,7 @@
-     {
-       int boot_entry;
-       grub_menu_entry_t e;
-+      int fallback_entry;
-       
-       boot_entry = run_menu (menu, nested);
-       if (boot_entry < 0)
-@@ -376,13 +461,14 @@
-       /* Deal with a fallback entry.  */
-       /* FIXME: Multiple fallback entries like GRUB Legacy.  */
--      if (menu->fallback_entry >= 0)
-+      fallback_entry = get_entry_number ("fallback");
-+      if (fallback_entry >= 0)
-       {
-         grub_print_error ();
-         grub_errno = GRUB_ERR_NONE;
-         
--        e = get_entry (menu, menu->fallback_entry);
--        menu->fallback_entry = -1;
-+        e = get_entry (menu, fallback_entry);
-+        grub_env_unset ("fallback");
-         grub_printf ("\n  Falling back to \'%s\'\n\n", e->title);
-         run_menu_entry (e);
-       }
-Index: normal/parser.y
-===================================================================
-RCS file: /cvsroot/grub/grub2/normal/parser.y,v
-retrieving revision 1.2
-retrieving revision 1.6
-diff -u -r1.2 -r1.6
---- normal/parser.y    17 Jan 2006 09:50:47 -0000      1.2
-+++ normal/parser.y    4 Jun 2006 15:56:55 -0000       1.6
-@@ -1,7 +1,7 @@
- /* parser.y - The scripting parser.  */
- /*
-  *  GRUB  --  GRand Unified Bootloader
-- *  Copyright (C) 2005  Free Software Foundation, Inc.
-+ *  Copyright (C) 2005, 2006  Free Software Foundation, Inc.
-  *
-  *  This program is free software; you can redistribute it and/or modify
-  *  it under the terms of the GNU General Public License as published by
-@@ -24,11 +24,7 @@
- #define YYFREE                grub_free
- #define YYMALLOC      grub_malloc
--
--/* Keep track of the memory allocated for this specific function.  */
--static struct grub_script_mem *func_mem = 0;
--
--static char *menu_entry = 0;
-+#define YYLTYPE_IS_TRIVIAL      0
- %}
-@@ -48,20 +44,28 @@
- %token GRUB_PARSER_TOKEN_FI           "fi"
- %token GRUB_PARSER_TOKEN_NAME
- %token GRUB_PARSER_TOKEN_VAR
--%type <cmd> script grubcmd command commands menuentry if
-+%type <cmd> script grubcmd command commands commandblock menuentry if
- %type <arglist> arguments;
- %type <arg> argument;
- %type <string> "if" "while" "function" "else" "then" "fi"
- %type <string> text GRUB_PARSER_TOKEN_NAME GRUB_PARSER_TOKEN_VAR
-+%pure-parser
-+%lex-param { struct grub_parser_param *state };
-+%parse-param { struct grub_parser_param *state };
-+
- %%
- /* It should be possible to do this in a clean way...  */
--script:               commands returns
-+script:               { state->err = 0} newlines commands
-                 {
--                  grub_script_parsed = $1;
-+                  state->parsed = $3;
-                 }
- ;
-+newlines:     /* Empty */
-+              | newlines '\n'
-+;
-+
- /* Some tokens are both used as token or as plain text.  XXX: Add all
-    tokens without causing conflicts.  */
- text:         GRUB_PARSER_TOKEN_NAME
-@@ -78,51 +82,45 @@
-                 }
- ;
--ws:           /* Empty */
--              | ' '
--;
--
--returns:      /* Empty */
--              | '\n'
--;
--
- /* An argument can consist of some static text mixed with variables,
-    for example: `foo${bar}baz'.  */
- argument:     GRUB_PARSER_TOKEN_VAR
-                 {
--                  $$ = grub_script_arg_add (0, GRUB_SCRIPT_ARG_TYPE_VAR, $1);
-+                  $$ = grub_script_arg_add (state, 0, GRUB_SCRIPT_ARG_TYPE_VAR, $1);
-                 }
-               | text
-                 {
--                  $$ = grub_script_arg_add (0, GRUB_SCRIPT_ARG_TYPE_STR, $1);
--                }
--              | argument GRUB_PARSER_TOKEN_VAR
--                {
--                  $$ = grub_script_arg_add ($1, GRUB_SCRIPT_ARG_TYPE_VAR, $2);
--                }
--              | argument text
--                {
--                  $$ = grub_script_arg_add ($1, GRUB_SCRIPT_ARG_TYPE_STR, $2);
-+                  $$ = grub_script_arg_add (state, 0, GRUB_SCRIPT_ARG_TYPE_STR, $1);
-                 }
-+/* XXX: Currently disabled to simplify the parser.  This should be
-+   parsed by yet another parser for readibility.  */
-+/*            | argument GRUB_PARSER_TOKEN_VAR */
-+/*              { */
-+/*                $$ = grub_script_arg_add ($1, GRUB_SCRIPT_ARG_TYPE_VAR, $2); */
-+/*              } */
-+/*            | argument text */
-+/*              { */
-+/*                $$ = grub_script_arg_add ($1, GRUB_SCRIPT_ARG_TYPE_STR, $2); */
-+/*              } */
- ;
- arguments:    argument
-                 {
--                  $$ = grub_script_add_arglist (0, $1);
-+                  $$ = grub_script_add_arglist (state, 0, $1);
-                 }
--              | arguments ' ' argument
-+              | arguments argument
-                 {
--                  $$ = grub_script_add_arglist ($1, $3);
-+                  $$ = grub_script_add_arglist (state, $1, $2);
-                 }
- ;
--grubcmd:      ws GRUB_PARSER_TOKEN_NAME ' ' arguments ws
-+grubcmd:      GRUB_PARSER_TOKEN_NAME arguments
-                 {
--                  $$ = grub_script_create_cmdline ($2, $4);
-+                  $$ = grub_script_create_cmdline (state, $1, $2);
-                 }
--              | ws GRUB_PARSER_TOKEN_NAME ws
-+              | GRUB_PARSER_TOKEN_NAME
-                 {
--                  $$ = grub_script_create_cmdline ($2, 0);
-+                  $$ = grub_script_create_cmdline (state, $1, 0);
-                 }
- ;
-@@ -130,84 +128,105 @@
- command:      grubcmd         { $$ = $1; }
-               | if            { $$ = $1; }
-               | function      { $$ = 0;  }
--              | menuentry     { $$ = $1;  }
-+              | menuentry     { $$ = $1; }
- ;
- /* A block of commands.  */
--commands:     command
-+commands:     command '\n'
-                 { 
--                  $$ = grub_script_add_cmd (0, $1);
-+                  $$ = grub_script_add_cmd (state, 0, $1);
-                 }
--              | commands ';' command
-+              | command
-+                { 
-+                  $$ = grub_script_add_cmd (state, 0, $1);
-+                }
-+              | command ';' commands
-                 { 
-                   struct grub_script_cmdblock *cmd;
--                  cmd = (struct grub_script_cmdblock *) $1;
--                  $$ = grub_script_add_cmd (cmd, $3);
-+                  cmd = (struct grub_script_cmdblock *) $3;
-+                  $$ = grub_script_add_cmd (state, cmd, $1);
-                 }
--              | commands '\n' command
-+              | command '\n' newlines commands
-                 { 
-                   struct grub_script_cmdblock *cmd;
--                  cmd = (struct grub_script_cmdblock *) $1;
--                  $$ = grub_script_add_cmd (cmd, $3);
-+                  cmd = (struct grub_script_cmdblock *) $4;
-+                  $$ = grub_script_add_cmd (state, cmd, $1);
-+                }
-+              | error
-+                {
-+                  yyerror (state, "Incorrect command");
-+                  state->err = 1;
-+                  yyerrok;
-                 }
- ;
--/* A function.  Carefully save the memory that is allocated.  */
--function:     "function" ' ' GRUB_PARSER_TOKEN_NAME
-+/* A function.  Carefully save the memory that is allocated.  Don't
-+   change any stuff because it might seem like a fun thing to do!
-+   Special care was take to make sure the mid-rule actions are
-+   executed on the right moment.  So the `commands' rule should be
-+   recognised after executing the `grub_script_mem_record; and before
-+   `grub_script_mem_record_stop'.  */
-+function:     "function" GRUB_PARSER_TOKEN_NAME
-                 { 
--                  grub_script_lexer_ref ();
--                } ws '{' returns
-+                  grub_script_lexer_ref (state->lexerstate);
-+                } newlines '{'
-                 { 
-                   /* The first part of the function was recognised.
-                      Now start recording the memory usage to store
-                      this function.  */
--                  func_mem = grub_script_mem_record ();
--                } commands returns '}'
-+                  state->func_mem = grub_script_mem_record (state);
-+                } newlines commands '}'
-                 {
-                   struct grub_script *script;
-                   /* All the memory usage for parsing this function
-                      was recorded.  */
--                  func_mem = grub_script_mem_record_stop (func_mem);
--                  script = grub_script_create ($9, func_mem);
-+                  state->func_mem = grub_script_mem_record_stop (state,
-+                                                                 state->func_mem);
-+                  script = grub_script_create ($8, state->func_mem);
-                   if (script)
--                    grub_script_function_create ($3, script);
--                  grub_script_lexer_deref ();
-+                    grub_script_function_create ($2, script);
-+                  grub_script_lexer_deref (state->lexerstate);
-+                }
-+;
-+
-+/* Carefully designed, together with `menuentry' so everything happens
-+   just in the expected order.  */
-+commandblock: '{'
-+                {
-+                  grub_script_lexer_ref (state->lexerstate);
-+                    grub_script_lexer_record_start (state->lexerstate);
-+                }
-+                newlines commands '}'
-+                  {
-+                  grub_script_lexer_deref (state->lexerstate);
-+                  $$ = $4;
-                 }
- ;
- /* A menu entry.  Carefully save the memory that is allocated.  */
--menuentry:    "menuentry" ' ' argument
--                { 
--                  grub_script_lexer_ref ();
--                } ws '{' returns
--                { 
--                  /* Record sourcecode of the menu entry.  It can be
--                     parsed multiple times if it is part of a
--                     loop.  */
--                  grub_script_lexer_record_start ();
--                } commands returns '}'
--                {
--                  menu_entry = grub_script_lexer_record_stop ();
--                  $$ = grub_script_create_cmdmenu ($3, menu_entry, 0);
--                  grub_script_lexer_deref ();
-+menuentry:    "menuentry" argument newlines commandblock
-+                {
-+                  char *menu_entry;
-+                  menu_entry = grub_script_lexer_record_stop (state->lexerstate);
-+                  $$ = grub_script_create_cmdmenu (state, $2, menu_entry, 0);
-                 }
- ;
- /* The first part of the if statement.  It's used to switch the lexer
-    to a state in which it demands more tokens.  */
--if_statement: "if" { grub_script_lexer_ref (); }
-+if_statement: "if" { grub_script_lexer_ref (state->lexerstate); }
- ;
- /* The if statement.  */
--if:            if_statement grubcmd ';' ws "then" returns commands returns "fi"
-+if:            if_statement grubcmd ';' "then" commands "fi"
-                 {
--                  $$ = grub_script_create_cmdif ($2, $7, 0);
--                  grub_script_lexer_deref ();
-+                  $$ = grub_script_create_cmdif (state, $2, $5, 0);
-+                  grub_script_lexer_deref (state->lexerstate);
-                 }
--               | if_statement grubcmd ';' ws "then" returns commands returns "else" returns commands returns  "fi"
-+               | if_statement grubcmd ';' "then" commands "else" commands  "fi"
-                 {
--                  $$ = grub_script_create_cmdif ($2, $7, $11);
--                  grub_script_lexer_deref ();
-+                  $$ = grub_script_create_cmdif (state, $2, $5, $7);
-+                  grub_script_lexer_deref (state->lexerstate);
-                 }
- ;
-Index: normal/script.c
-===================================================================
-RCS file: /cvsroot/grub/grub2/normal/script.c,v
-retrieving revision 1.2
-retrieving revision 1.7
-diff -u -r1.2 -r1.7
---- normal/script.c    17 Jan 2006 09:50:47 -0000      1.2
-+++ normal/script.c    4 Jun 2006 15:56:55 -0000       1.7
-@@ -1,7 +1,7 @@
- /* script.c -- Functions to create an in memory description of the script. */
- /*
-  *  GRUB  --  GRand Unified Bootloader
-- *  Copyright (C) 2005  Free Software Foundation, Inc.
-+ *  Copyright (C) 2005, 2006  Free Software Foundation, Inc.
-  *
-  *  This program is free software; you can redistribute it and/or modify
-  *  it under the terms of the GNU General Public License as published by
-@@ -28,11 +28,7 @@
-    allocations.  The memory is free'ed in case of an error, or
-    assigned to the parsed script when parsing was successful.  */
--/* The memory that was used while parsing and scanning.  */
--static struct grub_script_mem *grub_script_memused;
--
--/* The result of the parser.  */
--struct grub_script_cmd *grub_script_parsed = 0;
-+/* XXX */
- /* In case of the normal malloc, some additional bytes are allocated
-    for this datastructure.  All reserved memory is stored in a linked
-@@ -46,15 +42,15 @@
- /* Return malloc'ed memory and keep track of the allocation.  */
- void *
--grub_script_malloc (grub_size_t size)
-+grub_script_malloc (struct grub_parser_param *state, grub_size_t size)
- {
-   struct grub_script_mem *mem;
-   mem = (struct grub_script_mem *) grub_malloc (size + sizeof (*mem)
-                                               - sizeof (char));
-   grub_dprintf ("scripting", "malloc %p\n", mem);
--  mem->next = grub_script_memused;
--  grub_script_memused = mem;
-+  mem->next = state->memused;
-+  state->memused = mem;
-   return (void *) &mem->mem;
- }
-@@ -76,20 +72,22 @@
- /* Start recording memory usage.  Returns the memory that should be
-    restored when calling stop.  */
- struct grub_script_mem *
--grub_script_mem_record (void)
-+grub_script_mem_record (struct grub_parser_param *state)
- {
--  struct grub_script_mem *mem = grub_script_memused;
--  grub_script_memused = 0;
-+  struct grub_script_mem *mem = state->memused;
-+  state->memused = 0;
-+
-   return mem;
- }
- /* Stop recording memory usage.  Restore previous recordings using
-    RESTORE.  Return the recorded memory.  */
- struct grub_script_mem *
--grub_script_mem_record_stop (struct grub_script_mem *restore)
-+grub_script_mem_record_stop (struct grub_parser_param *state,
-+                           struct grub_script_mem *restore)
- {
--  struct grub_script_mem *mem = grub_script_memused;
--  grub_script_memused = restore;
-+  struct grub_script_mem *mem = state->memused;
-+  state->memused = restore;
-   return mem;
- }
-@@ -108,13 +106,13 @@
- /* Extend the argument arg with a variable or string of text.  If ARG
-    is zero a new list is created.  */
- struct grub_script_arg *
--grub_script_arg_add (struct grub_script_arg *arg,
-+grub_script_arg_add (struct grub_parser_param *state, struct grub_script_arg *arg,
-                    grub_script_arg_type_t type, char *str)
- {
-   struct grub_script_arg *argpart;
-   struct grub_script_arg *ll;
-   
--  argpart = (struct grub_script_arg *) grub_script_malloc (sizeof (*arg));
-+  argpart = (struct grub_script_arg *) grub_script_malloc (state, sizeof (*arg));
-   argpart->type = type;
-   argpart->str = str;
-   argpart->next = 0;
-@@ -131,14 +129,15 @@
- /* Add the argument ARG to the end of the argument list LIST.  If LIST
-    is zero, a new list will be created.  */
- struct grub_script_arglist *
--grub_script_add_arglist (struct grub_script_arglist *list, struct grub_script_arg *arg)
-+grub_script_add_arglist (struct grub_parser_param *state,
-+                       struct grub_script_arglist *list, struct grub_script_arg *arg)
- {
-   struct grub_script_arglist *link;
-   struct grub_script_arglist *ll;
-   grub_dprintf ("scripting", "arglist\n");
--  link = (struct grub_script_arglist *) grub_script_malloc (sizeof (*link));
-+  link = (struct grub_script_arglist *) grub_script_malloc (state, sizeof (*link));
-   link->next = 0;
-   link->arg = arg;
-   link->argcount = 0;
-@@ -162,15 +161,15 @@
-    contains the name of the command that should be executed.  ARGLIST
-    holds all arguments for this command.  */
- struct grub_script_cmd *
--grub_script_create_cmdline (char *cmdname, struct grub_script_arglist *arglist)
-+grub_script_create_cmdline (struct grub_parser_param *state,
-+                          char *cmdname, struct grub_script_arglist *arglist)
- {
-   struct grub_script_cmdline *cmd;
-   grub_dprintf ("scripting", "cmdline\n");
--  cmd = grub_script_malloc (sizeof (*cmd));
-+  cmd = grub_script_malloc (state, sizeof (*cmd));
-   cmd->cmd.exec = grub_script_execute_cmdline;
--/*   cmd->cmd.free = grub_script_free_cmdline; */
-   cmd->cmd.next = 0;
-   cmd->arglist = arglist;
-   cmd->cmdname = cmdname;
-@@ -179,24 +178,25 @@
- }
- /* Create a command that functions as an if statement.  If BOOL is
--   evaluated to true (the value is returned in envvar RESULT), the
-+   evaluated to true (the value is returned in envvar '?'), the
-    interpreter will run the command TRUE, otherwise the interpreter
-    runs the command FALSE.  */
- struct grub_script_cmd *
--grub_script_create_cmdif (struct grub_script_cmd *bool,
--                        struct grub_script_cmd *true,
--                        struct grub_script_cmd *false)
-+grub_script_create_cmdif (struct grub_parser_param *state,
-+                        struct grub_script_cmd *exec_to_evaluate,
-+                        struct grub_script_cmd *exec_on_true,
-+                        struct grub_script_cmd *exec_on_false)
- {
-   struct grub_script_cmdif *cmd;
-   grub_dprintf ("scripting", "cmdif\n");
--  cmd = grub_script_malloc (sizeof (*cmd));
-+  cmd = grub_script_malloc (state, sizeof (*cmd));
-   cmd->cmd.exec = grub_script_execute_cmdif;
-   cmd->cmd.next = 0;
--  cmd->bool = bool;
--  cmd->true = true;
--  cmd->false = false;
-+  cmd->exec_to_evaluate = exec_to_evaluate;
-+  cmd->exec_on_true = exec_on_true;
-+  cmd->exec_on_false = exec_on_false;
-   return (struct grub_script_cmd *) cmd;
- }
-@@ -206,7 +206,8 @@
-    the title.  The sourcecode for this entry is passed in SOURCECODE.
-    The options for this entry are passed in OPTIONS.  */
- struct grub_script_cmd *
--grub_script_create_cmdmenu (struct grub_script_arg *title,
-+grub_script_create_cmdmenu (struct grub_parser_param *state,
-+                          struct grub_script_arg *title,
-                           char *sourcecode,
-                           int options)
- {
-@@ -222,7 +223,7 @@
-       sourcecode[i] = '\0';
-     }
--  cmd = grub_script_malloc (sizeof (*cmd));
-+  cmd = grub_script_malloc (state, sizeof (*cmd));
-   cmd->cmd.exec = grub_script_execute_menuentry;
-   cmd->cmd.next = 0;
-   cmd->sourcecode = sourcecode;
-@@ -236,7 +237,9 @@
-    be added at the end of CMDBLOCK's list.  If CMDBLOCK is zero, a new
-    cmdblock will be created.  */
- struct grub_script_cmd *
--grub_script_add_cmd (struct grub_script_cmdblock *cmdblock, struct grub_script_cmd *cmd)
-+grub_script_add_cmd (struct grub_parser_param *state,
-+                   struct grub_script_cmdblock *cmdblock,
-+                   struct grub_script_cmd *cmd)
- {
-   grub_dprintf ("scripting", "cmdblock\n");
-@@ -245,20 +248,19 @@
-   if (! cmdblock)
-     {
--      cmdblock = (struct grub_script_cmdblock *) grub_script_malloc (sizeof (*cmdblock));
-+      cmdblock = (struct grub_script_cmdblock *) grub_script_malloc (state,
-+                                                                   sizeof (*cmdblock));
-       cmdblock->cmd.exec = grub_script_execute_cmdblock;
-       cmdblock->cmd.next = 0;
-       cmdblock->cmdlist = cmd;
-+      cmd->next = 0;
-     }
-   else
-     {
--      struct grub_script_cmd **last;
--      for (last = &cmdblock->cmdlist; *last; last = &(*last)->next);
--      *last = cmd;
-+      cmd->next = cmdblock->cmdlist;
-+      cmdblock->cmdlist = cmd;
-     }
--  cmd->next = 0;
--
-   return (struct grub_script_cmd *) cmdblock;
- }
-@@ -291,30 +293,51 @@
- {
-   struct grub_script *parsed;
-   struct grub_script_mem *membackup;
-+  struct grub_lexer_param *lexstate;
-+  struct grub_parser_param *parsestate;
-   parsed = grub_malloc (sizeof (*parsed));
-   if (! parsed)
-     return 0;
-+  parsestate = grub_malloc (sizeof (*parsestate));
-+  if (! parsestate)
-+    return 0;
-+
-+  parsestate->err = 0;
-+  parsestate->func_mem = 0;
-+  parsestate->memused = 0;
-+  parsestate->parsed = 0;
-+
-   /* Initialize the lexer.  */
--  grub_script_lexer_init (script, getline);
-+  lexstate = grub_script_lexer_init (script, getline);
-+  if (! lexstate)
-+    {
-+      grub_free (parsed);
-+      grub_free (parsestate);
-+      return 0;
-+    }
--  grub_script_parsed = 0;
-+  parsestate->lexerstate = lexstate;
--  membackup = grub_script_mem_record ();
-+  membackup = grub_script_mem_record (parsestate);
--  /* Parse the script, the result is stored in
--     `grub_script_parsed'.  */
--  if (grub_script_yyparse ())
-+  /* Parse the script.  */
-+  if (grub_script_yyparse (parsestate) || parsestate->err)
-     {
-       struct grub_script_mem *memfree;
--      memfree = grub_script_mem_record_stop (membackup);
-+      memfree = grub_script_mem_record_stop (parsestate, membackup);
-       grub_script_mem_free (memfree);
-+      grub_free (lexstate);
-+      grub_free (parsestate);
-       return 0;
-     }
--  parsed->mem = grub_script_mem_record_stop (membackup);
--  parsed->cmd = grub_script_parsed;
-+  parsed->mem = grub_script_mem_record_stop (parsestate, membackup);
-+  parsed->cmd = parsestate->parsed;
-+
-+  grub_free (lexstate);
-+  grub_free (parsestate);
-   return parsed;
- }
-Index: partmap/amiga.c
-===================================================================
-RCS file: /cvsroot/grub/grub2/partmap/amiga.c,v
-retrieving revision 1.4
-retrieving revision 1.5
-diff -u -r1.4 -r1.5
---- partmap/amiga.c    13 Nov 2005 15:47:09 -0000      1.4
-+++ partmap/amiga.c    4 Jun 2006 15:56:55 -0000       1.5
-@@ -1,7 +1,7 @@
- /* amiga.c - Read amiga partition tables (RDB).  */
- /*
-  *  GRUB  --  GRand Unified Bootloader
-- *  Copyright (C) 2002, 2004, 2005  Free Software Foundation, Inc.
-+ *  Copyright (C) 2002,2004,2005,2006  Free Software Foundation, Inc.
-  *
-  *  This program is free software; you can redistribute it and/or modify
-  *  it under the terms of the GNU General Public License as published by
-@@ -98,7 +98,7 @@
-                         sizeof (rdsk),  (char *) &rdsk))
-       return grub_errno;
-       
--      if (!grub_strcmp (rdsk.magic, "RDSK"))
-+      if (grub_strcmp ((char *) rdsk.magic, "RDSK") == 0)
-       {
-         /* Found the first PART block.  */
-         next = grub_be_to_cpu32 (rdsk.partitionlst);
-Index: partmap/gpt.c
-===================================================================
-RCS file: /cvsroot/grub/grub2/partmap/gpt.c,v
-retrieving revision 1.1
-retrieving revision 1.3
-diff -u -r1.1 -r1.3
---- partmap/gpt.c      3 Dec 2005 17:54:55 -0000       1.1
-+++ partmap/gpt.c      4 Jun 2006 15:56:55 -0000       1.3
-@@ -1,7 +1,7 @@
- /* gpt.c - Read GUID Partition Tables (GPT).  */
- /*
-  *  GRUB  --  GRand Unified Bootloader
-- *  Copyright (C) 2002, 2005  Free Software Foundation, Inc.
-+ *  Copyright (C) 2002,2005,2006  Free Software Foundation, Inc.
-  *
-  *  This program is free software; you can redistribute it and/or modify
-  *  it under the terms of the GNU General Public License as published by
-@@ -121,12 +121,12 @@
-         /* Calculate the first block and the size of the partition.  */
-         part.start = grub_le_to_cpu64 (entry.start);
-         part.len = (grub_le_to_cpu64 (entry.end)
--                    - grub_le_to_cpu64 (entry.start));
-+                    - grub_le_to_cpu64 (entry.start) + 1);
-         part.offset = entries;
-         part.index = partno;
-         part.partmap = &grub_gpt_partition_map;
--        grub_dprintf ("gpt", "GPT entry %d: start=%ld, length=%ld\n",
-+        grub_dprintf ("gpt", "GPT entry %d: start=%lld, length=%lld\n",
-                       partno, part.start, part.len);
-         if (hook (disk, &part))
-Index: partmap/pc.c
-===================================================================
-RCS file: /cvsroot/grub/grub2/partmap/pc.c,v
-retrieving revision 1.7
-retrieving revision 1.8
-diff -u -r1.7 -r1.8
---- partmap/pc.c       3 Dec 2005 17:54:55 -0000       1.7
-+++ partmap/pc.c       4 Jun 2006 15:56:55 -0000       1.8
-@@ -1,7 +1,7 @@
- /* pc.c - Read PC style partition tables.  */
- /*
-  *  GRUB  --  GRand Unified Bootloader
-- *  Copyright (C) 2002,2004,2005 Free Software Foundation, Inc.
-+ *  Copyright (C) 2002,2004,2005,2006 Free Software Foundation, Inc.
-  *
-  *  GRUB is free software; you can redistribute it and/or modify
-  *  it under the terms of the GNU General Public License as published by
-@@ -137,7 +137,7 @@
-         pcdata.bsd_type = -1;
-         grub_dprintf ("partition",
--                      "partition %d: flag 0x%x, type 0x%x, start 0x%lx, len 0x%lx\n",
-+                      "partition %d: flag 0x%x, type 0x%x, start 0x%llx, len 0x%llx\n",
-                       p.index, e->flag, pcdata.dos_type, p.start, p.len);
-         /* If this is a GPT partition, this MBR is just a dummy.  */
-Index: term/gfxterm.c
-===================================================================
-RCS file: term/gfxterm.c
-diff -N term/gfxterm.c
---- /dev/null  1 Jan 1970 00:00:00 -0000
-+++ term/gfxterm.c     20 Apr 2006 15:19:01 -0000      1.2
-@@ -0,0 +1,793 @@
-+/*
-+ *  GRUB  --  GRand Unified Bootloader
-+ *  Copyright (C) 2006  Free Software Foundation, Inc.
-+ *
-+ *  This program is free software; you can redistribute it and/or modify
-+ *  it under the terms of the GNU General Public License as published by
-+ *  the Free Software Foundation; either version 2 of the License, or
-+ *  (at your option) any later version.
-+ *
-+ *  This program is distributed in the hope that it will be useful,
-+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+ *  GNU General Public License for more details.
-+ *
-+ *  You should have received a copy of the GNU General Public License
-+ *  along with this program; if not, write to the Free Software
-+ *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-+ */
-+
-+#include <grub/machine/memory.h>
-+#include <grub/machine/console.h>
-+#include <grub/term.h>
-+#include <grub/types.h>
-+#include <grub/dl.h>
-+#include <grub/misc.h>
-+#include <grub/normal.h>
-+#include <grub/font.h>
-+#include <grub/arg.h>
-+#include <grub/mm.h>
-+#include <grub/env.h>
-+#include <grub/video.h>
-+
-+#define DEFAULT_VIDEO_WIDTH   640
-+#define DEFAULT_VIDEO_HEIGHT  480
-+#define DEFAULT_VIDEO_FLAGS   0
-+
-+#define DEFAULT_CHAR_WIDTH    8
-+#define DEFAULT_CHAR_HEIGHT   16
-+
-+#define DEFAULT_BORDER_WIDTH  10
-+
-+#define DEFAULT_FG_COLOR      0x0a
-+#define DEFAULT_BG_COLOR      0x00
-+#define DEFAULT_CURSOR_COLOR  0x0f
-+
-+struct grub_dirty_region
-+{
-+  int top_left_x;
-+  int top_left_y;
-+  int bottom_right_x;
-+  int bottom_right_y;
-+};
-+
-+struct grub_colored_char
-+{
-+  /* An Unicode codepoint.  */
-+  grub_uint32_t code;
-+
-+  /* Color values.  */
-+  grub_video_color_t fg_color;
-+  grub_video_color_t bg_color;
-+
-+  /* The width of this character minus one.  */
-+  unsigned char width;
-+
-+  /* The column index of this character.  */
-+  unsigned char index;
-+};
-+
-+struct grub_virtual_screen
-+{
-+  /* Dimensions of the virtual screen.  */
-+  unsigned int width;
-+  unsigned int height;
-+
-+  /* Offset in the display.  */
-+  unsigned int offset_x;
-+  unsigned int offset_y;
-+
-+  /* TTY Character sizes.  */
-+  unsigned int char_width;
-+  unsigned int char_height;
-+
-+  /* Virtual screen TTY size.  */
-+  unsigned int columns;
-+  unsigned int rows;
-+
-+  /* Current cursor details.  */
-+  unsigned int cursor_x;
-+  unsigned int cursor_y;
-+  int cursor_state;
-+  
-+  /* Color settings.  */
-+  grub_video_color_t fg_color_setting;
-+  grub_video_color_t bg_color_setting;
-+  grub_video_color_t fg_color;
-+  grub_video_color_t bg_color;
-+  grub_video_color_t cursor_color;
-+
-+  /* Text buffer for virtual screen.  Contains (columns * rows) number
-+     of entries.  */
-+  struct grub_colored_char *text_buffer;
-+};
-+
-+static struct grub_virtual_screen virtual_screen;
-+
-+static grub_dl_t my_mod;
-+static struct grub_video_mode_info mode_info;
-+
-+static struct grub_video_render_target *text_layer;
-+
-+static struct grub_dirty_region dirty_region;
-+
-+static void dirty_region_reset (void);
-+
-+static int dirty_region_is_empty (void);
-+
-+static void dirty_region_add (int x, int y, 
-+                              unsigned int width, unsigned int height);
-+
-+static void
-+grub_virtual_screen_free (void)
-+{
-+  /* If virtual screen has been allocated, free it.  */
-+  if (virtual_screen.text_buffer != 0)
-+    grub_free (virtual_screen.text_buffer);
-+
-+  /* Reset virtual screen data.  */
-+  grub_memset (&virtual_screen, 0, sizeof (virtual_screen));
-+  
-+  /* Free render targets.  */
-+  grub_video_delete_render_target (text_layer);
-+  text_layer = 0;
-+}
-+
-+static grub_err_t
-+grub_virtual_screen_setup (unsigned int x, unsigned int y,
-+                           unsigned int width, unsigned int height)
-+{
-+  /* Free old virtual screen.  */
-+  grub_virtual_screen_free ();
-+
-+  /* Initialize with default data.  */
-+  virtual_screen.width = width;
-+  virtual_screen.height = height;
-+  virtual_screen.offset_x = x;
-+  virtual_screen.offset_y = y;
-+  virtual_screen.char_width = DEFAULT_CHAR_WIDTH;
-+  virtual_screen.char_height = DEFAULT_CHAR_HEIGHT;
-+  virtual_screen.cursor_x = 0;
-+  virtual_screen.cursor_y = 0;
-+  virtual_screen.cursor_state = 1;
-+
-+  /* Calculate size of text buffer.  */
-+  virtual_screen.columns = virtual_screen.width / virtual_screen.char_width;
-+  virtual_screen.rows = virtual_screen.height / virtual_screen.char_height;
-+
-+  /* Allocate memory for text buffer.  */
-+  virtual_screen.text_buffer =
-+    (struct grub_colored_char *) grub_malloc (virtual_screen.columns
-+                                            * virtual_screen.rows
-+                                            * sizeof (*virtual_screen.text_buffer));
-+  if (grub_errno != GRUB_ERR_NONE)
-+    return grub_errno;
-+
-+  /* Create new render target for text layer.  */
-+  grub_video_create_render_target (&text_layer,
-+                                   virtual_screen.width,
-+                                   virtual_screen.height,
-+                                   GRUB_VIDEO_MODE_TYPE_RGB
-+                                   | GRUB_VIDEO_MODE_TYPE_ALPHA);
-+  if (grub_errno != GRUB_ERR_NONE)
-+    return grub_errno;
-+  
-+  /* As we want to have colors compatible with rendering target,
-+     we can only have those after mode is initialized.  */    
-+  grub_video_set_active_render_target (text_layer);
-+  
-+  virtual_screen.fg_color_setting = grub_video_map_color (DEFAULT_FG_COLOR);
-+  virtual_screen.bg_color_setting = grub_video_map_color (DEFAULT_BG_COLOR);
-+  virtual_screen.fg_color = virtual_screen.fg_color_setting;
-+  virtual_screen.bg_color = virtual_screen.bg_color_setting;
-+  virtual_screen.cursor_color = grub_video_map_color (DEFAULT_CURSOR_COLOR);
-+  
-+  grub_video_set_active_render_target (GRUB_VIDEO_RENDER_TARGET_DISPLAY);
-+  
-+  return grub_errno;
-+}
-+
-+static grub_err_t
-+grub_gfxterm_init (void)
-+{
-+  char *modevar;
-+  int width = DEFAULT_VIDEO_WIDTH;
-+  int height = DEFAULT_VIDEO_HEIGHT;
-+  int depth = -1;
-+  int flags = DEFAULT_VIDEO_FLAGS;
-+  grub_video_color_t color;
-+  
-+  /* Parse gfxmode environment variable if set.  */
-+  modevar = grub_env_get ("gfxmode");
-+  if (modevar)
-+    {
-+      char *tmp;
-+      char *param;
-+      char *value;
-+      
-+      /* Take copy of env.var. as we don't want to modify that.  */
-+      tmp = grub_strdup (modevar);
-+      modevar = tmp;
-+      
-+      if (grub_errno != GRUB_ERR_NONE)
-+        return grub_errno;        
-+      
-+      /* Skip whitespace.  */
-+      while (grub_isspace (*tmp))
-+        tmp++;
-+      
-+      /* Initialize token holders.  */
-+      param = tmp;
-+      value = NULL;
-+
-+      /* Parse <width>x<height>[x<depth>]*/
-+
-+      /* Find width value.  */
-+      value = param;
-+      param = grub_strchr(param, 'x');
-+      if (param == NULL)
-+        {
-+          /* Free memory before returning.  */
-+          grub_free (modevar);
-+          return grub_error (GRUB_ERR_BAD_ARGUMENT, 
-+                             "Invalid argument: %s\n",
-+                             param);
-+        }
-+      
-+      *param = 0;
-+      param++;
-+      
-+      width = grub_strtoul (value, 0, 0);
-+      if (grub_errno != GRUB_ERR_NONE)
-+        {
-+          /* Free memory before returning.  */
-+          grub_free (modevar);
-+          return grub_error (GRUB_ERR_BAD_ARGUMENT, 
-+                             "Invalid argument: %s\n",
-+                             param);
-+        }
-+
-+      /* Find height value.  */
-+      value = param;
-+      param = grub_strchr(param, 'x');
-+      if (param == NULL)
-+        {
-+          height = grub_strtoul (value, 0, 0);
-+          if (grub_errno != GRUB_ERR_NONE)
-+            {
-+              /* Free memory before returning.  */
-+              grub_free (modevar);
-+              return grub_error (GRUB_ERR_BAD_ARGUMENT, 
-+                                 "Invalid argument: %s\n",
-+                                 param);
-+            }
-+        }
-+      else
-+        {
-+          /* We have optional color depth value.  */
-+          *param = 0;
-+          param++;
-+          
-+          height = grub_strtoul (value, 0, 0);
-+          if (grub_errno != GRUB_ERR_NONE)
-+            {
-+              /* Free memory before returning.  */
-+              grub_free (modevar);
-+              return grub_error (GRUB_ERR_BAD_ARGUMENT, 
-+                                 "Invalid argument: %s\n",
-+                                 param);
-+            }
-+          
-+          /* Convert color depth value.  */
-+          value = param;
-+          depth = grub_strtoul (value, 0, 0);
-+          if (grub_errno != GRUB_ERR_NONE)
-+            {
-+              /* Free memory before returning.  */
-+              grub_free (modevar);
-+              return grub_error (GRUB_ERR_BAD_ARGUMENT, 
-+                                 "Invalid argument: %s\n",
-+                                 param);
-+            }
-+        }
-+      
-+      /* Free memory.  */
-+      grub_free (modevar);
-+    }
-+
-+  /* If we have 8 or less bits, then assuem that it is indexed color mode.  */
-+  if ((depth <= 8) && (depth != -1))
-+    flags |= GRUB_VIDEO_MODE_TYPE_INDEX_COLOR;
-+
-+  /* We have more than 8 bits, then assume that it is RGB color mode.  */
-+  if (depth > 8)
-+    flags |= GRUB_VIDEO_MODE_TYPE_RGB;
-+
-+  /* If user requested specific depth, forward that information to driver.  */
-+  if (depth != -1)
-+    flags |= (depth << GRUB_VIDEO_MODE_TYPE_DEPTH_POS)
-+             & GRUB_VIDEO_MODE_TYPE_DEPTH_MASK;
-+
-+  /* Initialize user requested mode.  */
-+  if (grub_video_setup (width, height, flags) != GRUB_ERR_NONE)
-+    return grub_errno;
-+
-+  /* Figure out what mode we ended up.  */
-+  if (grub_video_get_info (&mode_info) != GRUB_ERR_NONE)
-+    return grub_errno;
-+
-+  /* Make sure screen is black.  */
-+  color = grub_video_map_rgb (0, 0, 0);
-+  grub_video_fill_rect (color, 0, 0, mode_info.width, mode_info.height);
-+
-+  /* Leave borders for virtual screen.  */
-+  width = mode_info.width - (2 * DEFAULT_BORDER_WIDTH);
-+  height = mode_info.height - (2 * DEFAULT_BORDER_WIDTH);
-+  
-+  /* Create virtual screen.  */
-+  if (grub_virtual_screen_setup (DEFAULT_BORDER_WIDTH, DEFAULT_BORDER_WIDTH,
-+                                 width, height) != GRUB_ERR_NONE)
-+    {
-+      grub_video_restore ();
-+      return grub_errno;
-+    }
-+
-+  /* Mark whole screen as dirty.  */
-+  dirty_region_reset ();  
-+  dirty_region_add (0, 0, mode_info.width, mode_info.height);
-+
-+  return (grub_errno = GRUB_ERR_NONE);
-+}
-+
-+static grub_err_t
-+grub_gfxterm_fini (void)
-+{
-+  grub_virtual_screen_free ();
-+
-+  grub_video_restore ();
-+
-+  return GRUB_ERR_NONE;
-+}
-+
-+static void
-+redraw_screen_rect (unsigned int x, unsigned int y, 
-+                    unsigned int width, unsigned int height)
-+{
-+  grub_video_color_t color;
-+  
-+  grub_video_set_active_render_target (GRUB_VIDEO_RENDER_TARGET_DISPLAY);
-+
-+  /* Render background layer.  */
-+  color = virtual_screen.bg_color;
-+  grub_video_fill_rect (color, x, y, width, height);
-+  
-+  /* Render text layer.  */
-+  grub_video_blit_render_target (text_layer, x, y,
-+                                 x - virtual_screen.offset_x,
-+                                 y - virtual_screen.offset_y,
-+                                 width, height);
-+}
-+
-+static void
-+dirty_region_reset (void)
-+{
-+  dirty_region.top_left_x = -1;
-+  dirty_region.top_left_y = -1;
-+  dirty_region.bottom_right_x = -1;
-+  dirty_region.bottom_right_y = -1;
-+}
-+
-+static int
-+dirty_region_is_empty (void)
-+{
-+  if ((dirty_region.top_left_x == -1)
-+      || (dirty_region.top_left_y == -1)
-+      || (dirty_region.bottom_right_x == -1)
-+      || (dirty_region.bottom_right_y == -1))
-+    return 1;
-+  return 0;
-+}
-+
-+static void
-+dirty_region_add (int x, int y, unsigned int width, unsigned int height)
-+{
-+  if ((width == 0) || (height == 0))
-+    return;
-+    
-+  if (dirty_region_is_empty ())
-+    {
-+      dirty_region.top_left_x = x;
-+      dirty_region.top_left_y = y;
-+      dirty_region.bottom_right_x = x + width - 1;
-+      dirty_region.bottom_right_y = y + height - 1;
-+    } 
-+  else
-+    {
-+      if (x < dirty_region.top_left_x)
-+        dirty_region.top_left_x = x;
-+      if (y < dirty_region.top_left_y)
-+        dirty_region.top_left_y = y;
-+      if ((x + (int)width - 1) > dirty_region.bottom_right_x)
-+        dirty_region.bottom_right_x = x + width - 1;
-+      if ((y + (int)height - 1) > dirty_region.bottom_right_y)
-+        dirty_region.bottom_right_y = y + height - 1;
-+    }
-+} 
-+
-+static void
-+dirty_region_add_virtualscreen (void)
-+{
-+  /* Mark virtual screen as dirty.  */
-+  dirty_region_add (virtual_screen.offset_x, virtual_screen.offset_y,
-+                    virtual_screen.width, virtual_screen.height);
-+}
-+
-+
-+static void
-+dirty_region_redraw (void)
-+{
-+  int x;
-+  int y;
-+  int width;
-+  int height;
-+  
-+  if (dirty_region_is_empty ())
-+    return;
-+  
-+  x = dirty_region.top_left_x;
-+  y = dirty_region.top_left_y;
-+  
-+  width = dirty_region.bottom_right_x - x + 1;
-+  height = dirty_region.bottom_right_y - y + 1;
-+  
-+  redraw_screen_rect (x, y, width, height);
-+  
-+  dirty_region_reset ();
-+}
-+
-+static void
-+write_char (void)
-+{
-+  struct grub_colored_char *p;
-+  struct grub_font_glyph glyph;
-+  grub_video_color_t color;
-+  grub_video_color_t bgcolor;    
-+  unsigned int x;
-+  unsigned int y;
-+
-+  /* Find out active character.  */
-+  p = (virtual_screen.text_buffer
-+       + virtual_screen.cursor_x
-+       + (virtual_screen.cursor_y * virtual_screen.columns));
-+
-+  p -= p->index;
-+
-+  /* Get glyph for character.  */
-+  grub_font_get_glyph (p->code, &glyph);
-+
-+  color = p->fg_color;
-+  bgcolor = p->bg_color;
-+
-+  x = virtual_screen.cursor_x * virtual_screen.char_width;
-+  y = virtual_screen.cursor_y * virtual_screen.char_height;
-+
-+  /* Render glyph to text layer.  */
-+  grub_video_set_active_render_target (text_layer);
-+  grub_video_fill_rect (bgcolor, x, y, glyph.width, glyph.height);
-+  grub_video_blit_glyph (&glyph, color, x, y);  
-+  grub_video_set_active_render_target (GRUB_VIDEO_RENDER_TARGET_DISPLAY);
-+
-+  /* Mark character to be drawn.  */
-+  dirty_region_add (virtual_screen.offset_x + x, virtual_screen.offset_y + y,
-+                    glyph.width, glyph.height);
-+}
-+
-+static void
-+write_cursor (void)
-+{
-+  unsigned int x;
-+  unsigned int y;
-+  unsigned int width;
-+  unsigned int height;
-+  grub_video_color_t color;
-+
-+  /* Determine cursor properties and position on text layer. */
-+  x = virtual_screen.cursor_x * virtual_screen.char_width;
-+  y = ((virtual_screen.cursor_y + 1) * virtual_screen.char_height) - 3;  
-+  width = virtual_screen.char_width;
-+  height = 2;
-+
-+  color = virtual_screen.cursor_color;
-+
-+  /* Render cursor to text layer.  */
-+  grub_video_set_active_render_target (text_layer);
-+  grub_video_fill_rect (color, x, y, width, height);
-+  grub_video_set_active_render_target (GRUB_VIDEO_RENDER_TARGET_DISPLAY);
-+
-+  /* Mark cursor to be redrawn.  */
-+  dirty_region_add (virtual_screen.offset_x + x, virtual_screen.offset_y + y,
-+                    width, height);
-+}
-+
-+static void
-+scroll_up (void)
-+{
-+  unsigned int i;
-+  grub_video_color_t color;
-+
-+  /* Scroll text buffer with one line to up.  */
-+  grub_memmove (virtual_screen.text_buffer,
-+              virtual_screen.text_buffer + virtual_screen.columns,
-+                sizeof (*virtual_screen.text_buffer)
-+                * virtual_screen.columns
-+                * (virtual_screen.rows - 1));
-+
-+  /* Clear last line in text buffer.  */
-+  for (i = virtual_screen.columns * (virtual_screen.rows - 1);
-+       i < virtual_screen.columns * virtual_screen.rows;
-+       i++)
-+    {
-+      virtual_screen.text_buffer[i].code = ' ';
-+      virtual_screen.text_buffer[i].fg_color = virtual_screen.fg_color;
-+      virtual_screen.text_buffer[i].bg_color = virtual_screen.bg_color;
-+      virtual_screen.text_buffer[i].width = 0;
-+      virtual_screen.text_buffer[i].index = 0;
-+    }
-+    
-+  /* Scroll physical screen.  */
-+  grub_video_set_active_render_target (text_layer);
-+  color = virtual_screen.bg_color;
-+  grub_video_scroll (color, 0, -virtual_screen.char_height);
-+  grub_video_set_active_render_target (GRUB_VIDEO_RENDER_TARGET_DISPLAY);
-+  
-+  /* Mark virtual screen to be redrawn.  */
-+  dirty_region_add_virtualscreen ();
-+}
-+
-+static void
-+grub_gfxterm_putchar (grub_uint32_t c)
-+{
-+  if (c == '\a')
-+    /* FIXME */
-+    return;
-+
-+  if (c == '\b' || c == '\n' || c == '\r')
-+    {
-+      /* Erase current cursor, if any.  */
-+      if (virtual_screen.cursor_state)
-+      write_char ();
-+
-+      switch (c)
-+      {
-+      case '\b':
-+        if (virtual_screen.cursor_x > 0)
-+          virtual_screen.cursor_x--;
-+        break;
-+        
-+      case '\n':
-+        if (virtual_screen.cursor_y >= virtual_screen.rows - 1)
-+          scroll_up ();
-+        else
-+          virtual_screen.cursor_y++;
-+        break;
-+        
-+      case '\r':
-+        virtual_screen.cursor_x = 0;
-+        break;
-+      }
-+
-+      /* Redraw cursor if visible.  */
-+      if (virtual_screen.cursor_state)
-+      write_cursor ();
-+    }
-+  else
-+    {
-+      struct grub_font_glyph glyph;
-+      struct grub_colored_char *p;
-+  
-+      /* Get properties of the character.  */    
-+      grub_font_get_glyph (c, &glyph);
-+
-+      /* If we are about to exceed line length, wrap to next line.  */
-+      if (virtual_screen.cursor_x + glyph.char_width > virtual_screen.columns)
-+      grub_putchar ('\n');
-+
-+      /* Find position on virtual screen, and fill information.  */
-+      p = (virtual_screen.text_buffer +
-+         virtual_screen.cursor_x +
-+         virtual_screen.cursor_y * virtual_screen.columns);
-+      p->code = c;
-+      p->fg_color = virtual_screen.fg_color;
-+      p->bg_color = virtual_screen.bg_color;
-+      p->width = glyph.char_width - 1;
-+      p->index = 0;
-+
-+      /* If we have large glyph, add fixup info.  */
-+      if (glyph.char_width > 1)
-+      {
-+        unsigned i;
-+
-+        for (i = 1; i < glyph.char_width; i++)
-+          {
-+            p[i].code = ' ';
-+            p[i].width = glyph.char_width - 1;
-+            p[i].index = i;
-+          }
-+      }
-+        
-+      /* Draw glyph.  */
-+      write_char ();
-+  
-+      /* Make sure we scroll screen when needed and wrap line correctly.  */
-+      virtual_screen.cursor_x += glyph.char_width;
-+      if (virtual_screen.cursor_x >= virtual_screen.columns)
-+      {
-+        virtual_screen.cursor_x = 0;
-+        
-+        if (virtual_screen.cursor_y >= virtual_screen.rows - 1)
-+          scroll_up ();
-+        else
-+          virtual_screen.cursor_y++;
-+      }
-+
-+      /* Draw cursor if visible.  */
-+      if (virtual_screen.cursor_state)
-+      write_cursor ();
-+    }
-+}
-+
-+static grub_ssize_t
-+grub_gfxterm_getcharwidth (grub_uint32_t c)
-+{
-+  struct grub_font_glyph glyph;
-+  
-+  grub_font_get_glyph (c, &glyph);
-+
-+  return glyph.char_width;
-+}
-+
-+static grub_uint16_t
-+grub_virtual_screen_getwh (void)
-+{
-+  return (virtual_screen.columns << 8) | virtual_screen.rows;
-+}
-+
-+static grub_uint16_t
-+grub_virtual_screen_getxy (void)
-+{
-+  return ((virtual_screen.cursor_x << 8) | virtual_screen.cursor_y);
-+}
-+
-+static void
-+grub_gfxterm_gotoxy (grub_uint8_t x, grub_uint8_t y)
-+{
-+  if (x >= virtual_screen.columns)
-+    x = virtual_screen.columns - 1;
-+  
-+  if (y >= virtual_screen.rows)
-+    y = virtual_screen.rows - 1;
-+
-+  if (virtual_screen.cursor_state)
-+    write_char ();
-+
-+  virtual_screen.cursor_x = x;
-+  virtual_screen.cursor_y = y;
-+
-+  if (virtual_screen.cursor_state)
-+    write_cursor ();
-+}
-+
-+static void
-+grub_virtual_screen_cls (void)
-+{
-+  grub_uint32_t i;
-+
-+  for (i = 0; i < virtual_screen.columns * virtual_screen.rows; i++)
-+    {
-+      virtual_screen.text_buffer[i].code = ' ';
-+      virtual_screen.text_buffer[i].fg_color = virtual_screen.fg_color;
-+      virtual_screen.text_buffer[i].bg_color = virtual_screen.bg_color;
-+      virtual_screen.text_buffer[i].width = 0;
-+      virtual_screen.text_buffer[i].index = 0;
-+    }
-+
-+  virtual_screen.cursor_x = virtual_screen.cursor_y = 0;
-+}
-+
-+static void
-+grub_gfxterm_cls (void)
-+{
-+  grub_video_color_t color;
-+
-+  /* Clear virtual screen.  */
-+  grub_virtual_screen_cls ();
-+  
-+  /* Clear text layer.  */
-+  grub_video_set_active_render_target (text_layer);
-+  color = virtual_screen.bg_color_setting;
-+  grub_video_fill_rect (color, 0, 0, mode_info.width, mode_info.height);
-+  grub_video_set_active_render_target (GRUB_VIDEO_RENDER_TARGET_DISPLAY);
-+  
-+  /* Mark virtual screen to be redrawn.  */
-+  dirty_region_add_virtualscreen ();
-+}
-+
-+static void
-+grub_virtual_screen_setcolorstate (grub_term_color_state state)
-+{
-+  switch (state)
-+    {
-+    case GRUB_TERM_COLOR_STANDARD:
-+    case GRUB_TERM_COLOR_NORMAL:
-+      virtual_screen.fg_color = virtual_screen.fg_color_setting;
-+      virtual_screen.bg_color = virtual_screen.bg_color_setting;
-+      break;
-+    case GRUB_TERM_COLOR_HIGHLIGHT:
-+      virtual_screen.fg_color = virtual_screen.bg_color_setting;
-+      virtual_screen.bg_color = virtual_screen.fg_color_setting;
-+      break;
-+    default:
-+      break;
-+    }
-+}
-+
-+static void
-+grub_virtual_screen_setcolor (grub_uint8_t normal_color,
-+                              grub_uint8_t highlight_color)
-+{
-+  virtual_screen.fg_color_setting = grub_video_map_color (normal_color);
-+  virtual_screen.bg_color_setting = grub_video_map_color (highlight_color);
-+}
-+
-+static void
-+grub_gfxterm_setcursor (int on)
-+{
-+  if (virtual_screen.cursor_state != on)
-+    {
-+      if (virtual_screen.cursor_state)
-+      write_char ();
-+      else
-+      write_cursor ();
-+
-+      virtual_screen.cursor_state = on;
-+    }
-+}
-+
-+static void
-+grub_gfxterm_refresh (void)
-+{
-+  /* Redraw only changed regions.  */
-+  dirty_region_redraw ();
-+}
-+
-+static struct grub_term grub_video_term =
-+  {
-+    .name = "gfxterm",
-+    .init = grub_gfxterm_init,
-+    .fini = grub_gfxterm_fini,
-+    .putchar = grub_gfxterm_putchar,
-+    .getcharwidth = grub_gfxterm_getcharwidth,
-+    .checkkey = grub_console_checkkey,
-+    .getkey = grub_console_getkey,
-+    .getwh = grub_virtual_screen_getwh,
-+    .getxy = grub_virtual_screen_getxy,
-+    .gotoxy = grub_gfxterm_gotoxy,
-+    .cls = grub_gfxterm_cls,
-+    .setcolorstate = grub_virtual_screen_setcolorstate,
-+    .setcolor = grub_virtual_screen_setcolor,
-+    .setcursor = grub_gfxterm_setcursor,
-+    .refresh = grub_gfxterm_refresh,    
-+    .flags = 0,
-+    .next = 0
-+  };
-+
-+GRUB_MOD_INIT(term_gfxterm)
-+{
-+  my_mod = mod;
-+  grub_term_register (&grub_video_term);
-+}
-+
-+GRUB_MOD_FINI(term_gfxterm)
-+{
-+  grub_term_unregister (&grub_video_term);
-+}
-Index: term/efi/console.c
-===================================================================
-RCS file: term/efi/console.c
-diff -N term/efi/console.c
---- /dev/null  1 Jan 1970 00:00:00 -0000
-+++ term/efi/console.c 27 May 2006 21:09:25 -0000      1.3
-@@ -0,0 +1,311 @@
-+/*
-+ *  GRUB  --  GRand Unified Bootloader
-+ *  Copyright (C) 2006  Free Software Foundation, Inc.
-+ *
-+ *  This program is free software; you can redistribute it and/or modify
-+ *  it under the terms of the GNU General Public License as published by
-+ *  the Free Software Foundation; either version 2 of the License, or
-+ *  (at your option) any later version.
-+ *
-+ *  This program is distributed in the hope that it will be useful,
-+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+ *  GNU General Public License for more details.
-+ *
-+ *  You should have received a copy of the GNU General Public License
-+ *  along with this program; if not, write to the Free Software
-+ *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-+ */
-+
-+#include <grub/term.h>
-+#include <grub/misc.h>
-+#include <grub/types.h>
-+#include <grub/err.h>
-+#include <grub/efi/efi.h>
-+#include <grub/efi/api.h>
-+#include <grub/efi/console.h>
-+
-+static grub_uint8_t
-+grub_console_standard_color = GRUB_EFI_TEXT_ATTR (GRUB_EFI_YELLOW,
-+                                                GRUB_EFI_BACKGROUND_BLACK);
-+static grub_uint8_t
-+grub_console_normal_color = GRUB_EFI_TEXT_ATTR (GRUB_EFI_LIGHTGRAY,
-+                                              GRUB_EFI_BACKGROUND_BLACK);
-+static grub_uint8_t
-+grub_console_highlight_color = GRUB_EFI_TEXT_ATTR (GRUB_EFI_BLACK,
-+                                                 GRUB_EFI_BACKGROUND_LIGHTGRAY);
-+
-+static int read_key = -1;
-+
-+static void
-+grub_console_putchar (grub_uint32_t c)
-+{
-+  grub_efi_char16_t str[2];
-+  grub_efi_simple_text_output_interface_t *o;
-+  
-+  o = grub_efi_system_table->con_out;
-+  
-+  /* For now, do not try to use a surrogate pair.  */
-+  if (c > 0xffff)
-+    c = '?';
-+
-+  str[0] = (grub_efi_char16_t)  (c & 0xffff);
-+  str[1] = 0;
-+
-+  /* Should this test be cached?  */
-+  if (c > 0x7f && o->test_string (o, str) != GRUB_EFI_SUCCESS)
-+    return;
-+  
-+  o->output_string (o, str);
-+}
-+
-+static grub_ssize_t
-+grub_console_getcharwidth (grub_uint32_t c __attribute__ ((unused)))
-+{
-+  /* For now, every printable character has the width 1.  */
-+  return 1;
-+}
-+
-+static int
-+grub_console_checkkey (void)
-+{
-+  grub_efi_simple_input_interface_t *i;
-+  grub_efi_input_key_t key;
-+  grub_efi_status_t status;
-+  
-+  if (read_key >= 0)
-+    return 1;
-+
-+  i = grub_efi_system_table->con_in;
-+  status = i->read_key_stroke (i, &key);
-+#if 1
-+  switch (status)
-+    {
-+    case GRUB_EFI_SUCCESS:
-+      {
-+      grub_uint16_t xy;
-+      
-+      xy = grub_getxy ();
-+      grub_gotoxy (0, 0);
-+      grub_printf ("scan_code=%x,unicode_char=%x  ",
-+                   (unsigned) key.scan_code,
-+                   (unsigned) key.unicode_char);
-+      grub_gotoxy (xy >> 8, xy & 0xff);
-+      }
-+      break;
-+
-+    case GRUB_EFI_NOT_READY:
-+      //grub_printf ("not ready   ");
-+      break;
-+
-+    default:
-+      //grub_printf ("device error   ");
-+      break;
-+    }
-+#endif
-+  
-+  if (status == GRUB_EFI_SUCCESS)
-+    {
-+      switch (key.scan_code)
-+      {
-+      case 0x00:
-+        read_key = key.unicode_char;
-+        break;
-+      case 0x01:
-+        read_key = 16;
-+        break;
-+      case 0x02:
-+        read_key = 14;
-+        break;
-+      case 0x03:
-+        read_key = 6;
-+        break;
-+      case 0x04:
-+        read_key = 2;
-+        break;
-+      case 0x05:
-+        read_key = 1;
-+        break;
-+      case 0x06:
-+        read_key = 5;
-+        break;
-+      case 0x07:
-+        break;
-+      case 0x08:
-+        read_key = 4;
-+        break;
-+      case 0x09:
-+        break;
-+      case 0x0a:
-+        break;
-+      case 0x17:
-+        read_key = '\e';
-+        break;
-+      default:
-+        break;
-+      }
-+    }
-+
-+  return read_key;
-+}
-+
-+static int
-+grub_console_getkey (void)
-+{
-+  grub_efi_simple_input_interface_t *i;
-+  grub_efi_boot_services_t *b;
-+  grub_efi_uintn_t index;
-+  grub_efi_status_t status;
-+  int key;
-+
-+  if (read_key >= 0)
-+    {
-+      key = read_key;
-+      read_key = -1;
-+      return key;
-+    }
-+
-+  i = grub_efi_system_table->con_in;
-+  b = grub_efi_system_table->boot_services;
-+
-+  do
-+    {
-+      status = b->wait_for_event (1, &(i->wait_for_key), &index);
-+      if (status != GRUB_EFI_SUCCESS)
-+              return -1;
-+      
-+      grub_console_checkkey ();
-+    }
-+  while (read_key < 0);
-+  
-+  key = read_key;
-+  read_key = -1;
-+  return key;
-+}
-+
-+static grub_uint16_t
-+grub_console_getwh (void)
-+{
-+  grub_efi_simple_text_output_interface_t *o;
-+  grub_efi_uintn_t columns, rows;
-+  
-+  o = grub_efi_system_table->con_out;
-+  if (o->query_mode (o, o->mode->mode, &columns, &rows) != GRUB_EFI_SUCCESS)
-+    {
-+      /* Why does this fail?  */
-+      columns = 80;
-+      rows = 25;
-+    }
-+
-+  return ((columns << 8) | rows);
-+}
-+
-+static grub_uint16_t
-+grub_console_getxy (void)
-+{
-+  grub_efi_simple_text_output_interface_t *o;
-+  
-+  o = grub_efi_system_table->con_out;
-+  return ((o->mode->cursor_column << 8) | o->mode->cursor_row);
-+}
-+
-+static void
-+grub_console_gotoxy (grub_uint8_t x, grub_uint8_t y)
-+{
-+  grub_efi_simple_text_output_interface_t *o;
-+  
-+  o = grub_efi_system_table->con_out;
-+  o->set_cursor_position (o, x, y);
-+}
-+
-+static void
-+grub_console_cls (void)
-+{
-+  grub_efi_simple_text_output_interface_t *o;
-+  grub_efi_int32_t orig_attr;
-+  
-+  o = grub_efi_system_table->con_out;
-+  orig_attr = o->mode->attribute;
-+  o->set_attributes (o, GRUB_EFI_BACKGROUND_BLACK);
-+  o->clear_screen (o);
-+  o->set_attributes (o, orig_attr);
-+}
-+
-+static void
-+grub_console_setcolorstate (grub_term_color_state state)
-+{
-+  grub_efi_simple_text_output_interface_t *o;
-+
-+  o = grub_efi_system_table->con_out;
-+
-+  switch (state) {
-+    case GRUB_TERM_COLOR_STANDARD:
-+      o->set_attributes (o, grub_console_standard_color);
-+      break;
-+    case GRUB_TERM_COLOR_NORMAL:
-+      o->set_attributes (o, grub_console_normal_color);
-+      break;
-+    case GRUB_TERM_COLOR_HIGHLIGHT:
-+      o->set_attributes (o, grub_console_highlight_color);
-+      break;
-+    default:
-+      break;
-+  }
-+}
-+
-+static void
-+grub_console_setcolor (grub_uint8_t normal_color, grub_uint8_t highlight_color)
-+{
-+  grub_console_normal_color = normal_color;
-+  grub_console_highlight_color = highlight_color;
-+}
-+
-+static void
-+grub_console_setcursor (int on)
-+{
-+  grub_efi_simple_text_output_interface_t *o;
-+
-+  o = grub_efi_system_table->con_out;
-+  o->enable_cursor (o, on);
-+}
-+
-+static struct grub_term grub_console_term =
-+  {
-+    .name = "console",
-+    .init = 0,
-+    .fini = 0,
-+    .putchar = grub_console_putchar,
-+    .getcharwidth = grub_console_getcharwidth,
-+    .checkkey = grub_console_checkkey,
-+    .getkey = grub_console_getkey,
-+    .getwh = grub_console_getwh,
-+    .getxy = grub_console_getxy,
-+    .gotoxy = grub_console_gotoxy,
-+    .cls = grub_console_cls,
-+    .setcolorstate = grub_console_setcolorstate,
-+    .setcolor = grub_console_setcolor,
-+    .setcursor = grub_console_setcursor,
-+    .flags = 0,
-+    .next = 0
-+  };
-+
-+void
-+grub_console_init (void)
-+{
-+  /* FIXME: it is necessary to consider the case where no console control
-+     is present but the default is already in text mode.  */
-+  if (! grub_efi_set_text_mode (1))
-+    {
-+      grub_error (GRUB_ERR_BAD_DEVICE, "cannot set text mode");
-+      return;
-+    }
-+
-+  grub_term_register (&grub_console_term);
-+  grub_term_set_current (&grub_console_term);
-+}
-+
-+void
-+grub_console_fini (void)
-+{
-+  grub_term_unregister (&grub_console_term);
-+}
-Index: util/genmoddep.c
-===================================================================
-RCS file: util/genmoddep.c
-diff -N util/genmoddep.c
---- util/genmoddep.c   4 Apr 2004 13:46:03 -0000       1.3
-+++ /dev/null  1 Jan 1970 00:00:00 -0000
-@@ -1,279 +0,0 @@
--/*
-- *  GRUB  --  GRand Unified Bootloader
-- *  Copyright (C) 2002  Free Software Foundation, Inc.
-- *
-- *  This program is free software; you can redistribute it and/or modify
-- *  it under the terms of the GNU General Public License as published by
-- *  the Free Software Foundation; either version 2 of the License, or
-- *  (at your option) any later version.
-- *
-- *  This program is distributed in the hope that it will be useful,
-- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
-- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-- *  GNU General Public License for more details.
-- *
-- *  You should have received a copy of the GNU General Public License
-- *  along with this program; if not, write to the Free Software
-- *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-- */
--
--#include <stdio.h>
--#include <string.h>
--#include <stdlib.h>
--#include <stdarg.h>
--
--#define BUF_SIZE      1024
--#define SYMTAB_SIZE   509
--
--struct symbol
--{
--  const char *name;
--  const char *mod;
--  struct symbol *next;
--};
--
--struct module
--{
--  const char *name;
--  struct module *next;
--};
--
--static char buf[BUF_SIZE];
--static struct symbol *symtab[SYMTAB_SIZE];
--
--static void
--err (const char *fmt, ...)
--{
--  va_list ap;
--
--  fprintf (stderr, "genmoddep: error: ");
--  
--  va_start (ap, fmt);
--  vfprintf (stderr, fmt, ap);
--  va_end (ap);
--
--  fputc ('\n', stderr);
--  exit (1);
--}
--
--static void *
--xmalloc (size_t size)
--{
--  void *p;
--
--  p = malloc (size);
--  if (! p)
--    err ("out of memory");
--
--  return p;
--}
--
--static char *
--xstrdup (const char *str)
--{
--  char *s;
--  size_t len;
--
--  len = strlen (str);
--  s = (char *) xmalloc (len + 1);
--  memcpy (s, str, len + 1);
--
--  return s;
--}
--
--static void
--chomp (char *str)
--{
--  int end;
--  
--  end = strlen (str) - 1;
--  if (end < 0)
--    err ("empty string");
--
--  if (str[end] == '\n')
--    str[end] = '\0';
--}
--
--static unsigned
--symbol_hash (const char *s)
--{
--  unsigned key = 0;
--
--  while (*s)
--    key = key * 65599 + *s++;
--
--  return (key + (key >> 5)) % SYMTAB_SIZE;
--}
--
--static struct symbol *
--get_symbol (const char *name)
--{
--  unsigned k;
--  struct symbol *sym;
--  
--  k = symbol_hash (name);
--  for (sym = symtab[k]; sym; sym = sym->next)
--    if (strcmp (sym->name, name) == 0)
--      return sym;
--
--  return 0;
--}
--
--static void
--add_symbol (const char *name, const char *mod)
--{
--  unsigned k;
--  struct symbol *sym;
--
--  if (get_symbol (name))
--    err ("duplicated symbol: %s", name);
--  
--  sym = (struct symbol *) xmalloc (sizeof (*sym));
--  sym->name = xstrdup (name);
--  sym->mod = xstrdup (mod);
--
--  k = symbol_hash (name);
--  sym->next = symtab[k];
--  symtab[k] = sym;
--}
--
--static void
--free_symbols (void)
--{
--  int i;
--
--  for (i = 0; i < SYMTAB_SIZE; i++)
--    {
--      struct symbol *p, *q;
--
--      p = symtab[i];
--      while (p)
--      {
--        q = p->next;
--        free ((void *) p->name);
--        free ((void *) p->mod);
--        free (p);
--        p = q;
--      }
--    }
--}
--
--static void
--read_defined_symbols (FILE *fp)
--{
--  while (fgets (buf, sizeof (buf), fp))
--    {
--      char *p;
--
--      if (! *buf)
--      err ("empty symbol name: %s", buf);
--      
--      p = strchr (buf, ' ');
--      if (! p)
--      err ("invalid line format: %s", buf);
--
--      p++;
--      
--      if (! *p)
--      err ("empty module name: %s", buf);
--
--      *(p - 1) = '\0';
--      chomp (p);
--      
--      add_symbol (buf, p);
--    }
--}
--
--static void
--add_module (struct module **head, const char *name)
--{
--  struct module *mod;
--
--  for (mod = *head; mod; mod = mod->next)
--    if (strcmp (mod->name, name) == 0)
--      return;
--
--  mod = (struct module *) xmalloc (sizeof (*mod));
--  mod->name = xstrdup (name);
--
--  mod->next = *head;
--  *head = mod;
--}
--
--static void
--free_modules (struct module *head)
--{
--  struct module *next;
--
--  while (head)
--    {
--      next = head->next;
--      free ((void *) head->name);
--      free (head);
--      head = next;
--    }
--}
--
--static void
--find_dependencies (FILE *fp)
--{
--  char *mod_name;
--  struct module *mod_list = 0;
--  struct module *mod;
--  
--  if (! fgets (buf, sizeof (buf), fp) || buf[0] == '\n' || buf[0] == '\0')
--    err ("no module name");
--
--  chomp (buf);
--  mod_name = xstrdup (buf);
--
--  while (fgets (buf, sizeof (buf), fp))
--    {
--      struct symbol *sym;
--      
--      chomp (buf);
--      sym = get_symbol (buf);
--      if (! sym)
--      err ("%s in %s is not defined", buf, mod_name);
--
--      add_module (&mod_list, sym->mod);
--    }
--
--  printf ("%s:", mod_name);
--  
--  for (mod = mod_list; mod; mod = mod->next)
--    if (strcmp (mod->name, "kernel") != 0)
--      printf (" %s", mod->name);
--  
--  putchar ('\n');
--
--  free_modules (mod_list);
--}
--
--int
--main (int argc, char *argv[])
--{
--  int i;
--  
--  /* First, get defined symbols.  */
--  read_defined_symbols (stdin);
--
--  /* Second, find the dependecies.  */
--  for (i = 1; i < argc; i++)
--    {
--      FILE *fp;
--
--      fp = fopen (argv[i], "r");
--      if (! fp)
--      err ("cannot open %s", argv[i]);
--
--      find_dependencies (fp);
--
--      fclose (fp);
--    }
--
--  /* Last, free memory.  */
--  free_symbols ();
--  
--  return 0;
--}
-Index: util/grub-emu.c
-===================================================================
-RCS file: /cvsroot/grub/grub2/util/grub-emu.c,v
-retrieving revision 1.28
-retrieving revision 1.29
-diff -u -r1.28 -r1.29
---- util/grub-emu.c    13 Nov 2005 15:47:09 -0000      1.28
-+++ util/grub-emu.c    26 Apr 2006 21:58:36 -0000      1.29
-@@ -1,6 +1,6 @@
- /*
-  *  GRUB  --  GRand Unified Bootloader
-- *  Copyright (C) 2003, 2004, 2005  Free Software Foundation, Inc.
-+ *  Copyright (C) 2003,2004,2005,2006  Free Software Foundation, Inc.
-  *
-  *  GRUB is free software; you can redistribute it and/or modify
-  *  it under the terms of the GNU General Public License as published by
-@@ -53,6 +53,9 @@
- /* Used for going back to the main function.  */
- jmp_buf main_env;
-+/* Store the prefix specified by an argument.  */
-+static char *prefix = 0;
-+
- grub_addr_t
- grub_arch_modules_addr (void)
- {
-@@ -84,6 +87,14 @@
- }
- void
-+grub_machine_set_prefix (void)
-+{
-+  grub_env_set ("prefix", prefix);
-+  free (prefix);
-+  prefix = 0;
-+}
-+
-+void
- grub_machine_fini (void)
- {
-   grub_console_fini ();
-@@ -147,8 +158,8 @@
- int
- main (int argc, char *argv[])
- {
--  char *prefix = 0;
--  char rootprefix[100];
-+  char *dir;
-+  
-   struct arguments args =
-     {
-       .dir = DEFAULT_DIRECTORY,
-@@ -184,10 +195,10 @@
-       }
-     }
--  prefix = grub_get_prefix (args.dir ? : DEFAULT_DIRECTORY);
--  sprintf (rootprefix, "%s%s", args.root_dev, prefix);
--
--  grub_env_set ("prefix", rootprefix);
-+  dir = grub_get_prefix (args.dir ? : DEFAULT_DIRECTORY);
-+  prefix = xmalloc (strlen (args.root_dev) + strlen (dir) + 1);
-+  sprintf (prefix, "%s%s", args.root_dev, dir);
-+  free (dir);
-   
-   /* XXX: This is a bit unportable.  */
-   grub_util_biosdisk_init (args.dev_map);
-Index: util/misc.c
-===================================================================
-RCS file: /cvsroot/grub/grub2/util/misc.c,v
-retrieving revision 1.13
-retrieving revision 1.14
-diff -u -r1.13 -r1.14
---- util/misc.c        27 Feb 2005 21:19:06 -0000      1.13
-+++ util/misc.c        23 Apr 2006 13:37:36 -0000      1.14
-@@ -249,7 +249,7 @@
- }
- void
--grub_stop (void)
-+grub_exit (void)
- {
-   exit (1);
- }
-Index: util/unifont2pff.rb
-===================================================================
-RCS file: /cvsroot/grub/grub2/util/unifont2pff.rb,v
-retrieving revision 1.2
-retrieving revision 1.4
-diff -u -r1.2 -r1.4
---- util/unifont2pff.rb        24 Feb 2004 17:21:53 -0000      1.2
-+++ util/unifont2pff.rb        1 Apr 2006 19:23:01 -0000       1.4
-@@ -15,18 +15,26 @@
- MAGIC = "PPF\x7f"
- def usage(status = 0)
--  puts "Usage: ruby unifont2pff.rb [RANGE...] FILE"
-+  puts "Usage: ruby unifont2pff.rb [RANGE ...] FILE"
-   exit(status)
- end
-+if ARGV.length == 0
-+  usage(1)
-+end
-+
- file = ARGV.pop
- ranges = []
- ARGV.each do |range|
--  if /\A([0-9a-fA-F]+):([0-9a-fA-F]+)\z/ =~ range
-+  if /\A0x([0-9a-fA-F]+)[:-]0x([0-9a-fA-F]+)\z/ =~ range
-     ranges << [$1.hex, $2.hex]
--  elsif /\A([0-9a-fA-F]+)\z/ =~ range
-+  elsif /\A0x([0-9a-fA-F]+)\z/ =~ range
-     ranges << [$1.hex, $1.hex]
-+  elsif /\A([0-9]+)[:-]([0-9]+)\z/ =~ range
-+    ranges << [$1.to_i, $2.to_i]
-+  elsif /\A([0-9]+)\z/ =~ range
-+    ranges << [$1.to_i, $1.to_i]
-   else
-     usage(1)
-   end
-Index: util/i386/efi/grub-mkimage.c
-===================================================================
-RCS file: util/i386/efi/grub-mkimage.c
-diff -N util/i386/efi/grub-mkimage.c
---- /dev/null  1 Jan 1970 00:00:00 -0000
-+++ util/i386/efi/grub-mkimage.c       8 May 2006 19:29:10 -0000       1.3
-@@ -0,0 +1,999 @@
-+/*
-+ *  GRUB  --  GRand Unified Bootloader
-+ *  Copyright (C) 2004,2005,2006  Free Software Foundation, Inc.
-+ *
-+ *  This program is free software; you can redistribute it and/or modify
-+ *  it under the terms of the GNU General Public License as published by
-+ *  the Free Software Foundation; either version 2 of the License, or
-+ *  (at your option) any later version.
-+ *
-+ *  This program is distributed in the hope that it will be useful,
-+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+ *  GNU General Public License for more details.
-+ *
-+ *  You should have received a copy of the GNU General Public License
-+ *  along with this program; if not, write to the Free Software
-+ *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-+ */
-+
-+#include <stdio.h>
-+#include <stdint.h>
-+#include <unistd.h>
-+#include <fcntl.h>
-+#include <getopt.h>
-+#include <stdlib.h>
-+#include <string.h>
-+#include <time.h>
-+#include <grub/elf.h>
-+#include <grub/util/misc.h>
-+#include <grub/util/resolve.h>
-+#include <grub/kernel.h>
-+#include <grub/efi/pe32.h>
-+
-+static const grub_uint8_t stub[] = GRUB_PE32_MSDOS_STUB;
-+
-+static inline Elf32_Addr
-+align_address (Elf32_Addr addr, unsigned alignment)
-+{
-+  return (addr + alignment - 1) & ~(alignment - 1);
-+}
-+
-+static inline Elf32_Addr
-+align_pe32_section (Elf32_Addr addr)
-+{
-+  return align_address (addr, GRUB_PE32_SECTION_ALIGNMENT);
-+}
-+
-+/* Read the whole kernel image. Return the pointer to a read image,
-+   and store the size in bytes in *SIZE.  */
-+static char *
-+read_kernel_module (const char *dir, size_t *size)
-+{
-+  char *kernel_image;
-+  char *kernel_path;
-+  
-+  kernel_path = grub_util_get_path (dir, "kernel.mod");
-+  *size = grub_util_get_image_size (kernel_path);
-+  kernel_image = grub_util_read_image (kernel_path);
-+  free (kernel_path);
-+
-+  return kernel_image;
-+}
-+
-+/* Return if the ELF header is valid.  */
-+static int
-+check_elf_header (Elf32_Ehdr *e, size_t size)
-+{
-+  if (size < sizeof (*e)
-+      || e->e_ident[EI_MAG0] != ELFMAG0
-+      || e->e_ident[EI_MAG1] != ELFMAG1
-+      || e->e_ident[EI_MAG2] != ELFMAG2
-+      || e->e_ident[EI_MAG3] != ELFMAG3
-+      || e->e_ident[EI_VERSION] != EV_CURRENT
-+      || e->e_version != grub_cpu_to_le32 (EV_CURRENT)
-+      || e->e_ident[EI_CLASS] != ELFCLASS32
-+      || e->e_ident[EI_DATA] != ELFDATA2LSB
-+      || e->e_machine != grub_cpu_to_le16 (EM_386))
-+    return 0;
-+
-+  return 1;
-+}
-+
-+/* Return the starting address right after the header,
-+   aligned by the section alignment. Allocate 4 section tables for
-+   .text, .data, .reloc, and mods.  */
-+static Elf32_Addr
-+get_starting_section_address (void)
-+{
-+  return align_pe32_section (sizeof (struct grub_pe32_header)
-+                           + 4 * sizeof (struct grub_pe32_section_table));
-+}
-+
-+/* Determine if this section is a text section. Return false if this
-+   section is not allocated.  */
-+static int
-+is_text_section (Elf32_Shdr *s)
-+{
-+  return ((s->sh_flags & grub_cpu_to_le32 (SHF_EXECINSTR | SHF_ALLOC))
-+        == grub_cpu_to_le32 (SHF_EXECINSTR | SHF_ALLOC));
-+}
-+
-+/* Determine if this section is a data section. This assumes that
-+   BSS is also a data section, since the converter initializes BSS
-+   when producing PE32 to avoid a bug in EFI implementations.  */
-+static int
-+is_data_section (Elf32_Shdr *s)
-+{
-+  return (s->sh_flags & grub_cpu_to_le32 (SHF_ALLOC)
-+        && ! (s->sh_flags & grub_cpu_to_le32 (SHF_EXECINSTR)));
-+}
-+
-+/* Locate section addresses by merging code sections and data sections
-+   into .text and .data, respectively. Return the array of section
-+   addresses.  */
-+static Elf32_Addr *
-+locate_sections (Elf32_Shdr *sections, Elf32_Half section_entsize,
-+               Elf32_Half num_sections, const char *strtab)
-+{
-+  int i;
-+  Elf32_Addr current_address;
-+  Elf32_Addr *section_addresses;
-+  Elf32_Shdr *s;
-+  
-+  section_addresses = xmalloc (sizeof (*section_addresses) * num_sections);
-+  memset (section_addresses, 0, sizeof (*section_addresses) * num_sections);
-+
-+  current_address = get_starting_section_address ();
-+
-+  /* .text */
-+  for (i = 0, s = sections;
-+       i < num_sections;
-+       i++, s = (Elf32_Shdr *) ((char *) s + section_entsize))
-+    if (is_text_section (s))
-+      {
-+      Elf32_Word align = grub_le_to_cpu32 (s->sh_addralign);
-+      const char *name = strtab + grub_le_to_cpu32 (s->sh_name);
-+      
-+      if (align)
-+        current_address = align_address (current_address, align);
-+      
-+      grub_util_info ("locating the section %s at 0x%x",
-+                      name, current_address);
-+      section_addresses[i] = current_address;
-+      current_address += grub_le_to_cpu32 (s->sh_size);
-+      }
-+
-+  current_address = align_pe32_section (current_address);
-+
-+  /* .data */
-+  for (i = 0, s = sections;
-+       i < num_sections;
-+       i++, s = (Elf32_Shdr *) ((char *) s + section_entsize))
-+    if (is_data_section (s))
-+      {
-+      Elf32_Word align = grub_le_to_cpu32 (s->sh_addralign);
-+      const char *name = strtab + grub_le_to_cpu32 (s->sh_name);
-+      
-+      if (align)
-+        current_address = align_address (current_address, align);
-+      
-+      grub_util_info ("locating the section %s at 0x%x",
-+                      name, current_address);
-+      section_addresses[i] = current_address;
-+      current_address += grub_le_to_cpu32 (s->sh_size);
-+      }
-+
-+  return section_addresses;
-+}
-+
-+/* Return the symbol table section, if any.  */
-+static Elf32_Shdr *
-+find_symtab_section (Elf32_Shdr *sections,
-+                   Elf32_Half section_entsize, Elf32_Half num_sections)
-+{
-+  int i;
-+  Elf32_Shdr *s;
-+  
-+  for (i = 0, s = sections;
-+       i < num_sections;
-+       i++, s = (Elf32_Shdr *) ((char *) s + section_entsize))
-+    if (s->sh_type == grub_cpu_to_le32 (SHT_SYMTAB))
-+      return s;
-+
-+  return 0;
-+}
-+
-+/* Return the address of the string table.  */
-+static const char *
-+find_strtab (Elf32_Ehdr *e, Elf32_Shdr *sections, Elf32_Half section_entsize)
-+{
-+  Elf32_Shdr *s;
-+  char *strtab;
-+  
-+  s = (Elf32_Shdr *) ((char *) sections
-+                    + grub_le_to_cpu16 (e->e_shstrndx) * section_entsize);
-+  strtab = (char *) e + grub_le_to_cpu32 (s->sh_offset);
-+  return strtab;
-+}
-+
-+/* Relocate symbols; note that this function overwrites the symbol table.
-+   Return the address of a start symbol.  */
-+static Elf32_Addr
-+relocate_symbols (Elf32_Ehdr *e, Elf32_Shdr *sections,
-+                Elf32_Shdr *symtab_section, Elf32_Addr *section_addresses,
-+                Elf32_Half section_entsize, Elf32_Half num_sections)
-+{
-+  Elf32_Word symtab_size, sym_size, num_syms;
-+  Elf32_Off symtab_offset;
-+  Elf32_Addr start_address = 0;
-+  Elf32_Sym *sym;
-+  Elf32_Word i;
-+  Elf32_Shdr *strtab_section;
-+  const char *strtab;
-+  
-+  strtab_section
-+    = (Elf32_Shdr *) ((char *) sections
-+                    + (grub_le_to_cpu32 (symtab_section->sh_link)
-+                       * section_entsize));
-+  strtab = (char *) e + grub_le_to_cpu32 (strtab_section->sh_offset);
-+  
-+  symtab_size = grub_le_to_cpu32 (symtab_section->sh_size);
-+  sym_size = grub_le_to_cpu32 (symtab_section->sh_entsize);
-+  symtab_offset = grub_le_to_cpu32 (symtab_section->sh_offset);
-+  num_syms = symtab_size / sym_size;
-+
-+  for (i = 0, sym = (Elf32_Sym *) ((char *) e + symtab_offset);
-+       i < num_syms;
-+       i++, sym = (Elf32_Sym *) ((char *) sym + sym_size))
-+    {
-+      Elf32_Section index;
-+      const char *name;
-+      
-+      name = strtab + grub_le_to_cpu32 (sym->st_name);
-+      
-+      index = grub_le_to_cpu16 (sym->st_shndx);
-+      if (index == STN_UNDEF)
-+      {
-+        if (sym->st_name)
-+          grub_util_error ("undefined symbol %s", name);
-+        else
-+          continue;
-+      }
-+      else if (index >= num_sections)
-+      grub_util_error ("section %d does not exist", index);
-+      
-+      sym->st_value = (grub_le_to_cpu32 (sym->st_value)
-+                     + section_addresses[index]);
-+      grub_util_info ("locating %s at 0x%x", name, sym->st_value);
-+
-+      if (! start_address)
-+      if (strcmp (name, "_start") == 0 || strcmp (name, "start") == 0)
-+        start_address = sym->st_value;
-+    }
-+
-+  return start_address;
-+}
-+
-+/* Return the address of a symbol at the index I in the section S.  */
-+static Elf32_Addr
-+get_symbol_address (Elf32_Ehdr *e, Elf32_Shdr *s, Elf32_Word i)
-+{
-+  Elf32_Sym *sym;
-+  
-+  sym = (Elf32_Sym *) ((char *) e
-+                     + grub_le_to_cpu32 (s->sh_offset)
-+                     + i * grub_le_to_cpu32 (s->sh_entsize));
-+  return sym->st_value;
-+}
-+
-+/* Return the address of a modified value.  */
-+static Elf32_Addr
-+get_target_address (Elf32_Ehdr *e, Elf32_Shdr *s, Elf32_Addr offset)
-+{
-+  return (Elf32_Addr) e + grub_le_to_cpu32 (s->sh_offset) + offset;
-+}
-+
-+/* Deal with relocation information. This function relocates addresses
-+   within the virtual address space starting from 0. So only relative
-+   addresses can be fully resolved. Absolute addresses must be relocated
-+   again by a PE32 relocator when loaded.  */
-+static void
-+relocate_addresses (Elf32_Ehdr *e, Elf32_Shdr *sections,
-+                  Elf32_Addr *section_addresses,
-+                  Elf32_Half section_entsize, Elf32_Half num_sections,
-+                  const char *strtab)
-+{
-+  Elf32_Half i;
-+  Elf32_Shdr *s;
-+  
-+  for (i = 0, s = sections;
-+       i < num_sections;
-+       i++, s = (Elf32_Shdr *) ((char *) s + section_entsize))
-+    if (s->sh_type == grub_cpu_to_le32 (SHT_REL))
-+      {
-+      Elf32_Rel *r;
-+      Elf32_Word rtab_size, r_size, num_rs;
-+      Elf32_Off rtab_offset;
-+      Elf32_Shdr *symtab_section;
-+      Elf32_Word target_section_index;
-+      Elf32_Addr target_section_addr;
-+      Elf32_Shdr *target_section;
-+      Elf32_Word j;
-+
-+      symtab_section = (Elf32_Shdr *) ((char *) sections
-+                                       + (grub_le_to_cpu32 (s->sh_link)
-+                                          * section_entsize));
-+      target_section_index = grub_le_to_cpu32 (s->sh_info);
-+      target_section_addr = section_addresses[target_section_index];
-+      target_section = (Elf32_Shdr *) ((char *) sections
-+                                       + (target_section_index
-+                                          * section_entsize));
-+
-+      grub_util_info ("dealing with the relocation section %s for %s",
-+                      strtab + grub_le_to_cpu32 (s->sh_name),
-+                      strtab + grub_le_to_cpu32 (target_section->sh_name));
-+
-+      rtab_size = grub_le_to_cpu32 (s->sh_size);
-+      r_size = grub_le_to_cpu32 (s->sh_entsize);
-+      rtab_offset = grub_le_to_cpu32 (s->sh_offset);
-+      num_rs = rtab_size / r_size;
-+
-+      for (j = 0, r = (Elf32_Rel *) ((char *) e + rtab_offset);
-+           j < num_rs;
-+           j++, r = (Elf32_Rel *) ((char *) r + r_size))
-+        {
-+          Elf32_Word info;
-+          Elf32_Addr offset;
-+          Elf32_Addr sym_addr;
-+          Elf32_Addr *target;
-+          
-+          offset = grub_le_to_cpu32 (r->r_offset);
-+          target = (Elf32_Addr *) get_target_address (e, target_section,
-+                                                      offset);
-+          info = grub_le_to_cpu32 (r->r_info);
-+          sym_addr = get_symbol_address (e, symtab_section,
-+                                         ELF32_R_SYM (info));
-+
-+          switch (ELF32_R_TYPE (info))
-+            {
-+            case R_386_NONE:
-+              break;
-+
-+            case R_386_32:
-+              /* This is absolute.  */
-+              *target = grub_cpu_to_le32 (grub_le_to_cpu32 (*target)
-+                                          + sym_addr);
-+              grub_util_info ("relocating an R_386_32 entry to 0x%x at the offset 0x%x",
-+                              *target, offset);
-+              break;
-+
-+            case R_386_PC32:
-+              /* This is relative.  */
-+              *target = grub_cpu_to_le32 (grub_le_to_cpu32 (*target)
-+                                          + sym_addr
-+                                          - target_section_addr - offset);
-+              grub_util_info ("relocating an R_386_PC32 entry to 0x%x at the offset 0x%x",
-+                              *target, offset);
-+              break;
-+
-+            default:
-+              grub_util_error ("unknown relocation type %d",
-+                               ELF32_R_TYPE (info));
-+              break;
-+            }
-+        }
-+      }
-+}
-+
-+void
-+write_padding (FILE *out, size_t size)
-+{
-+  size_t i;
-+
-+  for (i = 0; i < size; i++)
-+    if (fputc (0, out) == EOF)
-+      grub_util_error ("padding failed");
-+}
-+
-+/* Add a PE32's fixup entry for a relocation. Return the resulting address
-+   after having written to the file OUT.  */
-+Elf32_Addr
-+add_fixup_entry (struct grub_pe32_fixup_block **block, grub_uint16_t type,
-+               Elf32_Addr addr, int flush, Elf32_Addr current_address,
-+               FILE *out)
-+{
-+  struct grub_pe32_fixup_block *b = *block;
-+  
-+  /* First, check if it is necessary to write out the current block.  */
-+  if (b)
-+    {
-+      if (flush || addr < b->page_rva || b->page_rva + 0x1000 <= addr)
-+      {
-+        grub_uint32_t size;
-+
-+        if (flush)
-+          {
-+            /* Add as much padding as necessary to align the address
-+               with a section boundary.  */
-+            Elf32_Addr next_address;
-+            unsigned padding_size;
-+              size_t index;
-+            
-+            next_address = current_address + b->block_size;
-+            padding_size = ((align_pe32_section (next_address)
-+                             - next_address)
-+                            >> 1);
-+              index = ((b->block_size - sizeof (*b)) >> 1);
-+              grub_util_info ("adding %d padding fixup entries", padding_size);
-+            while (padding_size--)
-+              {
-+                b->entries[index++] = 0;
-+                b->block_size += 2;
-+              }
-+          }
-+          else if (b->block_size & (8 - 1))
-+            {
-+            /* If not aligned with a 32-bit boundary, add
-+               a padding entry.  */
-+              size_t index;
-+
-+              grub_util_info ("adding a padding fixup entry");
-+              index = ((b->block_size - sizeof (*b)) >> 1);
-+              b->entries[index] = 0;
-+              b->block_size += 2;
-+            }
-+
-+          /* Flush it.  */
-+          grub_util_info ("writing %d bytes of a fixup block starting at 0x%x",
-+                          b->block_size, b->page_rva);
-+          size = b->block_size;
-+        current_address += size;
-+        b->page_rva = grub_cpu_to_le32 (b->page_rva);
-+        b->block_size = grub_cpu_to_le32 (b->block_size);
-+        if (fwrite (b, size, 1, out) != 1)
-+          grub_util_error ("write failed");
-+        free (b);
-+        *block = b = 0;
-+      }
-+    }
-+
-+  if (! flush)
-+    {
-+      grub_uint16_t entry;
-+      size_t index;
-+      
-+      /* If not allocated yet, allocate a block with enough entries.  */
-+      if (! b)
-+      {
-+        *block = b = xmalloc (sizeof (*b) + 2 * 0x1000);
-+
-+        /* The spec does not mention the requirement of a Page RVA.
-+           Here, align the address with a 4K boundary for safety.  */
-+        b->page_rva = (addr & ~(0x1000 - 1));
-+        b->block_size = sizeof (*b);
-+      }
-+
-+      /* Sanity check.  */
-+      if (b->block_size >= sizeof (*b) + 2 * 0x1000)
-+      grub_util_error ("too many fixup entries");
-+
-+      /* Add a new entry.  */
-+      index = ((b->block_size - sizeof (*b)) >> 1);
-+      entry = GRUB_PE32_FIXUP_ENTRY (type, addr - b->page_rva);
-+      b->entries[index] = grub_cpu_to_le16 (entry);
-+      b->block_size += 2;
-+    }
-+
-+  return current_address;
-+}
-+
-+/* Write out zeros to make space for the header.  */
-+static Elf32_Addr
-+make_header_space (FILE *out)
-+{
-+  Elf32_Addr addr;
-+  
-+  addr = get_starting_section_address ();
-+  write_padding (out, addr);
-+
-+  return addr;
-+}
-+
-+/* Write text sections.  */
-+static Elf32_Addr
-+write_text_sections (FILE *out, Elf32_Addr current_address,
-+                   Elf32_Ehdr *e, Elf32_Shdr *sections,
-+                   Elf32_Half section_entsize, Elf32_Half num_sections,
-+                   const char *strtab)
-+{
-+  Elf32_Half i;
-+  Elf32_Shdr *s;
-+  Elf32_Addr addr;
-+  
-+  for (i = 0, s = sections;
-+       i < num_sections;
-+       i++, s = (Elf32_Shdr *) ((char *) s + section_entsize))
-+    if (is_text_section (s))
-+      {
-+      Elf32_Word align = grub_le_to_cpu32 (s->sh_addralign);
-+      Elf32_Off offset = grub_le_to_cpu32 (s->sh_offset);
-+      Elf32_Word size = grub_le_to_cpu32 (s->sh_size);
-+      const char *name = strtab + grub_le_to_cpu32 (s->sh_name);
-+      
-+      if (align)
-+        {
-+          addr = align_address (current_address, align);
-+          if (current_address != addr)
-+            {
-+              grub_util_info ("padding %d bytes for the ELF section alignment",
-+                              addr - current_address);
-+              write_padding (out, addr - current_address);
-+              current_address = addr;
-+            }
-+        }
-+      
-+      grub_util_info ("writing the text section %s at 0x%x",
-+                      name, current_address);
-+      
-+      if (fwrite ((char *) e + offset, size, 1, out) != 1)
-+        grub_util_error ("write failed");
-+      
-+      current_address += size;
-+      }
-+
-+  addr = align_pe32_section (current_address);
-+  if (addr != current_address)
-+    {
-+      grub_util_info ("padding %d bytes for the PE32 section alignment",
-+                    addr - current_address);
-+      write_padding (out, addr - current_address);
-+    }
-+  
-+  return addr;
-+}
-+
-+/* Write data sections.  */
-+static Elf32_Addr
-+write_data_sections (FILE *out, Elf32_Addr current_address,
-+                   Elf32_Ehdr *e, Elf32_Shdr *sections,
-+                   Elf32_Half section_entsize, Elf32_Half num_sections,
-+                   const char *strtab)
-+{
-+  Elf32_Half i;
-+  Elf32_Shdr *s;
-+  Elf32_Addr addr;
-+  
-+  for (i = 0, s = sections;
-+       i < num_sections;
-+       i++, s = (Elf32_Shdr *) ((char *) s + section_entsize))
-+    if (is_data_section (s))
-+      {
-+      Elf32_Word align = grub_le_to_cpu32 (s->sh_addralign);
-+      Elf32_Off offset = grub_le_to_cpu32 (s->sh_offset);
-+      Elf32_Word size = grub_le_to_cpu32 (s->sh_size);
-+      const char *name = strtab + grub_le_to_cpu32 (s->sh_name);
-+      
-+      if (align)
-+        {
-+          addr = align_address (current_address, align);
-+          if (current_address != addr)
-+            {
-+              grub_util_info ("padding %d bytes for the ELF section alignment",
-+                              addr - current_address);
-+              write_padding (out, addr - current_address);
-+              current_address = addr;
-+            }
-+        }
-+      
-+      grub_util_info ("writing the data section %s at 0x%x",
-+                      name, current_address);
-+      
-+      if (s->sh_type == grub_cpu_to_le32 (SHT_NOBITS))
-+        write_padding (out, size);
-+      else
-+        if (fwrite ((char *) e + offset, size, 1, out) != 1)
-+          grub_util_error ("write failed");
-+      
-+      current_address += size;
-+      }
-+  
-+  addr = align_pe32_section (current_address);
-+  if (addr != current_address)
-+    {
-+      grub_util_info ("padding %d bytes for the PE32 section alignment",
-+                    addr - current_address);
-+      write_padding (out, addr - current_address);
-+    }
-+  
-+  return addr;
-+}
-+
-+/* Write modules.  */
-+static Elf32_Addr
-+make_mods_section (FILE *out, Elf32_Addr current_address,
-+                 const char *dir, char *mods[])
-+{
-+  struct grub_util_path_list *path_list;
-+  grub_size_t total_module_size;
-+  struct grub_util_path_list *p;
-+  struct grub_module_info modinfo;
-+  Elf32_Addr addr;
-+
-+  path_list = grub_util_resolve_dependencies (dir, "moddep.lst", mods);
-+  
-+  total_module_size = sizeof (struct grub_module_info);
-+  for (p = path_list; p; p = p->next)
-+    {
-+      total_module_size += (grub_util_get_image_size (p->name)
-+                          + sizeof (struct grub_module_header));
-+    }
-+
-+  grub_util_info ("the total module size is 0x%x", total_module_size);
-+
-+  modinfo.magic = grub_cpu_to_le32 (GRUB_MODULE_MAGIC);
-+  modinfo.offset = grub_cpu_to_le32 (sizeof (modinfo));
-+  modinfo.size = grub_cpu_to_le32 (total_module_size);
-+
-+  if (fwrite (&modinfo, sizeof (modinfo), 1, out) != 1)
-+    grub_util_error ("write failed");
-+
-+  for (p = path_list; p; p = p->next)
-+    {
-+      struct grub_module_header header;
-+      size_t mod_size;
-+      char *mod_image;
-+      
-+      grub_util_info ("adding module %s", p->name);
-+      
-+      mod_size = grub_util_get_image_size (p->name);
-+      header.offset = grub_cpu_to_le32 (sizeof (header));
-+      header.size = grub_cpu_to_le32 (mod_size + sizeof (header));
-+      
-+      mod_image = grub_util_read_image (p->name);
-+
-+      if (fwrite (&header, sizeof (header), 1, out) != 1
-+        || fwrite (mod_image, mod_size, 1, out) != 1)
-+      grub_util_error ("write failed");
-+
-+      free (mod_image);
-+    }
-+  
-+  for (p = path_list; p; )
-+    {
-+      struct grub_util_path_list *q;
-+
-+      q = p->next;
-+      free (p);
-+      p = q;
-+    }
-+      
-+  current_address += total_module_size;
-+  
-+  addr = align_pe32_section (current_address);
-+  if (addr != current_address)
-+    {
-+      grub_util_info ("padding %d bytes for the PE32 section alignment",
-+                    addr - current_address);
-+      write_padding (out, addr - current_address);
-+    }
-+
-+  return addr;
-+}
-+
-+/* Make a .reloc section.  */
-+static Elf32_Addr
-+make_reloc_section (FILE *out, Elf32_Addr current_address, Elf32_Ehdr *e, 
-+                  Elf32_Addr *section_addresses, Elf32_Shdr *sections,
-+                  Elf32_Half section_entsize, Elf32_Half num_sections,
-+                  const char *strtab)
-+{
-+  Elf32_Half i;
-+  Elf32_Shdr *s;
-+  struct grub_pe32_fixup_block *fixup_block = 0;
-+  
-+  for (i = 0, s = sections;
-+       i < num_sections;
-+       i++, s = (Elf32_Shdr *) ((char *) s + section_entsize))
-+    if (s->sh_type == grub_cpu_to_le32 (SHT_REL))
-+      {
-+      Elf32_Rel *r;
-+      Elf32_Word rtab_size, r_size, num_rs;
-+      Elf32_Off rtab_offset;
-+      Elf32_Addr section_address;
-+      Elf32_Word j;
-+      
-+      grub_util_info ("translating the relocation section %s",
-+                      strtab + grub_le_to_cpu32 (s->sh_name));
-+                      
-+      rtab_size = grub_le_to_cpu32 (s->sh_size);
-+      r_size = grub_le_to_cpu32 (s->sh_entsize);
-+      rtab_offset = grub_le_to_cpu32 (s->sh_offset);
-+      num_rs = rtab_size / r_size;
-+      
-+      section_address = section_addresses[grub_le_to_cpu32 (s->sh_info)];
-+
-+      for (j = 0, r = (Elf32_Rel *) ((char *) e + rtab_offset);
-+           j < num_rs;
-+           j++, r = (Elf32_Rel *) ((char *) r + r_size))
-+        {
-+          Elf32_Word info;
-+          Elf32_Addr offset;
-+
-+          offset = grub_le_to_cpu32 (r->r_offset);
-+          info = grub_le_to_cpu32 (r->r_info);
-+
-+          /* Necessary to relocate only absolute addresses.  */
-+          if (ELF32_R_TYPE (info) == R_386_32)
-+            {
-+              Elf32_Addr addr;
-+
-+              addr = section_address + offset;
-+              grub_util_info ("adding a relocation entry for 0x%x", addr);
-+              current_address = add_fixup_entry (&fixup_block,
-+                                                 GRUB_PE32_REL_BASED_HIGHLOW,
-+                                                 addr, 0, current_address,
-+                                                 out);
-+            }
-+        }
-+      }
-+
-+  current_address = add_fixup_entry (&fixup_block, 0, 0, 1,
-+                                   current_address, out);
-+
-+  return current_address;
-+}
-+
-+/* Create the header.  */
-+static void
-+make_header (FILE *out, Elf32_Addr text_address, Elf32_Addr data_address,
-+           Elf32_Addr mods_address, Elf32_Addr reloc_address,
-+           Elf32_Addr end_address, Elf32_Addr start_address)
-+{
-+  struct grub_pe32_header header;
-+  struct grub_pe32_coff_header *c;
-+  struct grub_pe32_optional_header *o;
-+  struct grub_pe32_section_table text_section, data_section;
-+  struct grub_pe32_section_table mods_section, reloc_section;
-+
-+  /* The magic.  */
-+  memset (&header, 0, sizeof (header));
-+  memcpy (header.msdos_stub, stub, sizeof (header.msdos_stub));
-+  memcpy (header.signature, "PE\0\0", sizeof (header.signature));
-+
-+  /* The COFF file header.  */
-+  c = &header.coff_header;
-+  c->machine = grub_cpu_to_le16 (GRUB_PE32_MACHINE_I386);
-+  c->num_sections = grub_cpu_to_le16 (4);
-+  c->time = grub_cpu_to_le32 (time (0));
-+  c->optional_header_size = grub_cpu_to_le16 (sizeof (header.optional_header));
-+  c->characteristics = grub_cpu_to_le16 (GRUB_PE32_EXECUTABLE_IMAGE
-+                                       | GRUB_PE32_LINE_NUMS_STRIPPED
-+                                       | GRUB_PE32_LOCAL_SYMS_STRIPPED
-+                                       | GRUB_PE32_32BIT_MACHINE);
-+
-+  /* The PE Optional header.  */
-+  o = &header.optional_header;
-+  o->magic = grub_cpu_to_le16 (GRUB_PE32_PE32_MAGIC);
-+  o->code_size = grub_cpu_to_le32 (data_address - text_address);
-+  o->data_size = grub_cpu_to_le32 (reloc_address - data_address);
-+  o->bss_size = 0;
-+  o->entry_addr = grub_cpu_to_le32 (start_address);
-+  o->code_base = grub_cpu_to_le32 (text_address);
-+  o->data_base = grub_cpu_to_le32 (data_address);
-+  o->image_base = 0;
-+  o->section_alignment = grub_cpu_to_le32 (GRUB_PE32_SECTION_ALIGNMENT);
-+  o->file_alignment = grub_cpu_to_le32 (GRUB_PE32_FILE_ALIGNMENT);
-+  o->image_size = grub_cpu_to_le32 (end_address);
-+  o->header_size = grub_cpu_to_le32 (text_address);
-+  o->subsystem = grub_cpu_to_le16 (GRUB_PE32_SUBSYSTEM_EFI_APPLICATION);
-+  
-+  /* Do these really matter? */
-+  o->stack_reserve_size = grub_cpu_to_le32 (0x10000);
-+  o->stack_commit_size = grub_cpu_to_le32 (0x10000);
-+  o->heap_reserve_size = grub_cpu_to_le32 (0x10000);
-+  o->heap_commit_size = grub_cpu_to_le32 (0x10000);
-+
-+  o->num_data_directories = grub_cpu_to_le32 (GRUB_PE32_NUM_DATA_DIRECTORIES);
-+  
-+  o->base_relocation_table.rva = grub_cpu_to_le32 (reloc_address);
-+  o->base_relocation_table.size = grub_cpu_to_le32 (end_address
-+                                                  - reloc_address);
-+
-+  /* The sections.  */
-+  memset (&text_section, 0, sizeof (text_section));
-+  strcpy (text_section.name, ".text");
-+  text_section.virtual_size = grub_cpu_to_le32 (data_address - text_address);
-+  text_section.virtual_address = grub_cpu_to_le32 (text_address);
-+  text_section.raw_data_size = grub_cpu_to_le32 (data_address - text_address);
-+  text_section.raw_data_offset = grub_cpu_to_le32 (text_address);
-+  text_section.characteristics = grub_cpu_to_le32 (GRUB_PE32_SCN_CNT_CODE
-+                                                 | GRUB_PE32_SCN_MEM_EXECUTE
-+                                                 | GRUB_PE32_SCN_MEM_READ);
-+
-+  memset (&data_section, 0, sizeof (data_section));
-+  strcpy (data_section.name, ".data");
-+  data_section.virtual_size = grub_cpu_to_le32 (mods_address - data_address);
-+  data_section.virtual_address = grub_cpu_to_le32 (data_address);
-+  data_section.raw_data_size = grub_cpu_to_le32 (mods_address - data_address);
-+  data_section.raw_data_offset = grub_cpu_to_le32 (data_address);
-+  data_section.characteristics
-+    = grub_cpu_to_le32 (GRUB_PE32_SCN_CNT_INITIALIZED_DATA
-+                      | GRUB_PE32_SCN_MEM_READ
-+                      | GRUB_PE32_SCN_MEM_WRITE);
-+
-+  memset (&mods_section, 0, sizeof (mods_section));
-+  strcpy (mods_section.name, "mods");
-+  mods_section.virtual_size = grub_cpu_to_le32 (reloc_address - mods_address);
-+  mods_section.virtual_address = grub_cpu_to_le32 (mods_address);
-+  mods_section.raw_data_size = grub_cpu_to_le32 (reloc_address - mods_address);
-+  mods_section.raw_data_offset = grub_cpu_to_le32 (mods_address);
-+  mods_section.characteristics
-+    = grub_cpu_to_le32 (GRUB_PE32_SCN_CNT_INITIALIZED_DATA
-+                      | GRUB_PE32_SCN_MEM_READ
-+                      | GRUB_PE32_SCN_MEM_WRITE);
-+
-+  memset (&reloc_section, 0, sizeof (reloc_section));
-+  strcpy (reloc_section.name, ".reloc");
-+  reloc_section.virtual_size = grub_cpu_to_le32 (end_address - reloc_address);
-+  reloc_section.virtual_address = grub_cpu_to_le32 (reloc_address);
-+  reloc_section.raw_data_size = grub_cpu_to_le32 (end_address - reloc_address);
-+  reloc_section.raw_data_offset = grub_cpu_to_le32 (reloc_address);
-+  reloc_section.characteristics
-+    = grub_cpu_to_le32 (GRUB_PE32_SCN_CNT_INITIALIZED_DATA
-+                      | GRUB_PE32_SCN_MEM_DISCARDABLE
-+                      | GRUB_PE32_SCN_MEM_READ);
-+
-+  /* Write them out.  */
-+  if (fseek (out, 0, SEEK_SET) < 0)
-+    grub_util_error ("seek failed");
-+
-+  if (fwrite (&header, sizeof (header), 1, out) != 1
-+      || fwrite (&text_section, sizeof (text_section), 1, out) != 1
-+      || fwrite (&data_section, sizeof (data_section), 1, out) != 1
-+      || fwrite (&mods_section, sizeof (mods_section), 1, out) != 1
-+      || fwrite (&reloc_section, sizeof (reloc_section), 1, out) != 1)
-+    grub_util_error ("write failed");
-+}
-+
-+/* Convert an ELF relocatable object into an EFI Application (PE32).  */
-+void
-+convert_elf (const char *dir, FILE *out, char *mods[])
-+{
-+  char *kernel_image;
-+  size_t kernel_size;
-+  const char *strtab;
-+  Elf32_Ehdr *e;
-+  Elf32_Shdr *sections;
-+  Elf32_Off section_offset;
-+  Elf32_Half section_entsize;
-+  Elf32_Half num_sections;
-+  Elf32_Addr *section_addresses;
-+  Elf32_Shdr *symtab_section;
-+  Elf32_Addr start_address;
-+  Elf32_Addr text_address, data_address, reloc_address, mods_address;
-+  Elf32_Addr end_address;
-+
-+  /* Get the kernel image and check the format.  */
-+  kernel_image = read_kernel_module (dir, &kernel_size);
-+  e = (Elf32_Ehdr *) kernel_image;
-+  if (! check_elf_header (e, kernel_size))
-+    grub_util_error ("invalid ELF header");
-+  
-+  section_offset = grub_cpu_to_le32 (e->e_shoff);
-+  section_entsize = grub_cpu_to_le16 (e->e_shentsize);
-+  num_sections = grub_cpu_to_le16 (e->e_shnum);
-+  if (kernel_size < section_offset + section_entsize * num_sections)
-+    grub_util_error ("invalid ELF format");
-+
-+  sections = (Elf32_Shdr *) (kernel_image + section_offset);
-+  strtab = find_strtab (e, sections, section_entsize);
-+
-+  /* Relocate sections then symbols in the virtual address space.  */
-+  section_addresses = locate_sections (sections, section_entsize,
-+                                     num_sections, strtab);
-+  
-+  symtab_section = find_symtab_section (sections,
-+                                      section_entsize, num_sections);
-+  if (! symtab_section)
-+    grub_util_error ("no symbol table");
-+  
-+  start_address = relocate_symbols (e, sections, symtab_section,
-+                                  section_addresses, section_entsize,
-+                                  num_sections);
-+  if (start_address == 0)
-+    grub_util_error ("start symbol is not defined");
-+
-+  /* Resolve addresses in the virtual address space.  */
-+  relocate_addresses (e, sections, section_addresses, section_entsize,
-+                    num_sections, strtab);
-+
-+  /* Generate a PE32 image file. The strategy is to dump binary data first,
-+     then fill up the header.  */
-+  text_address = make_header_space (out);
-+  data_address = write_text_sections (out, text_address, e, sections,
-+                                    section_entsize, num_sections,
-+                                    strtab);
-+  mods_address = write_data_sections (out, data_address, e, sections,
-+                                    section_entsize, num_sections,
-+                                    strtab);
-+  reloc_address = make_mods_section (out, mods_address, dir, mods);
-+  end_address = make_reloc_section (out, reloc_address, e, section_addresses,
-+                                  sections, section_entsize, num_sections,
-+                                  strtab);
-+  make_header (out, text_address, data_address, mods_address,
-+             reloc_address, end_address, start_address);
-+
-+  /* Clean up.  */
-+  free (section_addresses);
-+  free (kernel_image);
-+}
-+
-+static struct option options[] =
-+  {
-+    {"directory", required_argument, 0, 'd'},
-+    {"output", required_argument, 0, 'o'},
-+    {"help", no_argument, 0, 'h'},
-+    {"version", no_argument, 0, 'V'},
-+    {"verbose", no_argument, 0, 'v'},
-+    { 0, 0, 0, 0 }
-+  };
-+
-+static void
-+usage (int status)
-+{
-+  if (status)
-+    fprintf (stderr, "Try ``grub-mkimage --help'' for more information.\n");
-+  else
-+    printf ("\
-+Usage: grub-mkimage -o FILE [OPTION]... [MODULES]\n\
-+\n\
-+Make a bootable image of GRUB.\n\
-+\n\
-+-d, --directory=DIR     use images and modules under DIR [default=%s]\n\
-+-o, --output=FILE       output a generated image to FILE\n\
-+-h, --help              display this message and exit\n\
-+-V, --version           print version information and exit\n\
-+-v, --verbose           print verbose messages\n\
-+\n\
-+Report bugs to <%s>.\n\
-+", GRUB_LIBDIR, PACKAGE_BUGREPORT);
-+
-+  exit (status);
-+}
-+
-+int
-+main (int argc, char *argv[])
-+{
-+  FILE *fp;
-+  char *output = NULL;
-+  char *dir = NULL;
-+
-+  progname = "grub-mkimage";
-+
-+  while (1)
-+    {
-+      int c = getopt_long (argc, argv, "d:o:hVv", options, 0);
-+      if (c == -1)
-+      break;
-+
-+      switch (c)
-+      {
-+        case 'd':
-+          if (dir)
-+            free (dir);
-+          dir = xstrdup (optarg);
-+          break;
-+        case 'h':
-+          usage (0);
-+          break;
-+        case 'o':
-+          if (output)
-+            free (output);
-+          output = xstrdup (optarg);
-+          break;
-+        case 'V':
-+          printf ("grub-mkimage (%s) %s\n", PACKAGE_NAME, PACKAGE_VERSION);
-+          return 0;
-+        case 'v':
-+          verbosity++;
-+          break;
-+        default:
-+          usage (1);
-+          break;
-+      }
-+  }
-+
-+  if (! output)
-+    usage (1);
-+
-+  fp = fopen (output, "wb");
-+  if (! fp)
-+    grub_util_error ("cannot open %s", output);
-+
-+  convert_elf (dir ? : GRUB_LIBDIR, fp, argv + optind);
-+
-+  fclose (fp);
-+
-+  return 0;
-+}
-Index: util/i386/pc/biosdisk.c
-===================================================================
-RCS file: /cvsroot/grub/grub2/util/i386/pc/biosdisk.c,v
-retrieving revision 1.11
-retrieving revision 1.12
-diff -u -r1.11 -r1.12
---- util/i386/pc/biosdisk.c    18 Aug 2005 03:14:39 -0000      1.11
-+++ util/i386/pc/biosdisk.c    4 Jun 2006 15:56:55 -0000       1.12
-@@ -1,7 +1,7 @@
- /* biosdisk.c - emulate biosdisk */
- /*
-  *  GRUB  --  GRand Unified Bootloader
-- *  Copyright (C) 1999,2000,2001,2002,2003,2004  Free Software Foundation, Inc.
-+ *  Copyright (C) 1999,2000,2001,2002,2003,2004,2006  Free Software Foundation, Inc.
-  *
-  *  GRUB is free software; you can redistribute it and/or modify
-  *  it under the terms of the GNU General Public License as published by
-@@ -285,7 +285,7 @@
- #endif /* __linux__ */
- static int
--open_device (const grub_disk_t disk, unsigned long sector, int flags)
-+open_device (const grub_disk_t disk, grub_disk_addr_t sector, int flags)
- {
-   int fd;
-@@ -421,8 +421,8 @@
- }
- static grub_err_t
--grub_util_biosdisk_read (grub_disk_t disk, unsigned long sector,
--                       unsigned long size, char *buf)
-+grub_util_biosdisk_read (grub_disk_t disk, grub_disk_addr_t sector,
-+                       grub_size_t size, char *buf)
- {
-   int fd;
-@@ -458,8 +458,8 @@
- }
- static grub_err_t
--grub_util_biosdisk_write (grub_disk_t disk, unsigned long sector,
--                        unsigned long size, const char *buf)
-+grub_util_biosdisk_write (grub_disk_t disk, grub_disk_addr_t sector,
-+                        grub_size_t size, const char *buf)
- {
-   int fd;
-Index: util/i386/pc/grub-install.in
-===================================================================
-RCS file: /cvsroot/grub/grub2/util/i386/pc/grub-install.in,v
-retrieving revision 1.5
-retrieving revision 1.8
-diff -u -r1.5 -r1.8
---- util/i386/pc/grub-install.in       25 Jan 2006 00:11:36 -0000      1.5
-+++ util/i386/pc/grub-install.in       28 May 2006 23:01:43 -0000      1.8
-@@ -1,7 +1,7 @@
- #! /bin/sh
- # Install GRUB on your drive.
--# Copyright (C) 1999,2000,2001,2002,2003,2004,2005 Free Software Foundation, Inc.
-+# Copyright (C) 1999,2000,2001,2002,2003,2004,2005,2006 Free Software Foundation, Inc.
- #
- # This file is free software; you can redistribute it and/or modify it
- # under the terms of the GNU General Public License as published by
-@@ -21,17 +21,17 @@
- prefix=@prefix@
- exec_prefix=@exec_prefix@
- sbindir=@sbindir@
--datadir=@datadir@
-+bindir=@bindir@
-+libdir=@libdir@
- PACKAGE_NAME=@PACKAGE_NAME@
- PACKAGE_TARNAME=@PACKAGE_TARNAME@
- PACKAGE_VERSION=@PACKAGE_VERSION@
--host_cpu=@host_cpu@
--host_os=@host_os@
--host_vendor=@host_vendor@
--pkgdatadir=${datadir}/${PACKAGE_TARNAME}/${host_cpu}-${host_vendor}
-+target_cpu=@target_cpu@
-+platform=@platform@
-+pkglibdir=${libdir}/${PACKAGE_TARNAME}/${target_cpu}-${platform}
- grub_setup=${sbindir}/grub-setup
--grub_mkimage=${sbindir}/grub-mkimage
-+grub_mkimage=${bindir}/grub-mkimage
- grub_mkdevicemap=${sbindir}/grub-mkdevicemap
- grub_probefs=${sbindir}/grub-probefs
- rootdir=
-@@ -202,7 +202,7 @@
-       rm -f $file || exit 1
-     fi
- done
--for file in ${pkgdatadir}/*.mod ${pkgdatadir}/*.lst ${pkgdatadir}/*.img; do
-+for file in ${pkglibdir}/*.mod ${pkglibdir}/*.lst ${pkglibdir}/*.img; do
-     cp -f $file ${grubdir} || exit 1
- done
-Index: util/i386/pc/grub-mkimage.c
-===================================================================
-RCS file: /cvsroot/grub/grub2/util/i386/pc/grub-mkimage.c,v
-retrieving revision 1.8
-retrieving revision 1.10
-diff -u -r1.8 -r1.10
---- util/i386/pc/grub-mkimage.c        8 Aug 2005 23:15:21 -0000       1.8
-+++ util/i386/pc/grub-mkimage.c        8 May 2006 19:29:10 -0000       1.10
-@@ -61,9 +61,11 @@
-   memcpy (*core_img, kernel_img, GRUB_KERNEL_MACHINE_RAW_SIZE);
-   
-   grub_util_info ("compressing the core image");
--  if (lzo1x_999_compress (kernel_img + GRUB_KERNEL_MACHINE_RAW_SIZE,
-+  if (lzo1x_999_compress ((const lzo_byte *) (kernel_img
-+                                            + GRUB_KERNEL_MACHINE_RAW_SIZE),
-                         kernel_size - GRUB_KERNEL_MACHINE_RAW_SIZE,
--                        *core_img + GRUB_KERNEL_MACHINE_RAW_SIZE,
-+                        (lzo_byte *) (*core_img
-+                                      + GRUB_KERNEL_MACHINE_RAW_SIZE),
-                         &size, wrkmem)
-       != LZO_E_OK)
-     grub_util_error ("cannot compress the kernel image");
-@@ -205,7 +207,7 @@
-   -v, --verbose           print verbose messages\n\
- \n\
- Report bugs to <%s>.\n\
--", GRUB_DATADIR, PACKAGE_BUGREPORT);
-+", GRUB_LIBDIR, PACKAGE_BUGREPORT);
-   exit (status);
- }
-@@ -267,7 +269,7 @@
-       grub_util_error ("cannot open %s", output);
-     }
--  generate_image (dir ? : GRUB_DATADIR, fp, argv + optind);
-+  generate_image (dir ? : GRUB_LIBDIR, fp, argv + optind);
-   fclose (fp);
-Index: util/i386/pc/grub-probefs.c
-===================================================================
-RCS file: /cvsroot/grub/grub2/util/i386/pc/grub-probefs.c,v
-retrieving revision 1.2
-retrieving revision 1.3
-diff -u -r1.2 -r1.3
---- util/i386/pc/grub-probefs.c        19 Oct 2005 23:17:09 -0000      1.2
-+++ util/i386/pc/grub-probefs.c        23 Apr 2006 13:37:36 -0000      1.3
-@@ -1,7 +1,7 @@
- /* grub-probefs.c - probe a filesystem module for a given path */
- /*
-  *  GRUB  --  GRand Unified Bootloader
-- *  Copyright (C) 2005 Free Software Foundation, Inc.
-+ *  Copyright (C) 2005,2006 Free Software Foundation, Inc.
-  *
-  *  GRUB is free software; you can redistribute it and/or modify
-  *  it under the terms of the GNU General Public License as published by
-@@ -28,6 +28,7 @@
- #include <grub/pc_partition.h>
- #include <grub/machine/util/biosdisk.h>
- #include <grub/util/getroot.h>
-+#include <grub/term.h>
- #include <stdio.h>
- #include <unistd.h>
-@@ -52,6 +53,18 @@
-   putchar (c);
- }
-+int
-+grub_getkey (void)
-+{
-+  return -1;
-+}
-+
-+grub_term_t
-+grub_term_get_current (void)
-+{
-+  return 0;
-+}
-+
- void
- grub_refresh (void)
- {
-Index: util/i386/pc/grub-setup.c
-===================================================================
-RCS file: /cvsroot/grub/grub2/util/i386/pc/grub-setup.c,v
-retrieving revision 1.16
-retrieving revision 1.18
-diff -u -r1.16 -r1.18
---- util/i386/pc/grub-setup.c  18 Aug 2005 03:14:39 -0000      1.16
-+++ util/i386/pc/grub-setup.c  4 Jun 2006 15:56:55 -0000       1.18
-@@ -1,7 +1,7 @@
- /* grub-setup.c - make GRUB usable */
- /*
-  *  GRUB  --  GRand Unified Bootloader
-- *  Copyright (C) 1999,2000,2001,2002,2003,2004,2005 Free Software Foundation, Inc.
-+ *  Copyright (C) 1999,2000,2001,2002,2003,2004,2005,2006 Free Software Foundation, Inc.
-  *
-  *  GRUB is free software; you can redistribute it and/or modify
-  *  it under the terms of the GNU General Public License as published by
-@@ -31,6 +31,7 @@
- #include <grub/machine/util/biosdisk.h>
- #include <grub/machine/boot.h>
- #include <grub/machine/kernel.h>
-+#include <grub/term.h>
- #include <stdio.h>
- #include <unistd.h>
-@@ -59,7 +60,7 @@
- /* This is the blocklist used in the diskboot image.  */
- struct boot_blocklist
- {
--  grub_uint32_t start;
-+  grub_uint64_t start;
-   grub_uint16_t len;
-   grub_uint16_t segment;
- } __attribute__ ((packed));
-@@ -70,6 +71,18 @@
-   putchar (c);
- }
-+int
-+grub_getkey (void)
-+{
-+  return -1;
-+}
-+
-+grub_term_t
-+grub_term_get_current (void)
-+{
-+  return 0;
-+}
-+
- void
- grub_refresh (void)
- {
-@@ -86,14 +99,14 @@
-   grub_uint16_t core_sectors;
-   grub_device_t root_dev, dest_dev;
-   grub_uint8_t *boot_drive;
--  grub_uint32_t *kernel_sector;
-+  grub_disk_addr_t *kernel_sector;
-   grub_uint16_t *boot_drive_check;
-   struct boot_blocklist *first_block, *block;
-   grub_int32_t *install_dos_part, *install_bsd_part;
-   char *install_prefix;
-   char *tmp_img;
-   int i;
--  unsigned long first_sector;
-+  grub_disk_addr_t first_sector;
-   grub_uint16_t current_segment
-     = GRUB_BOOT_MACHINE_KERNEL_SEG + (GRUB_DISK_SECTOR_SIZE >> 4);
-   grub_uint16_t last_length = GRUB_DISK_SECTOR_SIZE;
-@@ -101,9 +114,9 @@
-   FILE *fp;
-   unsigned long first_start = ~0UL;
-   
--  auto void save_first_sector (unsigned long sector, unsigned offset,
-+  auto void save_first_sector (grub_disk_addr_t sector, unsigned offset,
-                              unsigned length);
--  auto void save_blocklists (unsigned long sector, unsigned offset,
-+  auto void save_blocklists (grub_disk_addr_t sector, unsigned offset,
-                            unsigned length);
-   auto int find_first_partition_start (grub_disk_t disk,
-@@ -122,10 +135,10 @@
-       return 0;
-     }
-   
--  void save_first_sector (unsigned long sector, unsigned offset,
-+  void save_first_sector (grub_disk_addr_t sector, unsigned offset,
-                         unsigned length)
-     {
--      grub_util_info ("the fist sector is <%lu,%u,%u>",
-+      grub_util_info ("the first sector is <%llu,%u,%u>",
-                     sector, offset, length);
-       
-       if (offset != 0 || length != GRUB_DISK_SECTOR_SIZE)
-@@ -134,23 +147,24 @@
-       first_sector = sector;
-     }
--  void save_blocklists (unsigned long sector, unsigned offset, unsigned length)
-+  void save_blocklists (grub_disk_addr_t sector, unsigned offset,
-+                      unsigned length)
-     {
-       struct boot_blocklist *prev = block + 1;
--      grub_util_info ("saving <%lu,%u,%u> with the segment 0x%x",
-+      grub_util_info ("saving <%llu,%u,%u> with the segment 0x%x",
-                     sector, offset, length, (unsigned) current_segment);
-       
-       if (offset != 0 || last_length != GRUB_DISK_SECTOR_SIZE)
-       grub_util_error ("Non-sector-aligned data is found in the core file");
-       if (block != first_block
--        && (grub_le_to_cpu32 (prev->start)
-+        && (grub_le_to_cpu64 (prev->start)
-             + grub_le_to_cpu16 (prev->len)) == sector)
-       prev->len = grub_cpu_to_le16 (grub_le_to_cpu16 (prev->len) + 1);
-       else
-       {
--        block->start = grub_cpu_to_le32 (sector);
-+        block->start = grub_cpu_to_le64 (sector);
-         block->len = grub_cpu_to_le16 (1);
-         block->segment = grub_cpu_to_le16 (current_segment);
-@@ -174,7 +188,7 @@
-   /* Set the addresses of BOOT_DRIVE, KERNEL_SECTOR and BOOT_DRIVE_CHECK.  */
-   boot_drive = (grub_uint8_t *) (boot_img + GRUB_BOOT_MACHINE_BOOT_DRIVE);
--  kernel_sector = (grub_uint32_t *) (boot_img
-+  kernel_sector = (grub_disk_addr_t *) (boot_img
-                                    + GRUB_BOOT_MACHINE_KERNEL_SECTOR);
-   boot_drive_check = (grub_uint16_t *) (boot_img
-                                       + GRUB_BOOT_MACHINE_DRIVE_CHECK);
-@@ -253,7 +267,7 @@
-         grub_util_info ("will embed the core image into after the MBR");
-         
-         /* The first blocklist contains the whole sectors.  */
--        first_block->start = grub_cpu_to_le32 (2);
-+        first_block->start = grub_cpu_to_le64 (2);
-         first_block->len = grub_cpu_to_le16 (core_sectors - 1);
-         first_block->segment
-           = grub_cpu_to_le16 (GRUB_BOOT_MACHINE_KERNEL_SEG
-@@ -292,7 +306,7 @@
-         /* The boot image and the core image are on the same drive,
-            so there is no need to specify the boot drive explicitly.  */
-         *boot_drive = 0xff;
--        *kernel_sector = grub_cpu_to_le32 (1);
-+        *kernel_sector = grub_cpu_to_le64 (1);
-         /* Write the boot image onto the disk.  */
-         if (grub_disk_write (dest_dev->disk, 0, 0, GRUB_DISK_SECTOR_SIZE,
-@@ -326,7 +340,7 @@
-       file = grub_file_open (core_path);
-       if (file)
-       {
--        if (grub_file_size (file) != (grub_ssize_t) core_size)
-+        if (grub_file_size (file) != core_size)
-           grub_util_info ("succeeded in opening the core image but the size is different (%d != %d)",
-                           (int) grub_file_size (file), (int) core_size);
-         else if (grub_file_read (file, tmp_img, core_size)
-@@ -411,7 +425,7 @@
-   free (core_path);
-   free (tmp_img);
-   
--  *kernel_sector = grub_cpu_to_le32 (first_sector);
-+  *kernel_sector = grub_cpu_to_le64 (first_sector);
-   /* If the destination device is different from the root device,
-      it is necessary to embed the boot drive explicitly.  */
-Index: util/powerpc/ieee1275/grub-install.in
-===================================================================
-RCS file: /cvsroot/grub/grub2/util/powerpc/ieee1275/grub-install.in,v
-retrieving revision 1.3
-retrieving revision 1.5
-diff -u -r1.3 -r1.5
---- util/powerpc/ieee1275/grub-install.in      23 Nov 2005 05:25:38 -0000      1.3
-+++ util/powerpc/ieee1275/grub-install.in      28 May 2006 23:01:43 -0000      1.5
-@@ -1,7 +1,7 @@
- #! /bin/sh
- # Install GRUB on your drive.
--# Copyright (C) 1999,2000,2001,2002,2003,2004,2005 Free Software Foundation, Inc.
-+# Copyright (C) 1999,2000,2001,2002,2003,2004,2005,2006 Free Software Foundation, Inc.
- #
- # This file is free software; you can redistribute it and/or modify it
- # under the terms of the GNU General Public License as published by
-@@ -24,16 +24,15 @@
- prefix=@prefix@
- exec_prefix=@exec_prefix@
- sbindir=@sbindir@
--datadir=@datadir@
-+libdir=@libdir@
- PACKAGE_NAME=@PACKAGE_NAME@
- PACKAGE_TARNAME=@PACKAGE_TARNAME@
- PACKAGE_VERSION=@PACKAGE_VERSION@
--host_cpu=@host_cpu@
--host_os=@host_os@
--host_vendor=@host_vendor@
--pkgdatadir=${datadir}/${PACKAGE_TARNAME}/${host_cpu}-${host_vendor}
-+target_cpu=@target_cpu@
-+platform=@platform@
-+pkglibdir=${libdir}/${PACKAGE_TARNAME}/${target_cpu}-${platform}
--grub_mkimage=${sbindir}/grub-mkimage
-+grub_mkimage=${bindir}/grub-mkimage
- rootdir=
- grub_prefix=/boot/grub
- modules=
-@@ -138,14 +137,14 @@
-       rm -f $file || exit 1
-     fi
- done
--for file in ${pkgdatadir}/*.mod ${pkgdatadir}/*.lst ; do
-+for file in ${pkglibdir}/*.mod ${pkglibdir}/*.lst ; do
-     cp -f $file ${grubdir} || exit 1
- done
- # Create the core image with all modules, unless user specified a subset.
- # XXX probe for partition map and filesystem?
- if test "x$modules" = x; then
--    modules="$pkgdatadir"/*.mod
-+    modules="$pkglibdir"/*.mod
- fi
- # Now perform the installation.
-Index: util/powerpc/ieee1275/grub-mkimage.c
-===================================================================
-RCS file: /cvsroot/grub/grub2/util/powerpc/ieee1275/grub-mkimage.c,v
-retrieving revision 1.4
-retrieving revision 1.6
-diff -u -r1.4 -r1.6
---- util/powerpc/ieee1275/grub-mkimage.c       3 Nov 2005 05:05:05 -0000       1.4
-+++ util/powerpc/ieee1275/grub-mkimage.c       8 May 2006 21:47:19 -0000       1.6
-@@ -1,6 +1,6 @@
- /*
-  *  GRUB  --  GRand Unified Bootloader
-- *  Copyright (C) 2004, 2005  Free Software Foundation, Inc.
-+ *  Copyright (C) 2004,2005,2006  Free Software Foundation, Inc.
-  *
-  *  This program is free software; you can redistribute it and/or modify
-  *  it under the terms of the GNU General Public License as published by
-@@ -168,7 +168,7 @@
-   int i;
-   /* Read ELF header.  */
--  kernel_path = grub_util_get_path (dir, "grubof");
-+  kernel_path = grub_util_get_path (dir, "kernel.elf");
-   in = fopen (kernel_path, "rb");
-   if (! in)
-     grub_util_error ("cannot open %s", kernel_path);
-@@ -278,7 +278,7 @@
- -v, --verbose           print verbose messages\n\
- \n\
- Report bugs to <%s>.\n\
--", GRUB_DATADIR, PACKAGE_BUGREPORT);
-+", GRUB_LIBDIR, PACKAGE_BUGREPORT);
-   exit (status);
- }
-@@ -336,7 +336,7 @@
-   if (! fp)
-     grub_util_error ("cannot open %s", output);
--  add_segments (dir ? : GRUB_DATADIR, fp, chrp, argv + optind);
-+  add_segments (dir ? : GRUB_LIBDIR, fp, chrp, argv + optind);
-   fclose (fp);
-Index: video/video.c
-===================================================================
-RCS file: video/video.c
-diff -N video/video.c
---- /dev/null  1 Jan 1970 00:00:00 -0000
-+++ video/video.c      31 Mar 2006 14:26:34 -0000      1.2
-@@ -0,0 +1,353 @@
-+/*
-+ *  GRUB  --  GRand Unified Bootloader
-+ *  Copyright (C) 2006  Free Software Foundation, Inc.
-+ *
-+ *  This program is free software; you can redistribute it and/or modify
-+ *  it under the terms of the GNU General Public License as published by
-+ *  the Free Software Foundation; either version 2 of the License, or
-+ *  (at your option) any later version.
-+ *
-+ *  This program is distributed in the hope that it will be useful,
-+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+ *  GNU General Public License for more details.
-+ *
-+ *  You should have received a copy of the GNU General Public License
-+ *  along with this program; if not, write to the Free Software
-+ *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-+ */
-+
-+#include <grub/video.h>
-+#include <grub/types.h>
-+#include <grub/dl.h>
-+
-+/* The list of video adapters registerd to system.  */
-+static grub_video_adapter_t grub_video_adapter_list;
-+
-+/* Active video adapter.  */
-+static grub_video_adapter_t grub_video_adapter_active;
-+
-+void
-+grub_video_register (grub_video_adapter_t adapter)
-+{
-+  adapter->next = grub_video_adapter_list;
-+  grub_video_adapter_list = adapter;
-+}
-+
-+void
-+grub_video_unregister (grub_video_adapter_t adapter)
-+{
-+  grub_video_adapter_t *p, q;
-+  
-+  for (p = &grub_video_adapter_list, q = *p; q; p = &(q->next), q = q->next)
-+    if (q == adapter)
-+      {
-+        *p = q->next;
-+        break;
-+      }                                    
-+}
-+
-+void
-+grub_video_iterate (int (*hook) (grub_video_adapter_t adapter))
-+{
-+  grub_video_adapter_t p;
-+  
-+  for (p = grub_video_adapter_list; p; p = p->next)
-+    if (hook (p))
-+      break;
-+}
-+
-+grub_err_t
-+grub_video_setup (unsigned int width, unsigned int height,
-+                  unsigned int mode_type)
-+{
-+  grub_video_adapter_t p;
-+
-+  /* De-activate last set video adapter.  */
-+  if (grub_video_adapter_active)
-+    {
-+      /* Finalize adapter.  */
-+      grub_video_adapter_active->fini ();
-+      if (grub_errno != GRUB_ERR_NONE)
-+        return grub_errno;
-+        
-+      /* Mark active adapter as not set.  */
-+      grub_video_adapter_active = 0;
-+    }
-+  
-+  /* Loop thru all possible video adapter trying to find requested mode.  */
-+  for (p = grub_video_adapter_list; p; p = p->next)
-+    {
-+      /* Try to initialize adapter, if can't skip to next.  */
-+      p->init ();
-+      if (grub_errno != GRUB_ERR_NONE)
-+        {
-+          grub_errno = GRUB_ERR_NONE;
-+          continue;
-+        }
-+
-+      /* Try to initialize video mode.  */      
-+      p->setup (width, height, mode_type);
-+      if (grub_errno == GRUB_ERR_NONE)
-+        {
-+          /* Valid mode found from adapter, and it has been activated.
-+             Specify it as active adapter.  */
-+          grub_video_adapter_active = p;
-+          return GRUB_ERR_NONE;
-+        }
-+      else
-+        grub_errno = GRUB_ERR_NONE;        
-+
-+      /* No valid mode found in this adapter, finalize adapter.  */
-+      p->fini ();
-+      if (grub_errno != GRUB_ERR_NONE)
-+        return grub_errno;
-+    }
-+  
-+  /* We couldn't find suitable adapter for specified mode.  */
-+  return grub_error (GRUB_ERR_UNKNOWN_DEVICE, 
-+                     "Can't locate valid adapter for mode");
-+}
-+
-+grub_err_t
-+grub_video_restore (void)
-+{
-+  if (grub_video_adapter_active)
-+    {
-+      grub_video_adapter_active->fini ();
-+      if (grub_errno != GRUB_ERR_NONE)
-+        return grub_errno;
-+      
-+      grub_video_adapter_active = 0;
-+    }
-+  return GRUB_ERR_NONE;
-+}
-+
-+grub_err_t
-+grub_video_get_info (struct grub_video_mode_info *mode_info)
-+{
-+  if (! grub_video_adapter_active)
-+    return grub_error (GRUB_ERR_BAD_DEVICE, "No video mode activated");
-+  
-+  return grub_video_adapter_active->get_info (mode_info);
-+}
-+
-+enum grub_video_blit_format
-+grub_video_get_blit_format (struct grub_video_mode_info *mode_info)
-+{
-+  /* Check if we have any knwon 32 bit modes.  */
-+  if (mode_info->bpp == 32)
-+    {
-+      if ((mode_info->red_mask_size == 8)
-+          && (mode_info->red_field_pos == 0)
-+          && (mode_info->green_mask_size == 8)
-+          && (mode_info->green_field_pos == 8)
-+          && (mode_info->blue_mask_size == 8)
-+          && (mode_info->blue_field_pos == 16)
-+          && (mode_info->reserved_mask_size == 8)
-+          && (mode_info->reserved_field_pos == 24))
-+        {
-+          return GRUB_VIDEO_BLIT_FORMAT_R8G8B8A8;
-+        }
-+    }
-+
-+  /* Check if we have any known 24 bit modes.  */
-+  if (mode_info->bpp == 24)
-+    {
-+      if ((mode_info->red_mask_size == 8)
-+          && (mode_info->red_field_pos == 0)
-+          && (mode_info->green_mask_size == 8)
-+          && (mode_info->green_field_pos == 8)
-+          && (mode_info->blue_mask_size == 8)
-+          && (mode_info->blue_field_pos == 16))
-+        {
-+          return GRUB_VIDEO_BLIT_FORMAT_R8G8B8;
-+        }
-+    }
-+
-+  /* If there are more than 8 bits per color, assume RGB(A) mode.  */
-+  if (mode_info->bpp > 8)
-+    {
-+      if (mode_info->reserved_mask_size > 0)
-+        {
-+          return GRUB_VIDEO_BLIT_FORMAT_RGBA;
-+        }
-+      return GRUB_VIDEO_BLIT_FORMAT_RGB;
-+    }
-+
-+  /* Assume as indexcolor mode.  */
-+  return GRUB_VIDEO_BLIT_FORMAT_INDEXCOLOR;
-+}
-+
-+grub_err_t
-+grub_video_set_palette (unsigned int start, unsigned int count,
-+                        struct grub_video_palette_data *palette_data)
-+{
-+  if (! grub_video_adapter_active)
-+    return grub_error (GRUB_ERR_BAD_DEVICE, "No video mode activated");
-+  
-+  return grub_video_adapter_active->set_palette (start, count, palette_data);
-+}
-+
-+grub_err_t
-+grub_video_get_palette (unsigned int start, unsigned int count,
-+                        struct grub_video_palette_data *palette_data)
-+{
-+  if (! grub_video_adapter_active)
-+    return grub_error (GRUB_ERR_BAD_DEVICE, "No video mode activated");
-+  
-+  return grub_video_adapter_active->get_palette (start, count, palette_data);
-+}
-+
-+grub_err_t
-+grub_video_set_viewport (unsigned int x, unsigned int y,
-+                         unsigned int width, unsigned int height)
-+{
-+  if (! grub_video_adapter_active)
-+    return grub_error (GRUB_ERR_BAD_DEVICE, "No video mode activated");
-+
-+  return grub_video_adapter_active->set_viewport (x, y, width, height);
-+}
-+
-+grub_err_t
-+grub_video_get_viewport (unsigned int *x, unsigned int *y,
-+                         unsigned int *width, unsigned int *height)
-+{
-+  if (! grub_video_adapter_active)
-+    return grub_error (GRUB_ERR_BAD_DEVICE, "No video mode activated");
-+
-+  return grub_video_adapter_active->get_viewport (x, y, width, height);
-+}
-+
-+grub_video_color_t
-+grub_video_map_color (grub_uint32_t color_name)
-+{
-+  if (! grub_video_adapter_active)
-+    return 0;
-+
-+  return grub_video_adapter_active->map_color (color_name);
-+}
-+
-+grub_video_color_t
-+grub_video_map_rgb (grub_uint8_t red, grub_uint8_t green, grub_uint8_t blue)
-+{
-+  if (! grub_video_adapter_active)
-+    return 0;
-+
-+  return grub_video_adapter_active->map_rgb (red, green, blue);
-+}
-+
-+grub_video_color_t
-+grub_video_map_rgba (grub_uint8_t red, grub_uint8_t green, grub_uint8_t blue,
-+                     grub_uint8_t alpha)
-+{
-+  if (! grub_video_adapter_active)
-+    return 0;
-+
-+  return grub_video_adapter_active->map_rgba (red, green, blue, alpha);
-+}
-+
-+grub_err_t
-+grub_video_fill_rect (grub_video_color_t color, int x, int y,
-+                      unsigned int width, unsigned int height)
-+{
-+  if (! grub_video_adapter_active)
-+    return grub_error (GRUB_ERR_BAD_DEVICE, "No video mode activated");
-+
-+  return grub_video_adapter_active->fill_rect (color, x, y, width, height);
-+}
-+
-+grub_err_t
-+grub_video_blit_glyph (struct grub_font_glyph *glyph,
-+                       grub_video_color_t color, int x, int y)
-+{
-+  if (! grub_video_adapter_active)
-+    return grub_error (GRUB_ERR_BAD_DEVICE, "No video mode activated");
-+
-+  return grub_video_adapter_active->blit_glyph (glyph, color, x, y);
-+}
-+
-+grub_err_t
-+grub_video_blit_bitmap (struct grub_video_bitmap *bitmap,
-+                        int x, int y, int offset_x, int offset_y,
-+                        unsigned int width, unsigned int height)
-+{
-+  if (! grub_video_adapter_active)
-+    return grub_error (GRUB_ERR_BAD_DEVICE, "No video mode activated");
-+
-+  return grub_video_adapter_active->blit_bitmap (bitmap, x, y,
-+                                                 offset_x, offset_y,
-+                                                 width, height);
-+}
-+
-+grub_err_t
-+grub_video_blit_render_target (struct grub_video_render_target *target,
-+                               int x, int y, int offset_x, int offset_y,
-+                               unsigned int width, unsigned int height)
-+{
-+  if (! grub_video_adapter_active)
-+    return grub_error (GRUB_ERR_BAD_DEVICE, "No video mode activated");
-+
-+  return grub_video_adapter_active->blit_render_target (target, x, y,
-+                                                        offset_x, offset_y, 
-+                                                        width, height);
-+}
-+
-+grub_err_t
-+grub_video_scroll (grub_video_color_t color, int dx, int dy)
-+{
-+  if (! grub_video_adapter_active)
-+    return grub_error (GRUB_ERR_BAD_DEVICE, "No video mode activated");
-+
-+  return grub_video_adapter_active->scroll (color, dx, dy);
-+}
-+
-+grub_err_t
-+grub_video_swap_buffers (void)
-+{
-+  if (! grub_video_adapter_active)
-+    return grub_error (GRUB_ERR_BAD_DEVICE, "No video mode activated");
-+
-+  return grub_video_adapter_active->swap_buffers ();
-+}
-+
-+grub_err_t
-+grub_video_create_render_target (struct grub_video_render_target **result,
-+                                 unsigned int width, unsigned int height,
-+                                 unsigned int mode_type)
-+{
-+  if (! grub_video_adapter_active)
-+    return grub_error (GRUB_ERR_BAD_DEVICE, "No video mode activated");
-+
-+  return grub_video_adapter_active->create_render_target (result,
-+                                                          width, height,
-+                                                          mode_type);
-+}
-+
-+grub_err_t
-+grub_video_delete_render_target (struct grub_video_render_target *target)
-+{
-+  if (! grub_video_adapter_active)
-+    return grub_error (GRUB_ERR_BAD_DEVICE, "No video mode activated");
-+
-+  return grub_video_adapter_active->delete_render_target (target);
-+}
-+
-+grub_err_t
-+grub_video_set_active_render_target (struct grub_video_render_target *target)
-+{
-+  if (! grub_video_adapter_active)
-+    return grub_error (GRUB_ERR_BAD_DEVICE, "No video mode activated");
-+
-+  return grub_video_adapter_active->set_active_render_target (target);
-+}
-+
-+GRUB_MOD_INIT(video_video)
-+{
-+  grub_video_adapter_active = 0;
-+  grub_video_adapter_list = 0;
-+}
-+
-+GRUB_MOD_FINI(video_video)
-+{
-+}
-Index: video/i386/pc/vbe.c
-===================================================================
-RCS file: /cvsroot/grub/grub2/video/i386/pc/vbe.c,v
-retrieving revision 1.4
-retrieving revision 1.7
-diff -u -r1.4 -r1.7
---- video/i386/pc/vbe.c        18 Sep 2005 21:04:41 -0000      1.4
-+++ video/i386/pc/vbe.c        9 May 2006 20:11:11 -0000       1.7
-@@ -1,6 +1,6 @@
- /*
-  *  GRUB  --  GRand Unified Bootloader
-- *  Copyright (C) 2005  Free Software Foundation, Inc.
-+ *  Copyright (C) 2005,2006  Free Software Foundation, Inc.
-  *
-  *  This program is free software; you can redistribute it and/or modify
-  *  it under the terms of the GNU General Public License as published by
-@@ -19,18 +19,15 @@
- #include <grub/err.h>
- #include <grub/machine/memory.h>
--#include <grub/machine/vga.h>
- #include <grub/machine/vbe.h>
--#include <grub/machine/console.h>
--#include <grub/term.h>
-+#include <grub/machine/vbeblit.h>
-+#include <grub/machine/vbefill.h>
- #include <grub/types.h>
- #include <grub/dl.h>
- #include <grub/misc.h>
--#include <grub/normal.h>
- #include <grub/font.h>
--#include <grub/arg.h>
- #include <grub/mm.h>
--#include <grub/env.h>
-+#include <grub/video.h>
- /* Specify "standard" VGA palette, some video cards may
-    need this and this will also be used when using RGB modes.  */
-@@ -57,15 +54,37 @@
-   };
- static int vbe_detected = -1;
--static int index_color_mode = 0;
- static struct grub_vbe_info_block controller_info;
- static struct grub_vbe_mode_info_block active_mode_info;
--static grub_uint32_t active_mode = 0;
-+static struct
-+{
-+  struct grub_video_render_target render_target;
-+
-+  unsigned int bytes_per_scan_line;
-+  unsigned int bytes_per_pixel;
-+  grub_uint32_t active_mode;
-+  grub_uint8_t *ptr;
-+  int index_color_mode;
-+  struct grub_video_palette_data palette[256];
-+} framebuffer;  
-+
-+static struct grub_video_render_target *render_target;
-+static grub_uint32_t initial_mode;
-+static grub_uint32_t mode_in_use = 0x55aa;
-+static grub_uint16_t *mode_list;
-+
-+static grub_video_color_t
-+grub_video_vbe_map_rgba (grub_uint8_t red, grub_uint8_t green,
-+                         grub_uint8_t blue, grub_uint8_t alpha);
--static grub_uint8_t *framebuffer = 0;
--static grub_uint32_t bytes_per_scan_line = 0;
-+static void *
-+real2pm (grub_vbe_farptr_t ptr)
-+{
-+  return (void *) ((((unsigned long) ptr & 0xFFFF0000) >> 12UL)
-+                   + ((unsigned long) ptr & 0x0000FFFF));
-+}
- grub_err_t
- grub_vbe_probe (struct grub_vbe_info_block *info_block)
-@@ -99,7 +118,7 @@
-       vbe_ib->signature[3] = '2';
-       
-       /* Try to get controller info block.  */
--      status = grub_vbe_get_controller_info (vbe_ib);
-+      status = grub_vbe_bios_get_controller_info (vbe_ib);
-       if (status == 0x004F)
-       {
-         /* Copy it for later usage.  */
-@@ -128,11 +147,13 @@
-   grub_uint32_t old_mode;
-   
-   /* Make sure that VBE is supported.  */
--  if (grub_vbe_probe (0) != GRUB_ERR_NONE)
-+  grub_vbe_probe (0);
-+  if (grub_errno != GRUB_ERR_NONE)
-     return grub_errno;
-   /* Try to get mode info.  */
--  if (grub_vbe_get_video_mode_info (mode, &active_mode_info) != GRUB_ERR_NONE)
-+  grub_vbe_get_video_mode_info (mode, &active_mode_info);
-+  if (grub_errno != GRUB_ERR_NONE)
-     return grub_errno;
-   /* For all VESA BIOS modes, force linear frame buffer.  */
-@@ -144,12 +165,12 @@
-       /* Determine frame buffer pixel format.  */
-       switch (active_mode_info.memory_model)
-       {
--      case 0x04:
--        index_color_mode = 1;
-+      case GRUB_VBE_MEMORY_MODEL_PACKED_PIXEL:
-+        framebuffer.index_color_mode = 1;
-         break;
-         
--      case 0x06:
--        index_color_mode = 0;
-+      case GRUB_VBE_MEMORY_MODEL_DIRECT_COLOR:
-+        framebuffer.index_color_mode = 0;
-         break;
-         
-       default:
-@@ -160,51 +181,68 @@
-     }
-   /* Get current mode.  */
--  if (grub_vbe_get_video_mode (&old_mode) != GRUB_ERR_NONE)
-+  grub_vbe_get_video_mode (&old_mode);
-+  if (grub_errno != GRUB_ERR_NONE)
-     return grub_errno;
-   
-   /* Try to set video mode.  */
--  status = grub_vbe_set_mode (mode, 0);
--  if (status != 0x004F)
-+  status = grub_vbe_bios_set_mode (mode, 0);
-+  if (status != GRUB_VBE_STATUS_OK)
-     return grub_error (GRUB_ERR_BAD_DEVICE, "cannot set VBE mode %x", mode);
-   /* Save information for later usage.  */
--  active_mode = mode;
-+  framebuffer.active_mode = mode;
-   if (mode < 0x100)
-     {
-       /* If this is not a VESA mode, guess address.  */
--      framebuffer = (grub_uint8_t *) 0xA0000;
--      index_color_mode = 1;
-+      framebuffer.ptr = (grub_uint8_t *) 0xA0000;
-+      framebuffer.index_color_mode = 1;
-     }
-   else
-     {
--      framebuffer = (grub_uint8_t *) active_mode_info.phys_base_addr;
-+      framebuffer.ptr = (grub_uint8_t *) active_mode_info.phys_base_addr;
-       if (controller_info.version >= 0x300)
--      bytes_per_scan_line = active_mode_info.lin_bytes_per_scan_line;
-+      framebuffer.bytes_per_scan_line = active_mode_info.lin_bytes_per_scan_line;
-       else
--      bytes_per_scan_line = active_mode_info.bytes_per_scan_line;
-+      framebuffer.bytes_per_scan_line = active_mode_info.bytes_per_scan_line;
-+    }
-+    
-+  /* Calculate bytes_per_pixel value.  */
-+  switch(active_mode_info.bits_per_pixel)
-+    {
-+    case 32: framebuffer.bytes_per_pixel = 4; break;
-+    case 24: framebuffer.bytes_per_pixel = 3; break;
-+    case 16: framebuffer.bytes_per_pixel = 2; break;
-+    case 15: framebuffer.bytes_per_pixel = 2; break;
-+    case 8: framebuffer.bytes_per_pixel = 1; break;
-+    default:    
-+      grub_vbe_bios_set_mode (old_mode, 0);
-+      return grub_error (GRUB_ERR_BAD_DEVICE, 
-+                         "cannot set VBE mode %x", 
-+                         mode);
-+      break;
-     }
-   /* If video mode is in indexed color, setup default VGA palette.  */
--  if (index_color_mode)
-+  if (framebuffer.index_color_mode)
-     {
-       struct grub_vbe_palette_data *palette
-       = (struct grub_vbe_palette_data *) GRUB_MEMORY_MACHINE_SCRATCH_ADDR;
-       /* Make sure that the BIOS can reach the palette.  */
-       grub_memcpy (palette, vga_colors, sizeof (vga_colors));
--      status = grub_vbe_set_palette_data (sizeof (vga_colors) 
--                                          / sizeof (struct grub_vbe_palette_data), 
--                                          0, 
--                                          palette);
-+      status = grub_vbe_bios_set_palette_data (sizeof (vga_colors) 
-+                                               / sizeof (struct grub_vbe_palette_data), 
-+                                               0, 
-+                                               palette);
--      /* For now, ignore the status. Not sure if this is fatal.  */
-+      /* For now, ignore the status.  Not sure if this is fatal.  */
- #if 0
--      if (status != 0x004F)
-+      if (status != GRUB_VBE_STATUS_OK)
-       {
--        grub_vbe_set_mode (old_mode, 0);
-+        grub_vbe_bios_set_mode (old_mode, 0);
-         return grub_error (GRUB_ERR_BAD_DEVICE,
-                            "cannot set the default VGA palette");
-       }
-@@ -224,12 +262,13 @@
-   grub_vbe_status_t status;
-   /* Make sure that VBE is supported.  */
--  if (grub_vbe_probe (0) != GRUB_ERR_NONE)
-+  grub_vbe_probe (0);
-+  if (grub_errno != GRUB_ERR_NONE)
-     return grub_errno;
-   /* Try to query current mode from VESA BIOS.  */
--  status = grub_vbe_get_mode (mode);
--  if (status != 0x004F)
-+  status = grub_vbe_bios_get_mode (mode);
-+  if (status != GRUB_VBE_STATUS_OK)
-     return grub_error (GRUB_ERR_BAD_DEVICE, "cannot get current VBE mode");
-   return GRUB_ERR_NONE;
-@@ -244,15 +283,16 @@
-   grub_vbe_status_t status;
-   /* Make sure that VBE is supported.  */
--  if (grub_vbe_probe (0) != GRUB_ERR_NONE)
-+  grub_vbe_probe (0);
-+  if (grub_errno != GRUB_ERR_NONE)
-     return grub_errno;
-   /* If mode is not VESA mode, skip mode info query.  */
-   if (mode >= 0x100)
-     {
-       /* Try to get mode info from VESA BIOS.  */
--      status = grub_vbe_get_mode_info (mode, mi_tmp);
--      if (status != 0x004F)
-+      status = grub_vbe_bios_get_mode_info (mode, mi_tmp);
-+      if (status != GRUB_VBE_STATUS_OK)
-       return grub_error (GRUB_ERR_BAD_DEVICE,
-                          "cannot get information on the mode %x", mode);
-@@ -266,60 +306,72 @@
-   return GRUB_ERR_NONE;
- }
--void
--grub_vbe_set_pixel_rgb (grub_uint32_t x,
--                      grub_uint32_t y,
--                        grub_uint8_t red,
--                        grub_uint8_t green,
--                        grub_uint8_t blue)
-+grub_uint8_t *
-+grub_video_vbe_get_video_ptr (struct grub_video_render_target *source,
-+                              grub_uint32_t x, grub_uint32_t y)
- {
--  grub_uint32_t value;
-+  grub_uint8_t *ptr = 0;
-+  
-+  switch (source->mode_info.bpp)
-+    {
-+    case 32:
-+      ptr = (grub_uint8_t *)source->data
-+            + y * source->mode_info.pitch
-+            + x * 4;
-+      break;
--  if (x >= active_mode_info.x_resolution)
--    return;
-+    case 24:
-+      ptr = (grub_uint8_t *)source->data
-+            + y * source->mode_info.pitch
-+            + x * 3;
-+      break;
--  if (y >= active_mode_info.y_resolution)
--    return;
-+    case 16:
-+    case 15:
-+      ptr = (grub_uint8_t *)source->data
-+            + y * source->mode_info.pitch
-+            + x * 2;
-+      break;
--  if (controller_info.version >= 0x300)
--    {
--      red >>= 8 - active_mode_info.lin_red_mask_size;
--      green >>= 8 - active_mode_info.lin_green_mask_size;
--      blue >>= 8 - active_mode_info.lin_blue_mask_size;
--
--      value = red << active_mode_info.lin_red_field_position;
--      value |= green << active_mode_info.lin_green_field_position;
--      value |= blue << active_mode_info.lin_blue_field_position;
-+    case 8:
-+      ptr = (grub_uint8_t *)source->data
-+            + y * source->mode_info.pitch
-+            + x;        
-+      break;
-     }
--  else
--    {
--      red >>= 8 - active_mode_info.red_mask_size;
--      green >>= 8 - active_mode_info.green_mask_size;
--      blue >>= 8 - active_mode_info.blue_mask_size;
-+    
-+  return ptr;
-+}
--      value = red << active_mode_info.red_field_position;
--      value |= green << active_mode_info.green_field_position;
--      value |= blue << active_mode_info.blue_field_position;
--    }
-+static void
-+grub_video_vbe_draw_pixel (grub_uint32_t x, grub_uint32_t y,
-+                           grub_video_color_t color)
-+{
-+  if (x >= render_target->mode_info.width)
-+    return;
--  switch (active_mode_info.bits_per_pixel)
-+  if (y >= render_target->mode_info.height)
-+    return;
-+
-+  switch (render_target->mode_info.bpp)
-     {
-     case 32:
-       {
--      grub_uint32_t *ptr = (grub_uint32_t *) (framebuffer
--                                              + y * bytes_per_scan_line
--                                              + x * 4);
-+      grub_uint32_t *ptr;
-+      
-+        ptr = (grub_uint32_t *)grub_video_vbe_get_video_ptr (render_target,
-+                                                             x, y);
-       
--      *ptr = value;
-+      *ptr = color;
-       }
-       break;
-       
-     case 24:
-       {
--      grub_uint8_t *ptr = (grub_uint8_t *) (framebuffer
--                                            + y * bytes_per_scan_line
--                                            + x * 3);
--      grub_uint8_t *ptr2 = (grub_uint8_t *) &value;
-+      grub_uint8_t *ptr;
-+      grub_uint8_t *ptr2 = (grub_uint8_t *) &color;
-+        
-+        ptr = grub_video_vbe_get_video_ptr (render_target, x, y);
-       
-       ptr[0] = ptr2[0];
-       ptr[1] = ptr2[1];
-@@ -330,11 +382,23 @@
-     case 16:
-     case 15:
-       {
--      grub_uint16_t *ptr = (grub_uint16_t *) (framebuffer
--                                              + y * bytes_per_scan_line
--                                              + x * 2);
-+      grub_uint16_t *ptr;
-       
--      *ptr = (grub_uint16_t) (value & 0xFFFF);
-+        ptr = (grub_uint16_t *)grub_video_vbe_get_video_ptr (render_target,
-+                                                             x, y);
-+      
-+      *ptr = (grub_uint16_t) (color & 0xFFFF);
-+      }
-+      break;
-+
-+    case 8:
-+      {
-+      grub_uint8_t *ptr;
-+      
-+        ptr = (grub_uint8_t *)grub_video_vbe_get_video_ptr (render_target,
-+                                                            x, y);
-+      
-+      *ptr = (grub_uint8_t) (color & 0xFF);
-       }
-       break;
-@@ -343,44 +407,1160 @@
-     }
- }
--void
--grub_vbe_set_pixel_index (grub_uint32_t x,
--                          grub_uint32_t y,
--                          grub_uint8_t color)
-+static grub_video_color_t
-+grub_video_vbe_get_pixel (struct grub_video_render_target *source,
-+                          grub_uint32_t x, grub_uint32_t y)
- {
--  if (x >= active_mode_info.x_resolution)
--    return;
-+  grub_video_color_t color = 0;
-+  
-+  if (x >= source->mode_info.width)
-+    return 0;
--  if (y >= active_mode_info.y_resolution)
--    return;
-+  if (y >= source->mode_info.height)
-+    return 0;
--  if (index_color_mode == 1)
-+  switch (source->mode_info.bpp)
-     {
--      grub_uint8_t *ptr = (grub_uint8_t *) (framebuffer
--                                          + y * bytes_per_scan_line
--                                          + x);
-+    case 32:
-+      color = *(grub_uint32_t *)grub_video_vbe_get_video_ptr (source, x, y);
-+      break;
-+      
-+    case 24:
-+      {
-+      grub_uint8_t *ptr;
-+        ptr = grub_video_vbe_get_video_ptr (source, x, y);
-+        color = ptr[0] | (ptr[1] << 8) | (ptr[2] << 16);
-+      }
-+      break;
--      *ptr = color;
-+    case 16:
-+    case 15:
-+      color = *(grub_uint16_t *)grub_video_vbe_get_video_ptr (source, x, y);
-+      break;
-+      
-+    case 8:
-+      color = *(grub_uint8_t *)grub_video_vbe_get_video_ptr (source, x, y);
-+      break;
-+      
-+    default:
-+      break;
-+    }
-+
-+  return color;    
-+}
-+
-+static grub_err_t
-+grub_video_vbe_init (void)
-+{
-+  grub_uint16_t *rm_mode_list;
-+  grub_uint16_t *p;
-+  grub_size_t mode_list_size;
-+  struct grub_vbe_info_block info_block;
-+
-+  /* Check if there is adapter present.
-+  
-+     Firmware note: There has been a report that some cards store video mode
-+     list in temporary memory.  So we must first use vbe probe to get
-+     refreshed information to receive valid pointers and data, and then
-+     copy this information to somewhere safe.  */
-+  grub_vbe_probe (&info_block);
-+  if (grub_errno != GRUB_ERR_NONE)
-+    return grub_errno;
-+  
-+  /* Copy modelist to local memory.  */
-+  p = rm_mode_list = real2pm (info_block.video_mode_ptr);
-+  while(*p++ != 0xFFFF)
-+    ;
-+  
-+  mode_list_size = (grub_addr_t) p - (grub_addr_t) rm_mode_list;
-+  mode_list = grub_malloc (mode_list_size);
-+  if (! mode_list)
-+    return grub_errno;
-+  grub_memcpy (mode_list, rm_mode_list, mode_list_size);
-+
-+  /* Adapter could be found, figure out initial video mode.  */
-+  grub_vbe_get_video_mode (&initial_mode);
-+  if (grub_errno != GRUB_ERR_NONE)
-+    {
-+      /* Free allocated resources.  */
-+      grub_free (mode_list);
-+      mode_list = 0;
-+      
-+      return grub_errno;
-+    }
-+
-+  /* Reset frame buffer and render target variables.  */
-+  grub_memset (&framebuffer, 0, sizeof(framebuffer));  
-+  render_target = &framebuffer.render_target;
-+
-+  return GRUB_ERR_NONE;
-+}
-+
-+static grub_err_t
-+grub_video_vbe_fini (void)
-+{
-+  grub_vbe_status_t status;
-+  
-+  /* Restore old video mode.  */
-+  status = grub_vbe_bios_set_mode (initial_mode, 0);
-+  if (status != GRUB_VBE_STATUS_OK)
-+    /* TODO: Decide, is this something we want to do.  */
-+    return grub_errno;
-+  
-+  /* TODO: Free any resources allocated by driver.  */
-+  grub_free (mode_list);
-+  mode_list = 0;
-+
-+  /* TODO: destroy render targets.  */
-+  
-+  /* Return success to caller.  */
-+  return GRUB_ERR_NONE;
-+}
-+
-+static grub_err_t
-+grub_video_vbe_setup (unsigned int width, unsigned int height,
-+                      unsigned int mode_type)
-+{
-+  grub_uint16_t *p;
-+  struct grub_vbe_mode_info_block mode_info;
-+  struct grub_vbe_mode_info_block best_mode_info;
-+  grub_uint32_t best_mode = 0;
-+  int depth;
-+  unsigned int i;
-+  
-+  /* Decode depth from mode_type.  If it is zero, then autodetect.  */
-+  depth = (mode_type & GRUB_VIDEO_MODE_TYPE_DEPTH_MASK) 
-+          >> GRUB_VIDEO_MODE_TYPE_DEPTH_POS;
-+  
-+  /* Walk thru mode list and try to find matching mode.  */
-+  for (p = mode_list; *p != 0xFFFF; p++)
-+    {
-+      grub_uint32_t mode = *p;
-+      
-+      grub_vbe_get_video_mode_info (mode, &mode_info);
-+      if (grub_errno != GRUB_ERR_NONE)
-+        {
-+          /* Could not retrieve mode info, retreat.  */
-+          grub_errno = GRUB_ERR_NONE;
-+          break;
-+        }
-+
-+      if ((mode_info.mode_attributes & 0x001) == 0)
-+        /* If not available, skip it.  */
-+        continue;
-+
-+      if ((mode_info.mode_attributes & 0x002) == 0)
-+        /* Not enough information.  */
-+        continue;
-+
-+      if ((mode_info.mode_attributes & 0x008) == 0)
-+        /* Monochrome is unusable.  */
-+        continue;
-+
-+      if ((mode_info.mode_attributes & 0x080) == 0)
-+        /* We support only linear frame buffer modes.  */
-+        continue;
-+
-+      if ((mode_info.mode_attributes & 0x010) == 0)
-+        /* We allow only graphical modes.  */
-+        continue;
-+      
-+      if ((mode_info.memory_model != GRUB_VBE_MEMORY_MODEL_PACKED_PIXEL)
-+          && (mode_info.memory_model != GRUB_VBE_MEMORY_MODEL_DIRECT_COLOR))
-+        /* Not compatible memory model.  */
-+        continue;
-+      
-+      if ((mode_info.x_resolution != width)
-+          || (mode_info.y_resolution != height))
-+        /* Non matching resolution.  */
-+        continue;
-+
-+      /* Check if user requested RGB or index color mode.  */
-+      if ((mode_type & GRUB_VIDEO_MODE_TYPE_COLOR_MASK) != 0)
-+        {
-+          if (((mode_type & GRUB_VIDEO_MODE_TYPE_INDEX_COLOR) != 0)
-+              && (mode_info.memory_model != GRUB_VBE_MEMORY_MODEL_PACKED_PIXEL))
-+            /* Requested only index color modes.  */
-+            continue;
-+
-+          if (((mode_type & GRUB_VIDEO_MODE_TYPE_RGB) != 0)
-+              && (mode_info.memory_model != GRUB_VBE_MEMORY_MODEL_DIRECT_COLOR))
-+            /* Requested only RGB modes.  */
-+            continue;
-+        }
-+      
-+      /* If there is a request for specific depth, ignore others.  */
-+      if ((depth != 0) && (mode_info.bits_per_pixel != depth))
-+        continue;
-+      
-+      /* Select mode with most number of bits per pixel.  */
-+      if (best_mode != 0)
-+        if (mode_info.bits_per_pixel < best_mode_info.bits_per_pixel)
-+          continue;
-+      
-+      /* Save so far best mode information for later use.  */
-+      best_mode = mode;
-+      grub_memcpy (&best_mode_info, &mode_info, sizeof (mode_info));
-+    }
-+
-+  /* Try to initialize best mode found.  */
-+  if (best_mode != 0)
-+    {
-+      /* If this fails, then we have mode selection heuristics problem, 
-+         or adapter failure.  */
-+      grub_vbe_set_video_mode (best_mode, &active_mode_info);
-+      if (grub_errno != GRUB_ERR_NONE)
-+        return grub_errno;
-+      
-+      /* Now we are happily in requested video mode.  Cache some info
-+         in order to fasten later operations.  */
-+      mode_in_use = best_mode;
-+
-+      /* Reset render target to framebuffer one.  */
-+      render_target = &framebuffer.render_target;
-+      
-+      /* Fill mode info details in framebuffer's render target.  */
-+      render_target->mode_info.width = active_mode_info.x_resolution;
-+      render_target->mode_info.height = active_mode_info.y_resolution;
-+
-+      if (framebuffer.index_color_mode)
-+        render_target->mode_info.mode_type = GRUB_VIDEO_MODE_TYPE_INDEX_COLOR;
-+      else
-+        render_target->mode_info.mode_type = GRUB_VIDEO_MODE_TYPE_RGB;
-+
-+      render_target->mode_info.bpp = active_mode_info.bits_per_pixel;
-+      render_target->mode_info.bytes_per_pixel = framebuffer.bytes_per_pixel;
-+      render_target->mode_info.pitch = framebuffer.bytes_per_scan_line;
-+      render_target->mode_info.number_of_colors = 256; /* TODO: fix me.  */
-+      render_target->mode_info.red_mask_size = active_mode_info.red_mask_size;
-+      render_target->mode_info.red_field_pos = active_mode_info.red_field_position;
-+      render_target->mode_info.green_mask_size = active_mode_info.green_mask_size;
-+      render_target->mode_info.green_field_pos = active_mode_info.green_field_position;
-+      render_target->mode_info.blue_mask_size = active_mode_info.blue_mask_size;
-+      render_target->mode_info.blue_field_pos = active_mode_info.blue_field_position;
-+      render_target->mode_info.reserved_mask_size = active_mode_info.rsvd_mask_size;
-+      render_target->mode_info.reserved_field_pos = active_mode_info.rsvd_field_position;
-+
-+      render_target->mode_info.blit_format = grub_video_get_blit_format (&render_target->mode_info);
-+     
-+      /* Reset viewport to match new mode.  */
-+      render_target->viewport.x = 0;
-+      render_target->viewport.y = 0;
-+      render_target->viewport.width = active_mode_info.x_resolution;
-+      render_target->viewport.height = active_mode_info.y_resolution;
-+
-+      /* Set framebuffer pointer and mark it as non allocated.  */
-+      render_target->is_allocated = 0;
-+      render_target->data = framebuffer.ptr;
-+
-+      /* Copy default palette to initialize emulated palette.  */
-+      for (i = 0; 
-+           i < (sizeof (vga_colors) 
-+                / sizeof (struct grub_vbe_palette_data));
-+           i++)
-+        {
-+          framebuffer.palette[i].r = vga_colors[i].red;
-+          framebuffer.palette[i].g = vga_colors[i].green;
-+          framebuffer.palette[i].b = vga_colors[i].blue;
-+          framebuffer.palette[i].a = 0xFF;
-+        }
-+
-+      return GRUB_ERR_NONE;
-+    }
-+
-+  /* Couldn't found matching mode.  */
-+  return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "no matching mode found.");
-+}
-+
-+static grub_err_t
-+grub_video_vbe_get_info (struct grub_video_mode_info *mode_info)
-+{
-+  /* Copy mode info from active render target.  */
-+  grub_memcpy (mode_info, &render_target->mode_info, 
-+               sizeof (struct grub_video_mode_info));
-+  
-+  return GRUB_ERR_NONE;
-+}
-+
-+static grub_err_t
-+grub_video_vbe_set_palette (unsigned int start, unsigned int count,
-+                            struct grub_video_palette_data *palette_data)
-+{
-+  unsigned int i;
-+  
-+  if (framebuffer.index_color_mode)
-+    {
-+      /* TODO: Implement setting indexed color mode palette to hardware.  */
-+      //status = grub_vbe_bios_set_palette_data (sizeof (vga_colors) 
-+      //                                         / sizeof (struct grub_vbe_palette_data), 
-+      //                                         0, 
-+      //                                         palette);
-+      
-+    }
-+
-+  /* Then set color to emulated palette.  */
-+  for (i = 0; (i < count) && ((i + start) < 256); i++)
-+    framebuffer.palette[start + i] = palette_data[i];
-+
-+  return GRUB_ERR_NONE;
-+}
-+
-+static grub_err_t
-+grub_video_vbe_get_palette (unsigned int start, unsigned int count,
-+                            struct grub_video_palette_data *palette_data)
-+{
-+  unsigned int i;
-+
-+  /* Assume that we know everything from index color palette.  */
-+  for (i = 0; (i < count) && ((i + start) < 256); i++)
-+    palette_data[i] = framebuffer.palette[start + i];
-+
-+  return GRUB_ERR_NONE;
-+}
-+
-+static grub_err_t
-+grub_video_vbe_set_viewport (unsigned int x, unsigned int y,
-+                             unsigned int width, unsigned int height)
-+{
-+  /* Make sure viewport is withing screen dimensions.  If viewport was set
-+     to be out of the reqion, mark its size as zero.  */
-+  if (x > active_mode_info.x_resolution)
-+    {
-+      x = 0;
-+      width = 0;
-+    }
-+  
-+  if (y > active_mode_info.y_resolution)
-+    {
-+      y = 0;
-+      height = 0;
-+    }
-+    
-+  if (x + width > active_mode_info.x_resolution)
-+    width = active_mode_info.x_resolution - x;
-+
-+  if (y + height > active_mode_info.y_resolution)
-+    height = active_mode_info.y_resolution - y;
-+
-+  render_target->viewport.x = x;
-+  render_target->viewport.y = y;
-+  render_target->viewport.width = width;
-+  render_target->viewport.height = height;
-+  
-+  return GRUB_ERR_NONE;
-+}
-+
-+static grub_err_t
-+grub_video_vbe_get_viewport (unsigned int *x, unsigned int *y,
-+                             unsigned int *width, unsigned int *height)
-+{
-+  if (x) *x = render_target->viewport.x;
-+  if (y) *y = render_target->viewport.y;
-+  if (width) *width = render_target->viewport.width;
-+  if (height) *height = render_target->viewport.height;
-+  
-+  return GRUB_ERR_NONE;
-+}
-+
-+static grub_video_color_t
-+grub_video_vbe_map_color (grub_uint32_t color_name)
-+{
-+  /* TODO: implement color theme mapping code.  */
-+  
-+  if (color_name < 256)
-+    {
-+      if ((render_target->mode_info.mode_type
-+           & GRUB_VIDEO_MODE_TYPE_INDEX_COLOR) != 0)
-+        return color_name;
-+      else
-+        {
-+          grub_video_color_t color;
-+          
-+          color = grub_video_vbe_map_rgb (framebuffer.palette[color_name].r,
-+                                          framebuffer.palette[color_name].g,
-+                                          framebuffer.palette[color_name].b);
-+          
-+          return color;
-+        }
-+    }
-+    
-+  return 0;
-+}
-+
-+grub_video_color_t
-+grub_video_vbe_map_rgb (grub_uint8_t red, grub_uint8_t green,
-+                        grub_uint8_t blue)
-+{
-+  if ((render_target->mode_info.mode_type 
-+       & GRUB_VIDEO_MODE_TYPE_INDEX_COLOR) != 0)
-+    {
-+      int minindex = 0;
-+      int delta = 0;
-+      int tmp;
-+      int val;
-+      int i;
-+      
-+      /* Find best matching color.  */
-+      for (i = 0; i < 256; i++)
-+        {
-+          val = framebuffer.palette[i].r - red;
-+          tmp = val * val;
-+          val = framebuffer.palette[i].g - green;
-+          tmp += val * val;
-+          val = framebuffer.palette[i].b - blue;
-+          tmp += val * val;
-+          
-+          if (i == 0)
-+            delta = tmp;
-+          
-+          if (tmp < delta)
-+            {
-+              delta = tmp;
-+              minindex = i;
-+              if (tmp == 0)
-+                break;
-+            }
-+        }
-+      
-+      return minindex;
-     }
-   else
-     {
--      color &= 0x0F;
-+      grub_uint32_t value;
-+      grub_uint8_t alpha = 255; /* Opaque color.  */
-       
--      if (color < 16)
--      {
--        grub_vbe_set_pixel_rgb (x,
--                                  y,
--                                  vga_colors[color].red,
--                                  vga_colors[color].green,
--                                  vga_colors[color].blue);
--      }
-+      red >>= 8 - render_target->mode_info.red_mask_size;
-+      green >>= 8 - render_target->mode_info.green_mask_size;
-+      blue >>= 8 - render_target->mode_info.blue_mask_size;
-+      alpha >>= 8 - render_target->mode_info.reserved_mask_size;
-+
-+      value = red << render_target->mode_info.red_field_pos;
-+      value |= green << render_target->mode_info.green_field_pos;
-+      value |= blue << render_target->mode_info.blue_field_pos;
-+      value |= alpha << render_target->mode_info.reserved_field_pos;
-+      
-+      return value;
-+    }
-+
-+}
-+
-+static grub_video_color_t
-+grub_video_vbe_map_rgba (grub_uint8_t red, grub_uint8_t green,
-+                         grub_uint8_t blue, grub_uint8_t alpha)
-+{
-+  if ((render_target->mode_info.mode_type 
-+       & GRUB_VIDEO_MODE_TYPE_INDEX_COLOR) != 0)
-+    /* No alpha available in index color modes, just use
-+       same value as in only RGB modes.  */
-+    return grub_video_vbe_map_rgb (red, green, blue);
-+  else
-+    {
-+      grub_uint32_t value;
-+      
-+      red >>= 8 - render_target->mode_info.red_mask_size;
-+      green >>= 8 - render_target->mode_info.green_mask_size;
-+      blue >>= 8 - render_target->mode_info.blue_mask_size;
-+      alpha >>= 8 - render_target->mode_info.reserved_mask_size;
-+
-+      value = red << render_target->mode_info.red_field_pos;
-+      value |= green << render_target->mode_info.green_field_pos;
-+      value |= blue << render_target->mode_info.blue_field_pos;
-+      value |= alpha << render_target->mode_info.reserved_field_pos;
-+      
-+      return value;
-+    }
-+}
-+
-+void
-+grub_video_vbe_unmap_color (struct grub_video_render_target * source,
-+                            grub_video_color_t color,
-+                            grub_uint8_t *red, grub_uint8_t *green,
-+                            grub_uint8_t *blue, grub_uint8_t *alpha)
-+{
-+  if ((source->mode_info.mode_type 
-+       & GRUB_VIDEO_MODE_TYPE_INDEX_COLOR) != 0)
-+    {
-+      /* If we have out of bounds color, return trasnparent black.  */
-+      if (color > 255)
-+        {
-+          *red = 0;
-+          *green = 0;
-+          *blue = 0;
-+          *alpha = 0;
-+          return;
-+        }
-+        
-+      *red = framebuffer.palette[color].r;
-+      *green = framebuffer.palette[color].g;
-+      *blue = framebuffer.palette[color].b;
-+      *alpha = framebuffer.palette[color].a;
-+      return;
-+    }
-+  else
-+    {      
-+      grub_uint32_t tmp;
-+      
-+      /* Get red component.  */
-+      tmp = color >> source->mode_info.red_field_pos;
-+      tmp &= (1 << source->mode_info.red_mask_size) - 1;
-+      tmp <<= 8 - source->mode_info.red_mask_size;
-+      tmp |= (1 << (8 - source->mode_info.red_mask_size)) - 1;
-+      *red = tmp & 0xFF;
-+
-+      /* Get green component.  */
-+      tmp = color >> source->mode_info.green_field_pos;
-+      tmp &= (1 << source->mode_info.green_mask_size) - 1;
-+      tmp <<= 8 - source->mode_info.green_mask_size;
-+      tmp |= (1 << (8 - source->mode_info.green_mask_size)) - 1;
-+      *green = tmp & 0xFF;
-+
-+      /* Get blue component.  */
-+      tmp = color >> source->mode_info.blue_field_pos;
-+      tmp &= (1 << source->mode_info.blue_mask_size) - 1;
-+      tmp <<= 8 - source->mode_info.blue_mask_size;
-+      tmp |= (1 << (8 - source->mode_info.blue_mask_size)) - 1;
-+      *blue = tmp & 0xFF;
-+
-+      /* Get alpha component.  */
-+      if (source->mode_info.reserved_mask_size > 0)
-+        {
-+          tmp = color >> source->mode_info.reserved_field_pos;
-+          tmp &= (1 << source->mode_info.reserved_mask_size) - 1;
-+          tmp <<= 8 - source->mode_info.reserved_mask_size;
-+          tmp |= (1 << (8 - source->mode_info.reserved_mask_size)) - 1;
-+        }
-       else
--      {
--        grub_vbe_set_pixel_rgb (x,
--                                  y,
--                                  0,
--                                  0,
--                                  0);
--      }
-+        /* If there is no alpha component, assume it opaque.  */
-+        tmp = 255;
-+
-+      *alpha = tmp & 0xFF;
-+    }
-+}
-+
-+static grub_err_t
-+grub_video_vbe_fill_rect (grub_video_color_t color, int x, int y,
-+                          unsigned int width, unsigned int height)
-+{
-+  unsigned int i, j;
-+
-+  /* Make sure there is something to do.  */
-+  if ((x >= (int)render_target->viewport.width) || (x + (int)width < 0))
-+    return GRUB_ERR_NONE;
-+  if ((y >= (int)render_target->viewport.height) || (y + (int)height < 0))
-+    return GRUB_ERR_NONE;
-+
-+  /* Do not allow drawing out of viewport.  */
-+  if (x < 0)
-+    {
-+      width += x;
-+      x = 0;
-+    }
-+  if (y < 0)
-+    {
-+      height += y;
-+      y = 0;
-+    }
-+  
-+  if ((x + width) > render_target->viewport.width)
-+    width = render_target->viewport.width - x;
-+  if ((y + height) > render_target->viewport.height)
-+    height = render_target->viewport.height - y;
-+
-+  /* Add viewport offset.  */
-+  x += render_target->viewport.x;
-+  y += render_target->viewport.y;
-+
-+  /* Try to figure out more optimized version.  */
-+  if (render_target->mode_info.blit_format == GRUB_VIDEO_BLIT_FORMAT_R8G8B8A8)
-+    {
-+      grub_video_i386_vbefill_R8G8B8A8 (render_target, color, x, y, 
-+                                        width, height);
-+      return GRUB_ERR_NONE;
-+    }
-+
-+  if (render_target->mode_info.blit_format == GRUB_VIDEO_BLIT_FORMAT_R8G8B8)
-+    {
-+      grub_video_i386_vbefill_R8G8B8 (render_target, color, x, y,
-+                                      width, height);
-+      return GRUB_ERR_NONE;
-+    }
-+    
-+  if (render_target->mode_info.blit_format == GRUB_VIDEO_BLIT_FORMAT_INDEXCOLOR)
-+    {
-+      grub_video_i386_vbefill_index (render_target, color, x, y,
-+                                     width, height);
-+      return GRUB_ERR_NONE;
-+    }
-+  
-+  /* Use backup method to fill area.  */
-+  for (j = 0; j < height; j++)
-+    for (i = 0; i < width; i++)
-+      grub_video_vbe_draw_pixel (x+i, y+j, color);
-+  
-+  return GRUB_ERR_NONE;
-+}
-+
-+static grub_err_t
-+grub_video_vbe_blit_glyph (struct grub_font_glyph * glyph,
-+                           grub_video_color_t color, int x, int y)
-+{
-+  unsigned int width;
-+  unsigned int charwidth;
-+  unsigned int height;
-+  unsigned int i;
-+  unsigned int j;
-+  unsigned int x_offset = 0;
-+  unsigned int y_offset = 0;
-+  
-+  /* Make sure there is something to do.  */
-+  if (x >= (int)render_target->viewport.width)
-+    return GRUB_ERR_NONE;
-+    
-+  if (y >= (int)render_target->viewport.height)
-+    return GRUB_ERR_NONE;
-+
-+  /* Calculate glyph dimensions.  */
-+  width = ((glyph->width + 7) / 8) * 8;
-+  charwidth = width;
-+  height = glyph->height;
-+  
-+  if (x + (int)width < 0)
-+    return GRUB_ERR_NONE;
-+    
-+  if (y + (int)height < 0)
-+    return GRUB_ERR_NONE;
-+
-+  /* Do not allow drawing out of viewport.  */
-+  if (x < 0)
-+    {
-+      width += x;
-+      x_offset = (unsigned int)-x;
-+      x = 0;
-+    }
-+  if (y < 0)
-+    {
-+      height += y;
-+      y_offset = (unsigned int)-y;
-+      y = 0;
-+    }
-+  
-+  if ((x + width) > render_target->viewport.width)
-+    width = render_target->viewport.width - x;
-+  if ((y + height) > render_target->viewport.height)
-+    height = render_target->viewport.height - y;
-+
-+  /* Add viewport offset.  */
-+  x += render_target->viewport.x;
-+  y += render_target->viewport.y;
-+  
-+  /* Draw glyph.  */
-+  for (j = 0; j < height; j++)
-+    for (i = 0; i < width; i++)
-+      if ((glyph->bitmap[((i + x_offset) / 8) 
-+                         + (j + y_offset) * (charwidth / 8)] 
-+           & (1 << ((charwidth - (i + x_offset) - 1) % 8))))
-+        grub_video_vbe_draw_pixel (x+i, y+j, color);
-+
-+  return GRUB_ERR_NONE;
-+}
-+
-+static grub_err_t
-+grub_video_vbe_blit_bitmap (struct grub_video_bitmap * bitmap,
-+                            int x, int y, int offset_x, int offset_y,
-+                            unsigned int width, unsigned int height)
-+{
-+  /* Make sure there is something to do.  */
-+  if ((x >= (int)render_target->viewport.width) || (x + (int)width < 0))
-+    return GRUB_ERR_NONE;
-+  if ((y >= (int)render_target->viewport.height) || (y + (int)height < 0))
-+    return GRUB_ERR_NONE;
-+
-+  /* Do not allow drawing out of viewport.  */
-+  if (offset_x < 0)
-+    {
-+      width += offset_x;
-+      x -= offset_x;
-+      offset_x = 0;
-+    }
-+    
-+  if (offset_y < 0)
-+    {
-+      height += offset_y;
-+      y -= offset_y;
-+      offset_y = 0;
-+    }
-+
-+  if (x < 0)
-+    {
-+      width += x;
-+      offset_x += (unsigned int)-x;
-+      x = 0;
-+    }
-+  if (y < 0)
-+    {
-+      height += y;
-+      offset_y += (unsigned int)-y;
-+      y = 0;
-+    }
-+  
-+  if ((x + width) > render_target->viewport.width)
-+    width = render_target->viewport.width - x;
-+  if ((y + height) > render_target->viewport.height)
-+    height = render_target->viewport.height - y;
-+
-+  /* TODO: Limit drawing to bitmap dimensions.  */
-+
-+  /* Add viewport offset.  */
-+  x += render_target->viewport.x;
-+  y += render_target->viewport.y;
-+
-+  /* TODO: Render bitmap.  */
-+
-+  return GRUB_ERR_NONE;
-+}
-+
-+static grub_err_t
-+grub_video_vbe_blit_render_target (struct grub_video_render_target *source,
-+                                   int x, int y, int offset_x, int offset_y,
-+                                   unsigned int width, unsigned int height)
-+{
-+  unsigned int i;
-+  unsigned int j;
-+
-+  /* Make sure there is something to do.  */
-+  if ((width == 0) || (height == 0))
-+    return GRUB_ERR_NONE;
-+  if ((x >= (int)render_target->viewport.width) || (x + (int)width < 0))
-+    return GRUB_ERR_NONE;
-+  if ((y >= (int)render_target->viewport.height) || (y + (int)height < 0))
-+    return GRUB_ERR_NONE;    
-+  if ((x + (int)source->mode_info.width) < 0)
-+    return GRUB_ERR_NONE;
-+  if ((y + (int)source->mode_info.height) < 0)
-+    return GRUB_ERR_NONE;    
-+  if ((offset_x >= (int)source->mode_info.width) 
-+      || (offset_x + (int)width < 0))
-+    return GRUB_ERR_NONE;
-+  if ((offset_y >= (int)source->mode_info.height) 
-+      || (offset_y + (int)height < 0))
-+    return GRUB_ERR_NONE;    
-+
-+  /* If we have negative coordinates, optimize drawing to minimum.  */
-+  if (offset_x < 0)
-+    {
-+      width += offset_x;
-+      x -= offset_x;
-+      offset_x = 0;
-+    }
-+    
-+  if (offset_y < 0)
-+    {
-+      height += offset_y;
-+      y -= offset_y;
-+      offset_y = 0;
-+    }
-+    
-+  if (x < 0)
-+    {
-+      width += x;
-+      offset_x += (unsigned int)-x;
-+      x = 0;
-+    }
-+    
-+  if (y < 0)
-+    {
-+      height += y;
-+      offset_y += (unsigned int)-y;
-+      y = 0;
-+    }
-+  
-+  /* Do not allow drawing out of viewport.  */
-+  if ((x + width) > render_target->viewport.width)
-+    width = render_target->viewport.width - x;
-+  if ((y + height) > render_target->viewport.height)
-+    height = render_target->viewport.height - y;
-+  
-+  if ((offset_x + width) > source->mode_info.width)
-+    width = source->mode_info.width - offset_x;
-+  if ((offset_y + height) > source->mode_info.height)
-+    height = source->mode_info.height - offset_y;
-+  
-+  /* Limit drawing to source render target dimensions.  */
-+  if (width > source->mode_info.width)
-+    width = source->mode_info.width;
-+  
-+  if (height > source->mode_info.height)
-+    height = source->mode_info.height;
-+
-+  /* Add viewport offset.  */
-+  x += render_target->viewport.x;
-+  y += render_target->viewport.y;
-+
-+  /* Try to figure out more optimized version.  */
-+  if (source->mode_info.blit_format == GRUB_VIDEO_BLIT_FORMAT_R8G8B8A8)
-+    {
-+      if (render_target->mode_info.blit_format == GRUB_VIDEO_BLIT_FORMAT_R8G8B8A8)
-+        {
-+          grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8 (render_target, source,
-+                                                     x, y, width, height,
-+                                                     offset_x, offset_y);
-+          return GRUB_ERR_NONE;
-+        }
-+
-+      if (render_target->mode_info.blit_format == GRUB_VIDEO_BLIT_FORMAT_R8G8B8)
-+        {
-+          grub_video_i386_vbeblit_R8G8B8_R8G8B8A8 (render_target, source,
-+                                                   x, y, width, height,
-+                                                   offset_x, offset_y);
-+          return GRUB_ERR_NONE;
-+        }
-+
-+      if (render_target->mode_info.blit_format == GRUB_VIDEO_BLIT_FORMAT_INDEXCOLOR)
-+        {
-+          grub_video_i386_vbeblit_index_R8G8B8A8 (render_target, source,
-+                                                  x, y, width, height,
-+                                                  offset_x, offset_y);
-+          return GRUB_ERR_NONE;
-+        }
-+    }    
-+
-+  if (source->mode_info.blit_format == GRUB_VIDEO_BLIT_FORMAT_R8G8B8)
-+    {
-+      if (render_target->mode_info.blit_format == GRUB_VIDEO_BLIT_FORMAT_R8G8B8A8)
-+        {
-+          grub_video_i386_vbeblit_R8G8B8A8_R8G8B8 (render_target, source,
-+                                                   x, y, width, height,
-+                                                   offset_x, offset_y);
-+          return GRUB_ERR_NONE;
-+        }
-+
-+      if (render_target->mode_info.blit_format == GRUB_VIDEO_BLIT_FORMAT_R8G8B8)
-+        {
-+          grub_video_i386_vbeblit_R8G8B8_R8G8B8 (render_target, source,
-+                                                 x, y, width, height,
-+                                                 offset_x, offset_y);
-+          return GRUB_ERR_NONE;
-+        }
-+
-+      if (render_target->mode_info.blit_format == GRUB_VIDEO_BLIT_FORMAT_INDEXCOLOR)
-+        {
-+          grub_video_i386_vbeblit_index_R8G8B8 (render_target, source,
-+                                                x, y, width, height,
-+                                                offset_x, offset_y);
-+          return GRUB_ERR_NONE;
-+        }
-+    }    
-+
-+  if (source->mode_info.blit_format == GRUB_VIDEO_BLIT_FORMAT_INDEXCOLOR)
-+    {
-+      if (render_target->mode_info.blit_format == GRUB_VIDEO_BLIT_FORMAT_INDEXCOLOR)
-+        {
-+          grub_video_i386_vbeblit_index_index (render_target, source,
-+                                               x, y, width, height,
-+                                               offset_x, offset_y);
-+          return GRUB_ERR_NONE;
-+        }
-+    }    
-+
-+  /* Use backup method to render.  */
-+  for (j = 0; j < height; j++)
-+    {
-+      for (i = 0; i < width; i++)
-+        {              
-+          grub_uint8_t src_red;
-+          grub_uint8_t src_green;
-+          grub_uint8_t src_blue;
-+          grub_uint8_t src_alpha;
-+          grub_uint8_t dst_red;
-+          grub_uint8_t dst_green;
-+          grub_uint8_t dst_blue;
-+          grub_uint8_t dst_alpha;
-+          grub_video_color_t src_color;
-+          grub_video_color_t dst_color;
-+          
-+          src_color = grub_video_vbe_get_pixel (source, i + offset_x, j + offset_y);
-+          grub_video_vbe_unmap_color (source, src_color, &src_red, &src_green, 
-+                                      &src_blue, &src_alpha);
-+              
-+          if (src_alpha == 0)
-+            continue;
-+          
-+          if (src_alpha == 255)
-+            {
-+              dst_color = grub_video_vbe_map_rgba (src_red, src_green,
-+                                                   src_blue, src_alpha);
-+               grub_video_vbe_draw_pixel (x + i, y + j, dst_color);
-+               continue;
-+            }
-+
-+          dst_color = grub_video_vbe_get_pixel (render_target, x + i, y + j);
-+          
-+          grub_video_vbe_unmap_color (render_target,  dst_color, &dst_red, 
-+                                      &dst_green, &dst_blue, &dst_alpha);
-+          
-+          dst_red = (((src_red * src_alpha)
-+                      + (dst_red * (255 - src_alpha))) / 255);
-+          dst_green = (((src_green * src_alpha)
-+                        + (dst_green * (255 - src_alpha))) / 255);
-+          dst_blue = (((src_blue * src_alpha)
-+                       + (dst_blue * (255 - src_alpha))) / 255);
-+                    
-+          dst_alpha = src_alpha;
-+          dst_color = grub_video_vbe_map_rgba (dst_red, dst_green, dst_blue,
-+                                               dst_alpha);
-+
-+          grub_video_vbe_draw_pixel (x + i, y + j, dst_color);
-+        }
-+    }
-+
-+  return GRUB_ERR_NONE;
-+}
-+
-+static grub_err_t
-+grub_video_vbe_scroll (grub_video_color_t color, int dx, int dy)
-+{
-+  int width;
-+  int height;
-+  int src_x;
-+  int src_y;
-+  int dst_x;
-+  int dst_y;
-+  
-+  /* 1. Check if we have something to do.  */
-+  if ((dx == 0) && (dy == 0))
-+    return GRUB_ERR_NONE;
-+
-+  width = render_target->viewport.width - grub_abs (dx);
-+  height = render_target->viewport.height - grub_abs (dy);
-+  
-+  if (dx < 0)
-+    {
-+      src_x = render_target->viewport.x - dx;
-+      dst_x = render_target->viewport.x;
-     }
-+  else
-+    {
-+      src_x = render_target->viewport.x;
-+      dst_x = render_target->viewport.x + dx;
-+    }
-+
-+  if (dy < 0)
-+    {
-+      src_y = render_target->viewport.y - dy;
-+      dst_y = render_target->viewport.y;
-+    }
-+  else
-+    {
-+      src_y = render_target->viewport.y;
-+      dst_y = render_target->viewport.y + dy;
-+    }
-+
-+  /* 2. Check if there is need to copy data.  */
-+  if ((grub_abs (dx) < render_target->viewport.width) 
-+       && (grub_abs (dy) < render_target->viewport.height))
-+    {
-+      /* 3. Move data in render target.  */
-+      grub_uint8_t *src;
-+      grub_uint8_t *dst;
-+      int j;
-+            
-+      for (j = 0; j < height; j++)
-+        {
-+          dst = grub_video_vbe_get_video_ptr (render_target, dst_x, dst_y + j);
-+          src = grub_video_vbe_get_video_ptr (render_target, src_x, src_y + j);
-+          grub_memmove (dst, src,
-+                        width * render_target->mode_info.bytes_per_pixel);
-+        }
-+    }
-+  
-+  /* 4. Fill empty space with specified color.  In this implementation
-+     there might be colliding areas but at the moment there is no need
-+     to optimize this.  */
-+
-+  /* 4a. Fill top & bottom parts.  */
-+  if (dy > 0)
-+    grub_video_vbe_fill_rect (color, 0, 0, render_target->viewport.width, dy);
-+  else if (dy < 0)
-+    {
-+      if (render_target->viewport.height < grub_abs (dy))
-+        dy = -render_target->viewport.height;
-+        
-+      grub_video_vbe_fill_rect (color, 0, render_target->viewport.height + dy,
-+                                render_target->viewport.width, -dy);
-+    }
-+
-+  /* 4b. Fill left & right parts.  */
-+  if (dx > 0)
-+    grub_video_vbe_fill_rect (color, 0, 0, 
-+                              dx, render_target->viewport.height);
-+  else if (dx < 0)
-+    {
-+      if (render_target->viewport.width < grub_abs (dx))
-+        dx = -render_target->viewport.width;
-+        
-+      grub_video_vbe_fill_rect (color, render_target->viewport.width + dx, 0,
-+                                -dx, render_target->viewport.height);
-+    }
-+  
-+  return GRUB_ERR_NONE;
-+}
-+
-+static grub_err_t 
-+grub_video_vbe_swap_buffers (void)
-+{
-+  /* TODO: Implement buffer swapping.  */
-+  return GRUB_ERR_NONE;
-+}
-+
-+static grub_err_t
-+grub_video_vbe_create_render_target (struct grub_video_render_target **result,
-+                                     unsigned int width, unsigned int height,
-+                                     unsigned int mode_type)
-+{
-+  struct grub_video_render_target *target;
-+  unsigned int size;
-+  
-+  /* Validate arguments.  */
-+  if ((! result)
-+      || (width == 0)
-+      || (height == 0))
-+    return grub_error (GRUB_ERR_BAD_ARGUMENT,
-+                       "invalid argument given.");
-+  
-+  /* Allocate memory for render target.  */
-+  target = grub_malloc (sizeof (struct grub_video_render_target));
-+  if (! target)
-+    return grub_errno;
-+
-+  /* TODO: Implement other types too.
-+     Currently only 32bit render targets are supported.  */
-+  
-+  /* Mark render target as allocated.  */
-+  target->is_allocated = 1;
-+  
-+  /* Maximize viewport.  */
-+  target->viewport.x = 0;
-+  target->viewport.y = 0;
-+  target->viewport.width = width;
-+  target->viewport.height = height;
-+
-+  /* Setup render target format.  */
-+  target->mode_info.width = width;
-+  target->mode_info.height = height;
-+  target->mode_info.mode_type = GRUB_VIDEO_MODE_TYPE_RGB 
-+                                | GRUB_VIDEO_MODE_TYPE_ALPHA;
-+  target->mode_info.bpp = 32;
-+  target->mode_info.bytes_per_pixel = 4;
-+  target->mode_info.pitch = target->mode_info.bytes_per_pixel * width;
-+  target->mode_info.number_of_colors = 256; /* Emulated paletted.  */
-+  target->mode_info.red_mask_size = 8;
-+  target->mode_info.red_field_pos = 0;
-+  target->mode_info.green_mask_size = 8;
-+  target->mode_info.green_field_pos = 8;
-+  target->mode_info.blue_mask_size = 8;
-+  target->mode_info.blue_field_pos = 16;
-+  target->mode_info.reserved_mask_size = 8;
-+  target->mode_info.reserved_field_pos = 24;
-+
-+  target->mode_info.blit_format = grub_video_get_blit_format (&target->mode_info);
-+
-+  /* Calculate size needed for the data.  */
-+  size = (width * target->mode_info.bytes_per_pixel) * height;
-+  
-+  target->data = grub_malloc (size);
-+  if (! target->data)
-+    {
-+      grub_free (target);
-+      return grub_errno;
-+    }
-+  
-+  /* Clear render target with black and maximum transparency.  */
-+  grub_memset (target->data, 0, size);
-+
-+  /* TODO: Add render target to render target list.  */
-+  
-+  /* Save result to caller.  */
-+  *result = target;
-+  
-+  return GRUB_ERR_NONE;
-+}
-+
-+static grub_err_t
-+grub_video_vbe_delete_render_target (struct grub_video_render_target *target)
-+{
-+  /* If there is no target, then just return without error.  */
-+  if (! target)
-+    return GRUB_ERR_NONE;
-+    
-+  /* TODO: Delist render target fron render target list.  */
-+    
-+  /* If this is software render target, free it's memory.  */
-+  if (target->is_allocated)
-+    grub_free (target->data);
-+        
-+  /* Free render target.  */
-+  grub_free (target);
-+  
-+  return GRUB_ERR_NONE;
-+}
-+
-+static grub_err_t
-+grub_video_vbe_set_active_render_target (struct grub_video_render_target *target)
-+{
-+  if (target == GRUB_VIDEO_RENDER_TARGET_FRONT_BUFFER)
-+    {
-+      render_target = &framebuffer.render_target;
-+      
-+      return GRUB_ERR_NONE;
-+    }
-+  
-+  if (target == GRUB_VIDEO_RENDER_TARGET_BACK_BUFFER)
-+    return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, 
-+                       "double buffering not implemented yet.");
-+    
-+  if (! target->data)
-+    return grub_error (GRUB_ERR_BAD_ARGUMENT, 
-+                       "invalid render target given.");
-+  
-+  render_target = target;
-+  
-+  return GRUB_ERR_NONE;
-+}
-+
-+static struct grub_video_adapter grub_video_vbe_adapter =
-+  {
-+    .name = "VESA BIOS Extension Video Driver",
-+
-+    .init = grub_video_vbe_init,
-+    .fini = grub_video_vbe_fini,
-+    .setup = grub_video_vbe_setup,
-+    .get_info = grub_video_vbe_get_info,
-+    .set_palette = grub_video_vbe_set_palette,
-+    .get_palette = grub_video_vbe_get_palette,
-+    .set_viewport = grub_video_vbe_set_viewport,
-+    .get_viewport = grub_video_vbe_get_viewport,
-+    .map_color = grub_video_vbe_map_color,
-+    .map_rgb = grub_video_vbe_map_rgb,
-+    .map_rgba = grub_video_vbe_map_rgba,
-+    .fill_rect = grub_video_vbe_fill_rect,
-+    .blit_glyph = grub_video_vbe_blit_glyph,
-+    .blit_bitmap = grub_video_vbe_blit_bitmap,
-+    .blit_render_target = grub_video_vbe_blit_render_target,
-+    .scroll = grub_video_vbe_scroll,
-+    .swap_buffers = grub_video_vbe_swap_buffers,
-+    .create_render_target = grub_video_vbe_create_render_target,
-+    .delete_render_target = grub_video_vbe_delete_render_target,
-+    .set_active_render_target = grub_video_vbe_set_active_render_target,
-+    
-+    .next = 0  
-+  };
-+
-+GRUB_MOD_INIT(video_i386_pc_vbe)
-+{
-+  grub_video_register (&grub_video_vbe_adapter);
-+}
-+
-+GRUB_MOD_FINI(video_i386_pc_vbe)
-+{
-+  grub_video_unregister (&grub_video_vbe_adapter);
- }
-Index: video/i386/pc/vbeblit.c
-===================================================================
-RCS file: video/i386/pc/vbeblit.c
-diff -N video/i386/pc/vbeblit.c
---- /dev/null  1 Jan 1970 00:00:00 -0000
-+++ video/i386/pc/vbeblit.c    31 Mar 2006 14:26:34 -0000      1.1
-@@ -0,0 +1,369 @@
-+/*
-+ *  GRUB  --  GRand Unified Bootloader
-+ *  Copyright (C) 2006  Free Software Foundation, Inc.
-+ *
-+ *  This program is free software; you can redistribute it and/or modify
-+ *  it under the terms of the GNU General Public License as published by
-+ *  the Free Software Foundation; either version 2 of the License, or
-+ *  (at your option) any later version.
-+ *
-+ *  This program is distributed in the hope that it will be useful,
-+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+ *  GNU General Public License for more details.
-+ *
-+ *  You should have received a copy of the GNU General Public License
-+ *  along with this program; if not, write to the Free Software
-+ *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-+ */
-+
-+#include <grub/err.h>
-+#include <grub/machine/memory.h>
-+#include <grub/machine/vbe.h>
-+#include <grub/machine/vbeblit.h>
-+#include <grub/types.h>
-+#include <grub/dl.h>
-+#include <grub/misc.h>
-+#include <grub/font.h>
-+#include <grub/mm.h>
-+#include <grub/video.h>
-+
-+void
-+grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8 (struct grub_video_render_target *dst,
-+                                           struct grub_video_render_target *src,
-+                                           int x, int y, int width, int height,
-+                                           int offset_x, int offset_y)
-+{
-+  grub_uint32_t color;
-+  int i;
-+  int j;
-+  grub_uint32_t *srcptr;
-+  grub_uint32_t *dstptr;
-+  unsigned int sr;
-+  unsigned int sg;
-+  unsigned int sb;
-+  unsigned int a;
-+  unsigned int dr;
-+  unsigned int dg;
-+  unsigned int db;
-+  
-+  /* We do not need to worry about data being out of bounds
-+     as we assume that everything has been checked before.  */
-+  
-+  for (j = 0; j < height; j++)
-+    {
-+      srcptr = (grub_uint32_t *)grub_video_vbe_get_video_ptr (src, offset_x,
-+                                                              j + offset_y);
-+
-+      dstptr = (grub_uint32_t *)grub_video_vbe_get_video_ptr (dst, x, y + j);
-+
-+      for (i = 0; i < width; i++)
-+        {
-+          color = *srcptr++;
-+          
-+          a = color >> 24;
-+          
-+          if (a == 0)
-+            {
-+              dstptr++;
-+              continue;
-+            }
-+
-+          if (a == 255)
-+            {
-+              *dstptr++ = color;
-+              continue;
-+            }
-+            
-+          sr = (color >> 0) & 0xFF;
-+          sg = (color >> 8) & 0xFF;
-+          sb = (color >> 16) & 0xFF;
-+          
-+          color = *dstptr;
-+          
-+          dr = (color >> 0) & 0xFF;
-+          dg = (color >> 8) & 0xFF;
-+          db = (color >> 16) & 0xFF;
-+          
-+          dr = (dr * (255 - a) + sr * a) / 255;
-+          dg = (dg * (255 - a) + sg * a) / 255;
-+          db = (db * (255 - a) + sb * a) / 255;
-+          
-+          color = (a << 24) | (db << 16) | (dg << 8) | dr;
-+
-+          *dstptr++ = color;          
-+        }
-+    }
-+}
-+
-+void
-+grub_video_i386_vbeblit_R8G8B8_R8G8B8A8 (struct grub_video_render_target *dst,
-+                                         struct grub_video_render_target *src,
-+                                         int x, int y, int width, int height,
-+                                         int offset_x, int offset_y)
-+{
-+  grub_uint32_t color;
-+  int i;
-+  int j;
-+  grub_uint32_t *srcptr;
-+  grub_uint8_t *dstptr;
-+  unsigned int sr;
-+  unsigned int sg;
-+  unsigned int sb;
-+  unsigned int a;
-+  unsigned int dr;
-+  unsigned int dg;
-+  unsigned int db;
-+  
-+  /* We do not need to worry about data being out of bounds
-+     as we assume that everything has been checked before.  */
-+  
-+  for (j = 0; j < height; j++)
-+    {
-+      srcptr = (grub_uint32_t *)grub_video_vbe_get_video_ptr (src, offset_x,
-+                                                              j + offset_y);
-+
-+      dstptr = (grub_uint8_t *)grub_video_vbe_get_video_ptr (dst, x, y + j);
-+
-+      for (i = 0; i < width; i++)
-+        {
-+          color = *srcptr++;
-+          
-+          a = color >> 24;
-+          
-+          if (a == 0)
-+            {
-+              dstptr += 3;
-+              continue;
-+            }
-+
-+          sr = (color >> 0) & 0xFF;
-+          sg = (color >> 8) & 0xFF;
-+          sb = (color >> 16) & 0xFF;
-+
-+          if (a == 255)
-+            {
-+              *dstptr++ = sr;
-+              *dstptr++ = sg;
-+              *dstptr++ = sb;
-+              
-+              continue;
-+            }
-+            
-+          dr = dstptr[0];
-+          dg = dstptr[1];
-+          db = dstptr[2];
-+          
-+          dr = (dr * (255 - a) + sr * a) / 255;
-+          dg = (dg * (255 - a) + sg * a) / 255;
-+          db = (db * (255 - a) + sb * a) / 255;
-+          
-+          *dstptr++ = dr;
-+          *dstptr++ = dg;
-+          *dstptr++ = db;
-+        }
-+    }
-+}
-+
-+void
-+grub_video_i386_vbeblit_index_R8G8B8A8 (struct grub_video_render_target *dst,
-+                                        struct grub_video_render_target *src,
-+                                        int x, int y, int width, int height,
-+                                        int offset_x, int offset_y)
-+{
-+  grub_uint32_t color;
-+  int i;
-+  int j;
-+  grub_uint32_t *srcptr;
-+  grub_uint8_t *dstptr;
-+  unsigned int sr;
-+  unsigned int sg;
-+  unsigned int sb;
-+  unsigned int a;
-+  unsigned char dr;
-+  unsigned char dg;
-+  unsigned char db;
-+  unsigned char da;
-+  
-+  /* We do not need to worry about data being out of bounds
-+     as we assume that everything has been checked before.  */
-+  
-+  for (j = 0; j < height; j++)
-+    {
-+      srcptr = (grub_uint32_t *)grub_video_vbe_get_video_ptr (src, offset_x,
-+                                                              j + offset_y);
-+
-+      dstptr = (grub_uint8_t *)grub_video_vbe_get_video_ptr (dst, x, y + j);
-+
-+      for (i = 0; i < width; i++)
-+        {
-+          color = *srcptr++;
-+          
-+          a = color >> 24;
-+          
-+          if (a == 0)
-+            {
-+              dstptr++;
-+              continue;
-+            }
-+
-+          sr = (color >> 0) & 0xFF;
-+          sg = (color >> 8) & 0xFF;
-+          sb = (color >> 16) & 0xFF;
-+          
-+          if (a == 255)
-+            {
-+              color = grub_video_vbe_map_rgb(sr, sg, sb);
-+              *dstptr++ = color & 0xFF;              
-+              continue;
-+            }
-+            
-+          grub_video_vbe_unmap_color (dst, *dstptr, &dr, &dg, &db, &da);
-+          
-+          dr = (dr * (255 - a) + sr * a) / 255;
-+          dg = (dg * (255 - a) + sg * a) / 255;
-+          db = (db * (255 - a) + sb * a) / 255;
-+          
-+          color = grub_video_vbe_map_rgb(dr, dg, db);
-+
-+          *dstptr++ = color & 0xFF;
-+        }
-+    }
-+}
-+
-+void
-+grub_video_i386_vbeblit_R8G8B8A8_R8G8B8 (struct grub_video_render_target *dst,
-+                                         struct grub_video_render_target *src,
-+                                         int x, int y, int width, int height,
-+                                         int offset_x, int offset_y)
-+{
-+  grub_uint32_t color;
-+  int i;
-+  int j;
-+  grub_uint8_t *srcptr;
-+  grub_uint32_t *dstptr;
-+  unsigned int sr;
-+  unsigned int sg;
-+  unsigned int sb;
-+  
-+  /* We do not need to worry about data being out of bounds
-+     as we assume that everything has been checked before.  */
-+  
-+  for (j = 0; j < height; j++)
-+    {
-+      srcptr = (grub_uint8_t *)grub_video_vbe_get_video_ptr (src, offset_x,
-+                                                             j + offset_y);
-+
-+      dstptr = (grub_uint32_t *)grub_video_vbe_get_video_ptr (dst, x, y + j);
-+
-+      for (i = 0; i < width; i++)
-+        {
-+          sr = *srcptr++;
-+          sg = *srcptr++;
-+          sb = *srcptr++;
-+
-+          color = 0xFF000000 | (sb << 16) | (sg << 8) | sr;
-+          
-+          *dstptr++ = color;
-+        }
-+    }
-+}
-+
-+
-+void
-+grub_video_i386_vbeblit_R8G8B8_R8G8B8 (struct grub_video_render_target *dst,
-+                                       struct grub_video_render_target *src,
-+                                       int x, int y, int width, int height,
-+                                       int offset_x, int offset_y)
-+{
-+  int i;
-+  int j;
-+  grub_uint8_t *srcptr;
-+  grub_uint8_t *dstptr;
-+  
-+  /* We do not need to worry about data being out of bounds
-+     as we assume that everything has been checked before.  */
-+  
-+  for (j = 0; j < height; j++)
-+    {
-+      srcptr = (grub_uint8_t *)grub_video_vbe_get_video_ptr (src, 
-+                                                             offset_x,
-+                                                             j + offset_y);
-+
-+      dstptr = (grub_uint8_t *)grub_video_vbe_get_video_ptr (dst,
-+                                                             x, 
-+                                                             y + j);
-+
-+      for (i = 0; i < width; i++)
-+        {
-+          *dstptr ++ = *srcptr++;
-+          *dstptr ++ = *srcptr++;
-+          *dstptr ++ = *srcptr++;
-+        }
-+    }
-+}
-+
-+void
-+grub_video_i386_vbeblit_index_R8G8B8 (struct grub_video_render_target *dst,
-+                                      struct grub_video_render_target *src,
-+                                      int x, int y, int width, int height,
-+                                      int offset_x, int offset_y)
-+{
-+  grub_uint32_t color;
-+  int i;
-+  int j;
-+  grub_uint8_t *srcptr;
-+  grub_uint8_t *dstptr;
-+  unsigned int sr;
-+  unsigned int sg;
-+  unsigned int sb;
-+  
-+  /* We do not need to worry about data being out of bounds
-+     as we assume that everything has been checked before.  */
-+  
-+  for (j = 0; j < height; j++)
-+    {
-+      srcptr = (grub_uint8_t *)grub_video_vbe_get_video_ptr (src, offset_x,
-+                                                             j + offset_y);
-+
-+      dstptr = (grub_uint8_t *)grub_video_vbe_get_video_ptr (dst, x, y + j);
-+
-+      for (i = 0; i < width; i++)
-+        {
-+          sr = *srcptr++;
-+          sg = *srcptr++;
-+          sb = *srcptr++;
-+          
-+          color = grub_video_vbe_map_rgb(sr, sg, sb);
-+
-+          *dstptr++ = color & 0xFF;
-+        }
-+    }
-+}
-+
-+
-+void
-+grub_video_i386_vbeblit_index_index (struct grub_video_render_target *dst,
-+                                     struct grub_video_render_target *src,
-+                                     int x, int y, int width, int height,
-+                                     int offset_x, int offset_y)
-+{
-+  int i;
-+  int j;
-+  grub_uint8_t *srcptr;
-+  grub_uint8_t *dstptr;
-+  
-+  /* We do not need to worry about data being out of bounds
-+     as we assume that everything has been checked before.  */
-+  
-+  for (j = 0; j < height; j++)
-+    {
-+      srcptr = (grub_uint8_t *)grub_video_vbe_get_video_ptr (src, offset_x,
-+                                                             j + offset_y);
-+                                                              
-+      dstptr = (grub_uint8_t *)grub_video_vbe_get_video_ptr (dst, x, y + j);
-+
-+      for (i = 0; i < width; i++)
-+          *dstptr++ = *srcptr++;
-+    }
-+}
-Index: video/i386/pc/vbefill.c
-===================================================================
-RCS file: video/i386/pc/vbefill.c
-diff -N video/i386/pc/vbefill.c
---- /dev/null  1 Jan 1970 00:00:00 -0000
-+++ video/i386/pc/vbefill.c    31 Mar 2006 14:26:34 -0000      1.1
-@@ -0,0 +1,101 @@
-+/*
-+ *  GRUB  --  GRand Unified Bootloader
-+ *  Copyright (C) 2006  Free Software Foundation, Inc.
-+ *
-+ *  This program is free software; you can redistribute it and/or modify
-+ *  it under the terms of the GNU General Public License as published by
-+ *  the Free Software Foundation; either version 2 of the License, or
-+ *  (at your option) any later version.
-+ *
-+ *  This program is distributed in the hope that it will be useful,
-+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+ *  GNU General Public License for more details.
-+ *
-+ *  You should have received a copy of the GNU General Public License
-+ *  along with this program; if not, write to the Free Software
-+ *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-+ */
-+
-+#include <grub/err.h>
-+#include <grub/machine/memory.h>
-+#include <grub/machine/vbe.h>
-+#include <grub/machine/vbefill.h>
-+#include <grub/types.h>
-+#include <grub/dl.h>
-+#include <grub/misc.h>
-+#include <grub/font.h>
-+#include <grub/mm.h>
-+#include <grub/video.h>
-+
-+void
-+grub_video_i386_vbefill_R8G8B8A8 (struct grub_video_render_target *dst,
-+                                  grub_video_color_t color, int x, int y,
-+                                  int width, int height)
-+{
-+  int i;
-+  int j;
-+  grub_uint32_t *dstptr;
-+  
-+  /* We do not need to worry about data being out of bounds
-+     as we assume that everything has been checked before.  */
-+  
-+  for (j = 0; j < height; j++)
-+    {
-+      dstptr = (grub_uint32_t *)grub_video_vbe_get_video_ptr (dst, x, y + j);
-+
-+      for (i = 0; i < width; i++)
-+        *dstptr++ = color;
-+    }
-+}
-+
-+void
-+grub_video_i386_vbefill_R8G8B8 (struct grub_video_render_target *dst,
-+                                grub_video_color_t color, int x, int y,
-+                                int width, int height)
-+{
-+  int i;
-+  int j;
-+  grub_uint8_t *dstptr;
-+  grub_uint8_t fillr = (grub_uint8_t)((color >> 0) & 0xFF);
-+  grub_uint8_t fillg = (grub_uint8_t)((color >> 8) & 0xFF);
-+  grub_uint8_t fillb = (grub_uint8_t)((color >> 16) & 0xFF);
-+  
-+  /* We do not need to worry about data being out of bounds
-+     as we assume that everything has been checked before.  */
-+  
-+  for (j = 0; j < height; j++)
-+    {
-+      dstptr = (grub_uint8_t *)grub_video_vbe_get_video_ptr (dst, x, y + j);
-+
-+      for (i = 0; i < width; i++)
-+        {
-+          *dstptr++ = fillr;
-+          *dstptr++ = fillg;
-+          *dstptr++ = fillb;
-+        }
-+    }
-+}
-+
-+
-+void
-+grub_video_i386_vbefill_index (struct grub_video_render_target *dst,
-+                               grub_video_color_t color, int x, int y,
-+                               int width, int height)
-+{
-+  int i;
-+  int j;
-+  grub_uint8_t *dstptr;
-+  grub_uint8_t fill = (grub_uint8_t)color & 0xFF;
-+  
-+  /* We do not need to worry about data being out of bounds
-+     as we assume that everything has been checked before.  */
-+  
-+  for (j = 0; j < height; j++)
-+    {
-+      dstptr = (grub_uint8_t *)grub_video_vbe_get_video_ptr (dst, x, y + j);
-+
-+      for (i = 0; i < width; i++)
-+        *dstptr++ = fill;
-+    }
-+}