The original is here https://thomashunter.name/blog/install-wget-on-os-x-lion/
Install wget on OS X Lion
2011/11/05
A pre-requisite for the "to" is, and the second disc of utilities that came with your Mac installed. This disc would provide a bunch of utilities required to compile code. Alternatively, you can Install Xcode from the App Store (it's free!) and you'll get all of the same utilities.
Update:installing Xcode is no longer good enough. You'll now need-open Xcode, go to preferences (CMD +,), go-to-Downloads, and install the Command line Tools feature. This installs a bunch of development tools onto your system.
Run the following commands in a terminal window to compile wget on OS X Lion:
Curl-o http://ftp.gnu.org/gnu/wget/wget-1.13.4.tar.gz
TAR-XZVF wget-1.13.4.tar.gz
CD wget-1.13.4
./configure--with-ssl=openssl
Make
sudo make install
Which wget #Should output:/usr/local/bin/wget
Note the WITH-SSL=OPENSSL option in the command above. If you omit this, you'll get the following error:
...
Checking for compress In-lz ... yes
Checking for Gpg_err_init in-lgpg-error ... no
Checking for Gcry_control in-lgcrypt ... no
Checking for libgnutls ... no
Configure:error:--with-ssl was given, but GnuTLS are not available.
username@host:~/wget-1.13.4 $
The reason for this was that GnuTLS not included with Mac OS X, but the equally usable library OpenSSL is available.