3 # Jérôme Carretero, 2011 (zougloub)
5 from waflib
import Options
6 from waflib
.Tools
import ccroot
7 from waflib
.Configure
import conf
11 conf
.find_program(['dcc'], var
='CC', path_list
=getattr(Options
.options
, 'diabbindir', ""))
12 conf
.env
.CC_NAME
= 'dcc'
16 conf
.find_program(['dld'], var
='LINK_CC', path_list
=getattr(Options
.options
, 'diabbindir', ""))
17 conf
.env
.LINK_CC_NAME
= 'dld'
21 conf
.find_program(['dar'], var
='AR', path_list
=getattr(Options
.options
, 'diabbindir', ""))
22 conf
.env
.AR_NAME
= 'dar'
23 conf
.env
.ARFLAGS
= 'rcs'
27 conf
.find_program(['ddump'], var
='DDUMP', path_list
=getattr(Options
.options
, 'diabbindir', ""))
30 def dcc_common_flags(conf
):
33 v
['CC_TGT_F'] = ['-c', '-o']
36 if not v
['LINK_CC']: v
['LINK_CC'] = v
['CC']
38 v
['CCLNK_TGT_F'] = ['-o']
39 v
['CPPPATH_ST'] = '-I%s'
40 v
['DEFINES_ST'] = '-D%s'
42 v
['LIB_ST'] = '-l:%s' # template for adding libs
43 v
['LIBPATH_ST'] = '-L%s' # template for adding libpaths
44 v
['STLIB_ST'] = '-l:%s'
45 v
['STLIBPATH_ST'] = '-L%s'
46 v
['RPATH_ST'] = '-Wl,-rpath,%s'
47 #v['STLIB_MARKER'] = '-Wl,-Bstatic'
50 v
['cprogram_PATTERN'] = '%s.elf'
53 v
['LINKFLAGS_cstlib'] = ['-Wl,-Bstatic']
54 v
['cstlib_PATTERN'] = 'lib%s.a'
61 conf
.dcc_common_flags()
68 Add the ``--with-diab-bindir`` command-line options.
70 opt
.add_option('--with-diab-bindir', type='string', dest
='diabbindir', help = 'Specify alternate diab bin folder', default
="")