Commit Graph

201 Commits

Author SHA1 Message Date
Andrew Tridgell fd286498af PX4: added otp to the build 2016-07-21 18:05:00 +10:00
Lucas De Marchi 2b1b23cabf build: fix static linking through --static option 2016-07-20 18:03:20 -03:00
Andrew Tridgell 3769e0fc64 waf: build support for Disco 2016-07-20 13:28:28 +10:00
Gustavo Jose de Sousa 9a9b59a97f waf: boards: fix funny CXXFLAGS typo 2016-07-18 15:26:07 -03:00
Gustavo Jose de Sousa 849a83315a waf: git_submodule: fix for Waf 1.9
Tasks cwd must be Node objects in Waf 1.9
2016-07-14 14:00:07 -03:00
Andrew Tridgell d25db426a3 waf: added AP_Module to the build 2016-07-14 13:39:47 +10:00
Lucas De Marchi b375b33189 waf: allow to disable tests
This allows to completely disable the tests. Even the gtest submodule is
not checked out allowing integration on build servers without needing to
download one more submodule.

This is different from the --notests flag. The latter only disables
executing the tests, but always use the submodule.
2016-07-13 15:38:50 -03:00
Lucas De Marchi 8967220652 waf: pass uselib_store in check_package()
This guarantees waf will always add the flags with our known prefix.
2016-07-13 15:24:42 -03:00
Andrew Tridgell 1b12371e25 waf: use define_name in libdl check 2016-07-13 15:24:42 -03:00
Andrew Tridgell a5adae5fb4 waf: make linux check for libdl
needed for libiio
2016-07-13 15:24:42 -03:00
Andrew Tridgell 3322d7c321 waf: don't build bebop static
need dynamic for libiio
2016-07-13 15:24:42 -03:00
Andrew Tridgell 2980d47e23 waf: added check_package() function for pkg-config checks
this converts existing pkg-config checks to use check_package, which
sets up all the needed variables after a check.

This also disables libdl and libiio for static builds, where they make
no sense
2016-07-13 15:24:41 -03:00
Lucas De Marchi ee62b61fc7 waf: use STDC format macros 2016-07-13 14:18:27 +10:00
Lucas De Marchi 8a27680fbb build: check for endian.h and byteswap.h 2016-07-08 19:49:32 -03:00
Siddharth Bharat Purohit 71c2f69a63 waf: add support for sitl build on mac 2016-07-07 11:35:17 -03:00
Gustavo Jose de Sousa a748c52f06 waf: bump to version 1.9.0
Some things worth mentioning:

- That version contains commits we had cherry picked on our submodule.
- There's a patch on top with a fix for the new process spawning used on
  version 1.9.0. That has already been applied to upstream's master, but not
  released yet.
- This patch also does necessary changes on our build system in order to
  accommodate the upgrade. Basically:
  - Use full task class names when calling create_task().
  - Use always_run class attribute instead of the decorator, which is
    deprecated.
