]> git.sesse.net Git - vlc/commitdiff
Remove recursion into modules/control/dbus/ and clean up D-Bus rules
authorRémi Denis-Courmont <remi@remlab.net>
Sun, 9 Sep 2012 10:55:47 +0000 (13:55 +0300)
committerRémi Denis-Courmont <remi@remlab.net>
Sun, 9 Sep 2012 11:32:43 +0000 (14:32 +0300)
modules/control/dbus/dbus.h is removed as it conflicted with the global
libdbus header and was included only once.

bin/Makefile.am
configure.ac
modules/control/Modules.am
modules/control/dbus/Modules.am [deleted file]
modules/control/dbus/dbus.c
modules/control/dbus/dbus.h [deleted file]
modules/gui/qt4/components/simple_preferences.cpp
modules/misc/Modules.am
src/Makefile.am

index c96e81be2f37ec11105de3d41df469d11cf1ac28..c1a954894a5b82aaff1de2e628bab172c4faed16 100644 (file)
@@ -11,7 +11,9 @@ SUFFIXES = .rc.in .rc
 
 AM_CPPFLAGS = $(CPPFLAGS_vlc)
 AM_CFLAGS = $(CFLAGS_vlc)
-
+if HAVE_DBUS
+AM_CPPFLAGS += -DHAVE_DBUS
+endif
 
 if !HAVE_WIN32
 bin_PROGRAMS += vlc-wrapper
