Tk Source Code

View Ticket
Login
Ticket UUID: 9087fae43f3ae496a4151ca15a9dd37d697d6f1e
Title: configure: X11 header check always fails because CPP is not set ("couldn't find any!")
Type: Bug Version: 9.0.4, 9.1b1
Submitter: serhiy.storchaka Created on: 2026-09-25 11:35:05
Subsystem: 84. Unix Build Assigned To: jan.nijtmans
Priority: 5 Medium Severity: Minor
Status: Closed Last Modified: 2026-09-25 13:05:48
Resolution: Fixed Closed By: jan.nijtmans
    Closed on: 2026-09-25 13:05:48
Description:

Since Tk 9.0 every Unix configure run prints

checking for X11 header files... couldn't find any!

although the X11 headers are installed and the build works. config.log shows

./configure: line 1818: conftest.c: command not found

SC_PATH_X checks for <X11/Xlib.h> with AC_PREPROC_IFELSE, but $CPP is empty. The only expansion of AC_PROG_CPP is inside if test $tk_ok = no; then (the fd_set check in unix/configure.ac, via AC_EGREP_HEADER), so it is skipped wherever fd_set is in <sys/types.h>. Before [b830ddb20c] removed the stdlib.h checks, they expanded it unconditionally earlier; 8.6 still has them and is not affected.

Consequences: the header check never succeeds when AC_PATH_X finds X in the default paths, and SC_PATH_X falls back to its directory list, adding -I for the first of those directories that contains X11/Xlib.h.

User Comments: jan.nijtmans added on 2026-09-25 13:05:48:

Fixed [bf45f48c4500fe1f|here] and in core-9-0-branch.

Dang... I noticed this already for a long time, but it didn't seem to hurt and I had no idea how to approach this. Many thanks!


serhiy.storchaka added on 2026-09-25 11:38:31:

Proposed fix in [78b2122ad8] (branch configure-prog-cpp): call AC_PROG_CPP right after AC_PROG_CC. With it CPP is set, the spurious message is gone, and XINCLUDES/XLIBSW are unchanged. 9.0 needs the same change.