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. 驗證
這裏寫圖片描述git

版權聲明:本文爲博主原創文章,未經博主容許不得轉載。github

相關文章
相關標籤/搜索