mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 18:21:39 +01:00
Unexpectedly the environment variable which needs to be passed is $LDSHARED and not $LD. Otherwise Python may find the build `ld` instead of the host `ld`. Replace $(LDFLAGS) with $(SHLIB_LDFLAGS) as Python needs shared objects it can load at runtime, not executables. This uses $(CC) instead of $(LD) since Python distutils appends $CFLAGS to $LDFLAGS which breaks many linkers. Signed-off-by: Elliott Mitchell <ehem+xen@m5p.com> Acked-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
49 lines
1.3 KiB
Makefile
49 lines
1.3 KiB
Makefile
XEN_ROOT = $(CURDIR)/../..
|
|
include $(XEN_ROOT)/tools/Rules.mk
|
|
|
|
.PHONY: all
|
|
all: build
|
|
|
|
PY_CFLAGS = $(CFLAGS) $(PY_NOOPT_CFLAGS)
|
|
PY_LDFLAGS = $(SHLIB_LDFLAGS) $(APPEND_LDFLAGS)
|
|
INSTALL_LOG = build/installed_files.txt
|
|
|
|
.PHONY: build
|
|
build:
|
|
CC="$(CC)" CFLAGS="$(PY_CFLAGS)" LDSHARED="$(CC)" LDFLAGS="$(PY_LDFLAGS)" $(PYTHON) setup.py build
|
|
|
|
.PHONY: install
|
|
install:
|
|
$(INSTALL_DIR) $(DESTDIR)$(LIBEXEC_BIN)
|
|
|
|
CC="$(CC)" CFLAGS="$(PY_CFLAGS)" LDSHARED="$(CC)" \
|
|
LDFLAGS="$(PY_LDFLAGS)" $(PYTHON) setup.py install \
|
|
--record $(INSTALL_LOG) $(PYTHON_PREFIX_ARG) \
|
|
--root="$(DESTDIR)" --force
|
|
|
|
$(INSTALL_PYTHON_PROG) scripts/convert-legacy-stream $(DESTDIR)$(LIBEXEC_BIN)
|
|
$(INSTALL_PYTHON_PROG) scripts/verify-stream-v2 $(DESTDIR)$(LIBEXEC_BIN)
|
|
|
|
.PHONY: uninstall
|
|
uninstall:
|
|
rm -f $(DESTDIR)$(LIBEXEC_BIN)/verify-stream-v2
|
|
rm -f $(DESTDIR)$(LIBEXEC_BIN)/convert-legacy-stream
|
|
if [ -e $(INSTALL_LOG) ]; then \
|
|
cat $(INSTALL_LOG) | xargs -i rm -f $(DESTDIR)/{}; \
|
|
fi
|
|
|
|
.PHONY: test
|
|
test:
|
|
LD_LIBRARY_PATH=$$(readlink -f ../libs/ctrl):$$(readlink -f ../xenstore) $(PYTHON) -m unittest discover
|
|
|
|
.PHONY: clean
|
|
clean:
|
|
find . \( -name "*.py[ocd]" -o -name "*~" -o -name "_*.[hc]" \) -delete
|
|
rm -rf build/
|
|
rm -f $(DEPS_RM)
|
|
|
|
.PHONY: distclean
|
|
distclean: clean
|
|
|
|
-include $(DEPS_INCLUDE)
|