上次我們提到了在Mac下安裝gcc,今天來安裝一個經常在命令行下使用的工具Wget。
Wget是一個支持HTTP、FTP的下載工具,經過合理的配置參數,我們甚至可以將一個網站的內容全部拷貝下來。
筆者的系統是Mac OS Lion 10.7.4 ,安裝好了gcc,如果沒有安裝gcc的同學,需要下載Xcode,然后通過下載命令行工具來進行安裝。
下載Wget的源代碼:下載地址
直接安裝的話,會發生下面的錯誤。
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 is not available.
username@host:~/wget-1.13.4 $
在zioer的站中也給出了一個解決方法,但這里我找到了一個更好的辦法。
# tar zxvf wget-1.13.4.tar.gz # cd wget-1.13.4 wget-1.13.4 root# ./configure --with-ssl=openssl wget-1.13.4 root# make wget-1.13.4 root# make install
注意,你如果不是使用root用戶,那么在安裝的這一步需要使用sudo授權。
參考資料:
1、MAC OS安裝Wget
2、Install Wget On OS X Lion
3、Discussion about the Nettle crypto library ()
