configure.ac: require GLib 2.32 (if enabled)

Since version 2.32, g_thread_init() is deprecated and a no-op.  Let's
upgrade that (optional) dependency so we can remove all those
g_thread_init() calls.
This commit is contained in:
Max Kellermann 2014-12-04 23:58:48 +01:00
parent d435dcdca4
commit 5cbc319e96
13 changed files with 1 additions and 130 deletions

View File

@ -522,7 +522,7 @@ AC_ARG_ENABLE(glib,
enable_glib=auto)
if test x$enable_glib != xno; then
PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.28 gthread-2.0],
PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.32],
[found_glib=yes],
[found_glib=no])

View File

@ -437,11 +437,6 @@ int mpd_main(int argc, char *argv[])
#ifdef HAVE_GLIB
g_set_application_name("Music Player Daemon");
#if !GLIB_CHECK_VERSION(2,32,0)
/* enable GLib's thread safety code */
g_thread_init(nullptr);
#endif
#endif
#endif

View File

@ -33,10 +33,6 @@
#include "event/Loop.hxx"
#include "util/Error.hxx"
#ifdef HAVE_GLIB
#include <glib.h>
#endif
#include <iostream>
using std::cout;
using std::cerr;
@ -107,14 +103,6 @@ main(int argc, char **argv)
return EXIT_FAILURE;
}
/* initialize GLib */
#ifdef HAVE_GLIB
#if !GLIB_CHECK_VERSION(2,32,0)
g_thread_init(nullptr);
#endif
#endif
/* initialize MPD */
config_global_init();

View File

@ -35,10 +35,6 @@
#include "thread/Cond.hxx"
#include "Log.hxx"
#ifdef HAVE_GLIB
#include <glib.h>
#endif
#include <unistd.h>
#include <stdlib.h>
@ -64,14 +60,6 @@ int main(int argc, char **argv)
const Path config_path = Path::FromFS(argv[1]);
uri = argv[2];
/* initialize GLib */
#ifdef HAVE_GLIB
#if !GLIB_CHECK_VERSION(2,32,0)
g_thread_init(NULL);
#endif
#endif
/* initialize MPD */
config_global_init();

View File

@ -32,10 +32,6 @@
#include "archive/ArchiveList.hxx"
#endif
#ifdef HAVE_GLIB
#include <glib.h>
#endif
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
@ -79,14 +75,6 @@ int main(int argc, char **argv)
return EXIT_FAILURE;
}
/* initialize GLib */
#ifdef HAVE_GLIB
#if !GLIB_CHECK_VERSION(2,32,0)
g_thread_init(NULL);
#endif
#endif
/* initialize MPD */
config_global_init();

View File

@ -28,10 +28,6 @@
#include "util/Error.hxx"
#include "Log.hxx"
#ifdef HAVE_GLIB
#include <glib.h>
#endif
#include <assert.h>
#include <string.h>
#include <unistd.h>
@ -52,12 +48,6 @@ int main(int argc, gcc_unused char **argv)
return EXIT_FAILURE;
}
#ifdef HAVE_GLIB
#if !GLIB_CHECK_VERSION(2,32,0)
g_thread_init(NULL);
#endif
#endif
EventLoop event_loop;
Error error;

View File

@ -32,10 +32,6 @@
#include "thread/Cond.hxx"
#include "Log.hxx"
#ifdef HAVE_GLIB
#include <glib.h>
#endif
#include <assert.h>
#include <unistd.h>
#include <stdlib.h>
@ -90,12 +86,6 @@ int main(int argc, char **argv)
decoder_name = argv[1];
const Path path = Path::FromFS(argv[2]);
#ifdef HAVE_GLIB
#if !GLIB_CHECK_VERSION(2,32,0)
g_thread_init(NULL);
#endif
#endif
const ScopeIOThread io_thread;
Error error;

View File

@ -30,10 +30,6 @@
#include "Log.hxx"
#include "stdbin.h"
#ifdef HAVE_GLIB
#include <glib.h>
#endif
#include <assert.h>
#include <unistd.h>
#include <stdlib.h>
@ -50,12 +46,6 @@ int main(int argc, char **argv)
const char *const decoder_name = argv[1];
const char *const uri = argv[2];
#ifdef HAVE_GLIB
#if !GLIB_CHECK_VERSION(2,32,0)
g_thread_init(NULL);
#endif
#endif
const ScopeIOThread io_thread;
Error error;

View File

@ -33,10 +33,6 @@
#include "system/FatalError.hxx"
#include "Log.hxx"
#ifdef HAVE_GLIB
#include <glib.h>
#endif
#include <assert.h>
#include <string.h>
#include <stdlib.h>
@ -86,14 +82,6 @@ int main(int argc, char **argv)
AudioFormat audio_format(44100, SampleFormat::S16, 2);
/* initialize GLib */
#ifdef HAVE_GLIB
#if !GLIB_CHECK_VERSION(2,32,0)
g_thread_init(NULL);
#endif
#endif
/* read configuration file (mpd.conf) */
config_global_init();

View File

@ -35,10 +35,6 @@
#include "archive/ArchiveList.hxx"
#endif
#ifdef HAVE_GLIB
#include <glib.h>
#endif
#include <unistd.h>
#include <stdlib.h>
@ -105,14 +101,6 @@ int main(int argc, char **argv)
return EXIT_FAILURE;
}
/* initialize GLib */
#ifdef HAVE_GLIB
#if !GLIB_CHECK_VERSION(2,32,0)
g_thread_init(NULL);
#endif
#endif
/* initialize MPD */
config_global_init();

View File

@ -36,10 +36,6 @@
#include "util/Error.hxx"
#include "Log.hxx"
#ifdef HAVE_GLIB
#include <glib.h>
#endif
#include <assert.h>
#include <string.h>
#include <unistd.h>
@ -163,12 +159,6 @@ int main(int argc, char **argv)
AudioFormat audio_format(44100, SampleFormat::S16, 2);
#ifdef HAVE_GLIB
#if !GLIB_CHECK_VERSION(2,32,0)
g_thread_init(NULL);
#endif
#endif
/* read configuration file (mpd.conf) */
config_global_init();

View File

@ -24,10 +24,6 @@
#include "storage/FileInfo.hxx"
#include "util/Error.hxx"
#ifdef HAVE_GLIB
#include <glib.h>
#endif
#include <memory>
#include <unistd.h>
@ -102,14 +98,6 @@ main(int argc, char **argv)
return EXIT_FAILURE;
}
/* initialize GLib */
#ifdef HAVE_GLIB
#if !GLIB_CHECK_VERSION(2,32,0)
g_thread_init(NULL);
#endif
#endif
const char *const command = argv[1];
const char *const storage_uri = argv[2];

View File

@ -30,10 +30,6 @@
#include "fs/Path.hxx"
#include "util/Error.hxx"
#ifdef HAVE_GLIB
#include <glib.h>
#endif
#include <unistd.h>
#include <stdlib.h>
@ -57,14 +53,6 @@ main(int argc, char **argv)
const char *plugin_name = argv[1];
const Path path = Path::FromFS(argv[2]);
/* initialize GLib */
#ifdef HAVE_GLIB
#if !GLIB_CHECK_VERSION(2,32,0)
g_thread_init(NULL);
#endif
#endif
/* initialize MPD */
config_global_init();