diff options
author | He Zhe <zhe.he@windriver.com> | 2019-08-29 21:15:49 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-09-06 14:58:09 +0100 |
commit | f2713fc631729d62428d5f6a08cb3eae56fe001b (patch) | |
tree | 81eb923878784e280dd76dbd356147e7cf1abf3a /meta/recipes-devtools/qemu | |
parent | a6c071c3abb2e43eb42d01233dab911332a2fea7 (diff) | |
download | poky-f2713fc631729d62428d5f6a08cb3eae56fe001b.tar.gz |
qemu: Add pkg-config handling for libgcrypt
When PACKAGECONFIG libgcrypt is enabled, we would get the following error.
ERROR: /usr/bin/libgcrypt-config should not be used, use an alternative such as pkg-config
In oe-core, libgcrypt has been turned to be configured with pkg-config instead
of libgcrypt-config, but qemu configure script does not contain pkg-config
related part for libgcrypt to handle it.
(From OE-Core rev: 37bec7c4ea3ebd17366fbd2ec719de401ec36275)
Signed-off-by: He Zhe <zhe.he@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/qemu')
-rw-r--r-- | meta/recipes-devtools/qemu/qemu.inc | 1 | ||||
-rw-r--r-- | meta/recipes-devtools/qemu/qemu/0010-configure-Add-pkg-config-handling-for-libgcrypt.patch | 93 |
2 files changed, 94 insertions, 0 deletions
diff --git a/meta/recipes-devtools/qemu/qemu.inc b/meta/recipes-devtools/qemu/qemu.inc index d2dd2bc9c1..3eeba6e3f3 100644 --- a/meta/recipes-devtools/qemu/qemu.inc +++ b/meta/recipes-devtools/qemu/qemu.inc | |||
@@ -22,6 +22,7 @@ SRC_URI = "https://download.qemu.org/${BPN}-${PV}.tar.xz \ | |||
22 | file://0007-apic-fixup-fallthrough-to-PIC.patch \ | 22 | file://0007-apic-fixup-fallthrough-to-PIC.patch \ |
23 | file://0008-linux-user-Fix-webkitgtk-hangs-on-32-bit-x86-target.patch \ | 23 | file://0008-linux-user-Fix-webkitgtk-hangs-on-32-bit-x86-target.patch \ |
24 | file://0009-Fix-webkitgtk-builds.patch \ | 24 | file://0009-Fix-webkitgtk-builds.patch \ |
25 | file://0010-configure-Add-pkg-config-handling-for-libgcrypt.patch \ | ||
25 | " | 26 | " |
26 | UPSTREAM_CHECK_REGEX = "qemu-(?P<pver>\d+(\.\d+)+)\.tar" | 27 | UPSTREAM_CHECK_REGEX = "qemu-(?P<pver>\d+(\.\d+)+)\.tar" |
27 | 28 | ||
diff --git a/meta/recipes-devtools/qemu/qemu/0010-configure-Add-pkg-config-handling-for-libgcrypt.patch b/meta/recipes-devtools/qemu/qemu/0010-configure-Add-pkg-config-handling-for-libgcrypt.patch new file mode 100644 index 0000000000..a8ab7daa42 --- /dev/null +++ b/meta/recipes-devtools/qemu/qemu/0010-configure-Add-pkg-config-handling-for-libgcrypt.patch | |||
@@ -0,0 +1,93 @@ | |||
1 | From 5214dd4461f2090ef0965b4d2518f49927d61cbc Mon Sep 17 00:00:00 2001 | ||
2 | From: He Zhe <zhe.he@windriver.com> | ||
3 | Date: Wed, 28 Aug 2019 19:56:28 +0800 | ||
4 | Subject: [Qemu-devel] [PATCH] configure: Add pkg-config handling for libgcrypt | ||
5 | |||
6 | libgcrypt may also be controlled by pkg-config, this patch adds pkg-config | ||
7 | handling for libgcrypt. | ||
8 | |||
9 | Upstream-Status: Denied [https://lists.nongnu.org/archive/html/qemu-devel/2019-08/msg06333.html] | ||
10 | |||
11 | Signed-off-by: He Zhe <zhe.he@windriver.com> | ||
12 | --- | ||
13 | configure | 48 ++++++++++++++++++++++++++++++++++++++++-------- | ||
14 | 1 file changed, 40 insertions(+), 8 deletions(-) | ||
15 | |||
16 | diff --git a/configure b/configure | ||
17 | index e44e454..0f362a7 100755 | ||
18 | --- a/configure | ||
19 | +++ b/configure | ||
20 | @@ -2875,6 +2875,30 @@ has_libgcrypt() { | ||
21 | return 0 | ||
22 | } | ||
23 | |||
24 | +has_libgcrypt_pkgconfig() { | ||
25 | + if ! has $pkg_config ; then | ||
26 | + return 1 | ||
27 | + fi | ||
28 | + | ||
29 | + if ! $pkg_config --list-all | grep libgcrypt > /dev/null 2>&1 ; then | ||
30 | + return 1 | ||
31 | + fi | ||
32 | + | ||
33 | + if test -n "$cross_prefix" ; then | ||
34 | + host=$($pkg_config --variable=host libgcrypt) | ||
35 | + if test "${host%-gnu}-" != "${cross_prefix%-gnu}" ; then | ||
36 | + print_error "host($host) does not match cross_prefix($cross_prefix)" | ||
37 | + return 1 | ||
38 | + fi | ||
39 | + fi | ||
40 | + | ||
41 | + if ! $pkg_config --atleast-version=1.5.0 libgcrypt ; then | ||
42 | + print_error "libgcrypt version is $($pkg_config --modversion libgcrypt)" | ||
43 | + return 1 | ||
44 | + fi | ||
45 | + | ||
46 | + return 0 | ||
47 | +} | ||
48 | |||
49 | if test "$nettle" != "no"; then | ||
50 | pass="no" | ||
51 | @@ -2902,7 +2926,14 @@ fi | ||
52 | |||
53 | if test "$gcrypt" != "no"; then | ||
54 | pass="no" | ||
55 | - if has_libgcrypt; then | ||
56 | + if has_libgcrypt_pkgconfig; then | ||
57 | + gcrypt_cflags=$($pkg_config --cflags libgcrypt) | ||
58 | + if test "$static" = "yes" ; then | ||
59 | + gcrypt_libs=$($pkg_config --libs --static libgcrypt) | ||
60 | + else | ||
61 | + gcrypt_libs=$($pkg_config --libs libgcrypt) | ||
62 | + fi | ||
63 | + elif has_libgcrypt; then | ||
64 | gcrypt_cflags=$(libgcrypt-config --cflags) | ||
65 | gcrypt_libs=$(libgcrypt-config --libs) | ||
66 | # Debian has removed -lgpg-error from libgcrypt-config | ||
67 | @@ -2912,15 +2943,16 @@ if test "$gcrypt" != "no"; then | ||
68 | then | ||
69 | gcrypt_libs="$gcrypt_libs -lgpg-error" | ||
70 | fi | ||
71 | + fi | ||
72 | |||
73 | - # Link test to make sure the given libraries work (e.g for static). | ||
74 | - write_c_skeleton | ||
75 | - if compile_prog "" "$gcrypt_libs" ; then | ||
76 | - LIBS="$gcrypt_libs $LIBS" | ||
77 | - QEMU_CFLAGS="$QEMU_CFLAGS $gcrypt_cflags" | ||
78 | - pass="yes" | ||
79 | - fi | ||
80 | + # Link test to make sure the given libraries work (e.g for static). | ||
81 | + write_c_skeleton | ||
82 | + if compile_prog "" "$gcrypt_libs" ; then | ||
83 | + LIBS="$gcrypt_libs $LIBS" | ||
84 | + QEMU_CFLAGS="$QEMU_CFLAGS $gcrypt_cflags" | ||
85 | + pass="yes" | ||
86 | fi | ||
87 | + | ||
88 | if test "$pass" = "yes"; then | ||
89 | gcrypt="yes" | ||
90 | cat > $TMPC << EOF | ||
91 | -- | ||
92 | 2.7.4 | ||
93 | |||