Commit Graph

2118 Commits

Author SHA1 Message Date
Gustavo Jose de Sousa 07700a821c waf: cmake: add method get_cmake_bldnode()
That allows a user to have access to the cmake build node before the configure
task generator is posted.
2016-03-14 11:54:30 -03:00
Gustavo Jose de Sousa b077613f28 waf: cmake: use BLUE color for cmake tasks 2016-03-14 11:54:30 -03:00
Gustavo Jose de Sousa 03146c5d15 waf: cmake: move cmake build task creation to a function
That enables other tools to create the task directly.
2016-03-14 11:54:30 -03:00
Gustavo Jose de Sousa 049abec55b waf: cmake: add keyword parameter cmake_output_patterns 2016-03-14 11:54:30 -03:00
Gustavo Jose de Sousa 4f82120c8f waf: cmake: improve documentation regarding target option
That feature can also be used within wscripts with no problem. The code added
in the example shows that.
2016-03-14 11:54:29 -03:00
Grant Morphett 0d9a3840d8 autotest: Added submodule update and removed old modules update
Firstly build.All was failing as the submodules had not been updated
so the 'git submodule update' in this commit resovles that.
Secondly, now that the dependant projects like PX4Firmware etc are git
submodules of ardupilot we no longer need to check them out separately
and update them so I have removed all those.
I left MAVProxy as it isn't a submodule of ardupilot.
2016-03-08 11:40:48 +11:00
Gustavo Jose de Sousa 86c1c6da5c waf: fix environment boolean values
It is more natural to use `env.FOO = True` then `env.foo = [True]`.
2016-03-03 14:58:03 -03:00
Gustavo Jose de Sousa 79b724dce8 waf: ardupilotwaf: fix board env processing
Two things are fixed with this patch:
    1. We sort dictionaries' keys if they aren't OrderedDict instances. Since
    dict objects don't guarantee order, environment variables may have contents
    in wrong order, causing unnecessary rebuilds.
    2. We only use prepend_value() if there's already a value set for the key
    and that value is list. Before this change, boards couldn't set
    non-iterable values.
2016-03-03 14:58:03 -03:00
Lucas De Marchi cca8a86962 Tools: Use GCC 4.9 as an Ubuntu prereq
This should actually use the install-prereq script so we don't duplicate
effort on the maintenance of these scripts. But let's at least install
the correct version for now.
2016-02-29 17:00:27 -03:00
Fredrik Hedberg e88e8835b1 Tools: Use GCC 4.9 as an Ubuntu prereq as older version is no longer available. 2016-02-29 16:58:48 -03:00
Gustavo Jose de Sousa 1233022c78 waf: cmake: synchronize cmake build tasks of same configuration
Running cmake build tasks of the same configuration in parallel my cause race
condition.
2016-02-27 03:15:45 -03:00
Gustavo Jose de Sousa 8734432196 waf: ardupilotwaf: don't use Node object for ap_program target
That will make platform specific naming be ignored. We use a string instead, to
let Waf tweak the target name correctly for us. The '#' prefix is to tell Waf
that the path is relative to bld.bldnode (instead of bld.path, which is the
default).
2016-02-27 03:13:08 -03:00
Staroselskii Georgii 1107190656 waf: boards: add navio2 2016-02-27 03:06:50 -03:00
Andrew Tridgell 15945c50cb scripts: ensure we have clean build for px4 2016-02-24 19:33:16 +11:00
Gustavo Jose de Sousa 181b6f5c2e waf: cmake: do a clean configuration
We need to remove CMakeCache.txt, otherwise cached variables would remain the
old value when they are removed from cmake_vars parameter.

