Commit Graph

228 Commits

Author SHA1 Message Date
Lucas De Marchi 95d5752011 build: fix configure check for headers
When we are checking if a header is available we can't pass -I argument
to our missing/ directory. Otherwise we would end up telling the build
that a header is available when it actually isn't.

This fixes the build of sitl in MacOS with clang.
2016-09-03 01:19:14 -03:00
José Roberto de Souza 6a9addb2a8 waf: Add Intel Aero to waf build
This will be the first board that only build with waf.
2016-09-03 01:03:17 -03:00
Gustavo Jose de Sousa 5d7ca3fd27 waf: build_summary: don't call size for empty list of nodes
Otherwise, that will cause an error.
2016-08-31 00:19:51 -03:00
Gustavo Jose de Sousa 87862a08ab waf: ap_library: make headers whitelist portable
Otherwise it won't work for platforms that don't use Unix style paths.
2016-08-26 13:13:56 -03:00
Gustavo Jose de Sousa a6b55d90a7 waf: cmake: define a dictionary of supported generators
On Windows, using MSYS Makefiles generator doesn't work very well when the
CMakeLists.txt files use custom commands with paths as arguments. Furthermore,
MinGW Makefiles generator can't be used if sh.exe is in the system's path and
some build systems rely on sh for certain tasks (which is the case of PX4
Firmware build). Because of that, the list of generators for Windows has been
narrowed to Ninja and NMake Makefiles.
2016-08-24 12:15:42 -03:00
Gustavo Jose de Sousa 07592d650e waf: px4: copy with shutil module instead of cp program
In order to make it independent of host platform.
2016-08-24 12:15:42 -03:00
Lucas De Marchi e31a06cfdb waf: fix programs searches
Here we do the following:
    1) Move the pkg-config check to boards.py so we only check of it for
       linux boards
    2) Use cfg.find_toolchain_program() if possible, for example, for AR
2016-08-24 12:15:42 -03:00
Gustavo Jose de Sousa f430ef3825 waf: toolchain: override find_g{xx,cc}() instead of wrapping configure()
That's more correct than setting Waf environment variables:

 (1) We don't need to worry about differences between OSes - the previous
 implementation was actually broken for Windows because the program names in
 the environment variables were missing the ".exe" extension.

 (2) That looks better than looping over possible compiler names and running
 the configuration transactionally multiple times.
2016-08-24 12:15:42 -03:00
Gustavo Jose de Sousa 31965689cb waf: persist implicit dependency information across clean
Implicit dependency scanning takes significant time and, since it doesn't
produce files, it's okay to keep the resulting information across clean
commands as long as the scanner is triggered again if there's need to. This
commit accomplishes that.

The advantage of this approach can be observed by the following timings when
building the group "bin":

 Method                                                         Time
 ------------------------------------------------------------------------
 Fully clean build                                              5m18.633s
 Clean build with scanning result persisted                     4m23.346s
 Clean build with ccache but non-persistent scan results        1m40.125s
 Clean build with scanning results persisted and with ccache      14.843s

While at it, move management of information persisted across clean commands to
a separate module.
2016-08-24 10:46:23 -03:00
Gustavo Jose de Sousa 6abcf6150c waf: ap_library: use ap_persistent_task_sigs for header checking tasks
In order to make clean builds faster.
2016-08-24 10:46:23 -03:00
Gustavo Jose de Sousa ef4fd0e2d3 waf: add --clean-all-sigs option
Explanation on the option help string.
2016-08-24 10:46:23 -03:00
Gustavo Jose de Sousa 0b7a98d40c waf: allow persisting tasks signatures across clean commands
That allows some time consuming tasks that don't really produce anything on the
file system to keep their signature after a clean command is issued.
2016-08-24 10:46:23 -03:00
Gustavo Jose de Sousa a98c42fef9 waf: define ap_groups in ardupilotwaf tool
That makes more sense, since that module is supposed to have basic Ardupilot
specific features. The root wscript should be a mere user of those features.
2016-08-24 10:46:23 -03:00
Gustavo Jose de Sousa a6ec802d28 ap_library: always check included headers when necessary
This approach is better then the previous one mainly because the latter
required creating the task generator for the checks in a separate group and
posting that target implied in posting the whole previous build groups.

