eval "$(/opt/homebrew/bin/brew shellenv)"
export PATH="/opt/homebrew/opt/texinfo/bin:$PATH"
export PKG_CONFIG_PATH="/opt/homebrew/lib/pkgconfig:/opt/homebrew/share/pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}"
export CPPFLAGS="-I/opt/homebrew/include -I$(brew --prefix libgccjit)/include${CPPFLAGS:+ $CPPFLAGS}"
export LDFLAGS="-L/opt/homebrew/lib -L$(brew --prefix gcc)/lib/gcc/current -L$(brew --prefix libgccjit)/lib/gcc/current${LDFLAGS:+ $LDFLAGS}"
./autogen.sh
./configure --with-tree-sitter=yes --with-native-compilation=yes
# make -C lisp autoloads-force
# need to remove old *.elc files from lisp/ if using _dirty_ git directory
make -j$(sysctl -n hw.ncpu)
make install
mv nextstep/Emacs.app ~/Applications/
https://www.emacswiki.org/emacs/EmacsForMacOS#toc23