2016-06-29 11:18:22 -03:00
Lucas De Marchi 3a5bc141bb build: use format macros in all linux boards
This doesn't work for px4 since it manually defines __STDC_FORMAT_MACROS
in some px4 modules, which needs to be updated.
2016-06-25 12:51:55 -03:00
Lucas De Marchi a9919420c6 waf: allow to disable libiio at configuration
We default to autodetection for libiio so if the libraries are available
we enable it. However this may not always be desired.
2016-06-23 19:08:13 -03:00
Lucas De Marchi 348678888b waf: allow to disable lttng at configuration
We default to autodetection for LTTNG so if the libraries are available
we enable it. However this may not always be desired.
2016-06-23 19:07:26 -03:00
Gustavo Jose de Sousa 6fa97c2289 waf: px4: require cmake version at least 3.2
That way we avoid build errors due to things not supported in earlier versions.
2016-06-03 09:55:17 -03:00
Gustavo Jose de Sousa 03728ac2f7 waf: cmake: enable minimum version checking
By using the environment variable CMAKE_MIN_VERSION.
2016-06-03 09:55:17 -03:00
Gustavo Jose de Sousa 8e9752c3d3 waf: px4: setup build summary
- Pass the correct nodes as the binaries for the programs task generators.
- Print extra information specific to PX4 build.
2016-05-25 17:47:00 -03:00
Gustavo Jose de Sousa d65a7897e4 waf: px4: keep ELF files around
Including px4io. We need them for the build summary. Also, that makes it easier
to use gdb on them.
2016-05-25 17:47:00 -03:00
Gustavo Jose de Sousa 4f3af94c57 waf: build_summary: add Waf tool 2016-05-25 17:47:00 -03:00
Gustavo Jose de Sousa afcabda21c waf: use better style for add_option() calls
Setting the "help" keyword argument may not fit in one line sometimes. This
patch adds the following convention to calls to add_option() in order to
address that issue in a better way:

    1) The "help" keyword must always be the last argument to be passed.

    2) If the help string is a literal string or a literal string with some
    operation (e.g. "%" operator) and setting the "help" keyword in the code
    doesn't fit a line (considering the limit of characters in a line), then
    the help string must be a triple-quoted string. That has the advantage of
    not having to have several "+" operations for long help strings. In that
    case, the help message must start on the next line and the closing
    triple-quotes must be on a separate line together with the closing
    parenthesis.

The requirement (1) makes it easier to make the style exception in (2)
acceptable.
2016-05-25 17:47:00 -03:00
Gustavo Jose de Sousa 64b8ec61c7 waf: set lib as output dir for static libraries 2016-05-25 17:47:00 -03:00
Gustavo Jose de Sousa 236a62f4b9 waf: create program_dir directory
There's an upcoming patch that moves all static libraries to
`build/<board>/lib/`. That way, the program directory won't be created
automatically by the build system and that will cause problems for PX4 builds,
since it builds ardupilot programs as static libraries and copies stuff to the
program directory.
2016-05-25 17:47:00 -03:00
Gustavo Jose de Sousa 844222870c waf: boards: bind get_board() to configure and build contexts
A convenience, since we don't expect the board to change for a given
configuration.
2016-05-25 17:47:00 -03:00
Gustavo Jose de Sousa 80f03b618b waf: toolchain: add find_toolchain_program() 2016-05-25 17:47:00 -03:00
Gustavo Jose de Sousa 06a515645e waf: px4: reconfigure PX4Firmware for each program
A (possible) bug in CMake makes it not to relink firmware_nuttx sometimes when
the following sequence of events happen with very short period of time in
between them:
    1) cmake target build_firmware_px4fmu-v2 just finishes
    2) px4-extra-files/libap_program.a is replaced with the next library
    3) cmake target build_firmware_px4fmu-v2 is run

It's unfortunate to have to reconfigure PX4Firmware with a different path
because of the overhead added.