We use `os.remove()` instead of `Node.delete()` because the latter removes the
node instance from its parent's children list. That makes the node be ignored
when storing persistent information after the build, thus the node signature
wouldn't be saved with that approach, which would make waf always think that
the task should be executed.
2016-02-22 15:36:48 -03:00
Gustavo Jose de Sousa eacf9d8a0e waf: cmake: declare CMAKE_BLD_DIR as a value dependency
Since we set that value to the task's cwd property, we need to declare it as a
value dependency of cmake_configure_task.
2016-02-22 15:36:48 -03:00
Gustavo Jose de Sousa 6c914349d0 waf: cmake: define proper uid() functions
The default implementation takes into account the task's output and input
nodes. That isn't very well applicable for cmake tasks, so we define proper
uid() methods.
2016-02-22 15:36:48 -03:00
Gustavo Jose de Sousa b5f20459e7 waf: cmake: set CMakeCache.txt as output of cmake_configure task
That provides the behavior we implemented in runnable_status(). Thus, we don't
have to override that method anymore.
2016-02-22 15:36:48 -03:00
Gustavo Jose de Sousa ed288ed345 waf: cmake: ensure order of cmake_vars
We need to ensure the order in which the variables are defined to avoid
unnecessary execution of the configuration task.
2016-02-22 15:36:48 -03:00
Gustavo Jose de Sousa c609b27afc waf: gbenchmark: use cmake tool
A little addition in the root wscript was also necessary.
2016-02-22 15:36:48 -03:00
Gustavo Jose de Sousa e883242c31 waf: cmake: add Waf tool 2016-02-22 15:36:48 -03:00
Gustavo Jose de Sousa 38da32853a ci: use --enable-benchmarks in waf configure 2016-02-22 15:36:48 -03:00
Gustavo Jose de Sousa 662e45fda2 waf: move --check-verbose option declaration
We move it to the correct "scope", that is, ardupilotwaf.py, where it's really
used.
2016-02-22 15:36:48 -03:00
Gustavo Jose de Sousa 8c4d4f3f2a waf: make options groups accessible for any tool
That allows options being declared where they're really used. Additionally, we
load ardupilotwaf after the other tools so that we can create our groups after
all non-ardupilot option groups are created. That makes our groups appear as
the last ones in the help message, which makes it easier to locate them.
2016-02-22 15:36:48 -03:00
Kevin Guest 17378bd42a autotest: Add Rotherham 2016-02-22 16:21:16 +11:00
Andrew Tridgell 119cf6bb13 ci: added sitltest target
this adds some basic SITL testing to our CI
2016-02-22 12:34:32 +11:00
Gustavo Jose de Sousa 898c2faaab waf: git_submodule: fix uid() method for python3
Python3's hashlib.md5() requires Unicode-objects to be encoded before hashing.
2016-02-19 20:28:03 -02:00
Lucas De Marchi 15ce176818 waf: add -Wundef to all boards 2016-02-19 12:34:24 -02:00
Lucas De Marchi f0277cecb4 waf: ignore -Wundef for gtest
The gtest header uses lots of undefined macros, showing lots of warnings
if we enable -Wundef. Ideally we could use a #pragma to ignore the
warning only from the correct header, but this currently doesn't work
with g++ - see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53431

So for now we disable the warning completely when compiling gtest or any
test that uses its header.

Thanks Gustavo Sousa
2016-02-19 12:34:24 -02:00
Gustavo Jose de Sousa 393bea8945 waf: boards: use classes for boards definition
In order to provide board-specific behavior. For example, the incoming PX4
build will require custom build behavior.
2016-02-18 14:33:46 -02:00
Lucas De Marchi a01b933cb9 waf: add missing warnings from AP_Common.h
Copy the missing warnings from AP_Common.h and reorder the warnings to
be more clear on intent. This will later let us remove the warnings from
the header.
2016-02-12 20:41:29 +11:00
Gustavo Jose de Sousa 7259ac33f0 waf: git_submodule: override uid()
By running waf with option -v, waf was complaining about the update_submodule
tasks having the same identifier. That happened because the default uid()
method depended on the class name, inputs and outputs. Since this type of task
doesn't have input nor output file, we need to override uid() so that it uses
the submodule path for the task identifier.
2016-02-11 17:08:35 -02:00
Randy Mackay 898673f5e8 web-firmware: fix link to companion computer images 2016-02-08 14:22:37 +09:00
Randy Mackay 434fe919d6 web-firmware: add link to companion computer images 2016-02-08 10:19:19 +09:00
Gustavo Jose de Sousa 8655fdfd7f waf: use git_submodule tool through GIT_SUBMODULES variable
With this change, there's no need to verify if the submodule is initialized,
because the submodules in GIT_SUBMODULES are automatically initialized and
updated if necessary before the build tasks are performed.

