diff options
author | Keir Fraser <keir.fraser@citrix.com> | 2008-07-10 14:15:46 +0100 |
---|---|---|
committer | Keir Fraser <keir.fraser@citrix.com> | 2008-07-10 14:15:46 +0100 |
commit | 8f969983389d428de381469944712e468f99e345 (patch) | |
tree | a61f39a4b60205164f696e0d3222fd3019965582 | |
parent | 79961b311e61cb274d817d15e073ad511918a36e (diff) | |
download | xen-8f969983389d428de381469944712e468f99e345.tar.gz xen-8f969983389d428de381469944712e468f99e345.tar.bz2 xen-8f969983389d428de381469944712e468f99e345.zip |
stubdom: fixes to compile with qemu-xen
This adds fixes to the stub domain build into compiling Ian Jackson's
qemu-xen. The most notable change is that mini-os headers now
#include each other through a mini-os/ prefix, so that we can turn all
-I into -isystem and still be sure that we include Mini-OS headers
(and not qemu's console.h or blktaplib's list.h for instance...).
Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
39 files changed, 107 insertions, 74 deletions
diff --git a/extras/mini-os/Config.mk b/extras/mini-os/Config.mk index d802b506f7..a6a738a68f 100644 --- a/extras/mini-os/Config.mk +++ b/extras/mini-os/Config.mk @@ -38,20 +38,20 @@ EXTRA_INC = $(ARCH_INC) # This must be before include minios.mk! include $(MINI-OS_ROOT)/$(TARGET_ARCH_DIR)/arch.mk -extra_incl := $(foreach dir,$(EXTRA_INC),-I$(realpath $(MINI-OS_ROOT)/include/$(dir))) +extra_incl := $(foreach dir,$(EXTRA_INC),-isystem $(realpath $(MINI-OS_ROOT)/include/$(dir))) -DEF_CPPFLAGS += -I$(realpath $(MINI-OS_ROOT)/include) +DEF_CPPFLAGS += -isystem $(realpath $(MINI-OS_ROOT)/include) DEF_CPPFLAGS += -D__MINIOS__ ifeq ($(libc),y) DEF_CPPFLAGS += -DHAVE_LIBC -DEF_CPPFLAGS += -I$(realpath $(MINI-OS_ROOT)/include/posix) -DEF_CPPFLAGS += -I$(realpath $(XEN_ROOT)/tools/xenstore) +DEF_CPPFLAGS += -isystem $(realpath $(MINI-OS_ROOT)/include/posix) +DEF_CPPFLAGS += -isystem $(realpath $(XEN_ROOT)/tools/xenstore) endif ifneq ($(LWIPDIR),) lwip=y DEF_CPPFLAGS += -DHAVE_LWIP -DEF_CPPFLAGS += -I$(LWIPDIR)/src/include -DEF_CPPFLAGS += -I$(LWIPDIR)/src/include/ipv4 +DEF_CPPFLAGS += -isystem $(LWIPDIR)/src/include +DEF_CPPFLAGS += -isystem $(LWIPDIR)/src/include/ipv4 endif diff --git a/extras/mini-os/Makefile b/extras/mini-os/Makefile index bc55145f3a..5ef4e03811 100644 --- a/extras/mini-os/Makefile +++ b/extras/mini-os/Makefile @@ -55,6 +55,8 @@ endif .PHONY: links links: $(ARCH_LINKS) [ -e include/xen ] || ln -sf ../../../xen/include/public include/xen + [ -e include/mini-os ] || ln -sf . include/mini-os + [ -e include/$(TARGET_ARCH_FAM)/mini-os ] || ln -sf . include/$(TARGET_ARCH_FAM)/mini-os .PHONY: arch_lib arch_lib: @@ -89,7 +91,7 @@ OBJS := $(filter-out $(OBJ_DIR)/daytime.o, $(OBJS)) endif $(OBJ_DIR)/$(TARGET)_app.o: $(APP_OBJS) app.lds - $(LD) -r -d $(LDFLAGS) $^ $(APP_LDLIBS) --undefined main -o $@ + $(LD) -r -d $(LDFLAGS) -\( $^ -\) $(APP_LDLIBS) --undefined main -o $@ $(OBJ_DIR)/$(TARGET): links $(OBJS) $(OBJ_DIR)/$(TARGET)_app.o arch_lib $(LD) -r $(LDFLAGS) $(HEAD_OBJ) $(OBJ_DIR)/$(TARGET)_app.o $(OBJS) $(LDARCHLIB) $(LDLIBS) -o $@.o diff --git a/extras/mini-os/include/arch/cc.h b/extras/mini-os/include/arch/cc.h index 1c31feb7c8..02aeb2f4bd 100644 --- a/extras/mini-os/include/arch/cc.h +++ b/extras/mini-os/include/arch/cc.h @@ -10,8 +10,8 @@ #define __LWIP_ARCH_CC_H__ /* Typedefs for the types used by lwip - */ -#include <os.h> -#include <types.h> +#include <mini-os/os.h> +#include <mini-os/types.h> #include <time.h> typedef u8 u8_t; typedef s8 s8_t; @@ -46,7 +46,7 @@ extern void lwip_die(char *fmt, ...); /* If the compiler does not provide memset() this file must include a */ /* definition of it, or include a file which defines it. */ -#include <lib.h> +#include <mini-os/lib.h> /* This file must either include a system-local <errno.h> which defines */ /* the standard *nix error codes, or it should #define LWIP_PROVIDE_ERRNO */ diff --git a/extras/mini-os/include/arch/sys_arch.h b/extras/mini-os/include/arch/sys_arch.h index 4e911549c9..11d5328896 100644 --- a/extras/mini-os/include/arch/sys_arch.h +++ b/extras/mini-os/include/arch/sys_arch.h @@ -9,9 +9,9 @@ #ifndef __LWIP_ARCH_SYS_ARCH_H__ #define __LWIP_ARCH_SYS_ARCH_H__ -#include <os.h> -#include <xmalloc.h> -#include <semaphore.h> +#include <mini-os/os.h> +#include <mini-os/xmalloc.h> +#include <mini-os/semaphore.h> typedef struct semaphore *sys_sem_t; #define SYS_SEM_NULL ((sys_sem_t) NULL) diff --git a/extras/mini-os/include/blkfront.h b/extras/mini-os/include/blkfront.h index a4e691140f..8cbc0905d3 100644 --- a/extras/mini-os/include/blkfront.h +++ b/extras/mini-os/include/blkfront.h @@ -1,6 +1,6 @@ -#include <wait.h> +#include <mini-os/wait.h> #include <xen/io/blkif.h> -#include <types.h> +#include <mini-os/types.h> struct blkfront_dev; struct blkfront_aiocb { diff --git a/extras/mini-os/include/byteswap.h b/extras/mini-os/include/byteswap.h index 6d97f78f74..46821aefea 100644 --- a/extras/mini-os/include/byteswap.h +++ b/extras/mini-os/include/byteswap.h @@ -3,7 +3,7 @@ /* Unfortunately not provided by newlib. */ -#include <types.h> +#include <mini-os/types.h> static inline uint16_t bswap_16(uint16_t x) { return diff --git a/extras/mini-os/include/console.h b/extras/mini-os/include/console.h index 4a61f1aaa0..e9e5161166 100644 --- a/extras/mini-os/include/console.h +++ b/extras/mini-os/include/console.h @@ -36,8 +36,8 @@ #ifndef _LIB_CONSOLE_H_ #define _LIB_CONSOLE_H_ -#include<os.h> -#include<traps.h> +#include<mini-os/os.h> +#include<mini-os/traps.h> #include<stdarg.h> void print(int direct, const char *fmt, va_list args); diff --git a/extras/mini-os/include/err.h b/extras/mini-os/include/err.h index c329c57d88..4e19619dbe 100644 --- a/extras/mini-os/include/err.h +++ b/extras/mini-os/include/err.h @@ -1,7 +1,7 @@ #ifndef _ERR_H #define _ERR_H -#include <errno.h> +#include <mini-os/errno.h> /* * Kernel pointers have redundant information, so we can use a diff --git a/extras/mini-os/include/errno.h b/extras/mini-os/include/errno.h index 5c2b2f8fad..f71b1311b9 100644 --- a/extras/mini-os/include/errno.h +++ b/extras/mini-os/include/errno.h @@ -1,7 +1,7 @@ #ifndef _ERRNO_H #define _ERRNO_H -#include <errno-base.h> +#include <mini-os/errno-base.h> typedef int error_t; @@ -113,7 +113,7 @@ typedef int error_t; #define EFTYPE 132 /* Inappropriate file type or format */ #ifdef HAVE_LIBC -#include <sched.h> +#include <mini-os/sched.h> extern int errno; #define ERRNO #define errno (get_current()->reent._errno) diff --git a/extras/mini-os/include/events.h b/extras/mini-os/include/events.h index fd708eb5d3..912e4cff09 100644 --- a/extras/mini-os/include/events.h +++ b/extras/mini-os/include/events.h @@ -19,7 +19,7 @@ #ifndef _EVENTS_H_ #define _EVENTS_H_ -#include<traps.h> +#include<mini-os/traps.h> #include<xen/event_channel.h> typedef void (*evtchn_handler_t)(evtchn_port_t, struct pt_regs *, void *); diff --git a/extras/mini-os/include/fbfront.h b/extras/mini-os/include/fbfront.h index 1e4d7ac6d9..7e29b4c974 100644 --- a/extras/mini-os/include/fbfront.h +++ b/extras/mini-os/include/fbfront.h @@ -1,6 +1,6 @@ #include <xen/io/kbdif.h> #include <xen/io/fbif.h> -#include <wait.h> +#include <mini-os/wait.h> /* from <linux/input.h> */ #ifndef BTN_LEFT diff --git a/extras/mini-os/include/fs.h b/extras/mini-os/include/fs.h index 4c822dfb20..d60f0c964b 100644 --- a/extras/mini-os/include/fs.h +++ b/extras/mini-os/include/fs.h @@ -2,8 +2,8 @@ #define __FS_H__ #include <xen/io/fsif.h> -#include <semaphore.h> -#include <types.h> +#include <mini-os/semaphore.h> +#include <mini-os/types.h> struct fs_import { diff --git a/extras/mini-os/include/hypervisor.h b/extras/mini-os/include/hypervisor.h index 41ef161db1..b4c7292a47 100644 --- a/extras/mini-os/include/hypervisor.h +++ b/extras/mini-os/include/hypervisor.h @@ -13,7 +13,7 @@ #ifndef _HYPERVISOR_H_ #define _HYPERVISOR_H_ -#include <types.h> +#include <mini-os/types.h> #include <xen/xen.h> #if defined(__i386__) #include <hypercall-x86_32.h> @@ -24,7 +24,7 @@ #else #error "Unsupported architecture" #endif -#include <traps.h> +#include <mini-os/traps.h> /* * a placeholder for the start of day information passed up from the hypervisor diff --git a/extras/mini-os/include/ia64/atomic.h b/extras/mini-os/include/ia64/atomic.h index b565c14c91..618ff82abc 100644 --- a/extras/mini-os/include/ia64/atomic.h +++ b/extras/mini-os/include/ia64/atomic.h @@ -38,7 +38,7 @@ #if !defined(__ASSEMBLY__) -#include <types.h> +#include <mini-os/types.h> /* diff --git a/extras/mini-os/include/ia64/efi.h b/extras/mini-os/include/ia64/efi.h index 25396572b6..b70a0a8e24 100644 --- a/extras/mini-os/include/ia64/efi.h +++ b/extras/mini-os/include/ia64/efi.h @@ -32,7 +32,7 @@ #ifndef _EFI_H_ #define _EFI_H_ -#include "types.h" +#include <mini-os/types.h> #define EFIWARN(a) (a) diff --git a/extras/mini-os/include/ia64/endian.h b/extras/mini-os/include/ia64/endian.h index 18fc7030b6..1d036ffa29 100644 --- a/extras/mini-os/include/ia64/endian.h +++ b/extras/mini-os/include/ia64/endian.h @@ -26,7 +26,7 @@ #if !defined(_ENDIAN_H_) #define _ENDIAN_H_ -#include "types.h" +#include <mini-os/types.h> #if !defined(__ASSEMBLY__) diff --git a/extras/mini-os/include/ia64/hypercall-ia64.h b/extras/mini-os/include/ia64/hypercall-ia64.h index bca01b118d..dbab3d55bf 100644 --- a/extras/mini-os/include/ia64/hypercall-ia64.h +++ b/extras/mini-os/include/ia64/hypercall-ia64.h @@ -34,8 +34,8 @@ #ifndef __HYPERCALL_H__ #define __HYPERCALL_H__ -#include "lib.h" /* memcpy() */ -#include "errno.h" /* ENOSYS() */ +#include <mini-os/lib.h> /* memcpy() */ +#include <mini-os/errno.h> /* ENOSYS() */ #include <xen/event_channel.h> #include <xen/sched.h> #include <xen/version.h> diff --git a/extras/mini-os/include/ia64/os.h b/extras/mini-os/include/ia64/os.h index bf3785fc82..2cbfa424b7 100644 --- a/extras/mini-os/include/ia64/os.h +++ b/extras/mini-os/include/ia64/os.h @@ -27,15 +27,15 @@ #if !defined(__ASSEMBLY__) -#include "types.h" +#include <mini-os/types.h> #include "endian.h" #include "ia64_cpu.h" #include "atomic.h" #include "efi.h" #include "sal.h" #include "pal.h" -#include "hypervisor.h" -#include <kernel.h> +#include <mini-os/hypervisor.h> +#include <mini-os/kernel.h> typedef uint64_t paddr_t; /* Physical address. */ diff --git a/extras/mini-os/include/lib.h b/extras/mini-os/include/lib.h index ababf890fb..b508c38f51 100644 --- a/extras/mini-os/include/lib.h +++ b/extras/mini-os/include/lib.h @@ -99,13 +99,13 @@ char *strstr(const char *s1, const char *s2); char * strcat(char * dest, const char * src); char *strdup(const char *s); #endif -#include <console.h> +#include <mini-os/console.h> #define RAND_MIX 2654435769U int rand(void); -#include <xenbus.h> +#include <mini-os/xenbus.h> #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) diff --git a/extras/mini-os/include/linux/types.h b/extras/mini-os/include/linux/types.h index f153ce8e42..978f29e2cb 100644 --- a/extras/mini-os/include/linux/types.h +++ b/extras/mini-os/include/linux/types.h @@ -1,5 +1,5 @@ #ifndef _LINUX_TYPES_H_ #define _LINUX_TYPES_H_ -#include <types.h> +#include <mini-os/types.h> typedef u64 __u64; #endif /* _LINUX_TYPES_H_ */ diff --git a/extras/mini-os/include/mm.h b/extras/mini-os/include/mm.h index 7c8588ccf8..dd7a6ba311 100644 --- a/extras/mini-os/include/mm.h +++ b/extras/mini-os/include/mm.h @@ -35,10 +35,10 @@ #error "Unsupported architecture" #endif -#include <lib.h> +#include <mini-os/lib.h> -#include <arch_limits.h> -#include <arch_mm.h> +#include <mini-os/arch_limits.h> +#include <mini-os/arch_mm.h> #define STACK_SIZE_PAGE_ORDER __STACK_SIZE_PAGE_ORDER #define STACK_SIZE __STACK_SIZE diff --git a/extras/mini-os/include/netfront.h b/extras/mini-os/include/netfront.h index 681ebf2c0f..2b95da9948 100644 --- a/extras/mini-os/include/netfront.h +++ b/extras/mini-os/include/netfront.h @@ -1,4 +1,4 @@ -#include <wait.h> +#include <mini-os/wait.h> #ifdef HAVE_LWIP #include <lwip/netif.h> #endif diff --git a/extras/mini-os/include/pcifront.h b/extras/mini-os/include/pcifront.h index f09769808d..3bb37139a6 100644 --- a/extras/mini-os/include/pcifront.h +++ b/extras/mini-os/include/pcifront.h @@ -1,4 +1,4 @@ -#include <types.h> +#include <mini-os/types.h> #include <xen/io/pciif.h> struct pcifront_dev; struct pcifront_dev *init_pcifront(char *nodename); diff --git a/extras/mini-os/include/posix/limits.h b/extras/mini-os/include/posix/limits.h index 5dd0e7d3b1..c45e0399d4 100644 --- a/extras/mini-os/include/posix/limits.h +++ b/extras/mini-os/include/posix/limits.h @@ -1,7 +1,7 @@ #ifndef _POSIX_LIMITS_H #define _POSIX_LIMITS_H -#include <arch_limits.h> +#include <mini-os/arch_limits.h> #define CHAR_BIT 8 diff --git a/extras/mini-os/include/posix/sys/select.h b/extras/mini-os/include/posix/sys/select.h index 5132c51224..a9337be4fc 100644 --- a/extras/mini-os/include/posix/sys/select.h +++ b/extras/mini-os/include/posix/sys/select.h @@ -2,6 +2,7 @@ #define _POSIX_SELECT_H #include <sys/time.h> +#include <lwip/sockets.h> int select(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout); #endif /* _POSIX_SELECT_H */ diff --git a/extras/mini-os/include/posix/unistd.h b/extras/mini-os/include/posix/unistd.h index 0cd9396ec9..373f07205a 100644 --- a/extras/mini-os/include/posix/unistd.h +++ b/extras/mini-os/include/posix/unistd.h @@ -2,8 +2,7 @@ #define _POSIX_UNISTD_H #include_next <unistd.h> -#include <sys/select.h> -#include <arch_limits.h> +#include <mini-os/arch_limits.h> #define getpagesize() __PAGE_SIZE diff --git a/extras/mini-os/include/sched.h b/extras/mini-os/include/sched.h index ba0d4e3df9..b3dab8dc6c 100644 --- a/extras/mini-os/include/sched.h +++ b/extras/mini-os/include/sched.h @@ -1,9 +1,12 @@ #ifndef __SCHED_H__ #define __SCHED_H__ -#include <list.h> -#include <time.h> -#include <arch_sched.h> +#include <mini-os/list.h> +#include <mini-os/time.h> +#include <mini-os/arch_sched.h> +#ifdef HAVE_LIBC +#include <sys/reent.h> +#endif struct thread { diff --git a/extras/mini-os/include/semaphore.h b/extras/mini-os/include/semaphore.h index 19f515a1f1..368d09ecb4 100644 --- a/extras/mini-os/include/semaphore.h +++ b/extras/mini-os/include/semaphore.h @@ -1,8 +1,8 @@ #ifndef _SEMAPHORE_H_ #define _SEMAPHORE_H_ -#include <wait.h> -#include <spinlock.h> +#include <mini-os/wait.h> +#include <mini-os/spinlock.h> /* * Implementation of semaphore in Mini-os is simple, because diff --git a/extras/mini-os/include/spinlock.h b/extras/mini-os/include/spinlock.h index ecfe73627e..70cf20f17a 100644 --- a/extras/mini-os/include/spinlock.h +++ b/extras/mini-os/include/spinlock.h @@ -1,7 +1,7 @@ #ifndef __ASM_SPINLOCK_H #define __ASM_SPINLOCK_H -#include <lib.h> +#include <mini-os/lib.h> /* * Your basic SMP spinlocks, allowing only a single CPU anywhere @@ -12,7 +12,7 @@ typedef struct { } spinlock_t; -#include "arch_spinlock.h" +#include <mini-os/arch_spinlock.h> #define SPINLOCK_MAGIC 0xdead4ead diff --git a/extras/mini-os/include/sys/lock.h b/extras/mini-os/include/sys/lock.h index 0757a749dd..8004536d02 100644 --- a/extras/mini-os/include/sys/lock.h +++ b/extras/mini-os/include/sys/lock.h @@ -5,7 +5,7 @@ /* Due to inclusion loop, we can not include sched.h, so have to hide things */ -#include <waittypes.h> +#include <mini-os/waittypes.h> typedef struct { diff --git a/extras/mini-os/include/time.h b/extras/mini-os/include/time.h index 250af5c5cf..ac83df855b 100644 --- a/extras/mini-os/include/time.h +++ b/extras/mini-os/include/time.h @@ -19,7 +19,7 @@ #ifndef _MINIOS_TIME_H_ #define _MINIOS_TIME_H_ -#include <types.h> +#include <mini-os/types.h> /* * System Time diff --git a/extras/mini-os/include/wait.h b/extras/mini-os/include/wait.h index 6519a4db89..2dc109b4f7 100644 --- a/extras/mini-os/include/wait.h +++ b/extras/mini-os/include/wait.h @@ -1,9 +1,9 @@ #ifndef __WAIT_H__ #define __WAIT_H__ -#include <sched.h> -#include <os.h> -#include <waittypes.h> +#include <mini-os/sched.h> +#include <mini-os/os.h> +#include <mini-os/waittypes.h> #define DEFINE_WAIT(name) \ struct wait_queue name = { \ diff --git a/extras/mini-os/include/waittypes.h b/extras/mini-os/include/waittypes.h index fd5806348f..326eef0f45 100644 --- a/extras/mini-os/include/waittypes.h +++ b/extras/mini-os/include/waittypes.h @@ -1,7 +1,7 @@ #ifndef __WAITTYPE_H__ #define __WAITTYPE_H__ -#include <list.h> +#include <mini-os/list.h> struct thread; struct wait_queue diff --git a/extras/mini-os/include/x86/arch_sched.h b/extras/mini-os/include/x86/arch_sched.h index d80323cd37..b494ecaf4a 100644 --- a/extras/mini-os/include/x86/arch_sched.h +++ b/extras/mini-os/include/x86/arch_sched.h @@ -2,7 +2,7 @@ #ifndef __ARCH_SCHED_H__ #define __ARCH_SCHED_H__ -#include <arch_limits.h> +#include "arch_limits.h" static inline struct thread* get_current(void) { diff --git a/extras/mini-os/include/x86/arch_spinlock.h b/extras/mini-os/include/x86/arch_spinlock.h index 59c2fb9b26..4b8faf75a8 100644 --- a/extras/mini-os/include/x86/arch_spinlock.h +++ b/extras/mini-os/include/x86/arch_spinlock.h @@ -3,7 +3,7 @@ #ifndef __ARCH_ASM_SPINLOCK_H #define __ARCH_ASM_SPINLOCK_H -#include <lib.h> +#include <mini-os/lib.h> #include "os.h" diff --git a/extras/mini-os/include/x86/os.h b/extras/mini-os/include/x86/os.h index 39faa0395d..248105f13c 100644 --- a/extras/mini-os/include/x86/os.h +++ b/extras/mini-os/include/x86/os.h @@ -16,9 +16,9 @@ #ifndef __ASSEMBLY__ -#include <types.h> -#include <hypervisor.h> -#include <kernel.h> +#include <mini-os/types.h> +#include <mini-os/hypervisor.h> +#include <mini-os/kernel.h> #define USED __attribute__ ((used)) diff --git a/extras/mini-os/include/x86/x86_32/hypercall-x86_32.h b/extras/mini-os/include/x86/x86_32/hypercall-x86_32.h index e11010b413..d5f5b1e713 100644 --- a/extras/mini-os/include/x86/x86_32/hypercall-x86_32.h +++ b/extras/mini-os/include/x86/x86_32/hypercall-x86_32.h @@ -33,7 +33,7 @@ #include <xen/xen.h> #include <xen/sched.h> #include <xen/nmi.h> -#include <mm.h> +#include <mini-os/mm.h> #define __STR(x) #x #define STR(x) __STR(x) diff --git a/extras/mini-os/include/x86/x86_64/hypercall-x86_64.h b/extras/mini-os/include/x86/x86_64/hypercall-x86_64.h index 179b776ed5..32ea5bd611 100644 --- a/extras/mini-os/include/x86/x86_64/hypercall-x86_64.h +++ b/extras/mini-os/include/x86/x86_64/hypercall-x86_64.h @@ -36,7 +36,7 @@ #include <xen/xen.h> #include <xen/sched.h> -#include <mm.h> +#include <mini-os/mm.h> #define __STR(x) #x #define STR(x) __STR(x) diff --git a/stubdom/Makefile b/stubdom/Makefile index d02528957e..00e8e935f2 100644 --- a/stubdom/Makefile +++ b/stubdom/Makefile @@ -3,11 +3,13 @@ MINI_OS = $(XEN_ROOT)/extras/mini-os export XEN_OS=MiniOS +CONFIG_QEMU=ioemu + export stubdom=y export debug=y include $(XEN_ROOT)/Config.mk -IOEMU_OPTIONS=--disable-vnc-tls +IOEMU_OPTIONS=--disable-sdl --disable-opengl --disable-gfx-check --disable-vnc-tls --disable-brlapi --disable-kqemu ZLIB_VERSION=1.2.3 LIBPCI_VERSION=2.2.9 NEWLIB_VERSION=1.16.0 @@ -48,10 +50,12 @@ TARGET_CFLAGS += $(call cc-option,$(CC),-fno-stack-protector-all,) # Do not use host headers and libs GCC_INSTALL = $(shell gcc -print-search-dirs | sed -n -e 's/install: \(.*\)/\1/p') TARGET_CPPFLAGS += -U __linux__ -U __FreeBSD__ -U __sun__ -TARGET_CFLAGS += -nostdinc -TARGET_CPPFLAGS += -isystem $(realpath $(MINI_OS)/include/posix) +TARGET_CPPFLAGS += -nostdinc +TARGET_CPPFLAGS += -isystem $(abspath $(MINI_OS)/include/posix) TARGET_CPPFLAGS += -isystem $(CROSS_PREFIX)/$(GNU_TARGET_ARCH)-xen-elf/include TARGET_CPPFLAGS += -isystem $(GCC_INSTALL)include +TARGET_CPPFLAGS += -isystem $(CURDIR)/lwip-cvs/src/include +TARGET_CPPFLAGS += -isystem $(CURDIR)/lwip-cvs/src/include/ipv4 TARGET_CPPFLAGS += -I$(CURDIR)/include TARGET_LDFLAGS += -nostdlib -L$(CROSS_PREFIX)/$(GNU_TARGET_ARCH)-xen-elf/lib @@ -149,6 +153,7 @@ $(CROSS_ROOT): cross-newlib cross-zlib cross-libpci mk-headers: mkdir -p include/xen && \ ln -sf $(addprefix ../../,$(wildcard $(XEN_ROOT)/xen/include/public/*.h)) include/xen && \ + ln -sf $(addprefix ../../$(XEN_ROOT)/xen/include/public/,arch-ia64 arch-x86 hvm io xsm) include/xen && \ ( [ -h include/xen/sys ] || ln -sf ../../$(XEN_ROOT)/tools/include/xen-sys/MiniOS include/xen/sys ) && \ mkdir -p include/xen-foreign && \ ln -sf $(addprefix ../../,$(wildcard $(XEN_ROOT)/tools/include/xen-foreign/*)) include/xen-foreign/ && \ @@ -165,10 +170,21 @@ mk-headers: ln -sf ../$(XEN_ROOT)/tools/libxc/$(XEN_TARGET_ARCH)/*.h . && \ ln -sf ../$(XEN_ROOT)/tools/libxc/$(XEN_TARGET_ARCH)/Makefile . ) mkdir -p ioemu +ifeq ($(CONFIG_QEMU),ioemu) + [ -h ioemu/Makefile ] || ( cd ioemu && \ + ln -sf ../$(XEN_ROOT)/tools/ioemu/* .) +else [ -h ioemu/Makefile ] || ( cd ioemu && \ - ln -sf ../$(XEN_ROOT)/tools/ioemu/* . && \ - ([ ! -h config-host.h ] || rm -f config-host.h) && \ - ([ ! -h config-host.mak ] || rm -f config-host.mak) ) + ln -sf $(CONFIG_QEMU)/* . && \ + rm -fr i386-dm && \ + rm -fr i386-stubdom && \ + mkdir i386-dm && \ + mkdir i386-stubdom && \ + ln -sf $(CONFIG_QEMU)/i386-dm/* i386-dm/ && \ + ln -sf $(CONFIG_QEMU)/i386-stubdom/* i386-stubdom/ ) +endif + [ ! -h ioemu/config-host.h ] || rm -f ioemu/config-host.h + [ ! -h ioemu/config-host.mak ] || rm -f ioemu/config-host.mak $(MAKE) -C $(MINI_OS) links TARGETS_MINIOS=$(addprefix mini-os-,$(TARGETS)) @@ -193,10 +209,17 @@ libxc/libxenctrl.a libxc/libxenguest.a:: cross-zlib mk-headers .PHONY: ioemu ioemu: cross-zlib cross-libpci mk-headers libxc +ifeq ($(CONFIG_QEMU),ioemu) [ -f ioemu/config-host.mak ] || \ ( cd ioemu ; \ XEN_TARGET_ARCH=$(XEN_TARGET_ARCH) CFLAGS="$(TARGET_CFLAGS)" sh configure --prefix=/usr --enable-stubdom $(IOEMU_OPTIONS)) CPPFLAGS="$(TARGET_CPPFLAGS)" $(MAKE) -C ioemu LWIPDIR=$(CURDIR)/lwip-cvs TOOLS= +else + [ -f ioemu/config-host.mak ] || \ + ( cd ioemu ; \ + CONFIG_STUBDOM=yes XEN_ROOT=$(abspath $(XEN_ROOT)) XEN_TARGET_ARCH=$(XEN_TARGET_ARCH) CFLAGS="$(TARGET_CFLAGS)" sh ./xen-setup --cc=$(CC) --disable-gcc-check $(IOEMU_OPTIONS)) + CPPFLAGS= TARGET_CPPFLAGS="$(TARGET_CPPFLAGS)" $(MAKE) -C ioemu LWIPDIR=$(CURDIR)/lwip-cvs TOOLS= CONFIG_STUBDOM=yes +endif ###### # caml @@ -233,8 +256,13 @@ grub: grub-cvs cross-newlib mk-headers ######## .PHONY: ioemu-stubdom +ifeq ($(CONFIG_QEMU),ioemu) +ioemu-stubdom: APP_OBJS=$(CURDIR)/ioemu/i386-dm-stubdom/qemu.a $(CURDIR)/ioemu/i386-dm-stubdom/libqemu.a +else +ioemu-stubdom: APP_OBJS=$(CURDIR)/ioemu/i386-stubdom/qemu.a $(CURDIR)/ioemu/i386-stubdom/libqemu.a $(CURDIR)/ioemu/libqemu_common.a +endif ioemu-stubdom: mini-os-ioemu lwip-cvs libxc ioemu - DEF_CPPFLAGS="$(TARGET_CPPFLAGS)" DEF_CFLAGS="-DCONFIG_QEMU $(TARGET_CFLAGS)" DEF_LDFLAGS="$(TARGET_LDFLAGS)" $(MAKE) -C $(MINI_OS) OBJ_DIR=$(CURDIR)/$< LWIPDIR=$(CURDIR)/lwip-cvs APP_OBJS="$(CURDIR)/ioemu/i386-dm-stubdom/qemu.a $(CURDIR)/ioemu/i386-dm-stubdom/libqemu.a" + DEF_CPPFLAGS="$(TARGET_CPPFLAGS)" DEF_CFLAGS="-DCONFIG_QEMU $(TARGET_CFLAGS)" DEF_LDFLAGS="$(TARGET_LDFLAGS)" $(MAKE) -C $(MINI_OS) OBJ_DIR=$(CURDIR)/$< LWIPDIR=$(CURDIR)/lwip-cvs APP_OBJS="$(APP_OBJS)" CAMLLIB = $(shell ocamlc -where) .PHONY: caml-stubdom @@ -302,7 +330,7 @@ patchclean: crossclean # clean downloads .PHONY: downloadclean downloadclean: patchclean - rm -f newlib-$(ZLIB_VERSION).tar.gz + rm -f newlib-$(NEWLIB_VERSION).tar.gz rm -f zlib-$(ZLIB_VERSION).tar.gz rm -f pciutils-$(LIBPCI_VERSION).tar.bz2 |