aboutsummaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-extended/volume_key/files/0001-explicitly-support-python3-by-pkg-config.patch
blob: 7fc76ab2f9f6b841c55bba5cd784bec2a1c28c3e (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
From 968c7506bea3b8d66e18a562d8b8491172631b37 Mon Sep 17 00:00:00 2001
From: Hongxu Jia <hongxu.jia@windriver.com>
Date: Fri, 28 Apr 2017 04:50:30 -0400
Subject: [PATCH] explicitly support python3 by pkg-config

The PYTHON_CPPFLAGS and -lpython$(PYTHON_VERSION) is hardcoded,
use pkg-config to replace

Upstream-Status: Inappropriate [wr-installer specific]

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>

---
 Makefile.am  | 5 ++---
 configure.ac | 2 ++
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 68560b1..ee2b4dc 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -20,7 +20,6 @@ ACLOCAL_AMFLAGS = -I m4
 AM_CPPFLAGS = $(blkid_CFLAGS) $(glib_CFLAGS) $(GPGME_CFLAGS) \
 	$(libcryptsetup_CFLAGS) $(nss_CFLAGS)
 LOCALEDIR_CPPFLAGS = -DLOCALEDIR='"$(localedir)"'
-PYTHON_CPPFLAGS = -I/usr/include/python$(PYTHON_VERSION)
 
 ## Targets
 SUBDIRS = po
@@ -63,9 +62,9 @@ lib_libvolume_key_la_LIBADD = $(blkid_LIBS) $(glib_LIBS) $(GPGME_LIBS) \
 	$(LTLIBINTL) $(libcryptsetup_LIBS) $(nss_LIBS)
 
 python__volume_key_la_SOURCES = python/volume_key_wrap.c
-python__volume_key_la_CPPFLAGS = $(AM_CPPFLAGS) $(PYTHON_CPPFLAGS)
+python__volume_key_la_CPPFLAGS = $(AM_CPPFLAGS) $(python3_CFLAGS)
 python__volume_key_la_LDFLAGS = -module -avoid-version $(glib_LIBS)
-python__volume_key_la_LIBADD = lib/libvolume_key.la -lpython$(PYTHON_VERSION) \
+python__volume_key_la_LIBADD = lib/libvolume_key.la $(python3_LIBS) \
 	$(glib_LIBS) $(nss_LIBS)
 
 src_volume_key_SOURCES = src/volume_key.c
diff --git a/configure.ac b/configure.ac
index 40c3906..16c067d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -31,6 +31,8 @@ LT_INIT([disable-static])
 AC_PATH_PROGS(PYTHON, python2.7 python2.6 python2 python, [Python is required])
 AM_PATH_PYTHON([2.6], [], AC_MSG_ERROR([Python 2.6 or 2.7 is required]))
 
+PKG_CHECK_MODULES(python3, [python3])
+
 AC_PATH_PROG([GPG], [gpg2])
 AC_ARG_VAR([GPG])
 AC_DEFINE_UNQUOTED([GPG_PATH], "$GPG", [Path to the gpg2 executable])