One downside of this change is that Google Benchmark configuration is now done
only during build. However that is minor, since now there are easy ways to
separately build different targets and program groups, so that a fail in
benchmark build doesn't really affect the other targets.
2016-02-06 10:25:08 -02:00
Gustavo Jose de Sousa fdc87df074 waf: create taskgen for gtest in _build_common_taskgens
So that it belongs to 'build' group.
2016-02-06 10:25:08 -02:00
Gustavo Jose de Sousa 049feb3e9e waf: git_submodule: add git_submodule tool 2016-02-06 10:25:08 -02:00
Daniel Frenzel 970b171414 waf: remove AP_Limits from ignored libraries 2016-02-04 09:50:55 +09:00
Daniel Frenzel a735db2870 Tools: remove AP_Limits unit test 2016-02-04 09:50:43 +09:00
Gustavo Jose de Sousa 05f4c8b5b1 waf: ardupilotwaf: reset LAST_IDX on every build
That is a workaround so that one can use `waf bin tests`, for example.  In our
context, the only restriction to the task generators creation is values defined
during configuration. Thus, ideally, the recursion and task generators creation
should be done only once for multiple build calls. We should do that in the
future.
2016-02-03 12:24:21 -02:00
Gustavo Jose de Sousa 7b0a6d301d ci: use command 'all' instead of 'build' for waf
The command build uses 'bin' programs group by default. By using the command
'all', we tell the build system to build all programs.
2016-02-01 14:08:39 -02:00
Gustavo Jose de Sousa 8718f5be4f waf: ardupilotwaf: rename build_shortcut() to build_command()
Rationale:
 1. That function creates a separate build context class instead of just
    creating a wrapper for calling build (previous approach).
 2. The check command isn't a build shortcut since there's no way of calling it
    without using 'check' explicitly.
2016-02-01 14:08:39 -02:00
Gustavo Jose de Sousa 8be2db4d01 waf: ardupilotwaf: add parameter doc to build_shortcut()
That makes it possible to display meaningful information on the help message.
2016-02-01 14:08:38 -02:00
Gustavo Jose de Sousa c5c129d15f waf: ardupilotwaf: add parameter program_group_list to build_shortcut() 2016-02-01 14:08:38 -02:00
Gustavo Jose de Sousa a867dcdd07 waf: ardupilotwaf: make build_shortcut create build context class
Instead of just creating a wrapper. With that, the option targets is visible
only to that command instead of all commands in Options.commands.
2016-02-01 14:08:38 -02:00
Gustavo Jose de Sousa 5699bf04d0 waf: rename parameter blddestdir to program_group
It's a good idea to consolidate the idea that all programs belong to a group
that has it's own directory.
2016-02-01 14:08:32 -02:00
Gustavo Jose de Sousa b93c3d1772 waf: add option --program-group 2016-02-01 14:08:10 -02:00
Lucas De Marchi d844b90d5e waf: remove duplicated warning flag 2016-01-30 13:47:28 -02:00
Randy Mackay e78595bf48 Frame_Params: remove defaults from Bebop2 params
Removed parameter values that should already be these values by default on a fresh install
2016-01-23 11:42:13 +09:00
Gustavo Jose de Sousa 53f22f4982 waf: fix legacy defines
The following fixes where applied:
 - Value for APM_BUILD_DIRECTORY must be prefixed with APM_BUILD_
 - Renamed parameter name to sketchname, so we differentiate the real program
   name from the legacy sketch name
 - Use directory name instead of program name as argument for
   _get_legacy_defines()
