Currently some errors are happening when we try to compile/install erlang on mac OS Catalina with any method. Looking for the solution on the web, I found a way that finally worked for me.
Let's install some mandatory dependencies.
brew install autoconf wxmac openssl
I recommend to install other packages too.
brew install autoconf wxmac openssl fop coreutils automake libyaml readline libxslt libtool unixodbc unzip curl
Once installed these packages, we need to set two environment variables before to install asdf.
export CFLAGS="-O2 -g -fno-stack-check"
export KERL_CONFIGURE_OPTIONS="--disable-hipe --with-ssl=$(brew --prefix openssl)"
If you haven't installed Java (or you don't want to install it), then set the second variable like this:
export KERL_CONFIGURE_OPTIONS="--disable-hipe --without-javac --with-ssl=$(brew --prefix openssl)"
Now you can install the erlang version you need. In my case, I was needing to install the specific version
asdf install erlang 126.96.36.199
I hope this method also work for you 😉.
I found the solution to my problem in this comment.