diff build/linux2-config-dist.py @ 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 b49714fff478
children 542213eebe73
line wrap: on
line diff
--- 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'])