libglib2: fix build when toolchain has no thread support
authorSamuel Martin <s.martin49@gmail.com>
Tue, 14 May 2013 22:26:49 +0000 (22:26 +0000)
committerPeter Korsgaard <jacmet@sunsite.dk>
Wed, 15 May 2013 13:38:35 +0000 (15:38 +0200)
Fixes the build failure visible at
http://autobuild.buildroot.net/results/3d3/3d3f4f0044a4b58ce3d0a3449a5f012d953d59bb

Signed-off-by: Samuel Martin <s.martin49@gmail.com>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
package/libglib2/libglib2-0004-fix-build-when-no-thread-support.patch [new file with mode: 0644]
package/libglib2/libglib2.mk

diff --git a/package/libglib2/libglib2-0004-fix-build-when-no-thread-support.patch b/package/libglib2/libglib2-0004-fix-build-when-no-thread-support.patch
new file mode 100644 (file)
index 0000000..5563544
--- /dev/null
@@ -0,0 +1,28 @@
+Fix gio/gcancellable.c build when thread support is disabled
+
+Signed-off-by: "Samuel Martin" <s.martin49@gmail.com>
+---
+--- a/gio/gcancellable.c       2013-05-14 23:08:25.514461348 +0200
++++ b/gio/gcancellable.c       2013-05-14 23:10:23.347789625 +0200
+@@ -270,8 +270,10 @@ g_cancellable_reset (GCancellable *cance
+   while (priv->cancelled_running)
+     {
+       priv->cancelled_running_waiting = TRUE;
++#if defined(G_THREADS_ENABLED)
+       g_cond_wait (cancellable_cond,
+                    g_static_mutex_get_mutex (& G_LOCK_NAME (cancellable)));
++#endif
+     }
+   if (priv->cancelled)
+@@ -619,8 +621,10 @@ g_cancellable_disconnect (GCancellable
+   while (priv->cancelled_running)
+     {
+       priv->cancelled_running_waiting = TRUE;
++#if defined(G_THREADS_ENABLED)
+       g_cond_wait (cancellable_cond,
+                    g_static_mutex_get_mutex (& G_LOCK_NAME (cancellable)));
++#endif
+     }
+   g_signal_handler_disconnect (cancellable, handler_id);
index d78e8ec0faa33b55d5fa47809f824d62246bd67d..3ac78ba8f65b9c65be7cd8a5bca2c98c5c010bed 100644 (file)
@@ -67,6 +67,9 @@ HOST_LIBGLIB2_CONF_OPT = \
                --disable-tests
 
 LIBGLIB2_CONF_OPT += --disable-tests
+ifeq ($(BR2_TOOLCHAIN_HAS_THREADS),)
+       LIBGLIB2_CONF_OPT += --with-threads=none --disable-threads
+endif
 
 LIBGLIB2_DEPENDENCIES = host-pkgconf host-libglib2 libffi zlib $(if $(BR2_NEEDS_GETTEXT),gettext) host-gettext