Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge branch 'jb51115_dbus_glib_submodule' into 'master'
Add dbus-glib submodule.

See merge request mer-core/dsme!45
  • Loading branch information
spiiroin committed Dec 4, 2020
2 parents 4d01894 + 6e76cc4 commit 07afe95
Show file tree
Hide file tree
Showing 9 changed files with 59 additions and 29 deletions.
2 changes: 2 additions & 0 deletions .depend
Expand Up @@ -272,6 +272,7 @@ modules/diskmonitor.pic.o:\

modules/dsme_dbus.o:\
modules/dsme_dbus.c\
dbus-gmain/dbus-gmain.h\
dsme/dsme-server.h\
include/dsme/logging.h\
include/dsme/modulebase.h\
Expand All @@ -282,6 +283,7 @@ modules/dsme_dbus.o:\

modules/dsme_dbus.pic.o:\
modules/dsme_dbus.c\
dbus-gmain/dbus-gmain.h\
dsme/dsme-server.h\
include/dsme/logging.h\
include/dsme/modulebase.h\
Expand Down
4 changes: 4 additions & 0 deletions .gitmodules
@@ -0,0 +1,4 @@
[submodule "dbus-gmain"]
path = dbus-gmain
url = https://github.com/sailfishos-mirror/dbus-glib.git
branch = dbus-gmain
25 changes: 23 additions & 2 deletions Makefile.custom
Expand Up @@ -239,7 +239,6 @@ LDLIBS += -ldl

PKG_NAMES += glib-2.0
PKG_NAMES += dbus-1
PKG_NAMES += dbus-glib-1
PKG_NAMES += dsme
PKG_NAMES += dsme_dbus_if
PKG_NAMES += thermalmanager_dbus_if
Expand Down Expand Up @@ -267,6 +266,21 @@ CPPFLAGS += $(PKG_CPPFLAGS)
CFLAGS += $(PKG_CFLAGS)
LDLIBS += $(PKG_LDLIBS)

# ----------------------------------------------------------------------------
# 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/%.o : CPPFLAGS += $(DBUS_GMAIN_CPPFLAGS)
dbus-gmain/%.o : CFLAGS += $(DBUS_GMAIN_CFLAGS)

# ----------------------------------------------------------------------------
# dsme-wdd
# ----------------------------------------------------------------------------
Expand Down Expand Up @@ -308,7 +322,10 @@ modules/alarmtracker.so : modules/alarmtracker.pic.o
modules/batterytracker.so : modules/batterytracker.pic.o
modules/bootreasonlogger.so : modules/bootreasonlogger.pic.o
modules/dbusautoconnector.so : modules/dbusautoconnector.pic.o
modules/dbusproxy.so : modules/dbusproxy.pic.o modules/dsme_dbus.pic.o
modules/dbusproxy.so : \
modules/dbusproxy.pic.o \
modules/dsme_dbus.pic.o \
dbus-gmain/dbus-gmain.pic.o
modules/diskmonitor.so : modules/diskmonitor.pic.o
modules/emergencycalltracker.so : modules/emergencycalltracker.pic.o
modules/heartbeat.so : modules/heartbeat.pic.o
Expand Down Expand Up @@ -449,6 +466,10 @@ DIRTY_HEADERS += test/utils_misc.h
BROKEN_SOURCES += util/kicker.c
BROKEN_SOURCES += util/kick_wd.c

# No need to process these
BROKEN_SOURCES += dbus-gmain/dbus-gmain.c
BROKEN_HEADERS += dbus-gmain/dbus-gmain.h

# ----------------------------------------------------------------------------
# Source code normalization
# ----------------------------------------------------------------------------
Expand Down
1 change: 1 addition & 0 deletions dbus-gmain
Submodule dbus-gmain added at d42176
9 changes: 3 additions & 6 deletions modules/Makefile.am
Expand Up @@ -127,13 +127,11 @@ emergencycalltracker_la_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)

