Thoughts on Tcl (long but necessary)

Bruce Dubbs bruce.dubbs at gmail.com
Sat Apr 29 11:58:50 PDT 2006


Randy McMurchy wrote:

> So far, I've built several packages from BLFS and a couple Non
> BLFS packages. In this testing, I didn't modify tcl/tkConfig.sh
> and only used 'make install-private-headers' to install any
> private headers. Nothing so far has failed to build.
> 
> There are packages (for example Expect) that pick up the wrong
> LDFLAGS, but it didn't affect the build as apparently it also
> had /usr/lib in the LDFLAGS setting. Here is example output from
> Expect's configure:
> 
> checking for Tcl configuration... found /usr/lib/tclConfig.sh
> checking Tcl build library... -L/home/rml/build/tcl8.4.13/unix -ltcl8.4 -ldl  -lpthread -lieee -lm
> 
> and how this was passed along in the Makefile to the make
> command (this was actually all one long line):
> 
> gcc -pipe   -Wl,--export-dynamic -o expect exp_main_exp.o
> libexpect5.43.a -L/home/rml/build/tcl8.4.13/unix -ltcl8.4
> -ldl  -lpthread -lieee -lm -lutil
> -Wl,-rpath,/usr/lib:/usr/lib:/usr/X11R6/lib
> 
> Notice how it picked up the non-existent build directory
> from the tclConfig.sh. But since /usr/lib is indirectly
> passed, the build didn't fail.
> 
> Makes me wonder if there are programs that will use this
> build dir only. Not sure why they would as the TCL_LIB_SPEC
> variable is what should be used:
> 
> TCL_LIB_SPEC='-L/usr/lib -ltcl8.4${TCL_DBGX}'
> 
> and not the TCL_BUILD_LIB_SPEC:
> 
> TCL_BUILD_LIB_SPEC='-L/home/rml/build/tcl8.4.13/unix -ltcl8.4${TCL_DBGX}'
> 
> But, as we know, what programmers should do and what actually
> is done may be two different things. Anyway, it would seem it
> would be a trivial fix if a package didn't pick up Tcl's lib
> dir correctly. So I think we can get away without modifying
> the tcl/tkConfig.sh files.


> The only other things left are these two symlinks:
> 
> ln -v -nsf ../../include/tcl8.4 /usr/lib/tcl8.4/include
> ln -v -sf libtcl8.4.so /usr/lib/libtcl.so
> 
> Though I stupidly created these when I installed Tcl/Tk for testing,
> I went back through the build trees (including logs of all output
> during building) of all the packages I built and grepped for
> indications that anything looked for the include directory as a sub
> of /usr/lib/{tcl,tk}8.4 or if anything used -l{tcl,tk} instead of
> -l{tcl,tk}8.4. I couldn't find anything. Again, probably a trivial
> fix if any package were to use references to the symlinks instead of
> the actual installed library/include files.

Thanks for the research Randy.  I suspect having the TCL_BUILD_LIB_SPEC,
etc., in the files would be for tkl developers that are using the latest
libraries under development.  If the libraries aren't found there, they
go to the standard location.  In our case, the libraries are the same
and the correct ones would be used from either location.

  -- Bruce





More information about the blfs-dev mailing list