From: Vladimir 'phcoder' Serbinenko Date: Sun, 7 Feb 2010 16:52:11 +0000 (+0100) Subject: Merge emu-mod into emu-modload X-Git-Tag: 1.99~963^2~5 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b77ab1aaa92b12db7de69261a8dfc2fd97f5028b;p=thirdparty%2Fgrub.git Merge emu-mod into emu-modload --- b77ab1aaa92b12db7de69261a8dfc2fd97f5028b diff --cc conf/any-emu.rmk index ad71f06bd,a4ee9b755..48d1035b3 --- a/conf/any-emu.rmk +++ b/conf/any-emu.rmk @@@ -6,7 -6,7 +6,6 @@@ COMMON_CFLAGS += -nostdinc -isystem $(s # Used by various components. These rules need to precede them. script/lexer.c_DEPENDENCIES = grub_script.tab.h - #sbin_UTILITIES += grub-emu -util/grub-emu.c_DEPENDENCIES = grub_emu_init.h kernel_img_RELOCATABLE = yes pkglib_PROGRAMS = kernel.img kernel_img_SOURCES = kern/device.c kern/disk.c kern/dl.c kern/env.c \ @@@ -17,34 -17,13 +16,33 @@@ kern/rescue_reader.c kern/rescue_parser.c \ \ util/console.c util/grub-emu.c util/misc.c \ - util/hostdisk.c util/getroot.c \ + util/hostdisk.c util/getroot.c util/mm.c \ \ - grub_emu_init.c gnulib/progname.c util/hostfs.c disk/host.c -kernel_img_CFLAGS = $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) -Wno-undef -I$(srcdir)/gnulib + gnulib/progname.c util/hostfs.c disk/host.c +kernel_img_HEADERS = boot.h cache.h device.h disk.h dl.h elf.h elfload.h \ + env.h err.h file.h fs.h kernel.h loader.h misc.h mm.h net.h parser.h \ + partition.h msdos_partition.h reader.h symbol.h term.h time.h types.h \ + list.h handler.h command.h i18n.h env_private.h +kernel_img_CFLAGS = $(CPPFLAGS) $(CFLAGS) -Wno-undef kernel_img_LDFLAGS = $(COMMON_LDFLAGS) TARGET_NO_STRIP = yes -TARGET_NO_DYNAMIC_MODULES = yes + +ifneq ($(TARGET_NO_MODULES), yes) +kernel_img_SOURCES += symlist.c kern/$(target_cpu)/dl.c +ifneq ($(target_cpu), i386) +ifneq ($(target_cpu), x86_64) +kernel_img_SOURCES += kern/$(target_cpu)/cache.S +endif +endif +else +kernel_img_SOURCES += grub_emu_init.c - grub_emu_init.c_DEPENDENCIES = grub_emu_init.h +endif + +# For boot.mod. +pkglib_MODULES += boot.mod +boot_mod_SOURCES = commands/boot.c lib/i386/pc/biosnum.c +boot_mod_CFLAGS = $(COMMON_CFLAGS) +boot_mod_LDFLAGS = $(COMMON_LDFLAGS) # For reboot.mod. pkglib_MODULES += reboot.mod @@@ -79,10 -58,9 +77,10 @@@ endi ifeq ($(enable_grub_emu_sdl), yes) pkglib_MODULES += sdl.mod sdl_mod_SOURCES = util/sdl.c - sdl_mod_CFLAGS = $(COMMON_CFLAGS) + sdl_mod_CFLAGS = sdl_mod_LDFLAGS = $(COMMON_LDFLAGS) grub_emu_LDFLAGS += $(LIBSDL) +kernel_img_HEADERS += sdl.h endif ifeq ($(enable_grub_emu_pci), yes) @@@ -106,7 -76,7 +104,7 @@@ grub_emu_init.h: genemuinitheader.sh $( rm -f $@; echo $(pkglib_MODULES) | sh $(srcdir)/genemuinitheader.sh $(NM) > $@ DISTCLEANFILES += grub_emu_init.h --grub_emu_init.c: genemuinit.sh $(pkglib_MODULES) ++grub_emu_init.c: genemuinit.sh $(pkglib_MODULES) grub_emu_init.h rm -f $@; echo $(pkglib_MODULES) | sh $(srcdir)/genemuinit.sh $(NM) > $@ DISTCLEANFILES += grub_emu_init.c diff --cc util/grub-emu.c index fadb79385,7d4544509..8660f0aa0 --- a/util/grub-emu.c +++ b/util/grub-emu.c @@@ -150,6 -150,6 +150,10 @@@ void grub_hostfs_init (void) void grub_hostfs_fini (void); void grub_host_init (void); void grub_host_fini (void); ++#if GRUB_NO_MODULES ++void grub_init_all (void); ++void grub_fini_all (void); ++#endif int main (int argc, char *argv[]) diff --cc util/misc.c index 6182f138e,7381c8fdd..ca22d1925 --- a/util/misc.c +++ b/util/misc.c @@@ -35,6 -35,6 +35,7 @@@ #endif #include ++#include #include #include #include