diff --git a/.depend b/.depend index 48f91143..c834fab9 100644 --- a/.depend +++ b/.depend @@ -178,6 +178,7 @@ mce-dbus.o:\ mce-dbus.c\ builtin-gconf.h\ datapipe.h\ + dbus-gmain/dbus-gmain.h\ mce-dbus.h\ mce-lib.h\ mce-log.h\ @@ -189,6 +190,7 @@ mce-dbus.pic.o:\ mce-dbus.c\ builtin-gconf.h\ datapipe.h\ + dbus-gmain/dbus-gmain.h\ mce-dbus.h\ mce-lib.h\ mce-log.h\ @@ -1347,11 +1349,13 @@ tklock.pic.o:\ tools/dummy_compositor.o:\ tools/dummy_compositor.c\ builtin-gconf.h\ + dbus-gmain/dbus-gmain.h\ mce-dbus.h\ tools/dummy_compositor.pic.o:\ tools/dummy_compositor.c\ builtin-gconf.h\ + dbus-gmain/dbus-gmain.h\ mce-dbus.h\ tools/evdev_trace.o:\ diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 00000000..a6ff4703 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "dbus-gmain"] + path = dbus-gmain + url = https://gitlab.freedesktop.org/dbus/dbus-glib.git diff --git a/Makefile b/Makefile index befd09fe..5d07b68d 100644 --- a/Makefile +++ b/Makefile @@ -138,11 +138,12 @@ HELPERSCRIPTDIR := $(_DATADIR)/mce TESTSDESTDIR := $(_TESTSDIR)/mce # Source directories -DOCDIR := doc -TOOLDIR := tools -TESTSDIR := tests -UTESTDIR := tests/ut -MODULE_DIR := modules +DOCDIR := doc +TOOLDIR := tools +TESTSDIR := tests +UTESTDIR := tests/ut +MODULE_DIR := modules +DBUS_GMAIN_DIR := dbus-gmain # Binaries to build TARGETS += mce @@ -281,7 +282,6 @@ MCE_PKG_NAMES += glib-2.0 MCE_PKG_NAMES += gio-2.0 MCE_PKG_NAMES += gmodule-2.0 MCE_PKG_NAMES += dbus-1 -MCE_PKG_NAMES += dbus-glib-1 MCE_PKG_NAMES += dsme MCE_PKG_NAMES += libiphb MCE_PKG_NAMES += libsystemd @@ -332,6 +332,8 @@ ifeq ($(strip $(ENABLE_WAKELOCKS)),y) MCE_CORE += libwakelock.c endif +MCE_CORE += $(DBUS_GMAIN_DIR)/dbus-gmain.c + mce : CFLAGS += $(MCE_CFLAGS) mce : LDLIBS += $(MCE_LDLIBS) ifeq ($(ENABLE_HYBRIS),y) @@ -342,6 +344,22 @@ mce : mce.o $(patsubst %.c,%.o,$(MCE_CORE)) CFLAGS += -g LDFLAGS += -g +# ---------------------------------------------------------------------------- +# DBUS_GMAIN +# ---------------------------------------------------------------------------- + +# The dbus-gmain submodule contains sources that have +# issues and do not compile cleanly. As the content is +# what it is, silence warnings etc when compiling source +# files from there... + +DBUS_GMAIN_CPPFLAGS += -I. +DBUS_GMAIN_CFLAGS += -Wno-unused-parameter +DBUS_GMAIN_CFLAGS += -Wno-cast-function-type + +$(DBUS_GMAIN_DIR)/%.o : CPPFLAGS += $(DBUS_GMAIN_CPPFLAGS) +$(DBUS_GMAIN_DIR)/%.o : CFLAGS += $(DBUS_GMAIN_CFLAGS) + # ---------------------------------------------------------------------------- # MODULES # ---------------------------------------------------------------------------- @@ -350,7 +368,6 @@ MODULE_PKG_NAMES += gobject-2.0 MODULE_PKG_NAMES += glib-2.0 MODULE_PKG_NAMES += gmodule-2.0 MODULE_PKG_NAMES += dbus-1 -MODULE_PKG_NAMES += dbus-glib-1 MODULE_PKG_NAMES += usb_moded MODULE_PKG_NAMES += libudev @@ -377,7 +394,6 @@ $(MODULE_DIR)/%.so : $(MODULE_DIR)/%.pic.o TOOLS_PKG_NAMES += gobject-2.0 TOOLS_PKG_NAMES += glib-2.0 TOOLS_PKG_NAMES += dbus-1 -TOOLS_PKG_NAMES += dbus-glib-1 TOOLS_PKG_CFLAGS := $(shell $(PKG_CONFIG) --cflags $(TOOLS_PKG_NAMES)) TOOLS_PKG_LDLIBS := $(shell $(PKG_CONFIG) --libs $(TOOLS_PKG_NAMES)) @@ -395,7 +411,7 @@ $(TOOLDIR)/evdev_trace : $(TOOLDIR)/evdev_trace.o evdev.o $(TOOLDIR)/fileusers.o $(TOOLDIR)/dummy_compositor : CFLAGS += $(TOOLS_CFLAGS) $(TOOLDIR)/dummy_compositor : LDLIBS += $(TOOLS_LDLIBS) -$(TOOLDIR)/dummy_compositor : $(TOOLDIR)/dummy_compositor.o +$(TOOLDIR)/dummy_compositor : $(TOOLDIR)/dummy_compositor.o $(DBUS_GMAIN_DIR)/dbus-gmain.o # ---------------------------------------------------------------------------- # UNIT TESTS @@ -403,7 +419,6 @@ $(TOOLDIR)/dummy_compositor : $(TOOLDIR)/dummy_compositor.o UTESTS_PKG_NAMES += check UTESTS_PKG_NAMES += dbus-1 -UTESTS_PKG_NAMES += dbus-glib-1 UTESTS_PKG_NAMES += glib-2.0 UTESTS_PKG_NAMES += gthread-2.0 @@ -427,6 +442,7 @@ $(UTESTDIR)/ut_display : LINK_STUBS += mce_write_string_to_file $(UTESTDIR)/ut_display : datapipe.o $(UTESTDIR)/ut_display : mce-lib.o $(UTESTDIR)/ut_display : modetransition.o +$(UTESTDIR)/ut_display : $(DBUS_GMAIN_DIR)/dbus-gmain.o # ---------------------------------------------------------------------------- # ACTIONS FOR TOP LEVEL TARGETS @@ -538,10 +554,13 @@ fixme:: # AUTOMATIC HEADER DEPENDENCIES # ---------------------------------------------------------------------------- +# All sources, except ones from gmain git submodule +DEPEND_SOURCES = $(filter-out $(DBUS_GMAIN_DIR)/%.c, $(wildcard *.c */*.c */*/*.c)) + .PHONY: depend depend:: @echo "Updating .depend" - $(CC) -MM $(CPPFLAGS) $(MCE_CFLAGS) *.c */*.c */*/*.c |\ + $(CC) -MM $(CPPFLAGS) $(MCE_CFLAGS) $(DEPEND_SOURCES) \ ./depend_filter.py > .depend ifneq ($(MAKECMDGOALS),depend) # not while: make depend diff --git a/dbus-gmain b/dbus-gmain new file mode 160000 index 00000000..d42176ae --- /dev/null +++ b/dbus-gmain @@ -0,0 +1 @@ +Subproject commit d42176ae4763e5288ef37ea314fe58387faf2005 diff --git a/mce-dbus.c b/mce-dbus.c index c841cf72..5b17daa4 100644 --- a/mce-dbus.c +++ b/mce-dbus.c @@ -42,7 +42,7 @@ #include #include -#include +#include "dbus-gmain/dbus-gmain.h" #include #include @@ -5238,7 +5238,7 @@ gboolean mce_dbus_init(const gboolean systembus) mce_log(LL_DEBUG, "Connecting D-Bus to the mainloop"); /* Connect D-Bus to the mainloop */ - dbus_connection_setup_with_g_main(dbus_connection, NULL); + dbus_gmain_set_up_connection(dbus_connection, NULL); mce_log(LL_DEBUG, "Acquiring D-Bus service"); diff --git a/rpm/mce.spec b/rpm/mce.spec index 57b470d3..61a4045a 100644 --- a/rpm/mce.spec +++ b/rpm/mce.spec @@ -15,7 +15,6 @@ Requires(postun): systemd Conflicts: mce-plugin-libhybris < 1.3.0 Conflicts: lipstick-qt5 < 0.24.7 BuildRequires: pkgconfig(dbus-1) >= 1.0.2 -BuildRequires: pkgconfig(dbus-glib-1) BuildRequires: pkgconfig(dsme) >= 0.65.0 BuildRequires: pkgconfig(thermalmanager_dbus_if) BuildRequires: pkgconfig(libiphb) diff --git a/tests/ut/ut_display.c b/tests/ut/ut_display.c index 608e49c3..216b3d82 100644 --- a/tests/ut/ut_display.c +++ b/tests/ut/ut_display.c @@ -1,5 +1,5 @@ #include -#include /* dbus_connection_setup_with_g_main */ +#include /* dbus_gmain_set_up_connection */ #include #include #include diff --git a/tools/dummy_compositor.c b/tools/dummy_compositor.c index 38506dd0..69162d12 100644 --- a/tools/dummy_compositor.c +++ b/tools/dummy_compositor.c @@ -32,7 +32,7 @@ #include #include -#include +#include "../dbus-gmain/dbus-gmain.h" /* ========================================================================= * * Constants @@ -622,7 +622,7 @@ dc_dbus_connect(void) dbus_connection_set_exit_on_disconnect(dc_dbus_con, false); - dbus_connection_setup_with_g_main(dc_dbus_con, 0); + dbus_gmain_set_up_connection(dc_dbus_con, 0); EXIT: dbus_error_free(&err);