From mboxrd@z Thu Jan 1 00:00:00 1970 From: Samuel Thibault Subject: [PATCH] stubdom: fixes to compile with qemu-xen Date: Thu, 10 Jul 2008 12:28:49 +0100 Message-ID: <20080710112849.GN4536@implementation.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org 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 diff -r aab9fbd6ffa0 extras/mini-os/Config.mk --- a/extras/mini-os/Config.mk Thu Jul 10 11:26:42 2008 +0100 +++ b/extras/mini-os/Config.mk Thu Jul 10 12:16:12 2008 +0100 @@ -38,20 +38,20 @@ # 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 -r aab9fbd6ffa0 extras/mini-os/Makefile --- a/extras/mini-os/Makefile Thu Jul 10 11:26:42 2008 +0100 +++ b/extras/mini-os/Makefile Thu Jul 10 12:16:12 2008 +0100 @@ -55,6 +55,8 @@ .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 @@ 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 -r aab9fbd6ffa0 extras/mini-os/include/arch/cc.h --- a/extras/mini-os/include/arch/cc.h Thu Jul 10 11:26:42 2008 +0100 +++ b/extras/mini-os/include/arch/cc.h Thu Jul 10 12:16:12 2008 +0100 @@ -10,8 +10,8 @@ #define __LWIP_ARCH_CC_H__ /* Typedefs for the types used by lwip - */ -#include -#include +#include +#include #include typedef u8 u8_t; typedef s8 s8_t; @@ -46,7 +46,7 @@ /* If the compiler does not provide memset() this file must include a */ /* definition of it, or include a file which defines it. */ -#include +#include /* This file must either include a system-local which defines */ /* the standard *nix error codes, or it should #define LWIP_PROVIDE_ERRNO */ diff -r aab9fbd6ffa0 extras/mini-os/include/arch/sys_arch.h --- a/extras/mini-os/include/arch/sys_arch.h Thu Jul 10 11:26:42 2008 +0100 +++ b/extras/mini-os/include/arch/sys_arch.h Thu Jul 10 12:16:12 2008 +0100 @@ -9,9 +9,9 @@ #ifndef __LWIP_ARCH_SYS_ARCH_H__ #define __LWIP_ARCH_SYS_ARCH_H__ -#include -#include -#include +#include +#include +#include typedef struct semaphore *sys_sem_t; #define SYS_SEM_NULL ((sys_sem_t) NULL) diff -r aab9fbd6ffa0 extras/mini-os/include/blkfront.h --- a/extras/mini-os/include/blkfront.h Thu Jul 10 11:26:42 2008 +0100 +++ b/extras/mini-os/include/blkfront.h Thu Jul 10 12:16:12 2008 +0100 @@ -1,6 +1,6 @@ -#include +#include #include -#include +#include struct blkfront_dev; struct blkfront_aiocb { diff -r aab9fbd6ffa0 extras/mini-os/include/byteswap.h --- a/extras/mini-os/include/byteswap.h Thu Jul 10 11:26:42 2008 +0100 +++ b/extras/mini-os/include/byteswap.h Thu Jul 10 12:16:12 2008 +0100 @@ -3,7 +3,7 @@ /* Unfortunately not provided by newlib. */ -#include +#include static inline uint16_t bswap_16(uint16_t x) { return diff -r aab9fbd6ffa0 extras/mini-os/include/console.h --- a/extras/mini-os/include/console.h Thu Jul 10 11:26:42 2008 +0100 +++ b/extras/mini-os/include/console.h Thu Jul 10 12:16:12 2008 +0100 @@ -36,8 +36,8 @@ #ifndef _LIB_CONSOLE_H_ #define _LIB_CONSOLE_H_ -#include -#include +#include +#include #include void print(int direct, const char *fmt, va_list args); diff -r aab9fbd6ffa0 extras/mini-os/include/err.h --- a/extras/mini-os/include/err.h Thu Jul 10 11:26:42 2008 +0100 +++ b/extras/mini-os/include/err.h Thu Jul 10 12:16:12 2008 +0100 @@ -1,7 +1,7 @@ #ifndef _ERR_H #define _ERR_H -#include +#include /* * Kernel pointers have redundant information, so we can use a diff -r aab9fbd6ffa0 extras/mini-os/include/errno.h --- a/extras/mini-os/include/errno.h Thu Jul 10 11:26:42 2008 +0100 +++ b/extras/mini-os/include/errno.h Thu Jul 10 12:16:12 2008 +0100 @@ -1,7 +1,7 @@ #ifndef _ERRNO_H #define _ERRNO_H -#include +#include typedef int error_t; @@ -113,7 +113,7 @@ #define EFTYPE 132 /* Inappropriate file type or format */ #ifdef HAVE_LIBC -#include +#include extern int errno; #define ERRNO #define errno (get_current()->reent._errno) diff -r aab9fbd6ffa0 extras/mini-os/include/events.h --- a/extras/mini-os/include/events.h Thu Jul 10 11:26:42 2008 +0100 +++ b/extras/mini-os/include/events.h Thu Jul 10 12:16:12 2008 +0100 @@ -19,7 +19,7 @@ #ifndef _EVENTS_H_ #define _EVENTS_H_ -#include +#include #include typedef void (*evtchn_handler_t)(evtchn_port_t, struct pt_regs *, void *); diff -r aab9fbd6ffa0 extras/mini-os/include/fbfront.h --- a/extras/mini-os/include/fbfront.h Thu Jul 10 11:26:42 2008 +0100 +++ b/extras/mini-os/include/fbfront.h Thu Jul 10 12:16:12 2008 +0100 @@ -1,6 +1,6 @@ #include #include -#include +#include /* from */ #ifndef BTN_LEFT diff -r aab9fbd6ffa0 extras/mini-os/include/fs.h --- a/extras/mini-os/include/fs.h Thu Jul 10 11:26:42 2008 +0100 +++ b/extras/mini-os/include/fs.h Thu Jul 10 12:16:12 2008 +0100 @@ -2,8 +2,8 @@ #define __FS_H__ #include -#include -#include +#include +#include struct fs_import { diff -r aab9fbd6ffa0 extras/mini-os/include/hypervisor.h --- a/extras/mini-os/include/hypervisor.h Thu Jul 10 11:26:42 2008 +0100 +++ b/extras/mini-os/include/hypervisor.h Thu Jul 10 12:16:12 2008 +0100 @@ -13,7 +13,7 @@ #ifndef _HYPERVISOR_H_ #define _HYPERVISOR_H_ -#include +#include #include #if defined(__i386__) #include @@ -24,7 +24,7 @@ #else #error "Unsupported architecture" #endif -#include +#include /* * a placeholder for the start of day information passed up from the hypervisor diff -r aab9fbd6ffa0 extras/mini-os/include/ia64/atomic.h --- a/extras/mini-os/include/ia64/atomic.h Thu Jul 10 11:26:42 2008 +0100 +++ b/extras/mini-os/include/ia64/atomic.h Thu Jul 10 12:16:12 2008 +0100 @@ -38,7 +38,7 @@ #if !defined(__ASSEMBLY__) -#include +#include /* diff -r aab9fbd6ffa0 extras/mini-os/include/ia64/efi.h --- a/extras/mini-os/include/ia64/efi.h Thu Jul 10 11:26:42 2008 +0100 +++ b/extras/mini-os/include/ia64/efi.h Thu Jul 10 12:16:12 2008 +0100 @@ -32,7 +32,7 @@ #ifndef _EFI_H_ #define _EFI_H_ -#include "types.h" +#include #define EFIWARN(a) (a) diff -r aab9fbd6ffa0 extras/mini-os/include/ia64/endian.h --- a/extras/mini-os/include/ia64/endian.h Thu Jul 10 11:26:42 2008 +0100 +++ b/extras/mini-os/include/ia64/endian.h Thu Jul 10 12:16:12 2008 +0100 @@ -26,7 +26,7 @@ #if !defined(_ENDIAN_H_) #define _ENDIAN_H_ -#include "types.h" +#include #if !defined(__ASSEMBLY__) diff -r aab9fbd6ffa0 extras/mini-os/include/ia64/hypercall-ia64.h --- a/extras/mini-os/include/ia64/hypercall-ia64.h Thu Jul 10 11:26:42 2008 +0100 +++ b/extras/mini-os/include/ia64/hypercall-ia64.h Thu Jul 10 12:16:12 2008 +0100 @@ -34,8 +34,8 @@ #ifndef __HYPERCALL_H__ #define __HYPERCALL_H__ -#include "lib.h" /* memcpy() */ -#include "errno.h" /* ENOSYS() */ +#include /* memcpy() */ +#include /* ENOSYS() */ #include #include #include diff -r aab9fbd6ffa0 extras/mini-os/include/ia64/os.h --- a/extras/mini-os/include/ia64/os.h Thu Jul 10 11:26:42 2008 +0100 +++ b/extras/mini-os/include/ia64/os.h Thu Jul 10 12:16:12 2008 +0100 @@ -27,15 +27,15 @@ #if !defined(__ASSEMBLY__) -#include "types.h" +#include #include "endian.h" #include "ia64_cpu.h" #include "atomic.h" #include "efi.h" #include "sal.h" #include "pal.h" -#include "hypervisor.h" -#include +#include +#include typedef uint64_t paddr_t; /* Physical address. */ diff -r aab9fbd6ffa0 extras/mini-os/include/lib.h --- a/extras/mini-os/include/lib.h Thu Jul 10 11:26:42 2008 +0100 +++ b/extras/mini-os/include/lib.h Thu Jul 10 12:16:12 2008 +0100 @@ -99,13 +99,13 @@ char * strcat(char * dest, const char * src); char *strdup(const char *s); #endif -#include +#include #define RAND_MIX 2654435769U int rand(void); -#include +#include #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) diff -r aab9fbd6ffa0 extras/mini-os/include/linux/types.h --- a/extras/mini-os/include/linux/types.h Thu Jul 10 11:26:42 2008 +0100 +++ b/extras/mini-os/include/linux/types.h Thu Jul 10 12:16:12 2008 +0100 @@ -1,5 +1,5 @@ #ifndef _LINUX_TYPES_H_ #define _LINUX_TYPES_H_ -#include +#include typedef u64 __u64; #endif /* _LINUX_TYPES_H_ */ diff -r aab9fbd6ffa0 extras/mini-os/include/mm.h --- a/extras/mini-os/include/mm.h Thu Jul 10 11:26:42 2008 +0100 +++ b/extras/mini-os/include/mm.h Thu Jul 10 12:16:12 2008 +0100 @@ -35,10 +35,10 @@ #error "Unsupported architecture" #endif -#include +#include -#include -#include +#include +#include #define STACK_SIZE_PAGE_ORDER __STACK_SIZE_PAGE_ORDER #define STACK_SIZE __STACK_SIZE diff -r aab9fbd6ffa0 extras/mini-os/include/netfront.h --- a/extras/mini-os/include/netfront.h Thu Jul 10 11:26:42 2008 +0100 +++ b/extras/mini-os/include/netfront.h Thu Jul 10 12:16:12 2008 +0100 @@ -1,4 +1,4 @@ -#include +#include #ifdef HAVE_LWIP #include #endif diff -r aab9fbd6ffa0 extras/mini-os/include/pcifront.h --- a/extras/mini-os/include/pcifront.h Thu Jul 10 11:26:42 2008 +0100 +++ b/extras/mini-os/include/pcifront.h Thu Jul 10 12:16:12 2008 +0100 @@ -1,4 +1,4 @@ -#include +#include #include struct pcifront_dev; struct pcifront_dev *init_pcifront(char *nodename); diff -r aab9fbd6ffa0 extras/mini-os/include/posix/limits.h --- a/extras/mini-os/include/posix/limits.h Thu Jul 10 11:26:42 2008 +0100 +++ b/extras/mini-os/include/posix/limits.h Thu Jul 10 12:16:12 2008 +0100 @@ -1,7 +1,7 @@ #ifndef _POSIX_LIMITS_H #define _POSIX_LIMITS_H -#include +#include #define CHAR_BIT 8 diff -r aab9fbd6ffa0 extras/mini-os/include/posix/sys/select.h --- a/extras/mini-os/include/posix/sys/select.h Thu Jul 10 11:26:42 2008 +0100 +++ b/extras/mini-os/include/posix/sys/select.h Thu Jul 10 12:16:12 2008 +0100 @@ -2,6 +2,7 @@ #define _POSIX_SELECT_H #include +#include int select(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout); #endif /* _POSIX_SELECT_H */ diff -r aab9fbd6ffa0 extras/mini-os/include/posix/unistd.h --- a/extras/mini-os/include/posix/unistd.h Thu Jul 10 11:26:42 2008 +0100 +++ b/extras/mini-os/include/posix/unistd.h Thu Jul 10 12:16:12 2008 +0100 @@ -2,8 +2,7 @@ #define _POSIX_UNISTD_H #include_next -#include -#include +#include #define getpagesize() __PAGE_SIZE diff -r aab9fbd6ffa0 extras/mini-os/include/sched.h --- a/extras/mini-os/include/sched.h Thu Jul 10 11:26:42 2008 +0100 +++ b/extras/mini-os/include/sched.h Thu Jul 10 12:16:12 2008 +0100 @@ -1,9 +1,12 @@ #ifndef __SCHED_H__ #define __SCHED_H__ -#include -#include -#include +#include +#include +#include +#ifdef HAVE_LIBC +#include +#endif struct thread { diff -r aab9fbd6ffa0 extras/mini-os/include/semaphore.h --- a/extras/mini-os/include/semaphore.h Thu Jul 10 11:26:42 2008 +0100 +++ b/extras/mini-os/include/semaphore.h Thu Jul 10 12:16:12 2008 +0100 @@ -1,8 +1,8 @@ #ifndef _SEMAPHORE_H_ #define _SEMAPHORE_H_ -#include -#include +#include +#include /* * Implementation of semaphore in Mini-os is simple, because diff -r aab9fbd6ffa0 extras/mini-os/include/spinlock.h --- a/extras/mini-os/include/spinlock.h Thu Jul 10 11:26:42 2008 +0100 +++ b/extras/mini-os/include/spinlock.h Thu Jul 10 12:16:12 2008 +0100 @@ -1,7 +1,7 @@ #ifndef __ASM_SPINLOCK_H #define __ASM_SPINLOCK_H -#include +#include /* * Your basic SMP spinlocks, allowing only a single CPU anywhere @@ -12,7 +12,7 @@ } spinlock_t; -#include "arch_spinlock.h" +#include #define SPINLOCK_MAGIC 0xdead4ead diff -r aab9fbd6ffa0 extras/mini-os/include/sys/lock.h --- a/extras/mini-os/include/sys/lock.h Thu Jul 10 11:26:42 2008 +0100 +++ b/extras/mini-os/include/sys/lock.h Thu Jul 10 12:16:12 2008 +0100 @@ -5,7 +5,7 @@ /* Due to inclusion loop, we can not include sched.h, so have to hide things */ -#include +#include typedef struct { diff -r aab9fbd6ffa0 extras/mini-os/include/time.h --- a/extras/mini-os/include/time.h Thu Jul 10 11:26:42 2008 +0100 +++ b/extras/mini-os/include/time.h Thu Jul 10 12:16:12 2008 +0100 @@ -19,7 +19,7 @@ #ifndef _MINIOS_TIME_H_ #define _MINIOS_TIME_H_ -#include +#include /* * System Time diff -r aab9fbd6ffa0 extras/mini-os/include/wait.h --- a/extras/mini-os/include/wait.h Thu Jul 10 11:26:42 2008 +0100 +++ b/extras/mini-os/include/wait.h Thu Jul 10 12:16:12 2008 +0100 @@ -1,9 +1,9 @@ #ifndef __WAIT_H__ #define __WAIT_H__ -#include -#include -#include +#include +#include +#include #define DEFINE_WAIT(name) \ struct wait_queue name = { \ diff -r aab9fbd6ffa0 extras/mini-os/include/waittypes.h --- a/extras/mini-os/include/waittypes.h Thu Jul 10 11:26:42 2008 +0100 +++ b/extras/mini-os/include/waittypes.h Thu Jul 10 12:16:12 2008 +0100 @@ -1,7 +1,7 @@ #ifndef __WAITTYPE_H__ #define __WAITTYPE_H__ -#include +#include struct thread; struct wait_queue diff -r aab9fbd6ffa0 extras/mini-os/include/x86/arch_sched.h --- a/extras/mini-os/include/x86/arch_sched.h Thu Jul 10 11:26:42 2008 +0100 +++ b/extras/mini-os/include/x86/arch_sched.h Thu Jul 10 12:16:12 2008 +0100 @@ -2,7 +2,7 @@ #ifndef __ARCH_SCHED_H__ #define __ARCH_SCHED_H__ -#include +#include "arch_limits.h" static inline struct thread* get_current(void) { diff -r aab9fbd6ffa0 extras/mini-os/include/x86/arch_spinlock.h --- a/extras/mini-os/include/x86/arch_spinlock.h Thu Jul 10 11:26:42 2008 +0100 +++ b/extras/mini-os/include/x86/arch_spinlock.h Thu Jul 10 12:16:12 2008 +0100 @@ -3,7 +3,7 @@ #ifndef __ARCH_ASM_SPINLOCK_H #define __ARCH_ASM_SPINLOCK_H -#include +#include #include "os.h" diff -r aab9fbd6ffa0 extras/mini-os/include/x86/os.h --- a/extras/mini-os/include/x86/os.h Thu Jul 10 11:26:42 2008 +0100 +++ b/extras/mini-os/include/x86/os.h Thu Jul 10 12:16:12 2008 +0100 @@ -16,9 +16,9 @@ #ifndef __ASSEMBLY__ -#include -#include -#include +#include +#include +#include #define USED __attribute__ ((used)) diff -r aab9fbd6ffa0 extras/mini-os/include/x86/x86_32/hypercall-x86_32.h --- a/extras/mini-os/include/x86/x86_32/hypercall-x86_32.h Thu Jul 10 11:26:42 2008 +0100 +++ b/extras/mini-os/include/x86/x86_32/hypercall-x86_32.h Thu Jul 10 12:16:12 2008 +0100 @@ -33,7 +33,7 @@ #include #include #include -#include +#include #define __STR(x) #x #define STR(x) __STR(x) diff -r aab9fbd6ffa0 extras/mini-os/include/x86/x86_64/hypercall-x86_64.h --- a/extras/mini-os/include/x86/x86_64/hypercall-x86_64.h Thu Jul 10 11:26:42 2008 +0100 +++ b/extras/mini-os/include/x86/x86_64/hypercall-x86_64.h Thu Jul 10 12:16:12 2008 +0100 @@ -36,7 +36,7 @@ #include #include -#include +#include #define __STR(x) #x #define STR(x) __STR(x) diff -r aab9fbd6ffa0 stubdom/Makefile --- a/stubdom/Makefile Thu Jul 10 11:26:42 2008 +0100 +++ b/stubdom/Makefile Thu Jul 10 12:16:13 2008 +0100 @@ -3,11 +3,13 @@ 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 +51,12 @@ # 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 +154,7 @@ 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 +171,21 @@ 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/* . && \ - ([ ! -h config-host.h ] || rm -f config-host.h) && \ - ([ ! -h config-host.mak ] || rm -f config-host.mak) ) + ln -sf ../$(XEN_ROOT)/tools/ioemu/* .) +else + [ -h ioemu/Makefile ] || ( cd ioemu && \ + 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 +210,17 @@ .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 +257,13 @@ ######## .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 +331,7 @@ # 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