Tk Source Code

View Ticket
Login
2026-10-07
11:20 • Closed ticket [b900dc75]: Compilation using installed TCL fails if TCL source is not accessible plus 8 other changes artifact: 8030b95f user: jan.nijtmans
2026-10-05
14:27
Fix [b900dc7552] for MinGW: compilation using installed Tcl fails if Tcl source is not accessible check-in: 0f27f721 user: jan.nijtmans tags: core-9-0-branch
14:08
Fix [b900dc7552] for MinGW: compilation using installed Tcl fails if Tcl source is not accessible check-in: d80a5f1b user: jan.nijtmans tags: trunk, main
07:39 • Ticket [b900dc75] Compilation using installed TCL fails if TCL source is not accessible status still Open with 3 other changes artifact: fcfd8bb0 user: serhiy.storchaka
07:35 • Ticket [b900dc75]: 3 changes artifact: c954801c user: serhiy.storchaka
07:35
Fix [b900dc7552]: compilation using installed Tcl fails if Tcl source is not accessible. check-in: 6b825fa5 user: serhiy.storchaka tags: core-8-6-branch
2026-10-04
21:29
Fix [b900dc7552]: compilation using installed Tcl fails if Tcl source is not accessible. check-in: c0549801 user: jan.nijtmans tags: core-9-0-branch
21:18
Fix [b900dc7552]: compilation using installed Tcl fails if Tcl source is not accessible. check-in: 2e03afb4 user: jan.nijtmans tags: trunk, main
2026-10-02
19:34 • Ticket [b900dc75] Compilation using installed TCL fails if TCL source is not accessible status still Open with 4 other changes artifact: 1cdd3103 user: serhiy.storchaka
19:33
Fix [b900dc7552] for MinGW: compilation using installed Tcl fails if Tcl source is not accessible.

As in the Unix build, configure uses the installed Tcl headers (TCL_INCLUDE_SPEC) for the compiler and the resource compiler if the Tcl source tree is not readable. tkWinIco.c no longer includes the private header tclWinPort.h, which is not installed. closed check-in: 885bd229 user: serhiy.storchaka tags: win-tcl-installed-headers

19:33
Fix [b900dc7552]: compilation using installed Tcl fails if Tcl source is not accessible.

The Unix build always added the -I options for the Tcl source tree recorded in tclConfig.sh (TCL_SRC_DIR), and never used TCL_INCLUDE_SPEC. Now configure uses the installed Tcl headers if the Tcl source tree is not readable. closed check-in: ac6f167d user: serhiy.storchaka tags: unix-tcl-installed-headers

2025-10-29
13:29 • New ticket [b900dc75] Compilation using installed TCL fails if TCL source is not accessible. artifact: 0e18a30b user: anonymous

Ticket UUID: b900dc755201139b5a7cecada73405c7681b7c03
Title: Compilation using installed TCL fails if TCL source is not accessible
Type: Bug Version: 8.6.18, 9.0.5, 9.1.0
Submitter: anonymous Created on: 2025-10-29 13:29:10
Subsystem: 84. Unix Build Assigned To: jan.nijtmans
Priority: 5 Medium Severity: Important
Status: Closed Last Modified: 2026-10-07 11:20:03
Resolution: Fixed Closed By: jan.nijtmans
    Closed on: 2026-10-07 11:20:03
Description:

We are installing TCL and TK on a HPC cluster using Lmod environtment modules. Usually different software might get installed by different admin accounts.

This now happend to be the case where person A installed TCL and person B tried to install TK on top:

$ ./configure --with-tcl=$EBROOTTCL/lib

However the installed tclConfig.sh contains multiple references to the original build environment in TCL_BUILD_* variables and TCL_SRC_DIR pointing to the original source location. In this case inside a folder only accessible to person A.

The Tk configure process uses TCL_SRC_DIR and adds various -I flags based on that which causes the build to fail as the compiler can't access that path.

I can't find any hint that the TCL sources are required for building against an installed TCL. The option description is:

--with-tcl=DIR		Specifies the directory containing the Tcl
			binaries and Tcl's platform-dependent
			configuration information.

Strangely enough compilation succeeds when the folder does not exist or is empty. Probably because the include folder of the Tcl installation is found and used by the compiler which contains the required headers.

Why is TCL_SRC_DIR used? Shouldn't that be at least documented?
Wouldn't $TCL_PREFIX/include suffice as the used include path?

User Comments: jan.nijtmans added on 2026-10-07 11:20:03:

The [d80a5f1b14ca4b01|MinGW part] is merged now too.

Thanks!

Closing


serhiy.storchaka added on 2026-10-05 07:39:14:

The Unix part was merged into main in [2e03afb4d0] and 9.0 in [c0549801a3]. The MinGW part in win-tcl-installed-headers is not merged yet.


serhiy.storchaka added on 2026-10-05 07:35:25:

Backported to 8.6 in [6b825fa561].


serhiy.storchaka added on 2026-10-02 19:34:40:

TCL_SRC_DIR is used because Tk normally builds against the Tcl source tree, and it never used TCL_INCLUDE_SPEC. Tk needs only the public Tcl headers.

Proposed fixes in branches unix-tcl-installed-headers and win-tcl-installed-headers (MinGW): configure uses the installed Tcl headers if the Tcl source tree is not readable. The MSVC build (makefile.vc) still requires the Tcl sources.