This commit is contained in:
Thomas Nagy 2011-11-06 14:34:10 +01:00
parent 977372d94a
commit 612cb9b8b3
1 changed files with 9 additions and 4 deletions

View File

@ -92,7 +92,7 @@ MACRO_TO_DEST_CPU = {
} }
@conf @conf
def parse_flags(self, line, uselib, env=None): def parse_flags(self, line, uselib, env=None, force_static=False):
""" """
Parse the flags from the input lines, and add them to the relevant use variables:: Parse the flags from the input lines, and add them to the relevant use variables::
@ -142,7 +142,8 @@ def parse_flags(self, line, uselib, env=None):
app('DEFINES_' + uselib, [ot]) app('DEFINES_' + uselib, [ot])
elif st == '-l': elif st == '-l':
if not ot: ot = lst.pop(0) if not ot: ot = lst.pop(0)
appu('LIB_' + uselib, [ot]) prefix = force_static and 'STLIB_' or 'LIB_'
appu(prefix + uselib, [ot])
elif st == '-L': elif st == '-L':
if not ot: ot = lst.pop(0) if not ot: ot = lst.pop(0)
appu('LIBPATH_' + uselib, [ot]) appu('LIBPATH_' + uselib, [ot])
@ -301,15 +302,19 @@ def exec_cfg(self, kw):
kw['okmsg'] = 'yes' kw['okmsg'] = 'yes'
return return
static = False
if 'args' in kw: if 'args' in kw:
lst += Utils.to_list(kw['args']) args = Utils.to_list(kw['args'])
if '--static' in args or '--static-libs' in args:
static = True
lst += args
# so we assume the command-line will output flags to be parsed afterwards # so we assume the command-line will output flags to be parsed afterwards
ret = self.cmd_and_log(lst) ret = self.cmd_and_log(lst)
if not 'okmsg' in kw: if not 'okmsg' in kw:
kw['okmsg'] = 'yes' kw['okmsg'] = 'yes'
self.define(self.have_define(kw.get('uselib_store', kw['package'])), 1, 0) self.define(self.have_define(kw.get('uselib_store', kw['package'])), 1, 0)
self.parse_flags(ret, kw.get('uselib_store', kw['package'].upper()), kw.get('env', self.env)) self.parse_flags(ret, kw.get('uselib_store', kw['package'].upper()), kw.get('env', self.env), force_static=static)
return ret return ret
@conf @conf