Some notes:
 - This is implemented so that headers aren't checked more than once, so there
   might be some checking tasks that won't do anything because the headers are
   checked on another task. Even so, those headers are added to the result of
   scan() in order to provide a consistent output to the user.
 - It is safe manipulating the shared variable dispatched_headers because the
   scan() is called before the task is added to the execution queue.
 - Although we force ap_library_check_headers.scan() to always be called,
   that's OK, because we use the scanning result of the compilation task, which
   returns a cached value if there's no need to rescan.
2016-08-24 10:46:23 -03:00
Gustavo Jose de Sousa 51bef96811 waf: px4: accommodate use of ap_library
- Use AP_LIBRARIES_OBJECTS_KW instead of AP_STLIB_FEATURES.
 - Change the feature name to one that makes more sense.
2016-08-24 10:46:23 -03:00
Gustavo Jose de Sousa b8e518a533 waf: use ap_library tool
That way we avoid recompiling source files that don't depend on vehicles.
Change notes:
- UTILITY_SOURCE_EXTS: moved to ap_library
- Task generators indexes: ap_library handles that now and in a better way
- Use of AP_STLIB_FEATURES: it doesn't make sense anymore, since the stlib
  taskgen has empty source list
- Flags and defines: passed down to ap_library through AP_LIBRARIES_OBJECTS_KW
- Set use='mavlink' in AP_LIBRARIES_OBJECTS_KW instead of calls to
  bld.ap_stlib().
2016-08-24 10:46:23 -03:00
Gustavo Jose de Sousa 9a6fcafade waf: ap_library: add tool
That's a tool for creating task generators for libraries object files. One of
the key objectives of this patch is to provide a way to avoid recompiling
sources that are independent of vehicles.
2016-08-24 10:46:23 -03:00
Gustavo Jose de Sousa b191269cc8 waf: px4: run firmware task after link task
This fix a bug introduced by 06a5156 ("waf: px4: reconfigure PX4Firmware for
each program"), with the removal of the call fw_task.set_run_after(cp_lib).
2016-08-24 10:46:23 -03:00
Gustavo Jose de Sousa 8fb6ccc8b7 waf: px4: use copy of "use" in px4_import_objects_from_use()
Utils.to_list() returns the argument if it is a list, which means that
px4_import_objects_from_use() cleared that attribute when processing the queue.
2016-08-24 10:46:23 -03:00
Gustavo Jose de Sousa 424f6490fc waf: px4: add missing import Errors 2016-08-24 10:46:23 -03:00
Gustavo Jose de Sousa 2e1ac0de8d waf: make get_legacy_defines() "public"
That function will be used by an upcoming separate tool.
2016-08-01 22:04:16 -03:00
Gustavo Jose de Sousa f2dec971e7 waf: add "ap_" prefix to keywords "libraries" and "vehicle"
As an effort to keep things specific to ardupilot API in the build system
consistent and easy way to identify.
2016-08-01 22:04:16 -03:00
Gustavo Jose de Sousa d1c5691501 waf: build_summary: let the user register the post build callback
That allows more control from the user's point of view.
2016-07-28 17:50:19 -03:00
Gustavo Jose de Sousa 4bd17ab90c waf: git_submodule: allow warning about skipped submodules updates
Provide a function to register a post build routine to do the warnings. Do that
way so that the user can chose when to add the callback to the build (i.e.
allow the user to assert a desired order for the post build callbacks to be
called).
2016-07-25 16:45:57 -03:00
Gustavo Jose de Sousa 4cd70842d9 waf: git_submodule: don't update submodule if non-fastforward
Don't cause trouble to developers working on submodules.
2016-07-25 16:45:57 -03:00
Andrew Tridgell db8bf48747 build: added AP_ICEngine to build 2016-07-25 10:06:03 +10:00
Andrew Tridgell 241b6edfcf Build: added AP_Button to build 2016-07-22 15:01:20 +10:00
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