scons: use python3-compatible print()

These changes were generated using python's `2to3` tool.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=102852
Reported-by: Alex Granni <liviuprodea@yahoo.com>
Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
This commit is contained in:
Eric Engestrom
2017-09-19 13:56:34 +01:00
parent 3f6a17a8fc
commit 7d48219b3a
8 changed files with 30 additions and 30 deletions

View File

@@ -50,10 +50,10 @@ except KeyError:
pass pass
else: else:
targets = targets.split(',') targets = targets.split(',')
print 'scons: warning: targets option is deprecated; pass the targets on their own such as' print('scons: warning: targets option is deprecated; pass the targets on their own such as')
print print()
print ' scons %s' % ' '.join(targets) print(' scons %s' % ' '.join(targets))
print print()
COMMAND_LINE_TARGETS.append(targets) COMMAND_LINE_TARGETS.append(targets)

View File

@@ -257,16 +257,16 @@ def generate(env):
# Backwards compatability with the debug= profile= options # Backwards compatability with the debug= profile= options
if env['build'] == 'debug': if env['build'] == 'debug':
if not env['debug']: if not env['debug']:
print 'scons: warning: debug option is deprecated and will be removed eventually; use instead' print('scons: warning: debug option is deprecated and will be removed eventually; use instead')
print print('')
print ' scons build=release' print(' scons build=release')
print print('')
env['build'] = 'release' env['build'] = 'release'
if env['profile']: if env['profile']:
print 'scons: warning: profile option is deprecated and will be removed eventually; use instead' print('scons: warning: profile option is deprecated and will be removed eventually; use instead')
print print('')
print ' scons build=profile' print(' scons build=profile')
print print('')
env['build'] = 'profile' env['build'] = 'profile'
if False: if False:
# Enforce SConscripts to use the new build variable # Enforce SConscripts to use the new build variable
@@ -300,7 +300,7 @@ def generate(env):
env['build_dir'] = build_dir env['build_dir'] = build_dir
env.SConsignFile(os.path.join(build_dir, '.sconsign')) env.SConsignFile(os.path.join(build_dir, '.sconsign'))
if 'SCONS_CACHE_DIR' in os.environ: if 'SCONS_CACHE_DIR' in os.environ:
print 'scons: Using build cache in %s.' % (os.environ['SCONS_CACHE_DIR'],) print('scons: Using build cache in %s.' % (os.environ['SCONS_CACHE_DIR'],))
env.CacheDir(os.environ['SCONS_CACHE_DIR']) env.CacheDir(os.environ['SCONS_CACHE_DIR'])
env['CONFIGUREDIR'] = os.path.join(build_dir, 'conf') env['CONFIGUREDIR'] = os.path.join(build_dir, 'conf')
env['CONFIGURELOG'] = os.path.join(os.path.abspath(build_dir), 'config.log') env['CONFIGURELOG'] = os.path.join(os.path.abspath(build_dir), 'config.log')
@@ -385,8 +385,8 @@ def generate(env):
if env['embedded']: if env['embedded']:
cppdefines += ['PIPE_SUBSYSTEM_EMBEDDED'] cppdefines += ['PIPE_SUBSYSTEM_EMBEDDED']
if env['texture_float']: if env['texture_float']:
print 'warning: Floating-point textures enabled.' print('warning: Floating-point textures enabled.')
print 'warning: Please consult docs/patents.txt with your lawyer before building Mesa.' print('warning: Please consult docs/patents.txt with your lawyer before building Mesa.')
cppdefines += ['TEXTURE_FLOAT_ENABLED'] cppdefines += ['TEXTURE_FLOAT_ENABLED']
env.Append(CPPDEFINES = cppdefines) env.Append(CPPDEFINES = cppdefines)

View File

