diff --git a/configure.py b/configure.py index 2e7fece5622..467ce99af9b 100755 --- a/configure.py +++ b/configure.py @@ -1813,7 +1813,13 @@ def insert_join(match): output += lines[idx] + "\n" idx += 1 - return self.join_pattern.sub(insert_join, self.value_pattern.sub(insert_value, output)) + '\n' + subsituded_template = self.join_pattern.sub(insert_join, self.value_pattern.sub(insert_value, output)) + + # Prevent newlines being added if the template was not a multiline string + if len(lines) == 1 and not template.endswith('\n'): + return subsituded_template.rstrip('\n') + + return subsituded_template + '\n' try: return SimpleTemplate(variables).substitute(template_text) @@ -2064,7 +2070,7 @@ def choose_cxx_exe(): if options.compiler_cache is None: return cxx else: - return '%s %s' % (options.compiler_cache, cxx) + return '%s %s' % (normalize_source_path(options.compiler_cache), cxx) def extra_libs(libs, cc): if libs is None: @@ -2102,7 +2108,7 @@ def test_exe_extra_ldflags(): 'internal_headers': sorted([os.path.basename(h) for h in build_paths.internal_headers]), 'external_headers': sorted([os.path.basename(h) for h in build_paths.external_headers]), - 'abs_root_dir': os.path.dirname(os.path.realpath(__file__)), + 'abs_root_dir': normalize_source_path(os.path.dirname(os.path.realpath(__file__))), 'base_dir': source_paths.base_dir, 'src_dir': source_paths.src_dir,