Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge branch 'omp-jb51115' into 'master'
Use dbus-gmain instead of dbus-glib

See merge request mer-core/profiled!7
  • Loading branch information
spiiroin committed Dec 4, 2020
2 parents 1374a34 + c1c65b5 commit 0d4721c
Show file tree
Hide file tree
Showing 49 changed files with 100 additions and 145 deletions.
20 changes: 15 additions & 5 deletions .depend
Expand Up @@ -62,9 +62,6 @@ mainloop.o: mainloop.c \
server.h \
sighnd.h

profile-tracker.o: profile-tracker.c \
profile_dbus.h

profileclient.o: profileclient.c \
libprofile-internal.h \
libprofile.h \
Expand All @@ -77,6 +74,10 @@ profiled.o: profiled.c \
mainloop.h \
profiled_config.h

profile-tracker.o: profile-tracker.c \
profile_dbus.h \
dbus-gmain/dbus-gmain.h

profileval.o: profileval.c \
profiled_config.h \
profileval.h \
Expand All @@ -90,7 +91,8 @@ server.o: server.c \
profile_dbus.h \
profiled_config.h \
profileval.h \
server.h
server.h \
dbus-gmain/dbus-gmain.h

sighnd.o: sighnd.c \
logging.h \
Expand All @@ -109,7 +111,8 @@ tracker.o: tracker.c \
logging.h \
profile_dbus.h \
profiled_config.h \
profileval.h
profileval.h \
dbus-gmain/dbus-gmain.h

unique.o: unique.c \
profiled_config.h \
Expand All @@ -120,3 +123,10 @@ xutil.o: xutil.c \
profiled_config.h \
xutil.h

callbacks_without_mainloop.o: examples/callbacks_without_mainloop.c

delayed_session_bus.o: examples/delayed_session_bus.c \
examples/../dbus-gmain/dbus-gmain.h

multiple_callbacks.o: examples/multiple_callbacks.c

3 changes: 3 additions & 0 deletions .gitmodules
@@ -0,0 +1,3 @@
[submodule "dbus-gmain"]
path = dbus-gmain
url = https://github.com/sailfishos-mirror/dbus-glib
29 changes: 29 additions & 0 deletions LICENSE
@@ -0,0 +1,29 @@
Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
Copyright (C) 2020 Jolla.
All rights reserved.


Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer. Redistributions in
binary form must reproduce the above copyright notice, this list of
conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.

Neither the name of Nokia Corporation nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
48 changes: 37 additions & 11 deletions Makefile
@@ -1,4 +1,4 @@
# -*- mode: sh -*-
# -*- mode: makefile -*-
# ----------------------------------------------------------------------------
# Configuration options
# ----------------------------------------------------------------------------
Expand Down Expand Up @@ -33,6 +33,7 @@ CUD_DIR ?= /etc/osso-cud-scripts
RFS_DIR ?= /etc/osso-rfs-scripts

DOXYDIR := doxydir
DBUS_GMAIN_DIR := dbus-gmain

SO ?= .so.0

Expand Down Expand Up @@ -73,7 +74,7 @@ LDLIBS += -Wl,--as-needed

# flags from pkgtool

PKG_NAMES := dbus-glib-1 dbus-1 glib-2.0
PKG_NAMES := dbus-1 glib-2.0
PKG_CFLAGS := $(shell pkg-config --cflags $(PKG_NAMES))
PKG_LDLIBS := $(shell pkg-config --libs $(PKG_NAMES))

Expand Down Expand Up @@ -107,6 +108,23 @@ CPPFLAGS += -D LOGGING_CHECK1ST# level check before args eval
# Top Level Targets
# ----------------------------------------------------------------------------

# ----------------------------------------------------------------------------
# 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_CFLAGS += -Wno-missing-field-initializers

$(DBUS_GMAIN_DIR)/%.o : CPPFLAGS += $(DBUS_GMAIN_CPPFLAGS)
$(DBUS_GMAIN_DIR)/%.o : CFLAGS += $(DBUS_GMAIN_CFLAGS)

