aboutsummarylogtreecommitdiffstats
path: root/0009-Fix-linking-against-static-D-Bus.patch
blob: 5b8a316f0ccff3485bb22c62def698e423972ee4 (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
From 3acf388e10fd40909af87cfdba35768f2be26be6 Mon Sep 17 00:00:00 2001
From: Martchus <martchus@gmx.net>
Date: Fri, 3 Feb 2017 19:36:25 +0100
Subject: [PATCH 09/33] Fix linking against static D-Bus

---
 configure.json             | 9 +++++++--
 src/dbus/qdbus_symbols_p.h | 4 ++++
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/configure.json b/configure.json
index 522bd34e9b..17446b6c21 100644
--- a/configure.json
+++ b/configure.json
@@ -170,17 +170,22 @@
             "label": "D-Bus >= 1.2",
             "test": {
                 "include": "dbus/dbus.h",
-                "main": "(void) dbus_bus_get_private(DBUS_BUS_SYSTEM, (DBusError *)NULL);"
+                "main": "(void) dbus_bus_get_private(DBUS_BUS_SYSTEM, (DBusError *)NULL);",
+                "qmake": "static: DEFINES += DBUS_STATIC_BUILD"
             },
             "sources": [
                 { "type": "pkgConfig", "args": "dbus-1 >= 1.2" },
+                {
+                    "libs": "-ldbus-1 -lws2_32 -liphlpapi",
+                    "condition": "config.win32 && !features.shared"
+                },
                 {
                     "libs": "",
                     "builds": {
                         "debug": "-ldbus-1d",
                         "release": "-ldbus-1"
                     },
-                    "condition": "config.win32"
+                    "condition": "config.win32 && features.shared"
                 },
                 { "libs": "-ldbus-1", "condition": "!config.win32" }
             ]
diff --git a/src/dbus/qdbus_symbols_p.h b/src/dbus/qdbus_symbols_p.h
index 7cce0d71aa..4d3d774d45 100644
--- a/src/dbus/qdbus_symbols_p.h
+++ b/src/dbus/qdbus_symbols_p.h
@@ -57,6 +57,10 @@
 
 #ifndef QT_NO_DBUS
 
+#ifdef QT_STATIC
+#  define DBUS_STATIC_BUILD
+#endif
+
 #ifdef QT_LINKED_LIBDBUS
 #  include <dbus/dbus.h>
 #else
-- 
2.19.2