summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2014-01-05 18:02:56 +0200
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2016-01-28 14:04:14 +0200
commit20928920cb0c14d9b05862a712eabbf4ba58ae01 (patch)
treec9ca9cde9117e54077ff44aa9e5d763ccae6b22e
parentee8c910888bc582ed844d5b2ed9a5c8707070476 (diff)
downloadbluez-20928920cb0c14d9b05862a712eabbf4ba58ae01.tar.gz
plugins: Add initial code for service plugin
This plugin will be used to control services individually.
-rw-r--r--Makefile.plugins8
-rwxr-xr-xbootstrap-configure1
-rw-r--r--configure.ac4
-rw-r--r--plugins/service.c44
4 files changed, 57 insertions, 0 deletions
diff --git a/Makefile.plugins b/Makefile.plugins
index f85b64293..8a4b47747 100644
--- a/Makefile.plugins
+++ b/Makefile.plugins
@@ -123,3 +123,11 @@ plugins_sixaxis_la_LDFLAGS = $(AM_LDFLAGS) -module -avoid-version \
-no-undefined @UDEV_LIBS@
plugins_sixaxis_la_CFLAGS = $(AM_CFLAGS) -fvisibility=hidden @UDEV_CFLAGS@
endif
+
+if SERVICE
+plugin_LTLIBRARIES += plugins/service.la
+plugins_service_la_SOURCES = plugins/service.c
+plugins_service_la_LDFLAGS = $(AM_LDFLAGS) -module -avoid-version \
+ -no-undefined
+plugins_service_la_CFLAGS = $(AM_CFLAGS) -fvisibility=hidden
+endif
diff --git a/bootstrap-configure b/bootstrap-configure
index 87766b117..1e8d50855 100755
--- a/bootstrap-configure
+++ b/bootstrap-configure
@@ -16,4 +16,5 @@ fi
--enable-experimental \
--enable-android \
--enable-sixaxis \
+ --enable-service \
--disable-datafiles $*
diff --git a/configure.ac b/configure.ac
index 7ec7c322f..143a8da69 100644
--- a/configure.ac
+++ b/configure.ac
@@ -252,6 +252,10 @@ AC_ARG_ENABLE(sixaxis, AC_HELP_STRING([--enable-sixaxis],
AM_CONDITIONAL(SIXAXIS, test "${enable_sixaxis}" = "yes" &&
test "${enable_udev}" != "no")
+AC_ARG_ENABLE(service, AC_HELP_STRING([--enable-service],
+ [enable service plugin]), [enable_service=${enableval}])
+AM_CONDITIONAL(SERVICE, test "${enable_service}" = "yes")
+
if (test "${prefix}" = "NONE"); then
dnl no prefix and no localstatedir, so default to /var
if (test "$localstatedir" = '${prefix}/var'); then
diff --git a/plugins/service.c b/plugins/service.c
new file mode 100644
index 000000000..e63d8a829
--- /dev/null
+++ b/plugins/service.c
@@ -0,0 +1,44 @@
+/*
+ *
+ * BlueZ - Bluetooth protocol stack for Linux
+ *
+ * Copyright (C) 2014 Intel Corporation.
+ *
+ *
+ * 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 St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "src/plugin.h"
+#include "src/log.h"
+
+static int service_init(void)
+{
+ DBG("");
+
+ return 0;
+}
+
+static void service_exit(void)
+{
+ DBG("");
+}
+
+BLUETOOTH_PLUGIN_DEFINE(service, VERSION, BLUETOOTH_PLUGIN_PRIORITY_DEFAULT,
+ service_init, service_exit)