Linux平台下的watchman源码编译

参考英文:https://facebook.github.io/watchman/docs/install.html

0、准备工作

      (1)确定gcc版本

[root@master ~]# gcc --version
gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-17)

        如果gcc版本低于4.8,需要升级,参考http://blog.csdn.net/chengyuqiang/article/details/53868915

       (2)python

        [root@master ~]# yum install -y python-devel

1、下载源码

        git clone https://github.com/facebook/watchman.git

        最近国外网络很慢,可以通过迅雷等下载工具下载

        打开 https://github.com/facebook/watchman,单击“download”

2、安装编译工具

       [root@master ~]# yum install -y automake

       [root@master watchman-master]# yum install -y gcc gcc-c++

3、编译源码

      (1)解压缩

        [root@master ~]# unzip watchman-master.zip

      (2)进入watchman根目录
        [root@master ~]# cd watchman-master
        [root@master watchman-master]#

      (3)执行脚本

        [root@master watchman-master]# ./autogen.sh

configure.ac:29: installing `./compile'
configure.ac:2: installing `./config.guess'
configure.ac:2: installing `./config.sub'
configure.ac:3: installing `./install-sh'
configure.ac:3: installing `./missing'
Makefile.am: installing `./depcomp'

     (4)[root@master watchman-master]# ./configure

       Your build configuration:
        CC = gcc
        CPPFLAGS =  -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
        CFLAGS = -g -O2 -Wall -Wextra -Wdeclaration-after-statement -g -gdwarf-2 -fno-omit-frame-pointer
        CXX = g++ -std=c++11
        CXXFLAGS = -g -O2 -Wall -Wextra -g -gdwarf-2 -fno-omit-frame-pointer
        LDFLAGS = 
        prefix: /usr/local
        version: 4.8.0
        state directory: /usr/local/var/run/watchman

       (5)[root@master watchman-master]# make

   gcc -pthread -shared build/temp.linux-x86_64-2.6/pywatchman/bser.o -L/usr/lib64 -lpython2.6 -o /root/watchman-master/python/pywatchman/bser.so
   make[1]: Leaving directory `/root/watchman-master'

        (6)make install

           [root@master watchman-master]# make install

           /usr/bin/install -c -d -m 777 //usr/local/var/run/watchman
           chmod g+s //usr/local/var/run/watchman
           touch //usr/local/var/run/watchman/.not-empty
           test -z "/usr/local/share/doc/watchman-4.8.0" || /bin/mkdir -p "//usr/local/share/doc/watchman-4.8.0"
           /usr/bin/install -c -m 644 README.markdown '//usr/local/share/doc/watchman-4.8.0'
           make[1]: Leaving directory `/root/watchman-master'
















  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值