Initialize GLib's Gthread system early at startup in case any plugins need it.

git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5637 ea778897-0a13-0410-b9d1-a72fbfd435f5
This commit is contained in:
Enrico Tröger 2011-03-27 15:04:58 +00:00
parent df172dfedd
commit 5521c67983
6 changed files with 26 additions and 6 deletions

View File

@ -1,3 +1,11 @@
2011-03-27 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
* src/makefile.win32, src/main.c, src/Makefile.am, configure.ac,
wscript:
Initialize GLib's Gthread system early at startup in case any
plugins need it.
2011-03-27 Colomban Wendling <colomban(at)geany(dot)org>
* plugins/splitwindow.c:

View File

@ -146,6 +146,11 @@ AC_SUBST(GIO_LIBS)
if test $have_gio = 1 ; then
AC_DEFINE(HAVE_GIO, 1, [Whether GIO is available])
fi
# GTHREAD checks
gthread_modules="gthread-2.0"
PKG_CHECK_MODULES(GTHREAD, [$gthread_modules])
AC_SUBST(GTHREAD_CFLAGS)
AC_SUBST(GTHREAD_LIBS)
# --disable-deprecated switch for GTK2 purification
AC_ARG_ENABLE(deprecated, [ --disable-deprecated Disable deprecated GTK functions. ],

View File

@ -74,7 +74,7 @@ geany_include_HEADERS = \
INCLUDES = -I$(top_srcdir) -I$(srcdir)/../scintilla/include -I$(srcdir)/../tagmanager/include \
-I$(topsrcdir)/tagmanager/mio @GTK_CFLAGS@ @GIO_CFLAGS@
-I$(topsrcdir)/tagmanager/mio @GTK_CFLAGS@ @GIO_CFLAGS@ @GTHREAD_CFLAGS@
# tell automake we have a C++ file so it uses the C++ linker we need for Scintilla
nodist_EXTRA_geany_SOURCES = dummy.cxx
@ -86,7 +86,8 @@ if MINGW
geany_SOURCES = $(SRCS) win32.c win32.h
geany_LDADD = ../scintilla/libscintilla.a ../tagmanager/libtagmanager.a ../tagmanager/mio/libmio.a \
@GTK_LIBS@ @GIO_LIBS@ $(INTLLIBS) -lole32 -luuid -liberty -lwsock32 geany_private.res
@GTK_LIBS@ @GIO_LIBS@ @GTHREAD_LIBS@ $(INTLLIBS) -lole32 -luuid -liberty -lwsock32 \
geany_private.res
AM_CFLAGS = -DGEANY_DATADIR=\"data\" \
-DGEANY_DOCDIR=\"\" \
@ -113,7 +114,7 @@ else
geany_SOURCES = $(SRCS) vte.c vte.h
geany_LDADD = ../scintilla/libscintilla.a ../tagmanager/libtagmanager.a ../tagmanager/mio/libmio.a \
@GTK_LIBS@ @GIO_LIBS@ $(INTLLIBS)
@GTK_LIBS@ @GIO_LIBS@ @GTHREAD_LIBS@ $(INTLLIBS)
AM_CFLAGS = -DGEANY_DATADIR=\""$(datadir)"\" \
-DGEANY_DOCDIR=\""$(docdir)"\" \

View File

@ -480,7 +480,7 @@ static void print_filetypes(void)
foreach_slist(node, filetypes_by_title)
{
GeanyFiletype *ft = node->data;
printf("%s\n", ft->name);
}
filetypes_free_types();
@ -959,6 +959,11 @@ gint main(gint argc, gchar **argv)
#endif
parse_command_line_options(&argc, &argv);
/* Initialize GLib's thread system in case any plugins want to use it or their
* dependencies (e.g. WebKit, Soup, ...) */
if (!g_thread_supported())
g_thread_init(NULL);
signal(SIGTERM, signal_cb);
#ifdef G_OS_UNIX
/* SIGQUIT is used to kill spawned children and we get also this signal, so ignore */

View File

@ -39,7 +39,7 @@ INCLUDEDIRS= -I.. \
ALL_GTK_LIBS= \
-L"$(PREFIX)/lib" \
-lgtk-win32-2.0 -lgdk-win32-2.0 -latk-1.0 -lgdk_pixbuf-2.0 -lpangowin32-1.0 -lgdi32 \
-lpango-1.0 -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lglib-2.0 -lintl
-lpango-1.0 -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lglib-2.0 -lgthread-2.0 -lintl
# these things are for GTK >= 2.8
# (should be same as with MSYS: pkg-config --libs gtk+-2.0 gthread-2.0)
#"$(PREFIX)/lib/libcairo.dll.a" \

View File

@ -150,6 +150,7 @@ def configure(conf):
have_gtk_210 = True
else:
gtk_version = 'Unknown'
conf.check_cfg(package='gthread-2.0', uselib_store='GTHREAD', args='--cflags --libs')
conf.check_cfg(package='gio-2.0', uselib_store='GIO', args='--cflags --libs', mandatory=False)
# Windows specials
@ -332,7 +333,7 @@ def build(bld):
source = geany_sources,
includes = ['.', 'scintilla/include/', 'tagmanager/include/'],
defines = ['G_LOG_DOMAIN="Geany"', 'GEANY_PRIVATE'],
uselib = ['GTK', 'GIO', 'WIN32', 'SUNOS_SOCKET'],
uselib = ['GTK', 'GIO', 'GTHREAD', 'WIN32', 'SUNOS_SOCKET'],
use = ['scintilla', 'tagmanager', 'mio'])
# geanyfunctions.h