aboutsummaryrefslogtreecommitdiffstats
path: root/Config.mk
diff options
context:
space:
mode:
authorKeir Fraser <keir.fraser@citrix.com>2009-05-07 19:32:10 +0100
committerKeir Fraser <keir.fraser@citrix.com>2009-05-07 19:32:10 +0100
commit727a00e80e581ee15ea2b7caea3fe27c415164f5 (patch)
treeb0b2c380052ec215eaa5ea867024e9a8173ac70d /Config.mk
parentca8d042e26e9b6e98e2b6bfcbba0c8025e135012 (diff)
downloadxen-727a00e80e581ee15ea2b7caea3fe27c415164f5.tar.gz
xen-727a00e80e581ee15ea2b7caea3fe27c415164f5.tar.bz2
xen-727a00e80e581ee15ea2b7caea3fe27c415164f5.zip
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>
Diffstat (limited to 'Config.mk')
-rw-r--r--Config.mk6
1 files changed, 6 insertions, 0 deletions
diff --git a/Config.mk b/Config.mk
index c1aa25ccd2..214b59296f 100644
--- a/Config.mk
+++ b/Config.mk
@@ -35,6 +35,12 @@ EXTRA_INCLUDES += $(EXTRA_PREFIX)/include
EXTRA_LIB += $(EXTRA_PREFIX)/$(LIBLEAFDIR)
endif
+PYTHON ?= python
+PYTHON_PREFIX_ARG ?= --prefix="$(PREFIX)"
+# The above requires that PREFIX contains *no spaces*. This variable is here
+# to permit the user to set PYTHON_PREFIX_ARG to '' to workaround this bug:
+# https://bugs.launchpad.net/ubuntu/+bug/362570
+
# cc-option: Check if compiler supports first option, else fall back to second.
# Usage: cflags-y += $(call cc-option,$(CC),-march=winchip-c6,-march=i586)
cc-option = $(shell if test -z "`$(1) $(2) -S -o /dev/null -xc \