summaryrefslogtreecommitdiffstats
path: root/recipes-append/libxml/libxml2/configure-Add-with-python-install-dir.patch
blob: 174be5f222167bd7c006ecf6d6208830ea21f03d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
From df85edda5f6632f12f5802173a5012a35b19ccdd Mon Sep 17 00:00:00 2001
From: Jonas Eriksson <jonas.eriksson@enea.com>
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 <jonas.eriksson@enea.com>

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