X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=common.py;h=c040c6ddd4ad34a28f64d622c6b30ed46d7d19b5;hb=53174afeeb68a79e471185cb463c13ff90af698f;hp=36b190ce89f23a0ab93ff6f1b1de5984e911da4c;hpb=09e6be9b5782870f1f225653687e0d3e7be2a5a9;p=mesa.git diff --git a/common.py b/common.py index 36b190ce89f..c040c6ddd4a 100644 --- a/common.py +++ b/common.py @@ -34,7 +34,7 @@ default_machine = _machine_map.get(default_machine, 'generic') if default_platform in ('linux', 'freebsd', 'darwin'): default_dri = 'yes' -elif default_platform in ('winddk', 'windows'): +elif default_platform in ('winddk', 'windows', 'wince'): default_dri = 'no' else: default_dri = 'no' @@ -52,12 +52,13 @@ def AddOptions(opts): from SCons.Options.EnumOption import EnumOption except ImportError: from SCons.Variables.EnumVariable import EnumVariable as EnumOption - opts.Add(BoolOption('debug', 'build debug version', 'no')) + opts.Add(BoolOption('debug', 'debug build', 'no')) + opts.Add(BoolOption('profile', 'profile build', 'no')) #opts.Add(BoolOption('quiet', 'quiet command lines', 'no')) opts.Add(EnumOption('machine', 'use machine-specific assembly code', default_machine, allowed_values=('generic', 'x86', 'x86_64'))) opts.Add(EnumOption('platform', 'target platform', default_platform, - allowed_values=('linux', 'cell', 'windows', 'winddk'))) + allowed_values=('linux', 'cell', 'windows', 'winddk', 'wince'))) opts.Add(BoolOption('llvm', 'use LLVM', 'no')) opts.Add(BoolOption('dri', 'build DRI drivers', default_dri)) @@ -125,6 +126,8 @@ def make_build_dir(env): build_subdir += '-' + env['machine'] if env['debug']: build_subdir += "-debug" + if env['profile']: + build_subdir += "-profile" build_dir = os.path.join(build_topdir, build_subdir) # Place the .sconsign file on the builddir too, to avoid issues with different scons # versions building the same source file @@ -146,7 +149,7 @@ def generate(env): platform = env['platform'] x86 = env['machine'] == 'x86' gcc = env['platform'] in ('linux', 'freebsd', 'darwin') - msvc = env['platform'] in ('windows', 'winddk') + msvc = env['platform'] in ('windows', 'winddk', 'wince') # C preprocessor options cppdefines = [] @@ -154,6 +157,8 @@ def generate(env): cppdefines += ['DEBUG'] else: cppdefines += ['NDEBUG'] + if env['profile']: + cppdefines += ['PROFILE'] if platform == 'windows': cppdefines += [ 'WIN32', @@ -191,6 +196,19 @@ def generate(env): ] if debug: cppdefines += [('DBG', 1)] + if platform == 'wince': + cppdefines += [ + ('_WIN32_WCE', '500'), + 'WCE_PLATFORM_STANDARDSDK_500', + '_i386_', + ('UNDER_CE', '500'), + 'UNICODE', + '_UNICODE', + '_X86_', + 'x86', + '_USRDLL', + 'TEST_EXPORTS' , + ] if platform == 'windows': cppdefines += ['PIPE_SUBSYSTEM_USER'] if platform == 'winddk': @@ -204,6 +222,8 @@ def generate(env): cflags += ['-O0', '-g3'] else: cflags += ['-O3', '-g3'] + if env['profile']: + cflags += ['-pg'] cflags += [ '-Wall', '-Wmissing-prototypes', @@ -228,6 +248,11 @@ def generate(env): '/Oi', # enable intrinsic functions '/Os', # favor code space ] + if env['profile']: + cflags += [ + '/Gh', # enable _penter hook function + '/GH', # enable _pexit hook function + ] if platform == 'windows': cflags += [ # TODO @@ -252,6 +277,11 @@ def generate(env): '/hotpatch', # prepares an image for hotpatching. #'/Z7', #enable old-style debug info ] + if platform == 'wince': + cflags += [ + '/Gs8192', + '/GF', # enable read-only string pooling + ] # Put debugging information in a separate .pdb file for each object file as # descrived in the scons manpage env['CCPDBFLAGS'] = '/Zi /Fd${TARGET}.pdb'