usbtracker_la_SOURCES = usbtracker.c
usbtracker_la_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
usbtracker_la_LIBADD = $(GLIB_LIBS) $(DBUS_LIBS) \
$(top_srcdir)/dbus-gmain/libdbus-gmain.la
usbtracker_la_LIBADD = $(GLIB_LIBS) $(DBUS_LIBS)

iphb_la_SOURCES = iphb.c
iphb_la_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS) $(MCE_DEV_CFLAGS)
iphb_la_LIBADD = $(GLIB_LIBS) $(DBUS_LIBS) \
$(top_srcdir)/dbus-gmain/libdbus-gmain.la
iphb_la_LIBADD = $(GLIB_LIBS) $(DBUS_LIBS)

thermalflagger_la_SOURCES = thermalflagger.c

Expand Down Expand Up @@ -183,8 +181,7 @@ endif
if WANT_VIBRA_FEEDBACK
shutdownfeedback_la_SOURCES = shutdownfeedback.c vibrafeedback.c vibrafeedback.h
shutdownfeedback_la_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS) $(LIBNGF_CFLAGS)
shutdownfeedback_la_LIBADD = $(GLIB_LIBS) $(LIBNGF_LIBS) \
$(top_srcdir)/dbus-gmain/libdbus-gmain.la
shutdownfeedback_la_LIBADD = $(GLIB_LIBS) $(LIBNGF_LIBS)
endif

if WANT_WLAN_LOADER
Expand Down
13 changes: 8 additions & 5 deletions modules/dsme_dbus.c
Expand Up @@ -3,8 +3,9 @@
D-Bus C binding for DSME
<p>
Copyright (C) 2008-2010 Nokia Corporation.
Copyright (C) 2013-2017 Jolla Ltd.
Copyright (c) 2008 - 2010 Nokia Corporation.
Copyright (c) 2013 - 2020 Jolla Ltd.
Copyright (c) 2020 Open Mobile Platform LLC.
@author Semi Malinen <semi.malinen@nokia.com>
@author Tapio Rantala <ext-tapio.rantala@nokia.com>
Expand All @@ -14,6 +15,8 @@
@author Kalle Jokiniemi <kalle.jokiniemi@jolla.com>
@author Slava Monich <slava.monich@jolla.com>
@author marko lemmetty <marko.lemmetty@jollamobile.com>
@author Bogdan Migunov <bogdanmigunov@yandex.ru>
@author Björn Bidar <bjorn.bidar@jolla.com>
This file is part of Dsme.
Expand All @@ -39,13 +42,13 @@
#include "../dsme/dsme-server.h"
#include <dsme/state.h>

#include <dbus/dbus.h>
#include <dbus-gmain/dbus-gmain.h>

#include <stdlib.h>
#include <string.h>
#include <stdio.h>

/* dbus_gmain_set_up_connection() from dbus-gmain submodule */
#include "../dbus-gmain/dbus-gmain.h"

#define DBUS_FAILED_FILE "/run/systemd/boot-status/dbus-failed"

/* HACK: make sure also unused code gets a compilation attempt */
Expand Down
12 changes: 6 additions & 6 deletions modules/iphb.c
Expand Up @@ -6,15 +6,19 @@
IP heartbeat service dsme plug-in
<p>
Copyright (C) 2010 Nokia. All rights reserved.
Copyright (C) 2013-2019 Jolla Ltd.
Copyright (c) 2010 Nokia. All rights reserved.
Copyright (c) 2013 - 2020 Jolla Ltd.
Copyright (c) 2020 Open Mobile Platform LLC.
@author Raimo Vuonnala <raimo.vuonnala@nokia.com>
@author Semi Malinen <semi.malinen@nokia.com>
@author Matias Muhonen <ext-matias.muhonen@nokia.com>
@author Antti Virtanen <antti.i.virtanen@nokia.com>
@author Simo Piiroinen <simo.piiroinen@jollamobile.com>
@author Petri M. Gerdt <petri.gerdt@jollamobile.com>
@author Bogdan Migunov <bogdanmigunov@yandex.ru>
@author slapin <slapinid@gmail.com>
@author Björn Bidar <bjorn.bidar@jolla.com>
This file is part of Dsme.
Expand Down Expand Up @@ -61,8 +65,6 @@
#include <sys/ioctl.h>
#include <linux/rtc.h>
#include <limits.h>
#include <dbus/dbus.h>
#include <dbus-gmain/dbus-gmain.h>
#include <mce/dbus-names.h>

