Skip to content

Commit b36d222

Browse files
author
Erlend Egeberg Aasland
authored
bpo-45847: Port _tkinter to PY_STDLIB_MOD (GH-31698)
- Remove ``--with-tclk-*`` options from `configure` - Use pkg-config to detect `_tkinter` dependencies (Tcl/Tk, X11) - Manual override via environment variables `TCLTK_CFLAGS` and `TCLTK_LIBS`
1 parent 7fc39a2 commit b36d222

File tree

10 files changed

+402
-517
lines changed

10 files changed

+402
-517
lines changed

Doc/using/configure.rst

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -404,14 +404,6 @@ Libraries options
404404

405405
.. versionadded:: 3.10
406406

407-
.. cmdoption:: --with-tcltk-includes='-I...'
408-
409-
Override search for Tcl and Tk include files.
410-
411-
.. cmdoption:: --with-tcltk-libs='-L...'
412-
413-
Override search for Tcl and Tk libraries.
414-
415407
.. cmdoption:: --with-libm=STRING
416408

417409
Override ``libm`` math library to *STRING* (default is system-dependent).

Doc/whatsnew/3.10.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2019,8 +2019,8 @@ Build Changes
20192019
20202020
* The ``configure`` script now uses the ``pkg-config`` utility, if available,
20212021
to detect the location of Tcl/Tk headers and libraries. As before, those
2022-
locations can be explicitly specified with the :option:`--with-tcltk-includes`
2023-
and :option:`--with-tcltk-libs` configuration options.
2022+
locations can be explicitly specified with the ``--with-tcltk-includes``
2023+
and ``--with-tcltk-libs`` configuration options.
20242024
(Contributed by Manolis Stamatogiannakis in :issue:`42603`.)
20252025
20262026
* Add :option:`--with-openssl-rpath` option to ``configure`` script. The option

Doc/whatsnew/3.11.rst

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -770,11 +770,17 @@ Build Changes
770770

771771
* Build dependencies, compiler flags, and linker flags for most stdlib
772772
extension modules are now detected by :program:`configure`. libffi, libnsl,
773-
libsqlite3, zlib, bzip2, liblzma, libcrypt, and uuid flags are detected by
774-
``pkg-config`` (when available).
773+
libsqlite3, zlib, bzip2, liblzma, libcrypt, Tcl/Tk libs, and uuid flags
774+
are detected by ``pkg-config`` (when available).
775775
(Contributed by Christian Heimes and Erlend Egeberg Aasland in
776776
:issue:`bpo-45847`, :issue:`45747`, and :issue:`45763`.)
777777

778+
.. note::
779+
Use the environment variables ``TCLTK_CFLAGS`` and ``TCLTK_LIBS`` to
780+
manually specify the location of Tcl/Tk headers and libraries.
781+
The :program:`configure` options ``--with-tcltk-includes`` and
782+
``--with-tcltk-libs`` have been removed.
783+
778784
* CPython now has experimental support for cross compiling to WebAssembly
779785
platform ``wasm32-emscripten``. The effort is inspired by previous work
780786
like Pyodide.

Doc/whatsnew/3.9.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1249,7 +1249,7 @@ Build Changes
12491249
of macOS. If a macOS SDK is explicitly configured, by using
12501250
:option:`--enable-universalsdk` or ``-isysroot``, only the SDK itself is
12511251
searched. The default behavior can still be overridden with
1252-
:option:`--with-tcltk-includes` and :option:`--with-tcltk-libs`.
1252+
``--with-tcltk-includes`` and ``--with-tcltk-libs``.
12531253
(Contributed by Ned Deily in :issue:`34956`.)
12541254

12551255
* Python can now be built for Windows 10 ARM64.

Makefile.pre.in

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -302,10 +302,6 @@ _PYTHON_HOST_PLATFORM=@_PYTHON_HOST_PLATFORM@
302302
BUILD_GNU_TYPE= @build@
303303
HOST_GNU_TYPE= @host@
304304

305-
# Tcl and Tk config info from --with-tcltk-includes and -libs options
306-
TCLTK_INCLUDES= @TCLTK_INCLUDES@
307-
TCLTK_LIBS= @TCLTK_LIBS@
308-
309305
# The task to run while instrumented when building the profile-opt target.
310306
# To speed up profile generation, we don't run the full unit test suite
311307
# by default. The default is "-m test --pgo". To run more tests, use
@@ -736,10 +732,8 @@ sharedmods: $(BUILDPYTHON) pybuilddir.txt @LIBMPDEC_INTERNAL@ @LIBEXPAT_INTERNAL
736732
*) quiet="";; \
737733
esac; \
738734
echo "$(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \
739-
_TCLTK_INCLUDES='$(TCLTK_INCLUDES)' _TCLTK_LIBS='$(TCLTK_LIBS)' \
740735
$(PYTHON_FOR_BUILD) $(srcdir)/setup.py $$quiet build"; \
741736
$(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \
742-
_TCLTK_INCLUDES='$(TCLTK_INCLUDES)' _TCLTK_LIBS='$(TCLTK_LIBS)' \
743737
$(PYTHON_FOR_BUILD) $(srcdir)/setup.py $$quiet build
744738

745739

Modules/Setup.stdlib.in

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,12 +150,11 @@
150150
# needs -lcrypt
151151
@MODULE__HASHLIB_TRUE@_hashlib _hashopenssl.c
152152

153-
# needs -ltk, -ltcl, and sometimes -lX11
154-
#@MODULE__TKINTER_TRUE@_tkinter _tkinter.c tkappinit.c
155-
156153
# Linux: -luuid, BSD/AIX: libc's uuid_create()
157154
@MODULE__UUID_TRUE@_uuid _uuidmodule.c
158155

156+
@MODULE__TKINTER_TRUE@_tkinter _tkinter.c tkappinit.c
157+
159158
############################################################################
160159
# macOS specific modules
161160

0 commit comments

Comments
 (0)