TARGETS += libprofile.a
TARGETS += libprofile$(SO)
TARGETS += profiled
Expand Down Expand Up @@ -259,8 +277,8 @@ profiled_src = \
xutil.c\
profileval.c

profiled_obj = $(profiled_src:.c=.o)

profiled_obj = $(profiled_src:.c=.o)
profiled_obj += $(DBUS_GMAIN_DIR)/dbus-gmain.o
profiled : $(profiled_obj)
profiled.cflow : $(profiled_src)

Expand All @@ -276,7 +294,8 @@ libprofile_src =\
profileval.c\
logging_client.c

libprofile_obj = $(libprofile_src:.c=.o)
libprofile_obj = $(libprofile_src:.c=.o)
libprofile_obj += $(DBUS_GMAIN_DIR)/dbus-gmain.o

libprofile$(SO) : $(libprofile_obj:.o=.pic.o)

Expand All @@ -286,9 +305,9 @@ libprofile.a : $(libprofile_obj)
# profileclient
# ----------------------------------------------------------------------------

profileclient_src = profileclient.c
profileclient_obj = $(profileclient_src:.c=.o)

profileclient_src = profileclient.c
profileclient_obj = $(profileclient_src:.c=.o)
profileclient_obj +=$(DBUS_GMAIN_DIR)/dbus-gmain.o
#profileclient : CFLAGS += -Wno-missing-prototypes
profileclient : $(profileclient_obj) libprofile$(SO)

Expand All @@ -304,14 +323,14 @@ profileclient.o: CFLAGS += -Wno-deprecated-declarations
profiletracker_src = profile-tracker.c logging.c
profiletracker_obj = $(profiletracker_src:.c=.o)

profile-tracker : $(profiletracker_obj) libprofile$(SO)
profile-tracker : $(profiletracker_obj) libprofile$(SO) $(DBUS_GMAIN_DIR)/dbus-gmain.o
profile-tracker.cflow : $(profiletracker_src) $(libprofile_src)

# ----------------------------------------------------------------------------
# camera-example1
# ----------------------------------------------------------------------------

camera-example1 : camera-example1.o libprofile$(SO)
camera-example1 : camera-example1.o libprofile$(SO) $(DBUS_GMAIN_DIR)/dbus-gmain.o

# ----------------------------------------------------------------------------
# profiled.deb
Expand Down Expand Up @@ -400,10 +419,13 @@ install-libprofile-doc:: $(addprefix install-libprofile-doc-, html man)
# Dependency Scanning
# ----------------------------------------------------------------------------

