[xml] [PATCH] configure: Add --with-python-install-dir

Cross-compiling the python bindings is a bit difficult today, as the
configure script will figure out the site packages dir

- Generating the path to the site-package target directories using
  libdir, and see if it exists. As it is not possible to point to the
  full path of the sysroot, since that will yield the wrong install
  path, and that the directory does not neccessarily exist on the host,
  this approach will not work.

- Fetch the site packages dir from the python interpreter as pointed to
  by --with-python. Since this python interpreter will point to the
  sysroot, the install dir generated will be inside the sysroot and thus
  not work.

This patch approaches the problem by adding the possibility of
explicitly stating the install dir of the python packages, leaving it up
to the cross-compilation environment to specify it. The patch does not
affect the default case (non-cross compilation).

Signed-off-by: Jonas Eriksson <jonas eriksson enea com>
 configure.in | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/configure.in b/configure.in
index ecaa403..21ad1e7 100644
--- a/configure.in
+++ b/configure.in
@@ -148,6 +148,9 @@ AC_ARG_WITH(push,
 [  --with-push             add the PUSH parser interfaces (on)])
 [  --with-python[[=DIR]]     build Python bindings if found])
+[  --with-python-install-dir=DIR
+                          install Python bindings in DIR])
 [  --with-reader           add the xmlReader parsing interface (on)])
@@ -866,6 +869,10 @@ if test "$with_python" != "no" ; then
+    if test "$with_python_install_dir" != ""
+    then
+       PYTHON_SITE_PACKAGES="$with_python_install_dir"
+    fi
     if test "$PYTHON_VERSION" != "" -a "$PYTHON_SITE_PACKAGES" = ""
        if test -d $libdir/python$PYTHON_VERSION/site-packages

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]