Overview
| Artifact ID: | 4c7b17566eacc7a2ad85d518a6e48916d5b66e95 |
|---|---|
| Ticket: | 579633ffffffffffffffffffffffffffffffffff
why are there static paths in libtcl? |
| User & Date: | dgp on 2002-07-10 21:55:53 |
Changes
- icomment:
Logged In: YES user_id=80530 The main product produce by 'make' on the Tcl sources is a binary library linkable into other (C) programs. It may be static or shared. It may have a name matching libtcl*.* or tcl*.dll, but I'll call it "libtcl" Unlike most binary libraries, libtcl doesn't contain everything it needs to perform its functions. It relies on a script library stored somewhere on some filesystem. It also expects to be able to [load] or [source] installed files to extend its functionality. The locations to search for installed extensions/packages are also somewhere on some filesystem. So, libtcl has to know path information in a filesystem for complete operation. In a completely default build/install of Tcl, these are known relative paths, relative to the installed location of libtcl. However, Unix offers no way within an executable to discover the full path of a library linked into that executable. For example, inside a running wish, there's no C function that can be called to find the path to the libtcl*.* that's linked into that wish. So there's no base path off of which to extend the relative paths to "init.tcl" or to the install directories for packages. Instead, the paths themselves must be compiled into the library, *and* one must assume that the library and its support files are in fact installed in the location where ./configure said they would be installed. Contrast this with the Windows initialization where AppendDllPath() is able to call GetModuleFileName() to discover the path to tcl*.dll and base further paths on it. Note the importance of matching a configure-time declaration of where things will be installed to the actual install location determined at install time. This really complicates binary distributions. In fact, the ActiveTcl installer has to solve this by actually *binary patching* the correct install paths into libtcl as it installs it. That's a start at the explanation, but that's limited to the default install. When people get adventurous with their ./configure options, things only get worse. More to come...
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"