# All sources, except ones from gmain git submodule
DEPEND_SOURCES = $(filter-out $(DBUS_GMAIN_DIR)/%.c, $(wildcard *.c */*.c */*/*.c))

.PHONY: depend

depend::
gcc -MM $(CPPFLAGS) *.c | ./depend_filter.py > .depend
gcc -MM $(CPPFLAGS) $(DEPEND_SOURCES) | ./depend_filter.py > .depend

ifneq ($(MAKECMDGOALS),depend)
include .depend
Expand Down Expand Up @@ -452,3 +474,7 @@ normalize:
crlf -t -e -k debian/changelog
crlf -M examples/Makefile
crlf -a examples/*.[ch]

# Local Variables:
# indent-tabs-mode: t
# End:
2 changes: 0 additions & 2 deletions codec.c
Expand Up @@ -5,8 +5,6 @@
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
**
** Contact: Sakari Poussa <sakari.poussa@nokia.com>
**
** Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are met:
**
Expand Down
2 changes: 0 additions & 2 deletions codec.h
Expand Up @@ -5,8 +5,6 @@
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
**
** Contact: Sakari Poussa <sakari.poussa@nokia.com>
**
** Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are met:
**
Expand Down
2 changes: 0 additions & 2 deletions confmon.c
Expand Up @@ -5,8 +5,6 @@
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
**
** Contact: Sakari Poussa <sakari.poussa@nokia.com>
**
** Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are met:
**
Expand Down
2 changes: 0 additions & 2 deletions confmon.h
Expand Up @@ -5,8 +5,6 @@
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
**
** Contact: Sakari Poussa <sakari.poussa@nokia.com>
**
** Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are met:
**
Expand Down
2 changes: 0 additions & 2 deletions connection.c
Expand Up @@ -5,8 +5,6 @@
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
**
** Contact: Sakari Poussa <sakari.poussa@nokia.com>
**
** Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are met:
**
Expand Down
2 changes: 0 additions & 2 deletions database.c
Expand Up @@ -5,8 +5,6 @@
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
**
** Contact: Sakari Poussa <sakari.poussa@nokia.com>
**
** Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are met:
**
Expand Down
2 changes: 0 additions & 2 deletions database.h
Expand Up @@ -5,8 +5,6 @@
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
**
** Contact: Sakari Poussa <sakari.poussa@nokia.com>
**
** Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are met:
**
Expand Down
1 change: 1 addition & 0 deletions dbus-gmain
Submodule dbus-gmain added at d42176
32 changes: 0 additions & 32 deletions debian/copyright

This file was deleted.

1 change: 1 addition & 0 deletions debian/copyright
2 changes: 0 additions & 2 deletions depend_filter.py
Expand Up @@ -6,8 +6,6 @@
# Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
# All rights reserved.
#
# Contact: Sakari Poussa <sakari.poussa@nokia.com>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
Expand Down
2 changes: 0 additions & 2 deletions doxymaindoc.h
Expand Up @@ -5,8 +5,6 @@
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
**
** Contact: Sakari Poussa <sakari.poussa@nokia.com>
**
** Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are met:
**
Expand Down
2 changes: 0 additions & 2 deletions examples/callbacks_without_mainloop.c
Expand Up @@ -5,8 +5,6 @@
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
**
** Contact: Sakari Poussa <sakari.poussa@nokia.com>
**
** Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are met:
**
Expand Down
7 changes: 3 additions & 4 deletions examples/delayed_session_bus.c
Expand Up @@ -3,10 +3,9 @@
** This file is part of profile-qt
**
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** Copyright (C) 2020 Jolla Ltd.
** All rights reserved.
**
** Contact: Sakari Poussa <sakari.poussa@nokia.com>
**
** Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are met:
**
Expand Down Expand Up @@ -38,7 +37,7 @@
#include <time.h>
#include <string.h>
#include <stdlib.h>
#include <dbus/dbus-glib-lowlevel.h>
#include "../dbus-gmain/dbus-gmain.h"
#include <profiled/libprofile.h>

static char *ex_busaddr = NULL;
Expand Down Expand Up @@ -69,7 +68,7 @@ ex_init(void)
goto cleanup;
}

dbus_connection_setup_with_g_main(ex_connection, NULL);
dbus_gmain_set_up_connection(ex_connection, NULL);
dbus_connection_set_exit_on_disconnect(ex_connection, 0);

res = 0;
Expand Down
2 changes: 0 additions & 2 deletions examples/multiple_callbacks.c
Expand Up @@ -5,8 +5,6 @@
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
**
** Contact: Sakari Poussa <sakari.poussa@nokia.com>
**
** Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are met:
**
Expand Down
2 changes: 0 additions & 2 deletions flow.py
Expand Up @@ -6,8 +6,6 @@
# Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
# All rights reserved.
#
# Contact: Sakari Poussa <sakari.poussa@nokia.com>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
Expand Down
2 changes: 0 additions & 2 deletions inifile.c
Expand Up @@ -5,8 +5,6 @@
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
**
** Contact: Sakari Poussa <sakari.poussa@nokia.com>
**
** Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are met:
**
Expand Down

0 comments on commit 0d4721c

Please sign in to comment.