Cannot install Python from source on Apple Silicon M1

I am trying to install Python from source according to the readme using:

./configure
make <-- Error happens here
make test
sudo make altinstall

However, I cannot complete the make command since it fails with:

Undefined symbols for architecture arm64:
  "_libintl_bindtextdomain", referenced from:
      __locale_bindtextdomain in _localemodule.o
  "_libintl_dcgettext", referenced from:
      __locale_dcgettext in _localemodule.o
  "_libintl_dgettext", referenced from:
      __locale_dgettext in _localemodule.o
  "_libintl_gettext", referenced from:
      __locale_gettext in _localemodule.o
  "_libintl_setlocale", referenced from:
      __locale_setlocale in _localemodule.o
      __locale_localeconv in _localemodule.o
  "_libintl_textdomain", referenced from:
      __locale_textdomain in _localemodule.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [Programs/_freeze_module] Error 1

Looks like make is somehow using the wrong architecture. I just don't know why. Does anyone have an idea?

I stumbled across this bug report: https://bugs.python.org/issue46975

I have indeed brew x86_64 (and arm64) installed and it seems that this somehow interferes. make --version generates this output:

GNU Make 3.81 Copyright (C) 2006 Free Software Foundation, Inc. ... This program built for i386-apple-darwin11.3.0

shouldn't it be arm64-apple-darwin11.3.0? And is there a way to just use the make from macOS and ignore all the other stuff from brew?

It seems that make (which is the correct make) uses the gettext library from brew. I could uninstall this, but a lot of other packages depend on it. Is there a way to make make ignore this library?

Cannot install Python from source on Apple Silicon M1
 
 
Q