Skip to content

Include build configuration info in the greeting#55

Open
mkobetic wants to merge 2 commits intomainfrom
build-info
Open

Include build configuration info in the greeting#55
mkobetic wants to merge 2 commits intomainfrom
build-info

Conversation

@mkobetic
Copy link
Owner

@mkobetic mkobetic commented Feb 25, 2026

We've previously introduced BUILD_CONFIG symbol that has bits dedicated to various configuration options used during the build, the bits are defined and assembled in core/build-config.inc. This PR adds this information to AmForth and outputs it in the greeting. This is how it looks now:

qemu % make stdio
qemu-system-arm -M virt -cpu cortex-a15 -m 1M -kernel build/amforth.elf -display none -serial stdio
amforth 7.0 CORTEX-A15 QEMU-VIRT
build: 2026-02-25T18:16:53-05:00 build-info@1ec0120* cfg:$00000000 
>

If you set WANT_IGNORECASE, the config value will be cfg:$00000001

I was hoping to emit an interpreted version of this, that would list the selected bits based on this value, at the end of the build process, but there doesn't seem to be any reasonable way to assemble this string during assembly. I gave up.

This PR also includes some cleanup

  • The build-info.tmpl was duplicated in MCU word directories unnecessarily, now there is a single copy of it in core/build-info.tmpl which defines all the build related words
  • The word build-info was renamed to build.time to reflect what it is
  • The word rev-info was renamed to build.rev to bring the words closer together
  • New word build.config now provides the BUILD_CONFIG value
  • New word .build emits the combined build information in a unified way, instead of assembling the bits in individual applturnkey words (all those are now using XT_ENV_DOT_BUILD)
  • The DOT_VER word was renamed from ver to .ver for consistency
  • all the build words were moved to the ENVIRONMENT wordlist to match the other info bits
  • CH32 copies of env-forthname.s, env-forthversion.s, and env-usersize.s were removed, they are defined in core/words
  • comments and END macro invocations were added as needed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant