ia64/xen-unstable

changeset 11879:3409c35a0b0e

[OpenBSD] Various changes to get Xen building on OpenBSD.
Signed-off-by: Keir Fraser <keir@xensource.com>
author kfraser@localhost.localdomain
date Wed Oct 18 17:08:09 2006 +0100 (2006-10-18)
parents 307e5ed9657e
children 7b99b8bdbc85
files config/Linux.mk config/OpenBSD.mk config/StdGNU.mk config/SunOS.mk config/x86_32.mk config/x86_64.mk xen/Rules.mk xen/common/vsprintf.c xen/drivers/char/console.c xen/include/xen/lib.h xen/include/xen/stdarg.h
line diff
     1.1 --- a/config/Linux.mk	Wed Oct 18 16:56:27 2006 +0100
     1.2 +++ b/config/Linux.mk	Wed Oct 18 17:08:09 2006 +0100
     1.3 @@ -1,35 +1,4 @@
     1.4 -# -*- mode: Makefile; -*-
     1.5 -
     1.6 -AS         = $(CROSS_COMPILE)as
     1.7 -LD         = $(CROSS_COMPILE)ld
     1.8 -CC         = $(CROSS_COMPILE)gcc
     1.9 -CPP        = $(CROSS_COMPILE)gcc -E
    1.10 -AR         = $(CROSS_COMPILE)ar
    1.11 -RANLIB     = $(CROSS_COMPILE)ranlib
    1.12 -NM         = $(CROSS_COMPILE)nm
    1.13 -STRIP      = $(CROSS_COMPILE)strip
    1.14 -OBJCOPY    = $(CROSS_COMPILE)objcopy
    1.15 -OBJDUMP    = $(CROSS_COMPILE)objdump
    1.16 -
    1.17 -INSTALL      = install
    1.18 -INSTALL_DIR  = $(INSTALL) -d -m0755
    1.19 -INSTALL_DATA = $(INSTALL) -m0644
    1.20 -INSTALL_PROG = $(INSTALL) -m0755
    1.21 -
    1.22 -LIB64DIR = lib64
    1.23 -
    1.24 -SOCKET_LIBS =
    1.25 -CURSES_LIBS = -lncurses
    1.26 -SONAME_LDFLAG = -soname
    1.27 -SHLIB_CFLAGS = -shared
    1.28 -
    1.29 -ifneq ($(debug),y)
    1.30 -# Optimisation flags are overridable
    1.31 -CFLAGS ?= -O2 -fomit-frame-pointer
    1.32 -else
    1.33 -# Less than -O1 produces bad code and large stack frames
    1.34 -CFLAGS ?= -O1 -fno-omit-frame-pointer
    1.35 -endif
    1.36 +include $(XEN_ROOT)/config/StdGNU.mk
    1.37  
    1.38  # You may use wildcards, e.g. KERNELS=*2.6*
    1.39  KERNELS ?= linux-2.6-xen
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/config/OpenBSD.mk	Wed Oct 18 17:08:09 2006 +0100
     2.3 @@ -0,0 +1,1 @@
     2.4 +include $(XEN_ROOT)/config/StdGNU.mk
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/config/StdGNU.mk	Wed Oct 18 17:08:09 2006 +0100
     3.3 @@ -0,0 +1,30 @@
     3.4 +AS         = $(CROSS_COMPILE)as
     3.5 +LD         = $(CROSS_COMPILE)ld
     3.6 +CC         = $(CROSS_COMPILE)gcc
     3.7 +CPP        = $(CROSS_COMPILE)gcc -E
     3.8 +AR         = $(CROSS_COMPILE)ar
     3.9 +RANLIB     = $(CROSS_COMPILE)ranlib
    3.10 +NM         = $(CROSS_COMPILE)nm
    3.11 +STRIP      = $(CROSS_COMPILE)strip
    3.12 +OBJCOPY    = $(CROSS_COMPILE)objcopy
    3.13 +OBJDUMP    = $(CROSS_COMPILE)objdump
    3.14 +
    3.15 +INSTALL      = install
    3.16 +INSTALL_DIR  = $(INSTALL) -d -m0755
    3.17 +INSTALL_DATA = $(INSTALL) -m0644
    3.18 +INSTALL_PROG = $(INSTALL) -m0755
    3.19 +
    3.20 +LIB64DIR = lib64
    3.21 +
    3.22 +SOCKET_LIBS =
    3.23 +CURSES_LIBS = -lncurses
    3.24 +SONAME_LDFLAG = -soname
    3.25 +SHLIB_CFLAGS = -shared
    3.26 +
    3.27 +ifneq ($(debug),y)
    3.28 +# Optimisation flags are overridable
    3.29 +CFLAGS ?= -O2 -fomit-frame-pointer
    3.30 +else
    3.31 +# Less than -O1 produces bad code and large stack frames
    3.32 +CFLAGS ?= -O1 -fno-omit-frame-pointer
    3.33 +endif
     4.1 --- a/config/SunOS.mk	Wed Oct 18 16:56:27 2006 +0100
     4.2 +++ b/config/SunOS.mk	Wed Oct 18 17:08:09 2006 +0100
     4.3 @@ -1,5 +1,3 @@
     4.4 -# -*- mode: Makefile; -*-
     4.5 -
     4.6  AS         = $(CROSS_COMPILE)gas
     4.7  LD         = $(CROSS_COMPILE)gld
     4.8  CC         = $(CROSS_COMPILE)gcc
     5.1 --- a/config/x86_32.mk	Wed Oct 18 16:56:27 2006 +0100
     5.2 +++ b/config/x86_32.mk	Wed Oct 18 17:08:09 2006 +0100
     5.3 @@ -10,4 +10,8 @@ CFLAGS += -m32 -march=i686
     5.4  LIBDIR := lib
     5.5  
     5.6  # Use only if calling $(LD) directly.
     5.7 +ifeq ($(XEN_OS),OpenBSD)
     5.8 +LDFLAGS_DIRECT += -melf_i386_obsd
     5.9 +else
    5.10  LDFLAGS_DIRECT += -melf_i386
    5.11 +endif
     6.1 --- a/config/x86_64.mk	Wed Oct 18 16:56:27 2006 +0100
     6.2 +++ b/config/x86_64.mk	Wed Oct 18 17:08:09 2006 +0100
     6.3 @@ -10,4 +10,8 @@ CFLAGS += -m64
     6.4  LIBDIR = $(LIB64DIR)
     6.5  
     6.6  # Use only if calling $(LD) directly.
     6.7 +ifeq ($(XEN_OS),OpenBSD)
     6.8 +LDFLAGS_DIRECT += -melf_x86_64_obsd
     6.9 +else
    6.10  LDFLAGS_DIRECT += -melf_x86_64
    6.11 +endif
     7.1 --- a/xen/Rules.mk	Wed Oct 18 16:56:27 2006 +0100
     7.2 +++ b/xen/Rules.mk	Wed Oct 18 17:08:09 2006 +0100
     7.3 @@ -72,7 +72,7 @@ AFLAGS   := $(strip $(AFLAGS) $(AFLAGS-y
     7.4  AFLAGS   += $(patsubst -std=gnu%,,$(CFLAGS))
     7.5  
     7.6  # LDFLAGS are only passed directly to $(LD)
     7.7 -LDFLAGS  += $(LDFLAGS_DIRECT)
     7.8 +LDFLAGS  := $(strip $(LDFLAGS) $(LDFLAGS_DIRECT))
     7.9  
    7.10  include Makefile
    7.11  
     8.1 --- a/xen/common/vsprintf.c	Wed Oct 18 16:56:27 2006 +0100
     8.2 +++ b/xen/common/vsprintf.c	Wed Oct 18 17:08:09 2006 +0100
     8.3 @@ -16,7 +16,7 @@
     8.4   * - scnprintf and vscnprintf
     8.5   */
     8.6  
     8.7 -#include <stdarg.h>
     8.8 +#include <xen/stdarg.h>
     8.9  #include <xen/ctype.h>
    8.10  #include <xen/lib.h>
    8.11  #include <asm/div64.h>
     9.1 --- a/xen/drivers/char/console.c	Wed Oct 18 16:56:27 2006 +0100
     9.2 +++ b/xen/drivers/char/console.c	Wed Oct 18 17:08:09 2006 +0100
     9.3 @@ -6,7 +6,7 @@
     9.4   * Copyright (c) 2002-2004, K A Fraser.
     9.5   */
     9.6  
     9.7 -#include <stdarg.h>
     9.8 +#include <xen/stdarg.h>
     9.9  #include <xen/config.h>
    9.10  #include <xen/version.h>
    9.11  #include <xen/init.h>
    10.1 --- a/xen/include/xen/lib.h	Wed Oct 18 16:56:27 2006 +0100
    10.2 +++ b/xen/include/xen/lib.h	Wed Oct 18 17:08:09 2006 +0100
    10.3 @@ -2,7 +2,7 @@
    10.4  #define __LIB_H__
    10.5  
    10.6  #include <xen/inttypes.h>
    10.7 -#include <stdarg.h>
    10.8 +#include <xen/stdarg.h>
    10.9  #include <xen/config.h>
   10.10  #include <xen/types.h>
   10.11  #include <xen/xmalloc.h>
    11.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    11.2 +++ b/xen/include/xen/stdarg.h	Wed Oct 18 17:08:09 2006 +0100
    11.3 @@ -0,0 +1,5 @@
    11.4 +#if defined(__OpenBSD__) || defined(__sun__)
    11.5 +#  include "/usr/include/stdarg.h"
    11.6 +#else
    11.7 +#  include <stdarg.h>
    11.8 +#endif