mirror of https://github.com/ArduPilot/ardupilot
build: fix static linking through --static option
This commit is contained in:
parent
9ea4a9233d
commit
2b1b23cabf
|
@ -179,9 +179,9 @@ def check_lttng(cfg, env):
|
|||
|
||||
@conf
|
||||
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
|
||||
cfg.msg("libiio disabled for static build", 'disabled', color='YELLOW')
|
||||
cfg.msg("Checking for 'libiio':", 'disabled for static build', color='YELLOW')
|
||||
return False
|
||||
if cfg.options.disable_libiio:
|
||||
cfg.msg("Checking for 'libiio':", 'disabled', color='YELLOW')
|
||||
|
@ -192,9 +192,9 @@ def check_libiio(cfg, env):
|
|||
|
||||
@conf
|
||||
def check_libdl(cfg, env):
|
||||
if env.STATIC_LINKING:
|
||||
if cfg.env.STATIC_LINKING:
|
||||
# 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
|
||||
ret = cfg.check(compiler='cxx', lib='dl', mandatory=False, global_define=True, define_name='HAVE_LIBDL')
|
||||
if ret:
|
||||
|
|
4
wscript
4
wscript
|
@ -132,8 +132,8 @@ def configure(cfg):
|
|||
cfg.define('WAF_BUILD', 1)
|
||||
|
||||
if cfg.options.static:
|
||||
cfg.msg('Using static linking')
|
||||
env.STATIC_LINKING = True
|
||||
cfg.msg('Using static linking', 'yes', color='YELLOW')
|
||||
cfg.env.STATIC_LINKING = True
|
||||
|
||||
cfg.msg('Setting board to', cfg.options.board)
|
||||
cfg.get_board().configure(cfg)
|
||||
|
|
Loading…
Reference in New Issue