Skip to content

Jimtcl configure - #3802

Open
csanchezdll wants to merge 1 commit into
apache:masterfrom
csanchezdll:jimtcl_configure
Open

csanchezdll wants to merge 1 commit into
apache:masterfrom
csanchezdll:jimtcl_configure

Conversation

@csanchezdll

@csanchezdll csanchezdll commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The Jim (TCL) Interpreter uses a configure script to detect operating system features. For the most part, it tries to build test programs using different OS functions, and if linking fails, assumes the function being tested is not available.

Previously, this tests were performed without bringing in NuttX system libraries, so most of them failed and Jim was built with most optional features off. A clear indication of this (and how the problem was detected) was the output from any TCL script not being sent to the console until the interpreter was exited (it was caused by a wrongly detected absence of isatty())

With this PR (which requires also apache/nuttx#20367), Jim is correctly configure, detects NuttX available features, and the output is immediate for TCL-side puts. It also brings in other Jim features like sockets, signals, etc.

Impact

This PR introduces a new variable in Application.mk: EXTLIBS. It can be used to indicate a certain application builds using an external build system and its product is one or more libraries. This is useful as those external build systems might change the built files depending on the result of the configure step, something that was not supported using the previous static list of source files.

It is an optional variable, so this does not impact other existing applications.

Testing

$ tools/configure.sh nucleo-h563zi:nsh
[...]
$ make menuconfig
Enable: Application Configuration -> Interpreters -> The Jim (TCL) Interpreter
Enable: Build Setup -> Customize Header Files -> setjmp.h

Flashing the device and accessing the console shows Jim now gives immediate output:

NuttShell (NSH) NuttX-13.0.1
nsh> jimsh
Welcome to Jim version 0.83
. foreach i {a b c} {
{> puts $i
{> }
a
b
c
. exit
nsh> 

Compare with the example in #3646

Also, comparing the generate jimautoconf.h files inside interpreters/jimtcl/jimtcl shows detection now worked correctly:

$ diff jim-old/jimautoconf.h jim-new/jimautoconf.h  | head
7c7
< /* #undef HAVE_CLOCK_GETTIME */
---
> #define HAVE_CLOCK_GETTIME 1
17c17
< /* #undef HAVE_DUP */
---
> #define HAVE_DUP 1
22,23c22,23
< /* #undef HAVE_FSTAT */

Comment thread Application.mk Outdated
The Jim Interpreter includes a configure script ro adapt to
the features provided by the operating system. It was being called
without providing NuttX system libraries so most advanced
features were disabled. This change passes the libraries (which
need to be already built).

Signed-off-by: Carlos Sánchez de La Lama <csanchezdll@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants