summaryrefslogtreecommitdiff
path: root/support
AgeCommit message (Collapse)Author
2017-02-15package: add generic support for lz archivesBaruch Siach
This commit teaches the generic package handling code how to extract .tar.lz archives. When lzip is not installed on the host, host-lzip gets built automatically. Signed-off-by: Baruch Siach <baruch@tkos.co.il> Reviewed-by: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-02-15package: refactor listing of extractor dependenciesBaruch Siach
Don't special case $(XZCAT) when constructing DL_TOOLS_DEPENDENCIES. The next commit will introduce another extractor that automatically builds when not installed. Introduce EXTRACTOR_DEPENDENCY_PRECHECKED_EXTENSIONS that lists archive extensions for which the extractor is already checked in support/dependencies/check-host-foo.mk. Use this in the newly introduced extractor-dependency to populate DL_TOOLS_DEPENDENCIES. Cc: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com> Signed-off-by: Baruch Siach <baruch@tkos.co.il> Reviewed-by: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com> [Thomas: add missing space after "firstword", as noticed by Thomas DS.] Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-02-12support/test-pkg: report number and types of failuresYann E. MORIN
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Cc: Luca Ceresoli <luca@lucaceresoli.net> Cc: Thomas De Schampheleire <patrickdepinguin@gmail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-02-12support/test-pkg: be less verboseYann E. MORIN
Requested-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-02-12support/test-pkg: simplify the config checkYann E. MORIN
Use comm(1) to check that all our config options are properly set in the resulting configuration, rather than our canned and fragile code. Reported-by: Cam Hutchison <camh@xdna.net> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-02-12support/test-pkg: check the config snippet existsYann E. MORIN
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-02-12support/test-pkg: fix code styleYann E. MORIN
Reported-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-02-09support/test-pkg: add option to limit the number of testsYann E. MORIN
Sometimes, it interesting to have a global overview of whether the package builds at all or not, rather than test on all toolchains. Add an option that allows testing on a limited set of randomly choosen toolchains. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Cc: Luca Ceresoli <luca@lucaceresoli.net> Cc: Thomas De Schampheleire <patrickdepinguin@gmail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-02-09support/test-pkg: store lines missing from resulting configuraitonYann E. MORIN
When a build is skipped, store the lines from the config snippet, that are missing in the resulting configuration, in a file in the build directory, for the user to inspect. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Cc: Luca Ceresoli <luca@lucaceresoli.net> Cc: Thomas De Schampheleire <patrickdepinguin@gmail.com> Acked-by: Luca Ceresoli <luca@lucaceresoli.net> Tested-by: Luca Ceresoli <luca@lucaceresoli.net> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-02-09support/scripts: add script to test a packageYann E. MORIN
This script helps in testing that a package builds fine on a wide range of architectures and toolchains: BE/LE, 32/64-bit, musl/glibc/uclibc... Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> [yann.morin.1998@free.fr: - completely rewrite the script from Thomas, with help from Luca ] Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Luca Ceresoli <luca@lucaceresoli.net> Cc: Thomas De Schampheleire <patrickdepinguin@gmail.com> Acked-by: Luca Ceresoli <luca@lucaceresoli.net> Reviewed-by: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com> Tested-by: Luca Ceresoli <luca@lucaceresoli.net> Acked-by: Luca Ceresoli <luca@lucaceresoli.net> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-02-06size-stats: don't count hard linksFrank Hunleth
This change adds inode tracking to the size-stats script so that hard links don't cause files to be double counted. This has a significant effect on the size computation for some packages. For example, git has around a dozen hard links to a large file. Before this change, git would weigh in at about 170 MB with the total filesystem size reported as 175 MB. The actual rootfs.ext2 size was around 16 MB. With the change, the git package registers at 10.5 MB with a total filesystem size of 15.8 MB. Signed-off-by: Frank Hunleth <fhunleth@troodon-software.com> Acked-by: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-02-06graph-depends: split off get_rdepends from get_dependsThomas De Schampheleire
The use of a 'rule' variable that can contain 'show-depends' or 'show-rdepends' is not logical if get_depends is considered as a reusable function from various scripts. The name of these rules are too much an implementation detail. Therefore, split the existing get_depends into two separate functions get_depends and get_rdepends, while keeping code duplication to a minimum. Signed-off-by: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com> Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-02-06graph-depends: split off get_version/get_depends into pkgutil.pyThomas De Schampheleire
Functions to obtain the version and dependencies of a package from Python can be useful for several scripts. Extract this logic out of graph-depends into pkgutil.py. Signed-off-by: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com> Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr> [Thomas: remove shebang from pkgutil.py, noticed by Yann E. Morin.] Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-02-05graph-depends: avoid use of global var 'rule' in get_dependsThomas De Schampheleire
Function get_depends was recently changed to support both normal dependencies as reverse dependencies, via a global variable 'rule' that equals 'show-depends' or 'show-rdepends'. As a subsequent function will extract this function get_depends to a separate file, the use of globals is problematic. Instead, pass the global as an argument. Signed-off-by: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-01-28core: do not reset DEPENDENCIES_HOST_PREREQ in dependencies.mkJérôme Pouiller
Usually, Buildroot does never initialize variables with empty content. DEPENDENCIES_HOST_PREREQ was an unjustified exception. Signed-off-by: Jérôme Pouiller <jezz@sysmic.org> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-01-25Update for 2016.11.2Peter Korsgaard
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2017-01-16core/br2-external: fix use of relative pathsYann E. MORIN
Fixes #9576 When the path to a br2-external tree is relative, make enters an endless recursive loop (paths elided for brevity): $ make BR2_EXTERNAL=.. foo_defconfig make[1]: stat: ../configs/../configs/../configs[...]/toto_defconfig: Filename too long make[1]: *** No rule to make target '../configs/../configs/../configs[...]/toto_defconfig', needed by '../configs/../configs/../configs[...]/toto_defconfig'. Stop. Makefile:79: recipe for target '_all' failed make: *** [_all] Error 2 It is a bit complex to understand the actual technical reason for this never-ending expansion; it seems it happens in the code generated by the percent_defconfig macro. Not sure why, though... But the root cause is the relative path. Just use absolute, canonical paths to br2-external trees. Always. [Peter: add bugzilla reference] Reported-by: outtierbert@gmail.com Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2017-01-04perl: bump to version 5.24.0Francois Perrad
Signed-off-by: Francois Perrad <francois.perrad@gadz.org> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2016-12-29Update for 2016.11.1Peter Korsgaard
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2016-12-27support/dependencies: ensure we have 'file' on the hostYann E. MORIN
Recently, the autoconf macros for libtool started using '/usr/bin/file' to determine the type of library that is generated by the toolchain. Packages that use this recent version of the libtool autoconf macros will fail in a rather dramatic way when /usr/bin/file is not present on the host: the package will still build but no shared library is generated, which in turn may cause build failures in other packages that link with it. For example, libpng's configure determines that it is not possible to build a shared library on MIPS64 because the expected output from 'file' is not present. Therefore, only a static libpng.a is built. Later, bandwithd links with -lpng but it doesn't use the pkg-config's Private-Libs (because it's not linking statically) and it doesn't have access to the NEEDED reference from the shared library. Therefore, it doesn't link with zlib and fails with pngrutil.c:(.text+0x55c): undefined reference to `inflate' We cant use host-file because it is itself an autotools package and is itself using libtool, so this would be a chicken-n-egg problem. Besides, the libtool script really wants to call /usr/bin/file, so it would not even find our host-file anyway. So, just require that '/usr/bin/file' is present on the host. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Arnout Vandecappelle <arnout@mind.be> Cc: Baruch Siach <baruch@tkos.co.il> Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2016-12-20mkusers: fix spelling in intro commentDanomi Manchego
Signed-off-by: Danomi Manchego <danomimanchego123@gmail.com> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2016-12-05pkg-autotools: generic configure fix for powerpc64Sam bobroff
Many (100+) packages supported by buildroot contain old configure scripts (or build them from old versions of autotools) that are unable to determine how to link shared libraries on powerpc64 and powerpc64le. This causes that test to erroneously fail on toolchains that are not "bi-endian" (which is the case for toolchains built by buildroot), which causes configure to build static libraries instead of dynamic ones. Although these builds succeed, they tend to cause linker failures in binaries later linked against them. Because affected configure files can be discovered automatically, this patch introduces a hook (enabled only when building for powerpc64 and powerpc64le) that uses a script to scan and fix each package. Signed-off-by: Sam Bobroff <sam.bobroff@au1.ibm.com> Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2016-12-04support/dependencies: use the new kconfig option to check UTF8 localeYann E. MORIN
Currently, we require a host with an UTF-8 locale as soone as we build a Buildroot toolchain with support for locales. This means that we do erquire such a locale when building a toolchain with either uClibc, glibc or musl. However, glibc and musl do not require such a locale to be present. Use the new option to check if an UTF8 locale is needed on the host, rather than deriving that from toolchain settings. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2016-11-30Update for 2016.11Peter Korsgaard
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2016-11-23core/br2-external: restore compatibility with old distrosYann E. MORIN
Currently, the br2-external script uses bash-4's associative arrays. However, some oldish enterprise-class distros like RHEL5 still use bash-3.1 which lacks associative arrays. We restore compatibility with those oldish distros using 'eval' to emulate associative arrays, as suggested by Arnout. Reported-by: Ricardo Martincoski <ricardo.martincoski@gmail.com> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Ricardo Martincoski <ricardo.martincoski@gmail.com> Cc: Thomas De Schampheleire <patrickdepinguin@gmail.com> Cc: Arnout Vandecappelle <arnout@mind.be> Cc: Max Filippov <jcmvbkbc@gmail.com> Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> Tested-by: Ricardo Martincoski <ricardo.martincoski@gmail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2016-11-06pkg-cmake: Change -DNEBUG to -DNDEBUGStefan Nickl
Signed-off-by: Stefan Nickl <Stefan.Nickl@gmail.com> Acked-by: Samuel Martin <s.martin49@gmail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2016-11-05get-developers: fix parentheses for printGaël PORTAY
Python3 complains about missing parentheses. $ ./support/scripts/get-developers File "./support/scripts/get-developers", line 45 print f ^ SyntaxError: Missing parentheses in call to 'print' Signed-off-by: Gaël PORTAY <gael.portay@savoirfairelinux.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2016-11-02linux: add ev3dev extensionDavid Lechner
This adds an ev3dev Linux drivers extension that provides Linux kernel drivers for LEGO MINDSTORMS EV3 from the ev3dev project. Signed-off-by: David Lechner <david@lechnology.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2016-10-25support/download: make the git wrapper more robustYann E. MORIN
Currently, there are two failure paths in the wrapper: - if the tar fails, then the error is ignored because it is on the left-hand-side of a pipe; - if the find fails, then the error is ignored because it is a process substitution (and there is a pipe, too). While the former could be fixed with "set -o pipefail", the latter can not be fixed thusly and we must use an intemediate file for it. So, fix both issues by using intermediate files, both to generate the list of files to include in the archive, and generate the archive in a temporary tarball. Fixes the following build issue, where the find is failing for whatever unknown reason: http://autobuild.buildroot.net/results/20f/20fd76d2256eee81837f7e9bbaefbe79d7645ae9/ And this one, where the process substitution failed, also for an unknown reason: http://autobuild.buildroot.org/results/018/018971ea9227b386fe25d3c264c7e80b843a9f68/ Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2016-10-25core/graph-depends: add option to graph reverse dependenciesYann E. MORIN
Now that we can dump the reverse dependencies of a package, add the ability to graph those. It does not make sense to do a full reverse graph, as it would be semantically equivalent to the direct graph. So we only provide a per-package reverse graph. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Arnout Vandecappelle <arnout@mind.be> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2016-10-25scripts/get-developers: correct type of patches argumentRahul Bedarkar
Current type for 'patches' argument is str. It supposed to only contain names of files. If we specify FileType as type, then we don't need to open file ourself and it allows script to read patch from standard input as well. e.g. $ git show -1 | ./support/scripts/get-developers - Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: Rahul Bedarkar <rahul.bedarkar@imgtec.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2016-10-22toolchainfile.cmake: fix description of CMAKE_Fortran_FLAGS_{DEBUG,RELEASE}Thomas Petazzoni
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2016-10-22toochainfile.cmake: rework the way Buildroot sets flagsSamuel Martin
From the build configuration, Buildroot defines and set some compiler and linker flags that should be passed to any packages build-system. For package using the cmake-package infrastructure, this is achieved via the toolchainfile.cmake. This change simplifies the way the toolchainfile.cmake file handles these flags: it now just sets them, without any attempt to extend them with those Buildroot defined. This change still allows overriding these flags from the configure command line. So, now, when a CMake-based package needs to extend them, they should be fully set from the package *.mk file. This behavior is consistent with what is done for others package infrastructures. This change should not pull any regression WRT the bug #7280 [1]. However, now, when someone uses the toolchainfile.cmake file outside of Buildroot, he/she must overload all compiler/linker flags (including the ones Buildroot sets since they no longer get automatically added). [1] https://bugs.busybox.net/show_bug.cgi?id=7280 Cc: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> Cc: Max Filippov <jcmvbkbc@gmail.com> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: Samuel Martin <s.martin49@gmail.com> Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2016-10-22toolchainfile.cmake: set per-config appended {C, CXX}FLAGSSamuel Martin
When a build type is set, CMake does append some flags that can override those set by Buildroot due to the gcc option parser (in which the last argument controling an option wins). Hereafter is a summary of the optimization and debug flags set by Buildroot and appended by CMake. * Flags set by Buildroot depending on the configuration: BR2_ENABLE_DEBUG | Optim. level | Buildroot {C,CXX}FLAGS =================+=====================+======================= y | BR2_OPTIMIZE_S | -Os -gx y | BR2_OPTIMIZE_G | -Og -gx y | BR2_OPTIMIZE_{0..3} | -On -gx n | BR2_OPTIMIZE_S | -Os n | BR2_OPTIMIZE_G | -Og n | BR2_OPTIMIZE_{0..3} | -On * Default flags appended by CMake depending on the build type: Build type | Flags | Effects on {C,CXX}FLAGS ===============+=================+=========================================== Debug | -g | Force -g, compatible with BR2_ENABLE_DEBUG MinSizeRel | -Os -DNDEBUG | Set -Os, compatible with BR2_OPTIMIZE_S Release | -O3 -DNDEBUG | Set -O3, closest to the others cases, | | though the optimization level is forced. RelWithDebInfo | -O2 -g -DNDEBUG | Force -g and set -O2, not friendly with BR To avoid the CMake flags take precedence over the Buildroot ones, this change sets in toolchainfile.cmake the per-config compiler flags CMake can append depending on the build type Buildroot defined. So, CMake does not mess up with the compilation flags Buildroot sets. It is still possible to override these per-config flags on the cmake command line. Note: If a CMake-based project forces the compiler and/or linker flag definitions (the default ones or the per-config ones - e.g. CMAKE_C_FLAGS/CMAKE_C_FLAGS_{DEBUG,RELEASE}), there is not much Buildroot can do about it. So, the flags will be overwritten anyway in these cases. Cc: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> Cc: Maxime Hadjinlian <maxime.hadjinlian@gmail.com> Signed-off-by: Samuel Martin <s.martin49@gmail.com> Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> [Thomas: - adjust comment in toolchainfile.cmake.in, as suggested by Arnout. - also handle CMAKE_Fortran_FLAGS_*, as suggested by Arnout.] Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2016-10-22package/pkg-cmake.mk: move CMAKE_BUILD_TYPE definition into toolchainfile.cmakeSamuel Martin
The chosen CMAKE_BUILD_TYPE encodes an option of the Buildroot configuration, so it makes more sense to save it in the toolchainfile.cmake than to pass it during configure. It is still possible to override the build type on the cmake command line. Cc: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> Cc: Maxime Hadjinlian <maxime.hadjinlian@gmail.com> Signed-off-by: Samuel Martin <s.martin49@gmail.com> Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> [Thomas: reword description in the CHANGES file.] Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2016-10-19get-developers: use --cc instead of --to for developersRahul Bedarkar
Output of get-developers script in our manual uses --cc for developers, but actual output of get-developers script uses --to. This patch makes code consistent with documentation, by using --cc for developers. Signed-off-by: Rahul Bedarkar <rahul.bedarkar@imgtec.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2016-10-19core/br2-external: fix link to manual for converting old treesYann E. MORIN
To be noted: that link will only be valid once we have a released manual. In the meantime, it's accessible on the nightly manual: http://nightly.buildroot.org/#br2-external-converting Reported-by: Benoît Allard <benoit.allard@greenbone.net> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Benoît Allard <benoit.allard@greenbone.net> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2016-10-19core/br2-external: export paths and descriptionsYann E. MORIN
Now that we support multiple br2-external trees, BR2_EXTERNAL is no longer exported in the environment. This means that post-build scripts in a br2-external tree can no longer find their own files (well, they could re-invent the path by stripping their known-relative path, but that'd be ugly, especially since we can very well provide it). Export the path for each br2-external trees as environment variables. Do so for the description as well, as a courtesy. Also, re-order variable definitions to be more logical: first, purely internal variables, then exported variables. Reported-by: Benoît Allard <benoit.allard@greenbone.net> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Benoît Allard <benoit.allard@greenbone.net> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2016-10-19support/misc/Vagrantfile: bump to ubuntu 16.04Angelo Compagnucci
* Updating to ubuntu 16.04 * Fixing dependencies * Fixing locale complaints * Removing unused packages Signed-off-by: Angelo Compagnucci <angelo.compagnucci@gmail.com> Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2016-10-16core: support description for br2-external treesYann E. MORIN
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2016-10-16core: allow a br2-external tree to override a defconfigYann E. MORIN
Currently, it is not possible for a br2-external tree to override a defconfig bundled in Buildroot, nor is it possible to override one from a previous br2-external tree in the stack. However, it is interesting that a latter br2-external tree be able to override a defconfig: - the ones bundled in Buildroot are minimalist, and almost always build a toolchain, so a br2-external tree may want to provide a "better" defconfig (better, in the sense "suited for the project"); - similarly for a defconfig from a previous br2-external tree. But we can't do that, as the rules for the defconfigs are generated in the order the br2-external trees are specified, all after the bundled defconfigs. Those rule are patten-matching rules, which means that the first one to match is used, and the following ones are ignored. Add a new utility macro, 'reverse', inspired from GMSL, that does what it says: reverse a list of words. Use that macro to reverse the list of br2-external trees, so that the latters win over the formers, and even over bundled ones. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Cc: Arnout Vandecappelle <arnout@mind.be> Cc: Samuel Martin <s.martin49@gmail.com> Cc: Romain Naour <romain.naour@openwide.fr> Cc: Julien CORJON <corjon.j@ecagroup.com> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2016-10-16core: add support for multiple br2-external treesYann E. MORIN
Currently, we only support at most one br2-external tree. Being able to use more than one br2-external tree can be very useful. A use-case would be for having a br2-external to contain the basic packages, basic board defconfigs and board files, provided by one team responsible for the "board-bringup", while other teams consume that br2-external as a base, and complements it each with their own set of packages, defconfigs and extra board files. Another use-case would be for third-parties to provide their own Buildroot packaging in a br2-external tree, along-side the archives for their stuff. Finally, another use-case is to be able to add FLOSS packages in a br2-external tree, and proprietary packages in another. This allows to not touch the Buildroot tree at all, and still be able to get in compliance by providing only that br2-external tree(s) that contains FLOSS packages, leaving aside the br2-external tree(s) with the proprietary bits. What we do is to treat BR2_EXTERNAL as a colon-separated (space- separated also work, and we use that internally) list of paths, on which we iterate to construct: - the list of all br2-external names, BR2_EXTERNAL_NAMES, - the per-br2-external tree BR2_EXTERNAL_$(NAME) variables, which point each to the actual location of the corresponding tree, - the list of paths to all the external.mk files, BR2_EXTERNAL_MKS, - the space-separated list of absolute paths to the external trees, BR2_EXTERNAL_DIRS. Once we have all those variables, we replace references to BR2_EXTERNAL with either one of those. This cascades into how we display the list of defconfigs, so that it is easy to see what br2-external tree provides what defconfigs. As suggested by Arnout, tweak the comment from "User-provided configs" to "External configs", on the assumption that some br2-external trees could be provided by vendors, so not necessarily user-provided. Ditto the menu in Kconfig, changed from "User-provided options" to "External options". Now, when more than one br2-external tree is used, each gets its own sub-menu in the "User-provided options" menu. The sub-menu is labelled with that br2-external tree's name and the sub-menu's first item is a comment with the path to that br2-external tree. If there's only one br2-external tree, then there is no sub-menu; there is a single comment that contains the name and path to the br2-external tree. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Cc: Arnout Vandecappelle <arnout@mind.be> Cc: Romain Naour <romain.naour@openwide.fr> Cc: Julien CORJON <corjon.j@ecagroup.com> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2016-10-16docs/manual: add appendix to convert old br2-external treesYann E. MORIN
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Cc: Arnout Vandecappelle <arnout@mind.be> Cc: Samuel Martin <s.martin49@gmail.com> Cc: Romain Naour <romain.naour@openwide.fr> Cc: Julien CORJON <corjon.j@ecagroup.com> [Peter: slightly reword] Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2016-10-16core: introduce per br2-external NAMEYann E. MORIN
This unique NAME is used to construct a per br2-external tree variable, BR2_EXTERNAL_$(NAME)_PATH, which contains the path to the br2-external tree. This variable is available both from Kconfig (set in the Kconfig snippet) and from the .mk files. Also, display the NAME and its path as a comment in the menuconfig. This will ultimately allow us to support multiple br2-external trees at once, with that NAME (and thus BR2_EXTERNAL_$(NAME)) uniquely defining which br2-external tree is being used. The obvious outcome is that BR2_EXTERNAL should now no longer be used to refer to the files in the br2-external tree; that location is now known from the BR2_EXTERNAL_$(NAME)_PATH variable instead. This means we no longer need to expose, and must stop from from exposing BR2_EXTERNAL as a Kconfig variable. Finally, this also fixes a latent bug in the pkg-generic infra, where we would so far always refer to BR2_EXTERNAL (even if not set) to filter the names of packages (to decide whether they are a bootloader, a toolchain or a simple package). Note: since the variables in the Makefile and in Kconfig are named the same, the one we computed early on in the Makefile will be overridden by the one in .config when we have it. Thus, even though they are set to the same raw value, the one from .config is quoted and, being included later in the Makefile, will take precedence, so we just re-include the generated Makefile fragment a third time before includeing the br2-external's Makefiles. That's unfortunate, but there is no easy way around that as we do want the two variables to be named the same in Makefile and Kconfig (and we can't ask the user to un-quote that variable himself either), hence this little dirty triple-inclusion trick. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Cc: Arnout Vandecappelle <arnout@mind.be> Cc: Romain Naour <romain.naour@openwide.fr> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2016-10-16core/br2-external: validate even moreYann E. MORIN
A br2-external tree must provide external.mk and Config.in. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Cc: Arnout Vandecappelle <arnout@mind.be> Cc: Romain Naour <romain.naour@openwide.fr> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2016-10-16core: offload handling of BR2_EXTERNAL into the scriptYann E. MORIN
Currently, we treat the case where we have no br2-external tree (BR2_EXTERNAL is empty) differently from the case where we do have one (BR2_EXTERNAL is not empty). There is now no reason to treat those two cases differently: - the kconfig snippet is always generated appropriately (i.e. it would include the br2-external tree if set, or include nothing otherwise); - we no longer have a dummy br-external tree either. Also, the Makefile code to handle BR2_EXTERNAL is currently quite readable if at least a little bit tricky. However, when we're going to add support for using multiple br2-external trees simultaneously, this code would need to get much, much more complex. To keep the Makefile (rather) simple, offload all of the handling of BR2_EXTERNAL to the recently added br2-external helper script. However, because of Makefiles idiosyncracies, we can't use a rule to generate that Makefile fragment. Instead, we use $(shell ...) to call the helper script, and include the fragment twice: once before the $(shell ...) so we can grab a previously defined BR2_EXTERNAL value, a second time to use the one passed on the command line, if any. Furthermore, we can't error out (e.g. on non-existent br2-external tree) directly from the fragment or we'd get that error on subsequent calls, with no chance to override it even from command line. Instead, we use a variable in which we store the error, set it to empty before the second inclusion, so that only the one newly generated, if any, is taken into account. Since we know the script will always be called from Makefile context first, we know validation will occur in Makefile context first. So we can assume that, if there is an error, it will be detected in Makefile context. Consequently, if the script is called to generate the kconfig fragment, validation has already occured, and there should be no error. So we change the error function to generate Makefile code, so that errors are caught as explained above. Lastly, when the value of BR2_EXTERNAL changes, we want to 'forget' about the previous value of the BR2_EXTERNAL_MK variable, especially in the case where BR2_EXTERNAL is now set to empty, so that we do not try to include it later. That's why we first generate empty version of BR2_EXTERNAL_MK, and then assign it the new value, if any. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Cc: Arnout Vandecappelle <arnout@mind.be> Cc: Romain Naour <romain.naour@openwide.fr> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2016-10-16core: get rid of our dummy br2-external treeYann E. MORIN
Now that we generate a kconfig snippet, we can conditionally include the BR2_EXTERNAL's Config.in only when BR2_EXTERNAL is supplied by the user, which means our empty/dummy Config.in is no needed. As for external.mk, we can also include it only when BR2_EXTERNAL is supplied by the user, which means our empty/dummy external.mk is no longer needed. Ditch both of those files, and: - only generate actual content in the Kconfig snippet when we actually do have a BR2_EXTERNAL provided by the user (i.e. BR2_EXTERNAL is not empty); - add a variable that contains the path to the external.mk provided by the user, or empty if none, and include the path set in that variable (make can 'include' nothing without any problem! ;-) ) Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Cc: Arnout Vandecappelle <arnout@mind.be> Cc: Romain Naour <romain.naour@openwide.fr> Cc: Julien CORJON <corjon.j@ecagroup.com> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2016-10-16core: do not hard-code inclusion of br2-external in KconfigYann E. MORIN
Move the inclusion of br2-external's Config.in to the generated kconfig snippet. This will ultimately allow us to use more than one br2-external tree. Offload the "User-provided options" menu to the generated Kconfig snippet. We can also move the definition of the Kconfig-version of BR2_EXTERNAL into this snippet. We introduce an extra check that was not present in the previous code, to check that we do have permission on that directory. Prevciously, it was handled as a side effect of not being able to cd into there, but it is cleaner to check it expressly. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Cc: Arnout Vandecappelle <arnout@mind.be> Cc: Romain Naour <romain.naour@openwide.fr> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2016-10-16dependencies: check for Math BigInt/BigRat Perl moduleRomain Naour
As for MakeMaker Perl module, add a check for Math BigInt/BigRat Perl Core module, which are needed by mpv. Fixes: Waf: Entering directory `output/build/mpv-0.17.0/build' [ 1/198] Compiling version.sh [ 12/198] Processing ebml_types.h: demux/ebml.c demux/demux_mkv.c -> build/ebml_types.h [ 13/198] Compiling demux/ebml.c Can't locate Math/BigRat.pm in @INC (you may need to install the Math::BigRat module) Waf: Entering directory `output/build/mpv-0.17.0/build' [ 1/198] Compiling version.sh [ 2/198] Compiling TOOLS/osxbundle/mpv.app/Contents/Resources/icon.icns [ 3/198] Compiling video/out/x11_icon.bin [ 4/198] Compiling etc/input.conf [ 5/198] Compiling sub/osd_font.otf [ 6/198] Compiling video/out/opengl/nnedi3_weights.bin [ 7/198] Compiling player/lua/defaults.lua [ 8/198] Compiling player/lua/assdraw.lua [ 9/198] Compiling player/lua/options.lua [ 10/198] Compiling player/lua/osc.lua [ 11/198] Compiling player/lua/ytdl_hook.lua [ 12/198] Processing ebml_types.h: demux/ebml.c demux/demux_mkv.c -> build/ebml_types.h [ 13/198] Compiling demux/ebml.c [ 14/198] Compiling DOCS/man/mpv.rst Can't locate Math/BigInt.pm in @INC (you may need to install the Math::BigInt module) Signed-off-by: Romain Naour <romain.naour@gmail.com> Cc: François Perrad <francois.perrad@gadz.org> [Thomas et al.: make those perl modules only required when mpv is enabled.] Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2016-10-16dependencies: check for MakeMaker Perl moduleRomain Naour
ExtUtils::MakeMaker is one of the Perl Core modules usually packaged in Perl package for a Debian/Ubuntu based system. For a Fedora based system, each Perl Core modules have their own RPM package. So install only Perl package is not enough. Fixes: >>> host-libxml-parser-perl 2.41 Configuring [...] perl `which perl` Makefile.PL Can't locate ExtUtils/MakeMaker.pm in @INC (you may need to install the ExtUtils::MakeMaker module) Add a new Perl module check in dependency.sh. Signed-off-by: Romain Naour <romain.naour@gmail.com> Cc: François Perrad <francois.perrad@gadz.org> Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>