Jan Kundrát | f04801f | 2021-01-19 22:01:25 +0100 | [diff] [blame] | 1 | From 25591463ae3bfbb359c42edde15158a714437c65 Mon Sep 17 00:00:00 2001 |
| 2 | From: Heinrich Schuchardt <xypron.glpk@gmx.de> |
| 3 | Date: Wed, 23 Sep 2020 19:09:51 +0200 |
| 4 | Subject: [PATCH] examples: make examples/ optional |
| 5 | |
| 6 | Most users don't need the standalone API examples. Distributions like SUSE |
| 7 | do not supply libgcc for cross-compiling and we cannot do without on ARMv8 |
| 8 | for building examples/. |
| 9 | |
| 10 | Make examples selectable via symbol CONFIG_EXAMPLES. It defaults to |
| 11 | yes on ARCH_QEMU to ensure that we compile the API as part of our |
| 12 | continuous integration. |
| 13 | |
| 14 | Cc: Matthias Brugger <mbrugger@suse.com> |
| 15 | Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> |
| 16 | Reviewed-by: Tom Rini <trini@konsulko.com> |
| 17 | Reviewed-by: Simon Glass <sjg@chromium.org> |
| 18 | Reviewed-by: Matthias Brugger <mbrugger@suse.com> |
| 19 | --- |
| 20 | Kconfig | 8 ++++++++ |
| 21 | examples/Makefile | 2 +- |
| 22 | 2 files changed, 9 insertions(+), 1 deletion(-) |
| 23 | |
| 24 | diff --git a/Kconfig b/Kconfig |
| 25 | index d96e3373c1..b272def247 100644 |
| 26 | --- a/Kconfig |
| 27 | +++ b/Kconfig |
| 28 | @@ -221,6 +221,14 @@ config BUILD_ROM |
| 29 | which are not shipped in the U-Boot source tree. |
| 30 | Please, see doc/README.x86 for details. |
| 31 | |
| 32 | +config EXAMPLES |
| 33 | + bool "Compile API examples" |
| 34 | + depends on !SANDBOX |
| 35 | + default y if ARCH_QEMU |
| 36 | + help |
| 37 | + U-Boot provides an API for standalone applications. Examples are |
| 38 | + provided in directory examples/. |
| 39 | + |
| 40 | endmenu # General setup |
| 41 | |
| 42 | menu "Boot images" |
| 43 | diff --git a/examples/Makefile b/examples/Makefile |
| 44 | index d440bc5655..bf518bd221 100644 |
| 45 | --- a/examples/Makefile |
| 46 | +++ b/examples/Makefile |
| 47 | @@ -1,6 +1,6 @@ |
| 48 | # SPDX-License-Identifier: GPL-2.0+ |
| 49 | |
| 50 | -ifndef CONFIG_SANDBOX |
| 51 | +ifdef CONFIG_EXAMPLES |
| 52 | |
| 53 | ifdef FTRACE |
| 54 | subdir-ccflags-y += -finstrument-functions -DFTRACE |
| 55 | -- |
| 56 | 2.29.0 |
| 57 | |