* common.rmk (bin_UTILITIES): Add grub-pe2elf.
(grub_pe2elf_SOURCES): New macro.
(CLEANFILES): Add grub-pe2elf.
* include/grub/efi/pe32.h (GRUB_PE32_SCN_ALIGN_1BYTES): New constant.
(GRUB_PE32_SCN_ALIGN_2BYTES): Likewise.
(GRUB_PE32_SCN_ALIGN_4BYTES): Likewise.
(GRUB_PE32_SCN_ALIGN_8BYTES): Likewise.
(GRUB_PE32_SCN_ALIGN_16BYTES): Likewise.
(GRUB_PE32_SCN_ALIGN_32BYTES): Likewise.
(GRUB_PE32_SCN_ALIGN_64BYTES): Likewise.
(GRUB_PE32_SCN_ALIGN_SHIFT): Likewise.
(GRUB_PE32_SCN_ALIGN_MASK): Likewise.
(GRUB_PE32_SYM_CLASS_EXTERNAL): Likewise.
(GRUB_PE32_SYM_CLASS_STATIC): Likewise.
(GRUB_PE32_SYM_CLASS_FILE): Likewise.
(GRUB_PE32_DT_FUNCTION): Likewise.
(GRUB_PE32_REL_I386_DIR32): Likewise.
(GRUB_PE32_REL_I386_REL32): Likewise.
(grub_pe32_symbol): New structure.
(grub_pe32_reloc): Likewise.
* util/grub-pe2elf.c: New file.
* configure.ac: Set TARGET_OBJ2ELF if host os is cygwin. Don't test for
start symbol in non pc platform.
* genmk.rb: Use TARGET_OBJ2ELF to convert native object format to elf.
The following patches are from Christian Franke.
* include/grub/dl.h: Remove .previous, gas supports this only
for ELF format.
* include/grub/symbol.h [__CYGWIN__] (#define FUNCTION/VARIABLE):
Remove .type, gas supports this only for ELF format.
* kern/dl.c (grub_dl_resolve_dependencies): Add check for trailing
nullbytes in symbol table. This fixes an infinite loop if table is
zero filled.
* Makefile.in: Add autoconf replacements TARGET_IMG_LDSCRIPT,
TARGET_IMG_LDFLAGS and EXEEXT.
* aclocal.m4 (grub_PROG_OBJCOPY_ABSOLUTE): Replace -Wl,-N by
TARGET_IMG_LDFLAGS_AC.
(grub_CHECK_STACK_ARG_PROBE): New function.
* conf/i386-pc.rmk: Replace -Wl,-N by TARGET_IMG_LDFLAGS.
* conf/i386-pc-cygwin-ld-img.sc: New linker script.
* configure.ac: Add check for linker script "conf/${target}-img-ld.c"
to set TARGET_IMG_LD* accordingly.
Add check for Cygwin to set TARGET_MOD_OBJCOPY accordingly.
Add call to grub_CHECK_STACK_ARG_PROBE.
Use TARGET_IMG_LDFLAGS to check start, bss_start, end symbols.
* genkernsyms.sh.in: Handle HAVE_ASM_USCORE case.
* genmk.rb: Add EXEEXT to CLEANFILES.
* Makefile.in (MODULE_LDFLAGS): New variable.
* aclocal.m4 (grub_PROG_LD_BUILD_ID_NONE): New macro. Check if
the linker accepts --build-id=none.
* configure.ac: Call grub_PROG_LD_BUILD_ID_NONE. Substitute
MODULE_LDFLAGS.
* genmk.rb: Use MODULE_LDFLAGS when linking modules.
* conf/powerpc-ieee1275.rmk (kernel_elf_SOURCES): Rename
kernel_elf_symlist.c to symlist.c for consistency with other
architectures. Update all users.
* conf/sparc64-ieee1275.rmk (kernel_elf_SOURCES): Likewise.
* configure.ac: Search for possible unifont.hex locations, and
define UNIFONT_HEX if found.
* Makefile.in (UNIFONT_HEX): Define variable.
(DATA): Rename to ...
(PKGLIB): ... this. Update all users.
(PKGDATA): New variable.
(pkgdata_IMAGES): Rename to ...
(pkglib_IMAGES): ... this. Update all users.
(pkgdata_MODULES): Rename to ...
(pkglib_MODULES): ... this. Update all users.
(pkgdata_PROGRAMS): Rename to ...
(pkglib_PROGRAMS): ... this. Update all users.
(pkgdata_DATA): Rename to ...
(pkglib_DATA): ... this. Update all users.
(CLEANFILES): Redefine to `$(pkglib_DATA) $(pkgdata_DATA)'.
(unicode.pff, ascii.pff): New rules.
(all-local): Add `$(PKGDATA)' dependency.
(install-local): Process `$(PKGDATA)'.
* util/update-grub_lib.in (font_path): Search for *.pff files in
a few more locations, including `${pkgdata}'.
* genmk.rb: Let GCC generate dependenceies the first time it
compiles a file; using the -MD option.
* conf/common.mk: Regenerate.
* conf/i386-pc.mk: Likewise.
* conf/i386-efi.mk: Likewise.
* conf/powerpc-ieee1275.mk: Likewise.
* conf/sparc64-ieee1275.mk: Likewise.
* 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.
* 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.
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.
* include/grub/parser.h: New file.
* kern/parser.c: Likewise.
* conf/i386-pc.rmk (kernel_img_SOURCES): Add `kern/parser.c'.
(grub_setup_SOURCES): Likewise.
(grub_probefs_SOURCES): Likewise.
(grub_emu_SOURCES): Likewise.
(kernel_img_HEADERS): Add `parser.h'.
* conf/powerpc-ieee1275.rmk (grubof_HEADERS): Add `parser.h'.
(grub_emu_SOURCES): Add `kern/parser.c'.
(grubof_SOURCES): Likewise.
* conf/sparc64-ieee1275.rmk (grubof_HEADERS): Add `parser.h'.
(grubof_SOURCES): Add `kern/parser.c'.
* include/grub/misc.h (grub_split_cmdline): Removed prototype.
* kern/misc.c (grub_split_cmdline): Removed function.
* kern/rescue.c: Include <grub/parser.h>.
(grub_enter_rescue_mode): Use `grub_parser_split_cmdline' instead
of `grub_split_cmdline'.
* normal/command.c: Include <grub/parser.h>.
(grub_command_execute): Use `grub_parser_split_cmdline' instead
of `grub_split_cmdline'.
* normal/completion.c: Include <grub/parser.h>.
(cmdline_state): New variable.
(iterate_dir): End the filename with a quote depending on the
command line state.
(get_state): new function.
(grub_normal_do_completion): Use `grub_parser_split_cmdline' to
split the arguments and determine the current argument. When the
argument string is not quoted, escape all spaces.
* conf/sparc64-ieee1275.rmk (grubof_SOURCES): The first file must be
kern/sparc64/ieee1275/init.c because it contains _start.
* conf/sparc64-ieee1275.mk: Generated from conf/sparc64-ieee1275.rmk.
* configure.ac: Add support for sparc64 host with ieee1275
firmware.
* configure: Generated from configure.ac.
* disk/ieee1275/ofdisk.c (grub_ofdisk_open): Use grub_ssize_t
instead of int.
(grub_ofdisk_read): Likewise.
(grub_ofdisk_open): Use %p to print pointer values, and cast the
pointers as (void *) to remove a warning.
(grub_ofdisk_close): Likewise.
(grub_ofdisk_read): Likewise.
* kern/ieee1275/ieee1275.c (grub_ieee1275_exit): This never
returns, so make it return void to remove a warning.
* include/grub/ieee1275/ieee1275.h (grub_ieee1275_exit):
Corresponding prototype change.
* kern/mm.c (grub_mm_init_region): Use %p to print pointer
values, and cast the pointers as (void *) to remove a warning.
(grub_mm_dump): Likewise.
* conf/sparc64-ieee1275.mk: New file.
* conf/sparc64-ieee1275.rmk: Likewise.
* include/grub/sparc64/setjmp.h: Likewise.
* include/grub/sparc64/types.h: Likewise.
* include/grub/sparc64/ieee1275/console.h: Likewise.
* include/grub/sparc64/ieee1275/ieee1275.h: Likewise.
* include/grub/sparc64/ieee1275/kernel.h: Likewise.
* include/grub/sparc64/ieee1275/time.h: Likewise.
* kern/sparc64/cache.c: Likewise.
* kern/sparc64/dl.c: Likewise.
* kern/sparc64/ieee1275/init.c: Likewise.
* kern/sparc64/ieee1275/openfw.c: Likewise.