Building haxe on mac m1

I’m not sure why, but it did not worked out with x86_64 brew.
But I’ve finally managed to build arm64 version, which is fine for me. That’s what has worked for me:

brew install zlib
brew install pcre
brew install mbedtls@2
brew unlink mbedtls
brew link mbedtls@2
export CPATH="/opt/homebrew/include:/opt/homebrew/opt/zlib/include:$CPATH"
make STATICLINK=1 "LIB_PARAMS=/opt/homebrew/opt/zlib/lib/libz.a /opt/homebrew/lib/libpcre.a /opt/homebrew/lib/libmbedtls.a /opt/homebrew/lib/libmbedcrypto.a /opt/homebrew/lib/libmbedx509.a -cclib '-framework Security -framework CoreFoundation'"