Author: Colin McCormack <firstname.lastname@example.org> Author: Don Porter <email@example.com> Author: Colin McCormack <firstname.lastname@example.org> State: Withdrawn Type: Project Vote: Pending Created: 17-Jun-2004 Post-History: Discussions-To: http://mini.net/tcl/tclConfig.sh Keywords: configuration,installation Tcl-Version: 8.5
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].
Packages such as Critclhttp://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.
In order to facilitate such future build tools, the build information should be made available to Tcl scripts.
Every variable defined in the unix tclConfig.sh should be registered using Tcl_RegisterConfig, with the following exceptions:
TCL_VERSION and similar redundant version, patch level information.
TCL_THREADS - redundant.
TCL_BUILD_* - nothing specifying the build directory.
Because Windows and other platforms don't have a tclConfig.sh, the following fields are desirable for hand construction:
Compilation: * TCL_CC # C compiler to use for compilation.
TCL_DEFS # -D flags for use with the C compiler.
TCL_INCLUDE_SPEC # String to pass to the compiler so that an extension can find installed Tcl headers.
TCL_LIB_FILE # The name of the Tcl library
TCL_LIBS # Additional libraries to use when linking Tcl.
TCL_SHLIB_CFLAGS # Flags to pass to cc when compiling the components of a shared library:
TCL_CFLAGS_WARNING # Flags to pass to cc to get warning messages
TCL_EXTRA_CFLAGS # Extra flags to pass to cc:
TCL_SHLIB_LD # Base command to use for combining object files into a shared library:
TCL_SHLIB_LD_LIBS # dependent libraries should be included when linking shared libraries
TCL_SH LIB_SUFFIX # Suffix to use for the name of a shared library.
TCL_LD_FLAGS # Flags to pass to the compiler when linking object files into an executable tclsh or tcltest binary.
TCL_COMPAT_OBJS # Additional object files linked with Tcl to provide compatibility with standard facilities from ANSI C or POSIX.
TCL_LIB_FLAG # -l flag to pass to the linker to pick up the Tcl library
TCL_LIB_SPEC # String to pass to linker to pick up the Tcl library from its installed directory.
TCL_SUPPORTS_STUBS # Tcl supports stub.
TCL_STUB_LIB_FILE # The name of the Tcl stub library (.a):
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.
How about converting this proposal into a proposal listing the values found in tclConfig.sh and proposing that Tcl should pass those values into Tcl_RegisterConfig during initialization? That would make all the values available to scripts via the ::tcl::pkgconfig command. -- Good idea. Done.
Several of the assigned values in tclConfig.sh contain references to other variables - should these be reproduced verbatim, or evaluated prior to registration? I'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 http://mini.net/tcl/tclConfig.sh , (b) there might be information in the verbatim form which needs to be preserved. Comments welcome.
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.
This document has been placed in the public domain.