build-info(3tcl)
β¨ build-info β the Tcl built-in that spills the tea on how Tcl was compiled β¨
okay so bestie, you ever look at your Tcl and go "hmm. what compiler raised you. what were the build flags. were you debug. are you even threaded." and no one can answer you? yeah. that's what this command is for. welcome to the build-info glow-up π
This is a Tcl built-in command, living in the 3tcl manual section. Let's get into it.
πΈ SYNOPSIS πΈ
::tcl::build-info ?field?
π DESCRIPTION π
So like, this command is your lil backstage pass to how Tcl was actually built. It's giving "behind the scenes documentary" energy.
If you pass no options at all, it hands you back the Tcl patchlevel, then a '+'-sign, then the fossil commit-id, then a list of dot-separated tags. That's the whole vibe string, all in one go. π«Ά
But if you do give it a field, it extracts just that one field, described down below. And here's the iconic part: any other field value that isn't mentioned below will always return "0". no cap. that's the rule.
For official Tcl releases, the fields are:
::tcl::build-info clangβ gives you the clang version number (as 4 digits) if Tcl was compiled with clang, and0if it wasn't. π::tcl::build-info commitβ gives you the fossil commit-id where Tcl was built from. your Tcl's origin story, fr.::tcl::build-info compiledebugβ returns1if Tcl is compiled with-DTCL_COMPILE_DEBUG,0otherwise.::tcl::build-info compilerβ returns the compiler name (eitherclang,gcc,iccormsvc), followed by a dash and a (4-digit) version number. so likegcc-1204, you know the vibe.::tcl::build-info compilestatsβ returns1if Tcl is compiled with-DTCL_COMPILE_STATS,0otherwise.::tcl::build-info cplusplusβ returns1if Tcl is compiled with a C++ compiler,0otherwise.::tcl::build-info debugβ returns1if Tcl is not compiled with-DNDEBUG,0otherwise. yes, it's the reverse, read it twice bestie π::tcl::build-info gccβ gives you the gcc version number (as 4 digits) if Tcl was compiled with gcc,0otherwise.::tcl::build-info iccβ gives you the icc version number (as 4 digits) if Tcl was compiled with icc,0otherwise.::tcl::build-info ilp32β returns1if Tcl is compiled such that integers, longs and pointers are all 32-bit,0otherwise.::tcl::build-info memdebugβ returns1if Tcl is compiled with-DTCL_MEM_DEBUG,0otherwise.::tcl::build-info msvcβ gives you the msvc version number (as 4 digits) if Tcl was compiled with msvc,0otherwise.::tcl::build-info nmakeβ returns1if Tcl is built using nmake,0otherwise.::tcl::build-info no-deprecateβ returns1if Tcl is compiled with-DTCL_NO_DEPRECATED,0otherwise.::tcl::build-info no-threadβ returns1if Tcl is compiled with-DTCL_THREADS=0,0otherwise.::tcl::build-info no-optimizeβ returns1if Tcl is not compiled with-DTCL_CFG_OPTIMIZED,0otherwise.::tcl::build-info objective-cβ returns1if Tcl is compiled with an objective-c compiler,0otherwise.::tcl::build-info objective-cplusplusβ returns1if Tcl is compiled with an objective-c++ compiler,0otherwise.::tcl::build-info patchlevelβ returns the Tcl patchlevel, same asinfo patchlevel. twins fr fr π«Ά::tcl::build-info profileβ returns1if Tcl is compiled with-DTCL_CFG_PROFILED,0otherwise.::tcl::build-info purifyβ returns1if Tcl is compiled with-DPURIFY,0otherwise.::tcl::build-info staticβ returns1if Tcl is compiled as a static library,0otherwise.::tcl::build-info tommathβ gives you the libtommath version number (as 4 digits) if libtommath is built into Tcl,0otherwise.::tcl::build-info versionβ returns the Tcl version, same asinfo tclversion. also twins π::tcl::build-info zlibβ gives you the zlib version number (as 4 digits) if zlib is built into Tcl,0otherwise.
π EXAMPLES π
These show the use of ::tcl::build-info. look at her go, she's iconic:
::tcl::build-info
β 9.0.2+af16c07b81655fabde8028374161ad54b84ef9956843c63f49976b4ef601b611.gcc-1204
::tcl::build-info commit
β af16c07b81655fabde8028374161ad54b84ef9956843c63f49976b4ef601b611
::tcl::build-info compiler
β gcc-1204
::tcl::build-info gcc
β 1204
::tcl::build-info version
β 9.0
::tcl::build-info patchlevel
β 9.0.2
π SEE ALSO π
info(3tcl)β go read that one too bestie, they're besties for a reason
β KEYWORDS β
build-info
and that's the whole page, no cap π this lil icon lives in the Tcl manual, version 9.0, dated as build-info(3tcl) β so if you ever forget where you read all this, that's your receipt π§β¨ bye bestie, go check your compiler flags π
π¦ where this page comes from
- ubuntu questing: tcl9.0-doc 9.0.2+dfsg-1
- ubuntu resolute: tcl9.0-doc 9.0.3+dfsg-1
- ubuntu stonking: tcl9.0-doc 9.0.4+dfsg-1
- Copyright (c) 2025 Jan Nijtmans
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms