summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog9
-rw-r--r--configure.ac7
-rwxr-xr-xfind-python-path.py14
-rw-r--r--python/Makefile.am2
4 files changed, 29 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index e69de29..86d9510 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -0,0 +1,9 @@
+2006-08-18 Rodney Dawes <dobey@novell.com>
+
+ * configure.ac: Determine the python site-packages path and substitute
+ it for the Makefiles to use
+
+ * find-python-path.py: Add this script to discover the python path
+
+ * python/Makefile.am: Remove the pythondir declaration from here, as
+ it is now defined by the configure script
diff --git a/configure.ac b/configure.ac
index 2e72c2b..86dbc04 100644
--- a/configure.ac
+++ b/configure.ac
@@ -8,6 +8,12 @@ AC_COPYRIGHT([Copyright 2006 Novell, Inc.])
AM_INIT_AUTOMAKE
AM_MAINTAINER_MODE
+AC_MSG_CHECKING([python site path])
+pythonsitedir="`./find-python-path.py`"
+pythondir="\${libdir}/${pythonsitedir}"
+AC_MSG_RESULT([$pythondir])
+AC_SUBST(pythondir)
+
AC_CONFIG_FILES([
Makefile
python/Makefile
@@ -15,4 +21,3 @@ scripts/Makefile
])
AC_OUTPUT
-
diff --git a/find-python-path.py b/find-python-path.py
new file mode 100755
index 0000000..21ecb12
--- /dev/null
+++ b/find-python-path.py
@@ -0,0 +1,14 @@
+#!/usr/bin/env python
+
+import sys
+from os.path import split, basename
+
+def find_path ():
+ for path in sys.path:
+ (head, tail) = split (path)
+ if tail == 'site-packages':
+ base = basename (head)
+ print base + '/' + tail
+ return
+
+find_path ()
diff --git a/python/Makefile.am b/python/Makefile.am
index 77b028a..1a42a7f 100644
--- a/python/Makefile.am
+++ b/python/Makefile.am
@@ -1,6 +1,4 @@
-pythondir = $(libdir)/python/site-packages
-
python_DATA = A11yTestUtils.py
EXTRA_DIST = $(python_DATA)