diff options
author | Andrew Morrow <acm@10gen.com> | 2013-03-23 15:30:36 -0400 |
---|---|---|
committer | Andrew Morrow <acm@10gen.com> | 2013-03-23 15:43:06 -0400 |
commit | 224a7bb7f6669eb80c393d536a894d8841f003c3 (patch) | |
tree | 4ad9b5e2d1ea06e5e6cff456f60924e612d14383 /SConstruct | |
parent | 1b2a4e07f24df4f2bed7ecf6857d312d2235dfb0 (diff) | |
download | mongo-224a7bb7f6669eb80c393d536a894d8841f003c3.tar.gz |
SERVER-9002 Fix indentation issue with compiler detection bodies
Diffstat (limited to 'SConstruct')
-rw-r--r-- | SConstruct | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/SConstruct b/SConstruct index fbfc0a84700..50023ab9f3e 100644 --- a/SConstruct +++ b/SConstruct @@ -21,6 +21,7 @@ import re import shutil import stat import sys +import textwrap import types import urllib import urllib2 @@ -849,7 +850,12 @@ def doConfigure(myenv): } print_tuple = (lang_name, context.env[compiler_var], toolchain) context.Message('Checking if %s compiler "%s" is %s... ' % print_tuple) - result = context.TryCompile(test_bodies[toolchain], source_suffix) + # Strip indentation from the test body to ensure that the newline at the end of the + # endif is the last character in the file (rather than a line of spaces with no + # newline), and that all of the preprocessor directives start at column zero. Both of + # these issues can trip up older toolchains. + test_body = textwrap.dedent(test_bodies[toolchain]) + result = context.TryCompile(test_body, source_suffix) context.Result(result) return result |