[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH XEN v5 02/23] tools: Refactor "xentoollog" into its own library



In attempting to disaggregate libxenctrl I found that many of the
pieces were going to want access to this library, so split it out (as
it probably should always have been).

Various build adjustments are needed. In particular things which use
xtl_* themselves now need to explicity link against the library.

This has a nice side effect which is that users of libxl no longer
need to link against libxenctrl just to create a logger, which was
counter to the principal that applications using libxl shouldn't be
required to look behind the curtain. This means that xl no longer
links against libxenctrl.

The new library uses a version script to ensure that only expected
symbols are exported and to version them such that ABI guarantees can
be kept in the future.

Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
Acked-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
Acked-by: Wei Liu <wei.liu2@xxxxxxxxxx>
---
Must be applied with:

- "qemu-xen-traditional: Use xentoollog as a separate library" and a
  corresponding QEMU_TAG update folded here.
- "mini-os: Include libxentoollog with libxc" and a corresponding bump
  to MINIOS_UPSTREAM_REVISION folded in here.

v2: Update doc at same time
v3: Move into tools/libs/toollog.
---
 .gitignore                                         |  1 +
 stubdom/Makefile                                   | 24 ++++++++-
 stubdom/grub/Makefile                              |  1 +
 tools/Makefile                                     |  3 ++
 tools/Rules.mk                                     | 14 +++--
 tools/libs/Makefile                                |  7 +++
 tools/libs/toollog/Makefile                        | 59 ++++++++++++++++++++++
 tools/{libxc => libs/toollog}/include/xentoollog.h |  0
 tools/libs/toollog/libxentoollog.map               | 12 +++++
 tools/{libxc => libs/toollog}/xtl_core.c           |  0
 tools/{libxc => libs/toollog}/xtl_logger_stdio.c   |  0
 tools/libxc/Makefile                               |  7 ++-
 tools/libxl/Makefile                               | 15 +++---
 tools/ocaml/Makefile.rules                         | 26 +++++-----
 tools/ocaml/libs/xentoollog/Makefile               |  6 +--
 tools/ocaml/libs/xentoollog/genlevels.py           |  2 +-
 tools/python/setup.py                              |  5 +-
 tools/xenpaging/Makefile                           |  2 +-
 18 files changed, 148 insertions(+), 36 deletions(-)
 create mode 100644 tools/libs/Makefile
 create mode 100644 tools/libs/toollog/Makefile
 rename tools/{libxc => libs/toollog}/include/xentoollog.h (100%)
 create mode 100644 tools/libs/toollog/libxentoollog.map
 rename tools/{libxc => libs/toollog}/xtl_core.c (100%)
 rename tools/{libxc => libs/toollog}/xtl_logger_stdio.c (100%)

diff --git a/.gitignore b/.gitignore
index 91e1430..a2c85e1 100644
--- a/.gitignore
+++ b/.gitignore
@@ -58,6 +58,7 @@ stubdom/gcc-*
 stubdom/include
 stubdom/ioemu
 stubdom/xenstore
+stubdom/libxentoollog-*
 stubdom/libxc-*
 stubdom/lwip-*
 stubdom/mini-os-*
