Commit 5cbc319e authored by Max Kellermann's avatar Max Kellermann

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.
parent d435dcdc
...@@ -522,7 +522,7 @@ AC_ARG_ENABLE(glib, ...@@ -522,7 +522,7 @@ AC_ARG_ENABLE(glib,
enable_glib=auto) enable_glib=auto)
if test x$enable_glib != xno; then 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=yes],
[found_glib=no]) [found_glib=no])
......
...@@ -437,11 +437,6 @@ int mpd_main(int argc, char *argv[]) ...@@ -437,11 +437,6 @@ int mpd_main(int argc, char *argv[])
#ifdef HAVE_GLIB #ifdef HAVE_GLIB
g_set_application_name("Music Player Daemon"); 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
#endif #endif
......
...@@ -33,10 +33,6 @@ ...@@ -33,10 +33,6 @@
#include "event/Loop.hxx" #include "event/Loop.hxx"
#include "util/Error.hxx" #include "util/Error.hxx"
#ifdef HAVE_GLIB
#include <glib.h>
#endif
#include <iostream> #include <iostream>
using std::cout; using std::cout;
using std::cerr; using std::cerr;
...@@ -107,14 +103,6 @@ main(int argc, char **argv) ...@@ -107,14 +103,6 @@ main(int argc, char **argv)
return EXIT_FAILURE; return EXIT_FAILURE;
} }
/* initialize GLib */
#ifdef HAVE_GLIB
#if !GLIB_CHECK_VERSION(2,32,0)
g_thread_init(nullptr);
#endif
#endif
/* initialize MPD */ /* initialize MPD */
config_global_init(); config_global_init();
......
...@@ -35,10 +35,6 @@ ...@@ -35,10 +35,6 @@
#include "thread/Cond.hxx" #include "thread/Cond.hxx"
#include "Log.hxx" #include "Log.hxx"
#ifdef HAVE_GLIB
#include <glib.h>
#endif
#include <unistd.h> #include <unistd.h>
#include <stdlib.h> #include <stdlib.h>
...@@ -64,14 +60,6 @@ int main(int argc, char **argv) ...@@ -64,14 +60,6 @@ int main(int argc, char **argv)
const Path config_path = Path::FromFS(argv[1]); const Path config_path = Path::FromFS(argv[1]);
uri = argv[2]; uri = argv[2];
/* initialize GLib */
#ifdef HAVE_GLIB
#if !GLIB_CHECK_VERSION(2,32,0)
g_thread_init(NULL);
#endif
#endif
/* initialize MPD */ /* initialize MPD */
config_global_init(); config_global_init();
......
...@@ -32,10 +32,6 @@ ...@@ -32,10 +32,6 @@
#include "archive/ArchiveList.hxx" #include "archive/ArchiveList.hxx"
#endif #endif
#ifdef HAVE_GLIB
#include <glib.h>
#endif
#include <unistd.h> #include <unistd.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
...@@ -79,14 +75,6 @@ int main(int argc, char **argv) ...@@ -79,14 +75,6 @@ int main(int argc, char **argv)
return EXIT_FAILURE; return EXIT_FAILURE;
} }
/* initialize GLib */
#ifdef HAVE_GLIB
#if !GLIB_CHECK_VERSION(2,32,0)
g_thread_init(NULL);
#endif
#endif
/* initialize MPD */ /* initialize MPD */
config_global_init(); config_global_init();
......
...@@ -28,10 +28,6 @@ ...@@ -28,10 +28,6 @@
#include "util/Error.hxx" #include "util/Error.hxx"
#include "Log.hxx" #include "Log.hxx"
#ifdef HAVE_GLIB
#include <glib.h>
#endif
#include <assert.h> #include <assert.h>
#include <string.h> #include <string.h>
#include <unistd.h> #include <unistd.h>
...@@ -52,12 +48,6 @@ int main(int argc, gcc_unused char **argv) ...@@ -52,12 +48,6 @@ int main(int argc, gcc_unused char **argv)
return EXIT_FAILURE; return EXIT_FAILURE;
} }
#ifdef HAVE_GLIB
#if !GLIB_CHECK_VERSION(2,32,0)
g_thread_init(NULL);
#endif
#endif
EventLoop event_loop; EventLoop event_loop;
Error error; Error error;
......
...@@ -32,10 +32,6 @@ ...@@ -32,10 +32,6 @@
#include "thread/Cond.hxx" #include "thread/Cond.hxx"
#include "Log.hxx" #include "Log.hxx"
#ifdef HAVE_GLIB
#include <glib.h>
#endif
#include <assert.h> #include <assert.h>
#include <unistd.h> #include <unistd.h>
#include <stdlib.h> #include <stdlib.h>
...@@ -90,12 +86,6 @@ int main(int argc, char **argv) ...@@ -90,12 +86,6 @@ int main(int argc, char **argv)
decoder_name = argv[1]; decoder_name = argv[1];
const Path path = Path::FromFS(argv[2]); 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; const ScopeIOThread io_thread;
Error error; Error error;
......
...@@ -30,10 +30,6 @@ ...@@ -30,10 +30,6 @@
#include "Log.hxx" #include "Log.hxx"
#include "stdbin.h" #include "stdbin.h"
#ifdef HAVE_GLIB
#include <glib.h>
#endif
#include <assert.h> #include <assert.h>
#include <unistd.h> #include <unistd.h>
#include <stdlib.h> #include <stdlib.h>
...@@ -50,12 +46,6 @@ int main(int argc, char **argv) ...@@ -50,12 +46,6 @@ int main(int argc, char **argv)
const char *const decoder_name = argv[1]; const char *const decoder_name = argv[1];
const char *const uri = argv[2]; 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; const ScopeIOThread io_thread;
Error error; Error error;
......
...@@ -33,10 +33,6 @@ ...@@ -33,10 +33,6 @@
#include "system/FatalError.hxx" #include "system/FatalError.hxx"
#include "Log.hxx" #include "Log.hxx"
#ifdef HAVE_GLIB
#include <glib.h>
#endif
#include <assert.h> #include <assert.h>
#include <string.h> #include <string.h>
#include <stdlib.h> #include <stdlib.h>
...@@ -86,14 +82,6 @@ int main(int argc, char **argv) ...@@ -86,14 +82,6 @@ int main(int argc, char **argv)
AudioFormat audio_format(44100, SampleFormat::S16, 2); 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) */ /* read configuration file (mpd.conf) */
config_global_init(); config_global_init();
......
...@@ -35,10 +35,6 @@ ...@@ -35,10 +35,6 @@
#include "archive/ArchiveList.hxx" #include "archive/ArchiveList.hxx"
#endif #endif
#ifdef HAVE_GLIB
#include <glib.h>
#endif
#include <unistd.h> #include <unistd.h>
#include <stdlib.h> #include <stdlib.h>
...@@ -105,14 +101,6 @@ int main(int argc, char **argv) ...@@ -105,14 +101,6 @@ int main(int argc, char **argv)
return EXIT_FAILURE; return EXIT_FAILURE;
} }
/* initialize GLib */
#ifdef HAVE_GLIB
#if !GLIB_CHECK_VERSION(2,32,0)
g_thread_init(NULL);
#endif
#endif
/* initialize MPD */ /* initialize MPD */
config_global_init(); config_global_init();
......
...@@ -36,10 +36,6 @@ ...@@ -36,10 +36,6 @@
#include "util/Error.hxx" #include "util/Error.hxx"
#include "Log.hxx" #include "Log.hxx"
#ifdef HAVE_GLIB
#include <glib.h>
#endif
#include <assert.h> #include <assert.h>
#include <string.h> #include <string.h>
#include <unistd.h> #include <unistd.h>
...@@ -163,12 +159,6 @@ int main(int argc, char **argv) ...@@ -163,12 +159,6 @@ int main(int argc, char **argv)
AudioFormat audio_format(44100, SampleFormat::S16, 2); 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) */ /* read configuration file (mpd.conf) */
config_global_init(); config_global_init();
......
...@@ -24,10 +24,6 @@ ...@@ -24,10 +24,6 @@
#include "storage/FileInfo.hxx" #include "storage/FileInfo.hxx"
#include "util/Error.hxx" #include "util/Error.hxx"
#ifdef HAVE_GLIB
#include <glib.h>
#endif
#include <memory> #include <memory>
#include <unistd.h> #include <unistd.h>
...@@ -102,14 +98,6 @@ main(int argc, char **argv) ...@@ -102,14 +98,6 @@ main(int argc, char **argv)
return EXIT_FAILURE; 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 command = argv[1];
const char *const storage_uri = argv[2]; const char *const storage_uri = argv[2];
......
...@@ -30,10 +30,6 @@ ...@@ -30,10 +30,6 @@
#include "fs/Path.hxx" #include "fs/Path.hxx"
#include "util/Error.hxx" #include "util/Error.hxx"
#ifdef HAVE_GLIB
#include <glib.h>
#endif
#include <unistd.h> #include <unistd.h>
#include <stdlib.h> #include <stdlib.h>
...@@ -57,14 +53,6 @@ main(int argc, char **argv) ...@@ -57,14 +53,6 @@ main(int argc, char **argv)
const char *plugin_name = argv[1]; const char *plugin_name = argv[1];
const Path path = Path::FromFS(argv[2]); 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 */ /* initialize MPD */
config_global_init(); config_global_init();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment