Commit ab5e5fe5 authored by Arnaud Rebillout's avatar Arnaud Rebillout Committed by Arun Raghavan
Browse files

meson: Make bluez optional



I can't promise that the logic is *exactly* the same as the logic
currently in use with the autotools, but it seems correct to me.
Signed-off-by: default avatarArnaud Rebillout <arnaud.rebillout@collabora.com>
parent d984da3f
......@@ -266,10 +266,21 @@ if avahi_dep.found()
cdata.set('HAVE_AVAHI', 1)
endif
bluez_dep = dependency('bluez', version : '>= 4.101', required : false)
# TODO fix bluez version, it seems wrong
bluez_dep = dependency('bluez', version : '>= 4.101', required : get_option('bluez5'))
sbc_dep = dependency('sbc', version : '>= 1.0', 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
assert(dbus_dep.found(), 'BlueZ requires D-Bus support')
assert(sbc_dep.found(), 'BlueZ requires SBC support')
cdata.set('HAVE_SBC', 1)
cdata.set('HAVE_BLUEZ', 1)
cdata.set('HAVE_BLUEZ_5', 1)
if get_option('bluez5-native-headset')
cdata.set('HAVE_BLUEZ_5_NATIVE_HEADSET', 1)
endif
if get_option('bluez5-ofono-headset')
cdata.set('HAVE_BLUEZ_5_OFONO_HEADSET', 1)
endif
endif
jack_dep = dependency('jack', version : '>= 0.117.0', required : false)
......@@ -292,15 +303,6 @@ 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
speex_dep = dependency('speexdsp', version : '>= 1.2', required : false)
if speex_dep.found()
cdata.set('HAVE_SPEEX', 1)
......
......@@ -23,6 +23,15 @@ option('alsa',
option('avahi',
type : 'feature', value : 'auto',
description : 'Optional Avahi support')
option('bluez5',
type : 'feature', value : 'auto',
description : 'Optional BlueZ 5 support')
option('bluez5-native-headset',
type : 'boolean',
description : 'Optional native headset backend support (BlueZ 5)')
option('bluez5-ofono-headset',
type : 'boolean',
description : 'Optional oFono headset backend support (BlueZ 5)')
option('dbus',
type : 'feature', value : 'auto',
description : 'Optional D-Bus support')
......
......@@ -8,12 +8,13 @@ libbluez5_util_headers = [
'rtp.h',
]
if bluez_dep.found()
if get_option('bluez5-native-headset')
libbluez5_util_sources += [ 'backend-native.c' ]
endif
# TODO This should be optional
libbluez5_util_sources += [ 'backend-ofono.c' ]
if get_option('bluez5-ofono-headset')
libbluez5_util_sources += [ 'backend-ofono.c' ]
endif
libbluez5_util = shared_library('libbluez5_util',
libbluez5_util_sources,
......
......@@ -103,6 +103,16 @@ if avahi_dep.found()
]
endif
if bluez_dep.found()
subdir('bluetooth')
all_modules += [
[ 'module-bluetooth-discover', 'bluetooth/module-bluetooth-discover.c' ],
[ 'module-bluetooth-policy', 'bluetooth/module-bluetooth-policy.c', [], [], [dbus_dep] ],
[ '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
if dbus_dep.found()
all_modules += [
[ 'module-console-kit', 'module-console-kit.c', [], [], [dbus_dep] ],
......@@ -130,20 +140,6 @@ if dbus_dep.found() and fftw_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 jack_dep.found()
all_modules += [
[ 'module-jack-sink', 'jack/module-jack-sink.c', [], [], [jack_dep] ],
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment