nfctype2: Initial implementation
authorSamuel Ortiz <sameo@linux.intel.com>
Fri, 29 Apr 2011 19:19:04 +0000 (21:19 +0200)
committerMarcel Holtmann <marcel@holtmann.org>
Fri, 21 Oct 2011 06:54:02 +0000 (23:54 -0700)
Makefile.am
Makefile.plugins [new file with mode: 0644]
bootstrap-configure
configure.ac
plugins/nfctype2.c [new file with mode: 0644]

index 70e1e2c..af9980e 100644 (file)
@@ -16,6 +16,10 @@ local_headers = $(foreach file,$(include_HEADERS) $(nodist_include_HEADERS) \
 gdbus_sources = gdbus/gdbus.h gdbus/mainloop.c gdbus/watch.c \
                                        gdbus/object.c gdbus/polkit.c
 
+plugin_LTLIBRARIES =
+
+plugin_objects =
+
 builtin_modules =
 builtin_sources =
 builtin_cflags =
@@ -35,13 +39,21 @@ src_neard_LDFLAGS = -Wl,--export-dynamic
 nodist_src_neard_SOURCES = src/builtin.h
 
 AM_CFLAGS = @GLIB_CFLAGS@ @DBUS_CFLAGS@ @NETLINK_CFLAGS@ $(builtin_cflags) \
-                                       -DNEARD_PLUGIN_BUILTIN \
+                                       -DNEAR_PLUGIN_BUILTIN \
                                        -DPLUGINDIR=\""$(plugindir)"\"
 
 INCLUDES = -I$(builddir)/include -I$(builddir)/src -I$(srcdir)/gdbus
 
 CLEANFILES = src/builtin.h $(local_headers)
 
+plugindir = $(libdir)/near/plugins
+
+if MAINTAINER_MODE
+build_plugindir = $(abs_top_srcdir)/plugins/.libs
+else
+build_plugindir = $(plugindir)
+endif
+
 doc_files = doc/manager-api.txt doc/target-api.txt doc/adapter-api.txt
 
 EXTRA_DIST = src/genbuiltin $(doc_files)
@@ -53,6 +65,8 @@ testdir = $(pkglibdir)/test
 test_SCRIPTS = $(test_scripts)
 endif
 
+include Makefile.plugins
+
 EXTRA_DIST += $(test_scripts)
 
 MAINTAINERCLEANFILES = Makefile.in \
diff --git a/Makefile.plugins b/Makefile.plugins
new file mode 100644 (file)
index 0000000..f511b54
--- /dev/null
@@ -0,0 +1,16 @@
+
+plugin_cflags = -fvisibility=hidden -I$(srcdir)/gdbus \
+                                       @DBUS_CFLAGS@ @GLIB_CFLAGS@
+plugin_ldflags = -no-undefined -module -avoid-version
+
+if NFCTYPE2
+if NFCTYPE2_BUILTIN
+builtin_modules += nfctype2
+builtin_sources += plugins/nfctype2.c
+else
+plugin_LTLIBRARIES += plugins/nfctype2.la
+plugin_objects += $(plugins_nfctype2_la_OBJECTS)
+plugins_nfctype2_la_CFLAGS = $(plugin_cflags)
+plugins_nfctype2_la_LDFLAGS = $(plugin_ldflags)
+endif
+endif
\ No newline at end of file
index 7d35d71..0339672 100755 (executable)
@@ -7,4 +7,5 @@ fi
 ./bootstrap && \
     ./configure --enable-maintainer-mode \
                --enable-debug \
+               --enable-nfctype2=builtin \
                --prefix=/usr $*
index 518b878..74d845a 100644 (file)
@@ -82,4 +82,10 @@ AC_ARG_ENABLE(test, AC_HELP_STRING([--enable-test],
                [enable test/example scripts]), [enable_test=${enableval}])
 AM_CONDITIONAL(TEST, test "${enable_test}" = "yes")
 
+AC_ARG_ENABLE(nfctype2,
+       AC_HELP_STRING([--enable-nfctype2], [enable NFC forum type 2 tags support]),
+                       [enable_nfctype2=${enableval}], [enable_nfctype2="no"])
+AM_CONDITIONAL(NFCTYPE2, test "${enable_nfctype2}" != "no")
+AM_CONDITIONAL(NFCTYPE2_BUILTIN, test "${enable_nfctype2}" = "builtin")
+
 AC_OUTPUT(Makefile include/version.h)
diff --git a/plugins/nfctype2.c b/plugins/nfctype2.c
new file mode 100644 (file)
index 0000000..2a49a39
--- /dev/null
@@ -0,0 +1,43 @@
+/*
+ *
+ *  neard - Near Field Communication manager
+ *
+ *  Copyright (C) 2011  Intel Corporation. All rights reserved.
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License version 2 as
+ *  published by the Free Software Foundation.
+ *
+ *  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 <near/plugin.h>
+#include <near/log.h>
+
+static int nfctype2_init(void)
+{
+       DBG("");
+
+       return 0;
+}
+
+static void nfctype2_exit(void)
+{
+       DBG("");
+}
+
+NEAR_PLUGIN_DEFINE(nfctype2, "NFC Forum Type 2 tags support", VERSION,
+                       NEAR_PLUGIN_PRIORITY_HIGH, nfctype2_init, nfctype2_exit)
+