build: add --apstatedir for Linux boards

This is the --localstatedir that is found on other
buildsystems/programs + the package directory. We could provide a
--localstatedir instead to be similar to the others, but I thought it
would be too confusing for the help message.
This commit is contained in:
Lucas De Marchi 2018-03-27 22:25:42 -07:00 committed by Lucas De Marchi
parent 1e7ad72909
commit 2916a3f40c
2 changed files with 11 additions and 1 deletions

View File

@ -437,7 +437,10 @@ class linux(Board):
if self.with_uavcan:
cfg.define('UAVCAN_EXCEPTIONS', 0)
if cfg.options.apstatedir:
cfg.define('AP_STATEDIR', cfg.options.apstatedir)
def build(self, bld):
super(linux, self).build(bld)
if bld.options.upload:

View File

@ -101,6 +101,13 @@ submodules at specific revisions.
opt.parser.remove_option(k)
g.add_option(option)
g.add_option('--apstatedir',
action='store',
default='',
help='''Where to save data like parameters, log and terrain.
This is the --localstatedir + ArduPilot's subdirectory [default:
board-dependent, usually /var/lib/ardupilot]''')
g.add_option('--rsync-dest',
dest='rsync_dest',
action='store',