That problem was found with CMake 3.5.2 and is reproducible with the following
bash script (with git HEAD at ae3cb05 'HAL_PX4: disable "Overtime in task"
msg'):

```
modules/waf/waf-light configure --board px4-v2
modules/waf/waf-light build --targets bin/arduplane,bin/arducopter-quad

fails=0
total=0
while true; do
    cp build/px4-v2/bin/libarducopter-quad.a \
       build/px4-v2/px4-extra-files/libap_program.a
    cmake --build build/px4-v2/modules/PX4Firmware \
          --target build_firmware_px4fmu-v2 &> /dev/null
    h1=$(sha256sum build/px4-v2/modules/PX4Firmware/src/firmware/nuttx/firmware_nuttx \
                   | cut -d" " -f1)

    cp build/px4-v2/bin/libarduplane.a build/px4-v2/px4-extra-files/libap_program.a
    cmake --build build/px4-v2/modules/PX4Firmware \
          --target build_firmware_px4fmu-v2 &> /dev/null
    h2=$(sha256sum build/px4-v2/modules/PX4Firmware/src/firmware/nuttx/firmware_nuttx \
                   | cut -d" " -f1)

    [[ $h1 == $h2 ]] && ((fails++))
    ((total++))
    printf "\r%d/%d" $fails $total
done
```
2016-05-25 11:51:40 -03:00
Gustavo Jose de Sousa fee5053493 waf: cmake: reconfigure when configuration data change
Create a new configuration task a configuration in the CMakeConfig object
changes. That allows building targets for different configurations in one waf
build run.
2016-05-25 11:51:40 -03:00
Gustavo Jose de Sousa ce0ae66b19 waf: cmake: add CMAKE_VARS to task uid()
To allow the correct multiple instantiations of the cmake_configuration tasks
for different states CMake variables.
2016-05-25 11:51:40 -03:00
Gustavo Jose de Sousa b6a5052a97 waf: cmake: use CMakeConfig class instead of taskgen
That will make it easier to allow reconfiguration of cmake builds on a single
waf build run.
2016-05-25 11:51:40 -03:00
Lucas De Marchi 563614e84b waf: check for libiio for all linux boards 2016-05-23 12:06:42 -03:00
Lucas De Marchi 04fc1e22da waf: check for lttng-ust for all linux boards 2016-05-23 12:06:42 -03:00
Lucas De Marchi 9ac6c399e9 waf: accept env variable to append library
Change check_librt() to do everything it needs to check for librt.
2016-05-23 12:06:42 -03:00
Andrew Tridgell a1c52415e9 waf: pass mavlink include path into cmake build 2016-05-21 15:25:18 +10:00
Andrew Tridgell 7e7c21d114 waf: update for MAVLink2 build 2016-05-21 15:25:17 +10:00
Gustavo Jose de Sousa bc62164ac9 waf: mavgen: scan for implicit dependencies
Process the input file to catch dependencies. Otherwise, changes in included
files wouldn't trigger the code regeneration.
2016-05-19 18:47:07 -03:00
Gustavo Jose de Sousa 0f60c8ed4f waf: boards: check for librt when necessary 2016-05-19 18:15:06 -03:00
Gustavo Jose de Sousa f10c150e70 waf: cxx_checks: add check_librt()
That function verifies for the necessity of linking against librt. If so, then
it checks if it is possible to do so.
2016-05-19 18:15:06 -03:00
Gustavo Jose de Sousa e630c2b33f waf: cxx_checks: define ap_common_checks() instead of configure()
That allow loading the cxx_checks tool before the calls to configure_env().
That way, we can add check functions to be used across boards.
2016-05-19 18:15:06 -03:00
Gustavo Jose de Sousa 83244dfe10 waf: cxx_checks: add copyright notice 2016-05-19 18:15:06 -03:00
Gustavo Jose de Sousa 468e8284f0 waf: cxx_checks: use check() instead of check_cxx()
check_cxx() is deprecated.
2016-05-19 18:15:06 -03:00
Francisco Ferreira 057124bd90 waf: px4: use lib/rc for v4
Some functions from that module are necessary for px4-v4.
2016-05-18 15:36:48 -03:00
Gustavo Jose de Sousa 8578d7c16f waf: px4: don't add libarm_cortexM4lf_math.a to extra libs
This is following d02abf2 ("Removed CMSIS.") from PX4Firmware.
2016-05-18 15:36:48 -03:00
Gustavo Jose de Sousa f29d8bd42c waf: px4: set ARDUPILOT_BUILD cmake variable
That allow changing PX4Firmware build system to accommodate ardupilot's build.
2016-05-18 15:36:48 -03:00
Gustavo Jose de Sousa 4529028c8a waf: ardupilotwaf: ap_get_all_libraries: ignore non-directory files
Each library in ardupilot is a folder with the source in. That avoids build
failures when there are files in libraries/. That fixes #4099 ("waf doesn't
seem to like TAGS files") and #4093 ("sim_vehicle.py /w waf /w eclipse project
broken on Cygwin").

That problem can be reproduced by just creating a file in libraries/ and trying
to build with waf.

There should be a better way to confirm a path is an ardupilot library. That
can be done later.
2016-05-12 13:47:44 -03:00
Andrew Tridgell fcd7611248 waf: ensure we don't build a library twice 2016-05-10 14:21:43 +10:00
Andrew Tridgell 2f656c187a waf: cope with -ve return from mavgen on segv 2016-05-10 13:41:48 +10:00