From 2916a3f40cd625cf6c978772a9b70f4eee760a85 Mon Sep 17 00:00:00 2001 From: Lucas De Marchi Date: Tue, 27 Mar 2018 22:25:42 -0700 Subject: [PATCH] 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. --- Tools/ardupilotwaf/boards.py | 5 ++++- wscript | 7 +++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Tools/ardupilotwaf/boards.py b/Tools/ardupilotwaf/boards.py index 9cae93ec3a..686f7e0755 100644 --- a/Tools/ardupilotwaf/boards.py +++ b/Tools/ardupilotwaf/boards.py @@ -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: diff --git a/wscript b/wscript index 4325764221..4a27bcfbac 100644 --- a/wscript +++ b/wscript @@ -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',