+from waflib.Build import Context
+from waflib.Build import BuildContext
+
+class i18n(BuildContext):
+ cmd = 'i18n'
+ fun = 'i18n'
+
+class i18n_pot(BuildContext):
+ cmd = 'i18n_pot'
+ fun = 'i18n_pot'
+
+class i18n_po(BuildContext):
+ cmd = 'i18n_po'
+ fun = 'i18n_po'
+
+class i18n_mo(BuildContext):
+ cmd = 'i18n_mo'
+ fun = 'i18n_mo'
+
+def is_tracks_build(self, *k, **kw):
+ return self.env['PROGRAM_NAME'] == 'Tracks Live'
+
+Context.Context.is_tracks_build = is_tracks_build
+
+compiler_flags_dictionaries= {
+ 'gcc' : {
+ # Flags required when building a debug build
+ 'debuggable' : [ '-O0', '-g' ],
+ # Flags required for the linker (if any) when building a debug build
+ 'linker-debuggable' : '',
+ # Flags required when building a non-debug optimized build
+ 'nondebuggable' : '-DNDEBUG',
+ # Flags required to enable profiling at runtime
+ 'profile' : '-pg',
+ # Flags required to disable warnings about unused arguments to function calls
+ 'silence-unused-arguments' : '',
+ # Flags required to use SSE unit for general math
+ 'sse' : '-msse',
+ # Flags required to use SSE unit for floating point math
+ 'fpmath-sse' : '-mfpmath=sse',
+ # Flags required to use XMM Intrinsics
+ 'xmmintrinsics' : '-DUSE_XMMINTRIN',
+ # Flags to use posix pipes between compiler stages
+ 'pipe' : '-pipe',
+ # Flags for maximally optimized build
+ 'full-optimization' : [ '-O3', '-fomit-frame-pointer', '-ffast-math', '-fstrength-reduce', ],
+ # Flag to ensure that compiler error output includes column/line numbers
+ 'show-column' : '-fshow-column',
+ # Flags required to build for x86 only (OS X feature)
+ 'generic-x86' : '',
+ # Flags required to build for PowerPC only (OS X feature)
+ 'generic-ppc' : '',
+ # All flags required to get basic warnings to be generated by the compiler
+ 'basic-warnings' : [ '-Wall', '-Wpointer-arith', '-Wcast-qual', '-Wcast-align', '-Wno-unused-parameter' ],
+ # Any additional flags for warnings that are specific to C (not C++)
+ 'extra-c-warnings' : [ '-Wstrict-prototypes', '-Wmissing-prototypes' ],
+ # Any additional flags for warnings that are specific to C++ (not C)
+ 'extra-cxx-warnings' : [ '-Woverloaded-virtual', '-Wno-unused-local-typedefs' ],
+ # Flags used for "strict" compilation, C and C++ (i.e. compiler will warn about language issues)
+ 'strict' : ['-Wall', '-Wcast-align', '-Wextra', '-Wwrite-strings', '-Wunsafe-loop-optimizations', '-Wlogical-op' ],
+ # Flags used for "strict" compilation, C only (i.e. compiler will warn about language issues)
+ 'c-strict' : ['-std=c99', '-pedantic', '-Wshadow'],
+ # Flags used for "strict" compilation, C++ only (i.e. compiler will warn about language issues)
+ 'cxx-strict' : [ '-ansi', '-Wnon-virtual-dtor', '-Woverloaded-virtual', '-fstrict-overflow' ],
+ # Flags required for whatever consider the strictest possible compilation
+ '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': '-masm=att',
+ # Flags to make AVX instructions/intrinsics available
+ 'avx': '-mavx',
+ # Flags to generate position independent code, when needed to build a shared object
+ 'pic': '-fPIC',
+ # Flags required to compile C code with anonymous unions (only part of C11)
+ 'c-anonymous-union': '-fms-extensions',
+ },
+ 'msvc' : {
+ 'debuggable' : ['/DDEBUG', '/Od', '/Zi', '/MDd', '/Gd', '/EHsc'],
+ 'linker-debuggable' : ['/DEBUG', '/INCREMENTAL' ],
+ 'nondebuggable' : ['/DNDEBUG', '/Ob1', '/MD', '/Gd', '/EHsc'],
+ 'profile' : '',
+ 'sse' : '/arch:SSE',
+ 'silence-unused-arguments' : '',
+ 'sse' : '',
+ 'fpmath-sse' : '',
+ 'xmmintrinsics' : '',
+ 'pipe' : '',
+ 'full-optimization' : '/O2',
+ 'no-frame-pointer' : '',
+ 'fast-math' : '',
+ 'strength-reduce' : '',
+ 'show-column' : '',
+ 'generic-x86' : '',
+ 'generic-ppc' : '',
+ 'basic-warnings' : '',
+ 'extra-c-warnings' : '',
+ 'extra-cxx-warnings' : '',
+ 'ultra-strict' : '',
+ 'c-strict' : '',
+ 'cxx-strict' : '',
+ 'strict' : '',
+ 'c99': '/TP',
+ 'attasm': '',
+ 'avx': '',
+ 'pic': '',
+ 'c-anonymous-union': '',
+ },
+}
+
+# Copy, edit and insert variants on gcc dict for gcc-darwin and clang
+
+gcc_darwin_dict = compiler_flags_dictionaries['gcc'].copy()
+gcc_darwin_dict['extra-cxx-warnings'] = [ '-Woverloaded-virtual' ]
+gcc_darwin_dict['cxx-strict'] = [ '-ansi', '-Wnon-virtual-dtor', '-Woverloaded-virtual' ]
+gcc_darwin_dict['strict'] = ['-Wall', '-Wcast-align', '-Wextra', '-Wwrite-strings' ]
+gcc_darwin_dict['generic-x86'] = [ '-arch', 'i386' ]
+gcc_darwin_dict['generic-ppc'] = [ '-arch', 'ppc' ]
+compiler_flags_dictionaries['gcc-darwin'] = gcc_darwin_dict;
+
+clang_dict = compiler_flags_dictionaries['gcc'].copy();
+clang_dict['sse'] = ''
+clang_dict['fpmath-sse'] = ''
+clang_dict['xmmintrinsics'] = ''
+clang_dict['silence-unused-arguments'] = '-Qunused-arguments'
+clang_dict['extra-cxx-warnings'] = [ '-Woverloaded-virtual', '-Wno-mismatched-tags' ]
+clang_dict['cxx-strict'] = [ '-ansi', '-Wnon-virtual-dtor', '-Woverloaded-virtual', '-fstrict-overflow' ]
+clang_dict['strict'] = ['-Wall', '-Wcast-align', '-Wextra', '-Wwrite-strings' ]
+clang_dict['generic-x86'] = [ '-arch', 'i386' ]
+compiler_flags_dictionaries['clang'] = clang_dict;
+
+clang_darwin_dict = compiler_flags_dictionaries['clang'].copy();
+clang_darwin_dict['cxx-strict'] = [ '-ansi', '-Wnon-virtual-dtor', '-Woverloaded-virtual', ]
+clang_darwin_dict['full-optimization'] = [ '-O3', '-ffast-math', '-fstrength-reduce' ]
+compiler_flags_dictionaries['clang-darwin'] = clang_darwin_dict;