'\"
'\" Generated from file '/home/aku/Projects/Packages/Critcl/dev-master/embedded/man/files/critcl_apppkg\&.n' by tcllib/doctools with format 'nroff'
'\" Copyright (c) Jean-Claude Wippler
'\" Copyright (c) Steve Landers
'\" Copyright (c) 2011-2013 Andreas Kupries
'\"
'\" The definitions below are for supplemental macros used in Tcl/Tk
'\" manual entries.
'\"
'\" .AP type name in/out ?indent?
'\"	Start paragraph describing an argument to a library procedure.
'\"	type is type of argument (int, etc.), in/out is either "in", "out",
'\"	or "in/out" to describe whether procedure reads or modifies arg,
'\"	and indent is equivalent to second arg of .IP (shouldn't ever be
'\"	needed;  use .AS below instead)
'\"
'\" .AS ?type? ?name?
'\"	Give maximum sizes of arguments for setting tab stops.  Type and
'\"	name are examples of largest possible arguments that will be passed
'\"	to .AP later.  If args are omitted, default tab stops are used.
'\"
'\" .BS
'\"	Start box enclosure.  From here until next .BE, everything will be
'\"	enclosed in one large box.
'\"
'\" .BE
'\"	End of box enclosure.
'\"
'\" .CS
'\"	Begin code excerpt.
'\"
'\" .CE
'\"	End code excerpt.
'\"
'\" .VS ?version? ?br?
'\"	Begin vertical sidebar, for use in marking newly-changed parts
'\"	of man pages.  The first argument is ignored and used for recording
'\"	the version when the .VS was added, so that the sidebars can be
'\"	found and removed when they reach a certain age.  If another argument
'\"	is present, then a line break is forced before starting the sidebar.
'\"
'\" .VE
'\"	End of vertical sidebar.
'\"
'\" .DS
'\"	Begin an indented unfilled display.
'\"
'\" .DE
'\"	End of indented unfilled display.
'\"
'\" .SO
'\"	Start of list of standard options for a Tk widget.  The
'\"	options follow on successive lines, in four columns separated
'\"	by tabs.
'\"
'\" .SE
'\"	End of list of standard options for a Tk widget.
'\"
'\" .OP cmdName dbName dbClass
'\"	Start of description of a specific option.  cmdName gives the
'\"	option's name as specified in the class command, dbName gives
'\"	the option's name in the option database, and dbClass gives
'\"	the option's class in the option database.
'\"
'\" .UL arg1 arg2
'\"	Print arg1 underlined, then print arg2 normally.
'\"
'\" RCS: @(#) $Id: man.macros,v 1.1 2009/01/30 04:56:47 andreas_kupries Exp $
'\"
'\"	# Set up traps and other miscellaneous stuff for Tcl/Tk man pages.
.if t .wh -1.3i ^B
.nr ^l \n(.l
.ad b
'\"	# Start an argument description
.de AP
.ie !"\\$4"" .TP \\$4
.el \{\
.   ie !"\\$2"" .TP \\n()Cu
.   el          .TP 15
.\}
.ta \\n()Au \\n()Bu
.ie !"\\$3"" \{\
\&\\$1	\\fI\\$2\\fP	(\\$3)
.\".b
.\}
.el \{\
.br
.ie !"\\$2"" \{\
\&\\$1	\\fI\\$2\\fP
.\}
.el \{\
\&\\fI\\$1\\fP
.\}
.\}
..
'\"	# define tabbing values for .AP
.de AS
.nr )A 10n
.if !"\\$1"" .nr )A \\w'\\$1'u+3n
.nr )B \\n()Au+15n
.\"
.if !"\\$2"" .nr )B \\w'\\$2'u+\\n()Au+3n
.nr )C \\n()Bu+\\w'(in/out)'u+2n
..
.AS Tcl_Interp Tcl_CreateInterp in/out
'\"	# BS - start boxed text
'\"	# ^y = starting y location
'\"	# ^b = 1
.de BS
.br
.mk ^y
.nr ^b 1u
.if n .nf
.if n .ti 0
.if n \l'\\n(.lu\(ul'
.if n .fi
..
'\"	# BE - end boxed text (draw box now)
.de BE
.nf
.ti 0
.mk ^t
.ie n \l'\\n(^lu\(ul'
.el \{\
.\"	Draw four-sided box normally, but don't draw top of
.\"	box if the box started on an earlier page.
.ie !\\n(^b-1 \{\
\h'-1.5n'\L'|\\n(^yu-1v'\l'\\n(^lu+3n\(ul'\L'\\n(^tu+1v-\\n(^yu'\l'|0u-1.5n\(ul'
.\}
.el \}\
\h'-1.5n'\L'|\\n(^yu-1v'\h'\\n(^lu+3n'\L'\\n(^tu+1v-\\n(^yu'\l'|0u-1.5n\(ul'
.\}
.\}
.fi
.br
.nr ^b 0
..
'\"	# VS - start vertical sidebar
'\"	# ^Y = starting y location
'\"	# ^v = 1 (for troff;  for nroff this doesn't matter)
.de VS
.if !"\\$2"" .br
.mk ^Y
.ie n 'mc \s12\(br\s0
.el .nr ^v 1u
..
'\"	# VE - end of vertical sidebar
.de VE
.ie n 'mc
.el \{\
.ev 2
.nf
.ti 0
.mk ^t
\h'|\\n(^lu+3n'\L'|\\n(^Yu-1v\(bv'\v'\\n(^tu+1v-\\n(^Yu'\h'-|\\n(^lu+3n'
.sp -1
.fi
.ev
.\}
.nr ^v 0
..
'\"	# Special macro to handle page bottom:  finish off current
'\"	# box/sidebar if in box/sidebar mode, then invoked standard
'\"	# page bottom macro.
.de ^B
.ev 2
'ti 0
'nf
.mk ^t
.if \\n(^b \{\
.\"	Draw three-sided box if this is the box's first page,
.\"	draw two sides but no top otherwise.
.ie !\\n(^b-1 \h'-1.5n'\L'|\\n(^yu-1v'\l'\\n(^lu+3n\(ul'\L'\\n(^tu+1v-\\n(^yu'\h'|0u'\c
.el \h'-1.5n'\L'|\\n(^yu-1v'\h'\\n(^lu+3n'\L'\\n(^tu+1v-\\n(^yu'\h'|0u'\c
.\}
.if \\n(^v \{\
.nr ^x \\n(^tu+1v-\\n(^Yu
\kx\h'-\\nxu'\h'|\\n(^lu+3n'\ky\L'-\\n(^xu'\v'\\n(^xu'\h'|0u'\c
.\}
.bp
'fi
.ev
.if \\n(^b \{\
.mk ^y
.nr ^b 2
.\}
.if \\n(^v \{\
.mk ^Y
.\}
..
'\"	# DS - begin display
.de DS
.RS
.nf
.sp
..
'\"	# DE - end display
.de DE
.fi
.RE
.sp
..
'\"	# SO - start of list of standard options
.de SO
.SH "STANDARD OPTIONS"
.LP
.nf
.ta 4c 8c 12c
.ft B
..
'\"	# SE - end of list of standard options
.de SE
.fi
.ft R
.LP
See the \\fBoptions\\fR manual entry for details on the standard options.
..
'\"	# OP - start of full description for a single option
.de OP
.LP
.nf
.ta 4c
Command-Line Name:	\\fB\\$1\\fR
Database Name:	\\fB\\$2\\fR
Database Class:	\\fB\\$3\\fR
.fi
.IP
..
'\"	# CS - begin code excerpt
.de CS
.RS
.nf
.ta .25i .5i .75i 1i
..
'\"	# CE - end code excerpt
.de CE
.fi
.RE
..
.de UL
\\$1\l'|0\(ul'\\$2
..
.TH "critcl::app" n 3\&.1\&.8 doc "C Runtime In Tcl (CriTcl)"
.BS
.SH NAME
critcl::app \- Critcl - Application Package Reference
.SH SYNOPSIS
package require \fBTcl  8\&.4\fR
.sp
package require \fBcritcl::app  ?3\&.1\&.8?\fR
.sp
package require \fBcritcl  ?2?\fR
.sp
package require \fBplatform  ?1\&.0\&.2?\fR
.sp
package require \fBcmdline \fR
.sp
\fB::critcl::app::main\fR \fIcommandline\fR
.sp
.BE
.SH DESCRIPTION
.PP
Welcome to the \fIC Runtime In Tcl\fR, \fICriTcl\fR for short, a
system to build C extension packages for Tcl on the fly, from C code
embedded within Tcl scripts, for all who wish to make their code go
faster\&.
.PP
This document is the reference manpage for the \fBcritcl::app\fR
package\&. Its intended audience are developers working on critcl's
internals\&.  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 \fIIntroduction To CriTcl\fR\&.
.PP
This package resides in the Application Layer of CriTcl\&.
.PP
.PS
.nf
*================*
|Applications    |
| critcl         |
| critcl::app    |
*================*

+----------------+
|Core Packages   |
| critcl         |
| critcl::util   |
+----------------+

+----------------+
|Support Packages|
| stubs::*       |
| md5, platform  |
|  \&.\&.\&.           |
+----------------+

.fi
.PE
.PP
,
implementing the functionality of the \fICriTcl Application\fR,
and through this, the mode \fBgenerate package\fR\&.
The actual application is (only) a shim wrapping around this
package\&. It itself is build on top of the core package
\fBcritcl\fR\&.
.SH API
The package exports a single command
.TP
\fB::critcl::app::main\fR \fIcommandline\fR
The \fIcommandline\fR is a list of options and input files, in this order,
with both parts possibly empty\&.
The exact set of options supported, their meaning, and interaction is
detailed in section \fBOptions\fR below\&.
For a larger set of examples please see section "Building Critcl Packages"
in the document about \fIUsing CriTcl\fR\&.
.PP
.SH OPTIONS
The following options are understood
.TP
\fB-v\fR
.TP
\fB--version\fR
These options cause critcl to print its version to \fBstdout\fR and
then exit\&.
.TP
\fB-I\fR path
This option specifies an additional global include path to use during
compilation of "\fI\&.critcl\fR" files\&. All values are used if this is
specified multiple times\&.
.sp
This option is irrelevant when generating a TEA package (see
option \fB-tea\fR below)\&.
.TP
\fB-L\fR path
This option specifies an additional global library searh path to use
during linking of "\fI\&.critcl\fR" files\&. All values are used if this is
specified multiple times\&.
.sp
This option is irrelevant when generating a TEA package (see
option \fB-tea\fR below)\&.
.TP
\fB-cache\fR path
This option specifies the path to the directory to use as the result
cache\&. If not specified it defaults to "\fI~/\&.critcl/<platform>\fR",
or, when generating a package (see option \fB-pkg\fR below), to
"\fI~/\&.critcl/<pid>\&.<epoch>\fR",
When specified multiple times the last value is used\&.
.sp
This option is irrelevant when generating a TEA package (see
option \fB-tea\fR below)\&.
.TP
\fB-clean\fR
When specified the result cache is emptied, i\&.e\&. all files and
directories found inside are deleted) before compilation begins\&.
.sp
This option is irrelevant when generating a package (see option
\fB-pkg\fR below) because this mode starts out with a unique and
empty result cache\&.
.sp
This option is irrelevant when generating a TEA package (see
option \fB-tea\fR below)\&.
.TP
\fB-config\fR path
This option specifies the path to a custom configuration file,
allowing the user to use their own target specifications\&. If not
specified a hardwired default configuration embedded in the system
core is used instead\&.
When specified multiple times the last value is used\&.
.sp
This option is irrelevant when generating a TEA package (see
option \fB-tea\fR below)\&.
.TP
\fB-debug\fR mode
This option activates compilation with debugging\&. It accepts the modes
below\&.
When specified multiple times the combination of all modes is used\&.
.sp
This option is irrelevant when generating a TEA package (see
option \fB-tea\fR below)\&.
.RS
.TP
\fBmemory\fR
This mode activates memory debugging of allocations made through the
Tcl core\&.
.TP
\fBsymbols\fR
This mode activates building of all "\fI\&.c\fR" files with debugging
symbols\&.
.TP
\fBall\fR
This mode activates both \fBmemory\fR and \fBsymbols\fR\&.
.RE
.TP
\fB-disable\fR name
This option sets the value of the custom build configuration option
\fIname\fR to \fBfalse\fR\&. It is equivalent to "-with-\fIname\fR 0"\&.
.sp
The information is validated only if one of the "\fI\&.critcl\fR"
input files actually defines and uses a custom build configuration
option with that \fIname\fR\&.
.sp
This option is irrelevant when generating a TEA package (see
option \fB-tea\fR below)\&.
.TP
\fB-enable\fR name
This option sets the value of the custom build configuration option
\fIname\fR to \fBtrue\fR\&. It is equivalent to "-with-\fIname\fR 1"\&.
.sp
The information is validated only if one of the "\fI\&.critcl\fR"
input files actually defines and uses a custom build configuration
option with that \fIname\fR\&.
.sp
This option is irrelevant when generating a TEA package (see
option \fB-tea\fR below)\&.
.TP
\fB-force\fR
When specified compilation is always done, even if a shared library
for the file exists already\&. This effect can be had through cleaning
the cache (see above) as well, except that it is lazy in the
destruction of files and will not destroy files unrelated to the ones
we are building\&.
.sp
This option is irrelevant when generating a package (see option
\fB-pkg\fR below) because this mode starts out with a unique and
empty result cache\&.
.sp
This option is irrelevant when generating a TEA package (see
option \fB-tea\fR below)\&.
.TP
\fB-help\fR
This option will cause the system to print a short help about command
line syntax and options and then exit the application\&.
.TP
\fB-keep\fR
This option will cause the system to keep the "\fI\&.c\fR" files
generated by a run in the result cache\&.
When generating a package (see option \fB-pkg\fR below) this also
prevents the deletion of the unique result cache used by the run\&.
This option is intended for the debugging of \fBcritcl\fR itself,
where it may be necessary to inspect the generated C code\&.
.sp
This option is irrelevant when generating a TEA package (see
option \fB-tea\fR below)\&.
.TP
\fB-libdir\fR path
This option specifies the path under which the packages generated via
option \fB-pkg\fR are saved\&. It also specifies a path to search
libraries in, like for \fB-L\fR\&.
When specified multiple times the last value is used\&.
When not specified at all the default, "\fIlib\fR", is used\&. Note how
this is a relative path, placing the result into the current working
directory\&.
.TP
\fB-includedir\fR path
This option specifies the path under which any generated package
headers are saved\&. It also specifies a path to search include files
in, like for \fB-I\fR\&.
When specified multiple times the last value is used as destination,
however all previous values are kept on the include search path\&.
When not specified at all the default, "\fIinclude\fR", is used\&. Note
how this is a relative path, placing the result into the current
working directory\&.
.sp
This option is irrelevant when generating a TEA package (see
option \fB-tea\fR below)\&.
.TP
\fB-pkg\fR
The default mode of the application is to build the "\fI\&.critcl\fR"
files listed on the command line and save the results in the result
cache\&. Essentially pre-filling the cache with important packages,
cutting down on the time needed to use these packages\&.
.sp
This option activates one of the other modes, package generation\&.
In this mode the input files are processed first as usual, however
after that they are bundled into a single library and additional files
are generated to make this library usable as a regular Tcl package\&.
.sp
The option \fB-tea\fR, see below, invokes the last mode, TEA
generation\&. If both options, i\&.e\&. \fB-pkg\fR and \fB-tea\fR are
specified the last one specified wins\&.
.sp
In this mode the options \fB-clean\fR and \fB-force\fR are
irrelevant and ignored\&. In contrast, the option \fB-libdir\fR is
relevant in both this and \fB-tea\fR mode\&.
.sp
When this option is specified the basename of the first file argument
after the options is used as the name of the package to generate\&. If
the extension of that file indicates a shared library ("\fI\&.so\fR",
"\fI\&.sl\fR", "\fI\&.dylib\fR", and "\fI\&.dll\fR") it is also removed from
the set of input files\&. A "\fI\&.tcl\fR" file is kept as part of the
input\&. A single file without extension is assumed to actually have a
"\fI\&.tcl\fR" extension\&. A file without extension, but other input files
following is treated like the name of a shared library proper, and
removed from the set of input files\&.
.sp
Examples:
.CS


	\&.\&.\&. -pkg \&.\&.\&. foo

	=> Package name is: foo
	=> Input file is:   foo\&.tcl

.CE
.CS


	\&.\&.\&. -pkg \&.\&.\&. foo bar\&.tcl

	=> Package name is: foo
	=> Input file is:   bar\&.tcl

.CE
.CS


	\&.\&.\&. -pkg \&.\&.\&. foo\&.tcl

	=> Package name is: foo
	=> Input file is:   foo\&.tcl

.CE
.CS


	\&.\&.\&. -pkg \&.\&.\&. foo\&.so bar\&.tcl

	=> Package name is: foo
	=> Input file is:   bar\&.tcl

.CE
.TP
\fB-show\fR
This option, when specified, will cause the system to print the
configuration of the chosen target to \fBstdout\fR and then exit\&.
The choice of target can be influenced through the option
\fB-target\fR (see below)\&.
.TP
\fB-showall\fR
This option, when specified, will cause the system to print the whole
chosen configuration file to \fBstdout\fR and then exit\&.
The choice of configuration file can be influenced through the option
\fB-config\fR (see above)\&.
.TP
\fB-target\fR name
This option overrides the default choice of build target with
the user's choice\&.
When specified multiple times the last value is used\&.
The named target must exist in the chosen configuration file\&.
Use option \fB-targets\fR (see below) to get a list of the
acceptable targets\&.
The choice of configuration file can be influenced through the option
\fB-config\fR (see above)\&.
.sp
This option is irrelevant when generating a TEA package (see
option \fB-tea\fR below)\&.
.TP
\fB-targets\fR
This option, when specified, will cause the system to print the list
of all known targets from the chosen configuration file to
\fBstdout\fR and then exit\&.
The choice of configuration file can be influenced through the option
\fB-config\fR (see above)\&.
.TP
\fB-tea\fR
Similar to option \fB-pkg\fR, except that the invoked mode does not
generate binaries, but a directory hierarchy containing the
"\fI\&.critcl\fR" file, its companion files, and a TEA-lookalike build
system with most of the needed support code (incliding copies of the
critcl packages)\&.
.sp
If both options, i\&.e\&. \fB-pkg\fR and \fB-tea\fR are specified
the last one specified wins\&.
.sp
In this mode the options \fB-I\fR, \fB-L\fR, \fB-clean\fR,
\fB-force\fR, \fB-cache\fR, \fB-includedir\fR, \fB-enable\fR,
\fB-disable\fR, and \fB-with-\fBFOO\fR\fR are irrelevant and
ignored\&. In contrast, the option \fB-libdir\fR is relevant in both
this and \fB-pkg\fR mode\&.
.sp
When this option is specified the basename of the first file argument
after the options is used as the name of the package to generate\&. If
the extension of that file indicates a shared library ("\fI\&.so\fR",
"\fI\&.sl\fR", "\fI\&.dylib\fR", and "\fI\&.dll\fR") it is also removed from
the set of input files\&. A "\fI\&.tcl\fR" file is kept as part of the
input\&. A single file without extension is assumed to actually have a
"\fI\&.tcl\fR" extension\&. A file without extension, but other input files
following is treated like the name of a shared library proper, and
removed from the set of input files\&.
.sp
Examples:
.CS


	\&.\&.\&. -tea \&.\&.\&. foo

	=> Package name is: foo
	=> Input file is:   foo\&.tcl

.CE
.CS


	\&.\&.\&. -tea \&.\&.\&. foo bar\&.tcl

	=> Package name is: foo
	=> Input file is:   bar\&.tcl

.CE
.CS


	\&.\&.\&. -tea \&.\&.\&. foo\&.tcl

	=> Package name is: foo
	=> Input file is:   foo\&.tcl

.CE
.CS


	\&.\&.\&. -tea \&.\&.\&. foo\&.so bar\&.tcl

	=> Package name is: foo
	=> Input file is:   bar\&.tcl

.CE
.TP
\fB-with-\fBname\fR\fR value
This option sets the value of the custom build configuration option
\fIname\fR to \fIvalue\fR\&.
.sp
The information is validated only if one of the "\fI\&.critcl\fR"
input files actually defines and uses a custom build configuration
option with that \fIname\fR\&.
.sp
This option is irrelevant when generating a TEA package (see
option \fB-tea\fR above)\&.
.PP
.SH "MODES OF OPERATION/USE"
CriTcl can be used in three different modes of operation, called
.IP [1]
\fICompile & Run\fR, and
.IP [2]
\fIGenerate Package\fR
.IP [3]
\fIGenerate TEA Package\fR
.PP
Of these three \fICompile & Run\fR came first and is the default
when using the package directly\&. In that case the package collects the
C fragments, builds them as needed, and caches the results for quick
reuse when the same code is used in the future again\&.
.PP
The second mode, \fIGenerate Package\fR, was introduced to enable
the creation of (prebuilt) deliverable packages which do not depend on
the existence of a build system, i\&.e\&. C compiler, on the target
machine\&.
This was originally done through the experimental \fBCritbind\fR tool,
and is now handled by the \fICriTcl Application\fR, also named
\fBcritcl\fR\&.
.PP
Newly introduced with Critcl version 3 is
\fIGenerate TEA Package\fR\&. This mode constructs a directory
hierarchy from the package which can later be built like a regular TEA
package, i\&.e\&. using
.CS


	\&.\&.\&./configure --prefix \&.\&.\&.
	make all isntall

.CE
.SH "PACKAGE STRUCTURE"
Packages generated by critcl have the following basic structure:
.CS


<TOP>
+- pkgIndex\&.tcl
+- critcl-rt\&.tcl
+- license\&.terms (optional)
|
+- tcl (optional)
|  +- <tsources files>
|
+- <platform>
   +- <shared library>

.CE
.PP
\fINotes\fR
.IP [1]
The file "\fIpkgIndex\&.tcl\fR" is the standard package index file
expected by Tcl's package management\&. It is sourced during a search
for packages, and declares the package to Tcl with its files, and how
to handle them\&.
.IP [2]
The file "\fIcritcl-rt\&.tcl\fR" is a helper file containing the
common code used by "\fIpkgIndex\&.tcl\fR" to perform its tasks\&.
.IP [3]
The file "\fIlicense\&.terms\fR" is optional and appears only if
the "\fI\&.critcl\fR" file the package is generated from used the command
\fBcritcl::license\fR to declare package author and license\&.
.IP [4]
All files declared with the command \fBcritcl::tsources\fR are
put into the sub-directory "\fItcl\fR"\&.
.IP [5]
The shared library generated by critcl is put into a
platform-specific sub-directory\&.
.PP
.PP
The whole structure, and especially the last point, enable 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\&. The
only files which can conflict are in the <TOP> and "\fItcl\fR"
directories, and for these we know that they are identical across
targets\&. The result of such a merge would look like:
.CS


<TOP>
+- pkgIndex\&.tcl
+- critcl-rt\&.tcl
+- license\&.terms (optional)
|
+- tcl (optional)
|  +- <tsources files>
|
+- <platform1>
|  +- <shared library1>
+- <platform2>
|  +- <shared library2>
\&.\&.\&.
+- <platformN>
   +- <shared libraryN>

.CE
.SH "CHANGES FOR VERSION 2\&.1"
.IP [1]
Fixed bug where \fBcritcl::tsources\fR interpreted relative
paths as relative to the current working directory instead of
relative to the "\fI\&.critcl\fR" file using the command, as all other
commands of this type do\&.
.IP [2]
Fixed internals, preventing information collected for multiple
"\fI\&.critcl\fR" files to leak between them\&. Notably, \fBcritcl::tk\fR
is not a global configuration option anymore\&.
.IP [3]
Fixed the command \fBcritcl::license\fR to be a null-operation
in mode "compile & run", instead of throwing an error\&.
.IP [4]
Fixed the critcl application's interference with the "compile &
run" result cache in \fB-pkg\fR mode by having it use a wholly
separate (and by default transient) directory for that mode\&.
.IP [5]
Fixed bug where changes to a "\fI\&.critcl\fR" file did not result
in a rebuild for mode "compile & run"\&. All relevant API commands now
ensure UUID changes\&.
.IP [6]
Fixed bug in the backend handling of \fBcritcl::debug\fR where
the companion c-sources of a "\fI\&.critcl\fR" file were not compiled
with debug options, although the "\fI\&.critcl\fR" file was\&.
.IP [7]
Fixed bug in \fBcritcl::debug\fR which prevented recognition of
mode "all" when it was not the first argument to the command\&.
.IP [8]
Fixed bug in "\fIpreload\&.c\fR" preventing its compilation on
non-windows platforms\&.
.IP [9]
Fixed long-standing bug in the handling of namespace qualifiers
in the command name argument of \fBcritcl::cproc\fR and
\fBcritcl::ccommand\fR\&. It is now possible to specify a fully
qualified command name without issues\&.
.IP [10]
Extended/reworked \fBcritcl::tsources\fR to be the canonical
way of declaring "\fI\&.tcl\fR" companion files even for mode "compile &
run"\&.
.IP [11]
Extended/reworked \fBcritcl::tsources\fR to allow the use of a
"\fI\&.critcl\fR" file as its own Tcl companion file\&.
.IP [12]
Extended \fBcritcl::framework\fR to internally check for OS X
build target, and to ignore the declaration if its not\&.
.IP [13]
Extended \fBcritcl::failed\fR to be callable more than once in
a "\fI\&.critcl\fR" file\&. The first call forces the build, if it was not
done already, to get the result\&. Further calls return the cached
result of the first call\&.
.IP [14]
Extended the handling of environment variable CC in the code
determining the compiler to use to deal with (i\&.e\&. remove) paths to
the compiler, compiler file extensions, and compiler options specified
after the compiler itself, leaving only the bare name of the compiler\&.
.IP [15]
Extended the code handling the search for preloaded libraries
to print the paths it searched, making debugging of a search failure
easier\&.
.IP [16]
A new command \fBcritcl::tcl\fR can be used to declare the
version of Tcl minimally needed to build and run the "\fI\&.critcl\fR"
file and package\&. Defaults to 8\&.4 if not declared\&. Extended critcl to
have the stubs and headers for all of Tcl 8\&.4, 8\&.5, and 8\&.6\&.
.IP [17]
A new command \fBcritcl::load\fR forces the build and load of a
"\fI\&.critcl\fR" file\&. This is the official way for overriding critcl's
default lazy-build-&-load-on-demand scheme for mode "compile & run"\&.
.sp
\fINote\fR that after using \fBcritcl::load\fR /
\fBcritcl::failed\fR in a "\fI\&.critcl\fR" file it is not possible to
use critcl commands in that file anymore\&. Doing so will throw an
error\&.
.IP [18]
Extended the generation of '#line' pragmas to use
\fBinfo frame\fR (if available) to provide the C compiler with exact
line numbers into the "\fI\&.critcl\fR" file for the reporting of
warnings and errors\&.
.IP [19]
Extended \fBcritcl::check\fR with logging to help with
debugging build-time checks of the environment, plus an additional
optional argument to provide labeling\&.
.IP [20]
Added a new command \fBcritcl::checklink\fR which not only
tries to check the environment via compiling the code, but also
its linkability\&.
.IP [21]
Added a new command \fBcritcl::msg\fR for messaging, like
command \fBcritcl::error\fR is for error reporting\&. Likewise this is a
hook a user of the package is allowed to override\&. The default
implementation, used by mode \fIcompile & run\fR does nothing\&. The
implementation for mode \fIgenerate package\fR prints the message
to stdout\&.
.sp
Envisioned use is for the reporting of results determined by
\fBcritcl::check\fR and \fBcritcl::checklink\fR during building, to
help with debugging when something goes wrong with a check\&.
.IP [22]
Exposed the argument processing internals of \fBcritcl::proc\fR
for use by advanced users\&. The new commands are
.RS
.IP [1]
\fBcritcl::argnames\fR
.IP [2]
\fBcritcl::argcnames\fR
.IP [3]
\fBcritcl::argcsignature\fR
.IP [4]
\fBcritcl::argvardecls\fR
.IP [5]
\fBcritcl::argconversion\fR
.RE
.IP
Please see section \fIAdvanced Embedded C Code\fR of the
\fBcritcl\fR package documentation for details\&.
.IP [23]
Extended the critcl package to intercept \fBpackage
provide\fR and record the file -> package name mapping\&. Plus other
internal changes now allow the use of namespaced package names while
still using proper path names and init function\&.
.IP [24]
Dropped the unused commands \fBcritcl::optimize\fR and
\fBcritcl::include\fR\&.
.IP [25]
Dropped \fB-lib\fR mode from the critcl application\&.
.IP [26]
Dropped remnants of support for Tcl 8\&.3 and before\&.
.PP
.SH "CHANGES FOR VERSION 3"
.IP [1]
The command \fBcritcl::platform\fR was deprecated in version
2\&.1, superceded by \fBcritcl::targetplatform\fR, yet kept for
compatibility\&. Now it has been removed\&.
.IP [2]
The command \fBcritcl::compiled\fR was kept with in version 2\&.1
with semantics in contradiction to its, for compatibility\&. This
contradiction has been removed, changing the visible semantics of the
command to be in line with its name\&.
.IP [3]
The change to version 3 became necessary because of the two
incompatible visible changes above\&.
.IP [4]
Extended the application package with code handling a new
option \fB-tea\fR\&. Specifying this option invokes a special mode
where critcl generates a TEA package, i\&.e\&. wraps the input into a
directory hierarchy and support files which provide it TEA-lookalike
buildsystem\&.
.sp
This new option, and \fB-pkg\fR, exclude each other\&. If
both are specified the last used option takes precedence\&.
.sp
The generated package directory hierarchy is mostly
self-contained, but not fully\&. It requires not only a working
installation of Tcl, but also working installations of the packages
\fBmd5\fR and \fBcmdline\fR\&. Both of these are provided by the
\fBTcllib\fR bundle\&. Not required, but recommended to have
installed are any of the packages which can accelerate md5's
operation, i\&.e\&. \fBcryptkit\fR, \fBtcllibc\fR, or
\fBTrf\fR\&.
.IP [5]
Extended the critcl package with a new command
\fBcritcl::scan\fR taking the path to a "\fI\&.critcl\fR" file,
statically scanning it, and returning license, version, a list of its
companion files, list of imported APIs, and list of
developer-specified custom configuration options\&. This data is the
foundation for the TEA wrapping described above\&.
.sp
Note that this is a \fIstatic\fR scan\&. While the other build
modes can (must) execute the "\fI\&.critcl\fR" file and make
platform-specific decisions regarding the assembled C code, companion
files, etc\&. the TEA wrap mode is not in a position to make
platform-specific decisions\&. It has to wrap everything which might
conceivably be needed when actually building\&. Hence the static scan\&.
This has however its own set of problems, namely the inability to
figure out any dynamic construction of companion file paths, at least
on its own\&. Thus:
.IP [6]
Extended the API used by critcl-based packages with the command
\fBcritcl::owns\fR\&. While this command is ignored by the regular build
modes the static scanner described above takes its arguments as the
names of companion files which have to be wrapped into the TEA package
and could not be figured by the scanner otherwise, like because of
dynamic paths to \fBcritcl::tsources\fR, \fBcritcl::csources\fR,
getting sourced directly, or simply being adjunct datafiles\&.
.IP [7]
Extended the API used by critcl-based packages with the command
\fBcritcl::api\fR for the management of stubs tables, be it their use,
and/or declaration and export\&.
.sp
Please see section \fIStubs Table Management\fR of the
\fBcritcl\fR package documentation for details\&.
.IP [8]
Extended the API used by critcl-based packages with the command
\fBcritcl::userconfig\fR for the management of developer-specified
custom configuration options, be it their use and/or declaration\&.
.sp
Please see section \fICustom Build Configuration\fR of the
\fBcritcl\fR package documentation for details\&.
.IP [9]
Extended the API used by critcl-based packages with the
commands \fBcritcl::description\fR, \fBcritcl::summary\fR,
\fBcritcl::subject\fR, \fBcritcl::meta\fR, and
\fBcritcl::buildrequirement\fR for the declaration of TEApot meta data
for/about the package\&.
.sp
Please see section \fIPackage Meta Data\fR of the
\fBcritcl\fR package documentation for details\&.
.PP
.SH "CHANGES FOR VERSION 3\&.0\&.1"
.IP [1]
Bugfixes all around\&. In detail:
.IP [2]
Fixed recording of Tcl version requirements\&. Keep package name
and version together, unbreaking generated meta data and generated
package load command\&.
.IP [3]
Fixed the build scripts: When installing, or wrapping for TEA,
generate any missing directories
.IP [4]
Modified the build scripts to properly exit the application
when the window of their GUI is closed through the (X) button\&.
.IP [5]
Removed an 8\&.5-ism (open wb) which had slipped into the main
build script\&.
.IP [6]
Modified the example build scripts to separate the output for
the different examples (and packages) by adding empty lines\&.
.IP [7]
stack::c example bugfix: Include API declarations for use in
the companion files\&.
.IP [8]
Extended the documentation: Noted the need for a working
installation of a C compiler\&.
.IP [9]
Extended the Windows target definitions and code to handle the
manifest files used by modern MS development environments\&. Note that
this code handles both possibilities, environment using manifests, and
(old(er)) environments without\&.
.IP [10]
Extended the Windows 64bit target definitions and code to
auto-detect the need for the helper library "bufferoverflowU\&.lib" and
reconfigure the compile and link commands appropriately\&. We assume
that the library must be linked when present\&. This should be no harm
if the library is present, yet not needed\&. Just superfluous\&. We search
for the library in the paths specified by the environment variable
LIB\&.
.PP
.SH "CHANGES FOR VERSION 3\&.0\&.2"
.IP [1]
Fixed issue in compile-and-run mode where commands put into the
auto_index are not found by Tcl's [unknown] command\&.
.IP [2]
Fixed an array key mismatch breaking usage of client data and
delete function for procedure\&. Reported by Jos DeCoster, with patch\&.
.IP [3]
Implemented a command line option \fB-L\fR, an equivalent of
option \fB-I\fR, just for library search paths\&.
.IP [4]
Fixed github issues 5 and 8\&. Working around a missing variable
::errorInfo\&. It should always be present, however there seem to be
revisions of Tcl around which violate this assumption\&.
.PP
.SH "CHANGES FOR VERSION 3\&.0\&.3"
.IP [1]
Fixed github issues 5 and 8, for the example build\&.tcl
scripts\&. Working around a missing variable ::errorInfo\&. It should
always be present, however there seem to be revisions of Tcl around
which violate this assumption\&.
.PP
.SH "CHANGES FOR VERSION 3\&.0\&.4"
.IP [1]
Fixed generation of the package's initname when the incoming
code is read from stdin and has no proper path\&.
.IP [2]
Fixed github issue 11\&. Now using /LIBPATH instead of -L
on Windows (libinclude configuration setting)\&.
.IP [3]
Extended critcl to handle -l:path format of -l options\&.
GNU ld 2\&.22+ handles this by searching for the path as
is\&. Good when specifying static libraries, as plain -l looks
for shared libraries in preference over static\&. critcl handles
it now, as older GNU ld's do not understand it, nor the
various vendor-specific linkers\&.
.IP [4]
Fixed github issue #12\&. Critcl now determines the version of
MSVC in use and uses it to switch between various link debug
options\&. Simplified the handling of bufferoverflowU\&.lib also,
making use of the same mechanism and collapsing the two
configurations sections we had back into one\&.
.IP [5]
Reworked the insertion of #line pragmas into the generated C
code to avoid limitations on the line number argument imposed
by various compilers, and be more accurate\&.
.IP [6]
Modified argument processing\&. Option -libdir now also
implies -L for its argument\&.
.IP [7]
Extended handling of option -show (\fBcritcl::showconfig\fR)
to list the path of the configuration file the data is coming
from\&. Good for debugging configuration processing\&.
.IP [8]
Extended the build script with targets to regenerate the
embedded documentation, and diagrams, and to generate a
release\&.
.PP
.SH "CHANGES FOR VERSION 3\&.0\&.5"
.IP [1]
Fixed bug in the new code for #line pragmas triggered when
specifying C code without leading whitespace\&.
.IP [2]
Extended the documentation to have manpages for the license,
source retrieval, installer, and developer's guides\&.
.PP
.SH "CHANGES FOR VERSION 3\&.0\&.6"
.IP [1]
Fixed github issue 10\&. The critcl application now delivers a
proper exit code (1) on build failure, instead of always
indicating success (status 0)\&.
.IP [2]
Fixed github issue 13\&. Handling of bufferoverflowU\&.lib for
release builds was inconsistent with handling for debug
builds\&. It is now identically handled (conditional) by
both cases\&.
.IP [3]
Documentation cleanup, mainly in the installation guide, and
the README\&.md shown by github
.PP
.SH "CHANGES FOR VERSION 3\&.0\&.7"
.IP [1]
Fixed the code generated by \fBcritcl::c++command\fR\&.
The emitted code handed a non-static string table to
\fBTcl_GetIndexFromObj\fR, in violation of the contract, which
requires the table to have a fixed address\&. This was a memory
smash waiting to happen\&. Thanks to Brian Griffin for alrerting
us to the general problem\&.
.PP
.SH "CHANGES FOR VERSION 3\&.1"
.IP [1]
Added a new higher-level package \fBcritcl::iassoc\fR\&.
.sp
This package simplifies the creation of code associating data
with an interpreter via Tcl's \fBTcl_(Get|Set)AssocData()\fR APIs\&. The
user can concentrate on his data while all the necessary boilerplate
C code to support this is generated by the package\&.
.sp
This package uses several of the new features which were added
to the core \fBcritcl\fR package, see below\&.
.IP [2]
Added the higher-level package \fBcritcl::class\fR\&.
.sp
This package simplifies the creation of C level objects with
class and instance commands\&. The user can write a class definition
with class- and instance-variables and -methods similar to a TclOO
class, with all the necessary boilerplate C code to support this
generated by the package\&.
.sp
This package uses several of the new features which were added
to the core \fBcritcl\fR package, see below\&.
.IP [3]
Extended the API for handling TEApot metadata\&. Added the
command \fBcritcl::meta?\fR to query the stored information\&. Main use
currently envisioned is retrieval of the current package's name by
utility commands, for use in constructed names\&. This particular
information is always available due to the static scan of the package
file on execution of the first critcl command\&.
.sp
The new packages \fBcritcl::iassoc\fR and
\fBcritcl::class\fR (see above) are users of this command\&.
.IP [4]
Extended the API with a command, \fBcritcl::name2c\fR, exposing
the process of converting a Tcl name into base name, namespace, and C
namespace\&. This enables higher-level code generators to generate the same
type of C identifiers as \fBcritcl\fR itself\&.
.sp
The new package \fBcritcl::class\fR (see above) is a user
of this command\&.
.IP [5]
Extended the API with a command, \fBcritcl::source\fR,
executing critcl commands found in a separate file in the context of
the current file\&. This enables easier management of larger bodies of
code as it allows the user to split such up into easier to digest
smaller chunks without causing the generation of multiple packages\&.
.IP [6]
Related to the previous item, extended the API with commands to
divert collection of generated C code into memory\&. This makes it
easier to use the commands for embedded C code in higher-level code
generators\&.
.sp
See the section \fBAdvanced: Diversions\fR for details of
the provided commands\&.
.sp
The new package \fBcritcl::class\fR (see above) is a user
of these facilities\&.
.IP [7]
Extended the API with commands helping developers with the
generation of proper C \fI#line\fR directives\&. This allows
higher-level code generators to generate and insert their own
directives, ensuring that compile errors in their code are properly
attributed\&.
.sp
See the section \fBAdvanced: Location management\fR for
details of the provided commands\&.
.sp
The new packages \fBcritcl::iassoc\fR and
\fBcritcl::class\fR (see above) are users of these facilities\&.
.IP [8]
Extended the API with commands giving users the ability to
define custom argument and result types for \fB::critcl::cproc\fR\&.
.sp
See the section \fBAdvanced: Extending cproc\fR for
details of the provided commands\&.
.PP
.SH "CHANGES FOR VERSION 3\&.1\&.1"
.IP [1]
Bugfixes all around\&. In detail:
.IP [2]
Fixed the generation of wrong#args errors for
\fBcritcl::cproc\fR and derived code (\fBcritcl::class\fR
cproc-based methods)\&. Use NULL if there are no arguments, and
take the offset into account\&.
.IP [3]
Fixed the handling of package names by
\fBcritcl::class\fR\&. Forgot that they may contain namespace
separators\&. Bumped to version 1\&.0\&.1\&.
.IP [4]
Extended a \fBcritcl::class\fR generated error message in
instance creation for clarity\&. Bumped to version 1\&.0\&.2\&.
.PP
.SH "CHANGES FOR VERSION 3\&.1\&.2"
.IP [1]
Enhancement\&. In detail:
.IP [2]
Extended \fBcritcl::cproc\fR to be able to handle optional
arguments, in a limited way\&. This is automatically available to
\fBcritcl::class\fR cproc-based methods as well\&.
.IP [3]
Bugfix in \fBlassign\fR emulation for Tcl 8\&.4\&.  Properly set
unused variables to the empty string\&.  Bumped version of
emulation package \fBlassign84\fR to 1\&.0\&.1\&.
.PP
.SH "CHANGES FOR VERSION 3\&.1\&.3"
.IP [1]
Enhancement\&. In detail:
.IP [2]
Added new argument type "pstring", for "Pascal String", a
counted string, i\&.e\&. a combination of string pointer and string
length\&.
.IP [3]
Added new methods \fBcritcl::argtypesupport\fR and
\fB::critcl::argsupport\fR to define and use additional
supporting code for an argument type, here used by "pstring"
above to define the necessary structure\&.
.IP [4]
Semi-bugfixes in the packages \fBcritcl::class\fR and
\fBcritcl::iassoc\fR\&. Pragmas for the AS meta data scanner
to ensure that the template files are made part of the package\&.
Versions bumped to 1\&.0\&.4 and 1\&.0\&.1 respectively\&.
.PP
.SH "CHANGES FOR VERSION 3\&.1\&.4"
.IP [1]
Bugfix in package \fBcritcl::class\fR\&. Generate a dummy
field in the class structure if the class has no class
variables\&. Without this change the structure would be empty,
and a number of compilers are not able to handle such a type\&.
.IP [2]
Fixed a typo which broke the win64 configuration\&.
.IP [3]
Fixed issue #16, a typo in the documentation of command
\fBcritcl::class\fR\&.
.PP
.SH "CHANGES FOR VERSION 3\&.1\&.5"
.IP [1]
Fixed issue #19\&. Made the regular expression extracting the
MSVC version number more general to make it work on german
language systems\&. This may have to be revisited in the future,
for other Windows locales\&.
.IP [2]
Fixed issue #20\&. Made option -tea work on windows, at least in
a unix emulation environment like msys/mingw\&.
.PP
.SH "CHANGES FOR VERSION 3\&.1\&.6"
.IP [1]
Fixed issue #21\&. While the multi-definition of the stub-table
pointer variables was ok with for all the C linkers seen so far
C++ linkers did not like this at all\&. Reworked the code to
ensure that this set of variables is generated only once, in
the wrapper around all the pieces to assemble\&.
.IP [2]
Fixed issue #22, the handling of the command identifier
arguments of \fBcritcl::ccommand\fR, \fBcritcl::cproc\fR, and
\fBcritcl::cdata\fR\&. We now properly allow any Tcl identifier
and generate proper internal C identifiers from them\&.
.sp
As part of this the signature of command \fBcritcl::name2c\fR
changed\&. The command now delivers a list of four values instead
of three\&. The new value was added at the end\&.
.sp
Further adapted the implementation of package
\fBcritcl::class\fR, a user of \fBcritcl::name2c\fR\&.
This package is now at version 1\&.0\&.6 and requires critcl 3\&.1\&.6
.sp
Lastly fixed the mis-handling of option \fB-cname\fR in
\fBcritcl::ccommand\fR, and \fBcritcl::cproc\fR\&.
.IP [3]
Fixed issue #23\&.
.PP
.SH "CHANGES FOR VERSION 3\&.1\&.7"
.IP [1]
Fixed issue #24\&. Extract and unconditionally display compiler
warnings found in the build log\&. Prevents users from missing
warnings which, while not causing the build to fail, may
still indicate problems\&.
.IP [2]
New feature\&. Output hook\&. All non-messaging user output is now
routed through the command \fBcritcl::print\fR, and users are
allowed to override it when using the critcl application-as-package\&.
.IP [3]
New feature, by Ashok P\&. Nadkarni\&. Platform configurations can
inherit values from configurations defined before them\&.
.PP
.SH "CHANGES FOR VERSION 3\&.1\&.8"
.IP [1]
Fixed issue with package indices generated for Tcl 8\&.4\&.
Join the list of commands with semi-colon, not newline\&.
.IP [2]
Fixed issue #26 which brought up use-cases I had forgotten to
consider while fixing bug #21 (see critcl 3\&.1\&.6)\&.
.PP
.SH "CHANGES FOR VERSION 3\&.1\&.9"
.IP [1]
Fixed issue #27\&. Added missing platform definitions for
various alternate linux and OS X targets\&.
.IP [2]
Fixed issue #28\&. Added missing -mXX flags for linking at the
linux-{32,64}-* targets\&.
.IP [3]
Fixed issue #29\&. Replaced the use of raw "cheaders"
information in the processing of "cdefines" with the proper
include directives derived from it\&.
.IP [4]
Fixed the issue behind rejected pull request #30 by Andrew
Shadura\&. Dynamically extract the stubs variable declarations
from the Tcl header files and generate matching variable
definitions for use in the package code\&. The generated code
will now be always consistent with the headers, even when
critcl's own copy of them is replaced by system headers\&.
.IP [5]
Fixed issue #31\&. Accepted patch by Andrew Shadura, with
changes (comments), for easier integration of critcl with
OS package systems, replacing critcl's copies of Tcl headers
with their own\&.
.IP [6]
Fixed issue #32\&. Merged pull request by Andrew Shadura\&.
Various typos in documentation and comments\&.
.IP [7]
Fixed issue #33\&. Handle files starting with a dot better\&.
.PP
.SH AUTHORS
Jean Claude Wippler, Steve Landers, Andreas Kupries
.SH "BUGS, IDEAS, FEEDBACK"
This document, and the package it describes, will undoubtedly contain
bugs and other problems\&.
Please report them at \fIhttps://github\&.com/andreas-kupries/critcl/issues\fR\&.
Ideas for enhancements you may have for either package, application,
and/or the documentation are also very welcome and should be reported
at \fIhttps://github\&.com/andreas-kupries/critcl/issues\fR as well\&.
.SH KEYWORDS
C code, Embedded C Code, code generator, compile & run, compiler, dynamic code generation, dynamic compilation, generate package, linker, on demand compilation, on-the-fly compilation
.SH CATEGORY
Glueing/Embedded C code
.SH COPYRIGHT
.nf
Copyright (c) Jean-Claude Wippler
Copyright (c) Steve Landers
Copyright (c) 2011-2013 Andreas Kupries

.fi