summaryrefslogtreecommitdiff
path: root/libre/glib2-static/libs.diff
blob: eef85b814cfe8c56f5f1f1f1a82e13092c51483d (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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
diff --git i/gio/meson.build w/gio/meson.build
index 4a10d49d7eb3229c..77537a77a26dcb5b 100644
--- i/gio/meson.build
+++ w/gio/meson.build
@@ -741,7 +741,7 @@ libgio = shared_library('gio-2.0',
                   libgobject_dep, libgmodule_dep] + platform_deps + network_libs,
   c_args : gio_c_args,
   # intl.lib is not compatible with SAFESEH
-  link_args : noseh_link_args,
+  link_args : noseh_link_args + library_link_args,
 )
 
 libgio_dep = declare_dependency(link_with : libgio,
diff --git i/glib/meson.build w/glib/meson.build
index f12a8b45bbbfec8f..2a505b3dd79ef163 100644
--- i/glib/meson.build
+++ w/glib/meson.build
@@ -227,7 +227,7 @@ libglib = shared_library('glib-2.0',
   soversion : soversion,
   install : true,
   # intl.lib is not compatible with SAFESEH
-  link_args : noseh_link_args,
+  link_args : noseh_link_args + library_link_args,
   include_directories : configinc,
   link_with : [charset_lib, gnulib_lib],
   dependencies : [pcre, thread_dep, libintl, librt] + libiconv + platform_deps,
diff --git i/gmodule/meson.build w/gmodule/meson.build
index 191bca2446f9977e..fd0219d9225f2f3f 100644
--- i/gmodule/meson.build
+++ w/gmodule/meson.build
@@ -37,7 +37,7 @@ elif cc.has_function('NSLinkModule')
 elif cc.links(dlopen_dlsym_test_code, args : '-ldl', name : 'dlopen() and dlsym() in libdl')
   g_module_impl = 'G_MODULE_IMPL_DL'
   libdl_dep = cc.find_library('dl')
-  g_module_lib_args = '-ldl'
+  g_module_lib_args = ['-ldl']
 endif
 
 # additional checks for G_MODULE_IMPL_DL
@@ -72,25 +72,29 @@ if g_module_impl == ''
   message('WARNING: No suitable GModule implementation found!')
 endif
 
+# For pc files
+glib_conf.set('G_MODULE_SUPPORTED', g_module_impl == '0' ? 'false' : 'true')
+glib_conf.set('G_MODULE_LIBS', ' '.join(g_module_lib_args))
+
 gmoduleconf_conf.set('G_MODULE_IMPL', g_module_impl)
-gmoduleconf_conf.set('G_MODULE_SUPPORTED', g_module_impl != '0')
 gmoduleconf_conf.set('G_MODULE_HAVE_DLERROR', g_module_have_dlerror)
 gmoduleconf_conf.set('G_MODULE_NEED_USCORE', g_module_need_uscore)
 gmoduleconf_conf.set('G_MODULE_BROKEN_RTLD_GLOBAL', g_module_broken_rtld_global)
 
 gmoduleconf_h = configure_file(input : 'gmoduleconf.h.in',
                                output : 'gmoduleconf.h',
                                configuration : gmoduleconf_conf)
 
 install_headers(['gmodule.h'], subdir : 'glib-2.0')
 
 libgmodule = shared_library('gmodule-2.0',
   sources : ['gmodule.c'],
   version : library_version,
   soversion : soversion,
   install : true,
   include_directories : [configinc, gmoduleinc],
   dependencies : [libdl_dep, libglib_dep],
+  link_args : library_link_args,
   c_args : ['-DG_LOG_DOMAIN="GModule"', '-DG_DISABLE_DEPRECATED'] + glib_hidden_visibility_args)
 
 libgmodule_dep = declare_dependency(link_with : libgmodule,
diff --git i/gobject/meson.build w/gobject/meson.build
index 65ffef0697b3bad4..32f6f91db12f29b6 100644
--- i/gobject/meson.build
+++ w/gobject/meson.build
@@ -61,6 +61,7 @@ libgobject = shared_library('gobject-2.0',
   install : true,
   include_directories : [configinc],
   dependencies : [libintl, libffi_dep, libglib_dep],
+  link_args : library_link_args,
   c_args : ['-DG_LOG_DOMAIN="GLib-GObject"', '-DGOBJECT_COMPILATION'] + glib_hidden_visibility_args)
 
 libgobject_dep = declare_dependency(link_with : libgobject,
diff --git i/gthread/meson.build w/gthread/meson.build
index 8ccac3369894bda4..2d5913a91525460f 100644
--- i/gthread/meson.build
+++ w/gthread/meson.build
@@ -6,4 +6,5 @@ libgthread = shared_library('gthread-2.0',
   soversion : soversion,
   install : true,
   dependencies : [libglib_dep],
+  link_args : library_link_args,
   c_args : ['-DG_LOG_DOMAIN="GThread"' ] + glib_hidden_visibility_args)
diff --git i/meson.build w/meson.build
index 208c23087627de1e..dd860592b26c9973 100644
--- i/meson.build
+++ w/meson.build
@@ -1541,6 +1541,13 @@ glib_conf.set('GIO_MODULE_DIR', '${libdir}/gio/modules')
 # @G_MODULE_LIBS@ @SELINUX_LIBS@ @COCOA_LIBS@ @CARBON_LIBS@ @G_LIBS_EXTRA@
 # @PCRE_REQUIRES@ @GLIB_EXTRA_CFLAGS@ @G_THREAD_CFLAGS@
 
+# HACK
+glib_conf.set('G_THREAD_LIBS', '-pthread')
+glib_conf.set('G_THREAD_CFLAGS', '-pthread')
+glib_conf.set('G_MODULE_LDFLAGS', '-Wl,--export-dynamic')
+glib_conf.set('PCRE_REQUIRES', 'libpcre')
+library_link_args = [ '-Wl,-z,nodelete' ]
+
 # Tracing: dtrace
 want_dtrace = get_option('enable-dtrace')
 enable_dtrace = false