| 1 | Author: Reiner Herrmann <[email protected]>
|
| 2 | Description: Fix build with recent scons version
|
| 3 | Bug-Debian: https://bugs.debian.org/947555
|
| 4 |
|
| 5 | |
| 6 | |
| 7 | @@ -16,7 +16,7 @@
|
| 8 | env['BUILDERS']['StaticLibrary'] = picLibBuilder
|
| 9 | env['BUILDERS']['Library'] = picLibBuilder
|
| 10 |
|
| 11 | -opts = Options(['options.cache'])
|
| 12 | +opts = Variables(['options.cache'])
|
| 13 | #opts.Add('CC', 'C compiler')
|
| 14 | #opts.Add('CXX', 'C++ compiler')
|
| 15 | opts.Add('CCFLAGS', 'General options that are passed to the C compiler')
|
| 16 | @@ -33,9 +33,9 @@
|
| 17 | opts.Add('lib_dir', 'resources directory (default: prefix/lib)', '')
|
| 18 | opts.Add('plugins_dir', 'plugins directory (default: prefix/lib/btanks)', '')
|
| 19 | opts.Add('resources_dir', 'resources directory (default: prefix/share/btanks)', '')
|
| 20 | - opts.Add(BoolOption('gcc_visibility', 'gcc visibility', 'true'))
|
| 21 | + opts.Add(BoolVariable('gcc_visibility', 'gcc visibility', 'true'))
|
| 22 |
|
| 23 | -opts.Add(EnumOption('mode', 'build mode', 'release', allowed_values=('debug','release')))
|
| 24 | +opts.Add(EnumVariable('mode', 'build mode', 'release', allowed_values=('debug','release')))
|
| 25 |
|
| 26 | opts.Update(env)
|
| 27 | opts.Save('options.cache', env.Clone())
|
| 28 | @@ -47,15 +47,15 @@
|
| 29 | Export('debug')
|
| 30 |
|
| 31 | import SCons.Util
|
| 32 | -if os.environ.has_key('CC'):
|
| 33 | +if 'CC' in os.environ:
|
| 34 | env['CC'] = os.environ['CC']
|
| 35 | -if os.environ.has_key('CFLAGS'):
|
| 36 | +if 'CFLAGS' in os.environ:
|
| 37 | env['CCFLAGS'] += SCons.Util.CLVar(os.environ['CFLAGS'])
|
| 38 | -if os.environ.has_key('CXX'):
|
| 39 | +if 'CXX' in os.environ:
|
| 40 | env['CXX'] = os.environ['CXX']
|
| 41 | -if os.environ.has_key('CXXFLAGS'):
|
| 42 | +if 'CXXFLAGS' in os.environ:
|
| 43 | env['CXXFLAGS'] += SCons.Util.CLVar(os.environ['CXXFLAGS'])
|
| 44 | -if os.environ.has_key('LDFLAGS'):
|
| 45 | +if 'LDFLAGS' in os.environ:
|
| 46 | env['LINKFLAGS'] += SCons.Util.CLVar(os.environ['LDFLAGS'])
|
| 47 |
|
| 48 | if (sys.platform != "win32" and env['gcc_visibility']):
|
| 49 | @@ -174,7 +174,7 @@
|
| 50 | lib_dir = '.'
|
| 51 | plugins_dir = ''
|
| 52 | try :
|
| 53 | - version_file = file('.svnversion', 'r')
|
| 54 | + version_file = open('.svnversion', 'r')
|
| 55 | try :
|
| 56 | version = version_file.readline().strip()
|
| 57 | prefix = env['prefix']
|
| 58 | @@ -202,7 +202,7 @@
|
| 59 |
|
| 60 | except:
|
| 61 | info = sys.exc_info()
|
| 62 | - print "%s %s %s" %(info[0], info[1], info[2])
|
| 63 | + print("%s %s %s" %(info[0], info[1], info[2]))
|
| 64 | except :
|
| 65 | svnversion = os.popen('svnversion -n .', 'r')
|
| 66 | version = svnversion.readline().strip()
|
| 67 | @@ -243,29 +243,29 @@
|
| 68 | Export('plugins_dir')
|
| 69 |
|
| 70 | version = '0.9.%s' %version
|
| 71 | -print "version: %s" %version
|
| 72 | +print("version: %s" %version)
|
| 73 |
|
| 74 | bt_sublibs = ['mrt', 'sdlx', 'objects', 'clunk']
|
| 75 | env.Append(CPPPATH=['#'])
|
| 76 |
|
| 77 | if (os.path.exists('private')):
|
| 78 | dir = 'private'
|
| 79 | - BuildDir('#/build/' + buildmode + '/' + dir, dir, 0)
|
| 80 | + VariantDir('#/build/' + buildmode + '/' + dir, dir, 0)
|
| 81 | SConscript('#/build/' + buildmode + '/' + dir + '/SConscript')
|
| 82 |
|
| 83 | for dir in bt_sublibs:
|
| 84 | - BuildDir('#/build/' + buildmode + '/' + dir, dir, 0)
|
| 85 | + VariantDir('#/build/' + buildmode + '/' + dir, dir, 0)
|
| 86 | SConscript('#/build/' + buildmode + '/' + dir + '/SConscript')
|
| 87 |
|
| 88 | for dir in bt_sublibs:
|
| 89 | env.Append(LIBPATH=['#/build/' + buildmode + '/' + dir])
|
| 90 |
|
| 91 | -env.BuildDir('#/build/' + buildmode + '/editor', 'editor', 0)
|
| 92 | +env.VariantDir('#/build/' + buildmode + '/editor', 'editor', 0)
|
| 93 | SConscript('#/build/' + buildmode + '/editor/SConscript')
|
| 94 |
|
| 95 | env.Append(LIBPATH=['#/build/' + buildmode + '/engine'])
|
| 96 |
|
| 97 | -env.BuildDir('#/build/' + buildmode + '/engine', 'engine', 0)
|
| 98 | +env.VariantDir('#/build/' + buildmode + '/engine', 'engine', 0)
|
| 99 | SConscript('#/build/' + buildmode + '/engine/' + 'SConscript')
|
| 100 |
|
| 101 | if len(install_targets) > 0:
|
| 102 | |
| 103 | |
| 104 | @@ -20,7 +20,7 @@
|
| 105 | 'net_exception.cpp', 'dict_serializator.cpp',
|
| 106 | ], LIBS=libs)
|
| 107 |
|
| 108 | -if sys.platform != 'win32' and env.has_key('prefix') and len(env['prefix']) > 0:
|
| 109 | +if sys.platform != 'win32' and 'prefix' in env and len(env['prefix']) > 0:
|
| 110 | Import('install_targets')
|
| 111 | Import('lib_dir')
|
| 112 | install_targets.append(Install(lib_dir, mrt))
|