From e5ffd87067a6a52e65fb476ecd84097d1c7a33c0 Mon Sep 17 00:00:00 2001 From: Thomas Zimmermann Date: Thu, 9 Apr 2015 15:57:40 +0200 Subject: [PATCH] Bug 1146355: Prepare build system to support Bluetooth APIs v1 and v2, r=shuang This patch adds support for both Bluetooth interfaces to the build system. The actual interface must be selected at compile time. --- dom/base/moz.build | 10 +++++++++- dom/bindings/moz.build | 10 +++++++++- dom/ipc/moz.build | 13 +++++++++++-- dom/moz.build | 6 +----- dom/system/gonk/moz.build | 10 +++++++++- js/xpconnect/src/moz.build | 9 ++++++++- layout/build/moz.build | 9 ++++++++- 7 files changed, 55 insertions(+), 12 deletions(-) diff --git a/dom/base/moz.build b/dom/base/moz.build index a829679971c..ee5f5fb70f0 100644 --- a/dom/base/moz.build +++ b/dom/base/moz.build @@ -398,7 +398,6 @@ MSVC_ENABLE_PGO = True LOCAL_INCLUDES += [ '../battery', '../bluetooth', - '../bluetooth/bluetooth1', '../events', '../media', '../network', @@ -429,6 +428,15 @@ LOCAL_INCLUDES += [ '/xpcom/ds', ] +if CONFIG['MOZ_B2G_BT_API_V2']: + LOCAL_INCLUDES += [ + '../bluetooth/bluetooth2', + ] +else: + LOCAL_INCLUDES += [ + '../bluetooth/bluetooth1', + ] + if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk': LOCAL_INCLUDES += [ '../fmradio', diff --git a/dom/bindings/moz.build b/dom/bindings/moz.build index b061934b8ce..2a3b8e6acd3 100644 --- a/dom/bindings/moz.build +++ b/dom/bindings/moz.build @@ -44,7 +44,6 @@ LOCAL_INCLUDES += [ '/dom/base', '/dom/battery', '/dom/bluetooth', - '/dom/bluetooth/bluetooth1', '/dom/camera', '/dom/canvas', '/dom/geolocation', @@ -90,6 +89,15 @@ if CONFIG['MOZ_AUDIO_CHANNEL_MANAGER']: '/dom/system/gonk', ] +if CONFIG['MOZ_B2G_BT_API_V2']: + LOCAL_INCLUDES += [ + '/dom/bluetooth/bluetooth2', + ] +else: + LOCAL_INCLUDES += [ + '/dom/bluetooth/bluetooth1', + ] + FINAL_LIBRARY = 'xul' SPHINX_TREES['webidl'] = 'docs' diff --git a/dom/ipc/moz.build b/dom/ipc/moz.build index 102e0e21da2..beee819a8c7 100644 --- a/dom/ipc/moz.build +++ b/dom/ipc/moz.build @@ -123,8 +123,6 @@ LOCAL_INCLUDES += [ '/docshell/base', '/dom/base', '/dom/bluetooth', - '/dom/bluetooth/bluetooth1', - '/dom/bluetooth/bluetooth1/ipc', '/dom/devicestorage', '/dom/filesystem', '/dom/fmradio/ipc', @@ -161,6 +159,17 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('android', 'gtk2', 'gonk', 'qt'): if CONFIG['MOZ_TOOLKIT_SEARCH']: DEFINES['MOZ_TOOLKIT_SEARCH'] = True +if CONFIG['MOZ_B2G_BT_API_V2']: + LOCAL_INCLUDES += [ + '/dom/bluetooth/bluetooth2', + '/dom/bluetooth/bluetooth2/ipc', + ] +else: + LOCAL_INCLUDES += [ + '/dom/bluetooth/bluetooth1', + '/dom/bluetooth/bluetooth1/ipc', + ] + JAR_MANIFESTS += ['jar.mn'] BROWSER_CHROME_MANIFESTS += ['tests/browser.ini'] diff --git a/dom/moz.build b/dom/moz.build index a4a1092b3d5..fae54ff5049 100644 --- a/dom/moz.build +++ b/dom/moz.build @@ -41,6 +41,7 @@ DIRS += [ 'animation', 'apps', 'base', + 'bluetooth', 'activities', 'archivereader', 'requestsync', @@ -146,11 +147,6 @@ if CONFIG['MOZ_B2G']: 'engineeringmode' ] -if CONFIG['MOZ_B2G_BT_API_V2']: - DIRS += ['bluetooth2'] -else: - DIRS += ['bluetooth'] - DIRS += ['presentation'] TEST_DIRS += [ diff --git a/dom/system/gonk/moz.build b/dom/system/gonk/moz.build index 409dcca83e1..e4aadabb1f0 100644 --- a/dom/system/gonk/moz.build +++ b/dom/system/gonk/moz.build @@ -114,9 +114,17 @@ include('/ipc/chromium/chromium-config.mozbuild') LOCAL_INCLUDES += [ '/dom/base', '/dom/bluetooth', - '/dom/bluetooth/bluetooth1', '/dom/geolocation', '/dom/wifi', ] +if CONFIG['MOZ_B2G_BT_API_V2']: + LOCAL_INCLUDES += [ + '/dom/bluetooth/bluetooth2', + ] +else: + LOCAL_INCLUDES += [ + '/dom/bluetooth/bluetooth1', + ] + FINAL_LIBRARY = 'xul' diff --git a/js/xpconnect/src/moz.build b/js/xpconnect/src/moz.build index a9c0ed89773..232a0ba2c19 100644 --- a/js/xpconnect/src/moz.build +++ b/js/xpconnect/src/moz.build @@ -74,5 +74,12 @@ LOCAL_INCLUDES += [ if CONFIG['MOZ_B2G_BT']: LOCAL_INCLUDES += [ '/dom/bluetooth', - '/dom/bluetooth/bluetooth1', ] + if CONFIG['MOZ_B2G_BT_API_V2']: + LOCAL_INCLUDES += [ + '/dom/bluetooth/bluetooth2', + ] + else: + LOCAL_INCLUDES += [ + '/dom/bluetooth/bluetooth1', + ] diff --git a/layout/build/moz.build b/layout/build/moz.build index fc051769060..5e94297499d 100644 --- a/layout/build/moz.build +++ b/layout/build/moz.build @@ -109,8 +109,15 @@ if CONFIG['MOZ_B2G_FM']: if CONFIG['MOZ_B2G_BT']: LOCAL_INCLUDES += [ '/dom/bluetooth', - '/dom/bluetooth/bluetooth1', ] + if CONFIG['MOZ_B2G_BT_API_V2']: + LOCAL_INCLUDES += [ + '/dom/bluetooth/bluetooth2', + ] + else: + LOCAL_INCLUDES += [ + '/dom/bluetooth/bluetooth1', + ] if CONFIG['MOZ_WEBSPEECH']: LOCAL_INCLUDES += [