[原创]macOS安装wget

mac用了一年多,今天使用wget命令,竟然提示命令不存在。只好下载源码进行安装了。
安装过程有点曲折:

  • 编译wget时,提示pkg-config不存在
  • 第一次从git上下载了pkg-config的源码,虽然注意到文件名为pkg-config-pkg-config-0.29.2.tar.gz,而非release文件,又下载了一个老版本的release后,终于找到configure文件,才知道自己下载错了。
  • 编译安装pkg-config时,使用make && make install 竟然提示没有权限。只要按照网上的安装命令一步步来。

话不多说,直接上安装命令

pkg-config

下载地址:
详见我的另外一篇博客:《软件开发资源下载》中的【MacOS】-【pkg-config】
安装命令:

./configure --with-internal-glib
make
make check
make install

直接使用./configure会提示如下错误:

checking malloc.h usability... no
checking malloc.h presence... no
checking for malloc.h... no
checking for bash... /bin/bash
checking for default search path for .pc files... ${libdir}/pkgconfig:${datadir}/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig
checking for system include path to avoid -I flags... /usr/include
checking for system library path to avoid -L flags... /usr/lib:/lib
configure: creating ./config.lt
config.lt: creating libtool
checking whether to list both direct and indirect dependencies... no
checking for Win32... no
checking if prefix should be redefined at runtime... no
checking if internal glib should be used... no
checking for pkg-config... no
checking for glib-2.0 >= 2.16... no
configure: error: Either a previously installed pkg-config or "glib-2.0 >= 2.16" could not be found. Please set GLIB_CFLAGS and GLIB_LIBS to the correct values or pass --with-internal-glib to configure to use the bundled copy.

wget

下载地址:
详见我的另外一篇博客:《软件开发资源下载》中的【MacOS】-【wget】
安装命令:

./configure
make && make install

不安装pkg-config,直接编译wget时,会提示:

configure: error: in `/Users/candy/Downloads/wget-1.20':
configure: error: The pkg-config script could not be found or is too old.  Make sure it
is in your PATH or set the PKG_CONFIG environment variable to the full
path to pkg-config.

Alternatively, you may set the environment variables GNUTLS_CFLAGS
and GNUTLS_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.

To get pkg-config, see <http://pkg-config.freedesktop.org/>.
See `config.log' for more details

猜你喜欢

转载自www.cnblogs.com/Candies/p/10125138.html
今日推荐