summaryrefslogtreecommitdiffstats
path: root/scripts/lib/devtool/__init__.py
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2015-09-22 17:21:27 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-09-23 09:53:15 +0100
commit30c7e7ac41ba201d41613d1482abeebdbd05ae46 (patch)
treeddea262ec8e5d690008b427191a7b98b4a079cbc /scripts/lib/devtool/__init__.py
parent99fc284545d3a493ce57e904c233e0130022dae7 (diff)
downloadpoky-30c7e7ac41ba201d41613d1482abeebdbd05ae46.tar.gz
devtool: add: properly handle separate build directory
When we were adding a recipe for software that would typically be built in the same directory as the source, we were always using a separate build directory unless the user explicitly specified not to, leading to errors for software that doesn't expect to be built that way (such as Python modules using distutils). Split out the code that makes this determination automatically from the "devtool modify" and "devtool upgrade" code and re-use that here so the behaviour is consistent. (From OE-Core rev: 320585b7ff6340df0b0dbc63f95ed3ca8fc3a993) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/lib/devtool/__init__.py')
-rw-r--r--scripts/lib/devtool/__init__.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/scripts/lib/devtool/__init__.py b/scripts/lib/devtool/__init__.py
index 3ea38028d4..07a3636e9b 100644
--- a/scripts/lib/devtool/__init__.py
+++ b/scripts/lib/devtool/__init__.py
@@ -152,3 +152,21 @@ def check_workspace_recipe(workspace, pn, checksrc=True):
152 raise DevtoolError("Source tree %s for recipe %s does not exist" % (srctree, pn)) 152 raise DevtoolError("Source tree %s for recipe %s does not exist" % (srctree, pn))
153 if not os.listdir(srctree): 153 if not os.listdir(srctree):
154 raise DevtoolError("Source tree %s for recipe %s is empty" % (srctree, pn)) 154 raise DevtoolError("Source tree %s for recipe %s is empty" % (srctree, pn))
155
156def use_external_build(same_dir, no_same_dir, d):
157 """
158 Determine if we should use B!=S (separate build and source directories) or not
159 """
160 b_is_s = True
161 if no_same_dir:
162 logger.info('Using separate build directory since --no-same-dir specified')
163 b_is_s = False
164 elif same_dir:
165 logger.info('Using source tree as build directory since --same-dir specified')
166 elif bb.data.inherits_class('autotools-brokensep', d):
167 logger.info('Using source tree as build directory since recipe inherits autotools-brokensep')
168 elif d.getVar('B', True) == os.path.abspath(d.getVar('S', True)):
169 logger.info('Using source tree as build directory since that would be the default for this recipe')
170 else:
171 b_is_s = False
172 return b_is_s