2016-01-22 20:14:57 -02:00
Gustavo Jose de Sousa c2e3f05dbf waf: ardupilotwaf: prefix build context methods with ap_
It helps to distinguish between things from waf and things from ardupilotwaf.
2016-01-22 20:10:29 -02:00
Gustavo Jose de Sousa a2d2661765 waf: use methods from bld instead of ardupilotwaf for the remaining 2016-01-22 20:10:29 -02:00
Gustavo Jose de Sousa 3d22490397 waf: examples: use methods from bld instead of ardupilotwaf 2016-01-22 20:10:29 -02:00
Gustavo Jose de Sousa 12cfe222eb waf: ardupilotwaf: decorate build methods with @conf
Bind functions used in wscripts to build context. Additionally, a new function
is created and also decorated with @conf, common_vehicle_libraries(), which
returns COMMON_VEHICLE_DEPENDENT_LIBRARIES.  This patch is a preparation for
making wscripts use methods bound to the build context instead of using them
directly from ardupilotwaf.
2016-01-22 20:10:28 -02:00
Gustavo Jose de Sousa cf432e8b3e waf: ardupilotwaf: rename vehicle_stlib to ap_stlib
That function is not only for vehicles.
2016-01-22 20:10:28 -02:00
Gustavo Jose de Sousa a35c0d48b0 waf: ardupilotwaf: rename program to ap_program
Make the rename so that there is no name clashes when defining it as a taskgen
method.
2016-01-22 20:10:28 -02:00
Julien BERAUD 90d266698d Frame_Params: Bebop 2 tuning by Leonard 2016-01-22 13:58:46 -02:00
Andrew Tridgell 417176c0b2 autotest: reduce speedup on quadplane test to 10
mavproxy wasn't keeping up on autotest server
2016-01-21 07:46:18 +11:00
Lucas De Marchi 36d669a2ab ci: switch linux/sitl compiler to 4.9 2016-01-20 14:19:08 -02:00
Lucas De Marchi 1cd20c50a6 ci: integrate ccache configuration
Also split the exportline setting to allow one PATH per line.
2016-01-20 14:19:07 -02:00
Ricardo de Almeida Gonzaga c8d01f4bf4 ci: add configure-ci.sh
In order to use it in Travis and in Semaphore.
2016-01-20 14:19:07 -02:00
Ricardo de Almeida Gonzaga 0db54e7b36 ci: change TRAVIS_BUILD_TARGET to CI_BUILD_TARGET on build_ci.sh 2016-01-20 14:19:07 -02:00
Ricardo de Almeida Gonzaga e816a4845a ci: rename build_all_travis.sh to build_ci.sh
Since we're going to support SemaphoreCI[1] besides Travis.

