On Dec 7, 2023, at 17:18, Matthew Dixon Cowles <m...@mondoinfo.com> wrote:
> I'm trying to compile Python 3.12.0 from source on a new ARM MacBook.
> I haven't had any trouble except with the tkinter module. I've built
> Python from source any number of times before on Linux and macOS, but
> previously always with X11. (For the moment, I'm just doing an
> ordinary Unix build, not a Framework build.) [...]

The process for specifying third-party libs for Python builds changed greatly 
for Python 3.11 and improved a bit in 3.12. It is now much simpler and more 
consistent.

It's pretty much automatic if you have a version of `pkg-config` installed and 
use third-party libraries that install .pc files (most do these days). Apple 
does not ship a version of pkg-config but third-party distributors like 
Homebrew and MacPorts have it (as well as pre-built versions of all other 
needed libraries, including Tk).  It's also easy to build a non-GPL version 
(try https://github.com/pkgconf/pkgconf). In any case you may need to set the 
PKG_CONFIG_PATH env variable to point to the .pc files for your Tcl and Tk. 
There are some potentially useful examples of using Homebrew and MacPorts in 
the Python Developers Guide: 
https://devguide.python.org/getting-started/setup-building/#install-dependencies

But otherwise, rather than modifying the Makefile, use the new ./configure 
options provided to override defaults for the various third-party libraries:

$ ./configure --help

`configure' configures python 3.12 to adapt to many kinds of systems.

Usage: ./configure [OPTION]... [VAR=VALUE]...

To assign environment variables (e.g., CC, CFLAGS...), specify them as
VAR=VALUE.  See below for descriptions of some of the useful variables.

Defaults for the options are specified in brackets.
[...]
  TCLTK_CFLAGS
              C compiler flags for TCLTK, overriding pkg-config
  TCLTK_LIBS  linker flags for TCLTK, overriding pkg-config

--
  Ned Deily
  n...@python.org -- []

_______________________________________________
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
https://mail.python.org/mailman/listinfo/pythonmac-sig
unsubscribe: https://mail.python.org/mailman/options/Pythonmac-SIG

Reply via email to