File: 0008-tools-libfsimage-prefix.diff.patch

package info (click to toggle)
xen 4.20.2%2B7-g1badcf5035-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 39,188 kB
  • sloc: ansic: 540,584; asm: 9,156; python: 7,990; sh: 7,692; makefile: 6,650; ml: 5,544; perl: 4,187; cpp: 1,885; lex: 828; yacc: 645; pascal: 533; awk: 274; xml: 51; exp: 47; sed: 4
file content (82 lines) | stat: -rw-r--r-- 3,173 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
From: Hans van Kranenburg <hans@knorrie.org>
Date: Mon, 25 May 2020 17:08:18 +0200
Subject: tools-libfsimage-prefix.diff

\o/
---
 tools/Rules.mk                   |  2 ++
 tools/libfsimage/common.mk       |  3 ++-
 tools/libfsimage/common/Makefile | 16 +++++++++-------
 3 files changed, 13 insertions(+), 8 deletions(-)

diff --git a/tools/Rules.mk b/tools/Rules.mk
index d0d77a4..517524c 100644
--- a/tools/Rules.mk
+++ b/tools/Rules.mk
@@ -16,6 +16,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
 
 include $(XEN_ROOT)/tools/libs/uselibs.mk
diff --git a/tools/libfsimage/common.mk b/tools/libfsimage/common.mk
index e433683..e273ee8 100644
--- a/tools/libfsimage/common.mk
+++ b/tools/libfsimage/common.mk
@@ -1,9 +1,10 @@
 include $(XEN_ROOT)/tools/Rules.mk
 
-FSDIR := $(libdir)/xenfsimage
+FSDIR := $(LIBEXEC_LIB)/xenfsimage
 CFLAGS += -Wno-unknown-pragmas -I$(XEN_ROOT)/tools/libfsimage/common/ $(CFLAGS_xeninclude) -DFSIMAGE_FSDIR=\"$(FSDIR)\"
 CFLAGS += -D_GNU_SOURCE
 LDFLAGS += -L../common/
+LDFLAGS += $(call LDFLAGS_RPATH,../..)
 
 PIC_OBJS = $(patsubst %.c,%.opic,$(LIB_SRCS-y))
 
diff --git a/tools/libfsimage/common/Makefile b/tools/libfsimage/common/Makefile
index 79f8cfd..4f1eaf9 100644
--- a/tools/libfsimage/common/Makefile
+++ b/tools/libfsimage/common/Makefile
@@ -4,6 +4,8 @@ include $(XEN_ROOT)/tools/libfsimage/common.mk
 MAJOR := $(shell $(XEN_ROOT)/version.sh $(XEN_ROOT)/xen/Makefile)
 MINOR = 0
 
+CFLAGS += -DFSDIR="\"$(LIBEXEC_LIB)/fs\""
+
 LDFLAGS-$(CONFIG_SunOS) = -Wl,-M -Wl,mapfile-SunOS
 LDFLAGS-$(CONFIG_Linux) = -Wl,mapfile-GNU
 LDFLAGS += $(LDFLAGS-y)
@@ -20,11 +22,11 @@ all: $(TARGETS)
 
 .PHONY: install
 install: all
-	$(INSTALL_DIR) $(DESTDIR)$(libdir)
+	$(INSTALL_DIR) $(DESTDIR)$(LIBEXEC_LIB)
 	$(INSTALL_DIR) $(DESTDIR)$(includedir)
-	$(INSTALL_PROG) libxenfsimage.so.$(MAJOR).$(MINOR) $(DESTDIR)$(libdir)
-	ln -sf libxenfsimage.so.$(MAJOR).$(MINOR) $(DESTDIR)$(libdir)/libxenfsimage.so.$(MAJOR)
-	ln -sf libxenfsimage.so.$(MAJOR) $(DESTDIR)$(libdir)/libxenfsimage.so
+	$(INSTALL_PROG) libxenfsimage.so.$(MAJOR).$(MINOR) $(DESTDIR)$(LIBEXEC_LIB)
+	ln -sf libxenfsimage.so.$(MAJOR).$(MINOR) $(DESTDIR)$(LIBEXEC_LIB)/libxenfsimage.so.$(MAJOR)
+	ln -sf libxenfsimage.so.$(MAJOR) $(DESTDIR)$(LIBEXEC_LIB)/libxenfsimage.so
 	$(INSTALL_DATA) xenfsimage.h $(DESTDIR)$(includedir)
 	$(INSTALL_DATA) xenfsimage_plugin.h $(DESTDIR)$(includedir)
 	$(INSTALL_DATA) xenfsimage_grub.h $(DESTDIR)$(includedir)
@@ -34,9 +36,9 @@ uninstall:
 	rm -f $(DESTDIR)$(includedir)/xenfsimage_grub.h
 	rm -f $(DESTDIR)$(includedir)/xenfsimage_plugin.h
 	rm -f $(DESTDIR)$(includedir)/xenfsimage.h
-	rm -f $(DESTDIR)$(libdir)/libxenfsimage.so
-	rm -f $(DESTDIR)$(libdir)/libxenfsimage.so.$(MAJOR)
-	rm -f $(DESTDIR)$(libdir)/libxenfsimage.so.$(MAJOR).$(MINOR)
+	rm -f $(DESTDIR)$(LIBEXEC_LIB)/libxenfsimage.so
+	rm -f $(DESTDIR)$(LIBEXEC_LIB)/libxenfsimage.so.$(MAJOR)
+	rm -f $(DESTDIR)$(LIBEXEC_LIB)/libxenfsimage.so.$(MAJOR).$(MINOR)
 
 libxenfsimage.so: libxenfsimage.so.$(MAJOR)
 	ln -sf $< $@