core: allow br2-external trees to provide resources usually in choices (branch yem/br2-ext-providers)
v2 cover core: allow br2-external trees to provide resources usually in choices (branch yem/br2-ext-providers)
Hello All!
Some packages, like jpeg, openssl or the external toolchains, are presented to the user in a kconfig choice, which precludes br2-external trees to easily provide alternatives to those.
This series prepares Buildroot to accept br2-external trees to provide such alternatives, that are seamlessly integrated into the existing choices.
The naive solution would be to simply add a new entry in every such coices, like "from a br2-external tree", and let the br2-external tree provide standard packages. However, this solution suffers frm two flaws:
- it is not very user-friendly,
- it still allows to select two or more providers for such packages, a situation which the choice otherwise avoids.
We could have lived with that, like we do for providers of other virtual packages that are not in a choice, but this is not so nice. And in the end, the alternative solution, implemented in this series, see below, will even allow us to move all virtual packages into a set of choices (when that makes sense).
Before we can allow br2-external trees to provide them we must allow for the kconfig variables that hold the paths to br2-external trees, to be available through-out kconfig, not only at the end. It usually does not matter in kconfig when a variable gets assigned a value, except when the variable is used to source a file, at which point its value must be known.
So, the few preparatory patches make it so that the paths are defined early, so they are available everywhere, and makes the handling of the internal .br-exterrnal.mk more logical and consistent.
Finally, the series introduces the possibility for br2-external trees to provide alternatives to the three meaningful packages: external toolchains, jpeg and openssl.
Eventually, this is documented in the manual.
In the future, we will be able to turn the GL providers into a choice. With this new mechanism, br2-external tree will be able to expose their GL providers, and they will appear in that choice.
Notes: we decided to go with a single do_kconfig() function in the helper script, so the redirection is a bit disconcerting at first, especially in the do_mk() function. The alternative would have been to provide one funciton for each feature, and redirect the output of each functions, like so:
do_mk >$output_mk
do_kconfig_paths >$output_paths_in
do_kconfig_menus >$output_menus_in
do_kconfig_jpeg >$output_jpeg_in
but that would have meant that each of those functions would have had to repeat all the boilerplate:
- the comment "this is a generated file; don't edit"
- testing if there was no br2-external tree and returning if so
- the loop over all the br2_names
- the evaluation of br2_desc and br2_ext (the path)
In the end, at the expense of a bit more complexity in the redirections, a single function was deemed nicer overall.
Changes v1 -> v2:
- push back redirection of helpers to its own patch
- expand manual changes
- reorder patches to have fixes first
Regards,
Yann E. MORIN.
The following changes since commit b254cb25b2ab89ac482abd4da91d827abfe2344e
package/zip: adjust the version to 3.0 (2019-07-29 09:26:26 +0200)
are available in the git repository at:
git://git.buildroot.org/~ymorin/git/buildroot.git
for you to fetch changes up to 7f27bb724debc80a274d44a169f1680e88509189
docs/manual: document providers from br2-external (2019-07-29 22:19:03 +0200)
----------------------------------------------------------------
Yann E. MORIN (13):
supports/scripts: declare missing local variables support/scripts: drop help for internal helper script
core: move generated .br2-external kconfig file to $(BASE_DIR)
core: rename generated .br-external.mk file
core: simplify removal of generated br2-external files
core: generate all br2-external files in one go
core: drop now-useless prepare-kconfig rule
core: prepare for generating multiple kconfig fragments
core: split generated kconfig file
core: allow br2-external trees to provide pre-configured toolchains
core: allow br2-external trees to provide libjpeg
core: allow br2-external trees to provide opensl docs/manual: document providers from br2-external
Config.in | 10 +- Makefile | 41 +++---- docs/manual/customize-outside-br.txt | 91 ++++++++++++++- package/jpeg/Config.in | 3 + package/openssl/Config.in | 3 + support/scripts/br2-external | 196 +++++++++++++++++---------------- toolchain/toolchain-external/Config.in | 5 +- 7 files changed, 224 insertions(+), 125 deletions(-)
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ | | +33 561 099 427 `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. | '------------------------------^-------^------------------^--------------------'
PATCH v2 1/13 supports/scripts: declare missing local variables
Commit b14b02698 (core/br2-external: restore compatibility with old distros) switched to using 'eval' to emulate assocviative arrays, for those distros too old to have bash-4+.
In so doing, it forgot to declare the new local variables in the respective helper functions.
---
Changes v1 -> v2;
- add another missing variable
--- support/scripts/br2-external | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
support/scripts/br2-external +2 -2
@@ -119,7 +119,7 @@ do_validate_one() { # Generate the .mk snippet that defines makefile variables # for the br2-external tree do_mk() { - local br2_name br2_ext + local br2_name br2_desc br2_ext printf '#\n# Automatically generated file; DO NOT EDIT.\n#\n' printf '\n'
@@ -155,7 +155,7 @@ do_mk() { # Generate the kconfig snippet for the br2-external tree. do_kconfig() { - local br2_name br2_ext + local br2_name br2_desc br2_ext printf '#\n# Automatically generated file; DO NOT EDIT.\n#\n' printf '\n'
Signature · 1 line
2.20.1
PATCH v2 1/13 supports/scripts: declare missing local variables
Quoted 9 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Yann" == Yann E MORIN <[email protected]> writes:
Commit
b14b02698(core/br2-external: restore compatibility with old distros) switched to using 'eval' to emulate assocviative arrays, for those distros too old to have bash-4+.In so doing, it forgot to declare the new local variables in the respective helper functions.
Quoted 8 lines
Signed-off-by "Yann E. MORIN" <[email protected]>Cc Vadim Kochan <[email protected]>Cc Arnout Vandecappelle <[email protected]>Cc Ricardo Martincoski <[email protected]>---
Changes v1 -> v2;
- add another missing variable
Committed, thanks.
Signature · 1 line
Bye, Peter Korsgaard
PATCH v2 2/13 support/scripts: drop help for internal helper script
In reply to Yann E. MORINWe do not usually provide help for our internal scripts. Besides, such help has a tendency to bitrot pretty quickly anyway.
--- support/scripts/br2-external | 33 +-------------------------------- 1 file changed, 1 insertion(+), 32 deletions(-)
support/scripts/br2-external +1 -32
@@ -16,9 +16,8 @@ main() { local OPT OPTARG local br2_ext ofile ofmt - while getopts :hkmo: OPT; do + while getopts :kmo: OPT; do case "${OPT}" in - h) help; exit 0;; o) ofile="${OPTARG}";; k) ofmt="kconfig";; m) ofmt="mk";;
@@ -188,36 +187,6 @@ do_kconfig() { printf "endmenu # User-provided options\n" } -help() { - cat <<-_EOF_ - Usage: - ${my_name} <-m|-k> -o FILE PATH - - With -m, ${my_name} generates the makefile fragment that defines - variables related to the br2-external trees passed as positional - arguments. - - With -k, ${my_name} generates the kconfig snippet to include the - configuration options specified in the br2-external trees passed - as positional arguments. - - Using -k and -m together is not possible. The last one wins. - - Options: - -m Generate the makefile fragment. - - -k Generate the kconfig snippet. - - -o FILE - FILE in which to generate the kconfig snippet or makefile - fragment. - - Returns: - 0 If no error - !0 If any error - _EOF_ -} - error() { local fmt="${1}"; shift; printf "BR2_EXTERNAL_ERROR = ${fmt}" "${@}"; exit 1; } my_name="${0##*/}"
Signature · 1 line
2.20.1
PATCH v2 2/13 support/scripts: drop help for internal helper script
Quoted 7 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Yann" == Yann E MORIN <[email protected]> writes:
We do not usually provide help for our internal scripts. Besides, such help has a tendency to bitrot pretty quickly anyway.
Signed-off-by "Yann E. MORIN" <[email protected]>Cc Vadim Kochan <[email protected]>
Committed, thanks.
Signature · 1 line
Bye, Peter Korsgaard
PATCH v2 3/13 core: move generated .br2-external kconfig file to $(BASE_DIR)
In reply to Yann E. MORINCurrently, that file is generated rather late in the configuration process, so BUILD_DIR is known (and exists) by then.
We're soon to generate that file much earlier, at a point where BUILD_DIR is not yet known, so we have two options:
1- declare BUILD_DIR earlier;
2- generate the file in an already-known location.
We go with the second solution, as we're already generating a br2-external related file in BASE_DIR, so we can as well generate all br2-external files in the same place.
--- Config.in | 6 +++--- Makefile | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-)
Config.in +3 -3
@@ -14,9 +14,9 @@ config BR2_HOSTARCH string option env="HOSTARCH" -config BR2_BUILD_DIR +config BR2_BASE_DIR string - option env="BUILD_DIR" + option env="BASE_DIR" # Hidden config symbols for packages to check system gcc version config BR2_HOST_GCC_VERSION
@@ -865,4 +865,4 @@ source "package/Config.in.host" source "Config.in.legacy" -source "$BR2_BUILD_DIR/.br2-external.in" +source "$BR2_BASE_DIR/.br2-external.in"
Makefile +5 -5
@@ -934,7 +934,7 @@ HOSTCFLAGS = $(CFLAGS_FOR_BUILD) export HOSTCFLAGS .PHONY: prepare-kconfig -prepare-kconfig: outputmakefile $(BUILD_DIR)/.br2-external.in +prepare-kconfig: outputmakefile $(BASE_DIR)/.br2-external.in $(BUILD_DIR)/buildroot-config/%onf: mkdir -p $(@D)/lxdialog
@@ -952,7 +952,7 @@ COMMON_CONFIG_ENV = \ KCONFIG_TRISTATE=$(BUILD_DIR)/buildroot-config/tristate.config \ BR2_CONFIG=$(BR2_CONFIG) \ HOST_GCC_VERSION="$(HOSTCC_VERSION)" \ - BUILD_DIR=$(BUILD_DIR) \ + BASE_DIR=$(BASE_DIR) \ SKIP_LEGACY= xconfig: $(BUILD_DIR)/buildroot-config/qconf prepare-kconfig
@@ -1034,8 +1034,8 @@ endif # Even though the target is a real file, we mark it as PHONY as we # want it to be re-generated each time make is invoked, in case the # value of BR2_EXTERNAL is changed. -.PHONY: $(BUILD_DIR)/.br2-external.in -$(BUILD_DIR)/.br2-external.in: $(BUILD_DIR) +.PHONY: $(BASE_DIR)/.br2-external.in +$(BASE_DIR)/.br2-external.in: $(BUILD_DIR) $(Q)support/scripts/br2-external -k -o "$(@)" $(BR2_EXTERNAL) # printvars prints all the variables currently defined in our
@@ -1066,7 +1066,7 @@ ifeq ($(O),$(CURDIR)/output) rm -rf $(O) endif rm -rf $(TOPDIR)/dl $(BR2_CONFIG) $(CONFIG_DIR)/.config.old $(CONFIG_DIR)/..config.tmp \ - $(CONFIG_DIR)/.auto.deps $(BR2_EXTERNAL_FILE) + $(CONFIG_DIR)/.auto.deps $(BR2_EXTERNAL_FILE) $(BASE_DIR)/.br2-external.in .PHONY: help help:
Signature · 1 line
2.20.1
PATCH v2 3/13 core: move generated .br2-external kconfig file to $(BASE_DIR)
Quoted 10 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Yann" == Yann E MORIN <[email protected]> writes:
Currently, that file is generated rather late in the configuration process, so
BUILD_DIRis known (and exists) by then.We're soon to generate that file much earlier, at a point where
BUILD_DIRis not yet known, so we have two options:
1- declareBUILD_DIRearlier;
2- generate the file in an already-known location.
Quoted 6 lines
We go with the second solution, as we're already generating a br2-external related file in
BASE_DIR, so we can as well generate all br2-external files in the same place.Signed-off-by "Yann E. MORIN" <[email protected]>Cc Vadim Kochan <[email protected]>
Committed, thanks.
Signature · 1 line
Bye, Peter Korsgaard
PATCH v2 4/13 core: rename generated .br-external.mk file
In reply to Yann E. MORINNow that the two (all of them!) br2-external related files are generated in the same location, it makes sense they are named after the same pattern.
When initial support for (then single) br2-external trees was added back in a4239f7fd1 (core: introduce the BR2_EXTERNAL variable), it was not clear-cut why that file was not named with a br2 prefix.
So rename it now.
---
Changes v1 -> v2:
- update manual accordingly
---
The reason for the original naming is probably because of the long undocumented (except buried in an old dev-days report) and mostly never-obeyed rule that internal variables should be prefixed with BR_ not BR2_, the latter being reserved for user-facing variables, and thus the same was thought for the generated file. Or maybe not...
--- Makefile | 2 +- docs/manual/customize-outside-br.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
Makefile +1 -1
@@ -179,7 +179,7 @@ $(if $(BASE_DIR),, $(error output directory "$(O)" does not exist)) # still be overridden on the command line, therefore the file is re-created # every time make is run. -BR2_EXTERNAL_FILE = $(BASE_DIR)/.br-external.mk +BR2_EXTERNAL_FILE = $(BASE_DIR)/.br2-external.mk -include $(BR2_EXTERNAL_FILE) $(shell support/scripts/br2-external \ -m -o '$(BR2_EXTERNAL_FILE)' $(BR2_EXTERNAL))
docs/manual/customize-outside-br.txt +1 -1
@@ -22,7 +22,7 @@ place project-specific customizations in two locations: One can tell Buildroot to use one or more br2-external trees by setting the +BR2_EXTERNAL+ make variable set to the path(s) of the br2-external tree(s) to use. It can be passed to any Buildroot +make+ invocation. It -is automatically saved in the hidden +.br-external.mk+ file in the output +is automatically saved in the hidden +.br2-external.mk+ file in the output directory. Thanks to this, there is no need to pass +BR2_EXTERNAL+ at every +make+ invocation. It can however be changed at any time by passing a new value, and can be removed by passing an empty value.
Signature · 1 line
2.20.1
PATCH v2 4/13 core: rename generated .br-external.mk file
Quoted 19 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Yann" == Yann E MORIN <[email protected]> writes:
Now that the two (all of them!) br2-external related files are generated in the same location, it makes sense they are named after the same pattern.
When initial support for (then single) br2-external trees was added back in
a4239f7fd1(core: introduce theBR2_EXTERNALvariable), it was not clear-cut why that file was not named with a br2 prefix.So rename it now.
Signed-off-by "Yann E. MORIN" <[email protected]>Cc Vadim Kochan <[email protected]>---
Changes v1 -> v2:
- update manual accordingly
Quoted 6 lines
---
The reason for the original naming is probably because of the long undocumented (except buried in an old dev-days report) and mostly never-obeyed rule that internal variables should be prefixed withBR_notBR2_, the latter being reserved for user-facing variables, and thus the same was thought for the generated file. Or maybe not...
Possibly ;)
Committed, thanks.
Signature · 1 line
Bye, Peter Korsgaard
PATCH v2 5/13 core: simplify removal of generated br2-external files
In reply to Yann E. MORINNow that all the br2-external generated files are named after the same pattern, it gets easier to remove them all using a glob.
Furthermore, we're on the verge of introducing more such generated files, so removing them at one fell swoop will be simpler too.
--- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Makefile +1 -1
@@ -1066,7 +1066,7 @@ ifeq ($(O),$(CURDIR)/output) rm -rf $(O) endif rm -rf $(TOPDIR)/dl $(BR2_CONFIG) $(CONFIG_DIR)/.config.old $(CONFIG_DIR)/..config.tmp \ - $(CONFIG_DIR)/.auto.deps $(BR2_EXTERNAL_FILE) $(BASE_DIR)/.br2-external.in + $(CONFIG_DIR)/.auto.deps $(BASE_DIR)/.br2-external.* .PHONY: help help:
Signature · 1 line
2.20.1
PATCH v2 5/13 core: simplify removal of generated br2-external files
Quoted 10 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Yann" == Yann E MORIN <[email protected]> writes:
Now that all the br2-external generated files are named after the same pattern, it gets easier to remove them all using a glob.
Furthermore, we're on the verge of introducing more such generated files, so removing them at one fell swoop will be simpler too.
Signed-off-by "Yann E. MORIN" <[email protected]>Cc Vadim Kochan <[email protected]>
Committed, thanks.
Signature · 1 line
Bye, Peter Korsgaard
PATCH v2 6/13 core: generate all br2-external files in one go
In reply to Yann E. MORINWhen we introduced support for multiple br2-external trees, we introduced two files, one on the Makefile side, needed very early, and one on the kconfig side, needed later in the configuration process. We naturally introduced a two-step generation, as it looked like the simplest and most obvious way.
But now, we are on the verge of generating more files on the kconfig side, and it does not make sense to add even more steps to generate them.
And even better yet, we can generate both the Makefile-side and kconfig-side files at the same time, in fact.
Make it so.
--- Makefile | 12 ++---------- support/scripts/br2-external | 23 ++++++++--------------- 2 files changed, 10 insertions(+), 25 deletions(-)
Makefile +2 -10
@@ -181,8 +181,7 @@ $(if $(BASE_DIR),, $(error output directory "$(O)" does not exist)) BR2_EXTERNAL_FILE = $(BASE_DIR)/.br2-external.mk -include $(BR2_EXTERNAL_FILE) -$(shell support/scripts/br2-external \ - -m -o '$(BR2_EXTERNAL_FILE)' $(BR2_EXTERNAL)) +$(shell support/scripts/br2-external -d '$(BASE_DIR)' $(BR2_EXTERNAL)) BR2_EXTERNAL_ERROR = include $(BR2_EXTERNAL_FILE) ifneq ($(BR2_EXTERNAL_ERROR),)
@@ -934,7 +933,7 @@ HOSTCFLAGS = $(CFLAGS_FOR_BUILD) export HOSTCFLAGS .PHONY: prepare-kconfig -prepare-kconfig: outputmakefile $(BASE_DIR)/.br2-external.in +prepare-kconfig: outputmakefile $(BUILD_DIR)/buildroot-config/%onf: mkdir -p $(@D)/lxdialog
@@ -1031,13 +1030,6 @@ ifeq ($(NEED_WRAPPER),y) $(Q)$(TOPDIR)/support/scripts/mkmakefile $(TOPDIR) $(O) endif -# Even though the target is a real file, we mark it as PHONY as we -# want it to be re-generated each time make is invoked, in case the -# value of BR2_EXTERNAL is changed. -.PHONY: $(BASE_DIR)/.br2-external.in -$(BASE_DIR)/.br2-external.in: $(BUILD_DIR) - $(Q)support/scripts/br2-external -k -o "$(@)" $(BR2_EXTERNAL) - # printvars prints all the variables currently defined in our # Makefiles. Alternatively, if a non-empty VARS variable is passed, # only the variables matching the make pattern passed in VARS are
support/scripts/br2-external +8 -15
@@ -14,13 +14,11 @@ MANUAL_URL='https://buildroot.org/manual.html\#br2-external-converting' main() { local OPT OPTARG - local br2_ext ofile ofmt + local br2_ext outputdir - while getopts :kmo: OPT; do + while getopts :d: OPT; do case "${OPT}" in - o) ofile="${OPTARG}";; - k) ofmt="kconfig";; - m) ofmt="mk";; + d) outputdir="${OPTARG}";; :) error "option '%s' expects a mandatory argument\n" "${OPTARG}";; \?) error "unknown option '%s'\n" "${OPTARG}";; esac
@@ -28,23 +26,18 @@ main() { # Forget options; keep only positional args shift $((OPTIND-1)) - case "${ofmt}" in - mk|kconfig) - ;; - *) error "no output format specified (-m/-k)\n";; - esac - if [ -z "${ofile}" ]; then - error "no output file specified (-o)\n" + if [ -z "${outputdir}" ]; then + error "no output directory specified (-d)\n" fi - exec >"${ofile}" - # Trap any unexpected error to generate a meaningful error message trap "error 'unexpected error while generating ${ofile}\n'" ERR do_validate ${@//:/ } - do_${ofmt} + mkdir -p "${outputdir}" + do_mk >"${outputdir}/.br2-external.mk" + do_kconfig >"${outputdir}/.br2-external.in" } # Validates the br2-external trees passed as arguments. Makes each of
Signature · 1 line
2.20.1
PATCH v2 6/13 core: generate all br2-external files in one go
Quoted 12 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Yann" == Yann E MORIN <[email protected]> writes:
When we introduced support for multiple br2-external trees, we introduced two files, one on the
Makefileside, needed very early, and one on the kconfig side, needed later in the configuration process. We naturally introduced a two-step generation, as it looked like the simplest and most obvious way.But now, we are on the verge of generating more files on the kconfig side, and it does not make sense to add even more steps to generate them.
Quoted 7 lines
And even better yet, we can generate both the Makefile-side and kconfig-side files at the same time, in fact.
Make it so.
Signed-off-by "Yann E. MORIN" <[email protected]>Cc Vadim Kochan <[email protected]>
Committed, thanks.
Signature · 1 line
Bye, Peter Korsgaard
PATCH v2 7/13 core: drop now-useless prepare-kconfig rule
In reply to Yann E. MORINThis rule was added back in 9429e7b698 (core: introduce an intermediate rule before the configurators) when the kconfig-side br2-external file was generated separately from the Makefile-side one.
Now that they are generated together very early in the Makefile, we no longer need this intermediate rule. Drop it.
--- Makefile | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-)
Makefile +11 -14
@@ -932,9 +932,6 @@ endif # ifeq ($(BR2_HAVE_DOT_CONFIG),y) HOSTCFLAGS = $(CFLAGS_FOR_BUILD) export HOSTCFLAGS -.PHONY: prepare-kconfig -prepare-kconfig: outputmakefile - $(BUILD_DIR)/buildroot-config/%onf: mkdir -p $(@D)/lxdialog PKG_CONFIG_PATH="$(HOST_PKG_CONFIG_PATH)" $(MAKE) CC="$(HOSTCC_NOCCACHE)" HOSTCC="$(HOSTCC_NOCCACHE)" \
@@ -954,19 +951,19 @@ COMMON_CONFIG_ENV = \ BASE_DIR=$(BASE_DIR) \ SKIP_LEGACY= -xconfig: $(BUILD_DIR)/buildroot-config/qconf prepare-kconfig +xconfig: $(BUILD_DIR)/buildroot-config/qconf outputmakefile @$(COMMON_CONFIG_ENV) $< $(CONFIG_CONFIG_IN) -gconfig: $(BUILD_DIR)/buildroot-config/gconf prepare-kconfig +gconfig: $(BUILD_DIR)/buildroot-config/gconf outputmakefile @$(COMMON_CONFIG_ENV) srctree=$(TOPDIR) $< $(CONFIG_CONFIG_IN) -menuconfig: $(BUILD_DIR)/buildroot-config/mconf prepare-kconfig +menuconfig: $(BUILD_DIR)/buildroot-config/mconf outputmakefile @$(COMMON_CONFIG_ENV) $< $(CONFIG_CONFIG_IN) -nconfig: $(BUILD_DIR)/buildroot-config/nconf prepare-kconfig +nconfig: $(BUILD_DIR)/buildroot-config/nconf outputmakefile @$(COMMON_CONFIG_ENV) $< $(CONFIG_CONFIG_IN) -config: $(BUILD_DIR)/buildroot-config/conf prepare-kconfig +config: $(BUILD_DIR)/buildroot-config/conf outputmakefile @$(COMMON_CONFIG_ENV) $< $(CONFIG_CONFIG_IN) # For the config targets that automatically select options, we pass
@@ -974,11 +971,11 @@ config: $(BUILD_DIR)/buildroot-config/conf prepare-kconfig # no values are set for the legacy options so a subsequent oldconfig # will query them. Therefore, run an additional olddefconfig. -randconfig allyesconfig alldefconfig allnoconfig: $(BUILD_DIR)/buildroot-config/conf prepare-kconfig +randconfig allyesconfig alldefconfig allnoconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile @$(COMMON_CONFIG_ENV) SKIP_LEGACY=y $< --$@ $(CONFIG_CONFIG_IN) @$(COMMON_CONFIG_ENV) $< --olddefconfig $(CONFIG_CONFIG_IN) >/dev/null -randpackageconfig allyespackageconfig allnopackageconfig: $(BUILD_DIR)/buildroot-config/conf prepare-kconfig +randpackageconfig allyespackageconfig allnopackageconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile @grep -v BR2_PACKAGE_ $(BR2_CONFIG) > $(CONFIG_DIR)/.config.nopkg @$(COMMON_CONFIG_ENV) SKIP_LEGACY=y \ KCONFIG_ALLCONFIG=$(CONFIG_DIR)/.config.nopkg \
@@ -986,15 +983,15 @@ randpackageconfig allyespackageconfig allnopackageconfig: $(BUILD_DIR)/buildroot @rm -f $(CONFIG_DIR)/.config.nopkg @$(COMMON_CONFIG_ENV) $< --olddefconfig $(CONFIG_CONFIG_IN) >/dev/null -oldconfig syncconfig olddefconfig: $(BUILD_DIR)/buildroot-config/conf prepare-kconfig +oldconfig syncconfig olddefconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile @$(COMMON_CONFIG_ENV) $< --$@ $(CONFIG_CONFIG_IN) -defconfig: $(BUILD_DIR)/buildroot-config/conf prepare-kconfig +defconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile @$(COMMON_CONFIG_ENV) $< --defconfig$(if $(DEFCONFIG),=$(DEFCONFIG)) $(CONFIG_CONFIG_IN) define percent_defconfig # Override the BR2_DEFCONFIG from COMMON_CONFIG_ENV with the new defconfig -%_defconfig: $(BUILD_DIR)/buildroot-config/conf $(1)/configs/%_defconfig prepare-kconfig +%_defconfig: $(BUILD_DIR)/buildroot-config/conf $(1)/configs/%_defconfig outputmakefile @$$(COMMON_CONFIG_ENV) BR2_DEFCONFIG=$(1)/configs/$$@ \ $$< --defconfig=$(1)/configs/$$@ $$(CONFIG_CONFIG_IN) endef
@@ -1002,7 +999,7 @@ $(eval $(foreach d,$(call reverse,$(TOPDIR) $(BR2_EXTERNAL_DIRS)),$(call percent update-defconfig: savedefconfig -savedefconfig: $(BUILD_DIR)/buildroot-config/conf prepare-kconfig +savedefconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile @$(COMMON_CONFIG_ENV) $< \ --savedefconfig=$(if $(DEFCONFIG),$(DEFCONFIG),$(CONFIG_DIR)/defconfig) \ $(CONFIG_CONFIG_IN)
Signature · 1 line
2.20.1
PATCH v2 7/13 core: drop now-useless prepare-kconfig rule
Quoted 11 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Yann" == Yann E MORIN <[email protected]> writes:
This rule was added back in
9429e7b698(core: introduce an intermediate rule before the configurators) when the kconfig-side br2-external file was generated separately from the Makefile-side one.Now that they are generated together very early in the
Makefile, we no longer need this intermediate rule. Drop it.Signed-off-by "Yann E. MORIN" <[email protected]>Cc Vadim Kochan <[email protected]>
We still had a reference to this rule in docs/manual/adding-packages-asciidoc.txt, so I've dropped that as well and committed, thanks.
Signature · 1 line
Bye, Peter Korsgaard
PATCH v2 8/13 core: prepare for generating multiple kconfig fragments
In reply to Yann E. MORINWe currently redirect the output of each helper function. This was nice as long as we were generating single .mk and .in fragments.
But we are soon to need more .in fragments.
So, do the redirection inside the .in helpers.
We do not (currently) need to generate more than one .mk fragment, but for consistency, do the redirection in the .mk helper too.
--- support/scripts/br2-external | 112 ++++++++++++++++++----------------- 1 file changed, 59 insertions(+), 53 deletions(-)
support/scripts/br2-external +59 -53
@@ -36,8 +36,8 @@ main() { do_validate ${@//:/ } mkdir -p "${outputdir}" - do_mk >"${outputdir}/.br2-external.mk" - do_kconfig >"${outputdir}/.br2-external.in" + do_mk "${outputdir}" + do_kconfig "${outputdir}" } # Validates the br2-external trees passed as arguments. Makes each of
@@ -111,73 +111,79 @@ do_validate_one() { # Generate the .mk snippet that defines makefile variables # for the br2-external tree do_mk() { + local outputdir="${1}" local br2_name br2_desc br2_ext - printf '#\n# Automatically generated file; DO NOT EDIT.\n#\n' - printf '\n' + { + printf '#\n# Automatically generated file; DO NOT EDIT.\n#\n' + printf '\n' - printf 'BR2_EXTERNAL ?=' - for br2_name in "${BR2_EXT_NAMES[@]}"; do - eval br2_ext="\"\${BR2_EXT_PATHS_${br2_name}}\"" - printf ' %s' "${br2_ext}" - done - printf '\n' + printf 'BR2_EXTERNAL ?=' + for br2_name in "${BR2_EXT_NAMES[@]}"; do + eval br2_ext="\"\${BR2_EXT_PATHS_${br2_name}}\"" + printf ' %s' "${br2_ext}" + done + printf '\n' - printf 'BR2_EXTERNAL_NAMES = \n' - printf 'BR2_EXTERNAL_DIRS = \n' - printf 'BR2_EXTERNAL_MKS = \n' + printf 'BR2_EXTERNAL_NAMES = \n' + printf 'BR2_EXTERNAL_DIRS = \n' + printf 'BR2_EXTERNAL_MKS = \n' - if [ ${#BR2_EXT_NAMES[@]} -eq 0 ]; then - printf '\n' - printf '# No br2-external tree defined.\n' - return - fi + if [ ${#BR2_EXT_NAMES[@]} -eq 0 ]; then + printf '\n' + printf '# No br2-external tree defined.\n' + return + fi - for br2_name in "${BR2_EXT_NAMES[@]}"; do - eval br2_desc="\"\${BR2_EXT_DESCS_${br2_name}}\"" - eval br2_ext="\"\${BR2_EXT_PATHS_${br2_name}}\"" - printf '\n' - printf 'BR2_EXTERNAL_NAMES += %s\n' "${br2_name}" - printf 'BR2_EXTERNAL_DIRS += %s\n' "${br2_ext}" - printf 'BR2_EXTERNAL_MKS += %s/external.mk\n' "${br2_ext}" - printf 'export BR2_EXTERNAL_%s_PATH = %s\n' "${br2_name}" "${br2_ext}" - printf 'export BR2_EXTERNAL_%s_DESC = %s\n' "${br2_name}" "${br2_desc}" - done + for br2_name in "${BR2_EXT_NAMES[@]}"; do + eval br2_desc="\"\${BR2_EXT_DESCS_${br2_name}}\"" + eval br2_ext="\"\${BR2_EXT_PATHS_${br2_name}}\"" + printf '\n' + printf 'BR2_EXTERNAL_NAMES += %s\n' "${br2_name}" + printf 'BR2_EXTERNAL_DIRS += %s\n' "${br2_ext}" + printf 'BR2_EXTERNAL_MKS += %s/external.mk\n' "${br2_ext}" + printf 'export BR2_EXTERNAL_%s_PATH = %s\n' "${br2_name}" "${br2_ext}" + printf 'export BR2_EXTERNAL_%s_DESC = %s\n' "${br2_name}" "${br2_desc}" + done + } >"${outputdir}/.br2-external.mk" } # Generate the kconfig snippet for the br2-external tree. do_kconfig() { + local outputdir="${1}" local br2_name br2_desc br2_ext - printf '#\n# Automatically generated file; DO NOT EDIT.\n#\n' - printf '\n' - - if [ ${#BR2_EXT_NAMES[@]} -eq 0 ]; then - printf '# No br2-external tree defined.\n' - return - fi - - printf 'menu "External options"\n' - printf '\n' + { + printf '#\n# Automatically generated file; DO NOT EDIT.\n#\n' + printf '\n' - for br2_name in "${BR2_EXT_NAMES[@]}"; do - eval br2_desc="\"\${BR2_EXT_DESCS_${br2_name}}\"" - eval br2_ext="\"\${BR2_EXT_PATHS_${br2_name}}\"" - if [ ${#BR2_EXT_NAMES[@]} -gt 1 ]; then - printf 'menu "%s"\n' "${br2_desc}" - fi - printf 'comment "%s (in %s)"\n' "${br2_desc}" "${br2_ext}" - printf 'config BR2_EXTERNAL_%s_PATH\n' "${br2_name}" - printf '\tstring\n' - printf '\tdefault "%s"\n' "${br2_ext}" - printf 'source "%s/Config.in"\n' "${br2_ext}" - if [ ${#BR2_EXT_NAMES[@]} -gt 1 ]; then - printf 'endmenu # %s\n' "${br2_name}" + if [ ${#BR2_EXT_NAMES[@]} -eq 0 ]; then + printf '# No br2-external tree defined.\n' + return fi + + printf 'menu "External options"\n' printf '\n' - done - printf "endmenu # User-provided options\n" + for br2_name in "${BR2_EXT_NAMES[@]}"; do + eval br2_desc="\"\${BR2_EXT_DESCS_${br2_name}}\"" + eval br2_ext="\"\${BR2_EXT_PATHS_${br2_name}}\"" + if [ ${#BR2_EXT_NAMES[@]} -gt 1 ]; then + printf 'menu "%s"\n' "${br2_desc}" + fi + printf 'comment "%s (in %s)"\n' "${br2_desc}" "${br2_ext}" + printf 'config BR2_EXTERNAL_%s_PATH\n' "${br2_name}" + printf '\tstring\n' + printf '\tdefault "%s"\n' "${br2_ext}" + printf 'source "%s/Config.in"\n' "${br2_ext}" + if [ ${#BR2_EXT_NAMES[@]} -gt 1 ]; then + printf 'endmenu # %s\n' "${br2_name}" + fi + printf '\n' + done + + printf "endmenu # User-provided options\n" + } >"${outputdir}/.br2-external.in" } error() { local fmt="${1}"; shift; printf "BR2_EXTERNAL_ERROR = ${fmt}" "${@}"; exit 1; }
Signature · 1 line
2.20.1
PATCH v2 8/13 core: prepare for generating multiple kconfig fragments
Quoted 7 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Yann" == Yann E MORIN <[email protected]> writes:
We currently redirect the output of each helper function. This was nice as long as we were generating single .mk and .in fragments.
But we are soon to need more .in fragments.
Quoted 7 lines
So, do the redirection inside the .in helpers.
We do not (currently) need to generate more than one .mk fragment, but for consistency, do the redirection in the .mk helper too.
Signed-off-by Yann E. MORIN <[email protected]>Cc Vadim Kochan <[email protected]>
Committed, thanks.
Signature · 1 line
Bye, Peter Korsgaard
PATCH v2 9/13 core: split generated kconfig file
In reply to Yann E. MORINCurrently, the kconfig part contains two things: the kconfig option with the paths to br2-external trees, and the kconfig menus for the br2-external trees.
When we want to include more kconfig files from the br2-external tree (e.g. to get definitions for pre-built toolchains), we will need to have the paths defined earlier, so they can be used from the br2-external tree to include files earlier than the existing menus.
Split the generated kconfig file in two: one to define the paths, which gets included early in our main Config.in, and one to actually define the existing menus, which still gets included at the same place they currently are.
---
Changes v1 -> v2:
- redirection is changed in its own patch now
--- Config.in | 6 +++- support/scripts/br2-external | 63 ++++++++++++++++++++++-------------- 2 files changed, 44 insertions(+), 25 deletions(-)
Config.in +5 -1
@@ -18,6 +18,9 @@ config BR2_BASE_DIR string option env="BASE_DIR" +# br2-external paths definitions +source "$BR2_BASE_DIR/.br2-external.in.paths" + # Hidden config symbols for packages to check system gcc version config BR2_HOST_GCC_VERSION string
@@ -865,4 +868,5 @@ source "package/Config.in.host" source "Config.in.legacy" -source "$BR2_BASE_DIR/.br2-external.in" +# br2-external menus definitions +source "$BR2_BASE_DIR/.br2-external.in.menus"
support/scripts/br2-external +39 -24
81 lines not on this page · raw message
Signature · 1 line
2.20.1
PATCH v2 9/13 core: split generated kconfig file
Quoted 16 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Yann" == Yann E MORIN <[email protected]> writes:
Currently, the kconfig part contains two things: the kconfig option with the paths to br2-external trees, and the kconfig menus for the br2-external trees.
When we want to include more kconfig files from the br2-external tree (e.g. to get definitions for pre-built toolchains), we will need to have the paths defined earlier, so they can be used from the br2-external tree to include files earlier than the existing menus.
Split the generated kconfig file in two: one to define the paths, which gets included early in our main Config.in, and one to actually define the existing menus, which still gets included at the same place they currently are.
Quoted 6 lines
Signed-off-by "Yann E. MORIN" <[email protected]>Cc Vadim Kochan <[email protected]>---
Changes v1 -> v2:
- redirection is changed in its own patch now
Committed, thanks.
Signature · 1 line
Bye, Peter Korsgaard
PATCH v2 10/13 core: allow br2-external trees to provide pre-configured toolchains
In reply to Yann E. MORINSince we have a choice for the pre-configured pre-built toolchains, there is no p[ossbility for a br2-external to provide its own. The only solution so far for defconfigs in br2-external trees is to use BR2_TOOLCHAIN_EXTERNAL_CUSTOM and define all the bits by itself...
This is not so convemient, so offer a way for br2-external trees to provide such pre-configured toolchains.
To allow for this, we now scan each br2-external tree and look for a specific file, provides.toolchains.in. We generate a kconfig file that sources each such file, and that generated file is sourced from within the toolchain choice, thus making the toolchains from a br2-external tree possible and available in the same location as the ones known to Buildroot:
Toolchain --->
Toolchain type (External toolchain) --->
Toolchain --->
(X) Arm ARM 2019.03
( ) Linaro ARM 2018.05
( ) Custom toolchain
*** Toolchains from my-br2-ext-tree: ***
( ) My custom ARM toolchain
*** Toolchains from another-br2-ext-tree: ***
( ) Another custom ARM toolchain
( ) A third custom ARM toolchain--- support/scripts/br2-external | 9 +++++++++ toolchain/toolchain-external/Config.in | 5 ++++- 2 files changed, 13 insertions(+), 1 deletion(-)
support/scripts/br2-external +9 -0
@@ -157,6 +157,7 @@ do_kconfig() { items=( paths menus + toolchains ) for br2 in "${items[@]}"; do
@@ -196,6 +197,14 @@ do_kconfig() { fi printf '\n' } >>"${outputdir}/.br2-external.in.menus" + + if [ -f "${br2_ext}/provides/toolchains.in" ]; then + printf 'comment "Toolchains from: %s"\n' "${br2_desc}" + printf 'source "%s/provides/toolchains.in"\n' "${br2_ext}" + printf '\n' + else + printf '# No toolchain from: %s\n\n' "${br2_desc}" + fi >>"${outputdir}/.br2-external.in.toolchains" done printf 'endmenu\n' >>"${outputdir}/.br2-external.in.menus"
toolchain/toolchain-external/Config.in +4 -1
@@ -47,9 +47,12 @@ source "toolchain/toolchain-external/toolchain-external-codesourcery-amd64/Confi # Kept last, so it remains the non-default choice, unless there isn't # any available toolchain profile for the currently selected -# architecture. +# architecture, but before toolchains from br2-external trees. source "toolchain/toolchain-external/toolchain-external-custom/Config.in" +# Toolchains from br2-external trees, if any +source "$BR2_BASE_DIR/.br2-external.in.toolchains" + endchoice choice
Signature · 1 line
2.20.1
PATCH v2 10/13 core: allow br2-external trees to provide pre-configured toolchains
Quoted 29 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Yann" == Yann E MORIN <[email protected]> writes:
Since we have a choice for the pre-configured pre-built toolchains, there is no p[ossbility for a br2-external to provide its own. The only solution so far for defconfigs in br2-external trees is to use
BR2_TOOLCHAIN_EXTERNAL_CUSTOMand define all the bits by itself...This is not so convemient, so offer a way for br2-external trees to provide such pre-configured toolchains.
To allow for this, we now scan each br2-external tree and look for a specific file, provides.toolchains.in. We generate a kconfig file that sources each such file, and that generated file is sourced from within the toolchain choice, thus making the toolchains from a br2-external tree possible and available in the same location as the ones known to Buildroot:
Toolchain ---> Toolchain type (External toolchain) ---> Toolchain ---> (X) Arm ARM 2019.03 ( ) Linaro ARM 2018.05 ( ) Custom toolchain *** Toolchains from my-br2-ext-tree: *** ( ) My custom ARM toolchain *** Toolchains from another-br2-ext-tree: *** ( ) Another custom ARM toolchain ( ) A third custom ARM toolchain
Quoted 2 lines
Signed-off-by "Yann E. MORIN" <[email protected]>Cc Vadim Kochan <[email protected]>
Committed, thanks.
Signature · 1 line
Bye, Peter Korsgaard
PATCH v2 11/13 core: allow br2-external trees to provide libjpeg
In reply to Yann E. MORINSimilar to toolchains, we now offer a way for br2-external trees to provide their libjpeg implementation, which gets included in the jpeg choice.
--- package/jpeg/Config.in | 3 +++ support/scripts/br2-external | 9 +++++++++ 2 files changed, 12 insertions(+)
package/jpeg/Config.in +3 -0
@@ -38,6 +38,9 @@ config BR2_PACKAGE_JPEG_TURBO http://www.libjpeg-turbo.org +# libjpeg from br2-external trees, if any +source "$BR2_BASE_DIR/.br2-external.in.jpeg" + endchoice config BR2_PACKAGE_HAS_JPEG
support/scripts/br2-external +9 -0
@@ -158,6 +158,7 @@ do_kconfig() { paths menus toolchains + jpeg ) for br2 in "${items[@]}"; do
@@ -205,6 +206,14 @@ do_kconfig() { else printf '# No toolchain from: %s\n\n' "${br2_desc}" fi >>"${outputdir}/.br2-external.in.toolchains" + + if [ -f "${br2_ext}/provides/jpeg.in" ]; then + printf 'comment "jpeg from: %s"\n' "${br2_desc}" + printf 'source "%s/provides/jpeg.in"\n' "${br2_ext}" + printf '\n' + else + printf '# No jpeg from: %s\n\n' "${br2_desc}" + fi >>"${outputdir}/.br2-external.in.jpeg" done printf 'endmenu\n' >>"${outputdir}/.br2-external.in.menus"
Signature · 1 line
2.20.1
PATCH v2 11/13 core: allow br2-external trees to provide libjpeg
Quoted 8 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Yann" == Yann E MORIN <[email protected]> writes:
Similar to toolchains, we now offer a way for br2-external trees to provide their libjpeg implementation, which gets included in the jpeg choice.
Signed-off-by "Yann E. MORIN" <[email protected]>Cc Vadim Kochan <[email protected]>
Committed, thanks.
Signature · 1 line
Bye, Peter Korsgaard
PATCH v2 12/13 core: allow br2-external trees to provide opensl
In reply to Yann E. MORINSimilar to toolchains and jpeg, we now offer a way for br2-external trees to provide their openssl implementation, which gets included in the openssl choice.
--- package/openssl/Config.in | 3 +++ support/scripts/br2-external | 9 +++++++++ 2 files changed, 12 insertions(+)
package/openssl/Config.in +3 -0
@@ -68,6 +68,9 @@ config BR2_PACKAGE_LIBRESSL_BIN endif +# openssl from br2-external trees, if any +source "$BR2_BASE_DIR/.br2-external.in.openssl" + endchoice config BR2_PACKAGE_HAS_OPENSSL
support/scripts/br2-external +9 -0
@@ -159,6 +159,7 @@ do_kconfig() { menus toolchains jpeg + openssl ) for br2 in "${items[@]}"; do
@@ -214,6 +215,14 @@ do_kconfig() { else printf '# No jpeg from: %s\n\n' "${br2_desc}" fi >>"${outputdir}/.br2-external.in.jpeg" + + if [ -f "${br2_ext}/provides/openssl.in" ]; then + printf 'comment "openssl from: %s"\n' "${br2_desc}" + printf 'source "%s/provides/openssl.in"\n' "${br2_ext}" + printf '\n' + else + printf '# No openssl from: %s\n\n' "${br2_desc}" + fi >>"${outputdir}/.br2-external.in.openssl" done printf 'endmenu\n' >>"${outputdir}/.br2-external.in.menus"
Signature · 1 line
2.20.1
PATCH v2 12/13 core: allow br2-external trees to provide opensl
Quoted 8 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Yann" == Yann E MORIN <[email protected]> writes:
Similar to toolchains and jpeg, we now offer a way for br2-external trees to provide their openssl implementation, which gets included in the openssl choice.
Signed-off-by "Yann E. MORIN" <[email protected]>Cc Vadim Kochan <[email protected]>
Committed, thanks.
Signature · 1 line
Bye, Peter Korsgaard
PATCH v2 13/13 docs/manual: document providers from br2-external
In reply to Yann E. MORINAdd documentation about how a br2-external tree can provide an external toolchain or a libjpeg alternative implementation.
---
Changes v1 -> v2:
- expand manual even more
---
Note: the documentation about external toolchains is inexistent so far, but this is unrelated to this change, which is only about documenting how to provide one from a br2-external.
--- docs/manual/customize-outside-br.txt | 89 +++++++++++++++++++++++++++- 1 file changed, 88 insertions(+), 1 deletion(-)
docs/manual/customize-outside-br.txt +88 -1
@@ -81,7 +81,8 @@ in the following chapters: Apart from those mandatory files, there may be additional and optional content that may be present in a br2-external tree, like the +configs/+ -directory. They are described in the following chapters as well. +or +provides/+ directories. They are described in the following chapters +as well. A complete example br2-external tree layout is also described later.
@@ -186,6 +187,22 @@ the one from the last br2-external tree is used. It is thus possible to override a defconfig bundled in Buildroot or another br2-external tree. +===== The +provides/+ directory + +For some packages, Buildroot provides a choice between two (or more) +implementations of API-compatible such packages. For example, there is +a choice to choose either libjpeg ot jpeg-turbo, and another choice +between openssl or libressl. Finally, there is a choice to select one +of the known, pre-configured toolchains. + +It is possible for a br2-external to extend those choices, by providing +a set of files that define those alternatives: + +* +provides/toolchains.in+ defines the pre-configured toolchains, which + will then be listed in the toolchain selection; +* +provides/jpeg.in+ defines the alternative libjpeg implementations; +* +provides/openssl.in+ defines the alternative openssl implementations. + ===== Free-form content One can store all the board-specific configuration files there, such
@@ -217,8 +234,10 @@ illustration, of course): | `---- | |- Config.in + | |source "$BR2_EXTERNAL_BAR_42_PATH/toolchain/toolchain-external-mine/Config.in.options" | |source "$BR2_EXTERNAL_BAR_42_PATH/package/pkg-1/Config.in" | |source "$BR2_EXTERNAL_BAR_42_PATH/package/pkg-2/Config.in" + | |source "$BR2_EXTERNAL_BAR_42_PATH/package/my-jpeg/Config.in" | | | |config BAR_42_FLASH_ADDR | | hex "my-board flash address"
@@ -259,6 +278,42 @@ illustration, of course): |- package/pkg-2/pkg-2.hash |- package/pkg-2/pkg-2.mk | + |- provides/jpeg.in + | |config BR2_PACKAGE_MY_JPEG + | | bool "my-jpeg" + | `---- + |- package/my-jpeg/Config.in + | |config BR2_PACKAGE_PROVIDES_JPEG + | | default "my-jpeg" if BR2_PACKAGE_MY_JPEG + | `---- + |- package/my-jpeg/my-jpeg.mk + | |# This is a normal package .mk file + | |MY_JPEG_VERSION = 1.2.3 + | |MY_JPEG_SITE = https://example.net/some/place + | |MY_JPEG_PROVIDES = jpeg + | |$(eval $(autotools-package)) + | `---- + | + |- provides/toolchains.in + | |config BR2_TOOLCHAIN_EXTERNAL_MINE + | | bool "my custom toolchain" + | | depends on BR2_some_arch + | | select BR2_INSTALL_LIBSTDCPP + | `---- + |- toolchain/toolchain-external-mine/Config.in.options + | |if BR2_TOOLCHAIN_EXTERNAL_MINE + | |config BR2_TOOLCHAIN_EXTERNAL_PREFIX + | | default "arch-mine-linux-gnu" + | |config BR2_PACKAGE_PROVIDES_TOOLCHAIN_EXTERNAL + | | default "toolchain-external-mine" + | |endif + | `---- + |- toolchain/toolchain-external-mine/toolchain-external-mine.mk + | |TOOLCHAIN_EXTERNAL_MINE_SITE = https://example.net/some/place + | |TOOLCHAIN_EXTERNAL_MINE_SOURCE = my-toolchain.tar.gz + | |$(eval $(toolchain-external-package)) + | `---- + | |- configs/my-board_defconfig | |BR2_GLOBAL_PATCH_DIR="$(BR2_EXTERNAL_BAR_42_PATH)/patches/" | |BR2_ROOTFS_OVERLAY="$(BR2_EXTERNAL_BAR_42_PATH)/board/my-board/overlay/"
@@ -311,3 +366,35 @@ External options ---> [ ] foo [ ] bar ---- + +Additionally, the jpeg provider will be visible in the jpeg choice: + +---- +Target packages ---> + Libraries ---> + Graphics ---> + [*] jpeg support + jpeg variant () ---> + ( ) jpeg + ( ) jpeg-turbo + *** jpeg from: Example br2-external tree *** + (X) my-jpeg + *** jpeg from: FOO_27 *** + ( ) another-jpeg +---- + +And similarly for the toolchains: + +---- +Toolchain ---> + Toolchain () ---> + ( ) Custom toolchain + *** Toolchains from: Example br2-external tree *** + (X) my custom toolchain +---- + +.Note +The toolchain options in +toolchain/toolchain-external-mine/Config.in.options+ +will not appear in the `Toolchain` menu. They must be explicitly included +from within the br2-external's top-level +Config.in+ and will thus appear +in the `External options` menu.
Signature · 1 line
2.20.1
PATCH v2 13/13 docs/manual: document providers from br2-external
Quoted 8 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Yann" == Yann E MORIN <[email protected]> writes:
Add documentation about how a br2-external tree can provide an external toolchain or a libjpeg alternative implementation.
Signed-off-by "Yann E. MORIN" <[email protected]>Cc Vadim Kochan <[email protected]>
Quoted 8 lines
---
Changes v1 -> v2:
- expand manual even more---
Note: the documentation about external toolchains is inexistent so far, but this is unrelated to this change, which is only about documenting how to provide one from a br2-external.
Committed, thanks.
Signature · 1 line
Bye, Peter Korsgaard