build: Port to meson
meson is a build system focused on speed an ease of use, which helps speeding up the software development. This patch adds meson support along autotools.
This commit is contained in:

committed by
Aleksander Morgado

parent
fa19b2b9b1
commit
77d1c24361
1
build-aux/mm-daemon-enums-types.c.template
Symbolic link
1
build-aux/mm-daemon-enums-types.c.template
Symbolic link
@@ -0,0 +1 @@
|
||||
mm-enums-types.c.template
|
1
build-aux/mm-daemon-enums-types.h.template
Symbolic link
1
build-aux/mm-daemon-enums-types.h.template
Symbolic link
@@ -0,0 +1 @@
|
||||
mm-enums-types.h.template
|
1
build-aux/mm-helper-enums-types.c.template
Symbolic link
1
build-aux/mm-helper-enums-types.c.template
Symbolic link
@@ -0,0 +1 @@
|
||||
mm-enums-types.c.template
|
1
build-aux/mm-helper-enums-types.h.template
Symbolic link
1
build-aux/mm-helper-enums-types.h.template
Symbolic link
@@ -0,0 +1 @@
|
||||
mm-enums-types.h.template
|
1
build-aux/mm-huawei-enums-types.c.template
Symbolic link
1
build-aux/mm-huawei-enums-types.c.template
Symbolic link
@@ -0,0 +1 @@
|
||||
mm-enums-types.c.template
|
1
build-aux/mm-huawei-enums-types.h.template
Symbolic link
1
build-aux/mm-huawei-enums-types.h.template
Symbolic link
@@ -0,0 +1 @@
|
||||
mm-enums-types.h.template
|
1
build-aux/mm-port-enums-types.c.template
Symbolic link
1
build-aux/mm-port-enums-types.c.template
Symbolic link
@@ -0,0 +1 @@
|
||||
mm-enums-types.c.template
|
1
build-aux/mm-port-enums-types.h.template
Symbolic link
1
build-aux/mm-port-enums-types.h.template
Symbolic link
@@ -0,0 +1 @@
|
||||
mm-enums-types.h.template
|
1
build-aux/mm-telit-enums-types.c.template
Symbolic link
1
build-aux/mm-telit-enums-types.c.template
Symbolic link
@@ -0,0 +1 @@
|
||||
mm-enums-types.c.template
|
1
build-aux/mm-telit-enums-types.h.template
Symbolic link
1
build-aux/mm-telit-enums-types.h.template
Symbolic link
@@ -0,0 +1 @@
|
||||
mm-enums-types.h.template
|
1
build-aux/mm-ublox-enums-types.c.template
Symbolic link
1
build-aux/mm-ublox-enums-types.c.template
Symbolic link
@@ -0,0 +1 @@
|
||||
mm-enums-types.c.template
|
1
build-aux/mm-ublox-enums-types.h.template
Symbolic link
1
build-aux/mm-ublox-enums-types.h.template
Symbolic link
@@ -0,0 +1 @@
|
||||
mm-enums-types.h.template
|
47
cli/meson.build
Normal file
47
cli/meson.build
Normal file
@@ -0,0 +1,47 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
# Copyright (C) 2021 Iñigo Martinez <inigomartinez@gmail.com>
|
||||
|
||||
sources = files(
|
||||
'mmcli-bearer.c',
|
||||
'mmcli.c',
|
||||
'mmcli-call.c',
|
||||
'mmcli-common.c',
|
||||
'mmcli-manager.c',
|
||||
'mmcli-modem-3gpp.c',
|
||||
'mmcli-modem-3gpp-profile-manager.c',
|
||||
'mmcli-modem-3gpp-ussd.c',
|
||||
'mmcli-modem.c',
|
||||
'mmcli-modem-cdma.c',
|
||||
'mmcli-modem-firmware.c',
|
||||
'mmcli-modem-location.c',
|
||||
'mmcli-modem-messaging.c',
|
||||
'mmcli-modem-oma.c',
|
||||
'mmcli-modem-signal.c',
|
||||
'mmcli-modem-simple.c',
|
||||
'mmcli-modem-time.c',
|
||||
'mmcli-modem-voice.c',
|
||||
'mmcli-output.c',
|
||||
'mmcli-sim.c',
|
||||
'mmcli-sms.c',
|
||||
)
|
||||
|
||||
deps = [
|
||||
gudev_dep,
|
||||
libmm_glib_dep,
|
||||
]
|
||||
|
||||
executable(
|
||||
'mmcli',
|
||||
sources: sources,
|
||||
include_directories: top_inc,
|
||||
dependencies: deps,
|
||||
install: true,
|
||||
)
|
||||
|
||||
if enable_bash_completion
|
||||
install_data(
|
||||
'mmcli-completion',
|
||||
install_dir: bash_completion_completionsdir,
|
||||
rename: 'mmcli',
|
||||
)
|
||||
endif
|
74
data/meson.build
Normal file
74
data/meson.build
Normal file
@@ -0,0 +1,74 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
# Copyright (C) 2021 Iñigo Martinez <inigomartinez@gmail.com>
|
||||
|
||||
service_conf = {
|
||||
'sbindir': mm_prefix / mm_sbindir,
|
||||
'MM_POLKIT_SERVICE': (enable_polkit ? 'polkit.service' : ''),
|
||||
}
|
||||
|
||||
# DBus Service file
|
||||
configure_file(
|
||||
input: 'org.freedesktop.ModemManager1.conf.@0@polkit'.format(enable_polkit ? '' : 'no'),
|
||||
output: '@BASENAME@',
|
||||
copy: true,
|
||||
install_dir: dbus_policy_dir,
|
||||
)
|
||||
|
||||
# DBus Activation file
|
||||
configure_file(
|
||||
input: 'org.freedesktop.ModemManager1.service.in',
|
||||
output: '@BASENAME@',
|
||||
configuration: service_conf,
|
||||
install_dir: dbus_system_bus_services_dir,
|
||||
)
|
||||
|
||||
# systemd unit file
|
||||
if install_systemdunitdir
|
||||
configure_file(
|
||||
input: 'ModemManager.service.in',
|
||||
output: '@BASENAME@',
|
||||
configuration: service_conf,
|
||||
install_dir: systemd_systemdsystemunitdir,
|
||||
)
|
||||
endif
|
||||
|
||||
# Polkit
|
||||
if enable_polkit
|
||||
policy = 'org.freedesktop.ModemManager1.policy'
|
||||
|
||||
# build file with translations, which we will include in dist
|
||||
i18n.merge_file(
|
||||
policy,
|
||||
input: configure_file(
|
||||
input: policy + '.in.in',
|
||||
output: '@BASENAME@',
|
||||
configuration: policy_conf,
|
||||
),
|
||||
output: '@BASENAME@',
|
||||
po_dir: po_dir,
|
||||
install: true,
|
||||
install_dir: polkit_gobject_policydir,
|
||||
)
|
||||
endif
|
||||
|
||||
if enable_gtk_doc
|
||||
# Logos
|
||||
logos_pngs = files(
|
||||
'ModemManager-logo-square.png',
|
||||
'ModemManager-logo-wide.png',
|
||||
'ModemManager-logo-wide-text.png',
|
||||
)
|
||||
|
||||
# Diagrams
|
||||
diagrams_pngs = files(
|
||||
'ModemManager-interface-initialization-sequence.png',
|
||||
'ModemManager-interface-initialization-sequence-subclassed.png',
|
||||
'ModemManager-states.png',
|
||||
)
|
||||
endif
|
||||
|
||||
# Icon
|
||||
install_data(
|
||||
'ModemManager.png',
|
||||
install_dir: mm_datadir / 'icons/hicolor/22x22/apps',
|
||||
)
|
9
docs/man/meson.build
Normal file
9
docs/man/meson.build
Normal file
@@ -0,0 +1,9 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
# Copyright (C) 2021 Iñigo Martinez <inigomartinez@gmail.com>
|
||||
|
||||
mans = files(
|
||||
'mmcli.1',
|
||||
'ModemManager.8',
|
||||
)
|
||||
|
||||
install_man(mans)
|
57
docs/reference/api/meson.build
Normal file
57
docs/reference/api/meson.build
Normal file
@@ -0,0 +1,57 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
# Copyright (C) 2021 Iñigo Martinez <inigomartinez@gmail.com>
|
||||
|
||||
doc_module = mm_name
|
||||
|
||||
private_headers = [
|
||||
'ModemManager.h',
|
||||
'ModemManager-names.h',
|
||||
]
|
||||
|
||||
mm_doc_path = mm_prefix / gnome.gtkdoc_html_dir(doc_module)
|
||||
|
||||
version_xml = configure_file(
|
||||
input: 'version.xml.in',
|
||||
output: '@BASENAME@',
|
||||
configuration: version_conf,
|
||||
)
|
||||
|
||||
expand_content_files = [
|
||||
'ModemManager-dbus-reference.xml',
|
||||
'ModemManager-migration-reference.xml',
|
||||
'ModemManager-overview.xml',
|
||||
# FIXME: workaround because only strings can be included and not custom targets (gen_docs)
|
||||
generated_build_dir / 'mm-gdbus-doc-org.freedesktop.ModemManager1.Bearer.xml',
|
||||
generated_build_dir / 'mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Firmware.xml',
|
||||
generated_build_dir / 'mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Location.xml',
|
||||
generated_build_dir / 'mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Messaging.xml',
|
||||
generated_build_dir / 'mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Modem3gpp.ProfileManager.xml',
|
||||
generated_build_dir / 'mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Modem3gpp.Ussd.xml',
|
||||
generated_build_dir / 'mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Modem3gpp.xml',
|
||||
generated_build_dir / 'mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.ModemCdma.xml',
|
||||
generated_build_dir / 'mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Oma.xml',
|
||||
generated_build_dir / 'mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Signal.xml',
|
||||
generated_build_dir / 'mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Simple.xml',
|
||||
generated_build_dir / 'mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Time.xml',
|
||||
generated_build_dir / 'mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.xml',
|
||||
generated_build_dir / 'mm-gdbus-doc-org.freedesktop.ModemManager1.Sim.xml',
|
||||
generated_build_dir / 'mm-gdbus-doc-org.freedesktop.ModemManager1.Sms.xml',
|
||||
generated_build_dir / 'mm-gdbus-doc-org.freedesktop.ModemManager1.xml',
|
||||
]
|
||||
|
||||
gnome.gtkdoc(
|
||||
doc_module,
|
||||
main_xml: doc_module + '-docs.xml',
|
||||
src_dir: include_inc,
|
||||
ignore_headers: private_headers,
|
||||
include_directories: top_inc,
|
||||
gobject_typesfile: doc_module + '.types',
|
||||
dependencies: glib_deps,
|
||||
namespace: 'mm',
|
||||
scan_args: '--deprecated-guards="MM_DISABLE_DEPRECATED"',
|
||||
fixxref_args: '--html-dir=' + mm_doc_path,
|
||||
html_assets: logos_pngs + diagrams_pngs,
|
||||
content_files: version_xml,
|
||||
expand_content_files: expand_content_files,
|
||||
install: true,
|
||||
)
|
52
docs/reference/libmm-glib/meson.build
Normal file
52
docs/reference/libmm-glib/meson.build
Normal file
@@ -0,0 +1,52 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
# Copyright (C) 2021 Iñigo Martinez <inigomartinez@gmail.com>
|
||||
|
||||
doc_module = mm_glib_name
|
||||
|
||||
src_dirs = [
|
||||
generated_inc,
|
||||
libmm_glib_inc,
|
||||
]
|
||||
|
||||
private_headers = [
|
||||
'mm-common-helpers.h',
|
||||
'mm-gdbus-test.h',
|
||||
'mm-helpers.h',
|
||||
]
|
||||
|
||||
scan_args = [
|
||||
'--deprecated-guards="MM_DISABLE_DEPRECATED"',
|
||||
'--rebuild-types',
|
||||
]
|
||||
|
||||
mkdb_args = [
|
||||
'--ignore-files=mm-gdbus-test.h',
|
||||
'--ignore-files=mm-gdbus-test.c',
|
||||
]
|
||||
|
||||
fixxref_args = [
|
||||
'--html-dir=' + (mm_prefix / gnome.gtkdoc_html_dir(doc_module)),
|
||||
'--extra-dir=' + mm_doc_path,
|
||||
]
|
||||
|
||||
version_xml = configure_file(
|
||||
input: 'version.xml.in',
|
||||
output: '@BASENAME@',
|
||||
configuration: version_conf,
|
||||
)
|
||||
|
||||
gnome.gtkdoc(
|
||||
doc_module,
|
||||
main_xml: doc_module + '-docs.xml',
|
||||
src_dir: src_dirs,
|
||||
ignore_headers: private_headers,
|
||||
include_directories: top_inc,
|
||||
dependencies: libmm_glib_dep,
|
||||
namespace: 'mm',
|
||||
scan_args: scan_args,
|
||||
mkdb_args: mkdb_args,
|
||||
fixxref_args: fixxref_args,
|
||||
html_assets: logos_pngs,
|
||||
content_files: version_xml,
|
||||
install: true,
|
||||
)
|
41
include/meson.build
Normal file
41
include/meson.build
Normal file
@@ -0,0 +1,41 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
# Copyright (C) 2021 Iñigo Martinez <inigomartinez@gmail.com>
|
||||
|
||||
include_inc = include_directories('.')
|
||||
|
||||
mm_enums_header = files('ModemManager-enums.h')
|
||||
mm_errors_header = files('ModemManager-errors.h')
|
||||
|
||||
headers = files(
|
||||
'ModemManager-compat.h',
|
||||
'ModemManager.h',
|
||||
)
|
||||
|
||||
install_headers(
|
||||
headers + mm_enums_header + mm_errors_header,
|
||||
install_dir: mm_pkgincludedir,
|
||||
)
|
||||
|
||||
header = 'ModemManager-names.h'
|
||||
|
||||
mm_names_header = custom_target(
|
||||
header,
|
||||
input: [build_aux_dir / 'header-generator.xsl', mm_ifaces_all],
|
||||
output: header,
|
||||
command: [find_program('xsltproc'), '--xinclude', '--nonet', '--output', '@OUTPUT@', '@INPUT@'],
|
||||
install: true,
|
||||
install_dir: mm_pkgincludedir,
|
||||
)
|
||||
|
||||
mm_version_header = configure_file(
|
||||
input: 'ModemManager-version.h.in',
|
||||
output: '@BASENAME@',
|
||||
configuration: version_conf,
|
||||
install: true,
|
||||
install_dir: mm_pkgincludedir,
|
||||
)
|
||||
|
||||
include_dep = declare_dependency(
|
||||
sources: [mm_names_header, mm_version_header],
|
||||
include_directories: include_inc,
|
||||
)
|
35
introspection/meson.build
Normal file
35
introspection/meson.build
Normal file
@@ -0,0 +1,35 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
# Copyright (C) 2021 Iñigo Martinez <inigomartinez@gmail.com>
|
||||
|
||||
# DBus Introspection files
|
||||
mm_ifaces_all = files('all.xml')
|
||||
mm_ifaces_test = files('tests/org.freedesktop.ModemManager1.Test.xml')
|
||||
|
||||
mm_ifaces = files('org.freedesktop.ModemManager1.xml')
|
||||
|
||||
mm_ifaces_bearer = files('org.freedesktop.ModemManager1.Bearer.xml')
|
||||
mm_ifaces_call = files('org.freedesktop.ModemManager1.Call.xml')
|
||||
|
||||
mm_ifaces_modem = files(
|
||||
'org.freedesktop.ModemManager1.Modem.Firmware.xml',
|
||||
'org.freedesktop.ModemManager1.Modem.Location.xml',
|
||||
'org.freedesktop.ModemManager1.Modem.Messaging.xml',
|
||||
'org.freedesktop.ModemManager1.Modem.Modem3gpp.ProfileManager.xml',
|
||||
'org.freedesktop.ModemManager1.Modem.Modem3gpp.Ussd.xml',
|
||||
'org.freedesktop.ModemManager1.Modem.Modem3gpp.xml',
|
||||
'org.freedesktop.ModemManager1.Modem.ModemCdma.xml',
|
||||
'org.freedesktop.ModemManager1.Modem.Oma.xml',
|
||||
'org.freedesktop.ModemManager1.Modem.Signal.xml',
|
||||
'org.freedesktop.ModemManager1.Modem.Simple.xml',
|
||||
'org.freedesktop.ModemManager1.Modem.Time.xml',
|
||||
'org.freedesktop.ModemManager1.Modem.Voice.xml',
|
||||
'org.freedesktop.ModemManager1.Modem.xml',
|
||||
)
|
||||
|
||||
mm_ifaces_sim = files('org.freedesktop.ModemManager1.Sim.xml')
|
||||
mm_ifaces_sms = files('org.freedesktop.ModemManager1.Sms.xml',)
|
||||
|
||||
install_data(
|
||||
mm_ifaces + mm_ifaces_bearer + mm_ifaces_call + mm_ifaces_modem + mm_ifaces_sim + mm_ifaces_sms,
|
||||
install_dir: dbus_interfaces_dir,
|
||||
)
|
135
libmm-glib/generated/meson.build
Normal file
135
libmm-glib/generated/meson.build
Normal file
@@ -0,0 +1,135 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
# Copyright (C) 2021 Iñigo Martinez <inigomartinez@gmail.com>
|
||||
|
||||
generated_inc = include_directories('.')
|
||||
generated_build_dir = meson.current_build_dir()
|
||||
|
||||
common_c_args = cc.get_supported_arguments([
|
||||
'-Wno-float-equal',
|
||||
'-Wno-shadow',
|
||||
'-Wno-unused-function',
|
||||
])
|
||||
|
||||
gen_sources = []
|
||||
gen_headers = []
|
||||
gen_docs = []
|
||||
|
||||
# Enum types
|
||||
enums_types = 'mm-enums-types'
|
||||
|
||||
gen_sources += gnome.mkenums(
|
||||
enums_types + '.c',
|
||||
sources: mm_enums_header,
|
||||
c_template: build_aux_dir / enums_types + '.c.template',
|
||||
fhead: '#include "mm-enums-types.h"\n',
|
||||
)
|
||||
|
||||
gen_headers += gnome.mkenums(
|
||||
enums_types + '.h',
|
||||
sources: mm_enums_header,
|
||||
h_template: build_aux_dir / enums_types + '.h.template',
|
||||
fhead: '#include <ModemManager.h>\n#ifndef __MM_ENUMS_TYPES_H__\n#define __MM_ENUMS_TYPES_H__\n',
|
||||
ftail: '#endif /* __MM_ENUMS_TYPES_H__ */\n',
|
||||
install_header: true,
|
||||
install_dir: mm_glib_pkgincludedir,
|
||||
)
|
||||
|
||||
# Error types & quarks
|
||||
errors_types = 'mm-errors-types'
|
||||
|
||||
gen_sources += gnome.mkenums(
|
||||
enums_types + '.c',
|
||||
sources: mm_errors_header,
|
||||
c_template: build_aux_dir / errors_types + '.c.template',
|
||||
fhead: '#include <ModemManager.h>\n#include "mm-errors-types.h"\n',
|
||||
)
|
||||
|
||||
gen_headers += gnome.mkenums(
|
||||
errors_types + '.h',
|
||||
sources: mm_errors_header,
|
||||
h_template: build_aux_dir / errors_types + '.h.template',
|
||||
fhead: '#ifndef __MM_ERRORS_TYPES_H__\n#define __MM_ERRORS_TYPES_H__\n',
|
||||
ftail: '#endif /* __MM_ERRORS_TYPES_H__ */\n',
|
||||
install_header: true,
|
||||
install_dir: mm_glib_pkgincludedir,
|
||||
)
|
||||
|
||||
errors_quarks = 'mm-errors-quarks'
|
||||
|
||||
gen_sources += gnome.mkenums(
|
||||
errors_quarks + '.c',
|
||||
sources: mm_errors_header,
|
||||
c_template: build_aux_dir / errors_quarks + '.c.template',
|
||||
fhead: '#include <ModemManager.h>\n#include "mm-errors-types.h"\n',
|
||||
)
|
||||
|
||||
gdbus_ifaces = [
|
||||
['bearer', mm_ifaces_bearer, [], false, true],
|
||||
['call', mm_ifaces_call, [], false, false],
|
||||
['manager', mm_ifaces, [], false, true],
|
||||
['sim', mm_ifaces_sim, [], false, true],
|
||||
]
|
||||
|
||||
annotations = [
|
||||
['org.freedesktop.ModemManager1.Modem.ModemCdma', 'org.gtk.GDBus.C.Name', 'ModemCdma'],
|
||||
['org.freedesktop.ModemManager1.Modem.Modem3gpp', 'org.gtk.GDBus.C.Name', 'Modem3gpp'],
|
||||
['org.freedesktop.ModemManager1.Modem.Modem3gpp.Ussd', 'org.gtk.GDBus.C.Name', 'Modem3gppUssd'],
|
||||
['org.freedesktop.ModemManager1.Modem.Modem3gpp.ProfileManager', 'org.gtk.GDBus.C.Name', 'Modem3gppProfileManager'],
|
||||
]
|
||||
|
||||
gdbus_ifaces += [['modem', mm_ifaces_modem, annotations, true, true]]
|
||||
|
||||
annotations = [['org.freedesktop.ModemManager1.Sms:Data', 'org.gtk.GDBus.C.ForceGVariant', 'True']]
|
||||
|
||||
gdbus_ifaces += [['sms', mm_ifaces_sms, annotations, false, true]]
|
||||
|
||||
# FIXME: to avoid the inclusion of call gdbus (seems a mistake in autotools)
|
||||
gen_gir_sources = gen_sources + gen_headers
|
||||
|
||||
foreach gdbus_iface: gdbus_ifaces
|
||||
gdbus_sources = gnome.gdbus_codegen(
|
||||
'mm-gdbus-' + gdbus_iface[0],
|
||||
sources: gdbus_iface[1],
|
||||
interface_prefix: 'org.freedesktop.ModemManager1.',
|
||||
namespace: 'MmGdbus',
|
||||
docbook: 'mm-gdbus-doc',
|
||||
annotations: gdbus_iface[2],
|
||||
object_manager: gdbus_iface[3],
|
||||
autocleanup: 'objects',
|
||||
# FIXME: due to the lack of possibility to add `docbook targets` to the `expand_content_files`.
|
||||
build_by_default: true,
|
||||
install_header: true,
|
||||
install_dir: mm_glib_pkgincludedir,
|
||||
)
|
||||
|
||||
gen_sources += gdbus_sources[0]
|
||||
gen_headers += gdbus_sources[1]
|
||||
# FIXME: the `expand_content_files` must be strings
|
||||
gen_docs += gdbus_sources[2]
|
||||
if gdbus_iface[4]
|
||||
gen_gir_sources += [gdbus_sources[0], gdbus_sources[1]]
|
||||
endif
|
||||
endforeach
|
||||
|
||||
deps = [
|
||||
include_dep,
|
||||
gio_unix_dep,
|
||||
glib_deps,
|
||||
]
|
||||
|
||||
libmm_generated = static_library(
|
||||
'mm-generated',
|
||||
sources: gen_sources + gen_headers,
|
||||
include_directories: top_inc,
|
||||
dependencies: deps,
|
||||
c_args: common_c_args,
|
||||
)
|
||||
|
||||
libmm_generated_dep = declare_dependency(
|
||||
sources: gen_headers,
|
||||
include_directories: generated_inc,
|
||||
dependencies: glib_deps,
|
||||
link_whole: libmm_generated,
|
||||
)
|
||||
|
||||
subdir('tests')
|
26
libmm-glib/generated/tests/meson.build
Normal file
26
libmm-glib/generated/tests/meson.build
Normal file
@@ -0,0 +1,26 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
# Copyright (C) 2021 Iñigo Martinez <inigomartinez@gmail.com>
|
||||
|
||||
# Test interface
|
||||
gdbus_sources = gnome.gdbus_codegen(
|
||||
'mm-gdbus-test',
|
||||
sources: mm_ifaces_test,
|
||||
interface_prefix: 'org.freedesktop.ModemManager1.',
|
||||
namespace: 'MmGdbus',
|
||||
autocleanup: 'objects',
|
||||
)
|
||||
|
||||
libmm_test_generated = static_library(
|
||||
'mm-test-generated',
|
||||
sources: gdbus_sources,
|
||||
include_directories: top_inc,
|
||||
dependencies: deps,
|
||||
c_args: common_c_args,
|
||||
)
|
||||
|
||||
libmm_test_generated_dep = declare_dependency(
|
||||
sources: gdbus_sources[1],
|
||||
include_directories: '.',
|
||||
dependencies: glib_deps,
|
||||
link_with: libmm_test_generated,
|
||||
)
|
179
libmm-glib/meson.build
Normal file
179
libmm-glib/meson.build
Normal file
@@ -0,0 +1,179 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
# Copyright (C) 2021 Iñigo Martinez <inigomartinez@gmail.com>
|
||||
|
||||
libmm_glib_inc = include_directories('.')
|
||||
|
||||
subdir('generated')
|
||||
|
||||
headers = files(
|
||||
'libmm-glib.h',
|
||||
'mm-3gpp-profile.h',
|
||||
'mm-bearer.h',
|
||||
'mm-bearer-ip-config.h',
|
||||
'mm-bearer-properties.h',
|
||||
'mm-bearer-stats.h',
|
||||
'mm-call-audio-format.h',
|
||||
'mm-call.h',
|
||||
'mm-call-properties.h',
|
||||
'mm-cdma-manual-activation-properties.h',
|
||||
'mm-compat.h',
|
||||
'mm-firmware-properties.h',
|
||||
'mm-firmware-update-settings.h',
|
||||
'mm-helper-types.h',
|
||||
'mm-kernel-event-properties.h',
|
||||
'mm-location-3gpp.h',
|
||||
'mm-location-cdma-bs.h',
|
||||
'mm-location-common.h',
|
||||
'mm-location-gps-nmea.h',
|
||||
'mm-location-gps-raw.h',
|
||||
'mm-manager.h',
|
||||
'mm-modem-3gpp.h',
|
||||
'mm-modem-3gpp-profile-manager.h',
|
||||
'mm-modem-3gpp-ussd.h',
|
||||
'mm-modem-cdma.h',
|
||||
'mm-modem-firmware.h',
|
||||
'mm-modem.h',
|
||||
'mm-modem-location.h',
|
||||
'mm-modem-messaging.h',
|
||||
'mm-modem-oma.h',
|
||||
'mm-modem-signal.h',
|
||||
'mm-modem-simple.h',
|
||||
'mm-modem-time.h',
|
||||
'mm-modem-voice.h',
|
||||
'mm-network-timezone.h',
|
||||
'mm-object.h',
|
||||
'mm-pco.h',
|
||||
'mm-signal.h',
|
||||
'mm-sim.h',
|
||||
'mm-simple-connect-properties.h',
|
||||
'mm-simple-status.h',
|
||||
'mm-sim-preferred-network.h',
|
||||
'mm-sms.h',
|
||||
'mm-sms-properties.h',
|
||||
'mm-unlock-retries.h',
|
||||
)
|
||||
|
||||
install_headers(
|
||||
headers,
|
||||
install_dir: mm_glib_pkgincludedir,
|
||||
)
|
||||
|
||||
sources = files(
|
||||
'mm-3gpp-profile.c',
|
||||
'mm-bearer.c',
|
||||
'mm-bearer-ip-config.c',
|
||||
'mm-bearer-properties.c',
|
||||
'mm-bearer-stats.c',
|
||||
'mm-call-audio-format.c',
|
||||
'mm-call.c',
|
||||
'mm-call-properties.c',
|
||||
'mm-cdma-manual-activation-properties.c',
|
||||
'mm-common-helpers.c',
|
||||
'mm-compat.c',
|
||||
'mm-firmware-properties.c',
|
||||
'mm-firmware-update-settings.c',
|
||||
'mm-helper-types.c',
|
||||
'mm-kernel-event-properties.c',
|
||||
'mm-location-3gpp.c',
|
||||
'mm-location-cdma-bs.c',
|
||||
'mm-location-gps-nmea.c',
|
||||
'mm-location-gps-raw.c',
|
||||
'mm-manager.c',
|
||||
'mm-modem-3gpp.c',
|
||||
'mm-modem-3gpp-profile-manager.c',
|
||||
'mm-modem-3gpp-ussd.c',
|
||||
'mm-modem.c',
|
||||
'mm-modem-cdma.c',
|
||||
'mm-modem-firmware.c',
|
||||
'mm-modem-location.c',
|
||||
'mm-modem-messaging.c',
|
||||
'mm-modem-oma.c',
|
||||
'mm-modem-signal.c',
|
||||
'mm-modem-simple.c',
|
||||
'mm-modem-time.c',
|
||||
'mm-modem-voice.c',
|
||||
'mm-network-timezone.c',
|
||||
'mm-object.c',
|
||||
'mm-pco.c',
|
||||
'mm-signal.c',
|
||||
'mm-sim.c',
|
||||
'mm-simple-connect-properties.c',
|
||||
'mm-simple-status.c',
|
||||
'mm-sim-preferred-network.c',
|
||||
'mm-sms.c',
|
||||
'mm-sms-properties.c',
|
||||
'mm-unlock-retries.c',
|
||||
)
|
||||
|
||||
deps = [include_dep]
|
||||
|
||||
libmm_glib = shared_library(
|
||||
'mm-glib',
|
||||
version: mm_glib_version,
|
||||
sources: sources,
|
||||
include_directories: top_inc,
|
||||
dependencies: deps + [libmm_generated_dep],
|
||||
c_args: '-DLIBMM_GLIB_COMPILATION',
|
||||
install: true,
|
||||
)
|
||||
|
||||
libmm_glib_dep = declare_dependency(
|
||||
sources: gen_headers,
|
||||
include_directories: [libmm_glib_inc, generated_inc],
|
||||
dependencies: deps + [glib_deps],
|
||||
link_with: libmm_glib,
|
||||
)
|
||||
|
||||
pkg.generate(
|
||||
libraries: libmm_glib,
|
||||
version: mm_version,
|
||||
name: 'mm-glib',
|
||||
description: 'Library to control and monitor the ModemManager',
|
||||
subdirs: mm_glib_name,
|
||||
# FIXME: produced by the inhability of meson to use internal dependencies
|
||||
requires: ['gio-2.0', 'glib-2.0', 'gobject-2.0', 'ModemManager'],
|
||||
variables: 'exec_prefix=${prefix}',
|
||||
)
|
||||
|
||||
if enable_gir
|
||||
incs = [
|
||||
'Gio-2.0',
|
||||
'GLib-2.0',
|
||||
'GObject-2.0',
|
||||
]
|
||||
|
||||
gir_ns = 'ModemManager'
|
||||
gir_prefix = 'Mm'
|
||||
|
||||
args = [
|
||||
'-DLIBMM_GLIB_COMPILATION',
|
||||
'--identifier-prefix=' + gir_prefix.to_upper(),
|
||||
]
|
||||
|
||||
libmm_glib_gir = gnome.generate_gir(
|
||||
libmm_glib,
|
||||
# FIXME: mm-gdbus-call.[ch] are not included
|
||||
# sources: sources + headers + gen_sources + gen_headers + [mm_names_header, mm_version_header],
|
||||
sources: sources + headers + gen_gir_sources + [mm_names_header, mm_version_header],
|
||||
includes: incs,
|
||||
namespace: gir_ns,
|
||||
nsversion: mm_gir_version,
|
||||
identifier_prefix: gir_prefix,
|
||||
symbol_prefix: gir_prefix.to_lower(),
|
||||
extra_args: args,
|
||||
header: 'libmm-glib.h',
|
||||
export_packages: gir_ns,
|
||||
install: true,
|
||||
)
|
||||
|
||||
if enable_vapi
|
||||
libmm_glib_vapi = gnome.generate_vapi(
|
||||
'libmm-glib',
|
||||
sources: libmm_glib_gir[0],
|
||||
packages: 'gio-2.0',
|
||||
install: true,
|
||||
)
|
||||
endif
|
||||
endif
|
||||
|
||||
subdir('tests')
|
21
libmm-glib/tests/meson.build
Normal file
21
libmm-glib/tests/meson.build
Normal file
@@ -0,0 +1,21 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
# Copyright (C) 2021 Iñigo Martinez <inigomartinez@gmail.com>
|
||||
|
||||
test_units = [
|
||||
'common-helpers',
|
||||
'pco',
|
||||
]
|
||||
|
||||
foreach test_unit: test_units
|
||||
test_name = 'test-' + test_unit
|
||||
|
||||
exe = executable(
|
||||
test_name,
|
||||
test_name + '.c',
|
||||
include_directories: top_inc,
|
||||
dependencies: libmm_glib_dep,
|
||||
c_args: '-DLIBMM_GLIB_COMPILATION',
|
||||
)
|
||||
|
||||
test(test_name, exe)
|
||||
endforeach
|
33
libqcdm/src/meson.build
Normal file
33
libqcdm/src/meson.build
Normal file
@@ -0,0 +1,33 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
# Copyright (C) 2021 Iñigo Martinez <inigomartinez@gmail.com>
|
||||
|
||||
libqcdm_inc = include_directories('.')
|
||||
|
||||
sources = files(
|
||||
'com.c',
|
||||
'commands.c',
|
||||
'errors.c',
|
||||
'logs.c',
|
||||
'result.c',
|
||||
'utils.c',
|
||||
)
|
||||
|
||||
libqcdm = static_library(
|
||||
'qcdm',
|
||||
sources: sources,
|
||||
include_directories: top_inc,
|
||||
dependencies: glib_deps,
|
||||
)
|
||||
|
||||
libqcdm_dep = declare_dependency(
|
||||
include_directories: libqcdm_inc,
|
||||
link_with: libqcdm,
|
||||
)
|
||||
|
||||
# FIXME: Created following autotools but actually unused
|
||||
libqcdm_test = static_library(
|
||||
'qcdm-test',
|
||||
sources: 'utils.c',
|
||||
include_directories: top_inc,
|
||||
dependencies: glib_deps,
|
||||
)
|
42
libqcdm/tests/meson.build
Normal file
42
libqcdm/tests/meson.build
Normal file
@@ -0,0 +1,42 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
# Copyright (C) 2021 Iñigo Martinez <inigomartinez@gmail.com>
|
||||
|
||||
test_units = [
|
||||
['ipv6pref', files('ipv6pref.c'), false],
|
||||
['modepref', files('modepref.c'), false],
|
||||
['reset', files('reset.c'), false],
|
||||
]
|
||||
|
||||
sources = files(
|
||||
'test-qcdm.c',
|
||||
'test-qcdm-com.c',
|
||||
'test-qcdm-crc.c',
|
||||
'test-qcdm-escaping.c',
|
||||
'test-qcdm-result.c',
|
||||
'test-qcdm-utils.c',
|
||||
)
|
||||
|
||||
test_units += [['test-qcdm', sources, true]]
|
||||
|
||||
incs = [
|
||||
top_inc,
|
||||
libqcdm_inc,
|
||||
]
|
||||
|
||||
deps = [
|
||||
glib_deps,
|
||||
libqcdm_dep,
|
||||
]
|
||||
|
||||
foreach test_unit: test_units
|
||||
exe = executable(
|
||||
test_unit[0],
|
||||
test_unit[1],
|
||||
include_directories: incs,
|
||||
dependencies: deps,
|
||||
)
|
||||
|
||||
if test_unit[2]
|
||||
test(test_unit[0], exe)
|
||||
endif
|
||||
endforeach
|
445
meson.build
Normal file
445
meson.build
Normal file
@@ -0,0 +1,445 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
# Copyright (C) 2021 Iñigo Martinez <inigomartinez@gmail.com>
|
||||
|
||||
project(
|
||||
'ModemManager', 'c',
|
||||
version: '1.17.900',
|
||||
license: 'GPL2',
|
||||
default_options: [
|
||||
'buildtype=debugoptimized',
|
||||
'c_std=gnu89',
|
||||
'warning_level=2',
|
||||
],
|
||||
meson_version: '>= 0.50.0',
|
||||
)
|
||||
|
||||
mm_name = meson.project_name()
|
||||
mm_version = meson.project_version()
|
||||
version_array = mm_version.split('.')
|
||||
mm_major_version = version_array[0].to_int()
|
||||
mm_minor_version = version_array[1].to_int()
|
||||
mm_micro_version = version_array[2].to_int()
|
||||
|
||||
mm_prefix = get_option('prefix')
|
||||
mm_datadir = get_option('datadir')
|
||||
mm_includedir = get_option('includedir')
|
||||
mm_libdir = get_option('libdir')
|
||||
mm_sbindir = get_option('sbindir')
|
||||
mm_sysconfdir = get_option('sysconfdir')
|
||||
|
||||
mm_pkgdatadir = mm_datadir / mm_name
|
||||
mm_pkgincludedir = mm_includedir / mm_name
|
||||
mm_pkglibdir = mm_libdir / mm_name
|
||||
|
||||
mm_glib_name = 'libmm-glib'
|
||||
mm_glib_pkgincludedir = mm_includedir / mm_glib_name
|
||||
|
||||
# libtool versioning for libmm-glib (-version-info c:r:a)
|
||||
# - If the interface is unchanged, but the implementation has changed or been fixed, then increment r
|
||||
# - Otherwise, increment c and zero r.
|
||||
# - If the interface has grown (that is, the new library is compatible with old code), increment a.
|
||||
# - If the interface has changed in an incompatible way (that is, functions have changed or been removed), then zero a.
|
||||
current = 7
|
||||
revision = 0
|
||||
age = 7
|
||||
mm_glib_version = '@0@.@1@.@2@'.format(current - age, age, revision)
|
||||
|
||||
mm_gir_version = '1.0'
|
||||
|
||||
gnome = import('gnome')
|
||||
i18n = import('i18n')
|
||||
pkg = import('pkgconfig')
|
||||
|
||||
source_root = meson.current_source_dir()
|
||||
build_root = meson.current_build_dir()
|
||||
|
||||
build_aux_dir = source_root / 'build-aux'
|
||||
data_dir = source_root / 'data'
|
||||
plugins_dir = source_root / 'plugins'
|
||||
po_dir = source_root / 'po'
|
||||
src_dir = source_root / 'src'
|
||||
|
||||
top_inc = include_directories('.')
|
||||
|
||||
cc = meson.get_compiler('c')
|
||||
|
||||
config_h = configuration_data()
|
||||
config_h.set_quoted('PACKAGE_VERSION', mm_version)
|
||||
config_h.set_quoted('VERSION', mm_version)
|
||||
|
||||
# Globally define_GNU_SOURCE and therefore enable the GNU extensions
|
||||
config_h.set('_GNU_SOURCE', true)
|
||||
|
||||
# compiler flags
|
||||
common_args = ['-DHAVE_CONFIG_H']
|
||||
|
||||
# compiler flags that are always enabled, even in release builds
|
||||
cc_args = cc.get_supported_arguments([
|
||||
# warning on unused parameters is overkill, never do that
|
||||
'-Wno-unused-parameter',
|
||||
# function type cast disabled: used throughout the code especially to
|
||||
# cast GAsyncReadyCallbacks with the real object type instead of GObject
|
||||
'-Wno-cast-function-type',
|
||||
# all message protocol structs are packed, never complain about it
|
||||
'-Wno-packed',
|
||||
])
|
||||
|
||||
# strict flags to use in debug builds
|
||||
if get_option('buildtype').contains('debug')
|
||||
cc_args += cc.get_supported_arguments([
|
||||
'-fno-strict-aliasing',
|
||||
'-Waggregate-return',
|
||||
'-Wcast-align',
|
||||
'-Wdeclaration-after-statement',
|
||||
'-Wdouble-promotion',
|
||||
'-Wduplicated-branches',
|
||||
'-Wduplicated-cond',
|
||||
'-Wfloat-equal',
|
||||
'-Wformat=2',
|
||||
'-Wformat-nonliteral',
|
||||
'-Wformat-security',
|
||||
'-Winit-self',
|
||||
'-Winline',
|
||||
'-Wjump-misses-init',
|
||||
'-Wlogical-op',
|
||||
'-Wnested-externs',
|
||||
'-Wmissing-declarations',
|
||||
'-Wmissing-format-attribute',
|
||||
'-Wmissing-include-dirs',
|
||||
'-Wmissing-noreturn',
|
||||
'-Wmissing-prototypes',
|
||||
'-Wnull-dereference',
|
||||
'-Wpointer-arith',
|
||||
'-Wredundant-decls',
|
||||
'-Wrestrict',
|
||||
'-Wreturn-type',
|
||||
'-Wshadow',
|
||||
'-Wstrict-prototypes',
|
||||
'-Wsuggest-attribute=format',
|
||||
'-Wswitch-default',
|
||||
'-Wswitch-enum',
|
||||
'-Wundef',
|
||||
'-Wunused-but-set-variable',
|
||||
'-Wwrite-strings',
|
||||
])
|
||||
endif
|
||||
|
||||
add_project_arguments(common_args + cc_args, language: 'c')
|
||||
|
||||
no_deprecated_declarations_flags = cc.get_supported_arguments('-Wno-deprecated-declarations')
|
||||
|
||||
glib_version = '2.56'
|
||||
|
||||
gio_unix_dep = dependency('gio-unix-2.0')
|
||||
glib_dep = dependency('glib-2.0', version: '>= ' + glib_version)
|
||||
gmodule_dep = dependency('gmodule-2.0')
|
||||
|
||||
deps = [
|
||||
glib_dep,
|
||||
dependency('gio-2.0'),
|
||||
dependency('gobject-2.0'),
|
||||
]
|
||||
|
||||
c_args = [
|
||||
'-DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_' + glib_version.underscorify(),
|
||||
'-DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_' + glib_version.underscorify(),
|
||||
'-DGLIB_DISABLE_DEPRECATION_WARNINGS',
|
||||
]
|
||||
|
||||
glib_deps = declare_dependency(
|
||||
dependencies: deps,
|
||||
compile_args: c_args,
|
||||
)
|
||||
|
||||
# DBus system directory
|
||||
dbus_dep = dependency('dbus-1')
|
||||
dbus_interfaces_dir = dbus_dep.get_pkgconfig_variable('interfaces_dir', define_variable: ['datadir', mm_datadir])
|
||||
dbus_system_bus_services_dir = dbus_dep.get_pkgconfig_variable('system_bus_services_dir', define_variable: ['datadir', mm_datadir])
|
||||
|
||||
dbus_policy_dir = get_option('dbus_policy_dir')
|
||||
if dbus_policy_dir == ''
|
||||
dbus_policy_dir = dbus_dep.get_pkgconfig_variable('sysconfdir', define_variable: ['sysconfdir', mm_sysconfdir]) / 'dbus-1/system.d'
|
||||
endif
|
||||
|
||||
enable_bash_completion = get_option('bash_completion')
|
||||
if enable_bash_completion
|
||||
bash_completion_dep = dependency('bash-completion')
|
||||
bash_completion_completionsdir = bash_completion_dep.get_pkgconfig_variable(
|
||||
'completionsdir',
|
||||
# bash-completion 2.10 changed the substitutions
|
||||
define_variable: bash_completion_dep.version().version_compare('>= 2.10') ? ['datadir', mm_datadir] : ['prefix', mm_prefix],
|
||||
)
|
||||
endif
|
||||
|
||||
# udev support (enabled by default)
|
||||
gudev_dep = dependency('gudev-1.0', version: '>= 232', required: get_option('udev'))
|
||||
enable_udev = gudev_dep.found()
|
||||
config_h.set('WITH_UDEV', enable_udev)
|
||||
|
||||
# udev base directory
|
||||
udev_udevdir = get_option('udevdir')
|
||||
if udev_udevdir == ''
|
||||
udev_udevdir = dependency('udev').get_pkgconfig_variable('udevdir')
|
||||
endif
|
||||
udev_rulesdir = udev_udevdir / 'rules.d'
|
||||
|
||||
# systemd unit / service files
|
||||
systemd_systemdsystemunitdir = get_option('systemdsystemunitdir')
|
||||
install_systemdunitdir = (systemd_systemdsystemunitdir != 'no')
|
||||
|
||||
if install_systemdunitdir and systemd_systemdsystemunitdir == ''
|
||||
systemd_dep = dependency('systemd', not_found_message: 'systemd required but not found, please provide a valid systemd user unit dir or disable it')
|
||||
systemd_systemdsystemunitdir = systemd_dep.get_pkgconfig_variable('systemdsystemunitdir', define_variable: ['root_prefix', mm_prefix])
|
||||
endif
|
||||
|
||||
# Suspend/resume support
|
||||
libsystemd_dep = dependency('libsystemd', version: '>= 209', required: false)
|
||||
if not libsystemd_dep.found()
|
||||
libsystemd_dep = dependency('libsystemd-login', version: '>= 183', required: false)
|
||||
if not libsystemd_dep.found()
|
||||
libsystemd_dep = dependency('libelogind', version: '>= 209', required: false)
|
||||
endif
|
||||
endif
|
||||
|
||||
enable_systemd_suspend_resume = get_option('systemd_suspend_resume')
|
||||
assert(not enable_systemd_suspend_resume or libsystemd_dep.found(), 'libsystemd, libsystemd-login or elogind must be available at runtime for suspend/resume support')
|
||||
config_h.set('WITH_SYSTEMD_SUSPEND_RESUME', enable_systemd_suspend_resume)
|
||||
|
||||
# systemd journal support
|
||||
enable_systemd_journal = get_option('systemd_journal')
|
||||
assert(not enable_systemd_journal or libsystemd_dep.found(), 'libsystemd development headers are required')
|
||||
config_h.set('WITH_SYSTEMD_JOURNAL', enable_systemd_journal)
|
||||
|
||||
# PolicyKit
|
||||
polkit = get_option('polkit')
|
||||
enable_polkit = (polkit != 'no')
|
||||
if enable_polkit
|
||||
polkit_gobject_dep = dependency('polkit-gobject-1', version: '>= 0.97', not_found_message: 'PolicyKit development headers are required')
|
||||
|
||||
polkit_gobject_policydir = polkit_gobject_dep.get_pkgconfig_variable('policydir', define_variable: ['prefix', mm_prefix])
|
||||
|
||||
policy_conf = {'MM_DEFAULT_USER_POLICY': (polkit == 'permissive' ? 'yes' : 'auth_self_keep')}
|
||||
endif
|
||||
config_h.set('WITH_POLKIT', enable_polkit)
|
||||
|
||||
# AT command via DBus support (disabled by default unless running in --debug)
|
||||
# It is suggested that this option is only enabled in custom built systems and
|
||||
# only if truly required.
|
||||
enable_at_command_via_dbus = get_option('at_command_via_dbus')
|
||||
config_h.set('WITH_AT_COMMAND_VIA_DBUS', enable_at_command_via_dbus)
|
||||
|
||||
# MBIM support (enabled by default)
|
||||
mbim_glib_dep = dependency('mbim-glib', version: '>= 1.26.0', required: get_option('mbim'))
|
||||
enable_mbim = mbim_glib_dep.found()
|
||||
config_h.set('WITH_MBIM', enable_mbim)
|
||||
|
||||
# QMI support (enabled by default)
|
||||
qmi_glib_dep = dependency('qmi-glib', version: '>= 1.30.0', required: get_option('qmi'))
|
||||
enable_qmi = qmi_glib_dep.found()
|
||||
config_h.set('WITH_QMI', enable_qmi)
|
||||
|
||||
# QRTR support (both as qrtr-glib and qmi-glib apis)
|
||||
qrtr_glib_dep = dependency('qrtr-glib', version: '>= 1.0.0', required: get_option('qrtr'))
|
||||
enable_qrtr = qrtr_glib_dep.found()
|
||||
assert(not enable_qrtr or enable_qmi, 'QRTR support requires QMI enabled')
|
||||
assert(not enable_qrtr or qmi_glib_dep.get_pkgconfig_variable('qmi_qrtr_supported').to_int().is_odd(), 'Couldn\'t find QRTR support in qmi-glib.')
|
||||
config_h.set('WITH_QRTR', enable_qrtr)
|
||||
|
||||
# Distribution version string
|
||||
dist_version = get_option('dist_version')
|
||||
if dist_version != ''
|
||||
config_h.set('MM_DIST_VERSION', dist_version)
|
||||
endif
|
||||
|
||||
util_dep = cc.find_library('util')
|
||||
|
||||
# introspection support
|
||||
enable_gir = dependency('gobject-introspection-1.0', version: '>= 0.9.6', required: get_option('introspection')).found()
|
||||
|
||||
# vala support
|
||||
enable_vapi = get_option('vapi')
|
||||
|
||||
# gtkdoc support
|
||||
enable_gtk_doc = get_option('gtk_doc')
|
||||
|
||||
plugins_shared = {
|
||||
'foxconn': enable_mbim,
|
||||
'icera': true,
|
||||
'novatel': true,
|
||||
'option': true,
|
||||
'sierra': true,
|
||||
'telit': true,
|
||||
'xmm': true,
|
||||
}
|
||||
|
||||
plugins_options = {
|
||||
'altair-lte': [],
|
||||
'anydata': [],
|
||||
'broadmobi': [],
|
||||
'cinterion': [],
|
||||
'dell': ['foxconn', 'novatel', 'sierra', 'telit', 'xmm'],
|
||||
'dlink': [],
|
||||
'fibocom': ['xmm'],
|
||||
'foxconn': ['foxconn'],
|
||||
'generic': [],
|
||||
'gosuncn': [],
|
||||
'haier': [],
|
||||
'huawei': [],
|
||||
'iridium': [],
|
||||
'linktop': [],
|
||||
'longcheer': [],
|
||||
'mbm': [],
|
||||
'motorola': [],
|
||||
'mtk': [],
|
||||
'nokia': [],
|
||||
'nokia-icera': ['icera'],
|
||||
'novatel': ['novatel'],
|
||||
'novatel-lte': [],
|
||||
'option': ['option'],
|
||||
'option-hso': ['option'],
|
||||
'pantech': [],
|
||||
'qcom-soc': [],
|
||||
'quectel': [],
|
||||
'samsung': ['icera'],
|
||||
'sierra-legacy': ['icera', 'sierra'],
|
||||
'sierra': ['xmm'],
|
||||
'simtech': [],
|
||||
'telit': ['telit'],
|
||||
'thuraya': [],
|
||||
'tplink': [],
|
||||
'ublox': [],
|
||||
'via': [],
|
||||
'wavecom': [],
|
||||
'x22x': [],
|
||||
'zte': ['icera'],
|
||||
}
|
||||
|
||||
disable_all_plugins = get_option('plugin_disable_all')
|
||||
|
||||
enable_plugins = []
|
||||
enable_plugins_shared = []
|
||||
if not disable_all_plugins
|
||||
foreach plugin_name, plugin_shared_reqs: plugins_options
|
||||
if get_option('plugin_' + plugin_name.underscorify())
|
||||
enable_plugins += [plugin_name]
|
||||
foreach plugin_req: plugin_shared_reqs
|
||||
assert(plugins_shared[plugin_req], '@0@ required @1@ but is not available'.format(plugin_name, plugin_req))
|
||||
if not enable_plugins_shared.contains(plugin_req)
|
||||
enable_plugins_shared += [plugin_req]
|
||||
endif
|
||||
endforeach
|
||||
endif
|
||||
endforeach
|
||||
endif
|
||||
|
||||
version_conf = {
|
||||
'MM_MAJOR_VERSION': mm_major_version,
|
||||
'MM_MINOR_VERSION': mm_minor_version,
|
||||
'MM_MICRO_VERSION': mm_micro_version,
|
||||
'VERSION': mm_version,
|
||||
}
|
||||
|
||||
subdir('po')
|
||||
subdir('data')
|
||||
subdir('introspection')
|
||||
subdir('include')
|
||||
|
||||
subdir('libqcdm/src')
|
||||
subdir('libqcdm/tests')
|
||||
|
||||
subdir('libmm-glib')
|
||||
subdir('src')
|
||||
subdir('plugins')
|
||||
subdir('cli')
|
||||
subdir('test')
|
||||
subdir('tools/tests')
|
||||
|
||||
enable_man = get_option('man')
|
||||
if enable_man
|
||||
subdir('docs/man')
|
||||
endif
|
||||
|
||||
if enable_gtk_doc
|
||||
subdir('docs/reference/api')
|
||||
subdir('docs/reference/libmm-glib')
|
||||
endif
|
||||
|
||||
configure_file(
|
||||
output: 'config.h',
|
||||
configuration: config_h,
|
||||
)
|
||||
|
||||
output = '\n' + mm_name + ' ' + mm_version + '\n\n'
|
||||
output += ' Build\n'
|
||||
output += ' compiler: ' + cc.get_id() + '\n'
|
||||
output += ' cflags: ' + ' '.join(cc_args) + '\n'
|
||||
output += ' System paths\n'
|
||||
output += ' prefix: ' + mm_prefix + '\n'
|
||||
output += ' D-Bus policy directory: ' + dbus_policy_dir + '\n'
|
||||
output += ' udev base directory: ' + udev_udevdir + '\n'
|
||||
output += ' systemd unit directory: ' + systemd_systemdsystemunitdir + '\n\n'
|
||||
output += ' Features\n'
|
||||
output += ' udev: ' + enable_udev.to_string() + '\n'
|
||||
output += ' policykit: ' + polkit + '\n'
|
||||
output += ' mbim: ' + enable_mbim.to_string() + '\n'
|
||||
output += ' qmi: ' + enable_qmi.to_string() + '\n'
|
||||
output += ' qrtr: ' + enable_qrtr.to_string() + '\n'
|
||||
output += ' systemd suspend/resume: ' + enable_systemd_suspend_resume.to_string() + '\n'
|
||||
output += ' systemd journal: ' + enable_systemd_journal.to_string() + '\n'
|
||||
output += ' at command via dbus: ' + enable_at_command_via_dbus.to_string() + '\n\n'
|
||||
output += ' Shared utils:\n'
|
||||
output += ' foxconn: ' + enable_plugins_shared.contains('foxconn').to_string() + '\n'
|
||||
output += ' icera: ' + enable_plugins_shared.contains('icera').to_string() + '\n'
|
||||
output += ' novatel: ' + enable_plugins_shared.contains('novatel').to_string() + '\n'
|
||||
output += ' option: ' + enable_plugins_shared.contains('option').to_string() + '\n'
|
||||
output += ' sierra: ' + enable_plugins_shared.contains('sierra').to_string() + '\n'
|
||||
output += ' telit: ' + enable_plugins_shared.contains('telit').to_string() + '\n'
|
||||
output += ' xmm: ' + enable_plugins_shared.contains('xmm').to_string() + '\n'
|
||||
output += ' Plugins:\n'
|
||||
output += ' altair-lte: ' + enable_plugins.contains('altair-lte').to_string() + '\n'
|
||||
output += ' anydata: ' + enable_plugins.contains('anydata').to_string() + '\n'
|
||||
output += ' broadmobi: ' + enable_plugins.contains('broadmobi').to_string() + '\n'
|
||||
output += ' cinterion: ' + enable_plugins.contains('cinterion').to_string() + '\n'
|
||||
output += ' dell: ' + enable_plugins.contains('dell').to_string() + '\n'
|
||||
output += ' dlink: ' + enable_plugins.contains('dlink').to_string() + '\n'
|
||||
output += ' fibocom: ' + enable_plugins.contains('fibocom').to_string() + '\n'
|
||||
output += ' foxconn: ' + enable_plugins.contains('foxconn').to_string() + '\n'
|
||||
output += ' generic: ' + enable_plugins.contains('generic').to_string() + '\n'
|
||||
output += ' gosuncn: ' + enable_plugins.contains('gosuncn').to_string() + '\n'
|
||||
output += ' haier: ' + enable_plugins.contains('haier').to_string() + '\n'
|
||||
output += ' huawei: ' + enable_plugins.contains('huawei').to_string() + '\n'
|
||||
output += ' iridium: ' + enable_plugins.contains('iridium').to_string() + '\n'
|
||||
output += ' linktop: ' + enable_plugins.contains('linktop').to_string() + '\n'
|
||||
output += ' longcheer: ' + enable_plugins.contains('longcheer').to_string() + '\n'
|
||||
output += ' mbm: ' + enable_plugins.contains('mbm').to_string() + '\n'
|
||||
output += ' motorola: ' + enable_plugins.contains('motorola').to_string() + '\n'
|
||||
output += ' mtk: ' + enable_plugins.contains('mtk').to_string() + '\n'
|
||||
output += ' nokia: ' + enable_plugins.contains('nokia').to_string() + '\n'
|
||||
output += ' nokia-icera: ' + enable_plugins.contains('nokia-icera').to_string() + '\n'
|
||||
output += ' novatel: ' + enable_plugins.contains('novatel').to_string() + '\n'
|
||||
output += ' novatel-lte: ' + enable_plugins.contains('novatel-lte').to_string() + '\n'
|
||||
output += ' option: ' + enable_plugins.contains('option').to_string() + '\n'
|
||||
output += ' option-hso: ' + enable_plugins.contains('option-hso').to_string() + '\n'
|
||||
output += ' pantech: ' + enable_plugins.contains('pantech').to_string() + '\n'
|
||||
output += ' qcom-soc: ' + enable_plugins.contains('qcom-soc').to_string() + '\n'
|
||||
output += ' quectel: ' + enable_plugins.contains('quectel').to_string() + '\n'
|
||||
output += ' samsung: ' + enable_plugins.contains('samsung').to_string() + '\n'
|
||||
output += ' sierra: ' + enable_plugins.contains('sierra').to_string() + '\n'
|
||||
output += ' sierra-legacy: ' + enable_plugins.contains('sierra-legacy').to_string() + '\n'
|
||||
output += ' simtech: ' + enable_plugins.contains('simtech').to_string() + '\n'
|
||||
output += ' telit: ' + enable_plugins.contains('telit').to_string() + '\n'
|
||||
output += ' thuraya: ' + enable_plugins.contains('thuraya').to_string() + '\n'
|
||||
output += ' tplink: ' + enable_plugins.contains('tplink').to_string() + '\n'
|
||||
output += ' ublox: ' + enable_plugins.contains('ublox').to_string() + '\n'
|
||||
output += ' via: ' + enable_plugins.contains('via').to_string() + '\n'
|
||||
output += ' wavecom: ' + enable_plugins.contains('wavecom').to_string() + '\n'
|
||||
output += ' x22x: ' + enable_plugins.contains('x22x').to_string() + '\n'
|
||||
output += ' zte: ' + enable_plugins.contains('zte').to_string() + '\n'
|
||||
output += ' Miscellaneous:\n'
|
||||
output += ' gobject introspection: ' + enable_gir.to_string() + '\n'
|
||||
output += ' Man: ' + enable_man.to_string() + '\n'
|
||||
output += ' Documentation: ' + enable_gtk_doc.to_string() + '\n'
|
||||
output += ' bash completion: ' + enable_bash_completion.to_string() + '\n'
|
||||
output += ' vala bindings: ' + enable_vapi.to_string() + '\n'
|
||||
output += ' code_coverage: ' + get_option('b_coverage').to_string()
|
||||
message(output)
|
99
meson_options.txt
Normal file
99
meson_options.txt
Normal file
@@ -0,0 +1,99 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
# Copyright (C) 2021 Iñigo Martinez <inigomartinez@gmail.com>
|
||||
|
||||
option('udev', type: 'feature', value: 'auto', description: 'enable udev support')
|
||||
option('udevdir', type: 'string', value: '', description: 'udev base directory')
|
||||
|
||||
option('dbus_policy_dir', type: 'string', value: '', description: 'd-bus system policy directory')
|
||||
|
||||
option('systemdsystemunitdir', type: 'string', value: '', description: 'systemd system units directory')
|
||||
option('systemd_suspend_resume', type: 'boolean', value: true, description: 'enable suspend/resume support')
|
||||
option('systemd_journal', type: 'boolean', value: true, description: 'enable systemd journal support')
|
||||
|
||||
option('polkit', type: 'combo', choices: ['strict', 'permissive', 'no'], value: 'strict', description: 'User auth-polkit configuration option.')
|
||||
|
||||
option('at_command_via_dbus', type: 'boolean', value: false, description: 'enable at commands vida d-bus')
|
||||
|
||||
option('mbim', type: 'feature', value: 'auto', description: 'enable MBIM support')
|
||||
option('qmi', type: 'feature', value: 'auto', description: 'enable QMI support')
|
||||
option('qrtr', type: 'feature', value: 'auto', description: 'enable QRTR support')
|
||||
|
||||
option('dist_version', type: 'string', value: '', description: 'define the custom version (like distribution package name and revision')
|
||||
|
||||
option('plugin_disable_all', type: 'boolean', value: false, description: 'disable all plugin support')
|
||||
|
||||
option('plugin_generic', type: 'boolean', value: true, description: 'enable generic plugin support')
|
||||
option('plugin_altair_lte', type: 'boolean', value: true, description: 'enable altair lte plugin support')
|
||||
option('plugin_anydata', type: 'boolean', value: true, description: 'enable anydata plugin support')
|
||||
option('plugin_broadmobi', type: 'boolean', value: true, description: 'enable broadmobi plugin support')
|
||||
option('plugin_cinterion', type: 'boolean', value: true, description: 'enable cinterion plugin support')
|
||||
|
||||
# shared_sierra, shared_novatel, shared_xmm, shared_telit, shared_foxonn
|
||||
option('plugin_dell', type: 'boolean', value: true, description: 'enable dell plugin support')
|
||||
|
||||
option('plugin_dlink', type: 'boolean', value: true, description: 'enable dlink plugin support')
|
||||
|
||||
# shared_xmm
|
||||
option('plugin_fibocom', type: 'boolean', value: true, description: 'enable fibocom plugin support')
|
||||
|
||||
# shared_foxconn
|
||||
option('plugin_foxconn', type: 'boolean', value: true, description: 'enable foxconn plugin support')
|
||||
option('plugin_gosuncn', type: 'boolean', value: true, description: 'enable gosuncn plugin support')
|
||||
option('plugin_haier', type: 'boolean', value: true, description: 'enable haier plugin support')
|
||||
option('plugin_huawei', type: 'boolean', value: true, description: 'enable huawei plugin support')
|
||||
option('plugin_iridium', type: 'boolean', value: true, description: 'enable iridium plugin support')
|
||||
option('plugin_linktop', type: 'boolean', value: true, description: 'enable linktop plugin support')
|
||||
option('plugin_longcheer', type: 'boolean', value: true, description: 'enable longcheer plugin support')
|
||||
option('plugin_mbm', type: 'boolean', value: true, description: 'enable mbm plugin support')
|
||||
option('plugin_motorola', type: 'boolean', value: true, description: 'enable motorola plugin support')
|
||||
option('plugin_mtk', type: 'boolean', value: true, description: 'enable mtk plugin support')
|
||||
option('plugin_nokia', type: 'boolean', value: true, description: 'enable nokia plugin support')
|
||||
|
||||
# shared_icera
|
||||
option('plugin_nokia_icera', type: 'boolean', value: true, description: 'enable nokia icera plugin support')
|
||||
|
||||
# shared_novatel
|
||||
option('plugin_novatel', type: 'boolean', value: true, description: 'enable novatel plugin support')
|
||||
option('plugin_novatel_lte', type: 'boolean', value: true, description: 'enable novatel lte plugin support')
|
||||
|
||||
# shared_option
|
||||
option('plugin_option', type: 'boolean', value: true, description: 'enable option plugin support')
|
||||
|
||||
# shared_option
|
||||
option('plugin_option_hso', type: 'boolean', value: true, description: 'enable option hso plugin support')
|
||||
option('plugin_pantech', type: 'boolean', value: true, description: 'enable pantech plugin support')
|
||||
|
||||
option('plugin_qcom_soc', type: 'boolean', value: false, description: 'enable qcom soc plugin support')
|
||||
option('plugin_quectel', type: 'boolean', value: true, description: 'enable quectel plugin support')
|
||||
|
||||
# shared_icera
|
||||
option('plugin_samsung', type: 'boolean', value: true, description: 'enable samsung plugin support')
|
||||
|
||||
# shared_icera, shared_sierra
|
||||
option('plugin_sierra_legacy', type: 'boolean', value: true, description: 'enable sierra legacy plugin support')
|
||||
|
||||
# shared_xmm
|
||||
option('plugin_sierra', type: 'boolean', value: true, description: 'enable sierra plugin support')
|
||||
option('plugin_simtech', type: 'boolean', value: true, description: 'enable simtech plugin support')
|
||||
|
||||
# shared_telit
|
||||
option('plugin_telit', type: 'boolean', value: true, description: 'enable telit plugin support')
|
||||
option('plugin_thuraya', type: 'boolean', value: true, description: 'enable thuraya plugin support')
|
||||
option('plugin_tplink', type: 'boolean', value: true, description: 'enable tplink plugin support')
|
||||
option('plugin_ublox', type: 'boolean', value: true, description: 'enable ublox plugin support')
|
||||
option('plugin_via', type: 'boolean', value: true, description: 'enable via plugin support')
|
||||
option('plugin_wavecom', type: 'boolean', value: true, description: 'enable wavecom plugin support')
|
||||
option('plugin_x22x', type: 'boolean', value: true, description: 'enable x22x plugin support')
|
||||
|
||||
# shared_icera
|
||||
option('plugin_zte', type: 'boolean', value: true, description: 'enable zte plugin support')
|
||||
|
||||
option('qcdm_standalone', type: 'boolean', value: true, description: 'enable standalone qdcm')
|
||||
|
||||
option('introspection', type: 'feature', value: 'auto', description: 'build introspection support')
|
||||
option('vapi', type: 'boolean', value: false, description: 'build vala bindings')
|
||||
|
||||
option('man', type: 'boolean', value: true, description: 'build manual pages')
|
||||
option('gtk_doc', type: 'boolean', value: false, description: 'use gtk-doc to build documentation')
|
||||
|
||||
option('bash_completion', type: 'boolean', value: true, description: 'install bash completion files')
|
989
plugins/meson.build
Normal file
989
plugins/meson.build
Normal file
@@ -0,0 +1,989 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
# Copyright (C) 2021 Iñigo Martinez <inigomartinez@gmail.com>
|
||||
|
||||
symbol_map = plugins_dir / 'symbol.map'
|
||||
ldflags = cc.get_supported_link_arguments('-Wl,--version-script,@0@'.format(symbol_map))
|
||||
|
||||
# common service test support
|
||||
sources = files(
|
||||
'tests/test-fixture.c',
|
||||
'tests/test-helpers.c',
|
||||
'tests/test-port-context.c',
|
||||
)
|
||||
|
||||
deps = [
|
||||
gio_unix_dep,
|
||||
libhelpers_dep,
|
||||
libmm_test_generated_dep,
|
||||
]
|
||||
|
||||
libmm_test_common = shared_library(
|
||||
'mm_test_common',
|
||||
sources: sources,
|
||||
include_directories: top_inc,
|
||||
dependencies: deps,
|
||||
c_args: '-DTEST_SERVICES="@0@"'.format(source_root / 'data/tests'),
|
||||
)
|
||||
|
||||
libmm_test_common_dep = declare_dependency(
|
||||
include_directories: 'tests',
|
||||
dependencies: deps,
|
||||
link_with: libmm_test_common,
|
||||
)
|
||||
|
||||
# plugins
|
||||
plugins = {}
|
||||
plugins_data = []
|
||||
plugins_udev_rules = []
|
||||
|
||||
# Common Foxconn modem support library (MBIM only)
|
||||
if enable_plugins_shared.contains('foxconn')
|
||||
foxconn_inc = include_directories('foxconn')
|
||||
|
||||
sources = files(
|
||||
'foxconn/mm-broadband-modem-mbim-foxconn.c',
|
||||
'foxconn/mm-shared.c',
|
||||
)
|
||||
|
||||
c_args = [
|
||||
'-DMM_MODULE_NAME="shared-foxconn"',
|
||||
'-DPKGDATADIR="@0@"'.format(mm_pkgdatadir),
|
||||
]
|
||||
|
||||
plugins += {'shared-foxconn': {
|
||||
'plugin': false,
|
||||
'module': {'sources': sources, 'include_directories': top_inc, 'c_args': c_args}
|
||||
}}
|
||||
endif
|
||||
|
||||
# common icera support
|
||||
if enable_plugins_shared.contains('icera')
|
||||
icera_inc = include_directories('icera')
|
||||
|
||||
common_c_args = '-DMM_MODULE_NAME="shared-icera"'
|
||||
|
||||
sources = files(
|
||||
'icera/mm-broadband-bearer-icera.c',
|
||||
'icera/mm-broadband-modem-icera.c',
|
||||
'icera/mm-shared.c',
|
||||
)
|
||||
|
||||
plugins += {'shared-icera': {
|
||||
'plugin': false,
|
||||
'helper': {'sources': files('icera/mm-modem-helpers-icera.c'), 'c_args': common_c_args},
|
||||
'module': {'sources': sources + daemon_enums_sources, 'include_directories': top_inc, 'c_args': common_c_args},
|
||||
'test': {'sources': files('icera/tests/test-modem-helpers-icera.c'), 'include_directories': icera_inc, 'dependencies': libhelpers_dep},
|
||||
}}
|
||||
endif
|
||||
|
||||
# common novatel support
|
||||
if enable_plugins_shared.contains('novatel')
|
||||
novatel_inc = include_directories('novatel')
|
||||
|
||||
sources = files(
|
||||
'novatel/mm-broadband-modem-novatel.c',
|
||||
'novatel/mm-common-novatel.c',
|
||||
'novatel/mm-shared.c',
|
||||
)
|
||||
|
||||
plugins += {'shared-novatel': {
|
||||
'plugin': false,
|
||||
'module': {'sources': sources, 'include_directories': top_inc, 'c_args': '-DMM_MODULE_NAME="shared-novatel"'}
|
||||
}}
|
||||
endif
|
||||
|
||||
# common option support
|
||||
if enable_plugins_shared.contains('option')
|
||||
sources = files(
|
||||
'option/mm-broadband-modem-option.c',
|
||||
'option/mm-shared.c',
|
||||
'option/mm-shared-option.c',
|
||||
'option/mm-sim-option.c',
|
||||
)
|
||||
|
||||
plugins += {'shared-option': {
|
||||
'plugin': false,
|
||||
'module': {'sources': sources, 'include_directories': top_inc}
|
||||
}}
|
||||
endif
|
||||
|
||||
# common sierra support
|
||||
if enable_plugins_shared.contains('sierra')
|
||||
sierra_inc = include_directories('sierra')
|
||||
|
||||
common_c_args = '-DMM_MODULE_NAME="shared-sierra"'
|
||||
|
||||
sources = files(
|
||||
'sierra/mm-broadband-bearer-sierra.c',
|
||||
'sierra/mm-broadband-modem-sierra.c',
|
||||
'sierra/mm-common-sierra.c',
|
||||
'sierra/mm-shared.c',
|
||||
'sierra/mm-sim-sierra.c',
|
||||
)
|
||||
|
||||
plugins += {'shared-sierra': {
|
||||
'plugin': false,
|
||||
'helper': {'sources': files('sierra/mm-modem-helpers-sierra.c'), 'c_args': common_c_args},
|
||||
'module': {'sources': sources, 'include_directories': top_inc, 'c_args': common_c_args},
|
||||
'test': {'sources': files('sierra/tests/test-modem-helpers-sierra.c'), 'include_directories': sierra_inc, 'dependencies': libhelpers_dep},
|
||||
}}
|
||||
endif
|
||||
|
||||
# common telit support
|
||||
if enable_plugins_shared.contains('telit')
|
||||
telit_inc = include_directories('telit')
|
||||
|
||||
common_c_args = '-DMM_MODULE_NAME="shared-telit"'
|
||||
|
||||
headers = files('telit/mm-modem-helpers-telit.h')
|
||||
|
||||
sources = files(
|
||||
'telit/mm-broadband-modem-telit.c',
|
||||
'telit/mm-common-telit.c',
|
||||
'telit/mm-shared.c',
|
||||
'telit/mm-shared-telit.c',
|
||||
)
|
||||
|
||||
enums_types = 'mm-telit-enums-types'
|
||||
|
||||
sources += gnome.mkenums(
|
||||
enums_types + '.c',
|
||||
sources: headers,
|
||||
c_template: build_aux_dir / enums_types + '.c.template',
|
||||
fhead: '#include "mm-telit-enums-types.h"',
|
||||
)
|
||||
|
||||
sources += gnome.mkenums(
|
||||
enums_types + '.h',
|
||||
sources: headers,
|
||||
h_template: build_aux_dir / enums_types + '.h.template',
|
||||
fhead: '#include "mm-modem-helpers-telit.h"\n#ifndef __MM_TELIT_ENUMS_TYPES_H__\n#define __MM_TELIT_ENUMS_TYPES_H__\n',
|
||||
ftail: '#endif /* __MM_TELIT_ENUMS_TYPES_H__ */\n',
|
||||
)
|
||||
|
||||
if enable_mbim
|
||||
sources += files('telit/mm-broadband-modem-mbim-telit.c')
|
||||
endif
|
||||
|
||||
plugins += {'shared-telit': {
|
||||
'plugin': false,
|
||||
'helper': {'sources': files('telit/mm-modem-helpers-telit.c'), 'include_directories': top_inc, 'c_args': common_c_args},
|
||||
'module': {'sources': sources, 'include_directories': [top_inc, telit_inc], 'c_args': common_c_args},
|
||||
'test': {'sources': files('telit/tests/test-mm-modem-helpers-telit.c'), 'include_directories': telit_inc, 'dependencies': libmm_test_common_dep},
|
||||
}}
|
||||
endif
|
||||
|
||||
# common xmm support
|
||||
if enable_plugins_shared.contains('xmm')
|
||||
xmm_inc = include_directories('xmm')
|
||||
|
||||
common_c_args = '-DMM_MODULE_NAME="shared-xmm"'
|
||||
|
||||
sources = files(
|
||||
'xmm/mm-broadband-modem-xmm.c',
|
||||
'xmm/mm-shared.c',
|
||||
'xmm/mm-shared-xmm.c',
|
||||
)
|
||||
|
||||
if enable_mbim
|
||||
sources += files('xmm/mm-broadband-modem-mbim-xmm.c')
|
||||
endif
|
||||
|
||||
plugins += {'shared-xmm': {
|
||||
'plugin': false,
|
||||
'helper': {'sources': files('xmm/mm-modem-helpers-xmm.c'), 'include_directories': top_inc, 'c_args': common_c_args},
|
||||
'module': {'sources': sources, 'include_directories': top_inc, 'c_args': common_c_args},
|
||||
'test': {'sources': files('xmm/tests/test-modem-helpers-xmm.c'), 'include_directories': xmm_inc, 'dependencies': libhelpers_dep},
|
||||
}}
|
||||
endif
|
||||
|
||||
# plugin: altair lte
|
||||
if enable_plugins.contains('altair-lte')
|
||||
common_c_args = '-DMM_MODULE_NAME="altair-lte"'
|
||||
|
||||
sources = files(
|
||||
'altair/mm-broadband-bearer-altair-lte.c',
|
||||
'altair/mm-broadband-modem-altair-lte.c',
|
||||
'altair/mm-plugin-altair-lte.c',
|
||||
)
|
||||
|
||||
plugins += {'plugin-altair-lte': {
|
||||
'plugin': true,
|
||||
'helper': {'sources': files('altair/mm-modem-helpers-altair-lte.c'), 'c_args': common_c_args},
|
||||
'module': {'sources': sources, 'include_directories': top_inc, 'c_args': common_c_args},
|
||||
'test': {'sources': files('altair/tests/test-modem-helpers-altair-lte.c'), 'include_directories': include_directories('altair'), 'dependencies': libhelpers_dep},
|
||||
}}
|
||||
endif
|
||||
|
||||
# plugin: anydata
|
||||
if enable_plugins.contains('anydata')
|
||||
sources = files(
|
||||
'anydata/mm-broadband-modem-anydata.c',
|
||||
'anydata/mm-plugin-anydata.c',
|
||||
)
|
||||
|
||||
plugins += {'plugin-anydata': {
|
||||
'plugin': true,
|
||||
'module': {'sources': sources, 'include_directories': top_inc, 'c_args': '-DMM_MODULE_NAME="anydata"'}
|
||||
}}
|
||||
endif
|
||||
|
||||
# plugin: broadmobi
|
||||
if enable_plugins.contains('broadmobi')
|
||||
c_args = [
|
||||
'-DMM_MODULE_NAME="broadmobi"',
|
||||
'-DTESTUDEVRULESDIR_BROADMOBI="@0@"'.format(plugins_dir / 'broadmobi'),
|
||||
]
|
||||
|
||||
plugins += {'plugin-broadmobi': {
|
||||
'plugin': true,
|
||||
'module': {'sources': files('broadmobi/mm-plugin-broadmobi.c'), 'include_directories': top_inc, 'c_args': c_args}
|
||||
}}
|
||||
|
||||
plugins_udev_rules += files('broadmobi/77-mm-broadmobi-port-types.rules')
|
||||
endif
|
||||
|
||||
# plugin: cinterion (previously siemens)
|
||||
if enable_plugins.contains('cinterion')
|
||||
common_c_args = [
|
||||
'-DMM_MODULE_NAME="cinterion"',
|
||||
'-DTESTUDEVRULESDIR_CINTERION="@0@"'.format(plugins_dir / 'cinterion'),
|
||||
]
|
||||
|
||||
sources = files(
|
||||
'cinterion/mm-broadband-bearer-cinterion.c',
|
||||
'cinterion/mm-broadband-modem-cinterion.c',
|
||||
'cinterion/mm-plugin-cinterion.c',
|
||||
'cinterion/mm-shared-cinterion.c',
|
||||
)
|
||||
|
||||
if enable_qmi
|
||||
sources += files('cinterion/mm-broadband-modem-qmi-cinterion.c')
|
||||
endif
|
||||
|
||||
if enable_mbim
|
||||
sources += files('cinterion/mm-broadband-modem-mbim-cinterion.c')
|
||||
endif
|
||||
|
||||
plugins += {'plugin-cinterion': {
|
||||
'plugin': true,
|
||||
'helper': {'sources': files('cinterion/mm-modem-helpers-cinterion.c'), 'include_directories': top_inc, 'c_args': common_c_args},
|
||||
'module': {'sources': sources + daemon_enums_sources, 'include_directories': top_inc, 'c_args': common_c_args},
|
||||
'test': {'sources': files('cinterion/tests/test-modem-helpers-cinterion.c'), 'include_directories': [top_inc, include_directories('cinterion')], 'dependencies': libport_dep},
|
||||
}}
|
||||
|
||||
plugins_udev_rules += files('cinterion/77-mm-cinterion-port-types.rules')
|
||||
endif
|
||||
|
||||
# plugin: dell
|
||||
if enable_plugins.contains('dell')
|
||||
incs = [
|
||||
top_inc,
|
||||
foxconn_inc,
|
||||
novatel_inc,
|
||||
sierra_inc,
|
||||
telit_inc,
|
||||
xmm_inc,
|
||||
]
|
||||
|
||||
c_args = [
|
||||
'-DMM_MODULE_NAME="dell"',
|
||||
'-DTESTUDEVRULESDIR_DELL="@0@"'.format(plugins_dir / 'dell'),
|
||||
]
|
||||
|
||||
plugins += {'plugin-dell': {
|
||||
'plugin': true,
|
||||
'module': {'sources': files('dell/mm-plugin-dell.c'), 'include_directories': incs, 'c_args': c_args}
|
||||
}}
|
||||
|
||||
plugins_udev_rules += files('dell/77-mm-dell-port-types.rules')
|
||||
endif
|
||||
|
||||
# plugin: dlink
|
||||
if enable_plugins.contains('dlink')
|
||||
c_args = [
|
||||
'-DMM_MODULE_NAME="d-link"',
|
||||
'-DTESTUDEVRULESDIR_DLINK="@0@"'.format(plugins_dir / 'dlink'),
|
||||
]
|
||||
|
||||
plugins += {'plugin-dlink': {
|
||||
'plugin': true,
|
||||
'module': {'sources': files('dlink/mm-plugin-dlink.c'), 'include_directories': top_inc, 'c_args': c_args}
|
||||
}}
|
||||
|
||||
plugins_udev_rules += files('dlink/77-mm-dlink-port-types.rules')
|
||||
endif
|
||||
|
||||
# plugin: fibocom
|
||||
if enable_plugins.contains('fibocom')
|
||||
incs = [
|
||||
top_inc,
|
||||
xmm_inc,
|
||||
]
|
||||
|
||||
c_args = [
|
||||
'-DMM_MODULE_NAME="fibocom"',
|
||||
'-DTESTUDEVRULESDIR_FIBOCOM="@0@"'.format(plugins_dir / 'fibocom'),
|
||||
]
|
||||
|
||||
plugins += {'plugin-fibocom': {
|
||||
'plugin': true,
|
||||
'module': {'sources': files('fibocom/mm-plugin-fibocom.c'), 'include_directories': incs, 'c_args': c_args}
|
||||
}}
|
||||
|
||||
plugins_udev_rules += files('fibocom/77-mm-fibocom-port-types.rules')
|
||||
endif
|
||||
|
||||
# plugin: foxconn
|
||||
if enable_plugins.contains('foxconn')
|
||||
foxconn_dir = plugins_dir / 'foxconn'
|
||||
|
||||
c_args = [
|
||||
'-DMM_MODULE_NAME="foxconn"',
|
||||
'-DTESTUDEVRULESDIR_FOXCONN="@0@"'.format(foxconn_dir),
|
||||
'-DTESTKEYFILE_FOXCONN_T77W968="@0@"'.format(foxconn_dir / 'mm-foxconn-t77w968-carrier-mapping.conf'),
|
||||
'-DTESTKEYFILE_FOXCONN_T99W175="@0@"'.format(foxconn_dir / 'mm-foxconn-t99w175-carrier-mapping.conf'),
|
||||
]
|
||||
|
||||
plugins += {'plugin-foxconn': {
|
||||
'plugin': true,
|
||||
'module': {'sources': files('foxconn/mm-plugin-foxconn.c'), 'include_directories': top_inc, 'c_args': c_args}
|
||||
}}
|
||||
|
||||
plugins_data += files(
|
||||
'foxconn/mm-foxconn-t77w968-carrier-mapping.conf',
|
||||
'foxconn/mm-foxconn-t99w175-carrier-mapping.conf',
|
||||
)
|
||||
plugins_udev_rules += files('foxconn/77-mm-foxconn-port-types.rules')
|
||||
endif
|
||||
|
||||
# plugin: generic
|
||||
if enable_plugins.contains('generic')
|
||||
# FIXME
|
||||
'''
|
||||
15/16 test-service-generic FAIL 0.02s killed by signal 5 SIGTRAP
|
||||
>>> MALLOC_PERTURB_=124 /ModemManager/_build/plugins/test-service-generic
|
||||
―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― ✀ ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――
|
||||
stdout:
|
||||
# random seed: R02S5d0d577043f61f2806f319a6510e83a4
|
||||
1..1
|
||||
# Start of MM tests
|
||||
# Start of Service tests
|
||||
# Start of Generic tests
|
||||
Bail out! FATAL-ERROR: Error starting ModemManager in test bus: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.ModemManager1 was not provided by any .service files
|
||||
stderr:
|
||||
|
||||
** (/ModemManager/_build/plugins/test-service-generic:36444): ERROR **: 21:06:16.248: Error starting ModemManager in test bus: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.ModemManager1 was not provided by any .service files
|
||||
cleaning up pid 36446
|
||||
'''
|
||||
|
||||
plugins += {'plugin-generic': {
|
||||
'plugin': true,
|
||||
'module': {'sources': files('generic/mm-plugin-generic.c'), 'include_directories': top_inc, 'c_args': '-DMM_MODULE_NAME="generic"'},
|
||||
'test': {'sources': files('generic/tests/test-service-generic.c'), 'include_directories': include_directories('generic'), 'dependencies': libmm_test_common_dep, 'c_args': '-DCOMMON_GSM_PORT_CONF="@0@"'.format(plugins_dir / 'tests/gsm-port.conf')},
|
||||
}}
|
||||
endif
|
||||
|
||||
# plugin: gosuncn
|
||||
if enable_plugins.contains('gosuncn')
|
||||
c_args = [
|
||||
'-DMM_MODULE_NAME="gosuncn"',
|
||||
'-DTESTUDEVRULESDIR_GOSUNCN="@0@"'.format(plugins_dir / 'gosuncn'),
|
||||
]
|
||||
|
||||
plugins += {'plugin-gosuncn': {
|
||||
'plugin': true,
|
||||
'module': {'sources': files('gosuncn/mm-plugin-gosuncn.c'), 'include_directories': top_inc, 'c_args': c_args}
|
||||
}}
|
||||
|
||||
plugins_udev_rules += files('gosuncn/77-mm-gosuncn-port-types.rules')
|
||||
endif
|
||||
|
||||
# plugin: haier
|
||||
if enable_plugins.contains('haier')
|
||||
c_args = [
|
||||
'-DMM_MODULE_NAME="haier"',
|
||||
'-DTESTUDEVRULESDIR_HAIER="@0@"'.format(plugins_dir / 'haier'),
|
||||
]
|
||||
|
||||
plugins += {'plugin-haier': {
|
||||
'plugin': true,
|
||||
'module': {'sources': files('haier/mm-plugin-haier.c'), 'include_directories': top_inc, 'c_args': c_args}
|
||||
}}
|
||||
|
||||
plugins_udev_rules += files('haier/77-mm-haier-port-types.rules')
|
||||
endif
|
||||
|
||||
# plugin: huawei
|
||||
if enable_plugins.contains('huawei')
|
||||
huawei_inc = include_directories('huawei')
|
||||
|
||||
common_c_args = ['-DTESTUDEVRULESDIR_HUAWEI="@0@"'.format(plugins_dir / 'huawei')]
|
||||
|
||||
headers = files('huawei/mm-modem-helpers-huawei.h')
|
||||
|
||||
sources = files(
|
||||
'huawei/mm-broadband-bearer-huawei.c',
|
||||
'huawei/mm-broadband-modem-huawei.c',
|
||||
'huawei/mm-plugin-huawei.c',
|
||||
'huawei/mm-sim-huawei.c',
|
||||
)
|
||||
|
||||
enums_types = 'mm-huawei-enums-types'
|
||||
|
||||
enums_sources = []
|
||||
enums_sources += gnome.mkenums(
|
||||
enums_types + '.c',
|
||||
sources: headers,
|
||||
c_template: build_aux_dir / enums_types + '.c.template',
|
||||
fhead: '#include "mm-huawei-enums-types.h"',
|
||||
)
|
||||
|
||||
enums_sources += gnome.mkenums(
|
||||
enums_types + '.h',
|
||||
sources: headers,
|
||||
h_template: build_aux_dir / enums_types + '.h.template',
|
||||
fhead: '#include "mm-modem-helpers-huawei.h"\n#ifndef __MM_HUAWEI_ENUMS_TYPES_H__\n#define __MM_HUAWEI_ENUMS_TYPES_H__\n',
|
||||
ftail: '#endif /* __MM_HUAWEI_ENUMS_TYPES_H__ */\n',
|
||||
)
|
||||
|
||||
plugins += {'plugin-huawei': {
|
||||
'plugin': true,
|
||||
'helper': {'sources': files('huawei/mm-modem-helpers-huawei.c'), 'include_directories': huawei_inc, 'c_args': common_c_args + ['-DMM_MODULE_NAME="huawei"']},
|
||||
'module': {'sources': sources + enums_sources + daemon_enums_sources, 'include_directories': [top_inc, huawei_inc], 'c_args': common_c_args + ['-DMM_MODULE_NAME="huawei"']},
|
||||
'test': {'sources': files('huawei/tests/test-modem-helpers-huawei.c') + enums_sources, 'include_directories': huawei_inc, 'dependencies': libhelpers_dep},
|
||||
}}
|
||||
|
||||
plugins_udev_rules += files('huawei/77-mm-huawei-net-port-types.rules')
|
||||
endif
|
||||
|
||||
# plugin: iridium
|
||||
if enable_plugins.contains('iridium')
|
||||
sources = files(
|
||||
'iridium/mm-bearer-iridium.c',
|
||||
'iridium/mm-broadband-modem-iridium.c',
|
||||
'iridium/mm-plugin-iridium.c',
|
||||
'iridium/mm-sim-iridium.c',
|
||||
)
|
||||
|
||||
plugins += {'plugin-iridium': {
|
||||
'plugin': true,
|
||||
'module': {'sources': sources, 'include_directories': top_inc, 'c_args': '-DMM_MODULE_NAME="iridium"'}
|
||||
}}
|
||||
endif
|
||||
|
||||
# plugin: linktop
|
||||
if enable_plugins.contains('linktop')
|
||||
common_c_args = '-DMM_MODULE_NAME="linktop"'
|
||||
|
||||
sources = files(
|
||||
'linktop/mm-plugin-linktop.c',
|
||||
'linktop/mm-broadband-modem-linktop.c',
|
||||
)
|
||||
|
||||
plugins += {'plugin-linktop': {
|
||||
'plugin': true,
|
||||
'helper': {'sources': files('linktop/mm-modem-helpers-linktop.c'), 'c_args': common_c_args},
|
||||
'module': {'sources': sources, 'include_directories': top_inc, 'c_args': common_c_args},
|
||||
'test': {'sources': files('linktop/tests/test-modem-helpers-linktop.c'), 'include_directories': include_directories('linktop'), 'dependencies': libhelpers_dep},
|
||||
}}
|
||||
endif
|
||||
|
||||
# plugin: longcheer (and rebranded dongles)
|
||||
if enable_plugins.contains('longcheer')
|
||||
sources = files(
|
||||
'longcheer/mm-broadband-modem-longcheer.c',
|
||||
'longcheer/mm-plugin-longcheer.c',
|
||||
)
|
||||
|
||||
c_args = [
|
||||
'-DMM_MODULE_NAME="longcheer"',
|
||||
'-DTESTUDEVRULESDIR_LONGCHEER="@0@"'.format(plugins_dir / 'longcheer'),
|
||||
]
|
||||
|
||||
plugins += {'plugin-longcheer': {
|
||||
'plugin': true,
|
||||
'module': {'sources': sources, 'include_directories': top_inc, 'c_args': c_args}
|
||||
}}
|
||||
|
||||
plugins_udev_rules += files('longcheer/77-mm-longcheer-port-types.rules')
|
||||
endif
|
||||
|
||||
# plugin: ericsson mbm
|
||||
if enable_plugins.contains('mbm')
|
||||
common_c_args = ['-DTESTUDEVRULESDIR_MBM="@0@"'.format(plugins_dir / 'mbm')]
|
||||
|
||||
sources = files(
|
||||
'mbm/mm-broadband-bearer-mbm.c',
|
||||
'mbm/mm-broadband-modem-mbm.c',
|
||||
'mbm/mm-plugin-mbm.c',
|
||||
'mbm/mm-sim-mbm.c',
|
||||
)
|
||||
|
||||
plugins += {'plugin-ericsson-mbm': {
|
||||
'plugin': true,
|
||||
'helper': {'sources': files('mbm/mm-modem-helpers-mbm.c'), 'c_args': common_c_args + ['-DMM_MODULE_NAME="ericsson-mbm"']},
|
||||
'module': {'sources': sources + daemon_enums_sources, 'include_directories': top_inc, 'c_args': common_c_args + ['-DMM_MODULE_NAME="ericsson-mbm"']},
|
||||
'test': {'sources': files('mbm/tests/test-modem-helpers-mbm.c'), 'include_directories': include_directories('mbm'), 'dependencies': libhelpers_dep},
|
||||
}}
|
||||
|
||||
plugins_udev_rules += files('mbm/77-mm-ericsson-mbm.rules')
|
||||
endif
|
||||
|
||||
# plugin: motorola
|
||||
if enable_plugins.contains('motorola')
|
||||
sources = files(
|
||||
'motorola/mm-broadband-modem-motorola.c',
|
||||
'motorola/mm-plugin-motorola.c',
|
||||
)
|
||||
|
||||
plugins += {'plugin-motorola': {
|
||||
'plugin': true,
|
||||
'module': {'sources': sources, 'include_directories': top_inc, 'c_args': '-DMM_MODULE_NAME="motorola"'}
|
||||
}}
|
||||
endif
|
||||
|
||||
# plugin: mtk
|
||||
if enable_plugins.contains('mtk')
|
||||
sources = files(
|
||||
'mtk/mm-broadband-modem-mtk.c',
|
||||
'mtk/mm-plugin-mtk.c',
|
||||
)
|
||||
|
||||
c_args = [
|
||||
'-DMM_MODULE_NAME="motorola"',
|
||||
'-DTESTUDEVRULESDIR_MTK="@0@"'.format(plugins_dir / 'mtk'),
|
||||
]
|
||||
|
||||
plugins += {'plugin-mtk': {
|
||||
'plugin': true,
|
||||
'module': {'sources': sources, 'include_directories': top_inc, 'c_args': c_args}
|
||||
}}
|
||||
|
||||
plugins_udev_rules += files('mtk/77-mm-mtk-port-types.rules')
|
||||
endif
|
||||
|
||||
# plugin: nokia
|
||||
if enable_plugins.contains('nokia')
|
||||
sources = files(
|
||||
'nokia/mm-broadband-modem-nokia.c',
|
||||
'nokia/mm-plugin-nokia.c',
|
||||
'nokia/mm-sim-nokia.c',
|
||||
)
|
||||
|
||||
plugins += {'plugin-nokia': {
|
||||
'plugin': true,
|
||||
'module': {'sources': sources, 'include_directories': top_inc, 'c_args': '-DMM_MODULE_NAME="nokia"'}
|
||||
}}
|
||||
endif
|
||||
|
||||
# plugin: nokia (icera)
|
||||
if enable_plugins.contains('nokia-icera')
|
||||
c_args = [
|
||||
'-DMM_MODULE_NAME="nokia-icera"',
|
||||
'-DTESTUDEVRULESDIR_NOKIA_ICERA="@0@"'.format(plugins_dir / 'nokia'),
|
||||
]
|
||||
|
||||
plugins += {'plugin-nokia-icera': {
|
||||
'plugin': true,
|
||||
'module': {'sources': files('nokia/mm-plugin-nokia-icera.c'), 'include_directories': [top_inc, icera_inc], 'c_args': c_args}
|
||||
}}
|
||||
|
||||
plugins_udev_rules += files('nokia/77-mm-nokia-port-types.rules')
|
||||
endif
|
||||
|
||||
# plugin: novatel non-lte
|
||||
if enable_plugins.contains('novatel')
|
||||
plugins += {'plugin-novatel': {
|
||||
'plugin': true,
|
||||
'module': {'sources': files('novatel/mm-plugin-novatel.c'), 'include_directories': top_inc, 'c_args': '-DMM_MODULE_NAME="novatel"'}
|
||||
}}
|
||||
endif
|
||||
|
||||
# plugin: novatel lte
|
||||
if enable_plugins.contains('novatel-lte')
|
||||
sources = files(
|
||||
'novatel/mm-plugin-novatel-lte.c',
|
||||
'novatel/mm-broadband-modem-novatel-lte.c',
|
||||
'novatel/mm-broadband-bearer-novatel-lte.c',
|
||||
'novatel/mm-sim-novatel-lte.c',
|
||||
)
|
||||
|
||||
plugins += {'plugin-novatel-lte': {
|
||||
'plugin': true,
|
||||
'module': {'sources': sources, 'include_directories': top_inc, 'c_args': '-DMM_MODULE_NAME="novatel-lte"'}
|
||||
}}
|
||||
endif
|
||||
|
||||
# plugin: option
|
||||
if enable_plugins.contains('option')
|
||||
plugins += {'plugin-option': {
|
||||
'plugin': true,
|
||||
'module': {'sources': files('option/mm-plugin-option.c'), 'include_directories': top_inc, 'c_args': '-DMM_MODULE_NAME="option"'}
|
||||
}}
|
||||
endif
|
||||
|
||||
# plugin: option hso
|
||||
if enable_plugins.contains('option-hso')
|
||||
sources = files(
|
||||
'option/mm-plugin-hso.c',
|
||||
'option/mm-broadband-bearer-hso.c',
|
||||
'option/mm-broadband-modem-hso.c',
|
||||
)
|
||||
|
||||
plugins += {'plugin-option-hso': {
|
||||
'plugin': true,
|
||||
'module': {'sources': sources + daemon_enums_sources, 'include_directories': top_inc, 'c_args': '-DMM_MODULE_NAME="option-hso"'}
|
||||
}}
|
||||
endif
|
||||
|
||||
# plugin: pantech
|
||||
if enable_plugins.contains('pantech')
|
||||
sources = files(
|
||||
'pantech/mm-broadband-modem-pantech.c',
|
||||
'pantech/mm-plugin-pantech.c',
|
||||
'pantech/mm-sim-pantech.c',
|
||||
)
|
||||
|
||||
plugins += {'plugin-pantech': {
|
||||
'plugin': true,
|
||||
'module': {'sources': sources, 'include_directories': top_inc, 'c_args': '-DMM_MODULE_NAME="pantech"'}
|
||||
}}
|
||||
endif
|
||||
|
||||
# plugin: qcom-soc
|
||||
if enable_plugins.contains('qcom-soc')
|
||||
sources = files(
|
||||
'qcom-soc/mm-broadband-modem-qmi-qcom-soc.c',
|
||||
'qcom-soc/mm-plugin-qcom-soc.c',
|
||||
)
|
||||
|
||||
c_args = [
|
||||
'-DMM_MODULE_NAME="qcom-soc"',
|
||||
'-DTESTUDEVRULESDIR_QCOM_SOC="@0@"'.format(plugins_dir / 'qcom-soc'),
|
||||
]
|
||||
|
||||
plugins += {'plugin-qcom-soc': {
|
||||
'plugin': true,
|
||||
'module': {'sources': sources, 'include_directories': top_inc, 'c_args': c_args}
|
||||
}}
|
||||
|
||||
plugins_udev_rules += files('qcom-soc/77-mm-qcom-soc.rules')
|
||||
endif
|
||||
|
||||
# plugin: quectel
|
||||
if enable_plugins.contains('quectel')
|
||||
common_c_args = ['-DTESTUDEVRULESDIR_QUECTEL="@0@"'.format(plugins_dir / 'quectel')]
|
||||
|
||||
sources = files(
|
||||
'quectel/mm-broadband-modem-quectel.c',
|
||||
'quectel/mm-plugin-quectel.c',
|
||||
'quectel/mm-shared-quectel.c',
|
||||
)
|
||||
|
||||
if enable_qmi
|
||||
sources += files('quectel/mm-broadband-modem-qmi-quectel.c')
|
||||
endif
|
||||
|
||||
if enable_mbim
|
||||
sources += files('quectel/mm-broadband-modem-mbim-quectel.c')
|
||||
endif
|
||||
|
||||
plugins += {'plugin-quectel': {
|
||||
'plugin': true,
|
||||
'helper': {'sources': files('quectel/mm-modem-helpers-quectel.c'), 'c_args': common_c_args + ['-DMM_MODULE_NAME="quectel"']},
|
||||
'module': {'sources': sources, 'include_directories': top_inc, 'c_args': common_c_args + ['-DMM_MODULE_NAME="quectel"']},
|
||||
'test': {'sources': files('quectel/tests/test-modem-helpers-quectel.c'), 'include_directories': include_directories('quectel'), 'dependencies': libhelpers_dep},
|
||||
}}
|
||||
|
||||
plugins_udev_rules += files('quectel/77-mm-quectel-port-types.rules')
|
||||
endif
|
||||
|
||||
# plugin: samsung
|
||||
if enable_plugins.contains('samsung')
|
||||
sources = files(
|
||||
'samsung/mm-broadband-modem-samsung.c',
|
||||
'samsung/mm-plugin-samsung.c',
|
||||
)
|
||||
|
||||
plugins += {'plugin-samsung': {
|
||||
'plugin': true,
|
||||
'module': {'sources': sources, 'include_directories': [top_inc, icera_inc], 'c_args': '-DMM_MODULE_NAME="samsung"'}
|
||||
}}
|
||||
endif
|
||||
|
||||
# plugin: sierra (legacy)
|
||||
if enable_plugins.contains('sierra-legacy')
|
||||
sources = files(
|
||||
'sierra/mm-broadband-modem-sierra-icera.c',
|
||||
'sierra/mm-plugin-sierra-legacy.c',
|
||||
)
|
||||
|
||||
plugins += {'plugin-sierra-legacy': {
|
||||
'plugin': true,
|
||||
'module': {'sources': sources, 'include_directories': [top_inc, icera_inc], 'c_args': '-DMM_MODULE_NAME="sierra-legacy"'}
|
||||
}}
|
||||
endif
|
||||
|
||||
# plugin: sierra (new QMI or MBIM modems)
|
||||
if enable_plugins.contains('sierra')
|
||||
plugins += {'plugin-sierra': {
|
||||
'plugin': true,
|
||||
'module': {'sources': files('sierra/mm-plugin-sierra.c'), 'include_directories': [top_inc, xmm_inc], 'c_args': '-DMM_MODULE_NAME="sierra"'}
|
||||
}}
|
||||
|
||||
plugins_udev_rules += files('sierra/77-mm-sierra.rules')
|
||||
endif
|
||||
|
||||
# plugin: simtech
|
||||
if enable_plugins.contains('simtech')
|
||||
common_c_args = ['-DTESTUDEVRULESDIR_SIMTECH="@0@"'.format(plugins_dir / 'simtech')]
|
||||
|
||||
sources = files(
|
||||
'simtech/mm-broadband-modem-simtech.c',
|
||||
'simtech/mm-plugin-simtech.c',
|
||||
'simtech/mm-shared-simtech.c',
|
||||
)
|
||||
|
||||
if enable_qmi
|
||||
sources += files('simtech/mm-broadband-modem-qmi-simtech.c')
|
||||
endif
|
||||
|
||||
plugins += {'plugin-simtech': {
|
||||
'plugin': true,
|
||||
'helper': {'sources': files('simtech/mm-modem-helpers-simtech.c'), 'include_directories': top_inc, 'c_args': common_c_args + ['-DMM_MODULE_NAME="simtech"']},
|
||||
'module': {'sources': sources, 'include_directories': top_inc, 'c_args': common_c_args + ['-DMM_MODULE_NAME="quectel"']},
|
||||
'test': {'sources': files('simtech/tests/test-modem-helpers-simtech.c'), 'include_directories': [top_inc, include_directories('simtech')], 'dependencies': libport_dep},
|
||||
}}
|
||||
|
||||
plugins_udev_rules += files('simtech/77-mm-simtech-port-types.rules')
|
||||
endif
|
||||
|
||||
# plugin: telit
|
||||
if enable_plugins.contains('telit')
|
||||
c_args = [
|
||||
'-DMM_MODULE_NAME="telit"',
|
||||
'-DTESTUDEVRULESDIR_TELIT="@0@"'.format(plugins_dir / 'telit'),
|
||||
]
|
||||
|
||||
plugins += {'plugin-telit': {
|
||||
'plugin': true,
|
||||
'module': {'sources': files('telit/mm-plugin-telit.c'), 'include_directories': top_inc, 'c_args': c_args}
|
||||
}}
|
||||
|
||||
plugins_udev_rules += files('telit/77-mm-telit-port-types.rules')
|
||||
endif
|
||||
|
||||
# plugin: thuraya xt
|
||||
if enable_plugins.contains('thuraya')
|
||||
common_c_args = ['-DMM_MODULE_NAME="thuraya"']
|
||||
|
||||
sources = files(
|
||||
'thuraya/mm-broadband-modem-thuraya.c',
|
||||
'thuraya/mm-plugin-thuraya.c',
|
||||
)
|
||||
|
||||
plugins += {'plugin-thuraya': {
|
||||
'plugin': true,
|
||||
'helper': {'sources': files('thuraya/mm-modem-helpers-thuraya.c'), 'c_args': common_c_args},
|
||||
'module': {'sources': sources, 'include_directories': top_inc, 'c_args': common_c_args},
|
||||
'test': {'sources': files('thuraya/tests/test-mm-modem-helpers-thuraya.c'), 'include_directories': include_directories('thuraya'), 'dependencies': libhelpers_dep},
|
||||
}}
|
||||
|
||||
plugins_udev_rules += files('simtech/77-mm-simtech-port-types.rules')
|
||||
endif
|
||||
|
||||
# plugin: tplink
|
||||
if enable_plugins.contains('tplink')
|
||||
c_args = [
|
||||
'-DMM_MODULE_NAME="tp-link"',
|
||||
'-DTESTUDEVRULESDIR_TPLINK="@0@"'.format(plugins_dir / 'tplink'),
|
||||
]
|
||||
|
||||
plugins += {'plugin-tplink': {
|
||||
'plugin': true,
|
||||
'module': {'sources': files('tplink/mm-plugin-tplink.c'), 'include_directories': top_inc, 'c_args': c_args}
|
||||
}}
|
||||
|
||||
plugins_udev_rules += files('tplink/77-mm-tplink-port-types.rules')
|
||||
endif
|
||||
|
||||
# plugin: u-blox
|
||||
if enable_plugins.contains('ublox')
|
||||
ublox_inc = include_directories('ublox')
|
||||
|
||||
common_c_args = '-DMM_MODULE_NAME="u-blox"'
|
||||
|
||||
headers = files('ublox/mm-modem-helpers-ublox.h')
|
||||
|
||||
sources = files(
|
||||
'ublox/mm-broadband-bearer-ublox.c',
|
||||
'ublox/mm-broadband-modem-ublox.c',
|
||||
'ublox/mm-plugin-ublox.c',
|
||||
'ublox/mm-sim-ublox.c',
|
||||
)
|
||||
|
||||
enums_types = 'mm-ublox-enums-types'
|
||||
|
||||
sources += gnome.mkenums(
|
||||
enums_types + '.c',
|
||||
sources: headers,
|
||||
c_template: build_aux_dir / enums_types + '.c.template',
|
||||
fhead: '#include "mm-ublox-enums-types.h"',
|
||||
)
|
||||
|
||||
sources += gnome.mkenums(
|
||||
enums_types + '.h',
|
||||
sources: headers,
|
||||
h_template: build_aux_dir / enums_types + '.h.template',
|
||||
fhead: '#include "mm-modem-helpers-ublox.h"\n#ifndef __MM_UBLOX_ENUMS_TYPES_H__\n#define __MM_UBLOX_ENUMS_TYPES_H__\n',
|
||||
ftail: '#endif /* __MM_UBLOX_ENUMS_TYPES_H__ */\n',
|
||||
)
|
||||
|
||||
plugins += {'plugin-ublox': {
|
||||
'plugin': true,
|
||||
'helper': {'sources': files('ublox/mm-modem-helpers-ublox.c'), 'c_args': common_c_args},
|
||||
'module': {'sources': sources, 'include_directories': [top_inc, ublox_inc], 'c_args': common_c_args},
|
||||
'test': {'sources': files('ublox/tests/test-modem-helpers-ublox.c'), 'include_directories': ublox_inc, 'dependencies': libmm_test_common_dep},
|
||||
}}
|
||||
|
||||
plugins_udev_rules += files('ublox/77-mm-ublox-port-types.rules')
|
||||
endif
|
||||
|
||||
# plugin: via
|
||||
if enable_plugins.contains('via')
|
||||
sources = files(
|
||||
'via/mm-broadband-modem-via.c',
|
||||
'via/mm-plugin-via.c',
|
||||
)
|
||||
|
||||
plugins += {'plugin-via': {
|
||||
'plugin': true,
|
||||
'module': {'sources': sources, 'include_directories': top_inc, 'c_args': '-DMM_MODULE_NAME="via"'}
|
||||
}}
|
||||
endif
|
||||
|
||||
# plugin: wavecom (now sierra airlink)
|
||||
if enable_plugins.contains('wavecom')
|
||||
sources = files(
|
||||
'wavecom/mm-broadband-modem-wavecom.c',
|
||||
'wavecom/mm-plugin-wavecom.c',
|
||||
)
|
||||
|
||||
plugins += {'plugin-wavecom': {
|
||||
'plugin': true,
|
||||
'module': {'sources': sources, 'include_directories': top_inc, 'c_args': '-DMM_MODULE_NAME="wavecom"'}
|
||||
}}
|
||||
endif
|
||||
|
||||
# plugin: alcatel/TCT/JRD x220D and possibly others
|
||||
if enable_plugins.contains('x22x')
|
||||
sources = files(
|
||||
'x22x/mm-broadband-modem-x22x.c',
|
||||
'x22x/mm-plugin-x22x.c',
|
||||
)
|
||||
|
||||
c_args = [
|
||||
'-DMM_MODULE_NAME="x22x"',
|
||||
'-DTESTUDEVRULESDIR_X22X="@0@"'.format(plugins_dir / 'x22x'),
|
||||
]
|
||||
|
||||
plugins += {'plugin-x22x': {
|
||||
'plugin': true,
|
||||
'module': {'sources': sources, 'include_directories': top_inc, 'c_args': c_args}
|
||||
}}
|
||||
|
||||
plugins_udev_rules += files('x22x/77-mm-x22x-port-types.rules')
|
||||
endif
|
||||
|
||||
# plugin: zte
|
||||
if enable_plugins.contains('zte')
|
||||
sources = files(
|
||||
'zte/mm-broadband-modem-zte.c',
|
||||
'zte/mm-broadband-modem-zte-icera.c',
|
||||
'zte/mm-common-zte.c',
|
||||
'zte/mm-plugin-zte.c',
|
||||
)
|
||||
|
||||
c_args = [
|
||||
'-DMM_MODULE_NAME="zte"',
|
||||
'-DTESTUDEVRULESDIR_ZTE="@0@"'.format(plugins_dir / 'zte'),
|
||||
]
|
||||
|
||||
plugins += {'plugin-zte': {
|
||||
'plugin': true,
|
||||
'module': {'sources': sources, 'include_directories': [top_inc, icera_inc], 'c_args': c_args}
|
||||
}}
|
||||
|
||||
plugins_udev_rules += files('zte/77-mm-zte-port-types.rules')
|
||||
endif
|
||||
|
||||
foreach plugin_name, plugin_data: plugins
|
||||
libhelpers = []
|
||||
if plugin_data.has_key('helper')
|
||||
libhelpers += [
|
||||
static_library(
|
||||
'helpers-' + plugin_name,
|
||||
dependencies: libport_dep,
|
||||
kwargs: plugin_data['helper'],
|
||||
)
|
||||
]
|
||||
endif
|
||||
|
||||
module_args = plugin_data['module']
|
||||
if plugin_data['plugin']
|
||||
module_args += {
|
||||
'link_args': ldflags,
|
||||
'link_depends': symbol_map,
|
||||
}
|
||||
endif
|
||||
|
||||
shared_module(
|
||||
'mm-' + plugin_name,
|
||||
dependencies: libhelpers_dep,
|
||||
link_with: libhelpers,
|
||||
kwargs: module_args,
|
||||
install: true,
|
||||
install_dir: mm_pkglibdir,
|
||||
)
|
||||
|
||||
if plugin_data.has_key('test')
|
||||
test_unit = 'test-' + plugin_name
|
||||
|
||||
exe = executable(
|
||||
test_unit,
|
||||
link_with: libhelpers,
|
||||
kwargs: plugin_data['test'],
|
||||
)
|
||||
|
||||
test(test_unit, exe)
|
||||
endif
|
||||
endforeach
|
||||
|
||||
install_data(
|
||||
plugins_data,
|
||||
install_dir: mm_pkgdatadir,
|
||||
)
|
||||
|
||||
install_data(
|
||||
plugins_udev_rules,
|
||||
install_dir: udev_rulesdir,
|
||||
)
|
||||
|
||||
# udev-rules and keyfiles tests
|
||||
test_units = {
|
||||
'udev-rules': {'include_directories': top_inc, 'dependencies': libkerneldevice_dep},
|
||||
'keyfiles': {'include_directories': [top_inc, src_inc], 'dependencies': libmm_glib_dep},
|
||||
}
|
||||
|
||||
foreach name, data: test_units
|
||||
test_name = 'test-' + name
|
||||
|
||||
exe = executable(
|
||||
test_name,
|
||||
sources: 'tests/@0@.c'.format(test_name),
|
||||
kwargs: data,
|
||||
)
|
||||
|
||||
test(test_name, exe)
|
||||
endforeach
|
8
plugins/symbol.map
Normal file
8
plugins/symbol.map
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
global:
|
||||
mm_plugin_major_version*;
|
||||
mm_plugin_minor_version*;
|
||||
mm_plugin_create*;
|
||||
local:
|
||||
*;
|
||||
};
|
4
po/meson.build
Normal file
4
po/meson.build
Normal file
@@ -0,0 +1,4 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
# Copyright (C) 2021 Iñigo Martinez <inigomartinez@gmail.com>
|
||||
|
||||
i18n.gettext(mm_name, preset: 'glib')
|
319
src/meson.build
Normal file
319
src/meson.build
Normal file
@@ -0,0 +1,319 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
# Copyright (C) 2021 Iñigo Martinez <inigomartinez@gmail.com>
|
||||
|
||||
# helpers library
|
||||
src_inc = include_directories('.')
|
||||
kerneldevice_inc = include_directories('kerneldevice')
|
||||
|
||||
headers = files(
|
||||
'mm-modem-helpers.h',
|
||||
'mm-sms-part.h',
|
||||
)
|
||||
|
||||
enums_types = 'mm-helper-enums-types'
|
||||
|
||||
enums_sources = []
|
||||
enums_sources += gnome.mkenums(
|
||||
enums_types + '.c',
|
||||
sources: headers,
|
||||
c_template: build_aux_dir / enums_types + '.c.template',
|
||||
fhead: '#include "mm-helper-enums-types.h"',
|
||||
)
|
||||
|
||||
enums_sources += gnome.mkenums(
|
||||
enums_types + '.h',
|
||||
sources: headers,
|
||||
h_template: build_aux_dir / enums_types + '.h.template',
|
||||
fhead: '#include "mm-sms-part.h"\n#include "mm-modem-helpers.h"\n#ifndef __MM_HELPER_ENUMS_TYPES_H__\n#define __MM_HELPER_ENUMS_TYPES_H__\n',
|
||||
ftail: '#endif /* __MM_HELPER_ENUMS_TYPES_H__ */\n',
|
||||
)
|
||||
|
||||
sources = files(
|
||||
'mm-charsets.c',
|
||||
'mm-error-helpers.c',
|
||||
'mm-log.c',
|
||||
'mm-log-object.c',
|
||||
'mm-modem-helpers.c',
|
||||
'mm-sms-part-3gpp.c',
|
||||
'mm-sms-part.c',
|
||||
'mm-sms-part-cdma.c',
|
||||
)
|
||||
|
||||
incs = [
|
||||
top_inc,
|
||||
# FIXME: only necessary if qmi is enabled?
|
||||
kerneldevice_inc,
|
||||
]
|
||||
|
||||
deps = [
|
||||
libmm_glib_dep,
|
||||
mbim_glib_dep,
|
||||
qmi_glib_dep,
|
||||
]
|
||||
|
||||
private_deps = []
|
||||
|
||||
if enable_qmi
|
||||
sources += files('mm-modem-helpers-qmi.c')
|
||||
endif
|
||||
|
||||
if enable_mbim
|
||||
sources += files('mm-modem-helpers-mbim.c')
|
||||
endif
|
||||
|
||||
if enable_systemd_journal
|
||||
private_deps += libsystemd_dep
|
||||
endif
|
||||
|
||||
libhelpers = static_library(
|
||||
'helpers',
|
||||
sources: sources + enums_sources,
|
||||
include_directories: incs,
|
||||
dependencies: deps + private_deps,
|
||||
)
|
||||
|
||||
libhelpers_dep = declare_dependency(
|
||||
sources: enums_sources[1],
|
||||
include_directories: ['.', kerneldevice_inc],
|
||||
dependencies: deps,
|
||||
link_with: libhelpers,
|
||||
)
|
||||
|
||||
# kerneldevice library
|
||||
sources = files(
|
||||
'kerneldevice/mm-kernel-device.c',
|
||||
'kerneldevice/mm-kernel-device-generic.c',
|
||||
'kerneldevice/mm-kernel-device-generic-rules.c',
|
||||
'kerneldevice/mm-kernel-device-helpers.c',
|
||||
)
|
||||
|
||||
deps = [
|
||||
gudev_dep,
|
||||
libhelpers_dep,
|
||||
qrtr_glib_dep,
|
||||
]
|
||||
|
||||
if enable_qrtr
|
||||
sources += files('kerneldevice/mm-kernel-device-qrtr.c')
|
||||
endif
|
||||
|
||||
if enable_udev
|
||||
sources += files('kerneldevice/mm-kernel-device-udev.c')
|
||||
endif
|
||||
|
||||
libkerneldevice = static_library(
|
||||
'kerneldevice',
|
||||
sources: sources,
|
||||
include_directories: top_inc,
|
||||
dependencies: deps,
|
||||
c_args: '-DUDEVRULESDIR="@0@"'.format(udev_rulesdir),
|
||||
)
|
||||
|
||||
libkerneldevice_dep = declare_dependency(
|
||||
dependencies: deps,
|
||||
link_with: libkerneldevice,
|
||||
)
|
||||
|
||||
# ports library
|
||||
headers = files(
|
||||
'mm-port.h',
|
||||
'mm-port-serial-at.h',
|
||||
)
|
||||
|
||||
sources = files(
|
||||
'mm-netlink.c',
|
||||
'mm-port.c',
|
||||
'mm-port-net.c',
|
||||
'mm-port-serial-at.c',
|
||||
'mm-port-serial.c',
|
||||
'mm-port-serial-gps.c',
|
||||
'mm-port-serial-qcdm.c',
|
||||
'mm-serial-parsers.c',
|
||||
)
|
||||
|
||||
deps = [libkerneldevice_dep]
|
||||
|
||||
private_deps = [gio_unix_dep]
|
||||
|
||||
if enable_qmi
|
||||
headers += files('mm-port-qmi.h')
|
||||
|
||||
sources += files('mm-port-qmi.c')
|
||||
endif
|
||||
|
||||
if enable_mbim
|
||||
sources += files('mm-port-mbim.c')
|
||||
endif
|
||||
|
||||
enums_types = 'mm-port-enums-types'
|
||||
|
||||
enums_sources = []
|
||||
enums_sources += gnome.mkenums(
|
||||
enums_types + '.c',
|
||||
sources: headers,
|
||||
c_template: build_aux_dir / enums_types + '.c.template',
|
||||
fhead: '#include "mm-port-enums-types.h"',
|
||||
)
|
||||
|
||||
enums_sources += gnome.mkenums(
|
||||
enums_types + '.h',
|
||||
sources: headers,
|
||||
h_template: build_aux_dir / enums_types + '.h.template',
|
||||
fhead: '#include "config.h"\n#include "mm-port.h"\n#include "mm-port-serial-at.h"\n#if defined WITH_QMI\n#include "mm-port-qmi.h"\n#endif\n#ifndef __MM_PORT_ENUMS_TYPES_H__\n#define __MM_PORT_ENUMS_TYPES_H__\n',
|
||||
ftail: '#endif /* __MM_PORT_ENUMS_TYPES_H__ */\n',
|
||||
)
|
||||
|
||||
libport = static_library(
|
||||
'port',
|
||||
sources: sources + enums_sources,
|
||||
include_directories: top_inc,
|
||||
dependencies: deps + private_deps,
|
||||
)
|
||||
|
||||
libport_dep = declare_dependency(
|
||||
sources: enums_sources[1],
|
||||
include_directories: '.',
|
||||
dependencies: deps,
|
||||
link_with: libport,
|
||||
)
|
||||
|
||||
# ModemManager daemon
|
||||
headers = files(
|
||||
'mm-base-bearer.h',
|
||||
'mm-filter.h',
|
||||
'mm-port-probe.h',
|
||||
)
|
||||
|
||||
enums_types = 'mm-daemon-enums-types'
|
||||
|
||||
daemon_enums_sources = []
|
||||
daemon_enums_sources += gnome.mkenums(
|
||||
enums_types + '.c',
|
||||
sources: headers,
|
||||
c_template: build_aux_dir / enums_types + '.c.template',
|
||||
fhead: '#include "mm-daemon-enums-types.h"',
|
||||
)
|
||||
|
||||
daemon_enums_sources += gnome.mkenums(
|
||||
enums_types + '.h',
|
||||
sources: headers,
|
||||
h_template: build_aux_dir / enums_types + '.h.template',
|
||||
fhead: '#include "mm-filter.h"\n#include "mm-base-bearer.h"\n#include "mm-port-probe.h"\n#ifndef __MM_DAEMON_ENUMS_TYPES_H__\n#define __MM_DAEMON_ENUMS_TYPES_H__\n',
|
||||
ftail: '#endif /* __MM_DAEMON_ENUMS_TYPES_H__ */\n',
|
||||
)
|
||||
|
||||
sources = files(
|
||||
'main.c',
|
||||
'mm-auth-provider.c',
|
||||
'mm-base-bearer.c',
|
||||
'mm-base-call.c',
|
||||
'mm-base-manager.c',
|
||||
'mm-base-modem-at.c',
|
||||
'mm-base-modem.c',
|
||||
'mm-base-sim.c',
|
||||
'mm-base-sms.c',
|
||||
'mm-bearer-list.c',
|
||||
'mm-broadband-bearer.c',
|
||||
'mm-broadband-modem.c',
|
||||
'mm-call-list.c',
|
||||
'mm-context.c',
|
||||
'mm-device.c',
|
||||
'mm-filter.c',
|
||||
'mm-iface-modem-3gpp.c',
|
||||
'mm-iface-modem-3gpp-profile-manager.c',
|
||||
'mm-iface-modem-3gpp-ussd.c',
|
||||
'mm-iface-modem.c',
|
||||
'mm-iface-modem-cdma.c',
|
||||
'mm-iface-modem-firmware.c',
|
||||
'mm-iface-modem-location.c',
|
||||
'mm-iface-modem-messaging.c',
|
||||
'mm-iface-modem-oma.c',
|
||||
'mm-iface-modem-signal.c',
|
||||
'mm-iface-modem-simple.c',
|
||||
'mm-iface-modem-time.c',
|
||||
'mm-iface-modem-voice.c',
|
||||
'mm-plugin.c',
|
||||
'mm-plugin-manager.c',
|
||||
'mm-port-probe.c',
|
||||
'mm-port-probe-at.c',
|
||||
'mm-private-boxed-types.c',
|
||||
'mm-sms-list.c',
|
||||
)
|
||||
|
||||
deps = [
|
||||
gmodule_dep,
|
||||
libmm_test_generated_dep,
|
||||
libport_dep,
|
||||
libqcdm_dep,
|
||||
]
|
||||
|
||||
c_args = [
|
||||
'-DMM_COMPILATION',
|
||||
'-DPLUGINDIR="@0@"'.format(mm_pkglibdir),
|
||||
]
|
||||
|
||||
if enable_qrtr
|
||||
sources += files('mm-qrtr-bus-watcher.c')
|
||||
endif
|
||||
|
||||
# Additional suspend/resume support via systemd
|
||||
if enable_systemd_journal
|
||||
sources += files('mm-sleep-monitor.c')
|
||||
|
||||
deps += [
|
||||
gio_unix_dep,
|
||||
libsystemd_dep,
|
||||
]
|
||||
endif
|
||||
|
||||
if enable_polkit
|
||||
deps += polkit_gobject_dep
|
||||
endif
|
||||
|
||||
# Additional QMI support in ModemManager
|
||||
if enable_qmi
|
||||
sources += files(
|
||||
'mm-bearer-qmi.c',
|
||||
'mm-broadband-modem-qmi.c',
|
||||
'mm-call-qmi.c',
|
||||
'mm-shared-qmi.c',
|
||||
'mm-sim-qmi.c',
|
||||
'mm-sms-qmi.c',
|
||||
)
|
||||
endif
|
||||
|
||||
# Additional MBIM support in ModemManager
|
||||
if enable_mbim
|
||||
sources += files(
|
||||
'mm-bearer-mbim.c',
|
||||
'mm-broadband-modem-mbim.c',
|
||||
'mm-sim-mbim.c',
|
||||
'mm-sms-mbim.c',
|
||||
)
|
||||
endif
|
||||
|
||||
executable(
|
||||
'ModemManager',
|
||||
sources: sources + daemon_enums_sources,
|
||||
include_directories: top_inc,
|
||||
dependencies: deps,
|
||||
c_args: c_args,
|
||||
install: true,
|
||||
install_dir: mm_sbindir,
|
||||
)
|
||||
|
||||
pkg.generate(
|
||||
version: mm_version,
|
||||
name: mm_name,
|
||||
description: 'Common headers provided by ModemManager',
|
||||
subdirs: mm_name,
|
||||
variables: 'exec_prefix=${prefix}',
|
||||
)
|
||||
|
||||
# generic udev rules
|
||||
install_data(
|
||||
'80-mm-candidate.rules',
|
||||
install_dir: udev_rulesdir,
|
||||
)
|
||||
|
||||
subdir('tests')
|
38
src/tests/meson.build
Normal file
38
src/tests/meson.build
Normal file
@@ -0,0 +1,38 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
# Copyright (C) 2021 Iñigo Martinez <inigomartinez@gmail.com>
|
||||
|
||||
test_units = {
|
||||
'at-serial-port': libport_dep,
|
||||
'charsets': libhelpers_dep,
|
||||
'error-helpers': libhelpers_dep,
|
||||
'modem-helpers': libhelpers_dep,
|
||||
'sms-part-3gpp': libhelpers_dep,
|
||||
'sms-part-cdma': libhelpers_dep,
|
||||
'udev-rules': libkerneldevice_dep,
|
||||
}
|
||||
|
||||
deps = [
|
||||
libport_dep,
|
||||
libqcdm_dep,
|
||||
util_dep,
|
||||
]
|
||||
|
||||
test_units += {'qcdm-serial-port': deps}
|
||||
|
||||
if enable_qmi
|
||||
test_units += {'modem-helpers-qmi': libkerneldevice_dep}
|
||||
endif
|
||||
|
||||
foreach test_unit, test_deps: test_units
|
||||
test_name = 'test-' + test_unit
|
||||
|
||||
exe = executable(
|
||||
test_name,
|
||||
sources: test_name + '.c',
|
||||
include_directories: top_inc,
|
||||
dependencies: test_deps,
|
||||
c_args: '-DTESTUDEVRULESDIR="@0@"'.format(src_dir)
|
||||
)
|
||||
|
||||
test(test_name, exe)
|
||||
endforeach
|
22
test/meson.build
Normal file
22
test/meson.build
Normal file
@@ -0,0 +1,22 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
# Copyright (C) 2021 Iñigo Martinez <inigomartinez@gmail.com>
|
||||
|
||||
test_units = {
|
||||
'mmrules': libkerneldevice_dep,
|
||||
'mmsmsmonitor': libhelpers_dep,
|
||||
'mmsmspdu': libhelpers_dep,
|
||||
'mmtty': libport_dep,
|
||||
}
|
||||
|
||||
if gudev_dep.found()
|
||||
test_units += {'lsudev': gudev_dep}
|
||||
endif
|
||||
|
||||
foreach test_unit, test_deps: test_units
|
||||
executable(
|
||||
test_unit,
|
||||
test_unit + '.c',
|
||||
include_directories: top_inc,
|
||||
dependencies: test_deps,
|
||||
)
|
||||
endforeach
|
30
tools/tests/meson.build
Normal file
30
tools/tests/meson.build
Normal file
@@ -0,0 +1,30 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
# Copyright (C) 2021 Iñigo Martinez <inigomartinez@gmail.com>
|
||||
|
||||
test_conf = {
|
||||
'abs_top_builddir': build_root,
|
||||
'abs_top_srcdir': source_root,
|
||||
}
|
||||
|
||||
subdir('services')
|
||||
|
||||
test_wrapper = configure_file(
|
||||
input: 'test-wrapper.sh.in',
|
||||
output: '@BASENAME@',
|
||||
configuration: test_conf,
|
||||
)
|
||||
|
||||
# common
|
||||
if enable_gir
|
||||
test_unit = 'test-stub'
|
||||
|
||||
exe = executable(
|
||||
test_unit,
|
||||
test_unit + '.c',
|
||||
include_directories: [top_inc, src_inc],
|
||||
dependencies: libmm_glib_dep,
|
||||
c_args: '-DTEST_SERVICES="@0@"'.format(meson.current_build_dir() / 'services'),
|
||||
)
|
||||
|
||||
test(test_unit, exe)
|
||||
endif
|
8
tools/tests/services/meson.build
Normal file
8
tools/tests/services/meson.build
Normal file
@@ -0,0 +1,8 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
# Copyright (C) 2021 Iñigo Martinez <inigomartinez@gmail.com>
|
||||
|
||||
configure_file(
|
||||
input: 'org.freedesktop.ModemManager1.service.in',
|
||||
output: '@BASENAME@',
|
||||
configuration: test_conf,
|
||||
)
|
Reference in New Issue
Block a user