summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@aleksander.es>2019-11-17 14:38:57 +0100
committerAleksander Morgado <aleksander@aleksander.es>2019-11-27 14:34:26 +0100
commitf5d973233d3553cfa20333cbc09982c465ebebce (patch)
treef7301fab87a4a679145da60efd7299edf89efe21
parent23edb526a905801a7e635118fb14e7186fea3fa5 (diff)
telit: setup as loadable 'shared' utils
(cherry picked from commit 1d1f597b5534d01d2df61a1543ed549ac9a3621b)
-rw-r--r--plugins/Makefile.am184
-rw-r--r--plugins/telit/mm-shared.c20
2 files changed, 114 insertions, 90 deletions
diff --git a/plugins/Makefile.am b/plugins/Makefile.am
index 4b58cee7..aaef7443 100644
--- a/plugins/Makefile.am
+++ b/plugins/Makefile.am
@@ -278,6 +278,99 @@ libmm_shared_xmm_la_LIBADD = \
XMM_COMMON_COMPILER_FLAGS = -I$(top_srcdir)/plugins/xmm
################################################################################
+# common telit support
+################################################################################
+
+TELIT_ENUMS_INPUTS = \
+ $(top_srcdir)/plugins/telit/mm-modem-helpers-telit.h \
+ $(NULL)
+
+TELIT_ENUMS_GENERATED = \
+ telit/mm-telit-enums-types.h \
+ telit/mm-telit-enums-types.c \
+ $(NULL)
+
+BUILT_SOURCES += $(TELIT_ENUMS_GENERATED)
+CLEANFILES += $(TELIT_ENUMS_GENERATED)
+
+telit/mm-telit-enums-types.h: Makefile.am $(TELIT_ENUMS_INPUTS) $(top_srcdir)/build-aux/mm-enums-template.h
+ $(AM_V_GEN) \
+ $(MKDIR_P) telit; \
+ $(GLIB_MKENUMS) \
+ --fhead "#include \"mm-modem-helpers-telit.h\"\n#ifndef __MM_TELIT_ENUMS_TYPES_H__\n#define __MM_TELIT_ENUMS_TYPES_H__\n" \
+ --template $(top_srcdir)/build-aux/mm-enums-template.h \
+ --ftail "#endif /* __MM_TELIT_ENUMS_TYPES_H__ */\n" \
+ $(TELIT_ENUMS_INPUTS) > $@
+
+telit/mm-telit-enums-types.c: Makefile.am $(top_srcdir)/build-aux/mm-enums-template.c telit/mm-telit-enums-types.h
+ $(AM_V_GEN) \
+ $(MKDIR_P) telit; \
+ $(GLIB_MKENUMS) \
+ --fhead "#include \"mm-telit-enums-types.h\"" \
+ --template $(top_srcdir)/build-aux/mm-enums-template.c \
+ $(TELIT_ENUMS_INPUTS) > $@
+
+noinst_LTLIBRARIES += libhelpers-telit.la
+libhelpers_telit_la_SOURCES = \
+ telit/mm-modem-helpers-telit.c \
+ telit/mm-modem-helpers-telit.h \
+ $(NULL)
+libhelpers_telit_la_CPPFLAGS = \
+ -I$(top_srcdir)/plugins/telit \
+ -I$(top_builddir)/plugins/telit \
+ $(NULL)
+nodist_libhelpers_telit_la_SOURCES = $(TELIT_ENUMS_GENERATED)
+
+noinst_PROGRAMS += test-modem-helpers-telit
+test_modem_helpers_telit_SOURCES = \
+ telit/tests/test-mm-modem-helpers-telit.c \
+ $(NULL)
+test_modem_helpers_telit_CPPFLAGS = \
+ -I$(top_srcdir)/plugins/telit \
+ -I$(top_builddir)/plugins/telit \
+ $(TEST_COMMON_COMPILER_FLAGS) \
+ $(NULL)
+test_modem_helpers_telit_LDADD = \
+ $(TEST_COMMON_LIBADD_FLAGS) \
+ $(builddir)/libhelpers-telit.la \
+ $(top_builddir)/src/libhelpers.la \
+ $(top_builddir)/libmm-glib/libmm-glib.la \
+ $(NULL)
+
+# Common telit modem support library
+pkglib_LTLIBRARIES += libmm-shared-telit.la
+libmm_shared_telit_la_SOURCES = \
+ telit/mm-shared.c \
+ telit/mm-common-telit.c \
+ telit/mm-common-telit.h \
+ telit/mm-shared-telit.c \
+ telit/mm-shared-telit.h \
+ telit/mm-broadband-modem-telit.c \
+ telit/mm-broadband-modem-telit.h \
+ $(NULL)
+if WITH_MBIM
+libmm_shared_telit_la_SOURCES += \
+ telit/mm-broadband-modem-mbim-telit.h \
+ telit/mm-broadband-modem-mbim-telit.c \
+ $(NULL)
+endif
+
+libmm_shared_telit_la_CPPFLAGS = \
+ -I$(top_srcdir)/plugins/telit \
+ -I$(top_builddir)/plugins/telit \
+ $(SHARED_COMMON_COMPILER_FLAGS) \
+ $(NULL)
+libmm_shared_telit_la_LDFLAGS = $(SHARED_COMMON_LINKER_FLAGS)
+libmm_shared_telit_la_LIBADD = \
+ $(builddir)/libhelpers-telit.la \
+ $(NULL)
+
+TELIT_COMMON_COMPILER_FLAGS = \
+ -I$(top_srcdir)/plugins/telit \
+ -I$(top_builddir)/plugins/telit \
+ $(NULL)
+
+################################################################################
# plugin: generic
################################################################################
@@ -864,104 +957,18 @@ libmm_plugin_via_la_LDFLAGS = $(PLUGIN_COMMON_LINKER_FLAGS)
# plugin: telit
################################################################################
-PLUGIN_TELIT_COMPILER_FLAGS = \
- -I$(top_srcdir)/plugins/telit \
- -I$(top_builddir)/plugins/telit \
- $(NULL)
-
-noinst_LTLIBRARIES += libhelpers-telit.la
-
-TELIT_ENUMS_INPUTS = \
- $(top_srcdir)/plugins/telit/mm-modem-helpers-telit.h \
- $(NULL)
-
-TELIT_ENUMS_GENERATED = \
- telit/mm-telit-enums-types.h \
- telit/mm-telit-enums-types.c \
- $(NULL)
-
-telit/mm-telit-enums-types.h: Makefile.am $(TELIT_ENUMS_INPUTS) $(top_srcdir)/build-aux/mm-enums-template.h
- $(AM_V_GEN) \
- $(MKDIR_P) telit; \
- $(GLIB_MKENUMS) \
- --fhead "#include \"mm-modem-helpers-telit.h\"\n#ifndef __MM_TELIT_ENUMS_TYPES_H__\n#define __MM_TELIT_ENUMS_TYPES_H__\n" \
- --template $(top_srcdir)/build-aux/mm-enums-template.h \
- --ftail "#endif /* __MM_TELIT_ENUMS_TYPES_H__ */\n" \
- $(TELIT_ENUMS_INPUTS) > $@
-
-telit/mm-telit-enums-types.c: Makefile.am $(top_srcdir)/build-aux/mm-enums-template.c telit/mm-telit-enums-types.h
- $(AM_V_GEN) \
- $(MKDIR_P) telit; \
- $(GLIB_MKENUMS) \
- --fhead "#include \"mm-telit-enums-types.h\"" \
- --template $(top_srcdir)/build-aux/mm-enums-template.c \
- $(TELIT_ENUMS_INPUTS) > $@
-
-libhelpers_telit_la_SOURCES = \
- telit/mm-modem-helpers-telit.c \
- telit/mm-modem-helpers-telit.h \
- $(NULL)
-
-nodist_libhelpers_telit_la_SOURCES = $(TELIT_ENUMS_GENERATED)
-
-libhelpers_telit_la_CPPFLAGS = $(PLUGIN_TELIT_COMPILER_FLAGS)
-
-BUILT_SOURCES += $(TELIT_ENUMS_GENERATED)
-CLEANFILES += $(TELIT_ENUMS_GENERATED)
-
pkglib_LTLIBRARIES += libmm-plugin-telit.la
libmm_plugin_telit_la_SOURCES = \
telit/mm-plugin-telit.c \
telit/mm-plugin-telit.h \
$(NULL)
-libmm_plugin_telit_la_CPPFLAGS = $(PLUGIN_COMMON_COMPILER_FLAGS) $(PLUGIN_TELIT_COMPILER_FLAGS)
+libmm_plugin_telit_la_CPPFLAGS = $(PLUGIN_COMMON_COMPILER_FLAGS) $(TELIT_COMMON_COMPILER_FLAGS)
libmm_plugin_telit_la_LDFLAGS = $(PLUGIN_COMMON_LINKER_FLAGS)
-libmm_plugin_telit_la_LIBADD = $(TELIT_COMMON_LIBADD_FLAGS)
dist_udevrules_DATA += telit/77-mm-telit-port-types.rules
AM_CFLAGS += -DTESTUDEVRULESDIR_TELIT=\"${srcdir}/telit\"
-noinst_PROGRAMS += test-modem-helpers-telit
-test_modem_helpers_telit_SOURCES = \
- telit/tests/test-mm-modem-helpers-telit.c \
- $(NULL)
-test_modem_helpers_telit_CPPFLAGS = \
- $(PLUGIN_TELIT_COMPILER_FLAGS) \
- $(TEST_COMMON_COMPILER_FLAGS) \
- $(NULL)
-test_modem_helpers_telit_LDADD = \
- $(TEST_COMMON_LIBADD_FLAGS) \
- $(builddir)/libhelpers-telit.la \
- $(top_builddir)/src/libhelpers.la \
- $(top_builddir)/libmm-glib/libmm-glib.la \
- $(NULL)
-
-# Common telit modem support library
-noinst_LTLIBRARIES += libmm-utils-telit.la
-libmm_utils_telit_la_SOURCES = \
- telit/mm-common-telit.c \
- telit/mm-common-telit.h \
- telit/mm-shared-telit.c \
- telit/mm-shared-telit.h \
- telit/mm-broadband-modem-telit.c \
- telit/mm-broadband-modem-telit.h \
- $(NULL)
-libmm_utils_telit_la_CPPFLAGS = $(PLUGIN_TELIT_COMPILER_FLAGS)
-
-if WITH_MBIM
-libmm_utils_telit_la_SOURCES += \
- telit/mm-broadband-modem-mbim-telit.h \
- telit/mm-broadband-modem-mbim-telit.c \
- $(NULL)
-endif
-
-TELIT_COMMON_COMPILER_FLAGS = $(PLUGIN_TELIT_COMPILER_FLAGS)
-TELIT_COMMON_LIBADD_FLAGS = \
- $(builddir)/libhelpers-telit.la \
- $(builddir)/libmm-utils-telit.la \
- $(NULL)
-
################################################################################
# plugin: mtk
################################################################################
@@ -1102,9 +1109,6 @@ libmm_plugin_dell_la_CPPFLAGS = \
$(XMM_COMMON_COMPILER_FLAGS) \
$(NULL)
libmm_plugin_dell_la_LDFLAGS = $(PLUGIN_COMMON_LINKER_FLAGS)
-libmm_plugin_dell_la_LIBADD = \
- $(TELIT_COMMON_LIBADD_FLAGS) \
- $(NULL)
dist_udevrules_DATA += dell/77-mm-dell-port-types.rules
diff --git a/plugins/telit/mm-shared.c b/plugins/telit/mm-shared.c
new file mode 100644
index 00000000..ad2843dd
--- /dev/null
+++ b/plugins/telit/mm-shared.c
@@ -0,0 +1,20 @@
+/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * 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:
+ *
+ * Copyright (C) 2019 Aleksander Morgado <aleksander@aleksander.es>
+ */
+
+#include "mm-shared.h"
+
+MM_SHARED_DEFINE_MAJOR_VERSION
+MM_SHARED_DEFINE_MINOR_VERSION
+MM_SHARED_DEFINE_NAME(Telit)