diff --git a/stubdom/Makefile b/stubdom/Makefile
index e1359cf..9c923dd 100644
--- a/stubdom/Makefile
+++ b/stubdom/Makefile
@@ -313,6 +313,11 @@ mk-headers-$(XEN_TARGET_ARCH): $(IOEMU_LINKFARM_TARGET)
          ln -sf $(wildcard $(XEN_ROOT)/tools/include/xen-foreign/*) 
include/xen-foreign/ && \
          $(MAKE) DESTDIR= -C include/xen-foreign/ && \
          ( [ -h include/xen/foreign ] || ln -sf ../xen-foreign 
include/xen/foreign )
+       mkdir -p libs-$(XEN_TARGET_ARCH)/toollog
+       [ -h libs-$(XEN_TARGET_ARCH)/toollog/Makefile ] || ( cd 
libs-$(XEN_TARGET_ARCH)/toollog && \
+         ln -sf $(XEN_ROOT)/tools/libs/toollog/include/*.h . && \
+         ln -sf $(XEN_ROOT)/tools/libs/toollog/*.c . && \
+         ln -sf $(XEN_ROOT)/tools/libs/toollog/Makefile . )
        mkdir -p libxc-$(XEN_TARGET_ARCH)
        [ -h libxc-$(XEN_TARGET_ARCH)/Makefile ] || ( cd 
libxc-$(XEN_TARGET_ARCH) && \
          ln -sf $(XEN_ROOT)/tools/libxc/*.h . && \
@@ -336,12 +341,23 @@ $(TARGETS_MINIOS): mini-os-%:
        done
 
 #######
+# libxentoollog
+#######
+
+.PHONY: libxentoollog
+libxentoollog: libs-$(XEN_TARGET_ARCH)/toollog/libxentoollog.a
+libs-$(XEN_TARGET_ARCH)/toollog/libxentoollog.a: $(NEWLIB_STAMPFILE)
+       $(MAKE) -C $(XEN_ROOT)/tools/include
+       $(MAKE) DESTDIR= -C $(MINI_OS) links
+       CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) 
DESTDIR= -C libs-$(XEN_TARGET_ARCH)/toollog
+
+#######
 # libxc
 #######
 
 .PHONY: libxc
 libxc: libxc-$(XEN_TARGET_ARCH)/libxenctrl.a 
libxc-$(XEN_TARGET_ARCH)/libxenguest.a
-libxc-$(XEN_TARGET_ARCH)/libxenctrl.a: cross-zlib
+libxc-$(XEN_TARGET_ARCH)/libxenctrl.a: libxentoollog cross-zlib
        $(MAKE) -C $(XEN_ROOT)/tools/include
        $(MAKE) DESTDIR= -C $(MINI_OS) links
        CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) 
DESTDIR= CONFIG_LIBXC_MINIOS=y -C libxc-$(XEN_TARGET_ARCH)
@@ -515,6 +531,11 @@ clean:
        $(MAKE) -C vtpmmgr clean
        rm -fr grub-$(XEN_TARGET_ARCH)
        rm -f $(STUBDOMPATH)
+       [ ! -e libs-$(XEN_TARGET_ARCH)/toollog/Makefile ] || $(MAKE) DESTDIR= 
-C libs-$(XEN_TARGET_ARCH)/toollog clean
+       [ ! -e libs-$(XEN_TARGET_ARCH)/evtchn/Makefile ] || $(MAKE) DESTDIR= -C 
libs-$(XEN_TARGET_ARCH)/evtchn clean
+       [ ! -e libs-$(XEN_TARGET_ARCH)/gnttab/Makefile ] || $(MAKE) DESTDIR= -C 
libs-$(XEN_TARGET_ARCH)/gnttab clean
+       [ ! -e libs-$(XEN_TARGET_ARCH)/call/Makefile ] || $(MAKE) DESTDIR= -C 
libs-$(XEN_TARGET_ARCH)/call clean
+       [ ! -e libs-$(XEN_TARGET_ARCH)/foreignmemory/Makefile ] || $(MAKE) 
DESTDIR= -C libs-$(XEN_TARGET_ARCH)/foreignmemory clean
        [ ! -e libxc-$(XEN_TARGET_ARCH)/Makefile ] || $(MAKE) DESTDIR= -C 
libxc-$(XEN_TARGET_ARCH) clean
        -[ ! -d ioemu ] || $(MAKE) DESTDIR= -C ioemu clean
        -[ ! -d xenstore ] || $(MAKE) DESTDIR= -C xenstore clean
@@ -525,6 +546,7 @@ crossclean: clean
        rm -fr $(CROSS_ROOT)
        rm -fr newlib-$(XEN_TARGET_ARCH)
        rm -fr zlib-$(XEN_TARGET_ARCH) pciutils-$(XEN_TARGET_ARCH)
+       rm -fr libs-$(XEN_TARGET_ARCH)
        rm -fr libxc-$(XEN_TARGET_ARCH) ioemu xenstore
        rm -fr gmp-$(XEN_TARGET_ARCH)
        rm -fr polarssl-$(XEN_TARGET_ARCH)
diff --git a/stubdom/grub/Makefile b/stubdom/grub/Makefile
index 934cc4c..26dff45 100644
--- a/stubdom/grub/Makefile
+++ b/stubdom/grub/Makefile
@@ -5,6 +5,7 @@ vpath %.c ../grub-upstream
 
 BOOT=$(OBJ_DIR)/boot-$(XEN_TARGET_ARCH).o
 
+DEF_CPPFLAGS += -I$(XEN_ROOT)/tools/libs/toollog/include
 DEF_CPPFLAGS += -I$(XEN_ROOT)/tools/libxc/include -I$(XEN_ROOT)/tools/include 
-I.
 DEF_CPPFLAGS += -I../grub-upstream/stage1
 DEF_CPPFLAGS += -I../grub-upstream/stage2
diff --git a/tools/Makefile b/tools/Makefile
index 820ca40..9f74ac7 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -3,6 +3,7 @@ include $(XEN_ROOT)/tools/Rules.mk
 
 SUBDIRS-y :=
 SUBDIRS-y += include
+SUBDIRS-y += libs
 SUBDIRS-y += libxc
 SUBDIRS-$(FLASK_ENABLE) += flask
 SUBDIRS-y += xenstore
@@ -248,12 +249,14 @@ subdir-all-qemu-xen-dir: qemu-xen-dir-find
                --includedir=$(LIBEXEC_INC) \
                --source-path=$$source \
                --extra-cflags="-I$(XEN_ROOT)/tools/include \
+               -I$(XEN_ROOT)/tools/libs/toollog/include \
                -I$(XEN_ROOT)/tools/libxc/include \
                -I$(XEN_ROOT)/tools/xenstore/include \
                -I$(XEN_ROOT)/tools/xenstore/compat/include \
                $(EXTRA_CFLAGS_QEMU_XEN)" \
                --extra-ldflags="-L$(XEN_ROOT)/tools/libxc \
                -L$(XEN_ROOT)/tools/xenstore \
+               -Wl,-rpath-link=$(XEN_ROOT)/tools/libs/toollog \
                $(QEMU_UPSTREAM_RPATH)" \
                --bindir=$(LIBEXEC_BIN) \
                --datadir=$(SHAREDIR)/qemu-xen \
diff --git a/tools/Rules.mk b/tools/Rules.mk
index 37b0aaf..7516ddd 100644
--- a/tools/Rules.mk
+++ b/tools/Rules.mk
@@ -10,6 +10,7 @@ export _INSTALL := $(INSTALL)
 INSTALL = $(XEN_ROOT)/tools/cross-install
 
 XEN_INCLUDE        = $(XEN_ROOT)/tools/include
+XEN_LIBXENTOOLLOG  = $(XEN_ROOT)/tools/libs/toollog
 XEN_LIBXC          = $(XEN_ROOT)/tools/libxc
 XEN_XENLIGHT       = $(XEN_ROOT)/tools/libxl
 XEN_XENSTORE       = $(XEN_ROOT)/tools/xenstore
@@ -76,10 +77,15 @@ endif
 # Consumers of libfoo should not directly use $(SHDEPS_libfoo) or
 # $(SHLIB_libfoo)
 
-CFLAGS_libxenctrl = -I$(XEN_LIBXC)/include $(CFLAGS_xeninclude)
-SHDEPS_libxenctrl =
-LDLIBS_libxenctrl = $(XEN_LIBXC)/libxenctrl$(libextension)
-SHLIB_libxenctrl  = -Wl,-rpath-link=$(XEN_LIBXC)
+CFLAGS_libxentoollog = -I$(XEN_LIBXENTOOLLOG)/include $(CFLAGS_xeninclude)
+SHDEPS_libxentoollog =
+LDLIBS_libxentoollog = $(XEN_LIBXENTOOLLOG)/libxentoollog$(libextension)
+SHLIB_libxentoollog  = -Wl,-rpath-link=$(XEN_LIBXENTOOLLOG)
+
+CFLAGS_libxenctrl = -I$(XEN_LIBXC)/include $(CFLAGS_libxentoollog) 
$(CFLAGS_xeninclude)
+SHDEPS_libxenctrl = $(SHLIB_libxentoollog) 
+LDLIBS_libxenctrl = $(SHDEPS_libxenctrl) $(XEN_LIBXC)/libxenctrl$(libextension)
+SHLIB_libxenctrl  = $(SHDEPS_libxenctrl) -Wl,-rpath-link=$(XEN_LIBXC)
 
 CFLAGS_libxenguest = -I$(XEN_LIBXC)/include $(CFLAGS_xeninclude)
 SHDEPS_libxenguest =
diff --git a/tools/libs/Makefile b/tools/libs/Makefile
new file mode 100644
index 0000000..73be500
--- /dev/null
+++ b/tools/libs/Makefile
@@ -0,0 +1,7 @@
+XEN_ROOT = $(CURDIR)/../..
+include $(XEN_ROOT)/tools/Rules.mk
+
+SUBDIRS-y :=
+SUBDIRS-y += toollog
+
+all clean install distclean: %: subdirs-%
diff --git a/tools/libs/toollog/Makefile b/tools/libs/toollog/Makefile
new file mode 100644
index 0000000..bd12403
--- /dev/null
+++ b/tools/libs/toollog/Makefile
@@ -0,0 +1,59 @@
+XEN_ROOT = $(CURDIR)/../../..
+include $(XEN_ROOT)/tools/Rules.mk
+
+MAJOR  = 1
+MINOR  = 0
+SHLIB_LDFLAGS += -Wl,--version-script=libxentoollog.map
+
+CFLAGS += -Werror -Wmissing-prototypes
+CFLAGS += -I./include
+
+SRCS-y += xtl_core.c
+SRCS-y += xtl_logger_stdio.c
+
+LIB_OBJS := $(patsubst %.c,%.o,$(SRCS-y))
+PIC_OBJS := $(patsubst %.c,%.opic,$(SRCS-y))
+
+LIB := libxentoollog.a
+ifneq ($(nosharedlibs),y)
+LIB += libxentoollog.so
+endif
+
+.PHONY: all
+all: build
+
+.PHONY: build
+build:
+       $(MAKE) libs
+
+.PHONY: libs
+libs: $(LIB)
+
+libxentoollog.a: $(LIB_OBJS)
+       $(AR) rc $@ $^
+
+libxentoollog.so: libxentoollog.so.$(MAJOR)
+       $(SYMLINK_SHLIB) $< $@
+libxentoollog.so.$(MAJOR): libxentoollog.so.$(MAJOR).$(MINOR)
+       $(SYMLINK_SHLIB) $< $@
+
+libxentoollog.so.$(MAJOR).$(MINOR): $(PIC_OBJS) libxentoollog.map
+       $(CC) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxentoollog.so.$(MAJOR) 
$(SHLIB_LDFLAGS) -o $@ $(PIC_OBJS) $(APPEND_LDFLAGS)
+
+.PHONY: install
+install: build
+       $(INSTALL_DIR) $(DESTDIR)$(libdir)
+       $(INSTALL_DIR) $(DESTDIR)$(includedir)
+       $(INSTALL_SHLIB) libxentoollog.so.$(MAJOR).$(MINOR) $(DESTDIR)$(libdir)
+       $(INSTALL_DATA) libxentoollog.a $(DESTDIR)$(libdir)
+       $(SYMLINK_SHLIB) libxentoollog.so.$(MAJOR).$(MINOR) 
$(DESTDIR)$(libdir)/libxentoollog.so.$(MAJOR)
+       $(SYMLINK_SHLIB) libxentoollog.so.$(MAJOR) 
$(DESTDIR)$(libdir)/libxentoollog.so
+       $(INSTALL_DATA) include/xentoollog.h $(DESTDIR)$(includedir)
+
+.PHONY: TAGS
+TAGS:
+       etags -t *.c *.h
+
+.PHONY: clean
+clean:
+       rm -rf *.rpm $(LIB) *~ $(DEPS) $(LIB_OBJS) $(PIC_OBJS)
diff --git a/tools/libxc/include/xentoollog.h 
b/tools/libs/toollog/include/xentoollog.h
similarity index 100%
rename from tools/libxc/include/xentoollog.h
rename to tools/libs/toollog/include/xentoollog.h
diff --git a/tools/libs/toollog/libxentoollog.map 
b/tools/libs/toollog/libxentoollog.map
new file mode 100644
index 0000000..c183cf5
--- /dev/null
+++ b/tools/libs/toollog/libxentoollog.map
@@ -0,0 +1,12 @@
+VERS_1.0 {
+       global:
+               xtl_createlogger_stdiostream;
+               xtl_level_to_string;
+               xtl_log;
+               xtl_logger_destroy;
+               xtl_logv;
+               xtl_progress;
+               xtl_stdiostream_adjust_flags;
+               xtl_stdiostream_set_minlevel;
+       local: *; /* Do not expose anything by default */
+};
diff --git a/tools/libxc/xtl_core.c b/tools/libs/toollog/xtl_core.c
similarity index 100%
rename from tools/libxc/xtl_core.c
rename to tools/libs/toollog/xtl_core.c
diff --git a/tools/libxc/xtl_logger_stdio.c 
b/tools/libs/toollog/xtl_logger_stdio.c
similarity index 100%
rename from tools/libxc/xtl_logger_stdio.c
rename to tools/libs/toollog/xtl_logger_stdio.c
diff --git a/tools/libxc/Makefile b/tools/libxc/Makefile
index 818f2e4..940708f 100644
--- a/tools/libxc/Makefile
+++ b/tools/libxc/Makefile
@@ -39,8 +39,6 @@ CTRL_SRCS-y       += xc_memshr.c
 CTRL_SRCS-y       += xc_hcall_buf.c
 CTRL_SRCS-y       += xc_foreign_memory.c
 CTRL_SRCS-y       += xc_kexec.c
