From 8af992c449b895ec8be638049fd2510388f23ddd Mon Sep 17 00:00:00 2001 From: Greg Zharun Date: Wed, 8 Apr 2015 16:29:33 +0300 Subject: [Summary] Added SSE sound processing functions support for Windows. Version 1. Conflicts: wscript --- wscript | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) (limited to 'wscript') diff --git a/wscript b/wscript index bb3157434d..61e2abd4d1 100644 --- a/wscript +++ b/wscript @@ -71,6 +71,8 @@ compiler_flags_dictionaries= { 'ultra-strict' : ['-Wredundant-decls', '-Wstrict-prototypes', '-Wmissing-prototypes'], # Flag to turn on C99 compliance by itself 'c99': '-std=c99', + # Flag to enable AT&T assembler syntax + 'attasm': 'asm=att', }, 'msvc' : { 'debuggable' : ['/DDEBUG', '/Od', '/Zi', '/MDd', '/Gd', '/EHsc'], @@ -370,17 +372,15 @@ int main() { return 0; }''', c_flags.append("-Qunused-arguments") cxx_flags.append("-Qunused-arguments") - if ((re.search ("i[0-9]86", cpu) != None) or (re.search ("x86_64", cpu) != None)) and conf.env['build_target'] != 'none': - + if (re.search ("(i[0-9]86|x86_64|AMD64)", cpu) != None) and conf.env['build_target'] != 'none': # # ARCH_X86 means anything in the x86 family from i386 to x86_64 # the compile-time presence of the macro _LP64 is used to # distingush 32 and 64 bit assembler # - - if (re.search ("(i[0-9]86|x86_64)", cpu) != None): - compiler_flags.append ("-DARCH_X86") + + compiler_flags.append ("-DARCH_X86") if platform == 'linux' : @@ -405,9 +405,19 @@ int main() { return 0; }''', elif cpu == "i686": compiler_flags.append ("-march=i686") - if ((conf.env['build_target'] == 'i686') or (conf.env['build_target'] == 'x86_64')) and build_host_supports_sse: + if not is_clang and ((conf.env['build_target'] == 'i686') or (conf.env['build_target'] == 'x86_64')) and build_host_supports_sse: compiler_flags.extend ([ flags_dict['sse'], flags_dict['fpmath-sse'], flags_dict['xmmintrinsics'] ]) - + + if (conf.env['build_target'] == 'mingw'): + if (re.search ("(x86_64|AMD64)", cpu) != None): + # on Windows sse is supported by 64 bit platforms only + build_host_supports_sse = True + + # mingw GCC compiler to uses at&t (Unix specific) assembler dialect by default + # compiler_flags.append (["--mmnemonic=att", "msyntax=att") + + compiler_flags.extend ([ flags_dict['sse'], flags_dict['fpmath-sse'], flags_dict['xmmintrinsics'], flags_dicts['attasm'] ]) + # end of processor-specific section # optimization section @@ -415,7 +425,7 @@ int main() { return 0; }''', if sys.platform == 'darwin': compiler_flags.append("-DBUILD_VECLIB_OPTIMIZATIONS"); conf.env.append_value('LINKFLAGS_OSX', ['-framework', 'Accelerate']) - elif conf.env['build_target'] == 'i686' or conf.env['build_target'] == 'x86_64': + elif conf.env['build_target'] == 'i686' or conf.env['build_target'] == 'x86_64' or (conf.env['build_target'] == 'mingw' and build_host_supports_sse): compiler_flags.append ("-DBUILD_SSE_OPTIMIZATIONS") if not build_host_supports_sse: print("\nWarning: you are building Ardour with SSE support even though your system does not support these instructions. (This may not be an error, especially if you are a package maintainer)") @@ -859,7 +869,7 @@ def configure(conf): autowaf.check_pkg(conf, 'rubberband', uselib_store='RUBBERBAND', mandatory=True) if Options.options.dist_target == 'mingw': - Options.options.fpu_optimization = False + Options.options.fpu_optimization = True conf.env.append_value('CFLAGS', '-DPLATFORM_WINDOWS') conf.env.append_value('CFLAGS', '-DCOMPILER_MINGW') conf.env.append_value('CXXFLAGS', '-DPLATFORM_WINDOWS') -- cgit v1.2.3