diff options
author | Arnaud Rebillout <arnaud.rebillout@collabora.com> | 2018-09-22 17:37:19 +0700 |
---|---|---|
committer | Arun Raghavan <arun@arunraghavan.net> | 2018-10-04 08:44:18 +0530 |
commit | 0d6ea15eea8e30cb09e1a8bc0dbf9dd43060f6c7 (patch) | |
tree | cb264fcde654f9bf62bde860cf26fb2074f61c3e | |
parent | 147462b276fd8d1b5207f32ea791ec2be76398ea (diff) |
meson: Enable bluetooth modules, add bluez_util lib, add bluez and sbc dependencies
Please notice that the bluez5 version seems wrong in the dependency
declaration: `>= 4.x`, while we're talking about version 5.
The ofono part will need to be made optional when we start to work on
the meson_options file.
I follow the current configure.ac to define 'HAVE_BLUEZ', but it looks
like this part would benefit from a bit of rework. Setting HAVE_BLUEZ
when we have dbus+sbc sounds weird, there's probably a better name for
this variable.
Signed-off-by: Arnaud Rebillout <arnaud.rebillout@collabora.com>
-rw-r--r-- | meson.build | 15 | ||||
-rw-r--r-- | src/modules/bluetooth/meson.build | 25 | ||||
-rw-r--r-- | src/modules/meson.build | 18 |
3 files changed, 54 insertions, 4 deletions
diff --git a/meson.build b/meson.build index ac956ffb8..db518703d 100644 --- a/meson.build +++ b/meson.build @@ -238,6 +238,12 @@ if avahi_dep.found() cdata.set('HAVE_AVAHI', 1) endif +bluez_dep = dependency('bluez', version : '>= 4.101', required : false) +if bluez_dep.found() + cdata.set('HAVE_BLUEZ_5_NATIVE_HEADSET', 1) + cdata.set('HAVE_BLUEZ_5_OFONO_HEADSET', 1) # TODO This should be optional +endif + jack_dep = dependency('jack', version : '>= 0.117.0', required : false) if jack_dep.found() cdata.set('HAVE_JACK', 1) @@ -258,6 +264,15 @@ if openssl_dep.found() cdata.set('HAVE_OPENSSL', 1) endif +sbc_dep = dependency('sbc', version : '>= 1.0', required : false) +if sbc_dep.found() + cdata.set('HAVE_SBC', 1) +endif +if sbc_dep.found() and dbus_dep.found() + cdata.set('HAVE_BLUEZ', 1) + cdata.set('HAVE_BLUEZ_5', 1) +endif + udev_dep = dependency('libudev', version : '>= 143', required : false) if udev_dep.found() cdata.set('HAVE_UDEV', 1) diff --git a/src/modules/bluetooth/meson.build b/src/modules/bluetooth/meson.build new file mode 100644 index 000000000..2afcd495e --- /dev/null +++ b/src/modules/bluetooth/meson.build @@ -0,0 +1,25 @@ +libbluez5_util_sources = [ + 'bluez5-util.c', +] + +libbluez5_util_headers = [ + 'a2dp-codecs.h', + 'bluez5-util.h', + 'rtp.h', +] + +if bluez_dep.found() + libbluez5_util_sources += [ 'backend-native.c' ] +endif + +# TODO This should be optional +libbluez5_util_sources += [ 'backend-ofono.c' ] + +libbluez5_util = shared_library('libbluez5_util', + libbluez5_util_sources, + libbluez5_util_headers, + c_args : [pa_c_args, server_c_args], + include_directories : [configinc, topinc], + dependencies : [libpulse_dep, libpulsecommon_dep, libpulsecore_dep, dbus_dep], + install : true +) diff --git a/src/modules/meson.build b/src/modules/meson.build index 2cb305be3..d295c6d48 100644 --- a/src/modules/meson.build +++ b/src/modules/meson.build @@ -8,10 +8,6 @@ all_modules = [ [ 'module-always-sink', 'module-always-sink.c' ], [ 'module-always-source', 'module-always-source.c' ], [ 'module-augment-properties', 'module-augment-properties.c' ], -# [ 'module-bluetooth-discover', 'bluetooth/module-bluetooth-discover.c' ], -# [ 'module-bluetooth-policy', 'bluetooth/module-bluetooth-policy.c' ], -# [ 'module-bluez5-device', 'bluetooth/module-bluez5-device.c' ], -# [ 'module-bluez5-discover', 'bluetooth/module-bluez5-discover.c' ], # [ 'module-bonjour-publish', 'macosx/module-bonjour-publish.c' ], [ 'module-card-restore', 'module-card-restore.c' ], [ 'module-cli', 'module-cli.c', [], [], [], libcli ], @@ -125,6 +121,20 @@ if dbus_dep.found() ] endif +if dbus_dep.found() and sbc_dep.found() + all_modules += [ + [ 'module-bluetooth-discover', 'bluetooth/module-bluetooth-discover.c' ], + [ 'module-bluetooth-policy', 'bluetooth/module-bluetooth-policy.c', [], [], [dbus_dep] ] + ] + if bluez_dep.found() + subdir('bluetooth') + all_modules += [ + [ 'module-bluez5-device', 'bluetooth/module-bluez5-device.c', [], [], [sbc_dep], libbluez5_util ], + [ 'module-bluez5-discover', 'bluetooth/module-bluez5-discover.c', [], [], [dbus_dep], libbluez5_util ], + ] + endif +endif + if fftw_dep.found() all_modules += [ [ 'module-equalizer-sink', 'module-equalizer-sink.c', [], [], [dbus_dep, fftw_dep, libm_dep] ], |