summaryrefslogtreecommitdiff
path: root/SConstruct
diff options
context:
space:
mode:
authorAndrew Morrow <acm@10gen.com>2013-03-23 15:30:36 -0400
committerAndrew Morrow <acm@10gen.com>2013-03-23 15:43:06 -0400
commit224a7bb7f6669eb80c393d536a894d8841f003c3 (patch)
tree4ad9b5e2d1ea06e5e6cff456f60924e612d14383 /SConstruct
parent1b2a4e07f24df4f2bed7ecf6857d312d2235dfb0 (diff)
downloadmongo-224a7bb7f6669eb80c393d536a894d8841f003c3.tar.gz
SERVER-9002 Fix indentation issue with compiler detection bodies
Diffstat (limited to 'SConstruct')
-rw-r--r--SConstruct8
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