diff options
author | Jason Carey <hanumantmk@gmail.com> | 2014-08-11 10:03:42 -0400 |
---|---|---|
committer | Jason Carey <hanumantmk@gmail.com> | 2014-08-12 10:07:27 -0400 |
commit | 8d0bf7dfbfafd09b9465feec3651cdd31aeb0dcc (patch) | |
tree | 5af8d41713b4555d41cf2d4f66180b0da05a9706 /SConstruct | |
parent | e2a58d5fd4e3f0d64bb5ba10de87ca48365617fc (diff) | |
download | mongo-8d0bf7dfbfafd09b9465feec3651cdd31aeb0dcc.tar.gz |
SERVER-14852 AAE safe read/write primitives
Alignment, aliasing and endian safe read write primitives in the form
of DataView and DataCursor primitives. These primitives provide safe
reads and writes with explicit endian variants that funnel through
std::memcpy to provide defined behavior.
Support for a safe packed struct idiom is also provided in the
encoded_value_storage class.
Diffstat (limited to 'SConstruct')
-rw-r--r-- | SConstruct | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/SConstruct b/SConstruct index 945f908b96f..015542d3880 100644 --- a/SConstruct +++ b/SConstruct @@ -205,6 +205,9 @@ add_option( "dynamic-windows", "dynamically link on Windows", 0, True) add_option( "64" , "whether to force 64 bit" , 0 , True , "force64" ) add_option( "32" , "whether to force 32 bit" , 0 , True , "force32" ) +add_option( "endian" , "endianness of target platform" , 1 , False , "endian", + type="choice", choices=["big", "little", "auto"], default="auto" ) + add_option( "cxx", "compiler to use" , 1 , True ) add_option( "cc", "compiler to use for c" , 1 , True ) add_option( "cc-use-shell-environment", "use $CC from shell for C compiler" , 0 , False ) @@ -552,6 +555,16 @@ if has_option('mute'): env.Append( SHLINKCOMSTR = env["LINKCOMSTR"] ) env.Append( ARCOMSTR = "Generating library $TARGET" ) +endian = get_option( "endian" ) + +if endian == "auto": + endian = sys.byteorder + +if endian == "little": + env.Append( CPPDEFINES=[("MONGO_BYTE_ORDER", "1234")] ) +elif endian == "big": + env.Append( CPPDEFINES=[("MONGO_BYTE_ORDER", "4321")] ) + env['_LIBDEPS'] = '$_LIBDEPS_OBJS' if env['_LIBDEPS'] == '$_LIBDEPS_OBJS': |