ia64/xen-unstable

changeset 12637:9493864f7a3c

Add libxen to overall xen build via a config option in Config.mk.

Signed-off-by: Jim Fehlig <jfehlig@novell.com>
author jfehlig@jfehlig2.provo.novell.com
date Wed Nov 22 14:25:07 2006 -0700 (2006-11-22)
parents 221b8ea81823
children a4ba47e9bc1f
files Config.mk tools/Makefile tools/libxen/Makefile
line diff
     1.1 --- a/Config.mk	Tue Nov 28 16:23:05 2006 +0000
     1.2 +++ b/Config.mk	Wed Nov 22 14:25:07 2006 -0700
     1.3 @@ -71,5 +71,6 @@ ACM_DEFAULT_SECURITY_POLICY ?= ACM_NULL_
     1.4  XENSTAT_XENTOP ?= y
     1.5  
     1.6  VTPM_TOOLS ?= n
     1.7 +LIBXENAPI_BINDINGS ?= n
     1.8  
     1.9  -include $(XEN_ROOT)/.config
     2.1 --- a/tools/Makefile	Tue Nov 28 16:23:05 2006 +0000
     2.2 +++ b/tools/Makefile	Wed Nov 22 14:25:07 2006 -0700
     2.3 @@ -19,6 +19,7 @@ SUBDIRS-y += xenstat
     2.4  SUBDIRS-y += libaio
     2.5  SUBDIRS-y += blktap
     2.6  SUBDIRS-y += libfsimage
     2.7 +SUBDIRS-$(LIBXENAPI_BINDINGS) += libxen
     2.8  
     2.9  # These don't cross-compile
    2.10  ifeq ($(XEN_COMPILE_ARCH),$(XEN_TARGET_ARCH))
     3.1 --- a/tools/libxen/Makefile	Tue Nov 28 16:23:05 2006 +0000
     3.2 +++ b/tools/libxen/Makefile	Wed Nov 22 14:25:07 2006 -0700
     3.3 @@ -15,23 +15,55 @@
     3.4  # License along with this library; if not, write to the Free Software
     3.5  # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
     3.6  #
     3.7 +XEN_ROOT=../..
     3.8 +include $(XEN_ROOT)/tools/Rules.mk
     3.9 +
    3.10 +MAJOR = 0.1
    3.11 +MINOR = 0
    3.12  
    3.13  CFLAGS = -Iinclude                     \
    3.14 -         $(shell xml2-config --cflags) \
    3.15 +	 $(shell xml2-config --cflags) \
    3.16           $(shell curl-config --cflags) \
    3.17           -W -Wall -Wmissing-prototypes -Werror -std=c99 -O2 -fPIC
    3.18  
    3.19  LDFLAGS = $(shell xml2-config --libs) \
    3.20            $(shell curl-config --libs)
    3.21  
    3.22 -test/test_bindings: test/test_bindings.o src/libxen.so
    3.23 -	$(CC) $(LDFLAGS) -o $@ $< -L src -lxen
    3.24 +LIBXENAPI_HDRS = $(wildcard include/*.h)
    3.25 +LIBXENAPI_OBJS = $(patsubst %.c, %.o, $(wildcard src/*.c))
    3.26  
    3.27 -src/libxen.so: $(patsubst %.c, %.o, $(wildcard src/*.c))
    3.28 -	$(CC) -shared -o $@ $^
    3.29 +
    3.30 +.PHONY: all
    3.31 +all: libxenapi.so libxenapi.a
    3.32 +
    3.33 +libxenapi.so: libxenapi.so.$(MAJOR)
    3.34 +	ln -sf $< $@
    3.35 +
    3.36 +libxenapi.so.$(MAJOR): libxenapi.so.$(MAJOR).$(MINOR)
    3.37 +	ln -sf $< $@
    3.38 +
    3.39 +libxenapi.so.$(MAJOR).$(MINOR): $(LIBXENAPI_OBJS)
    3.40 +	$(CC) $(CFLAGS) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxenapi.so.$(MAJOR) $(SHLIB_CFLAGS) -o $@ $^
    3.41 +
    3.42 +libxenapi.a: $(LIBXENAPI_OBJS)
    3.43 +	$(AR) rcs libxenapi.a $^
    3.44 +
    3.45 +
    3.46 +.PHONY: install
    3.47 +install: all
    3.48 +	$(INSTALL_DIR) -p $(DESTDIR)/usr/include/xen/api
    3.49 +	$(INSTALL_DIR) -p $(DESTDIR)/usr/$(LIBDIR)
    3.50 +	$(INSTALL_PROG) libxenapi.so.$(MAJOR).$(MINOR) $(DESTDIR)/usr/$(LIBDIR)
    3.51 +	ln -sf libxenapi.so.$(MAJOR).$(MINOR) $(DESTDIR)/usr/$(LIBDIR)/libxenapi.so.$(MAJOR)
    3.52 +	ln -sf libxenapi.so.$(MAJOR) $(DESTDIR)/usr/$(LIBDIR)/libxenapi.so
    3.53 +	$(INSTALL_DATA) libxenapi.a $(DESTDIR)/usr/$(LIBDIR)
    3.54 +	for i in $(LIBXENAPI_HDRS); do \
    3.55 +	    $(INSTALL_DATA) $$i $(DESTDIR)/usr/include/xen/api; \
    3.56 +	done
    3.57  
    3.58  .PHONY: clean
    3.59  clean:
    3.60  	rm -f `find -name *.o`
    3.61 -	rm -f src/libxen.so
    3.62 +	rm -f libxenapi.so*
    3.63 +	rm -f libxenapi.a
    3.64  	rm -f test/test_bindings