index e2e356fbcba1e713188afc6606b0b3d309c90ebd..5f72ebaec7f67076c9103cc96bbf53368f39c437 100644 (file)
@@ -619,7 +619,7 @@ AC_CHECK_FUNC(getopt_long,, [
 AC_SUBST(GNUGETOPT_LIBS)
 
 AC_CHECK_LIB(m,cos,[
-  VLC_ADD_LIBS([adjust wave ripple psychedelic gradient a52tofloat32 dtstofloat32 x264 goom panoramix rotate noise grain scene kate flac lua chorus_flanger freetype avcodec avformat access_avio swscale postproc i420_rgb faad twolame equalizer spatializer param_eq samplerate freetype mpc dmo mp4 quicktime qt4 compressor headphone_channel_mixer normvol audiobargraph_a speex opus mono colorthres extract ball access_imem hotkeys mosaic gaussianblur dbus x26410b hqdn3d anaglyph oldrc ncurses],[-lm])
+  VLC_ADD_LIBS([adjust wave ripple psychedelic gradient a52tofloat32 dtstofloat32 x264 goom panoramix rotate noise grain scene kate flac lua chorus_flanger freetype avcodec avformat access_avio swscale postproc i420_rgb faad twolame equalizer spatializer param_eq samplerate freetype mpc dmo mp4 quicktime qt4 compressor headphone_channel_mixer normvol audiobargraph_a speex opus mono colorthres extract ball access_imem hotkeys mosaic gaussianblur x26410b hqdn3d anaglyph oldrc ncurses],[-lm])
   LIBM="-lm"
 ], [
   LIBM=""
@@ -771,35 +771,19 @@ dnl Check for dbus
 AC_ARG_ENABLE(dbus,
   [AS_HELP_STRING([--enable-dbus],
     [compile D-Bus message bus support (default enabled)])])
-case "${SYS}" in
-    linux*|*bsd*)
-if test "${enable_dbus}" != "no" -a "${SYS}" != "mingw32"
-then
-  dnl api stable dbus
-  PKG_CHECK_MODULES(DBUS, [dbus-1 >= 1.0.0],
-    [ AC_DEFINE( HAVE_DBUS, 1, [Define if you have the D-BUS library] )
-      VLC_ADD_LIBS([libvlccore],[$DBUS_LIBS])
-      VLC_ADD_CFLAGS([libvlccore],[$DBUS_CFLAGS])
-      dnl Check for dbus control interface
-        AC_ARG_ENABLE(dbus-control,
-          [AS_HELP_STRING([--disable-dbus-control],
-            [D-Bus control interface (default enabled)])])
-        if test "${enable_dbus_control}" != "no"
-        then
-          VLC_ADD_PLUGIN([dbus])
-          VLC_ADD_LIBS([dbus],[$DBUS_LIBS])
-          VLC_ADD_CFLAGS([dbus],[$DBUS_CFLAGS])
-        fi
-        dnl Power Management Inhibiter
-        VLC_ADD_PLUGIN([inhibit])
-        VLC_ADD_LIBS([inhibit],[$DBUS_LIBS])
-        VLC_ADD_CFLAGS([inhibit],[$DBUS_CFLAGS])
-    ],
-    [AC_MSG_ERROR([${DBUS_PKG_ERRORS}.])]
-  )
-fi
-;;
-esac
+have_dbus="no"
+AS_IF([test "${enable_dbus}" != "no"], [
+  PKG_CHECK_MODULES(DBUS, [dbus-1 >= 1.0.0], [
+    have_dbus="yes"
+  ], [
+    AS_IF([test -n "${enable_dbus}"], [
+      AC_MSG_ERROR([${DBUS_PKG_ERRORS}.])
+    ], [
+      AC_MSG_WARN([${DBUS_PKG_ERRORS}.])
+    ])
+  ])
+])
+AM_CONDITIONAL([HAVE_DBUS], [test "${have_dbus}" = "yes"])
 
 dnl Check for ntohl, etc.
 VLC_SAVE_FLAGS
@@ -4090,7 +4074,6 @@ AC_CONFIG_FILES([
   modules/codec/spudec/Makefile
   modules/codec/wmafixed/Makefile
   modules/control/Makefile
-  modules/control/dbus/Makefile
   modules/demux/Makefile
   modules/demux/asf/Makefile
   modules/demux/avformat/Makefile
index faab544d083607a06d69ec77b294406cf623c380..96fc60ad7a234d9c5821810b88a2e6a6483c60d1 100644 (file)
@@ -1,4 +1,3 @@
-SUBDIRS = dbus
 SOURCES_dummy = dummy.c
 SOURCES_gestures = gestures.c
 SOURCES_netsync = netsync.c
@@ -22,6 +21,19 @@ libvlc_LTLIBRARIES += \
        libnetsync_plugin.la \
        libhotkeys_plugin.la \
        liboldrc_plugin.la
+
+libdbus_plugin_la_SOURCES = \
+       dbus/dbus_introspect.h dbus/dbus_common.h \
+       dbus/dbus_root.c dbus/dbus_root.h \
+       dbus/dbus_player.c dbus/dbus/player.h \
+       dbus/dbus_tracklist.c dbus/dbus/tracklist.h \
+       dbus/dbus.c
+libdbus_plugin_la_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
+libdbus_plugin_la_LIBADD = $(AM_LIBADD) $(DBUS_LIBS) $(LIBM)
+if HAVE_DBUS
+libvlc_LTLIBRARIES += libdbus_plugin.la
+endif
+
 if !HAVE_WIN32
 libglobalhotkeys_plugin_la_SOURCES = globalhotkeys/xcb.c
 libglobalhotkeys_plugin_la_CFLAGS = $(AM_CFLAGS) $(XCB_KEYSYMS_CFLAGS) $(XCB_CFLAGS)
diff --git a/modules/control/dbus/Modules.am b/modules/control/dbus/Modules.am
deleted file mode 100644 (file)
index 28a415f..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-SOURCES_dbus = \
-    dbus.c \
-    dbus.h \
-    dbus_introspect.h \
-    dbus_common.h \
-    dbus_root.h \
-    dbus_root.c \
-    dbus_player.h \
-    dbus_player.c \
-    dbus_tracklist.h \
-    dbus_tracklist.c \
-    $(NULL)
index 84581a631a508bdb90cf40af54eb4fa08faf6748..71cf7d03edcf208362170680975a09eb9582f2d1 100644 (file)
@@ -45,7 +45,6 @@
 #endif
 
 #include <dbus/dbus.h>
-#include "dbus.h"
 #include "dbus_common.h"
 #include "dbus_root.h"
 #include "dbus_player.h"
 #include <errno.h>
 #include <unistd.h>
 
+#define DBUS_MPRIS_BUS_NAME "org.mpris.MediaPlayer2.vlc"
+#define DBUS_INSTANCE_ID_PREFIX "instance"
+
+#define SEEK_THRESHOLD 1000 /* µsec */
+
 /*****************************************************************************
  * Local prototypes.
  *****************************************************************************/
 
+static DBusHandlerResult
+MPRISEntryPoint ( DBusConnection *p_conn, DBusMessage *p_from, void *p_this );
+
+static const DBusObjectPathVTable dbus_mpris_vtable = {
+        NULL, MPRISEntryPoint, /* handler function */
+        NULL, NULL, NULL, NULL
+};
+
 typedef struct
 {
     int signal;
diff --git a/modules/control/dbus/dbus.h b/modules/control/dbus/dbus.h
deleted file mode 100644 (file)
index cdafe5c..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-/*****************************************************************************
- * dbus.h : D-Bus control interface
- *****************************************************************************
- * Copyright © 2006-2008 Rafaël Carré
- * Copyright © 2007-2012 Mirsal Ennaime
- * Copyright © 2009-2012 The VideoLAN team
- * $Id$
- *
- * Authors:    Rafaël Carré <funman at videolanorg>
- *             Mirsal Ennaime <mirsal at mirsal fr>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- *****************************************************************************/
-
-#ifndef _VLC_DBUS_H
-#define _VLC_DBUS_H
-
-#define DBUS_MPRIS_BUS_NAME "org.mpris.MediaPlayer2.vlc"
-#define DBUS_INSTANCE_ID_PREFIX "instance"
-
-static DBusHandlerResult
-MPRISEntryPoint ( DBusConnection *p_conn, DBusMessage *p_from, void *p_this );
-
-static const DBusObjectPathVTable dbus_mpris_vtable = {
-        NULL, MPRISEntryPoint, /* handler function */
-        NULL, NULL, NULL, NULL
-};
-
-#define SEEK_THRESHOLD 1000 /* µsec */
-
-#endif //dbus.h
index e3d36e3d55609d2fde019f45b671dba00fbd625a..c974c416fc88194a58ee6e921abedcd9b9c6061c 100644 (file)
@@ -618,16 +618,20 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
             ui.updatesDays->hide();
 #endif
             /* ONE INSTANCE options */
-#if defined( WIN32 ) || defined( HAVE_DBUS ) || defined(__APPLE__)
-            CONFIG_BOOL( "one-instance", OneInterfaceMode );
-            CONFIG_BOOL( "playlist-enqueue",
-                    EnqueueOneInterfaceMode );
-            ui.EnqueueOneInterfaceMode->setEnabled( ui.OneInterfaceMode->isChecked() );
-            CONNECT( ui.OneInterfaceMode, toggled( bool ),
-                     ui.EnqueueOneInterfaceMode, setEnabled( bool ) );
-#else
-            ui.OneInterfaceBox->hide();
+#if !defined( WIN32 ) && !defined(__APPLE__)
+            if( !module_exists( "dbus" ) )
+                ui.OneInterfaceBox->hide();
+            else
 #endif
+            {
+                CONFIG_BOOL( "one-instance", OneInterfaceMode );
+                CONFIG_BOOL( "playlist-enqueue", EnqueueOneInterfaceMode );
+                ui.EnqueueOneInterfaceMode->setEnabled(
+                                                       ui.OneInterfaceMode->isChecked() );
+                CONNECT( ui.OneInterfaceMode, toggled( bool ),
+                         ui.EnqueueOneInterfaceMode, setEnabled( bool ) );
+            }
+
             /* RECENTLY PLAYED options */
             CONNECT( ui.saveRecentlyPlayed, toggled( bool ),
                      ui.recentlyPlayedFilters, setEnabled( bool ) );
index f74bb39efb8fc7b29cd74cf7399d3fc9ff68a310..63139d27df37ce5a5879a78b3ae87458e9a37061 100644 (file)
@@ -5,7 +5,6 @@ DIST_SUBDIRS = $(BASE_SUBDIRS)
 
 SOURCES_vod_rtsp = rtsp.c
 SOURCES_audioscrobbler = audioscrobbler.c
-SOURCES_inhibit = inhibit.c
 SOURCES_sqlite = sqlite.c
 SOURCES_xml = xml/libxml.c
 
@@ -18,6 +17,13 @@ endif
 EXTRA_LTLIBRARIES += libgnutls_plugin.la
 libvlc_LTLIBRARIES += $(LTLIBgnutls)
 
+libinhibit_plugin_la_SOURCES = inhibit.c
+libinhibit_plugin_la_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
+libinhibit_plugin_la_LIBADD = $(AM_LIBADD) $(DBUS_LIBS)
+if HAVE_DBUS
+libvlc_LTLIBRARIES += libinhibit_plugin.la
+endif
+
 libxdg_screensaver_plugin_la_SOURCES = inhibit/xdg.c
 libxdg_screensaver_plugin_la_CFLAGS = $(AM_CFLAGS)
 libxdg_screensaver_plugin_la_LIBADD = $(AM_LIBADD)
index 9572480f47408d492d390dd90fe128297102be3c..befa6f508da992b8a7aa07cdc66b2f2804e11dfc 100644 (file)
@@ -174,6 +174,10 @@ AM_CFLAGS = $(CFLAGS_libvlccore)
 if HAVE_DYNAMIC_PLUGINS
 AM_CPPFLAGS += -DHAVE_DYNAMIC_PLUGINS
 endif
+if HAVE_DBUS
+AM_CPPFLAGS += -DHAVE_DBUS
+AM_CFLAGS += $(DBUS_CFLAGS)
+endif
 
 libvlccore_la_SOURCES = $(SOURCES_libvlc)
 libvlccore_la_LDFLAGS = \
@@ -191,6 +195,9 @@ if HAVE_WIN32
 libvlccore_la_DEPENDENCIES += libvlc_win32_rc.$(OBJEXT)
 libvlccore_la_LDFLAGS += -Wl,libvlc_win32_rc.$(OBJEXT) -avoid-version
 endif
+if HAVE_DBUS
+libvlccore_la_LIBADD += $(DBUS_LIBS)
+endif
 
 libvlc_win32_rc.$(OBJEXT): libvlc_win32_rc.rc
        $(WINDRES) --include-dir $(top_srcdir)/share --include-dir $(top_srcdir)/extras/package/win32 -i $< -o $@