-CTRL_SRCS-y       += xtl_core.c
-CTRL_SRCS-y       += xtl_logger_stdio.c
 CTRL_SRCS-y       += xc_resource.c
 CTRL_SRCS-$(CONFIG_X86) += xc_psr.c
 CTRL_SRCS-$(CONFIG_X86) += xc_pagetab.c
@@ -112,6 +110,7 @@ CFLAGS   += -I. -I./include $(CFLAGS_xeninclude)
 CFLAGS-$(CONFIG_Linux) += -D_GNU_SOURCE
 
 CFLAGS += $(PTHREAD_CFLAGS)
+CFLAGS += $(CFLAGS_libxentoollog)
 
 CTRL_LIB_OBJS := $(patsubst %.c,%.o,$(CTRL_SRCS-y))
 CTRL_PIC_OBJS := $(patsubst %.c,%.opic,$(CTRL_SRCS-y))
@@ -165,7 +164,7 @@ install: build
        $(INSTALL_DATA) libxenctrl.a $(DESTDIR)$(libdir)
        $(SYMLINK_SHLIB) libxenctrl.so.$(MAJOR).$(MINOR) 
$(DESTDIR)$(libdir)/libxenctrl.so.$(MAJOR)
        $(SYMLINK_SHLIB) libxenctrl.so.$(MAJOR) 
