Tcl Source Code

View Ticket
Login
2026-10-27
14:44 • Closed ticket [17ffc49790]: Building Tcl 9.0.2 release fails when using "co... artifact: dec09a84d0 user: jan.nijtmans
13:25
Fix [ac3ea87305] and [17ffc49790]. New option --with-system-zlib and fix out-of-tree build with "con... check-in: 0890c290ed user: jan.nijtmans tags: core-8-6-branch
12:15
Fix [17ffc49790]: Make packages work in an out-of-tree build with "configure --srcdir=..." check-in: 2e8ab95738 user: jan.nijtmans tags: core-9-0-branch
09:45
Fix [17ffc49790]: Make packages work in an out-of-tree build with "configure --srcdir=..." check-in: 9ac77da0c6 user: jan.nijtmans tags: trunk, main
2026-10-20
11:56 • Ticket [17ffc49790] Building Tcl 9.0.2 release fails when using "configure ... artifact: 62eed7018c user: serhiy.storchaka
11:54
Fix [17ffc49790]: an out-of-tree build with "configure --srcdir=..." failed to configure the bundled... closed check-in: 0e472d58ee user: serhiy.storchaka tags: configure-pkgs-no-srcdir
2025-10-09
20:31 • Ticket [17ffc49790] Building Tcl 9.0.2 release fails when using "configure ... artifact: 4dfd0bebcf user: griffin
2025-09-27
02:15 • Ticket [17ffc49790]: 3 changes artifact: 409cdb5f43 user: apnadkarni
01:24 • Ticket [17ffc49790]: 3 changes artifact: bb4e633c4e user: griffin
2025-09-26
12:14 • Ticket [17ffc49790]: 3 changes artifact: 3365abc7db user: jan.nijtmans
2025-09-25
21:03 • Add attachment sdmakelog.tgz to ticket [17ffc49790] artifact: 6f80a813f2 user: griffin
21:02 • New ticket [17ffc49790] . artifact: 3f295cb817 user: griffin

Ticket UUID: 17ffc49790fadbc4f515aa0b01f123e75f9fad26
Title: Building Tcl 9.0.2 release fails when using "configure --srcdir=<path> ..."
Type: Bug Created on: 2025-09-25 21:02:03
Submitter: griffin Assigned to: jan.nijtmans
Subsystem: 53. Configuration and Build Tools Severity: Important
Priority: 5 Medium Last modified: 2026-10-27 14:44:39
Status: Closed Closed by: jan.nijtmans
Resolution: Fixed Closed on: 2026-10-27 14:44:39
Version: 9.1.0
Description:
Building Tcl 9.0.2 release, complete with pkg complement, fails to build packages when using: 
    "configure --srdir=<path> ..."

The configure srcdir value is not propagated to the pkgs components.

To reproduce:
  tar xzf tcl9.0.2-src.tar.gz
  mkdir empty
  cd empty

  ../tcl9.0.2/unix/configuration --srcdir=../tcl9.0.2 --prefix=../foobar

  make install
.
. (long transcript)
.
checking whether byte ordering is bigendian... no
configure: error: could not find source file 'itcl2TclOO.c'
make: *** [Makefile:2048: configure-packages] Error 1
User Comments:
jan.nijtmans added on 2025-09-26 12:14:36:

I think srcdir should always be an absolute path. That should be documented somewhere (if it isn't yet)


griffin added on 2025-09-27 01:24:16:
Good point Jan, but I don't believe that is the problem.

The problem appears to be in Tcl. The Makefile target configure-packages has a literal relative path:

... configure ... --with-tcl=../..  ...

When replaced with an absolute path, the problem is resolved.
This code is in the Makefile.in file, so nothing passed in to configure is going to change it.

It would be good if someone more familiar with this area could fashion a fix, or supply considerations for fashioning a fix.

 can I add [file normalize ../..] here?  :)

apnadkarni added on 2025-09-27 02:15:06:

Just to note, there is a comment just above as to why absolute paths are not used.

# If PKG_DIR is changed to a different relative depth to the build dir, need
# to adapt the ../.. relative paths below and at the top of configure.ac (we
# cannot use absolute paths due to issues in nested configure when path to
# build dir contains spaces).

griffin added on 2025-10-09 20:31:00:
In this scenario, the source directory is not the same as the build directory. That is the purpose of --srcdir.

I believe --srcdir= needs to be an absolute path.
It's not clear to me what --with-tcl needs to be.
One problem is that --srcdir is not passed down to the pkgs' configure. The pkgs need this too.

Isn't --with-tcl redundant or conflicting with --src-dir?

serhiy.storchaka added on 2026-10-20 11:56:31:

Reproduced with an out-of-tree build of the current main with Thread and Itcl in pkgs/: .../unix/configure --srcdir=.../unix, then make fails in configure-packages with "cannot find sources () in .../unix". The relative --with-tcl=../.. is not the problem: Tcl passes its own --srcdir on to each package's configure (in PKG_CFG_ARGS), so the package looks for its sources in Tcl's unix directory. The packages do not need it, since their configure scripts are run by absolute path.

Proposed fix in branch configure-pkgs-no-srcdir: do not pass --srcdir to the packages, in unix/configure.ac and also in win/configure.ac, which had the same problem (there the package configure failed silently). With it, out-of-tree builds with a relative or absolute --srcdir, or without it, build Thread and Itcl, and make install installs them; also checked with a MinGW cross build.

Note that --srcdir must point to the unix (or win) directory, not to the top of the source tree as in the original report.


jan.nijtmans added on 2026-10-27 14:44:39:

Fixed in [9ac77da0c6|trunk], core-9-0-branch and core-8-6-branch

Many thanks!


Attachments: