about summary refs log tree commit diff
path: root/default.bam
diff options
context:
space:
mode:
authorMagnus Auvinen <magnus.auvinen@gmail.com>2008-11-29 10:19:00 +0000
committerMagnus Auvinen <magnus.auvinen@gmail.com>2008-11-29 10:19:00 +0000
commit7c3eb2d6dbe2d99a868de887c37dd06aa8fd068a (patch)
treebba0f35ae24dbdf2d7de2071d953b2f2ff1097ad /default.bam
parent4004d13b48fd303c982dbcf7c432add64d128637 (diff)
downloadzcatch-7c3eb2d6dbe2d99a868de887c37dd06aa8fd068a.tar.gz
zcatch-7c3eb2d6dbe2d99a868de887c37dd06aa8fd068a.zip
made sdl like a little bampack
Diffstat (limited to 'default.bam')
-rw-r--r--default.bam78
1 files changed, 3 insertions, 75 deletions
diff --git a/default.bam b/default.bam
index 18adf483..1ff18325 100644
--- a/default.bam
+++ b/default.bam
@@ -1,85 +1,13 @@
 CheckVersion("0.1")
 
+require("other/sdl/sdl.bam")
+
 --- Setup Config --------
 config = NewConfig()
 config:add(OptFindCompiler())
 config:add(OptTestCompileC("stackprotector", "int main(){return 0;}", "-fstack-protector -fstack-protector-all"))
 config:add(OptFindLibrary("zlib", "zlib.h", false))
-
-function OptFindSDL(name, required)
-	local check = function(option)
-		option.value = nil
-		option.use_sdlconfig = nil
-		option.use_win32sdl = nil
-		option.use_osxframework = nil
-		option.lib_path = nil
-		
-		if ExecuteSilent("sdl-config") > 0 and ExecuteSilent("sdl-config --cflags") == 0 then
-			option.value = 1
-			option.use_sdlconfig = 1
-		end
-		
-		if platform == "win32" then
-			option.value = 1
-			option.use_win32sdl = 1
-		end
-		
-		if platform == "macosx" then
-			option.value = 1
-			option.use_osxframework = 1
-		end
-	end
-	
-	local apply = function(option, settings)
-		if option.use_sdlconfig then
-			settings.cc.flags = settings.cc.flags .. " -I/usr/include/SDL "
-			settings.linker.flags = settings.linker.flags .. " `sdl-config --libs` "
-		end
-
-		if option.use_osxframework then
-			client_settings.linker.frameworks:add("SDL")
-			client_settings.cc.includes:add("/Library/Frameworks/SDL.framework/Headers")
-		end
-
-		if option.use_win32sdl then
-			settings.cc.includes:add("other/sdl_include")
-			settings.linker.libpath:add("other/vc2005_sdllibs")
-			settings.linker.libs:add("SDL")
-			settings.linker.libs:add("SDLmain")
-		end
-	end
-	
-	local save = function(option, output)
-		output:option(option, "value")
-		output:option(option, "use_sdlconfig")
-		output:option(option, "use_win32sdl")
-		output:option(option, "use_osxframework")
-	end
-	
-	local display = function(option)
-		if option.value then
-			if option.use_sdlconfig then return "using sdl-config" end
-			if option.use_win32sdl then return "using supplied win32 libraries" end
-			if option.use_osxframework then return "using osx framework" end
-			return "using unknown method"
-		else
-			if option.required then
-				return "not found (required)"
-			else
-				return "not found (optional)"
-			end
-		end
-	end
-	
-	local o = MakeOption(name, 0, check, save, display)
-	o.apply = apply
-	o.include_path = nil
-	o.lib_path = nil
-	o.required = required
-	return o
-end
-
-config:add(OptFindSDL("sdl", true))
+config:add(SDL.OptFind("sdl", true))
 
 --- Auto detect ------
 if not config:load("config.bam") then