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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
|
From 241041b0b38e5851bb1a166cbd9393bbdd6eea06 Mon Sep 17 00:00:00 2001
From: Luke Shumaker <lukeshu@lukeshu.com>
Date: Sun, 24 Dec 2017 03:42:06 -0500
Subject: [PATCH] meson: Build with static linkage.
This switches all libraries from using shared_library() to
static_library(). For some reason, switching them to just library() (which
should obey default_library) doesn't allow -Ddefault_library=static to set
most of them to static. I suspect it's a bug in meson 0.44.0-1.
This also amends libglib_dep to include the pkg-config's Libs.private.
---
gio/meson.build | 2 +-
gio/tests/gdbus-object-manager-example/meson.build | 2 +-
gio/tests/modules/meson.build | 4 ++--
glib/meson.build | 3 ++-
gmodule/meson.build | 2 +-
gobject/meson.build | 2 +-
gthread/meson.build | 2 +-
7 files changed, 9 insertions(+), 8 deletions(-)
diff --git a/gio/meson.build b/gio/meson.build
index d7030aa29..b904841b2 100644
--- a/gio/meson.build
+++ b/gio/meson.build
@@ -711,7 +711,7 @@ else
gio_dtrace_hdr = []
endif
-libgio = shared_library('gio-2.0',
+libgio = static_library('gio-2.0',
gioenumtypes_h, gioenumtypes_c, gnetworking_h, gio_sources,
gio_dtrace_hdr, gio_dtrace_obj,
version : library_version,
diff --git a/gio/tests/gdbus-object-manager-example/meson.build b/gio/tests/gdbus-object-manager-example/meson.build
index 630357378..b92d6ea9d 100644
--- a/gio/tests/gdbus-object-manager-example/meson.build
+++ b/gio/tests/gdbus-object-manager-example/meson.build
@@ -14,7 +14,7 @@ gdbus_example_objectmanager_generated = custom_target('gdbus-example-objectmanag
'--generate-docbook', 'gdbus-example-objectmanager-generated',
'@INPUT@'])
-libgdbus_example_objectmanager = shared_library('libgdbus-example-objectmanager',
+libgdbus_example_objectmanager = static_library('libgdbus-example-objectmanager',
gdbus_example_objectmanager_generated,
c_args : ['-DHAVE_CONFIG_H=1'] + gio_c_args,
dependencies : [libglib_dep, libgmodule_dep, libgobject_dep, libgio_dep],
diff --git a/gio/tests/modules/meson.build b/gio/tests/modules/meson.build
index c219015d3..21a43c5ee 100644
--- a/gio/tests/modules/meson.build
+++ b/gio/tests/modules/meson.build
@@ -1,10 +1,10 @@
-libtestmodulea = shared_library('testmodulea', 'test-module-a.c',
+libtestmodulea = static_library('testmodulea', 'test-module-a.c',
install : false,
dependencies : [libglib_dep, libgobject_dep, libgmodule_dep, libgio_dep],
c_args : [ ]
)
-libtestmoduleb = shared_library('testmoduleb', 'test-module-b.c',
+libtestmoduleb = static_library('testmoduleb', 'test-module-b.c',
install : false,
dependencies : [libglib_dep, libgobject_dep, libgmodule_dep, libgio_dep],
c_args : [ ]
diff --git a/glib/meson.build b/glib/meson.build
index e46d2deb6..371e5bfbf 100644
--- a/glib/meson.build
+++ b/glib/meson.build
@@ -220,7 +220,7 @@ if use_pcre_static_flag
pcre_static_args = ['-DPCRE_STATIC']
endif
-libglib = shared_library('glib-2.0',
+libglib = static_library('glib-2.0',
glib_dtrace_obj, glib_dtrace_hdr,
sources : [deprecated_sources, glib_sources, thread_src, plat_src],
version : library_version,
@@ -235,6 +235,7 @@ libglib = shared_library('glib-2.0',
)
libglib_dep = declare_dependency(link_with : libglib,
+ dependencies : [pcre, thread_dep, libintl, librt] + libiconv + platform_deps,
# We sadly need to export configinc here because everyone includes <glib/*.h>
include_directories : [configinc, glibinc])
diff --git a/gmodule/meson.build b/gmodule/meson.build
index fd0219d92..841fc1e91 100644
--- a/gmodule/meson.build
+++ b/gmodule/meson.build
@@ -87,7 +87,7 @@ gmoduleconf_h = configure_file(input : 'gmoduleconf.h.in',
install_headers(['gmodule.h'], subdir : 'glib-2.0')
-libgmodule = shared_library('gmodule-2.0',
+libgmodule = static_library('gmodule-2.0',
sources : ['gmodule.c'],
version : library_version,
soversion : soversion,
diff --git a/gobject/meson.build b/gobject/meson.build
index 9c722ce30..feac8fa92 100644
--- a/gobject/meson.build
+++ b/gobject/meson.build
@@ -53,7 +53,7 @@ else
gobject_dtrace_hdr = []
endif
-libgobject = shared_library('gobject-2.0',
+libgobject = static_library('gobject-2.0',
gobject_dtrace_obj, gobject_dtrace_hdr,
sources : [gobject_c_sources],
version : library_version,
diff --git a/gthread/meson.build b/gthread/meson.build
index 2d5913a91..63e6dd86b 100644
--- a/gthread/meson.build
+++ b/gthread/meson.build
@@ -1,6 +1,6 @@
# Just a skeleton lib for backwards compatibility since all the functionaliy
# has been moved into glib now
-libgthread = shared_library('gthread-2.0',
+libgthread = static_library('gthread-2.0',
sources : [ 'gthread-impl.c' ],
version : library_version,
soversion : soversion,
--
2.15.1
|