From 8d98eb474e084d5b5dead4e0643606a4f7bb794e Mon Sep 17 00:00:00 2001 From: Kp Date: Sun, 9 Oct 2016 17:35:03 +0000 Subject: [PATCH] Move DXX_WORDS_NEED_ALIGNMENT to user settings Previously, raspberrypi mode forced DXX_WORDS_NEED_ALIGNMENT on and any other mode forced it off. Add a specific user setting for DXX_WORDS_NEED_ALIGNMENT. Set its default as bool(raspberrypi) to preserve the previous special case. --- SConstruct | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/SConstruct b/SConstruct index f6860f384..1256c303a 100644 --- a/SConstruct +++ b/SConstruct @@ -893,6 +893,9 @@ int main(int argc,char**argv){(void)argc;(void)argv; context.Result('%s: checking endian to use...%s' % (self.msgprefix, __endian_names[endian])) self._define_macro(context, 'DXX_WORDS_BIGENDIAN', endian) @_custom_test + def _check_user_settings_words_need_alignment(self,context): + self._result_check_user_setting(context, self.user_settings.words_need_alignment, 'DXX_WORDS_NEED_ALIGNMENT', 'word alignment fixups') + @_custom_test def _check_user_settings_opengl(self,context): user_settings = self.user_settings Result = context.Result @@ -2793,6 +2796,8 @@ class DXXCommon(LazyObjectConstructor): # If isatty is None, then assume output is a TTY. cls.__stdout_is_not_a_tty = r = False if isatty is None else not isatty() return r + def default_words_need_alignment(self): + return self.raspberrypi def selected_OGLES_LIB(self): if self.raspberrypi: return 'GLESv2' @@ -2899,6 +2904,7 @@ class DXXCommon(LazyObjectConstructor): ('use_udp', True, 'enable UDP support'), ('use_tracker', True, 'enable Tracker support (requires UDP)'), ('verbosebuild', self.default_verbosebuild, 'print out all compiler/linker messages during building'), + ('words_need_alignment', self.default_words_need_alignment, 'align words at load (needed for many non-x86 systems)'), ('register_compile_target', True, 'report compile targets to SCons core'), ('register_cpp_output_targets', None, None), # This is intentionally undocumented. If a bug @@ -3404,7 +3410,6 @@ class DXXCommon(LazyObjectConstructor): user_settings = self.user_settings env.Prepend(CXXFLAGS = ['-g', '-O2']) - env.Append(CPPDEFINES = [('DXX_WORDS_NEED_ALIGNMENT', int(user_settings.raspberrypi))]) # Raspberry Pi? if user_settings.raspberrypi: rpi_vc_path = user_settings.rpi_vc_path