[Buildroot] [PATCH 25/29 v2] package/sdcc: add option for the mcs51 (aka 8051) port
Yann E. MORIN
yann.morin.1998 at free.fr
Wed Apr 9 20:03:40 UTC 2025
Enabling a port enables the assembler for that port; the other utilities
(sdcpp, sdbinutils) are always built.
We make it so that at least one port is enabled, otherwise it does not
make much sense to enable sdcc [0]. Also, without any port enabled,
some parts of sdcc (e.g. sdld) get compiled at install time, which is
incorrect (but by luck just happens to use the proper tools and compile
flags).
The mcs51 port is the first one that will be needed (for fx2lafw in a
following commit). So we make that the default port to use if no other
is enabled (another port will be added soon, too, so we get ready for
that right now).
[0] there is one utility, packihx, that could be used without any port
enabled, but that was not deemed an interesting-enough use-case to
support.
Signed-off-by: Yann E. MORIN <yann.morin.1998 at free.fr>
---
package/sdcc/Config.in.host | 16 ++++++++++++++++
package/sdcc/sdcc.mk | 2 +-
2 files changed, 17 insertions(+), 1 deletion(-)
diff --git a/package/sdcc/Config.in.host b/package/sdcc/Config.in.host
index 52934aa150..1c851951b8 100644
--- a/package/sdcc/Config.in.host
+++ b/package/sdcc/Config.in.host
@@ -2,6 +2,7 @@ config BR2_PACKAGE_HOST_SDCC
bool "host sdcc"
select BR2_PACKAGE_HOST_BOOST
select BR2_PACKAGE_HOST_BOOST_GRAPH
+ select BR2_PACKAGE_HOST_SDCC_MCS51 if !BR2_PACKAGE_HOST_SDCC_HAS_PORT
help
SDCC is a retargettable, optimizing Standard C (ANSI C89, ISO
C99, ISO C11, ISO C23) compiler suite that targets the Intel
@@ -13,3 +14,18 @@ config BR2_PACKAGE_HOST_SDCC
65C02.
https://sdcc.sourceforge.net/
+
+if BR2_PACKAGE_HOST_SDCC
+
+comment "Ports"
+
+config BR2_PACKAGE_HOST_SDCC_HAS_PORT
+ bool
+
+config BR2_PACKAGE_HOST_SDCC_MCS51
+ bool "mcs51 (8051 et al.)"
+ help
+ Add support for Intel MCS-51 based Microprocessors (8031,
+ 8032, 8051, 8052, etc.),
+
+endif
diff --git a/package/sdcc/sdcc.mk b/package/sdcc/sdcc.mk
index b2082c36bc..60ed688ce4 100644
--- a/package/sdcc/sdcc.mk
+++ b/package/sdcc/sdcc.mk
@@ -51,7 +51,7 @@ HOST_SDCC_CONF_OPTS += \
--disable-ez80_z80-port \
--disable-f8-port \
--disable-hc08-port \
- --disable-mcs51-port \
+ $(if $(BR2_PACKAGE_HOST_SDCC_MCS51),--enable,--disable)-mcs51-port \
--disable-mos6502-port \
--disable-mos65c02-port \
--disable-pdk13-port \
--
2.47.0
More information about the buildroot
mailing list