[PATCH 1/2] Allow Python packages to be dropped
Simon Glass
sjg at chromium.org
Thu Aug 31 19:20:52 CEST 2023
When building in a portage chroot, we do not have the environment needed
to build pylibfdt. It is instead build as a separate package.
Provide a build option to tell U-Boot to skip this part of the build. We
still need it to use binman, etc. but don't need it to build its
dependencies.
Signed-off-by: Simon Glass <sjg at chromium.org>
Reviewed-by: Mike Frysinger <vapier at chromium.org>
---
Makefile | 8 ++++++++
doc/build/tools.rst | 9 +++++++++
scripts/dtc/Makefile | 2 ++
3 files changed, 19 insertions(+)
diff --git a/Makefile b/Makefile
index 9b90204bfe6..25be94ef20f 100644
--- a/Makefile
+++ b/Makefile
@@ -646,12 +646,20 @@ export CFLAGS_NON_EFI # Compiler flags to remove when building EFI app
export EFI_TARGET # binutils target if EFI is natively supported
export LTO_ENABLE
+export PYTHON_ENABLE
# This is y if LTO is enabled for this build. See NO_LTO=1 to disable LTO
ifeq ($(NO_LTO),)
LTO_ENABLE=$(if $(CONFIG_LTO),y)
endif
+# This is y if U-Boot should not build any Python tools or libraries. Typically
+# you would need to set this if those tools/libraries (typically binman and
+# pylibfdt) cannot be built by your environment and are provided separately.
+ifeq ($(NO_PYTHON),)
+PYTHON_ENABLE=y
+endif
+
# If board code explicitly specified LDSCRIPT or CONFIG_SYS_LDSCRIPT, use
# that (or fail if absent). Otherwise, search for a linker script in a
# standard location.
diff --git a/doc/build/tools.rst b/doc/build/tools.rst
index ec017229258..418f0abb236 100644
--- a/doc/build/tools.rst
+++ b/doc/build/tools.rst
@@ -45,3 +45,12 @@ Launch the MSYS2 shell of the MSYS2 environment, and do the following::
$ make tools-only_defconfig
$ make tools-only
+
+
+Building without Python
+-----------------------
+
+The tools-only build bytes pylibfdt by default. To disable this, use the
+NO_PYTHON variable::
+
+ NO_PYTHON=1 make tools-only_defconfig tools-only
diff --git a/scripts/dtc/Makefile b/scripts/dtc/Makefile
index 58d879dd11f..faa72d95e28 100644
--- a/scripts/dtc/Makefile
+++ b/scripts/dtc/Makefile
@@ -19,4 +19,6 @@ HOSTCFLAGS_dtc-parser.tab.o := -I$(src)
$(obj)/dtc-lexer.lex.o: $(obj)/dtc-parser.tab.h
# Added for U-Boot
+ifeq ($(PYTHON_ENABLE),y)
subdir-$(CONFIG_PYLIBFDT) += pylibfdt
+endif
--
2.42.0.rc2.253.gd59a3bf2b4-goog
More information about the U-Boot
mailing list