summaryrefslogtreecommitdiffstats
path: root/meta/recipes-support/libcap-ng/libcap-ng/python.patch
blob: fcd6f9cd334fa502e1bc6f8d138d067bc469041d (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
Subject: [PATCH] configure.ac - Avoid an incorrect check for python.
 Makefile.am - avoid hard coded host include paths.

Upstream-Status: pending

Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Signed-off-by: Li Xin <lixin.fnst@cn.fujitsu.com>
Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
Signed-off-by: Zang Ruochen <zangrc.fnst@cn.fujitsu.com>

---
 bindings/python/Makefile.am |  4 +++-
 configure.ac                | 17 ++---------------
 2 files changed, 5 insertions(+), 16 deletions(-)

diff --git a/bindings/python/Makefile.am b/bindings/python/Makefile.am
index 999b184..c8e49db 100644
--- a/bindings/python/Makefile.am
+++ b/bindings/python/Makefile.am
@@ -23,7 +23,9 @@
 SUBDIRS = test
 CONFIG_CLEAN_FILES = *.loT *.rej *.orig
 AM_CFLAGS = -fPIC -DPIC
-AM_CPPFLAGS = -I. -I$(top_builddir) -I@PYINCLUDEDIR@
+PYLIBVER ?= python$(PYTHON_VERSION)
+PYINC ?= /usr/include/$(PYLIBVER)
+AM_CPPFLAGS = -I. -I$(top_builddir) -I$(PYINC)
 SWIG_FLAGS = -python
 SWIG_INCLUDES = ${AM_CPPFLAGS}
 pyexec_PYTHON = capng.py
diff --git a/configure.ac b/configure.ac
index 8b46f51..2d7e00c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -141,21 +141,8 @@ fi
 
 # Setup Python2 with the interpreter found previously.
 AM_PATH_PYTHON
-PYINCLUDEDIR=`python${am_cv_python_version} -c "from distutils import sysconfig; print(sysconfig.get_config_var('INCLUDEPY'))"`
-if test -f ${PYINCLUDEDIR}/Python.h ; then
-	python_found="yes"
-	AC_SUBST(PYINCLUDEDIR)
-	pybind_dir="python"
-	AC_SUBST(pybind_dir)
-	AC_MSG_NOTICE(Python bindings will be built)
-else
-	python_found="no"
-	if test "x$use_python" = xyes ; then
-		AC_MSG_ERROR([Python explicitly requested and python headers were not found])
-	else
-		AC_MSG_WARN("Python headers not found - python bindings will not be made")
-	fi
-fi
+python_found="yes"
+AC_MSG_NOTICE(Python bindings will be built)
 fi
 AM_CONDITIONAL(HAVE_PYTHON, test ${python_found} = "yes")
 
-- 
2.25.1