Thoughts on Tcl (long but necessary)

Randy McMurchy randy at linuxfromscratch.org
Fri Apr 28 15:19:43 PDT 2006


Hi all,

Working with the Tcl update and trying to go ahead and simplify the
instructions and use the 'make install-private-headers' target. For
some background, visit http://wiki.linuxfromscratch.org/blfs/ticket/1897

Here's some notes. There are things that need to be discussed, hashed
out and a decision needs to be reached. The headers are what we need
to get straight. Anyway, here's a review of the proposed changes.
Much of it is from Bruce's suggestions, though I had to change some
of it.

1. The 3 exported variables can be removed. $VERSION is an entity we
already have defined. $V can be a new defined entity (and it will only
change rarely, like when Tcl moves to 8.5.x and then 8.6.x). $DIR is
the same as $PWD, why create another?

2. The sed that fixed configure isn't required. It has been fixed
upstream and is in this new version (8.4.13).

3. This ugly sed will change from this:

sed -i -e "s:${DIR}/unix:/usr/lib:" \
       -e "s:${DIR}:/usr/include/tcl${V}:" \
       -e "s:^TCL_LIB_FILE='libtcl${V}..TCL_DBGX..so':\
TCL_LIB_FILE=\"libtcl${V}\$\{TCL_DBGX\}.so\":" tclConfig.sh

to this:

sed -i -e "s:${PWD}:/usr/lib:" \
       -e "s:$(dirname ${PWD}):/usr/include/tcl&tclver;:" \
       -e "/TCL_LIB_FILE/ s:':\":g" \
    tclConfig.sh

4. It was mentioned in the ticket that perhaps we don't even need
to do the sed. I'm not sure about that. I think we need it for as
long as we continue to remove the source tree. I just can't see
how tclConfig.sh would work without the changes.

Now, as we'll see later in this message, that sed above (both do
the exact thing) *will need to be changed* if we use a different
method to install the headers. I'll touch on this at the end of
the message.

Now on to the installation commands:

5. We have 5 lines working with the headers. It should actually be
only 4 as there are two different lines creating directories where
consolidating them would only require changing a 'unix' to a
'{unix,generic}'. So, we'll consider it 4 with them being the one
to create the two directories, 2 to install headers into those
directories, and 1 command removes some redundant headers so they
don't exist in two places. So, let's call it 4 lines.

Some say we should use the 'make install-private-headers' Makefile
target instead. This would require 2 lines: the make line being one
and because one necessary header isn't installed, we have to do
that one manually. So, two commands. FYI: the missed header defines
things for thread support. I suppose since we pass --enable-threads
to configure and the install-header target doesn't install the
header we'll have to do it manually. So, 2 commands. Half as many,
but only *two* commands we are eliminating.

6. This is really a continuation of 5, but in 5 I wanted to stress
4 commands versus 2. Not only is there a difference in the commands,
but there is a difference *in what gets installed*. And I don't
know enough about Tcl to determine if the difference in the
installation will affect things. I tend to think it is to close to
a release, without enough time to properly test all the packages
that create Tcl bindings and ensure they build and work properly.

Here is the list of differences. First, here is what is installed
using the two-command 'make install-private-headers' method:

rml at rmlinux: ~/build > ls -l  /home/rml/tcl
total 16
drwxr-xr-x 2 rml install 4096 Apr 28 16:23 bin
drwxr-xr-x 2 rml install 4096 Apr 28 16:26 include
drwxr-xr-x 3 rml install 4096 Apr 28 16:23 lib
drwxr-xr-x 5 rml install 4096 Apr 28 16:23 man
rml at rmlinux: ~/build > find /home/rml/tcl/include
/home/rml/tcl/include
/home/rml/tcl/include/tcl.h
/home/rml/tcl/include/tclDecls.h
/home/rml/tcl/include/tclPlatDecls.h
/home/rml/tcl/include/tclInt.h
/home/rml/tcl/include/tclIntDecls.h
/home/rml/tcl/include/tclIntPlatDecls.h
/home/rml/tcl/include/tclUnixPort.h
/home/rml/tcl/include/tclMath.h
/home/rml/tcl/include/tclPort.h

Here is what gets installed using our existing four-command
method:

rml at rmlinux: ~/build > ls -C1 /usr/include/tcl*.h
/usr/include/tcl.h
/usr/include/tclDecls.h
/usr/include/tclPlatDecls.h
/usr/include/tcldbg.h

rml at rmlinux: ~/build > ls -C1 /usr/include/tcl8.4
generic
unix

rml at rmlinux: ~/build > ls -C1 /usr/include/tcl8.4/unix
tclUnixPort.h
tclUnixThrd.h

rml at rmlinux: ~/build > ls -C1 /usr/include/tcl8.4/generic
regcustom.h
regerrs.h
regex.h
regguts.h
tclCompile.h
tclIO.h
tclInitScript.h
tclInt.h
tclIntDecls.h
tclIntPlatDecls.h
tclMath.h
tclPort.h
tclRegexp.h


Now (you're at the end of the message finally) we need to compare
the difference in the *number* of files and the *location* of the
headers. Our existing instructions installs more headers and into
a different directory structure. The two-command method installs
less headers *all into /usr/include*.

I'm sure I can make a change to the sedding of tclConfig.sh so that
all the headers would be found if they are all in /usr/include. But
do the headers that are not installed matter?

Keep in mind, the 'make install-private-headers' method already
leaves out an important header which defines things for thread
support. Are any more being left out that are needed?

Let the discussion ensue.

P.S. I won't make any changes until at least Wednesday, so that folks
that don't do LFS on weekends will have a chance to contribute to
the discussion. That is, unless something definitive is determined
before then.

-- 
Randy

rmlscsi: [bogomips 1003.28] [GNU ld version 2.16.1] [gcc (GCC) 4.0.3]
[GNU C Library stable release version 2.3.6] [Linux 2.6.14.3 i686]
16:34:00 up 34 days, 4:11, 1 user, load average: 0.00, 0.00, 0.00



More information about the blfs-dev mailing list