@@ -68,13 +68,13 @@ def generate(env):
if env['platform'] == 'windows': if env['platform'] == 'windows':
# XXX: There is no llvm-config on Windows, so assume a standard layout # XXX: There is no llvm-config on Windows, so assume a standard layout
if llvm_dir is None: if llvm_dir is None:
print 'scons: LLVM environment variable must be specified when building for windows' print('scons: LLVM environment variable must be specified when building for windows')
return return
# Try to determine the LLVM version from llvm/Config/config.h # Try to determine the LLVM version from llvm/Config/config.h
llvm_config = os.path.join(llvm_dir, 'include/llvm/Config/llvm-config.h') llvm_config = os.path.join(llvm_dir, 'include/llvm/Config/llvm-config.h')
if not os.path.exists(llvm_config): if not os.path.exists(llvm_config):
print 'scons: could not find %s' % llvm_config print('scons: could not find %s' % llvm_config)
return return
llvm_version_major_re = re.compile(r'^#define LLVM_VERSION_MAJOR ([0-9]+)') llvm_version_major_re = re.compile(r'^#define LLVM_VERSION_MAJOR ([0-9]+)')
llvm_version_minor_re = re.compile(r'^#define LLVM_VERSION_MINOR ([0-9]+)') llvm_version_minor_re = re.compile(r'^#define LLVM_VERSION_MINOR ([0-9]+)')
@@ -92,10 +92,10 @@ def generate(env):
llvm_version = distutils.version.LooseVersion('%s.%s' % (llvm_version_major, llvm_version_minor)) llvm_version = distutils.version.LooseVersion('%s.%s' % (llvm_version_major, llvm_version_minor))
if llvm_version is None: if llvm_version is None:
print 'scons: could not determine the LLVM version from %s' % llvm_config print('scons: could not determine the LLVM version from %s' % llvm_config)
return return
if llvm_version < distutils.version.LooseVersion(required_llvm_version): if llvm_version < distutils.version.LooseVersion(required_llvm_version):
print 'scons: LLVM version %s found, but %s is required' % (llvm_version, required_llvm_version) print('scons: LLVM version %s found, but %s is required' % (llvm_version, required_llvm_version))
return return
env.Prepend(CPPPATH = [os.path.join(llvm_dir, 'include')]) env.Prepend(CPPPATH = [os.path.join(llvm_dir, 'include')])
@@ -231,14 +231,14 @@ def generate(env):
else: else:
llvm_config = os.environ.get('LLVM_CONFIG', 'llvm-config') llvm_config = os.environ.get('LLVM_CONFIG', 'llvm-config')
if not env.Detect(llvm_config): if not env.Detect(llvm_config):
print 'scons: %s script not found' % llvm_config print('scons: %s script not found' % llvm_config)
return return
llvm_version = env.backtick('%s --version' % llvm_config).rstrip() llvm_version = env.backtick('%s --version' % llvm_config).rstrip()
llvm_version = distutils.version.LooseVersion(llvm_version) llvm_version = distutils.version.LooseVersion(llvm_version)
if llvm_version < distutils.version.LooseVersion(required_llvm_version): if llvm_version < distutils.version.LooseVersion(required_llvm_version):
print 'scons: LLVM version %s found, but %s is required' % (llvm_version, required_llvm_version) print('scons: LLVM version %s found, but %s is required' % (llvm_version, required_llvm_version))
return return
try: try:
@@ -264,13 +264,13 @@ def generate(env):
env.ParseConfig('%s --system-libs' % llvm_config) env.ParseConfig('%s --system-libs' % llvm_config)
env.Append(CXXFLAGS = ['-std=c++11']) env.Append(CXXFLAGS = ['-std=c++11'])
except OSError: except OSError:
print 'scons: llvm-config version %s failed' % llvm_version print('scons: llvm-config version %s failed' % llvm_version)
return return
assert llvm_version is not None assert llvm_version is not None
env['llvm'] = True env['llvm'] = True
print 'scons: Found LLVM version %s' % llvm_version print('scons: Found LLVM version %s' % llvm_version)
env['LLVM_VERSION'] = llvm_version env['LLVM_VERSION'] = llvm_version
# Define HAVE_LLVM macro with the major/minor version number (e.g., 0x0206 for 2.6) # Define HAVE_LLVM macro with the major/minor version number (e.g., 0x0206 for 2.6)

View File

@@ -30,7 +30,7 @@ def write_git_sha1_h_file(filename):
try: try:
subprocess.Popen(args, stdout=f).wait() subprocess.Popen(args, stdout=f).wait()
except: except:
print "Warning: exception in write_git_sha1_h_file()" print("Warning: exception in write_git_sha1_h_file()")
return return
if not os.path.exists(filename) or not filecmp.cmp(tempfile, filename): if not os.path.exists(filename) or not filecmp.cmp(tempfile, filename):

View File

@@ -4,7 +4,7 @@ import distutils.version
Import('*') Import('*')
if not env['llvm']: if not env['llvm']:
print 'warning: LLVM disabled: not building llvmpipe' print('warning: LLVM disabled: not building llvmpipe')
Return() Return()
env = env.Clone() env = env.Clone()

View File

@@ -5,7 +5,7 @@ env = env.Clone()
env.MSVC2013Compat() env.MSVC2013Compat()
if env['suncc']: if env['suncc']:
print 'warning: not building svga' print('warning: not building svga')
Return() Return()
env.Append(CPPDEFINES = [ env.Append(CPPDEFINES = [

View File

@@ -8,12 +8,12 @@ if not env['swr']:
Return() Return()
if not env['llvm']: if not env['llvm']:
print 'warning: LLVM disabled: not building swr' print('warning: LLVM disabled: not building swr')
env['swr'] = False env['swr'] = False
Return() Return()
if env['LLVM_VERSION'] < distutils.version.LooseVersion('3.9'): if env['LLVM_VERSION'] < distutils.version.LooseVersion('3.9'):
print "warning: swr requires LLVM >= 3.9: not building swr" print("warning: swr requires LLVM >= 3.9: not building swr")
env['swr'] = False env['swr'] = False
Return() Return()
@@ -28,7 +28,7 @@ if env['platform'] == 'windows':
else: else:
llvm_config = os.environ.get('LLVM_CONFIG', 'llvm-config') llvm_config = os.environ.get('LLVM_CONFIG', 'llvm-config')
llvm_includedir = env.backtick('%s --includedir' % llvm_config).rstrip() llvm_includedir = env.backtick('%s --includedir' % llvm_config).rstrip()
print "llvm include dir %s" % llvm_includedir print("llvm include dir %s" % llvm_includedir)
if not env['msvc'] : if not env['msvc'] :
env.Append(CCFLAGS = [ env.Append(CCFLAGS = [

View File

@@ -3,7 +3,7 @@ Import('*')
env = drienv.Clone() env = drienv.Clone()
if env['suncc']: if env['suncc']:
print 'warning: not building dri-vmwgfx' print('warning: not building dri-vmwgfx')
Return() Return()
env.Append(CPPPATH = [ env.Append(CPPPATH = [