<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE TIP SYSTEM "http://www.tcl.tk/cgi-bin/tct/tip/tipxml.dtd">
<!-- Converted at Fri May 24 06:10:56 GMT 2013 -->
<!-- TIP AutoGenerator - written by Donal K. Fellows -->

<TIP number='203'>
<header><title>Create tclConfig.sh-Equivalent in Tcl</title><author address="mailto:coldstore@users.sourceforge.net">Colin McCormack</author><author address="mailto:dgp@users.sf.net">Don Porter</author><author address="mailto:colin@sharedtech.dyndns.org">Colin McCormack</author><status type='project' state='withdrawn' tclversion="8.5" vote='prior'>$Revision: 1.11 $</status><history></history><created day='17' month='jun' year='2004' /><discussions url='http://mini.net/tcl/tclConfig.sh'/><keyword>configuration installation</keyword></header>
<abstract>This proposal requires the registration of information about the built process, currently stored in tclConfig.sh, by means of the Tcl_RegisterConfig mechanism set out in [Tip 59].</abstract>
<body><section title="Rationale">
<para>Packages such as Critcl[<url ref="http://www.equi4.com/critcl.html"/>], and indeed anything written in pure tcl which tries to build extensions under Tcl need more introspection to discover the ground rules of construction in the installation in which they find themselves.</para>
<para>In order to facilitate such future build tools, the build information should be made available to Tcl scripts.</para>
</section>
<section title="Specification">
<para>Every variable defined in the unix tclConfig.sh should be registered using <emph style="bold">Tcl_RegisterConfig</emph>, with the following exceptions:</para>
<itemize><item.i><para>TCL_VERSION and similar redundant version, patch level information.</para></item.i><item.i><para>TCL_THREADS - redundant.</para></item.i><item.i><para>TCL_BUILD_* - nothing specifying the build directory.</para></item.i></itemize>
<para>Because Windows and other platforms don&apos;t have a tclConfig.sh, the following fields are desirable for hand construction: ---- <emph style="bold">Compilation:</emph> * TCL_CC # C compiler to use for compilation.</para>
<itemize><item.i><para>TCL_DEFS # -D flags for use with the C compiler.</para></item.i><item.i><para>TCL_INCLUDE_SPEC # String to pass to the compiler so that an extension can find installed Tcl headers.</para></item.i><item.i><para>TCL_LIB_FILE # The name of the Tcl library</para></item.i><item.i><para>TCL_LIBS # Additional libraries to use when linking Tcl.</para></item.i><item.i><para>TCL_SHLIB_CFLAGS # Flags to pass to cc when compiling the components of a shared library:</para></item.i><item.i><para>TCL_CFLAGS_WARNING # Flags to pass to cc to get warning messages</para></item.i></itemize><describe><item.d name='* TCL_EXTRA_CFLAGS # Extra flags to pass to cc'><para>---- <emph style="bold">Linking:</emph></para></item.d></describe><itemize><item.i><para>TCL_SHLIB_LD # Base command to use for combining object files into a shared library:</para></item.i><item.i><para>TCL_SHLIB_LD_LIBS # dependent libraries should be included when linking shared libraries</para></item.i><item.i><para>TCL_SH LIB_SUFFIX # Suffix to use for the name of a shared library.</para></item.i><item.i><para>TCL_LD_FLAGS # Flags to pass to the compiler when linking object files into an executable tclsh or tcltest binary.</para></item.i><item.i><para>TCL_COMPAT_OBJS # Additional object files linked with Tcl to provide compatibility with standard facilities from ANSI C or POSIX.</para></item.i><item.i><para>TCL_LIB_FLAG # -l flag to pass to the linker to pick up the Tcl library</para></item.i><item.i><para>TCL_LIB_SPEC # String to pass to linker to pick up the Tcl library from its installed directory.</para></item.i></itemize>
<para>---- <emph style="bold">Stub Support:</emph></para>
<itemize><item.i><para>TCL_SUPPORTS_STUBS # Tcl supports stub.</para></item.i><item.i><para>TCL_STUB_LIB_FILE # The name of the Tcl stub library (.a):</para></item.i><item.i><para>TCL_STUB_LIB_FLAG # -l flag to pass to the linker to pick up the Tcl stub library * TCL_STUB_LIB_SPEC # String to pass to linker to pick up the Tcl stub library from its installed directory. * TCL_STUB_LIB_PATH # Path to the Tcl stub library in the install directory. ----</para></item.i></itemize>
</section>
<section title="Comments">
<para>How about converting this proposal into a proposal listing the values found in <emph style="italic">tclConfig.sh</emph> and proposing that Tcl should pass those values into <emph style="bold">Tcl_RegisterConfig</emph> during initialization? That would make all the values available to scripts via the <emph style="bold">::tcl::pkgconfig</emph> command. -- Good idea. Done.</para>
<para>Several of the assigned values in tclConfig.sh contain references to other variables - should these be reproduced verbatim, or evaluated prior to registration? I&apos;m leaning toward verbatim storage: let the people who need the data construct an evaluation which serves their purposes because (a) the form is easy enough to evaluate, as in the parser I threw together [<url ref="http://mini.net/tcl/tclConfig.sh"/>], (b) there might be information in the verbatim form which needs to be preserved. Comments welcome.</para>
</section>
<section title="Withdrawal">
<para>Joe English points out that those parts potentially useful to a pure-tcl builder are not necessarily applicable, since the build and installation machines may/will differ substantially, and that those parts universally applicable are available via some combination of info and ::tcl::pkgconfig. Given this insight, I withdraw this TIP.</para>
</section>
<section title="Copyright">
<para>This document has been placed in the public domain.</para>
</section>
</body></TIP>
