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

[Xen-devel] [PATCH 31/46] Add configure --enable-rpath



This fixes the tools when xen is configured with --prefix=/odd/path

Signed-off-by: Olaf Hering <olaf@xxxxxxxxx>
---
 Config.mk                      |  3 +++
 config/Tools.mk.in             |  2 ++
 tools/Makefile                 | 15 +++++++++++++--
 tools/configure.ac             |  1 +
 tools/ocaml/xenstored/Makefile |  1 +
 5 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/Config.mk b/Config.mk
index c8dac4c..3947e85 100644
--- a/Config.mk
+++ b/Config.mk
@@ -208,6 +208,9 @@ LDFLAGS += $(foreach i, $(EXTRA_LIB), -L$(i))
 CFLAGS += $(foreach i, $(EXTRA_INCLUDES), -I$(i))
 LDFLAGS += $(foreach i, $(PREPEND_LIB), -L$(i))
 CFLAGS += $(foreach i, $(PREPEND_INCLUDES), -I$(i))
+ifeq ($(XEN_TOOLS_RPATH),y)
+APPEND_LDFLAGS += -Wl,-rpath,$(LIBDIR)
+endif
 APPEND_LDFLAGS += $(foreach i, $(APPEND_LIB), -L$(i))
 APPEND_CFLAGS += $(foreach i, $(APPEND_INCLUDES), -I$(i))
 
diff --git a/config/Tools.mk.in b/config/Tools.mk.in
index 974e28e..5126bb1 100644
--- a/config/Tools.mk.in
+++ b/config/Tools.mk.in
@@ -43,6 +43,8 @@ PTHREAD_LIBS        := @PTHREAD_LIBS@
 
 PTYFUNCS_LIBS       := @PTYFUNCS_LIBS@
 
+XEN_TOOLS_RPATH     := @rpath@
+
 # Download GIT repositories via HTTP or GIT's own protocol?
 # GIT's protocol is faster and more robust, when it works at all (firewalls
 # may block it). We make it the default, but if your GIT repository downloads
diff --git a/tools/Makefile b/tools/Makefile
index 7e5d4ce..0988020 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -111,6 +111,14 @@ IOEMU_CONFIGURE_CROSS ?= --cpu=$(XEN_TARGET_ARCH) \
                         --interp-prefix=$(CROSS_SYS_ROOT)
 endif
 
+ifeq ($(XEN_TOOLS_RPATH),y)
+QEMU_UPSTREAM_RPATH := -Wl,-rpath,$(LIBEXEC_LIB):$(LIBDIR)
+IOEMU_EXTRA_LDFLAGS := --extra-ldflags="-Wl,-rpath,$(LIBDIR)"
+else
+QEMU_UPSTREAM_RPATH := -Wl,-rpath,$(LIBEXEC_LIB)
+IOEMU_EXTRA_LDFLAGS :=
+endif
+
 QEMU_ROOT := $(shell if [ -d "$(QEMU_TRADITIONAL_LOC)" ]; then echo 
"$(QEMU_TRADITIONAL_LOC)"; else echo .; fi)
 ifneq ($(QEMU_ROOT),.)
 export QEMU_ROOT
@@ -146,7 +154,9 @@ subdir-all-qemu-xen-traditional-dir: 
qemu-xen-traditional-dir-find
        set -e; \
                $(buildmakevars2shellvars); \
                cd qemu-xen-traditional-dir; \
-               $(QEMU_ROOT)/xen-setup $(IOEMU_CONFIGURE_CROSS); \
+               $(QEMU_ROOT)/xen-setup \
+               $(IOEMU_EXTRA_LDFLAGS) \
+               $(IOEMU_CONFIGURE_CROSS); \
                $(MAKE) all
 
 subdir-install-qemu-xen-traditional-dir: qemu-xen-traditional-dir-find
@@ -155,6 +165,7 @@ subdir-install-qemu-xen-traditional-dir: 
qemu-xen-traditional-dir-find
                cd qemu-xen-traditional-dir; \
                $(QEMU_ROOT)/xen-setup \
                --extra-cflags="$(EXTRA_CFLAGS_QEMU_TRADITIONAL)" \
+               $(IOEMU_EXTRA_LDFLAGS) \
                $(IOEMU_CONFIGURE_CROSS); \
                $(MAKE) install
 
@@ -198,7 +209,7 @@ subdir-all-qemu-xen-dir: qemu-xen-dir-find
                $(EXTRA_CFLAGS_QEMU_XEN)" \
                --extra-ldflags="-L$(XEN_ROOT)/tools/libxc \
                -L$(XEN_ROOT)/tools/xenstore \
-               -Wl,-rpath=$(PREFIX)/lib/xen/lib" \
+               $(QEMU_UPSTREAM_RPATH)" \
                --bindir=$(LIBEXEC_BIN) \
                --datadir=$(SHAREDIR)/qemu-xen \
                --localstatedir=/var \
diff --git a/tools/configure.ac b/tools/configure.ac
index bcc8a93..013f04d 100644
--- a/tools/configure.ac
+++ b/tools/configure.ac
@@ -80,6 +80,7 @@ m4_include([../m4/systemd.m4])
 AX_XEN_EXPAND_CONFIG()
 
 # Enable/disable options
+AX_ARG_DEFAULT_DISABLE([rpath], [Build tools with -Wl,-rpath,LIBDIR])
 AX_ARG_DEFAULT_DISABLE([githttp], [Download GIT repositories via HTTP])
 AX_ARG_DEFAULT_ENABLE([monitors], [Disable xenstat and xentop monitoring 
tools])
 AX_ARG_DEFAULT_ENABLE([ocamltools], [Disable Ocaml tools])
diff --git a/tools/ocaml/xenstored/Makefile b/tools/ocaml/xenstored/Makefile
index 068e04a..18dedf7 100644
--- a/tools/ocaml/xenstored/Makefile
+++ b/tools/ocaml/xenstored/Makefile
@@ -8,6 +8,7 @@ LDFLAGS-$(CONFIG_SYSTEMD) += $(SYSTEMD_LIBS)
 
 CFLAGS  += $(CFLAGS-y)
 LDFLAGS += $(LDFLAGS-y)
+LDFLAGS += $(APPEND_LDFLAGS)
 
 OCAMLINCLUDE += \
        -I $(OCAML_TOPLEVEL)/libs/xb \

_______________________________________________
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®.