From df85edda5f6632f12f5802173a5012a35b19ccdd Mon Sep 17 00:00:00 2001 From: Jonas Eriksson Date: Thu, 6 Mar 2014 08:22:23 +0100 Subject: [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 (PYTHON_SITE_PACKAGES) by either: - 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 Upstream-Status: Submitted [xml@gnome.org] --- 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)]) AC_ARG_WITH(python, [ --with-python[[=DIR]] build Python bindings if found]) +AC_ARG_WITH(python_install_dir, +[ --with-python-install-dir=DIR + install Python bindings in DIR]) AC_ARG_WITH(reader, [ --with-reader add the xmlReader parsing interface (on)]) AC_ARG_WITH(readline, @@ -866,6 +869,10 @@ if test "$with_python" != "no" ; then fi fi fi + if test "$with_python_install_dir" != "" + then + PYTHON_SITE_PACKAGES="$with_python_install_dir" + fi if test "$PYTHON_VERSION" != "" -a "$PYTHON_SITE_PACKAGES" = "" then if test -d $libdir/python$PYTHON_VERSION/site-packages -- 1.9.0