diff options
author | Keith Bostic <keith.bostic@mongodb.com> | 2016-06-02 22:54:40 -0400 |
---|---|---|
committer | Michael Cahill <michael.cahill@mongodb.com> | 2016-06-03 12:54:40 +1000 |
commit | d3a8060e5b8917d8bec927cd54c229e313e22258 (patch) | |
tree | 93f1806e38d89c25f38a3954b051d7355db30d38 /SConstruct | |
parent | a27db763dc3d694bf57ec9755fc1b4f0d06a10ab (diff) | |
download | mongo-d3a8060e5b8917d8bec927cd54c229e313e22258.tar.gz |
WT-2658 Only include PPC-specific files in PPC builds (#2758)
* WT-2658 Only include PPC-specific files in PPC builds
* Add support for conditional file inclusion by adding a second argument on lines in dist/filelist. Add a new automake conditional, POWERPC_HOST, set for the various PPC host CPUs. Change dist/filelist to only compile the checksum/power8 files if POWERPC_HOST is set.
* Merge the Windows and POSIX file lists, use POSIX_HOST and WINDOWS_HOST to mark source files needed for builds on those systems.
Diffstat (limited to 'SConstruct')
-rw-r--r-- | SConstruct | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/SConstruct b/SConstruct index c724d94da7c..a5dd8761d6c 100644 --- a/SConstruct +++ b/SConstruct @@ -240,12 +240,26 @@ wtheader = env.Substfile( # # WiredTiger library # -filelistfile = r'build_win\filelist.win' -filelist = open(filelistfile) -wtsources = [line.strip() - for line in filelist - if not line.startswith("#") and len(line) > 1] -filelist.close() +# Map WiredTiger build conditions: any conditions that appear in WiredTiger's +# dist/filelist must appear here, and if the value is true, those files will be +# included. +# +condition_map = { + 'POSIX_HOST' : env['PLATFORM'] == 'posix', + 'POWERPC_HOST' : False, + 'WINDOWS_HOST' : env['PLATFORM'] == 'win32', +} + +def filtered_filelist(f): + for line in f: + file_cond = line.split() + if line.startswith("#") or len(file_cond) == 0: + continue + if len(file_cond) == 1 or condition_map[file_cond[1]]: + yield file_cond[0] + +filelistfile = r'dist/filelist' +wtsources = list(filtered_filelist(open(filelistfile))) if useZlib: wtsources.append("ext/compressors/zlib/zlib_compress.c") |