ia64/xen-unstable

changeset 10190:b049fb947f2a

[MINIOS] Allows the use of a C library without modifying Mini-OS source files.
From: John Ramsdell
Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Fri May 26 13:23:18 2006 +0100 (2006-05-26)
parents 96ce5961b5eb
children 2dc7c2712700
files extras/mini-os/Makefile extras/mini-os/lib/printf.c extras/mini-os/lib/string.c
line diff
     1.1 --- a/extras/mini-os/Makefile	Fri May 26 11:23:55 2006 +0100
     1.2 +++ b/extras/mini-os/Makefile	Fri May 26 13:23:18 2006 +0100
     1.3 @@ -13,6 +13,7 @@ CFLAGS += -Wstrict-prototypes -Wnested-e
     1.4  override CPPFLAGS := -Iinclude $(CPPFLAGS)
     1.5  ASFLAGS = -D__ASSEMBLY__
     1.6  
     1.7 +LDLIBS =  -L. -lminios
     1.8  LDFLAGS := -N -T minios-$(TARGET_ARCH).lds
     1.9  
    1.10  ifeq ($(TARGET_ARCH),x86_32)
    1.11 @@ -55,11 +56,11 @@ default: $(TARGET)
    1.12  links:
    1.13  	[ -e include/xen ] || ln -sf ../../../xen/include/public include/xen
    1.14  
    1.15 -libminios.a: $(OBJS) $(HEAD)
    1.16 -	ar r libminios.a $(HEAD) $(OBJS)
    1.17 +libminios.a: links $(OBJS) $(HEAD)
    1.18 +	$(AR) r libminios.a $(HEAD) $(OBJS)
    1.19  
    1.20 -$(TARGET): links libminios.a $(HEAD)
    1.21 -	$(LD) $(LDFLAGS) $(HEAD) -L. -lminios -o $@.elf
    1.22 +$(TARGET): libminios.a $(HEAD)
    1.23 +	$(LD) $(LDFLAGS) $(HEAD) $(LDLIBS) -o $@.elf
    1.24  	gzip -f -9 -c $@.elf >$@.gz
    1.25  
    1.26  .PHONY: clean
     2.1 --- a/extras/mini-os/lib/printf.c	Fri May 26 11:23:55 2006 +0100
     2.2 +++ b/extras/mini-os/lib/printf.c	Fri May 26 13:23:18 2006 +0100
     2.3 @@ -54,6 +54,8 @@
     2.4   * $FreeBSD: src/sys/libkern/divdi3.c,v 1.6 1999/08/28 00:46:31 peter Exp $
     2.5   */
     2.6  
     2.7 +#if !defined HAVE_LIBC
     2.8 +
     2.9  #include <os.h>
    2.10  #include <types.h>
    2.11  #include <hypervisor.h>
    2.12 @@ -789,4 +791,4 @@ int sscanf(const char * buf, const char 
    2.13  	return i;
    2.14  }
    2.15  
    2.16 -
    2.17 +#endif
     3.1 --- a/extras/mini-os/lib/string.c	Fri May 26 11:23:55 2006 +0100
     3.2 +++ b/extras/mini-os/lib/string.c	Fri May 26 13:23:18 2006 +0100
     3.3 @@ -18,6 +18,8 @@
     3.4   ****************************************************************************
     3.5   */
     3.6  
     3.7 +#if !defined HAVE_LIBC
     3.8 +
     3.9  #include <os.h>
    3.10  #include <types.h>
    3.11  #include <lib.h>
    3.12 @@ -153,3 +155,5 @@ char * strstr(const char * s1,const char
    3.13          }
    3.14          return NULL;
    3.15  }
    3.16 +
    3.17 +#endif