[1] - https://semaphoreci.com/
2016-01-20 14:19:07 -02:00
Andrew Tridgell 926c37a876 autotest: increase timeout in quadplane test 2016-01-20 17:23:36 +11:00
Andrew Tridgell c2a12b55a0 scripts: raise max lockage in autotest 2016-01-20 07:43:43 +11:00
Andrew Tridgell b8c6bee132 autotest: raise overall timeout 2016-01-20 07:42:29 +11:00
Andrew Tridgell 15c8a27d5e scripts: added some debug to travis script 2016-01-20 07:42:28 +11:00
Gustavo Jose de Sousa 6ca58eac78 travis: fix verification for calling waf check
The use of `[[ $t == linux ]] && $waf check` makes the script exit with
non-zero status when $t isn't linux *and* that's the last thing executed.
2016-01-19 11:56:30 -02:00
Andrew Tridgell 56f8e3d414 scripts: added runfliptest.sh example script 2016-01-19 14:30:09 +11:00
Andrew Tridgell 889da98ca6 scripts: cope with older releases that don't support FMUv4 2016-01-19 14:18:32 +11:00
Gustavo Jose de Sousa d7f50ab668 travis: call waf check for linux
That helps preventing applying code that break unit tests.
2016-01-19 00:21:15 -02:00
Gustavo Jose de Sousa 54d938e2c4 waf: fail the check if not all test programs succeed
So that integration with Travis work properly.
2016-01-19 00:21:15 -02:00
Gustavo Jose de Sousa 8d0522f6ef waf: gtest: add gtest Waf tool
Tool for building gtest from the submodule.
2016-01-19 00:21:15 -02:00
Andrew Tridgell 3ea05759d1 travis: setup BUILDROOT to try to make builds faster 2016-01-19 12:28:04 +11:00
Andrew Tridgell 1416780976 scripts: copy px4-v4 binaries to autobuild published directories
this allows users to use pre-built binaries for pixracer
2016-01-19 11:18:51 +11:00
Andrew Tridgell d19c722963 autotest: fixed hex LOG_BITMASK for quadplane 2016-01-19 11:05:57 +11:00
Lucas De Marchi d663a748f2 waf: fix blddestdir
The destination directory for binaries should be
<build_dir>/<board>/bin/ and not
<build_dir>/<board>/<where-wscript-file-is>/bin

The same reasoning can be applied for others: tools, examples, etc
should follow the same rule.

Before this patch, compiling for example ArduPlane for navio we would
have:

    [339/339] Linking build/navio/ArduPlane/bin/ArduPlane

And now we have:

    [339/339] Linking build/navio/bin/ArduPlane
2016-01-18 16:56:08 -02:00
Lucas De Marchi eb6c89d09c waf: use os.path.join() for joining paths
Use platform-neutral way in python to join path components to improve
readability. Both will work when passing down to waf's Node object, even
on Windows.
2016-01-18 16:56:08 -02:00
Andrew Tridgell df64a63243 scripts: use BUILDROOT in build_all.sh and build_binaries.sh
better ccache performance

fixup
2016-01-16 16:07:42 +11:00
Gustavo Jose de Sousa 60abd4ff2f waf: don't differentiate taskgen names from targets for programs
waf's terminology might be a bit confusing regarding the word 'target'. As an
attribute for a task generator, it means the paths of the files supposed to be
built. As a command line option (--target), it means the list of names of the
task generators to be used in the build.

Before this commit, only vehicles programs had their task generators' target
parameter value different from the name parameter. Now, there's no distinction
between those two parameters for the case of programs.
2016-01-15 16:46:41 -02:00
Gustavo Jose de Sousa 2448ea1611 waf: ardupilotwaf: add function build_shortcut
That enable the easy creation of custom build commands with the purpose of
creating "shortcuts" for execution from command line.

For example, consider the following code fragment from a wscript:
```
copter = ardupilotwaf.build_shortcut(targets='ArduCopter')
```

With that, one can just issue `waf copter` instead of
`waf --target ArduCopter`.

The parameter target is made optional because more parameters might be added to
this function in the future.
2016-01-15 16:46:41 -02:00
Gustavo Jose de Sousa 0b8eff79af waf: remove extension from programs' names
Each platform has its own build directory, no extension is necessary.
2016-01-15 16:46:41 -02:00
Gustavo Jose de Sousa ad0f2080c6 waf: reorganize destination of binaries in Tools
It makes more sense for Hello to be an example and for CPUInfo and Replay to be
placed inside a `build/<board>/tools/` directory.
2016-01-15 16:46:41 -02:00
Gustavo Jose de Sousa f4a6d13cef waf: make benchmarks and tests be placed in common directories
Benchmarks now go to `build/<board>/benchmarks/` and tests to
`build/<board>/tests/`. That's done by using ardupilotwaf.program() and passing
blddestdir and program_name.
2016-01-15 16:46:41 -02:00
Gustavo Jose de Sousa 59562ad693 waf: add option program_name to ardupilotwaf.program()
That allows one to set explictly the program name instead of getting it from
the current directory.
2016-01-15 16:46:41 -02:00
Gustavo Jose de Sousa 2ad91dc1bc waf: add option use_legacy_defines to ardupilotwaf.program()
This is to allow to use ardupilotwaf.program() for programs that don't need the
legacy defines.
2016-01-15 16:46:41 -02:00
Gustavo Jose de Sousa c933b94f4d waf: add shortcut function for examples build
The function example() calls program() passing blddestdir as 'examples'.
2016-01-15 16:46:41 -02:00
Gustavo Jose de Sousa e549d0a3eb waf: use blddestdir to define task generator name
The only exception is for binaries that go in 'bin', like vehicles.
That way, partial builds follow the rule:
 - If building a vehicle or some helper that goes into 'bin', just use the
   binary name as the argument for --target. Example: `waf --target
   ArduCopter`.
 - For other binaries, the name of the directory they are placed in must be
   used. Example: `waf --target tests/test_vectors`.
