skuh...@web.de wrote:
> Am Samstag, 7. Dezember 2019 00:36:29 UTC+1 schrieb Brad Lanam:
>> Also be aware that the installation path gets hard-coded into the
>> binary, and Tcl/Tk will locate .tcl and .tm modules from the
>> original install path (again, instead of looking in its current
>> location).
>
> How does that work, when make does compiling and installing/copying
> in two different steps?
Generally it's done during compilation. One of those many CPP defines
that get setup before compilation would contain the eventual install
path, and some line of C somewhere sets up a static string containing
the contents of the CPP define.
> And how do you deal with it? - I would have guessed, that this is
> part of the init.tcl scripts and not directly in the binary.
For compiled in static strings, typically by redefining the CPP define
prior to compiling the .c file that adds in the static string.
As for init.tcl, the C code still needs some way to find init.tcl, so
you'll still end up compiling in at least one path, that being the one
necessary to find init.tcl. Once you've done that, it likely becomes
an either/or whether you defer to init.tcl for the remainder or just
compile in the remainder (as 99% of the C coding and configuration
effort is already done for that first one). One aspect that would sway
the either/or choice towards compiled into the binary would be if
several of the paths were needed by the C init before the Tcl
interpreter is up and ready to interpret init.tcl.