diff --git a/ChangeLog b/ChangeLog index 36a83d43..2973b030 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2011-03-27 Enrico Tröger + + * 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 * plugins/splitwindow.c: diff --git a/configure.ac b/configure.ac index 8d7643a5..d6e89c2c 100644 --- a/configure.ac +++ b/configure.ac @@ -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. ], diff --git a/src/Makefile.am b/src/Makefile.am index 6614bad5..4878f422 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -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)"\" \ diff --git a/src/main.c b/src/main.c index bd22ffa6..ba507e0b 100644 --- a/src/main.c +++ b/src/main.c @@ -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 */ diff --git a/src/makefile.win32 b/src/makefile.win32 index dd396f25..1e358a5f 100644 --- a/src/makefile.win32 +++ b/src/makefile.win32 @@ -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" \ diff --git a/wscript b/wscript index e064467c..8102de08 100644 --- a/wscript +++ b/wscript @@ -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