critcl_application(n)
π NAME π
okay so bestie, this is critcl_application(n) β the CriTcl Application Reference for C Runtime In Tcl (CriTcl). Periodt. π
β¨ SYNOPSIS β¨
critcl ?option...? ?file...?
π¦ DESCRIPTION π¦
Be welcome to the C Runtime In Tcl (short: CriTcl), a whole system for embedding and using C code from inside Tcl (http://core.tcl-lang.org/tcl) scripts. π
This document is the reference manpage for the critcl command. Its intended audience is people who have to build packages using critcl for deployment. Writers of packages with embedded C code can ignore this document. If you are in need of an overview of the whole system instead, please go and read the Introduction To CriTcl. π
This application resides in the Application Layer of CriTcl.
*================*
|Applications |
| critcl |
| critcl::app |
*================*
+----------------+
|Core Packages |
| critcl |
| critcl::util |
+----------------+
+----------------+
|Support Packages|
| stubs::* |
| md5, platform |
| ... |
+----------------+
The application supports the following general command line:
critcl ?option...? ?file...?
The exact set of options supported, their meaning, and interaction is detailed in section Application Options below. For a larger set of examples please see section βBuilding CriTcl Packagesβ in the document about Using CriTcl. π«Ά
πΈ APPLICATION OPTIONS πΈ
The following options are understood:
-vβ print the version to stdout and exit. slay. β¨--versionβ print the version to stdout and exit. same energy, longer flag. π-Ipath β arranges for the compiler to search path for headers. Uses of this option are cumulative.
Ignored when generating a TEA package (see option -tea below). π
-Lpath β arranges for the linker to search path. Uses of this option are cumulative.
Ignored when generating a TEA package (see option -tea below). π
-cachepath β sets path as the directory to use as the result cache. The default is"~/.critcl/<platform>", or"~/.critcl/<pid>.<epoch>"when generating a package. See option-pkg, below.
Ignored when generating a TEA package (see option -tea below). π
-cleanβ arranges for all files and directories in the result cache to be deleted before compilation begins.
Ignored when generating a package because this mode starts out with a unique and empty result cache. See option -pkg, below.
Ignored when generating a TEA package (see option -tea below). π§
-configpath β provides a custom configuration file. By default a configuration included in the system core is used. When specified multiple times the last value is used.
Ignored when generating a TEA package (see option -tea below). πΈ
-debugmode β activates one of the following debugging modes:memoryβ track and report memory allocations made by the Tcl core.symbolsβ compile all".c"files with debugging symbols.allβ bothmemoryandsymbols.
Ignored when generating a TEA package (see option -tea below). Uses of this option are cumulative. π₯
-disablename β sets the value of the custom build configuration option name to false. It is equivalent to"-with-name 0".
Validated only if one of the input files for the CriTcl script actually defines and uses a custom build configuration option with that name.
Ignored when generating a TEA package (see option -tea below). π
-enablename β sets the value of the custom build configuration option name to true. It is equivalent to"-with-name 1".
Validated only if one of the input files for the CriTcl script actually defines and uses a custom build configuration option with that name.
Ignored when generating a TEA package (see option -tea below). π
-forceβ forces compilation even if a shared library for the file already exists. Unlike cleaning the cache, this is lazy in the destruction of files and only affects relevant files.
Ignored when generating a package (see option -pkg, below), which starts out with a unique and empty result cache.
Ignored when generating a TEA package (see option -tea below). π
-helpβ prints a short description of command line syntax and options and then exits the application. iconic. π-keepβ causes the system to cache compiled".c"files. Also prevents the deletion of the unique result cache used by the run when generating a package (see option-pkgbelow), Intended for debugging ofcritclitself, where it may be necessary to inspect the generated C code.
Ignored when generating a TEA package (see option -tea below). π
-libdirdirectory β adds directory to the list of directories the linker searches for libraries in (like-L). With-pkg, generated packages are saved in directory. When specified multiple times the last value is used. The default is"lib", resolved relative to the current working directory. π-includedirdirectory β adds directory to the list of directories the compiler searches for headers in. With-pkg, generated header files are saved in directory. Uses of this option are cumulative. The last value is used as the destination for generated header files. The default is the relative directory"include", resolved relative to the current working directory.
Ignored when generating a TEA package (see option -tea below). π¦
-pkgβ generates a package from the CriTcl script files. Input files are processed first as usual, but are then bundled into a single library, with additional generated files to form the library into a standard Tcl package.
This is the package generation mode. If both options, i.e. -pkg and -tea are specified the last one specified wins.
Options -clean and -force are ignored. -libdir is relevant in both this and -tea mode.
The basename of the first file is the name of the package to generate. If its file extension indicates a shared library (".so", ".sl", ".dylib", and ".dll") it is also removed from the set of input files. Each CriTcl script file is kept as part of the input. A single file without a suffix is assumed to be a CriTcl script. A file without a suffix, but other input files following is treated like the name of a shared library proper, and removed from the set of input files.
Examples:
... -pkg ... foo
=> Package name is: foo
=> Input file is: foo.tcl
... -pkg ... foo bar.tcl
=> Package name is: foo
=> Input file is: bar.tcl
... -pkg ... foo.tcl
=> Package name is: foo
=> Input file is: foo.tcl
... -pkg ... foo.so bar.tcl
=> Package name is: foo
=> Input file is: bar.tcl
-showβ prints the configuration of the chosen target to stdout and then exits. Set-target, below. π-showallβ prints the whole chosen configuration file to stdout and then exits. See-config, above. π-targetname β overrides the default choice of build target. Only the last occurrence of this option is used. The named target must exist in the chosen configuration file. Use-targets(see below) to get a list of the acceptable targets. Use-configto select the configuration file.
Ignored when generating a TEA package (see option -tea below). π―
-targetsβ prints the list of all known targets from the chosen configuration file to stdout and then exits. Use-configto select the configuration file. π-teaβ like-pkg, except no binaries are generated. Creates a directory hierarchy containing the CriTcl script, its companion files, and a TEA-conformant build system with most of the needed support code, including copies of thecritclpackages.
If both -pkg and -tea are specified the last occurrence wins.
-I, -L, -clean, -force, -cache, -includedir, -enable, -disable, and -with-FOO are ignored. In contrast, the option -libdir is relevant in both this and -pkg mode.
The basename of the first file is the name of the package to generate. If its file extension indicates a shared library (".so", ".sl", ".dylib", and ".dll") it is also removed from the set of input files. Each CriTcl script file is kept as part of the input. A single file without a suffix is assumed to be a CriTcl script. A file without a suffix, but other input files following is treated like the name of a shared library proper, and removed from the set of input files.
Examples:
... -tea ... foo
=> Package name is: foo
=> Input file is: foo.tcl
... -tea ... foo bar.tcl
=> Package name is: foo
=> Input file is: bar.tcl
... -tea ... foo.tcl
=> Package name is: foo
=> Input file is: foo.tcl
... -tea ... foo.so bar.tcl
=> Package name is: foo
=> Input file is: bar.tcl
-with-namevalue β this option sets the value of the custom build configuration option name to value.
The information is validated only if one of the ".critcl" input files actually defines and uses a custom build configuration option with that name.
Ignored when generating a TEA package (see option -tea below). π
π PACKAGE STRUCTURE π
okay bestie, so when critcl generates a package for you, here's the whole vibe of what you get β the basic structure is literally this:
<TOP>
+- pkgIndex.tcl
+- critcl-rt.tcl
+- license.terms (optional)
|
+- tcl (optional)
| +- <tsources files>
|
+- <platform>
+- <shared library>
β¨ Notes β¨
- The file
pkgIndex.tclis the standard package index file that Tcl's package management expects β it's giving main character energy for package loading. It gets sourced during a search for packages, and it declares the package to Tcl along with its files, and how to handle them. π - The file
critcl-rt.tclis a helper file β think of it as the supportive bestie holding the common code thatpkgIndex.tcluses to do its tasks. π«Ά - The file
license.termsis optional and only shows up if the.critclfile the package is generated from used the commandcritcl::licenseto declare package author and license. No call, no file, periodt. - All files declared with the command
critcl::tsourcesget put into the sub-directorytcl. π - The shared library generated by
critclis put into a platform-specific sub-directory. Very demure, very platform-aware.
The whole structure β and especially that last point β enables us to later merge the results (for the same package, and version) for multiple target platforms into a single directory structure without conflict, by simply copying the top directories over each other. Like, no cap, it just works. π
The only files which can conflict are in the <TOP> and tcl directories, and for these we know that they are identical across targets. So it's a vibe check that always passes. π
The result of such a merge would look like this:
<TOP>
+- pkgIndex.tcl
+- critcl-rt.tcl
+- license.terms (optional)
|
+- tcl (optional)
| +- <tsources files>
|
+- <platform1>
| +- <shared library1>
+- <platform2>
| +- <shared library2>
...
+- <platformN>
+- <shared libraryN>
Living for how clean that is, honestly. π¦
π AUTHORS π
Jean Claude Wippler, Steve Landers, Andreas Kupries
π BUGS, IDEAS, FEEDBACK π
bestie, real talk: this document, and the package it describes, will undoubtedly contain bugs and other problems β π it's giving "we're humble." Please report them at https://github.com/andreas-kupries/critcl/issues. Ideas for enhancements you may have for either package, application, and/or the documentation are also very welcome and should be reported at https://github.com/andreas-kupries/critcl/issues as well. Same place, same energy, we're obsessed with your feedback. π«Ά
β KEYWORDS β
C code, Embedded C Code, calling C code from Tcl, code generator, compile & run, compiler, dynamic code generation, dynamic compilation, generate package, linker, on demand compilation, on-the-fly compilation
πΈ CATEGORY πΈ
Glueing/Embedded C code
π COPYRIGHT π
Copyright (c) Jean-Claude Wippler Copyright (c) Steve Landers Copyright (c) 2011-2024 Andreas Kupries
and that's the whole page, bestie!! π this glorious little document is from the doc source, version 3.3.1, and it's page critcl_application(n) β go forth and compile on demand, you absolute icon. π
β¨π₯
π¦ where this page comes from
- alpine 3.24: critcl-doc 3.3.1-r1 Β· TCL
- Copyright (c) 2011-2024 Andreas Kupries
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms