Merge branch '2.0.x' into master

This commit is contained in:
derselbst 2019-03-02 10:23:13 +01:00
commit 0cd44d00e1
6 changed files with 41 additions and 1 deletions

View file

@ -82,6 +82,10 @@ if ( CMAKE_SYSTEM MATCHES "Linux|FreeBSD|DragonFly" )
option ( enable-alsa "compile ALSA support (if it is available)" on ) option ( enable-alsa "compile ALSA support (if it is available)" on )
endif ( CMAKE_SYSTEM MATCHES "Linux|FreeBSD|DragonFly" ) endif ( CMAKE_SYSTEM MATCHES "Linux|FreeBSD|DragonFly" )
if ( CMAKE_SYSTEM MATCHES "Linux" )
option ( enable-systemd "compile systemd support (if it is available)" on )
endif ( CMAKE_SYSTEM MATCHES "Linux" )
if ( CMAKE_SYSTEM MATCHES "Darwin" ) if ( CMAKE_SYSTEM MATCHES "Darwin" )
option ( enable-coreaudio "compile CoreAudio support (if it is available)" on ) option ( enable-coreaudio "compile CoreAudio support (if it is available)" on )
option ( enable-coremidi "compile CoreMIDI support (if it is available)" on ) option ( enable-coremidi "compile CoreMIDI support (if it is available)" on )
@ -529,6 +533,14 @@ else(NOT enable-pkgconfig)
remove_definitions( -DHAVE_LASH ) remove_definitions( -DHAVE_LASH )
endif ( enable-lash ) endif ( enable-lash )
unset ( SYSTEMD_SUPPORT CACHE )
if ( enable-systemd )
pkg_check_modules ( SYSTEMD libsystemd )
set ( SYSTEMD_SUPPORT ${SYSTEMD_FOUND} )
else ( enable-systemd )
unset_pkg_config ( SYSTEMD )
endif ( enable-systemd )
unset ( DBUS_SUPPORT CACHE ) unset ( DBUS_SUPPORT CACHE )
if ( enable-dbus ) if ( enable-dbus )
pkg_check_modules ( DBUS dbus-1>=1.0.0 ) pkg_check_modules ( DBUS dbus-1>=1.0.0 )

View file

@ -110,6 +110,12 @@ else ( LASH_SUPPORT )
message ( "LASH support: no" ) message ( "LASH support: no" )
endif ( LASH_SUPPORT ) endif ( LASH_SUPPORT )
if ( SYSTEMD_SUPPORT )
message ( "systemd support: yes" )
else ( SYSTEMD_SUPPORT )
message ( "systemd support: no" )
endif ( SYSTEMD_SUPPORT )
if ( DART_SUPPORT ) if ( DART_SUPPORT )
message ( "OS/2 DART support: yes" ) message ( "OS/2 DART support: yes" )
else ( DART_SUPPORT ) else ( DART_SUPPORT )

View file

@ -4,6 +4,8 @@ Documentation=man:fluidsynth(1)
After=sound.target After=sound.target
[Service] [Service]
Type=notify
NotifyAccess=main
EnvironmentFile=@FLUID_DAEMON_ENV_FILE@ EnvironmentFile=@FLUID_DAEMON_ENV_FILE@
EnvironmentFile=-%h/.config/fluidsynth EnvironmentFile=-%h/.config/fluidsynth
ExecStart=@CMAKE_INSTALL_PREFIX@/@BIN_INSTALL_DIR@/fluidsynth -is $OTHER_OPTS $SOUND_FONT ExecStart=@CMAKE_INSTALL_PREFIX@/@BIN_INSTALL_DIR@/fluidsynth -is $OTHER_OPTS $SOUND_FONT

View file

@ -104,6 +104,10 @@ if ( LASH_SUPPORT )
include_directories ( ${LASH_INCLUDE_DIRS}) include_directories ( ${LASH_INCLUDE_DIRS})
endif ( LASH_SUPPORT ) endif ( LASH_SUPPORT )
if ( SYSTEMD_SUPPORT )
include_directories ( ${SYSTEMD_INCLUDE_DIRS})
endif ( SYSTEMD_SUPPORT )
if ( DART_SUPPORT ) if ( DART_SUPPORT )
set ( fluid_dart_SOURCES drivers/fluid_dart.c ) set ( fluid_dart_SOURCES drivers/fluid_dart.c )
include_directories ( ${DART_INCLUDE_DIRS} ) include_directories ( ${DART_INCLUDE_DIRS} )
@ -353,6 +357,7 @@ endif ( FLUID_CPPFLAGS )
target_link_libraries ( fluidsynth target_link_libraries ( fluidsynth
libfluidsynth libfluidsynth
${SYSTEMD_LIBRARIES}
${FLUID_LIBS} ${FLUID_LIBS}
) )

View file

@ -49,6 +49,9 @@
/* whether or not we are supporting lash */ /* whether or not we are supporting lash */
#cmakedefine HAVE_LASH @HAVE_LASH@ #cmakedefine HAVE_LASH @HAVE_LASH@
/* Define if systemd support is enabled */
#cmakedefine SYSTEMD_SUPPORT @SYSTEMD_SUPPORT@
/* Define to 1 if you have the `MidiShare' library (-lMidiShare). */ /* Define to 1 if you have the `MidiShare' library (-lMidiShare). */
#cmakedefine HAVE_LIBMIDISHARE @HAVE_LIBMIDISHARE@ #cmakedefine HAVE_LIBMIDISHARE @HAVE_LIBMIDISHARE@

View file

@ -31,6 +31,9 @@
#include "fluid_lash.h" #include "fluid_lash.h"
#ifdef SYSTEMD_SUPPORT
#include <systemd/sd-daemon.h>
#endif
void print_usage(void); void print_usage(void);
void print_help(fluid_settings_t *settings); void print_help(fluid_settings_t *settings);
@ -892,6 +895,12 @@ int main(int argc, char **argv)
fprintf(stderr, "Failed to create the server.\n" fprintf(stderr, "Failed to create the server.\n"
"Continuing without it.\n"); "Continuing without it.\n");
} }
#ifdef SYSTEMD_SUPPORT
else
{
sd_notify(0, "READY=1");
}
#endif
} }
#endif #endif
@ -954,10 +963,13 @@ cleanup:
fluid_server_join(server); fluid_server_join(server);
} }
#ifdef SYSTEMD_SUPPORT
sd_notify(0, "STOPPING=1");
#endif
delete_fluid_server(server); delete_fluid_server(server);
} }
#endif #endif /* NETWORK_SUPPORT */
if(cmd_handler != NULL) if(cmd_handler != NULL)
{ {