#include "../include/android/android_alarm.h"
Expand Down Expand Up @@ -3016,8 +3018,6 @@ static void systembus_connect(void)
goto cleanup;
}

dbus_gmain_set_up_connection(systembus, 0);

xmce_handle_dbus_connect();

cleanup:
Expand Down
13 changes: 7 additions & 6 deletions modules/usbtracker.c
Expand Up @@ -6,15 +6,18 @@
so that we will not allow reboot/shutdown while the device is
mounted to a host PC over USB.
<p>
Copyright (C) 2010 Nokia Corporation.
Copyright (C) 2013-2017 Jolla Ltd
Copyright (c) 2010 Nokia Corporation.
Copyright (c) 2013 - 2020 Jolla Ltd.
Copyright (c) 2020 Open Mobile Platform LLC.
@author Semi Malinen <semi.malinen@nokia.com>
@author Matias Muhonen <ext-matias.muhonen@nokia.com>
@author Philippe De Swert <philippe.deswert@jollamobile.com>
@author Simo Piiroinen <simo.piiroinen@jollamobile.com>
@author Pekka Lundstrom <pekka.lundstrom@jollamobile.com>
@author Marko Saukko <marko.saukko@jollamobile.com>
@author Bogdan Migunov <bogdanmigunov@yandex.ru>
@author Björn Bidar <bjorn.bidar@jolla.com>
This file is part of Dsme.
Expand Down Expand Up @@ -48,8 +51,8 @@
#include <dsme/state.h>

#include <string.h>
#include <dbus/dbus.h>
#include <dbus-gmain/dbus-gmain.h>

#include <glib.h>

/** Prefix string used for logging from this module */
#define PFIX "usbtracker: "
Expand Down Expand Up @@ -672,8 +675,6 @@ systembus_connect(void)
goto cleanup;
}

dbus_gmain_set_up_connection(systembus, 0);

xusbmoded_init_tracking();

cleanup:
Expand Down
9 changes: 5 additions & 4 deletions modules/vibrafeedback.c
Expand Up @@ -4,9 +4,13 @@
Play vibra using ngfd
<p>
Copyright (C) 2014 Jolla Oy.
Copyright (c) 2014 - 2020 Jolla Ltd.
Copyright (c) 2020 Open Mobile Platform LLC.
@author Pekka Lundstrom <pekka.lundstrom@jolla.com>
@author Juho Hämäläinen <juho.hamalainen@tieto.com>
@author Simo Piiroinen <simo.piiroinen@jolla.com>
@author Björn Bidar <bjorn.bidar@jolla.com>
This file is part of Dsme.
Expand Down Expand Up @@ -37,8 +41,6 @@
#include <stdlib.h>

#include <glib.h>
#include <dbus/dbus.h>
#include <dbus-gmain/dbus-gmain.h>

#include "vibrafeedback.h"

Expand Down Expand Up @@ -148,7 +150,6 @@ void dsme_ini_vibrafeedback(void) {
err.name, err.message);
goto cleanup;
}
dbus_gmain_set_up_connection(dbus_connection, NULL);
cleanup:
dbus_error_free(&err);
}
Expand Down

0 comments on commit 07afe95

Please sign in to comment.