blob: 3dbad3fed7d8465d4b8fb67f6512208b38a1ccd4 [file] [log] [blame]
Jan Kundrátf04801f2021-01-19 22:01:25 +01001From 25591463ae3bfbb359c42edde15158a714437c65 Mon Sep 17 00:00:00 2001
2From: Heinrich Schuchardt <xypron.glpk@gmx.de>
3Date: Wed, 23 Sep 2020 19:09:51 +0200
4Subject: [PATCH] examples: make examples/ optional
5
6Most users don't need the standalone API examples. Distributions like SUSE
7do not supply libgcc for cross-compiling and we cannot do without on ARMv8
8for building examples/.
9
10Make examples selectable via symbol CONFIG_EXAMPLES. It defaults to
11yes on ARCH_QEMU to ensure that we compile the API as part of our
12continuous integration.
13
14Cc: Matthias Brugger <mbrugger@suse.com>
15Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
16Reviewed-by: Tom Rini <trini@konsulko.com>
17Reviewed-by: Simon Glass <sjg@chromium.org>
18Reviewed-by: Matthias Brugger <mbrugger@suse.com>
19---
20 Kconfig | 8 ++++++++
21 examples/Makefile | 2 +-
22 2 files changed, 9 insertions(+), 1 deletion(-)
23
24diff --git a/Kconfig b/Kconfig
25index 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"
43diff --git a/examples/Makefile b/examples/Makefile
44index 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--
562.29.0
57