@@ -4,84 +4,35 @@ Contains ad hoc patches for cross building.
4
4
5
5
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
6
6
From: Kleis Auke Wolthuizen <github@kleisauke.nl>
7
- Date: Wed, 1 Jul 2020 12:30:21 +0200
8
- Subject: [PATCH 1/2] Revert "meson: Fix underlinking of static libintl by trying
9
- iconv and pthread"
7
+ Date: Fri, 24 Jun 2022 11:15:23 +0200
8
+ Subject: [PATCH 1/1] Ensure standalone intl support library can be found
10
9
11
- This reverts commit 56271ff27119f0b6b7dc6cc0c081d64bec06b473 as it causes
12
- issues with a statically built libintl on MinGW-w64.
10
+ See: https://gitlab.gnome.org/GNOME/glib/-/merge_requests/2109#note_1485662
13
11
14
- diff --git a/glib/meson.build b/glib/meson.build
15
- index 1111111..2222222 100644
16
- --- a/glib/meson.build
17
- +++ b/glib/meson.build
18
- @@ -375,19 +375,19 @@ libglib = library('glib-2.0',
19
- link_args : [noseh_link_args, glib_link_flags, win32_ldflags],
20
- include_directories : configinc,
21
- link_with: [charset_lib, gnulib_lib],
22
- - dependencies : [pcre, thread_dep, librt] + libintl_deps + libiconv + platform_deps + [gnulib_libm_dependency, libm] + [libsysprof_capture_dep],
23
- + dependencies : [pcre, thread_dep, libintl, librt] + libiconv + platform_deps + [gnulib_libm_dependency, libm] + [libsysprof_capture_dep],
24
- c_args : glib_c_args,
25
- objc_args : glib_c_args,
26
- )
27
-
28
- libglib_dep = declare_dependency(
29
- link_with : libglib,
30
- - dependencies : libintl_deps,
31
- + dependencies : libintl,
32
- # We sadly need to export configinc here because everyone includes <glib/*.h>
33
- include_directories : [configinc, glibinc])
34
-
35
- pkg.generate(libglib,
36
- - libraries : [libintl_deps],
37
- + libraries : [libintl],
38
- libraries_private : [win32_ldflags],
39
- subdirs : ['glib-2.0'],
40
- extra_cflags : ['-I${libdir}/glib-2.0/include'] + win32_cflags,
41
12
diff --git a/meson.build b/meson.build
42
13
index 1111111..2222222 100644
43
14
--- a/meson.build
44
15
+++ b/meson.build
45
- @@ -2030,40 +2030,17 @@ endif
46
- # proxy-libintl subproject.
47
- # FIXME: glib-gettext.m4 has much more checks to detect broken/uncompatible
48
- # implementations. This could be extended if issues are found in some platforms.
49
- - libintl_deps = []
50
- if cc.has_function('ngettext')
51
- + libintl = []
52
- have_bind_textdomain_codeset = cc.has_function('bind_textdomain_codeset')
53
- else
54
- - # First just find the bare library.
55
- libintl = cc.find_library('intl', required : false)
56
- - # The bare library probably won't link without help if it's static.
57
- - if libintl.found() and not cc.has_function('ngettext', dependencies : libintl)
58
- - libintl_iconv = cc.find_library('iconv', required : false)
59
- - # libintl supports different threading APIs, which may not
60
- - # require additional flags, but it defaults to using pthreads if
61
- - # found. Meson's "threads" dependency does not allow you to
62
- - # prefer pthreads. We may not be using pthreads for glib itself
63
- - # either so just link the library to satisfy libintl rather than
64
- - # also defining the macros with the -pthread flag.
65
- - libintl_pthread = cc.find_library('pthread', required : false)
66
- - # Try linking with just libiconv.
67
- - if libintl_iconv.found() and cc.has_function('ngettext', dependencies : [libintl, libintl_iconv])
68
- - libintl_deps += [libintl_iconv]
69
- - # Then also try linking with pthreads.
70
- - elif libintl_iconv.found() and libintl_pthread.found() and cc.has_function('ngettext', dependencies : [libintl, libintl_iconv, libintl_pthread])
71
- - libintl_deps += [libintl_iconv, libintl_pthread]
72
- - else
73
- - libintl = disabler()
74
- - endif
75
- - endif
76
- if not libintl.found()
77
- libintl = subproject('proxy-libintl').get_variable('intl_dep')
78
- - libintl_deps = [libintl] + libintl_deps
79
- have_bind_textdomain_codeset = true # proxy-libintl supports it
16
+ @@ -2065,11 +2065,11 @@ if libintl.found()
17
+ #
18
+ # Meson's builtin dependency lookup as of 0.60.0 doesn't check for
19
+ # pthread, so we do this manually here.
20
+ - if cc.has_function('ngettext', dependencies : libintl)
21
+ + if cc.has_function('ngettext', prefix: '#include <libintl.h>', dependencies : libintl)
22
+ libintl_deps += [libintl]
80
23
else
81
- - libintl_deps = [libintl] + libintl_deps
82
- have_bind_textdomain_codeset = cc.has_function('bind_textdomain_codeset',
83
- - dependencies : libintl_deps)
84
- + dependencies : libintl)
85
- endif
24
+ libintl_pthread = cc.find_library('pthread', required : false)
25
+ - if libintl_pthread.found() and cc.has_function('ngettext', dependencies : [libintl, libintl_pthread])
26
+ + if libintl_pthread.found() and cc.has_function('ngettext', prefix: '#include <libintl.h>', dependencies : [libintl, libintl_pthread])
27
+ libintl_deps += [libintl, libintl_pthread]
28
+ else
29
+ libintl = disabler()
30
+ @@ -2078,7 +2078,7 @@ if libintl.found()
86
31
endif
87
32
33
+ if libintl.found()
34
+ - have_bind_textdomain_codeset = cc.has_function('bind_textdomain_codeset', dependencies: libintl_deps)
35
+ + have_bind_textdomain_codeset = cc.has_function('bind_textdomain_codeset', prefix: '#include <libintl.h>', dependencies: libintl_deps)
36
+ else
37
+ libintl = subproject('proxy-libintl').get_variable('intl_dep')
38
+ libintl_deps = [libintl]
0 commit comments