diff options
author | Michael Cahill <michael.cahill@mongodb.com> | 2016-06-03 12:51:38 +1000 |
---|---|---|
committer | Ramon Fernandez <ramon@mongodb.com> | 2016-07-26 21:37:56 -0400 |
commit | 482cc73bc00a09246f503fbe4026c539ac7f205b (patch) | |
tree | aec799ca19806063b0ebd3d450effdf2b9b7ea89 | |
parent | ffdc7c6831d82b51e9fd56f045dc77d60300f5c5 (diff) | |
download | mongo-482cc73bc00a09246f503fbe4026c539ac7f205b.tar.gz |
SERVER-24334 Support conditional files in WiredTiger build.
(cherry picked from commit f154e2e2ecc158140d338b0debb9664c0d5ba509)
-rw-r--r-- | src/third_party/wiredtiger/SConscript | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/src/third_party/wiredtiger/SConscript b/src/third_party/wiredtiger/SConscript index a9f43aaa2ac..f740040245b 100644 --- a/src/third_party/wiredtiger/SConscript +++ b/src/third_party/wiredtiger/SConscript @@ -125,14 +125,27 @@ env.Alias('generated-sources', "wiredtiger.h") # # WiredTiger library # -filelistfile = "build_win/filelist.win" if env.TargetOSIs('windows') else 'dist/filelist' +# 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' : not env.TargetOSIs('windows'), + 'POWERPC_HOST' : env['TARGET_ARCH'] == 'ppc64le', + 'WINDOWS_HOST' : env.TargetOSIs('windows'), +} -wtsources = [] +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 = 'dist/filelist' with open(File(filelistfile).srcnode().abspath) as filelist: - wtsources = [line.strip() - for line in filelist - if not line.startswith("#") and len(line.strip()) >= 1] + wtsources = list(filtered_filelist(filelist)) if useZlib: env.Append(CPPDEFINES=['HAVE_BUILTIN_EXTENSION_ZLIB']) |