All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jim Fehlig <jfehlig@novell.com>
To: Xen-devel <xen-devel@lists.xensource.com>
Subject: [PATCH] [RFC] Add libxen to overall xen build
Date: Wed, 22 Nov 2006 15:03:31 -0700	[thread overview]
Message-ID: <4564C933.6020507@novell.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 375 bytes --]

libxen (c-bindings to new XenAPI) is not integrated into the overall xen 
build.  This patch enables building of libxen when 'LIBXENAPI_BINDINGS 
?= y' in Config.mk.

Headers are installed in $(DESTDIR)/usr/include/xen/api and libs in 
$(DESTDIR/usr/$(LIBDIR).  I did not include the test_bindings program 
since it introduces yet another dependency - libcurl.

Regards,
Jim

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: libxen-build.patch --]
[-- Type: text/x-patch; name="libxen-build.patch", Size: 3028 bytes --]

# HG changeset patch
# User jfehlig@jfehlig2.provo.novell.com
# Date 1164230707 25200
# Node ID 234b8e33a4b4a923b816b43c91f76bd4b97a36cf
# Parent  08007423788ab86753515756b8142b075162c336
Add libxen to overall xen build via a config option in Config.mk.

Signed-off-by: Jim Fehlig <jfehlig@novell.com>

diff -r 08007423788a -r 234b8e33a4b4 Config.mk
--- a/Config.mk	Tue Nov 21 16:14:53 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 08007423788a -r 234b8e33a4b4 tools/Makefile
--- a/tools/Makefile	Tue Nov 21 16:14:53 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 08007423788a -r 234b8e33a4b4 tools/libxen/Makefile
--- a/tools/libxen/Makefile	Tue Nov 21 16:14:53 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

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

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

             reply	other threads:[~2006-11-22 22:03 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-22 22:03 Jim Fehlig [this message]
2006-11-28 16:34 ` [PATCH] [RFC] Add libxen to overall xen build Ewan Mellor
2006-11-30  1:01   ` Jim Fehlig
2006-11-30  8:33     ` Ewan Mellor

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4564C933.6020507@novell.com \
    --to=jfehlig@novell.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.