summaryrefslogtreecommitdiff
path: root/support
diff options
context:
space:
mode:
authorYann E. MORIN <yann.morin.1998@free.fr>2016-10-14 16:39:14 +0200
committerPeter Korsgaard <peter@korsgaard.com>2016-10-16 13:01:02 +0200
commit64e12a370c6d48f7a508a0add68f205943628142 (patch)
treebc894ba85ca0d9b0aadec216c70966e40f3944dc /support
parent0f4435e950240d1beff6cffae2b23ab4089b0d41 (diff)
core: get rid of our dummy br2-external tree
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>
Diffstat (limited to 'support')
-rw-r--r--support/dummy-external/Config.in0
-rw-r--r--support/dummy-external/external.mk0
-rwxr-xr-xsupport/scripts/br2-external18
3 files changed, 15 insertions, 3 deletions
diff --git a/support/dummy-external/Config.in b/support/dummy-external/Config.in
deleted file mode 100644
index e69de29bb..000000000
--- a/support/dummy-external/Config.in
+++ /dev/null
diff --git a/support/dummy-external/external.mk b/support/dummy-external/external.mk
deleted file mode 100644
index e69de29bb..000000000
--- a/support/dummy-external/external.mk
+++ /dev/null
diff --git a/support/scripts/br2-external b/support/scripts/br2-external
index 6c2b85b5c..1c42ffafc 100755
--- a/support/scripts/br2-external
+++ b/support/scripts/br2-external
@@ -19,9 +19,11 @@ main() {
# Forget options; keep only positional args
shift $((OPTIND-1))
- if [ ${#} -ne 1 ]; then
- error "need exactly one br2-external tree to be specified\n"
+ # Accept 0 or 1 br2-external tree.
+ if [ ${#} -gt 1 ]; then
+ error "only zero or one br2-external tree allowed.\n"
fi
+
br2_ext="${1}"
if [ -z "${ofile}" ]; then
@@ -38,6 +40,11 @@ main() {
do_validate() {
local br2_ext="${1}"
+ # No br2-external tree is valid
+ if [ -z "${br2_ext}" ]; then
+ return
+ fi
+
if [ ! -d "${br2_ext}" ]; then
error "'%s': no such file or directory\n" "${br2_ext}"
fi
@@ -52,12 +59,17 @@ do_validate() {
do_kconfig() {
printf '#\n# Automatically generated file; DO NOT EDIT.\n#\n'
printf '\n'
+
+ if [ -z "${BR2_EXT}" ]; then
+ printf '# No br2-external tree defined.\n'
+ return
+ fi
+
printf 'config BR2_EXTERNAL\n'
printf '\tstring\n'
printf '\tdefault "%s"\n' "${BR2_EXT}"
printf '\n'
printf 'menu "User-provided options"\n'
- printf '\tdepends on BR2_EXTERNAL != "support/dummy-external"\n'
printf '\n'
printf 'source "%s/Config.in"\n' "${BR2_EXT}"
printf '\n'