WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] Add libxen to overall xen build via a con

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] Add libxen to overall xen build via a config option in Config.mk.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Tue, 28 Nov 2006 20:00:17 +0000
Delivery-date: Tue, 28 Nov 2006 12:00:11 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User jfehlig@xxxxxxxxxxxxxxxxxxxxxxxxx
# Node ID 9493864f7a3c82932fb67aed2f4a68b373d39111
# Parent  221b8ea81823b553caaed51da32f045a7a59f431
Add libxen to overall xen build via a config option in Config.mk.

Signed-off-by: Jim Fehlig <jfehlig@xxxxxxxxxx>
---
 Config.mk             |    1 +
 tools/Makefile        |    1 +
 tools/libxen/Makefile |   44 ++++++++++++++++++++++++++++++++++++++------
 3 files changed, 40 insertions(+), 6 deletions(-)

diff -r 221b8ea81823 -r 9493864f7a3c Config.mk
--- a/Config.mk Tue Nov 28 16:23:05 2006 +0000
+++ b/Config.mk Wed Nov 22 14:25:07 2006 -0700
@@ -71,5 +71,6 @@ XENSTAT_XENTOP ?= y
 XENSTAT_XENTOP ?= y
 
 VTPM_TOOLS ?= n
+LIBXENAPI_BINDINGS ?= n
 
 -include $(XEN_ROOT)/.config
diff -r 221b8ea81823 -r 9493864f7a3c tools/Makefile
--- a/tools/Makefile    Tue Nov 28 16:23:05 2006 +0000
+++ b/tools/Makefile    Wed Nov 22 14:25:07 2006 -0700
@@ -19,6 +19,7 @@ SUBDIRS-y += libaio
 SUBDIRS-y += libaio
 SUBDIRS-y += blktap
 SUBDIRS-y += libfsimage
+SUBDIRS-$(LIBXENAPI_BINDINGS) += libxen
 
 # These don't cross-compile
 ifeq ($(XEN_COMPILE_ARCH),$(XEN_TARGET_ARCH))
diff -r 221b8ea81823 -r 9493864f7a3c tools/libxen/Makefile
--- a/tools/libxen/Makefile     Tue Nov 28 16:23:05 2006 +0000
+++ b/tools/libxen/Makefile     Wed Nov 22 14:25:07 2006 -0700
@@ -15,23 +15,55 @@
 # License along with this library; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
 #
+XEN_ROOT=../..
+include $(XEN_ROOT)/tools/Rules.mk
+
+MAJOR = 0.1
+MINOR = 0
 
 CFLAGS = -Iinclude                     \
-         $(shell xml2-config --cflags) \
+        $(shell xml2-config --cflags) \
          $(shell curl-config --cflags) \
          -W -Wall -Wmissing-prototypes -Werror -std=c99 -O2 -fPIC
 
 LDFLAGS = $(shell xml2-config --libs) \
           $(shell curl-config --libs)
 
-test/test_bindings: test/test_bindings.o src/libxen.so
-       $(CC) $(LDFLAGS) -o $@ $< -L src -lxen
+LIBXENAPI_HDRS = $(wildcard include/*.h)
+LIBXENAPI_OBJS = $(patsubst %.c, %.o, $(wildcard src/*.c))
 
-src/libxen.so: $(patsubst %.c, %.o, $(wildcard src/*.c))
-       $(CC) -shared -o $@ $^
+
+.PHONY: all
+all: libxenapi.so libxenapi.a
+
+libxenapi.so: libxenapi.so.$(MAJOR)
+       ln -sf $< $@
+
+libxenapi.so.$(MAJOR): libxenapi.so.$(MAJOR).$(MINOR)
+       ln -sf $< $@
+
+libxenapi.so.$(MAJOR).$(MINOR): $(LIBXENAPI_OBJS)
+       $(CC) $(CFLAGS) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) 
-Wl,libxenapi.so.$(MAJOR) $(SHLIB_CFLAGS) -o $@ $^
+
+libxenapi.a: $(LIBXENAPI_OBJS)
+       $(AR) rcs libxenapi.a $^
+
+
+.PHONY: install
+install: all
+       $(INSTALL_DIR) -p $(DESTDIR)/usr/include/xen/api
+       $(INSTALL_DIR) -p $(DESTDIR)/usr/$(LIBDIR)
+       $(INSTALL_PROG) libxenapi.so.$(MAJOR).$(MINOR) $(DESTDIR)/usr/$(LIBDIR)
+       ln -sf libxenapi.so.$(MAJOR).$(MINOR) 
$(DESTDIR)/usr/$(LIBDIR)/libxenapi.so.$(MAJOR)
+       ln -sf libxenapi.so.$(MAJOR) $(DESTDIR)/usr/$(LIBDIR)/libxenapi.so
+       $(INSTALL_DATA) libxenapi.a $(DESTDIR)/usr/$(LIBDIR)
+       for i in $(LIBXENAPI_HDRS); do \
+           $(INSTALL_DATA) $$i $(DESTDIR)/usr/include/xen/api; \
+       done
 
 .PHONY: clean
 clean:
        rm -f `find -name *.o`
-       rm -f src/libxen.so
+       rm -f libxenapi.so*
+       rm -f libxenapi.a
        rm -f test/test_bindings

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] Add libxen to overall xen build via a config option in Config.mk., Xen patchbot-unstable <=