aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Ben Boeckel <MathStuf@gmail.com>2011-10-25 14:24:10 -0400
committerGravatar Ben Boeckel <MathStuf@gmail.com>2011-10-25 14:40:56 -0400
commit47f84c9c76366da2fefff0fd29d57712c695bc68 (patch)
tree7d5d707b436b109e2f824bca0c4e2afc1c96c36a
parent6bc7b4b43d402d1ccef6d7214a5e0bbd007621d9 (diff)
Check if glib needs g_thread_init
Newer glib versions don't need g_thread_init. Of course, there is no announcement or whatever, so you have to go to the docs to discover this. Nevermind the lack of backwards compatibility with a nice message about when it will be removed for a while either.
-rw-r--r--Makefile5
-rw-r--r--src/uzbl-core.c3
2 files changed, 7 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 00a8f89..83be153 100644
--- a/Makefile
+++ b/Makefile
@@ -21,6 +21,11 @@ endif
REQ_PKGS += libsoup-2.4 gthread-2.0 glib-2.0
+# Check for a new glib version
+ifeq ($(shell pkg-config --exists "glib-2.0 >= 2.31.0" && echo 1),1)
+ CPPFLAGS += -DUZBL_GTHREAD_NO_INIT
+endif
+
ARCH:=$(shell uname -m)
COMMIT_HASH:=$(shell ./misc/hash.sh)
diff --git a/src/uzbl-core.c b/src/uzbl-core.c
index f90c5dd..f756740 100644
--- a/src/uzbl-core.c
+++ b/src/uzbl-core.c
@@ -962,9 +962,10 @@ initialize(int argc, char** argv) {
if (uzbl.state.socket_id || uzbl.state.embed)
uzbl.state.plug_mode = TRUE;
+#ifndef UZBL_GTHREAD_NO_INIT
if (!g_thread_supported())
g_thread_init(NULL);
-
+#endif
/* TODO: move the handler setup to event_buffer_timeout and disarm the
* handler in empty_event_buffer? */