summaryrefslogtreecommitdiff
path: root/platform/flash/detect.py
blob: 56d2516ab5bef1dfd7f6f42266c9d57261f34914 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
import os
import sys
import string

def is_active():
	return True
	
def get_name():
	return "Flash"

def can_build():

	#import os
	print(os.environ)
	if (not os.environ.has_key("FLASCC_ROOT")):
		return False
	return True

def get_opts():

	return []
	

def get_flags():

	return [
		('lua', 'no'),
		('tools', 'no'),
		('nedmalloc', 'no'),
		('theora', 'no'),
		('squirrel', 'yes'),
		('gdscript', 'yes'),
		('minizip', 'no'),
		('vorbis', 'yes'),
		('squish', 'yes'),
		('speex', 'yes'),
		('xml', 'yes'),
		('png', 'yes'),
		('jpg', 'yes'),
		('webp', 'yes'),
		('dds', 'yes'),
		('pvr', 'yes'),
		('musepack', 'yes'),
		('default_gui_theme', 'yes'),
		('old_scenes', 'no'),
	]


def configure(env):

	ccroot = os.environ["FLASCC_ROOT"]

	if (ccroot.find("/cygdrive")==0):
		unit = ccroot[ ccroot.find("/") + 1 ]
		ccroot=ccroot.replace("/cygdrive/"+unit,unit+":")
		
	env['FLASCC_ROOT'] = ccroot
	if env['PLATFORM'] == 'win32':
		import methods
		env.Tool('mingw')
		#env['SPAWN'] = methods.win32_spawn

	env['ENV']['PATH'] = os.environ["PATH"];
	env.PrependENVPath('PATH', env['FLASCC_ROOT']+'/usr/bin')
	#os.environ['PATH'] = env['ENV']['PATH']

	env.Append(CPPPATH=['#platform/flash', '#platform/flash/include'])
	env.Append(LIBPATH=['#platform/flash/lib'])

	env['CC'] = ccroot+'/sdk/usr/bin/gcc'
	env['CXX'] = ccroot+'/sdk/usr/bin/g++'
	env['AR'] = ccroot+'/sdk/usr/bin/ar'
	env['LINK'] = ccroot+'/sdk/usr/bin/gcc'

	
	env['OBJSUFFIX'] = ".fl.o"
	env['LIBSUFFIX'] = ".fl.a"
	env['PROGSUFFIX'] = "_flash"
	
	#env["CXX"]='gcc-4'
	import string
	#include path
	env['CCFLAGS'] = string.split('-fno-strict-aliasing -fno-rtti -fno-common -finline-limit=30000 -fno-exceptions -DNO_SAFE_CAST -DNO_THREADS -DNO_NETWORK -DNO_STATVFS')

	#env.Append(LDPATH=[ld_path])
	env.Append(LIBS=['m', 'Flash++', 'AS3++', 'GL'])

	env.Append(LINKFLAGS=['-symbol-abc=platform/flash/Console.abc'])
	#env["LINKFLAGS"]= string.split(" -g --sysroot="+ld_sysroot+" -Wl,--no-undefined -Wl,-z,noexecstack -lsupc++ ")

	#env.Append(CXXFLAGS=['-fno-access-control'])

	if (env["target"]=="release"):

		env.Append(CCFLAGS=['-O4', '-ffast-math','-fomit-frame-pointer'])
		env['OBJSUFFIX'] = ".fo.o"
		env['LIBSUFFIX'] = ".fo.a"
		env['PROGSUFFIX'] = "_opt_flash"

	elif (env["target"]=="debug"):

		env.Append(CCFLAGS=['-D_DEBUG', '-g0', '-Wall', '-O0', '-DDEBUG_ENABLED'])
		env.Append(CPPFLAGS=['-DDEBUG_MEMORY_ALLOC'])

	env.Append(CPPFLAGS=['-DFLASH_ENABLED', '-DGLES1_ENABLED', '-DNO_FCNTL', '-DUNIX_ENABLED'])
#	env.Append(CPPFLAGS=['-DANDROID_ENABLED', '-DUNIX_ENABLED','-DMPC_FIXED_POINT'])