diff ext/SConscript @ 378:64738befdf3b

bringing in the changes from the build_system_rework branch in preparation for the 0.3.0 release. This commit will require the Jan2010 devkit. Clients will also need to be modified to the new way to import fife.
author vtchill@33b003aa-7bff-0310-803a-e67f0ece8222
date Mon, 11 Jan 2010 23:34:52 +0000
parents fa33cda75471
children b5e7e14004a4
line wrap: on
line diff
--- a/ext/SConscript	Wed Dec 09 17:01:52 2009 +0000
+++ b/ext/SConscript	Mon Jan 11 23:34:52 2010 +0000
@@ -1,44 +1,38 @@
-import os, shutil
+import os, sys, shutil
 from utils.util_scripts.path import path
 
 Import('env')
 
-curpath = str(path('.'))
-installpath = str((path('.') / path('install')).abspath())
+curpath = Dir('#/ext').srcnode().abspath
+installpath = Dir(os.path.join(curpath, 'install')).srcnode().abspath
 
-print "======= FIFE EXTERNAL DEPENDENCY BUILD: GUICHAN ======="
-os.chdir(str(path('.') / path('guichan-0.8.1')))
-os.system('./configure')
-os.system('make')
-os.system('make install prefix=%s' % installpath)
-
-print "======= FIFE EXTERNAL DEPENDENCY BUILD: LIBPNG ======="
-os.chdir(str(path('..')))
-os.chdir(str(path('.') / path('libpng-1.2.29')))
-os.system('./configure')
-os.system('make all-am')
-os.system('make install prefix=%s' % installpath)
-os.system('make install-data-hook prefix=%s' % installpath)
+def build_guichan(target, source, env):
+	print "======= FIFE EXTERNAL DEPENDENCY BUILD: GUICHAN ======="
+	failure = Execute(Action(['./configure',
+							  'make',
+							  'make install prefix=%s' % installpath],
+		chdir=os.path.join(curpath, 'guichan-0.8.2')))
+	
+	if (failure):
+		print 'Building failed: guichan'
+		Exit(1)
 
-print "======= FIFE EXTERNAL DEPENDENCY BUILD: OPENAL-SOFT ======="
-os.chdir('..')
-os.chdir(str(path('.') / path('openal-soft')))
-os.system('./configure')
-os.system('make')
-os.system('make install prefix=%s' % installpath)
+def build_png(target, source, env):
+	print "======= FIFE EXTERNAL DEPENDENCY BUILD: LIBPNG ======="
+	failure = Execute(Action(['./configure',
+							  'make all-am',
+							  'make install prefix=%s' % installpath,
+							  'make install-data-hook prefix=%s' % installpath],
+		chdir=os.path.join(curpath, 'libpng-1.2.29')))
+	
+	if (failure):
+		print 'Building failed: png'
+		Exit(1)
 
-print "======= FIFE EXTERNAL DEPENDENCY BUILD: UNITTEST++ ======="
-os.chdir('..')
-os.chdir(str(path('.') / path('UnitTest++')))
-os.system('make')
-shutil.copyfile('libUnitTest++.a', str(path(installpath) / path('lib') / path('libUnitTest++.a')))
-shutil.copyfile(
-	str(path('src') / path('UnitTest++.h')),
-	str(path(installpath) / path('include') / path('UnitTest++.h')))
-shutil.copyfile(
-	str(path('src') / path('TestReporterStdout.h')),
-	str(path(installpath) / path('include') / path('TestReporterStdout.h')))
-
-print "======= FIFE EXTERNAL DEPENDENCY BUILD: ALL DONE ( CHECK LOG FOR POSSIBLE ERRORS ) ======="
-
-os.chdir(curpath)
+	
+ext_cmd = env.Command('ext_target',
+					  'install',
+					  [build_guichan,
+					   build_png,
+					   os.chdir(Dir('#').abspath)])
+Alias('ext', ext_cmd)