# HG changeset patch
# User nihathrael@33b003aa-7bff-0310-803a-e67f0ece8222
# Date 1232910477 0
# Node ID ea04dfe54aaebd07ce8171f377ad130dcf9c9edc
# Parent 362fe23920b9bec948add6a8223b87f4f3d1c6e4
* 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.
diff -r 362fe23920b9 -r ea04dfe54aae build/darwin-config-dist.py
--- 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']
diff -r 362fe23920b9 -r ea04dfe54aae build/freebsd6-config-dist.py
--- 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]])
diff -r 362fe23920b9 -r ea04dfe54aae build/freebsd7-config-dist.py
--- 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])
diff -r 362fe23920b9 -r ea04dfe54aae build/linux2-config-dist.py
--- 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'])
diff -r 362fe23920b9 -r ea04dfe54aae engine/SConscript
--- 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' + '' % 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' + '' % 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 @@
'''
-
+
codeblocksCppDef = \
'''
@@ -238,7 +238,7 @@
'''
-
+
codeblocksCppDef = \
'''
@@ -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])