$(DESTDIR)$(libdir)/libxenctrl.so
-       $(INSTALL_DATA) include/xenctrl.h include/xenctrlosdep.h 
include/xentoollog.h $(DESTDIR)$(includedir)
+       $(INSTALL_DATA) include/xenctrl.h include/xenctrlosdep.h 
$(DESTDIR)$(includedir)
        $(INSTALL_SHLIB) libxenguest.so.$(MAJOR).$(MINOR) $(DESTDIR)$(libdir)
        $(INSTALL_DATA) libxenguest.a $(DESTDIR)$(libdir)
        $(SYMLINK_SHLIB) libxenguest.so.$(MAJOR).$(MINOR) 
$(DESTDIR)$(libdir)/libxenguest.so.$(MAJOR)
@@ -208,7 +207,7 @@ libxenctrl.so.$(MAJOR): libxenctrl.so.$(MAJOR).$(MINOR)
        $(SYMLINK_SHLIB) $< $@
 
 libxenctrl.so.$(MAJOR).$(MINOR): $(CTRL_PIC_OBJS)
-       $(CC) $(LDFLAGS) $(PTHREAD_LDFLAGS) -Wl,$(SONAME_LDFLAG) 
-Wl,libxenctrl.so.$(MAJOR) $(SHLIB_LDFLAGS) -o $@ $^ $(DLOPEN_LIBS) 
$(PTHREAD_LIBS) $(APPEND_LDFLAGS)
+       $(CC) $(LDFLAGS) $(PTHREAD_LDFLAGS) -Wl,$(SONAME_LDFLAG) 
-Wl,libxenctrl.so.$(MAJOR) $(SHLIB_LDFLAGS) -o $@ $^ $(LDLIBS_libxentoollog) 
$(DLOPEN_LIBS) $(PTHREAD_LIBS) $(APPEND_LDFLAGS)
 
 # libxenguest
 
