mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 18:21:39 +01:00
Permit user to suppress passing --prefix to setup.py
We change all invocations of setup.py as follows:
* use $(PYTHON) instead of `python' so that the user can specify
an alternative python version if they need to. If not set it
defaults to `python' in Config.mk.
* pass --prefix=$(PREFIX) via a new make variable
$(PYTHON_PREFIX_ARG). This allows a user to suppress the
--prefix=... argument entirely by setting PYTHON_PREFIX_ARG=''.
This will work around the bug described here
https://bugs.launchpad.net/ubuntu/+bug/362570
where passing --prefix=/usr/local (which ought to have no effect as
/usr/local is the default prefix) changes which subdirectory
distutils chooses, and results in the files being installed in
site-packages which is not on the default search path.
Users not affected by this python packaging bug should not set
PYTHON_PREFIX_ARG and their builds will not be affected. (Provided
PREFIX did not contain spaces. People who put spaces in PREFIX are
being quite optimistic.)
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
This commit is contained in:
1 parent
ca8d042e26
commit
727a00e80e
4 files changed
+15
-9
No files matched your search
@@ -16,7 +16,7 @@ NLSDIR = $(SHAREDIR)/locale
|
||||
|
||||
.PHONY: build buildpy
|
||||
buildpy:
|
||||
CC="$(CC)" CFLAGS="$(CFLAGS)" python setup.py build
|
||||
CC="$(CC)" CFLAGS="$(CFLAGS)" $(PYTHON) setup.py build
|
||||
|
||||
build: buildpy refresh-pot refresh-po $(CATALOGS)
|
||||
|
||||
@@ -55,8 +55,8 @@ refresh-po: $(POTFILE)
|
||||
|
||||
.PHONY: install
|
||||
install: install-messages install-dtd
|
||||
CC="$(CC)" CFLAGS="$(CFLAGS)" python setup.py install \
|
||||
--prefix="$(PREFIX)" --root="$(DESTDIR)" --force
|
||||
CC="$(CC)" CFLAGS="$(CFLAGS)" $(PYTHON) setup.py install \
|
||||
$(PYTHON_PREFIX_ARG) --root="$(DESTDIR)" --force
|
||||
|
||||
install-dtd: all
|
||||
$(INSTALL_DIR) $(DESTDIR)$(DOCDIR)
|
||||
|
||||