diff options
author | Ian Jackson <ian.jackson@citrix.com> | 2019-02-22 12:24:35 +0000 |
---|---|---|
committer | Hans van Kranenburg <hans.van.kranenburg@mendix.com> | 2019-06-18 09:50:22 +0200 |
commit | 4fa701b59ddaa960c80440ae4b8009a5e9fb995a (patch) | |
tree | 989e7a6930e8c04e0ff0e52ee566c942015f3687 | |
parent | 882029074a640f7326fb1b9d55e3153271b7cdc5 (diff) |
pygrub: Specify -rpath LIBEXEC_LIB when building fsimage.so
If LIBEXEC_LIB is not on the default linker search path, the python
fsimage.so module fails to find libfsimage.so.
Add the relevant directory to the rpath explicitly.
(This situation occurs in the Debian package, where
--with-libexec-libdir is used to put each Xen version's libraries and
utilities in their own directory, to allow them to be coinstalled.)
Signed-off-by: Ian Jackson <ian.jackson@citrix.com>
-rw-r--r-- | tools/pygrub/Makefile | 5 | ||||
-rw-r--r-- | tools/pygrub/setup.py | 5 |
2 files changed, 8 insertions, 2 deletions
diff --git a/tools/pygrub/Makefile b/tools/pygrub/Makefile index 3063c4998f..4cd1a95421 100644 --- a/tools/pygrub/Makefile +++ b/tools/pygrub/Makefile @@ -10,12 +10,13 @@ INSTALL_LOG = build/installed_files.txt all: build .PHONY: build build: - CC="$(CC)" CFLAGS="$(PY_CFLAGS)" LDFLAGS="$(PY_LDFLAGS)" $(PYTHON) setup.py build + CC="$(CC)" CFLAGS="$(PY_CFLAGS)" LDFLAGS="$(PY_LDFLAGS)" LIBEXEC_LIB=$(LIBEXEC_LIB) $(PYTHON) setup.py build .PHONY: install install: all $(INSTALL_DIR) $(DESTDIR)/$(bindir) - CC="$(CC)" CFLAGS="$(PY_CFLAGS)" LDFLAGS="$(PY_LDFLAGS)" $(PYTHON) \ + CC="$(CC)" CFLAGS="$(PY_CFLAGS)" LDFLAGS="$(PY_LDFLAGS)" \ + LIBEXEC_LIB=$(LIBEXEC_LIB) $(PYTHON) \ setup.py install --record $(INSTALL_LOG) $(PYTHON_PREFIX_ARG) \ --root="$(DESTDIR)" --install-scripts=$(LIBEXEC_BIN) --force set -e; if [ $(bindir) != $(LIBEXEC_BIN) -a \ diff --git a/tools/pygrub/setup.py b/tools/pygrub/setup.py index 52dcf57373..b907525b84 100644 --- a/tools/pygrub/setup.py +++ b/tools/pygrub/setup.py @@ -5,10 +5,15 @@ import sys extra_compile_args = [ "-fno-strict-aliasing", "-Werror" ] +extra_link_args = [] +try: extra_link_args += [ "-Wl,-rpath," + os.environ['LIBEXEC_LIB'] ] +except KeyError: pass + XEN_ROOT = "../.." fsimage = Extension("fsimage", extra_compile_args = extra_compile_args, + extra_link_args = extra_link_args, include_dirs = [ XEN_ROOT + "/tools/libfsimage/common/" ], library_dirs = [ XEN_ROOT + "/tools/libfsimage/common/" ], libraries = ["fsimage"], |