diff options
author | Keir Fraser <keir.fraser@citrix.com> | 2008-05-28 09:30:48 +0100 |
---|---|---|
committer | Keir Fraser <keir.fraser@citrix.com> | 2008-05-28 09:30:48 +0100 |
commit | f9b4231a673d75dd6404ac5df8a47adc04437e6b (patch) | |
tree | 67d37f19b98706274ec6af9245082f25622341a8 /extras | |
parent | 4151cc56f19b3fe8aabde12ddf532cd9502c637d (diff) | |
download | xen-f9b4231a673d75dd6404ac5df8a47adc04437e6b.tar.gz xen-f9b4231a673d75dd6404ac5df8a47adc04437e6b.tar.bz2 xen-f9b4231a673d75dd6404ac5df8a47adc04437e6b.zip |
stubdom: make the build more generic by moving as many stubdom parts
into stubdom/ as possible. That also permits to build all of
ioemu, c and caml stubdoms at the same time.
Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
Diffstat (limited to 'extras')
-rw-r--r-- | extras/mini-os/Config.mk | 8 | ||||
-rw-r--r-- | extras/mini-os/Makefile | 33 | ||||
-rw-r--r-- | extras/mini-os/main-caml.c | 42 | ||||
-rw-r--r-- | extras/mini-os/main.c | 2 |
4 files changed, 7 insertions, 78 deletions
diff --git a/extras/mini-os/Config.mk b/extras/mini-os/Config.mk index 15f7ed832c..96dd739ce7 100644 --- a/extras/mini-os/Config.mk +++ b/extras/mini-os/Config.mk @@ -55,11 +55,3 @@ DEF_CPPFLAGS += -DHAVE_LWIP DEF_CPPFLAGS += -I$(LWIPDIR)/src/include DEF_CPPFLAGS += -I$(LWIPDIR)/src/include/ipv4 endif - -ifneq ($(QEMUDIR),) -qemu=y -endif - -ifneq ($(CAMLDIR),) -caml=y -endif diff --git a/extras/mini-os/Makefile b/extras/mini-os/Makefile index 8cec019e42..18497e1843 100644 --- a/extras/mini-os/Makefile +++ b/extras/mini-os/Makefile @@ -73,44 +73,25 @@ lwip.a: $(LWO) OBJS += lwip.a endif -OBJS := $(filter-out lwip%.o $(LWO), $(OBJS)) - -ifeq ($(caml),y) -CAMLLIB = $(shell ocamlc -where) -APP_OBJS += main-caml.o -APP_OBJS += $(CAMLDIR)/caml.o -APP_OBJS += $(CAMLLIB)/libasmrun.a -CFLAGS += -I$(CAMLLIB) -APP_LDLIBS += -lm -endif -OBJS := $(filter-out main-caml.o, $(OBJS)) - -ifeq ($(qemu),y) -APP_OBJS += $(QEMUDIR)/i386-dm-stubdom/qemu.a $(QEMUDIR)/i386-dm-stubdom/libqemu.a -CFLAGS += -DCONFIG_QEMU -endif - -ifneq ($(CDIR),) -APP_OBJS += $(CDIR)/main.a -APP_LDLIBS += -endif +OBJS := $(filter-out main.o lwip%.o $(LWO), $(OBJS)) ifeq ($(libc),y) APP_LDLIBS += -L$(XEN_ROOT)/stubdom/libxc -whole-archive -lxenguest -lxenctrl -no-whole-archive APP_LDLIBS += -lpci APP_LDLIBS += -lz +APP_LDLIBS += -lm LDLIBS += -lc endif -ifneq ($(caml)-$(qemu)-$(CDIR)-$(lwip),---y) +ifneq ($(APP_OBJS)-$(lwip),-y) OBJS := $(filter-out daytime.o, $(OBJS)) endif -app.o: $(APP_OBJS) app.lds - $(LD) -r -d $(LDFLAGS) $^ $(APP_LDLIBS) --undefined main -o $@ +$(TARGET)_app.o: $(APP_OBJS) app.lds + $(LD) -r -d $(LDFLAGS) $^ $(APP_LDLIBS) --undefined app_main -o $@ -$(TARGET): links $(OBJS) app.o arch_lib - $(LD) -r $(LDFLAGS) $(HEAD_OBJ) app.o $(OBJS) $(LDARCHLIB) $(LDLIBS) -o $@.o +$(TARGET): links $(OBJS) $(TARGET)_app.o arch_lib + $(LD) -r $(LDFLAGS) $(HEAD_OBJ) $(TARGET)_app.o $(OBJS) $(LDARCHLIB) $(LDLIBS) -o $@.o $(OBJCOPY) -w -G $(GLOBAL_PREFIX)* -G _start $@.o $@.o $(LD) $(LDFLAGS) $(LDFLAGS_FINAL) $@.o $(EXTRA_OBJS) -o $@ gzip -f -9 -c $@ >$@.gz diff --git a/extras/mini-os/main-caml.c b/extras/mini-os/main-caml.c deleted file mode 100644 index dd55aca38f..0000000000 --- a/extras/mini-os/main-caml.c +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Caml bootstrap - * - * Samuel Thibault <Samuel.Thibault@eu.citrix.net>, January 2008 - */ - -#include <stdio.h> -#include <errno.h> - -#include <caml/mlvalues.h> -#include <caml/callback.h> -#include <unistd.h> - -/* Ugly binary compatibility with Linux */ -FILE *_stderr asm("stderr"); -int *__errno_location; -/* Will probably break everything, probably need to fetch from glibc */ -void *__ctype_b_loc; - -int main(int argc, char *argv[], char *envp[]) -{ - value *val; - - /* Get current thread's value */ - _stderr = stderr; - __errno_location = &errno; - - printf("starting caml\n"); - - /* Wait before things might hang up */ - sleep(1); - - caml_startup(argv); - val = caml_named_value("main"); - if (!val) { - printf("Couldn't find Caml main"); - return 1; - } - caml_callback(*val, Val_int(0)); - printf("callback returned\n"); - return 0; -} diff --git a/extras/mini-os/main.c b/extras/mini-os/main.c index 1851469c3e..74904bbf1e 100644 --- a/extras/mini-os/main.c +++ b/extras/mini-os/main.c @@ -4,7 +4,6 @@ * Samuel Thibault <Samuel.Thibault@eu.citrix.net>, October 2007 */ -#ifdef HAVE_LIBC #include <os.h> #include <sched.h> #include <console.h> @@ -180,4 +179,3 @@ int app_main(start_info_t *si) main_thread = create_thread("main", call_main, si); return 0; } -#endif |