diff --git a/tools/libxl/Makefile b/tools/libxl/Makefile
index 6ff5bee..2abae0c 100644
--- a/tools/libxl/Makefile
+++ b/tools/libxl/Makefile
@@ -20,11 +20,12 @@ LIBUUID_LIBS += -luuid
 endif
 
 LIBXL_LIBS =
-LIBXL_LIBS = $(LDLIBS_libxenctrl) $(LDLIBS_libxenguest) $(LDLIBS_libxenstore) 
$(LDLIBS_libblktapctl) $(PTYFUNCS_LIBS) $(LIBUUID_LIBS)
+LIBXL_LIBS = $(LDLIBS_libxentoollog) $(LDLIBS_libxenctrl) 
$(LDLIBS_libxenguest) $(LDLIBS_libxenstore) $(LDLIBS_libblktapctl) 
$(PTYFUNCS_LIBS) $(LIBUUID_LIBS)
 ifeq ($(CONFIG_REMUS_NETBUF),y)
 LIBXL_LIBS += $(LIBNL3_LIBS)
 endif
 
+CFLAGS_LIBXL += $(CFLAGS_libxentoollog)
 CFLAGS_LIBXL += $(CFLAGS_libxenctrl)
 CFLAGS_LIBXL += $(CFLAGS_libxenguest)
 CFLAGS_LIBXL += $(CFLAGS_libxenstore)
