build: fix static linking through --static option

This commit is contained in:
Lucas De Marchi 2016-07-19 12:10:21 -03:00
parent 9ea4a9233d
commit 2b1b23cabf
2 changed files with 6 additions and 6 deletions

View File

@ -179,9 +179,9 @@ def check_lttng(cfg, env):
@conf @conf
def check_libiio(cfg, env): def check_libiio(cfg, env):
if env.STATIC_LINKING: if cfg.env.STATIC_LINKING:
# libiio depends on libdl which means it can't be used in a static build # libiio depends on libdl which means it can't be used in a static build
cfg.msg("libiio disabled for static build", 'disabled', color='YELLOW') cfg.msg("Checking for 'libiio':", 'disabled for static build', color='YELLOW')
return False return False
if cfg.options.disable_libiio: if cfg.options.disable_libiio:
cfg.msg("Checking for 'libiio':", 'disabled', color='YELLOW') cfg.msg("Checking for 'libiio':", 'disabled', color='YELLOW')
@ -192,9 +192,9 @@ def check_libiio(cfg, env):
@conf @conf
def check_libdl(cfg, env): def check_libdl(cfg, env):
if env.STATIC_LINKING: if cfg.env.STATIC_LINKING:
# using loadable modules for a static build is not recommended # using loadable modules for a static build is not recommended
cfg.msg("libdl disabled for static build", 'disabled', color='YELLOW') cfg.msg("Checking for 'libdl':", 'disabled for static build', color='YELLOW')
return False return False
ret = cfg.check(compiler='cxx', lib='dl', mandatory=False, global_define=True, define_name='HAVE_LIBDL') ret = cfg.check(compiler='cxx', lib='dl', mandatory=False, global_define=True, define_name='HAVE_LIBDL')
if ret: if ret:

View File

@ -132,8 +132,8 @@ def configure(cfg):
cfg.define('WAF_BUILD', 1) cfg.define('WAF_BUILD', 1)
if cfg.options.static: if cfg.options.static:
cfg.msg('Using static linking') cfg.msg('Using static linking', 'yes', color='YELLOW')
env.STATIC_LINKING = True cfg.env.STATIC_LINKING = True
cfg.msg('Setting board to', cfg.options.board) cfg.msg('Setting board to', cfg.options.board)
cfg.get_board().configure(cfg) cfg.get_board().configure(cfg)