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)
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)
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')
'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,
]
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] ],
]
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] ],