@@ -149,7 +150,7 @@ CFLAGS_XL += -Wshadow
 
 XL_OBJS = xl.o xl_cmdimpl.o xl_cmdtable.o xl_sxp.o
 $(XL_OBJS) $(TEST_PROG_OBJS) _libxl.api-for-check: \
-            CFLAGS += $(CFLAGS_libxenctrl) # For xentoollog.h
+            CFLAGS += $(CFLAGS_libxentoollog)
 $(XL_OBJS): CFLAGS += $(CFLAGS_XL)
 $(XL_OBJS): CFLAGS += -include $(XEN_ROOT)/tools/config.h # libxl_json.h needs 
it.
 
@@ -253,19 +254,19 @@ libxlutil.a: $(LIBXLU_OBJS)
        $(AR) rcs libxlutil.a $^
 
 xl: $(XL_OBJS) libxlutil.so libxenlight.so
-       $(CC) $(LDFLAGS) -o $@ $(XL_OBJS) libxlutil.so $(LDLIBS_libxenlight) 
$(LDLIBS_libxenctrl) -lyajl $(APPEND_LDFLAGS)
+       $(CC) $(LDFLAGS) -o $@ $(XL_OBJS) libxlutil.so $(LDLIBS_libxenlight) 
$(LDLIBS_libxentoollog) -lyajl $(APPEND_LDFLAGS)
 
 xen-init-dom0: $(XEN_INIT_DOM0_OBJS) libxenlight.so
-       $(CC) $(LDFLAGS) -o $@ $(XEN_INIT_DOM0_OBJS) $(LDLIBS_libxenstore) 
$(LDLIBS_libxenlight) $(LDLIBS_libxenctrl) $(APPEND_LDFLAGS)
+       $(CC) $(LDFLAGS) -o $@ $(XEN_INIT_DOM0_OBJS) $(LDLIBS_libxenstore) 
$(LDLIBS_libxenlight) $(LDLIBS_libxentoollog) $(APPEND_LDFLAGS)
 
 test_%: test_%.o test_common.o libxlutil.so libxenlight_test.so
