(Mac OS) Varnish 安装日志

By: Roban lee ([email protected])



最近公司在弄varnish,下午在LINUX下用源码安装的时候也碰到了一个问题就是PKG_CONFIG_PATH环境变量的问题,最后BAIDU了一下之后用

export PKG_CONFIG_PATH =/usr/local/lib/pkg_config_path


搞定。

 

然后MAC  OS 下有点小问题

第一次 export之后通过 终端  EXPORT 发现没有倒进

结果多看了几次之后发现实际上已经导入了, 只是变量不对:

declare -x PATH="/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin"
declare -x PKG_CONFIG="/usr/local/lib/pkgconfig"
declare -x PWD="/usr/local/installed_source_files/varnish-3.0.3"
declare -x SHELL="/bin/bash"
declare -x SHLVL="1"

这里导入的是PKG_CONFIG 而不是PKG_CONFIG_PATH

接着CONFIGURE 报错:

checking for library containing pthread_create... none required
checking for socket in -lsocket... no
checking for getaddrinfo in -lnsl... no
checking pkg-config is at least version 0.9.0... ./configure: line 13952: /usr/local/lib/pkgconfig: is a directory
no
checking for PCRE... no
configure: error: in `/usr/local/installed_source_files/varnish-3.0.3':
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 PCRE_CFLAGS
and PCRE_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/>.

 

结论是MAC OS没有安装PKG-CONFIG,于是

http://www.linuxfromscratch.org/blfs/view/6.3/general/pkgconfig.html 下载最新源码

 安装

 

安装完成后

export PKG_CONFIG=/usr/local/bin/pkg-config

注意是 PKG_CONFIG 而不是LINUX下的PKG_CONFIG_PATH

接着安装, 一切搞定!


^ ^ Roban Lee

你可能感兴趣的:(varnish,varnish,出错,macos,varnish安装)