2016-01-15 16:46:41 -02:00
Gustavo Jose de Sousa a55d803638 waf: make program() use blddestdir param
That param defines where the binary will be saved in the build directory,
namely `build/<board>/<blddestdir>`. The default is 'bin', for binaries that are
to be shipped for installation.
2016-01-15 16:46:40 -02:00
Andrew Tridgell d65ace2e34 scripts: make build_examples.sh much faster 2016-01-15 19:09:21 +11:00
pkancir 85f0ef9265 waf : use LINKFLAGS for pthread
-pthread is the one supposed to be used because it defines pre-defined
macros as -lpthread doesn't, like was done in
2016-01-14 18:59:04 -02:00
Gustavo Jose de Sousa ff02adf57e 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
2016-01-15 07:28:49 +11:00
Gustavo Jose de Sousa 46449ee032 waf: mavgen: use output_dir instead of target
The option target for the waf task generator is meant for actual files that are
going to be build. Since our target files are dynamic, let's change the code to
use a new parameter output_dir instead.
2016-01-15 07:28:48 +11:00
Gustavo Jose de Sousa ce294e841c waf: ardupilotwaf: make vehicle_stlib pass **kw to bld.stlib
That allows users to pass more parameters to bld.stlib.
2016-01-15 07:28:48 +11:00
Gustavo Jose de Sousa 5816dcba03 waf: mavgen: set system env during build instead of configure
By setting env.env during configure time makes changes be for the whole build
system scope and persistently, which may cause problems for other tasks and
tools.
2016-01-15 07:28:48 +11:00
Gustavo Jose de Sousa e5c66de554 waf: mavgen: ensure order without bld.add_group()
This is a better approach, because there's no need of calling add_group() for
each time a mavgen task generator is created.
2016-01-15 07:28:48 +11:00
Gustavo Jose de Sousa c9ca75e2cb waf: mavgen: set task signature for dynamic output
Since the output list for mavgen is dynamic, in the sense that we don't have
the information of what files will be generated by the task, that is not
captured by default by waf and post_run can't save the task signature for those
files. Although that doesn't cause build errors, the build time increase
significantly for when tasks that use the generate files are included (for
example, vehicles builds).

This patch search for the headers that were created by the task and set the
task signature for them. Using ant_glob isn't a very good solution, since there
may be stray file in the local build directory, but let's use that for now
until we find a better approach.
2016-01-15 07:28:48 +11:00
Gustavo Jose de Sousa b3c1c2efd9 waf: mavgen: expand tabs to spaces
Although waf's coding style uses tabs instead of spaces, scripts created for
this repository have been using spaces from the beginning.
2016-01-15 07:28:48 +11:00
Siddharth Bharat Purohit 11b82474de waf: generate mavlink headers for waf build 2016-01-15 07:28:47 +11:00
Julien BERAUD b8aef20ee8 Frame_Params: Fix bebop compass orient
Without COMPASS_EXTERNAL set to 1, COMPASS_ORIENT wasn't taken
into account, leading to bad data
2016-01-13 19:17:27 -02:00