X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=scons%2Fgallium.py;h=21197c8d0d12bda8d3f48e98a4b1d348cc8bd3e5;hb=3dd299c3d5b88114894ec30d1fac85fba688201f;hp=aa7201a97159c08914ca72c4792c89a4cc23e56a;hpb=c782168751ec6373c28ebb4b4c39a8f3ae06a075;p=mesa.git diff --git a/scons/gallium.py b/scons/gallium.py index aa7201a9715..21197c8d0d1 100755 --- a/scons/gallium.py +++ b/scons/gallium.py @@ -279,7 +279,7 @@ def generate(env): if env['build'] == 'profile': env['debug'] = False env['profile'] = True - if env['build'] in ('release', 'opt'): + if env['build'] == 'release': env['debug'] = False env['profile'] = False @@ -308,7 +308,20 @@ def generate(env): if env.GetOption('num_jobs') <= 1: env.SetOption('num_jobs', num_jobs()) - env.Decider('MD5-timestamp') + # Speed up dependency checking. See + # - https://github.com/SCons/scons/wiki/GoFastButton + # - https://bugs.freedesktop.org/show_bug.cgi?id=109443 + + # Scons version string has consistently been in this format: + # MajorVersion.MinorVersion.Patch[.alpha/beta.yyyymmdd] + # so this formula should cover all versions regardless of type + # stable, alpha or beta. + # For simplicity alpha and beta flags are removed. + + scons_version = distutils.version.StrictVersion('.'.join(SCons.__version__.split('.')[:3])) + if scons_version < distutils.version.StrictVersion('3.0.2') or \ + scons_version > distutils.version.StrictVersion('3.0.4'): + env.Decider('MD5-timestamp') env.SetOption('max_drift', 60) # C preprocessor options @@ -317,7 +330,7 @@ def generate(env): '__STDC_CONSTANT_MACROS', '__STDC_FORMAT_MACROS', '__STDC_LIMIT_MACROS', - 'HAVE_NO_AUTOCONF', + 'HAVE_SCONS', ] if env['build'] in ('debug', 'checked'): cppdefines += ['DEBUG'] @@ -325,8 +338,6 @@ def generate(env): cppdefines += ['NDEBUG'] if env['build'] == 'profile': cppdefines += ['PROFILE'] - if env['build'] in ('opt', 'profile'): - cppdefines += ['VMX86_STATS'] if env['platform'] in ('posix', 'linux', 'freebsd', 'darwin'): cppdefines += [ '_POSIX_SOURCE', @@ -341,6 +352,7 @@ def generate(env): '_DARWIN_C_SOURCE', 'GLX_USE_APPLEGL', 'GLX_DIRECT_RENDERING', + 'BUILDING_MESA', ] else: cppdefines += [ @@ -357,9 +369,15 @@ def generate(env): if check_functions(env, ['strtod_l', 'strtof_l']): cppdefines += ['HAVE_STRTOD_L'] + if check_functions(env, ['random_r']): + cppdefines += ['HAVE_RANDOM_R'] + if check_functions(env, ['timespec_get']): cppdefines += ['HAVE_TIMESPEC_GET'] + if check_header(env, 'sys/shm.h'): + cppdefines += ['HAVE_SYS_SHM_H'] + if platform == 'windows': cppdefines += [ 'WIN32', @@ -385,10 +403,8 @@ def generate(env): ] if env['build'] in ('debug', 'checked'): cppdefines += ['_DEBUG'] - if platform == 'windows': - cppdefines += ['PIPE_SUBSYSTEM_WINDOWS_USER'] if env['embedded']: - cppdefines += ['PIPE_SUBSYSTEM_EMBEDDED'] + cppdefines += ['EMBEDDED_DEVICE'] env.Append(CPPDEFINES = cppdefines) # C compiler options @@ -477,7 +493,7 @@ def generate(env): ccflags += [ '/O2', # optimize for speed ] - if env['build'] in ('release', 'opt'): + if env['build'] == 'release': if not env['clang']: ccflags += [ '/GL', # enable whole program optimization @@ -588,7 +604,7 @@ def generate(env): shlinkflags += ['-Wl,--enable-stdcall-fixup'] #shlinkflags += ['-Wl,--kill-at'] if msvc: - if env['build'] in ('release', 'opt') and not env['clang']: + if env['build'] == 'release' and not env['clang']: # enable Link-time Code Generation linkflags += ['/LTCG'] env.Append(ARFLAGS = ['/LTCG'])