-       $(CC) $(LDFLAGS) -o $@ $^ $(filter-out %libxenlight.so, 
$(LDLIBS_libxenlight)) $(LDLIBS_libxenctrl) -lyajl $(APPEND_LDFLAGS)
+       $(CC) $(LDFLAGS) -o $@ $^ $(filter-out %libxenlight.so, 
$(LDLIBS_libxenlight)) $(LDLIBS_libxentoollog) -lyajl $(APPEND_LDFLAGS)
 
 libxl-save-helper: $(SAVE_HELPER_OBJS) libxenlight.so
-       $(CC) $(LDFLAGS) -o $@ $(SAVE_HELPER_OBJS) $(LDLIBS_libxenctrl) 
$(LDLIBS_libxenguest) $(APPEND_LDFLAGS)
+       $(CC) $(LDFLAGS) -o $@ $(SAVE_HELPER_OBJS) $(LDLIBS_libxentoollog) 
$(LDLIBS_libxenctrl) $(LDLIBS_libxenguest) $(APPEND_LDFLAGS)
 
 testidl: testidl.o libxlutil.so libxenlight.so
-       $(CC) $(LDFLAGS) -o $@ testidl.o libxlutil.so $(LDLIBS_libxenlight) 
$(LDLIBS_libxenctrl) $(APPEND_LDFLAGS)
+       $(CC) $(LDFLAGS) -o $@ testidl.o libxlutil.so $(LDLIBS_libxenlight) 
$(LDLIBS_libxentoollog) $(APPEND_LDFLAGS)
 
 $(PKG_CONFIG): % : %.in Makefile
        @sed -e 's/@@version@@/$(MAJOR).$(MINOR)/g' < $< > $@.new
diff --git a/tools/ocaml/Makefile.rules b/tools/ocaml/Makefile.rules
index 1796060..45e71f2 100644
--- a/tools/ocaml/Makefile.rules
+++ b/tools/ocaml/Makefile.rules
@@ -1,18 +1,18 @@
-ifdef V
-  ifeq ("$(origin V)", "command line")
-    BUILD_VERBOSE = $(V)
-  endif
-endif
-ifndef BUILD_VERBOSE
-  BUILD_VERBOSE = 0
-endif
-ifeq ($(BUILD_VERBOSE),1)
+#ifdef V
+#  ifeq ("$(origin V)", "command line")
+#    BUILD_VERBOSE = $(V)
+#  endif
+#endif
+#ifndef BUILD_VERBOSE
+#  BUILD_VERBOSE = 0
+#endif
+#ifeq ($(BUILD_VERBOSE),1)
   E = @true
   Q =
-else
-  E = @echo
-  Q = @
-endif
+#else
+#  E = @echo
+#  Q = @
+#endif
 
 .NOTPARALLEL:
 
diff --git a/tools/ocaml/libs/xentoollog/Makefile 
b/tools/ocaml/libs/xentoollog/Makefile
index 666eb66..8ae0a78 100644
--- a/tools/ocaml/libs/xentoollog/Makefile
+++ b/tools/ocaml/libs/xentoollog/Makefile
@@ -5,7 +5,7 @@ include $(TOPLEVEL)/common.make
 # allow mixed declarations and code
 CFLAGS += -Wno-declaration-after-statement
 
-CFLAGS += $(CFLAGS_libxenctrl) $(CFLAGS_libxenguest)
+CFLAGS += $(CFLAGS_libxentoollog)
 CFLAGS += $(APPEND_CFLAGS)
 OCAMLINCLUDE +=
 
@@ -13,7 +13,7 @@ OBJS = xentoollog
 INTF = xentoollog.cmi
 LIBS = xentoollog.cma xentoollog.cmxa
 
-LIBS_xentoollog = $(LDLIBS_libxenctrl)
+LIBS_xentoollog = $(LDLIBS_libxentoollog)
 
 xentoollog_OBJS = $(OBJS)
 xentoollog_C_OBJS = xentoollog_stubs
