Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
d5dfe7d4
Commit
d5dfe7d4
authored
Dec 15, 2013
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
configure.ac: add option "--disable-glib"
Allows building without GLib. This fails to compile currently, because GLib is still used in the MPD core.
parent
0db0b4e3
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
70 additions
and
15 deletions
+70
-15
Makefile.am
Makefile.am
+12
-8
configure.ac
configure.ac
+15
-4
LogBackend.cxx
src/LogBackend.cxx
+14
-0
LogInit.cxx
src/LogInit.cxx
+6
-1
Main.cxx
src/Main.cxx
+7
-1
SignalMonitor.cxx
src/event/SignalMonitor.cxx
+1
-0
FatalError.cxx
src/system/FatalError.cxx
+5
-1
FatalError.hxx
src/system/FatalError.hxx
+2
-0
run_decoder.cxx
test/run_decoder.cxx
+4
-0
run_input.cxx
test/run_input.cxx
+4
-0
No files found.
Makefile.am
View file @
d5dfe7d4
...
...
@@ -990,14 +990,6 @@ libplaylist_plugins_a_SOURCES = \
src/playlist/ExtM3uPlaylistPlugin.hxx
\
src/playlist/M3uPlaylistPlugin.cxx
\
src/playlist/M3uPlaylistPlugin.hxx
\
src/playlist/PlsPlaylistPlugin.cxx
\
src/playlist/PlsPlaylistPlugin.hxx
\
src/playlist/XspfPlaylistPlugin.cxx
\
src/playlist/XspfPlaylistPlugin.hxx
\
src/playlist/AsxPlaylistPlugin.cxx
\
src/playlist/AsxPlaylistPlugin.hxx
\
src/playlist/RssPlaylistPlugin.cxx
\
src/playlist/RssPlaylistPlugin.hxx
\
src/playlist/CuePlaylistPlugin.cxx
\
src/playlist/CuePlaylistPlugin.hxx
\
src/playlist/EmbeddedCuePlaylistPlugin.cxx
\
...
...
@@ -1024,6 +1016,18 @@ libplaylist_plugins_a_SOURCES += \
PLAYLIST_LIBS
+=
$(YAJL_LIBS)
endif
if
HAVE_GLIB
libplaylist_plugins_a_SOURCES
+=
\
src/playlist/PlsPlaylistPlugin.cxx
\
src/playlist/PlsPlaylistPlugin.hxx
\
src/playlist/XspfPlaylistPlugin.cxx
\
src/playlist/XspfPlaylistPlugin.hxx
\
src/playlist/AsxPlaylistPlugin.cxx
\
src/playlist/AsxPlaylistPlugin.hxx
\
src/playlist/RssPlaylistPlugin.cxx
\
src/playlist/RssPlaylistPlugin.hxx
endif
#
# Filter plugins
#
...
...
configure.ac
View file @
d5dfe7d4
...
...
@@ -547,13 +547,24 @@ AC_ARG_WITH(tremor-includes,
dnl ---------------------------------------------------------------------------
dnl Mandatory Libraries
dnl ---------------------------------------------------------------------------
PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.28 gthread-2.0],,
AC_ARG_ENABLE(glib,
AS_HELP_STRING([--enable-glib],
[enable GLib usage (default: enabled)]),,
enable_glib=yes)
if test x$enable_glib = xyes; then
PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.28 gthread-2.0],,
[AC_MSG_ERROR([GLib 2.28 is required])])
if test x$GCC = xyes; then
# suppress warnings in the GLib headers
GLIB_CFLAGS=`echo $GLIB_CFLAGS |sed -e 's,-I/,-isystem /,g'`
if test x$GCC = xyes; then
# suppress warnings in the GLib headers
GLIB_CFLAGS=`echo $GLIB_CFLAGS |sed -e 's,-I/,-isystem /,g'`
fi
AC_DEFINE(HAVE_GLIB, 1, [Define if GLib is used])
fi
AM_CONDITIONAL(HAVE_GLIB, test x$enable_glib = xyes)
dnl ---------------------------------------------------------------------------
dnl Protocol Options
...
...
src/LogBackend.cxx
View file @
d5dfe7d4
...
...
@@ -23,18 +23,24 @@
#include "util/Domain.hxx"
#include "util/CharUtil.hxx"
#ifdef HAVE_GLIB
#include <glib.h>
#endif
#include <assert.h>
#include <stdio.h>
#include <string.h>
#include <time.h>
#ifdef HAVE_SYSLOG
#include <syslog.h>
#endif
static
LogLevel
log_threshold
=
LogLevel
::
INFO
;
#ifdef HAVE_GLIB
static
const
char
*
log_charset
;
#endif
static
bool
enable_timestamp
;
...
...
@@ -48,12 +54,16 @@ SetLogThreshold(LogLevel _threshold)
log_threshold
=
_threshold
;
}
#ifdef HAVE_GLIB
void
SetLogCharset
(
const
char
*
_charset
)
{
log_charset
=
_charset
;
}
#endif
void
EnableLogTimestamp
()
{
...
...
@@ -142,6 +152,7 @@ LogFinishSysLog()
static
void
FileLog
(
const
Domain
&
domain
,
const
char
*
message
)
{
#ifdef HAVE_GLIB
char
*
converted
;
if
(
log_charset
!=
nullptr
)
{
...
...
@@ -153,13 +164,16 @@ FileLog(const Domain &domain, const char *message)
message
=
converted
;
}
else
converted
=
nullptr
;
#endif
fprintf
(
stderr
,
"%s%s: %.*s
\n
"
,
enable_timestamp
?
log_date
()
:
""
,
domain
.
GetName
(),
chomp_length
(
message
),
message
);
#ifdef HAVE_GLIB
g_free
(
converted
);
#endif
}
void
...
...
src/LogInit.cxx
View file @
d5dfe7d4
...
...
@@ -31,13 +31,16 @@
#include "util/Domain.hxx"
#include "system/FatalError.hxx"
#ifdef HAVE_GLIB
#include <glib.h>
#endif
#include <assert.h>
#include <string.h>
#include <fcntl.h>
#include <stdio.h>
#include <time.h>
#include <unistd.h>
#include <glib.h>
#define LOG_LEVEL_SECURE LogLevel::INFO
...
...
@@ -110,9 +113,11 @@ log_init(bool verbose, bool use_stdout, Error &error)
{
const
struct
config_param
*
param
;
#ifdef HAVE_GLIB
const
char
*
charset
;
g_get_charset
(
&
charset
);
SetLogCharset
(
charset
);
#endif
if
(
verbose
)
SetLogThreshold
(
LogLevel
::
DEBUG
);
...
...
src/Main.cxx
View file @
d5dfe7d4
...
...
@@ -79,7 +79,9 @@
#include "ArchiveList.hxx"
#endif
#ifdef HAVE_GLIB
#include <glib.h>
#endif
#include <stdlib.h>
...
...
@@ -92,6 +94,8 @@
#include <ws2tcpip.h>
#endif
#include <limits.h>
static
constexpr
unsigned
DEFAULT_BUFFER_SIZE
=
4096
;
static
constexpr
unsigned
DEFAULT_BUFFER_BEFORE_PLAY
=
10
;
...
...
@@ -359,12 +363,14 @@ int mpd_main(int argc, char *argv[])
setlocale
(
LC_CTYPE
,
""
);
#endif
#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
winsock_init
();
io_thread_init
();
...
...
@@ -473,7 +479,7 @@ int mpd_main(int argc, char *argv[])
}
if
(
!
glue_state_file_init
(
error
))
{
g_printerr
(
"%s
\n
"
,
error
.
GetMessage
()
);
LogError
(
error
);
return
EXIT_FAILURE
;
}
...
...
src/event/SignalMonitor.cxx
View file @
d5dfe7d4
...
...
@@ -40,6 +40,7 @@
#include <algorithm>
#include <assert.h>
#include <signal.h>
class
SignalMonitor
final
:
private
SocketMonitor
{
#ifdef USE_SIGNALFD
...
...
src/system/FatalError.cxx
View file @
d5dfe7d4
...
...
@@ -23,7 +23,7 @@
#include "util/Domain.hxx"
#include "LogV.hxx"
#ifdef
WIN32
#ifdef
HAVE_GLIB
#include <glib.h>
#endif
...
...
@@ -78,12 +78,16 @@ FatalError(const char *msg, const Error &error)
FormatFatalError
(
"%s: %s"
,
msg
,
error
.
GetMessage
());
}
#ifdef HAVE_GLIB
void
FatalError
(
const
char
*
msg
,
GError
*
error
)
{
FormatFatalError
(
"%s: %s"
,
msg
,
error
->
message
);
}
#endif
void
FatalSystemError
(
const
char
*
msg
)
{
...
...
src/system/FatalError.hxx
View file @
d5dfe7d4
...
...
@@ -45,9 +45,11 @@ gcc_noreturn
void
FatalError
(
const
char
*
msg
,
const
Error
&
error
);
#ifdef HAVE_GLIB
gcc_noreturn
void
FatalError
(
const
char
*
msg
,
GError
*
error
);
#endif
/**
* Call this after a system call has failed that is not supposed to
...
...
test/run_decoder.cxx
View file @
d5dfe7d4
...
...
@@ -29,7 +29,9 @@
#include "Log.hxx"
#include "stdbin.h"
#ifdef HAVE_GLIB
#include <glib.h>
#endif
#include <assert.h>
#include <unistd.h>
...
...
@@ -192,9 +194,11 @@ int main(int argc, char **argv)
decoder_name
=
argv
[
1
];
decoder
.
uri
=
argv
[
2
];
#ifdef HAVE_GLIB
#if !GLIB_CHECK_VERSION(2,32,0)
g_thread_init
(
NULL
);
#endif
#endif
g_log_set_default_handler
(
my_log_func
,
NULL
);
...
...
test/run_input.cxx
View file @
d5dfe7d4
...
...
@@ -33,7 +33,9 @@
#include "ArchiveList.hxx"
#endif
#ifdef HAVE_GLIB
#include <glib.h>
#endif
#include <unistd.h>
#include <stdlib.h>
...
...
@@ -120,9 +122,11 @@ int main(int argc, char **argv)
/* initialize GLib */
#ifdef HAVE_GLIB
#if !GLIB_CHECK_VERSION(2,32,0)
g_thread_init
(
NULL
);
#endif
#endif
g_log_set_default_handler
(
my_log_func
,
NULL
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment