summary refs log tree commit diff stats
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile8
1 files changed, 6 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index dc030b5a..57a3f8f2 100644
--- a/Makefile
+++ b/Makefile
@@ -20,8 +20,12 @@ DOCDIR ?= doc/pydoc
 PREFIX ?= /usr
 MANPREFIX ?= /share/man
 PYOPTIMIZE ?= 1
-PYTHON_SITE_DEST ?= $(shell $(PYTHON) -c 'import sys; sys.stdout.write( \
-	[p for p in sys.path if "site" in p][0])' 2> /dev/null)
+# this finds the shortest item in sys.path that contains "site" or "dist"
+# for example: /usr/lib/python2.6/site-packages
+PYTHON_SITE_DEST ?= $(shell $(PYTHON) -c 'import sys; \
+	dests = sorted([p for p in sys.path if "site" in p or "dist" in p], \
+	key=lambda dest: len(dest)); \
+	sys.stdout.write(dests[0])' 2> /dev/null)
 BMCOUNT ?= 5  # how often to run the benchmarks?
 
 CWD = $(shell pwd)
f='#n94'>94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131