@@ -49,7 +49,7 @@ xentoollog.mli: xentoollog.mli.in _xtl_levels.mli.in
 
 libs: $(LIBS)
 
-_xtl_levels.ml.in _xtl_levels.mli.in _xtl_levels.inc: genlevels.py 
$(XEN_ROOT)/tools/libxc/include/xentoollog.h
+_xtl_levels.ml.in _xtl_levels.mli.in _xtl_levels.inc: genlevels.py 
$(XEN_ROOT)/tools/libs/toollog/include/xentoollog.h
        $(PYTHON) genlevels.py _xtl_levels.mli.in _xtl_levels.ml.in 
_xtl_levels.inc
 
 .PHONY: install
diff --git a/tools/ocaml/libs/xentoollog/genlevels.py 
b/tools/ocaml/libs/xentoollog/genlevels.py
index 65d334f..8c233c5 100755
--- a/tools/ocaml/libs/xentoollog/genlevels.py
+++ b/tools/ocaml/libs/xentoollog/genlevels.py
@@ -3,7 +3,7 @@
 import sys
 
 def read_levels():
-       f = open('../../../libxc/include/xentoollog.h', 'r')
+       f = open('../../../libs/toollog/include/xentoollog.h', 'r')
 
        levels = []
        record = False
diff --git a/tools/python/setup.py b/tools/python/setup.py
index fdba866..9771cc4 100644
--- a/tools/python/setup.py
+++ b/tools/python/setup.py
@@ -7,16 +7,17 @@ XEN_ROOT = "../.."
 extra_compile_args  = [ "-fno-strict-aliasing", "-Werror" ]
 
 PATH_XEN      = XEN_ROOT + "/tools/include"
+PATH_LIBXENTOOLLOG = XEN_ROOT + "/tools/libs/toollog"
 PATH_LIBXC    = XEN_ROOT + "/tools/libxc"
 PATH_LIBXL    = XEN_ROOT + "/tools/libxl"
 PATH_XENSTORE = XEN_ROOT + "/tools/xenstore"
 
 xc = Extension("xc",
                extra_compile_args = extra_compile_args,
-               include_dirs       = [ PATH_XEN, PATH_LIBXC + "/include", 
"xen/lowlevel/xc" ],
+               include_dirs       = [ PATH_XEN, PATH_LIBXENTOOLLOG + 
"/include", PATH_LIBXC + "/include", "xen/lowlevel/xc" ],
                library_dirs       = [ PATH_LIBXC ],
                libraries          = [ "xenctrl", "xenguest" ],
-               depends            = [ PATH_LIBXC + "/libxenctrl.so", 
PATH_LIBXC + "/libxenguest.so" ],
+               depends            = [ PATH_LIBXC + "/libxenctrl.so", 
PATH_LIBXC + "/libxenguest.so",  "-Wl,-rpath-link="+PATH_LIBXENTOOLLOG ],
                sources            = [ "xen/lowlevel/xc/xc.c" ])
 
 xs = Extension("xs",
diff --git a/tools/xenpaging/Makefile b/tools/xenpaging/Makefile
index 2407a30..e63d894 100644
--- a/tools/xenpaging/Makefile
+++ b/tools/xenpaging/Makefile
@@ -3,7 +3,7 @@ include $(XEN_ROOT)/tools/Rules.mk
 
 # xenpaging.c and file_ops.c incorrectly use libxc internals
 CFLAGS += $(CFLAGS_libxenctrl) $(CFLAGS_libxenstore) $(PTHREAD_CFLAGS) 
-I$(XEN_ROOT)/tools/libxc
-LDLIBS += $(LDLIBS_libxenctrl) $(LDLIBS_libxenstore) $(PTHREAD_LIBS)
+LDLIBS += $(LDLIBS_libxentoollog) $(LDLIBS_libxenctrl) $(LDLIBS_libxenstore) 
$(PTHREAD_LIBS)
 LDFLAGS += $(PTHREAD_LDFLAGS)
 
 POLICY    = default
-- 
2.1.4


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.