3 def generate(env
, gcc_cross_prefix
=None, gcc_strict
=True, gcc_stop_on_warning
=None, gcc_extra_options
=''):
4 if gcc_stop_on_warning
== None: gcc_stop_on_warning
= env
['stop_on_warning']
8 env
.AppendUnique(CCFLAGS
= ['-pedantic', '-Wall', '-W', '-Wundef', '-Wno-long-long'])
9 env
.AppendUnique(CFLAGS
= ['-Wmissing-prototypes', '-Wmissing-declarations'])
11 env
.AppendUnique(CCFLAGS
= ['-Wall'])
13 compiler_defines
= ['-D_REENTRANT']
14 env
.AppendUnique(CCFLAGS
= compiler_defines
)
15 env
.AppendUnique(CPPFLAGS
= compiler_defines
)
17 if env
['build_config'] == 'Debug':
18 env
.AppendUnique(CCFLAGS
= '-g')
20 env
.AppendUnique(CCFLAGS
= '-O3')
22 if gcc_stop_on_warning
:
23 env
.AppendUnique(CCFLAGS
= ['-Werror'])
25 env
['STRIP'] = 'strip'
28 env
['ENV']['PATH'] += os
.environ
['PATH']
29 env
['AR'] = gcc_cross_prefix
+'-ar'
30 env
['RANLIB'] = gcc_cross_prefix
+'-ranlib'
31 env
['CC'] = gcc_cross_prefix
+'-gcc ' + gcc_extra_options
32 env
['CXX'] = gcc_cross_prefix
+'-g++ ' + gcc_extra_options
33 env
['LINK'] = gcc_cross_prefix
+'-g++ ' + gcc_extra_options
34 env
['STRIP'] = gcc_cross_prefix
+'-strip'