]> xenbits.xensource.com Git - people/iwj/xen.git/commitdiff
tools-libfsimage-prefix.diff
authorIan Jackson <ian.jackson@citrix.com>
Fri, 5 Oct 2018 16:53:38 +0000 (17:53 +0100)
committerIan Jackson <ian.jackson@citrix.com>
Thu, 11 Jul 2019 23:05:33 +0000 (00:05 +0100)
Patch-Name: tools-libfsimage-prefix.diff

Gbp-Pq: Topic prefix-abiname
Gbp-Pq: Name tools-libfsimage-prefix.diff

tools/Rules.mk
tools/libfsimage/Rules.mk
tools/libfsimage/common/Makefile

index 804176a1d0d5bd6b8507effec298ad40273687d6..a46f10e34aa5cc4646be69bb1f8cc4d4457274e3 100644 (file)
@@ -11,6 +11,8 @@ INSTALL = $(XEN_ROOT)/tools/cross-install
 
 LDFLAGS += $(PREPEND_LDFLAGS_XEN_TOOLS)
 
+LDFLAGS_RPATH = -Wl,-rpath,'$${ORIGIN}$(if $(1),/$(1))'
+
 XEN_INCLUDE        = $(XEN_ROOT)/tools/include
 XEN_LIBXENTOOLCORE  = $(XEN_ROOT)/tools/libs/toolcore
 XEN_LIBXENTOOLLOG  = $(XEN_ROOT)/tools/libs/toollog
index eab4ecb35ece2557cfdd5027137548470e09c526..50be5048986a4de4d242b939ae987950eefe5b3d 100644 (file)
@@ -3,10 +3,11 @@ include $(XEN_ROOT)/tools/Rules.mk
 CFLAGS += -Wno-unknown-pragmas -I$(XEN_ROOT)/tools/libfsimage/common/ -DFSIMAGE_FSDIR=\"$(FSDIR)\"
 CFLAGS += -Werror -D_GNU_SOURCE
 LDFLAGS += -L../common/
+LDFLAGS += $(call LDFLAGS_RPATH,../..)
 
 PIC_OBJS := $(patsubst %.c,%.opic,$(LIB_SRCS-y))
 
-FSDIR = $(libdir)/fs
+FSDIR = $(LIBEXEC_LIB)/fs
 
 FSLIB = fsimage.so
 
index b3881de9e9fa402d5e4accfd2c9dfdaf11b89f6c..5a6e17d992245815e211d13f5ea753e3c730c572 100644 (file)
@@ -1,6 +1,8 @@
 XEN_ROOT = $(CURDIR)/../../..
 include $(XEN_ROOT)/tools/libfsimage/Rules.mk
 
+CFLAGS += -DFSDIR="\"$(LIBEXEC_LIB)/fs\""
+
 LDFLAGS-$(CONFIG_SunOS) = -Wl,-M -Wl,mapfile-SunOS
 LDFLAGS-$(CONFIG_Linux) = -Wl,mapfile-GNU
 LDFLAGS += $(LDFLAGS-y)
@@ -19,9 +21,9 @@ all: $(LIB)
 
 .PHONY: install
 install: all
-       $(INSTALL_DIR) $(DESTDIR)$(libdir)
+       $(INSTALL_DIR) $(DESTDIR)$(LIBEXEC_LIB)
        $(INSTALL_DIR) $(DESTDIR)$(includedir)
-       $(INSTALL_PROG) libfsimage.so $(DESTDIR)$(libdir)
+       $(INSTALL_PROG) libfsimage.so $(DESTDIR)$(LIBEXEC_LIB)
        $(INSTALL_DATA) fsimage.h $(DESTDIR)$(includedir)
        $(INSTALL_DATA) fsimage_plugin.h $(DESTDIR)$(includedir)
        $(INSTALL_DATA) fsimage_grub.h $(DESTDIR)$(includedir)
@@ -31,7 +33,7 @@ uninstall:
        rm -f $(DESTDIR)$(includedir)/fsimage_grub.h
        rm -f $(DESTDIR)$(includedir)/fsimage_plugin.h
        rm -f $(DESTDIR)$(includedir)/fsimage.h
-       rm -f $(DESTDIR)$(libdir)/libfsimage.so
+       rm -f $(DESTDIR)$(LIBEXEC_LIB)/libfsimage.so
 
 clean distclean::
        rm -f $(LIB)