[Buildroot] [PATCH 26/29 v2] package/sdcc: add option for the z80 port

Yann E. MORIN yann.morin.1998 at free.fr
Wed Apr 9 20:03:41 UTC 2025


The z80 is a common microprocessor familly, and although it is currently
unused in Buildroot, it makes sense to enable to demonstrate how to
enable ports other than the mcs51.

Note that we decided to add a single option that enables all the
variants of z80, rather than one for each variant: this only installs a
single additional program that handles all z80 variants anyway. When the
device libs are enabled, one set of libs is installed for each variant,
though they are small enough that it does not warrant adding an option
for each variant.

Signed-off-by: Yann E. MORIN <yann.morin.1998 at free.fr>
---
 package/sdcc/Config.in.host | 8 ++++++++
 package/sdcc/sdcc.mk        | 8 ++++----
 2 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/package/sdcc/Config.in.host b/package/sdcc/Config.in.host
index 1c851951b8..711da37444 100644
--- a/package/sdcc/Config.in.host
+++ b/package/sdcc/Config.in.host
@@ -28,4 +28,12 @@ config BR2_PACKAGE_HOST_SDCC_MCS51
 	  Add support for Intel MCS-51 based Microprocessors (8031,
 	  8032, 8051, 8052, etc.),
 
+config BR2_PACKAGE_HOST_SDCC_Z80
+	bool "z80 (et al.)"
+	select BR2_PACKAGE_HOST_SDCC_HAS_PORT
+	help
+	  Add support for Zilog Z80 based MCUs (Z80, Z180, eZ80 in Z80
+	  mode, SM83, Rabbit 2000/3000, Rabbit 3000A , Toshiba TLCS-90,
+	  Zilog eZ80 in Z80 mode, ASCII R800),
+
 endif
diff --git a/package/sdcc/sdcc.mk b/package/sdcc/sdcc.mk
index 60ed688ce4..8e5032427f 100644
--- a/package/sdcc/sdcc.mk
+++ b/package/sdcc/sdcc.mk
@@ -48,7 +48,7 @@ HOST_SDCC_CONF_OPTS += \
 HOST_SDCC_CONF_OPTS += \
 	--disable-ds390-port \
 	--disable-ds400-port \
-	--disable-ez80_z80-port \
+	$(if $(BR2_PACKAGE_HOST_SDCC_Z80),--enable,--disable)-ez80_z80-port \
 	--disable-f8-port \
 	--disable-hc08-port \
 	$(if $(BR2_PACKAGE_HOST_SDCC_MCS51),--enable,--disable)-mcs51-port \
@@ -68,8 +68,8 @@ HOST_SDCC_CONF_OPTS += \
 	--disable-sm83-port \
 	--disable-stm8-port \
 	--disable-tlcs90-port \
-	--disable-z180-port \
-	--disable-z80-port \
-	--disable-z80n-port
+	$(if $(BR2_PACKAGE_HOST_SDCC_Z80),--enable,--disable)-z180-port \
+	$(if $(BR2_PACKAGE_HOST_SDCC_Z80),--enable,--disable)-z80-port \
+	$(if $(BR2_PACKAGE_HOST_SDCC_Z80),--enable,--disable)-z80n-port
 
 $(eval $(host-autotools-package))
-- 
2.47.0



More information about the buildroot mailing list