macox下编译snappy静态库

  1. 源码地址:https://github.com/google/snappy
    下载 git clone https://github.com/google/snappy
  2. 编译
    • 进入snappy源码目录,执行命令: ./autogen.sh
      报错 “./autogen.sh: line 3: aclocal: command not found”
      通过http://superuser.com/questions/657925/cygwin-rtorrent-installing-libtorrent-autogen-sh-aclocal-not-found这篇文章得知,系统没有安装automake,
      执行命令: breaw install automake
      报错“-bash: brew: command not found”
      安装 brew
      执行 命令:ruby -e "$(curl -f sSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
      这里写图片描述
      然后 安装 automake,执行命令: brew install automake
      执行命令:./autogen.sh
      报错:“./autogen.sh: line 5: libtoolize: command not found”
      安装 libtool,执行命令:brew install libtool
      继续执行命令:./autogen.sh
      报错“./autogen.sh: line 5: libtoolize: command not found”
      通过这篇文章:http://stackoverflow.com/questions/15448582/installed-libtool-but-libtoolize-not-found
      我是在修改./autogen.sh 把第五行改成 glibtoolize --copy
      网上也有这样改得(我没试):
case `uname` in Darwin*) glibtoolize --copy ;;
  *) libtoolize --copy ;; esac 

执行命令:./autogen.sh
报错:“configure.ac:42: error: possibly undefined macro: AC_DEFINE
If this token and others are legitimate, please use m4_pattern_allow.
See the Autoconf documentation.
configure.ac:44: error: possibly undefined macro: AC_MSG_FAILURE”
通过这篇文章http://stackoverflow.com/questions/8811381/possibly-undefined-macro-ac-msg-error
我安装了pkgconfig,执行命令:brew install pkgconfig
报错“rm: autom4te.cache/output.0: Permission denied
rm: autom4te.cache/output.1: Permission denied
rm: autom4te.cache/requests: Permission denied
rm: autom4te.cache/traces.0: Permission denied
rm: autom4te.cache/traces.1: Permission denied
rm: autom4te.cache: Directory not empty

改成sudo ,执行命令:sudo ./autogen.sh
- 执行configure ,执行命令:./configure
- 执行make,执行命令:make
- 执行make install,执行命令:make install
3. 验证
这里写图片描述

你可能感兴趣的:(源码,Install,Make,snappy,库)