aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2016-10-31 00:28:28 -0400
committerJack Lloyd <[email protected]>2016-10-31 00:28:28 -0400
commit2608be4689132de0994abec11e83f31afd525ec3 (patch)
treef8f4fad4e20a52538525c942a2166dec743d75d4
parent77a7383e5d50a50e6966e4bfe24428d215acefed (diff)
Fix configure when building outside of main source dir
When configuring from fuzzer dir, object files would get names starting with '..'
-rwxr-xr-xconfigure.py15
1 files changed, 12 insertions, 3 deletions
diff --git a/configure.py b/configure.py
index 51ca56a8f..99bc8f5e1 100755
--- a/configure.py
+++ b/configure.py
@@ -1171,14 +1171,23 @@ def gen_makefile_lists(var, build_config, options, modules, cc, arch, osinfo):
for src in sources:
(dir,file) = os.path.split(os.path.normpath(src))
- parts = dir.split(os.sep)[2:]
+ parts = dir.split(os.sep)
+ if 'src' in parts:
+ parts = parts[parts.index('src')+2:]
+ elif 'tests' in parts:
+ parts = parts[parts.index('tests')+2:]
+ elif 'cli' in parts:
+ parts = parts[parts.index('cli'):]
+ else:
+ raise Exception("Unexpected file '%s/%s'" % (dir, file))
+
if parts != []:
# Handle src/X/X.cpp -> X.o
if file == parts[-1] + '.cpp':
- name = '_'.join(dir.split(os.sep)[2:]) + '.cpp'
+ name = '_'.join(parts) + '.cpp'
else:
- name = '_'.join(dir.split(os.sep)[2:]) + '_' + file
+ name = '_'.join(parts) + '_' + file
def fixup_obj_name(name):
def remove_dups(parts):