Mercurial > fife-parpg
changeset 175:ea04dfe54aae
* Buildscripts have been modified to work with different python versions.
This applys only to linux/freebsd/darwin. For windows the only supported
python version remains 2.5.x. On linux/freebsd/darwin 2.5 and 2.6 should work.
author | nihathrael@33b003aa-7bff-0310-803a-e67f0ece8222 |
---|---|
date | Sun, 25 Jan 2009 19:07:57 +0000 |
parents | 362fe23920b9 |
children | 542213eebe73 |
files | build/darwin-config-dist.py build/freebsd6-config-dist.py build/freebsd7-config-dist.py build/linux2-config-dist.py engine/SConscript |
diffstat | 5 files changed, 29 insertions(+), 25 deletions(-) [+] |
line wrap: on
line diff
--- a/build/darwin-config-dist.py Sun Jan 25 12:49:27 2009 +0000 +++ b/build/darwin-config-dist.py Sun Jan 25 19:07:57 2009 +0000 @@ -1,4 +1,4 @@ -import os +import os, sys def initEnvironment(env): env.Append(ENV={'PATH' : os.environ['PATH']}) @@ -19,9 +19,9 @@ context.env['SHLIBSUFFIX']='.so' include_dirs = ['/opt/local/include', '/usr/local/include', '/usr/X11/include', '/Library/Frameworks/SDL.framework/Headers', - '/Library/Frameworks/SDL_image.framework/Headers', '/Library/Frameworks/SDL_ttf.framework/Headers', - '/opt/local/include/boost', '/System/Library/Frameworks/OpenAL.framework/Headers', '/opt/local/include/vorbis/', - '/usr/include/python2.5', '/opt/local/include/guichan', 'ext/install/include', '../ext/install/include', '../ext/install/include/guichan'] + '/Library/Frameworks/SDL_image.framework/Headers', '/Library/Frameworks/SDL_ttf.framework/Headers', + '/opt/local/include/boost', '/System/Library/Frameworks/OpenAL.framework/Headers', '/opt/local/include/vorbis/', + '/usr/include/python%s'%sys.version[:3], '/opt/local/include/guichan', 'ext/install/include', '../ext/install/include', '../ext/install/include/guichan'] context.env.Append(CPPPATH = include_dirs) lib_dirs = ['/opt/local/lib','/usr/local/lib','/usr/X11/lib','ext/install/lib','../ext/install/lib']
--- a/build/freebsd6-config-dist.py Sun Jan 25 12:49:27 2009 +0000 +++ b/build/freebsd6-config-dist.py Sun Jan 25 19:07:57 2009 +0000 @@ -4,6 +4,7 @@ # boost_filesystem & boost_regex # vorbisfile # openal +import sys def initEnvironment(env): return env @@ -26,6 +27,5 @@ context.env.Append(CPPPATH = ['/usr/local/include']) context.env.Append(LIBPATH = ['/usr/local/lib']) context.checkSimpleLib(['guichan_opengl']) - # For swig/python: - context.env.Append(CPPPATH = ['/usr/local/include/python2.5']) + context.env.Append(CPPPATH = ['/usr/local/include/python%s'%sys.version[:3]])
--- a/build/freebsd7-config-dist.py Sun Jan 25 12:49:27 2009 +0000 +++ b/build/freebsd7-config-dist.py Sun Jan 25 19:07:57 2009 +0000 @@ -5,6 +5,8 @@ # vorbisfile # openal +import sys + def initEnvironment(env): return env @@ -26,6 +28,5 @@ context.env.Append(CPPPATH = ['/usr/local/include']) context.env.Append(LIBPATH = ['/usr/local/lib']) context.checkSimpleLib(['guichan_opengl']) - # For swig/python: - context.env.Append(CPPPATH = ['/usr/local/include/python2.5']) + context.env.Append(CPPPATH = ['/usr/local/include/python%s'%sys.version])
--- a/build/linux2-config-dist.py Sun Jan 25 12:49:27 2009 +0000 +++ b/build/linux2-config-dist.py Sun Jan 25 19:07:57 2009 +0000 @@ -1,18 +1,21 @@ +import sys + def initEnvironment(env): return env def addExtras(context): context.env.Append(LIBS = 'm') - context.env.Replace(LIBPATH = ['/opt/lib', '%s/ext/install/lib' % context.env['SCONS_ROOT_PATH']]) + context.env.Replace(LIBPATH = ['/opt/lib', ('%s/ext/install/lib' % context.env['SCONS_ROOT_PATH'])]) context.env.Append(CPPPATH = ['/opt/include', '/usr/include/vorbis', - '/usr/include/python2.5', + '/usr/include/python%s'% sys.version[:3], + '/usr/include/SDL', '%s/ext/install/include' % context.env['SCONS_ROOT_PATH']]) - context.env.Append(CPPPATH = []) - + context.env.Append(CPPPATH = []) + context.checkSimpleLib(['vorbisfile'], 'vorbisfile.h') context.checkSimpleLib(['openal_soft'], 'AL/al.h') - context.checkSimpleLib(['python', 'python2.5'], ['python2.5/Python.h']) + context.checkSimpleLib(['python%s' % sys.version[:3], 'python2%s'%sys.version[2]], ['Python.h']) # Use current python version context.checkSimpleLib(['SDL'], 'SDL.h') context.checkSimpleLib(['SDL_ttf'], 'SDL_ttf.h') context.checkSimpleLib(['SDL_image'], 'SDL_image.h') @@ -21,7 +24,7 @@ context.checkSimpleLib(['boost_filesystem', 'boost_filesystem-gcc', 'boost_filesystem-gcc41']) context.checkSimpleLib(['boost_regex', 'boost_regex-gcc', 'boost_regex-gcc41']) context.checkSimpleLib(['png'], 'png.h'); - + if context.env['opengl']: # linking explicitly against libstdc++ to work around Segfault_in_cxa_allocate_exception issue: http://wiki.fifengine.de/Segfault_in_cxa_allocate_exception context.env.Append(LIBS = ['stdc++', 'GL', 'GLU'])
--- a/engine/SConscript Sun Jan 25 12:49:27 2009 +0000 +++ b/engine/SConscript Sun Jan 25 19:07:57 2009 +0000 @@ -23,10 +23,10 @@ swigpath = '"' + os.environ['_SWIG'] + '"\\' print " Generating language specific wrappers for " + lang - + langoutdir = joinpath(swigoutdir, lang) templatefile = joinpath(langoutdir,"fife.i.templ") - + template = Template(open(templatefile).read()) inclusions = sorted(['%include ' + str(f) for f in source]) inclusions = '\n'.join(inclusions) @@ -111,7 +111,7 @@ for k, d in source_dict.items(): create_dict_tree(d) return source_dict - + def get_msvc_repr(d, tabcount=2, curpath=''): retstr = [] for k in sorted(d.keys()): @@ -124,7 +124,7 @@ newpath = os.path.join('..', '..', '..', '..', 'engine', newpath) retstr.append(tabcount * '\t' + '<File RelativePath="%s"></File>' % newpath.replace('/','\\')) return '\n'.join(retstr) - + vcpaths = [os.path.abspath(str(f)).split('%sengine%s' % (_sep, _sep))[-1] for f in source] xmlstr = get_msvc_repr(create_dict_tree(dict([[p, {}] for p in vcpaths]))) projtxt = open(joinpath(msvcbuildpath, 'engine_template.xml'), 'r').read() @@ -161,7 +161,7 @@ for k, d in source_dict.items(): create_dict_tree(d) return source_dict - + def get_msvc_repr(d, tabcount=2, curpath=''): retstr = [] for k in sorted(d.keys()): @@ -174,7 +174,7 @@ newpath = os.path.join('..', '..', '..', '..', 'engine', newpath) retstr.append(tabcount * '\t' + '<File RelativePath="%s"></File>' % newpath.replace('/','\\')) return '\n'.join(retstr) - + vcpaths = [os.path.abspath(str(f)).split('%sengine%s' % (_sep, _sep))[-1] for f in source] xmlstr = get_msvc_repr(create_dict_tree(dict([[p, {}] for p in vcpaths]))) projtxt = open(joinpath(msvcbuildpath9, 'engine_template.xml'), 'r').read() @@ -205,7 +205,7 @@ <Option link="0"/> <Option target="default"/> </Unit>''' - + codeblocksCppDef = \ ''' <Unit filename="..\..\..\..\engine\%s"> <Option compilerVar="CPP"/> @@ -238,7 +238,7 @@ <Option link="0"/> <Option target="default"/> </Unit>''' - + codeblocksCppDef = \ ''' <Unit filename="../../../engine/%s"> <Option compilerVar="CPP"/> @@ -281,7 +281,7 @@ interfacefiles.append(f) swig = env.SwigWrappers('swigwrappers/python/fife', interfacefiles) -env.Install('$PREFIX/lib/python2.5/site-packages/fife', ['swigwrappers/python/fife.py']) +env.Install('$PREFIX/lib/python%s/site-packages/fife'%sys.version[:3], ['swigwrappers/python/fife.py']) allfiles = list(enginepath.walkfiles()) headerfiles = [f for f in allfiles if is_headerfile(f)] @@ -310,5 +310,5 @@ if sys.platform != 'win32': env.Command('swigwrappers/%s/_fife.so' % env['script'], flib, [Copy('$TARGET', '$SOURCE')]) if sys.platform != 'darwin': - env.Install('$PREFIX/lib/python2.5/site-packages/fife', flib) -# env.Install('$PREFIX/lib/python2.5/site-packages/fife', [str(f) for f in extensionfiles]) + env.Install('$PREFIX/lib/python%s/site-packages/fife'%sys.version[:3], flib) +# env.Install('$PREFIX/lib/python%s/site-packages/fife'%sys.version[:3], [str(f) for f in extensionfiles])