xref: /OK3568_Linux_fs/buildroot/package/harfbuzz/0001-meson.build-check-for-pthread.h.patch (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1From 96bbf3a3af45d86f790afdf91a6686c37421e92b Mon Sep 17 00:00:00 2001
2From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
3Date: Sun, 15 Nov 2020 10:57:37 +0100
4Subject: [PATCH] meson.build: check for pthread.h
5
6Check for pthread.h otherwise the build will fail with some toolchains
7that have libphtread.so but not pthread.h:
8
9Run-time dependency threads found: YES
10
11../src/hb-mutex.hh:53:10: fatal error: pthread.h: No such file or directory
12 #include <pthread.h>
13          ^~~~~~~~~~~
14
15Moreover, fix detection of pthread fallback
16
17Fixes:
18 - http://autobuild.buildroot.org/results/70c98e89b1d5e5b651d1f6928dc53f465103f57a
19
20Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
21---
22 meson.build | 6 ++++--
23 1 file changed, 4 insertions(+), 2 deletions(-)
24
25diff --git a/meson.build b/meson.build
26index bf3925db..6d263d48 100644
27--- a/meson.build
28+++ b/meson.build
29@@ -270,7 +270,9 @@ endif
30 # threads
31 thread_dep = null_dep
32 if host_machine.system() != 'windows'
33-  thread_dep = dependency('threads', required: false)
34+  if cpp.has_header('pthread.h')
35+    thread_dep = dependency('threads', required: false)
36+  endif
37
38   if thread_dep.found()
39     conf.set('HAVE_PTHREAD', 1)
40--
412.29.2
42
43