waf: mavgen: reorganize configure

The configure function was reorganized for:
 - removing variables that are not used
 - making it more general, i.e., not relying in ardupilotmega.xml, so that this
   tool can be used for generating other headers in the future
This commit is contained in:
Gustavo Jose de Sousa 2016-01-14 17:55:54 -02:00 committed by Andrew Tridgell
parent 46449ee032
commit ff02adf57e

View File

@ -53,16 +53,11 @@ def configure(cfg):
env = cfg.env
cfg.start_msg('Checking for message_definitions')
if not cfg.srcnode.find_resource('modules/mavlink/message_definitions/v1.0/ardupilotmega.xml'):
cfg.fatal(env.MAV_MSG_DEFS + ' not found, please run: git submodule init && git submodule update', color='RED')
cfg.start_msg('Checking for mavgen')
if not cfg.srcnode.find_resource('modules/mavlink/pymavlink/tools/mavgen.py'):
cfg.fatal('not found, please run: git submodule init && git submodule update')
return
cfg.end_msg('success')
cfg.end_msg('yes')
env.MAVLINK_DIR = cfg.srcnode.find_dir('modules/mavlink/').abspath()
env.MAVLINK_HEADERS = cfg.bldnode.make_node('/libraries/GCS_MAVLink/include/mavlink/v1.0/').abspath()
env.MAVGEN = env.MAVLINK_DIR + '/pymavlink/tools/mavgen.py'
env.MAV_MSG_DEFS = cfg.srcnode.find_resource('modules/mavlink/message_definitions/v1.0/ardupilotmega.xml').abspath()