一键安装thrift-0.9.0的脚本
来源:互联网 发布:人声节拍器软件 编辑:程序博客网 时间:2024/06/08 19:48
#!/bin/sh
# 一键安装thrift-0.9.0的脚本
# thrift依赖boost、openssl和libevent
# 下面的变量值可以根据实现做修改
boost=boost_1_52_0
openssl=openssl-1.0.1c
libevent=libevent-2.0.19-stable
thrift=thrift-0.9.0
#
# 安装boost
#
printf "\n\033[0;32;34minstalling boost\033[m\n"
tar xzf $boost.tar.gz
cd $boost
./bootstrap.sh
if test $? -ne 0; then
exit 1
fi
./b2 install --prefix=$THIRD_PARTY_HOME/boost
printf "\n\033[0;32;34m./b2 install return $?\033[m\n"
cd -
#
# 安装openssl
#
printf "\n\033[0;32;34minstalling openssl\033[m\n"
tar xzf $openssl.tar.gz
cd $openssl
./config --prefix=$THIRD_PARTY_HOME/openssl shared threads
if test $? -ne 0; then
exit 1
fi
make
if test $? -ne 0; then
exit 1
fi
make install
cd -
#
# 安装libevent
#
printf "\n\033[0;32;34minstalling libevent\033[m\n"
tar xzf $libevent.tar.gz
cd $libevent
./configure --prefix=$THIRD_PARTY_HOME/libevent
if test $? -ne 0; then
exit 1
fi
make
if test $? -ne 0; then
exit 1
fi
make install
cd -
#
# 安装thrift
#
printf "\n\033[0;32;34minstalling thrift\033[m\n"
tar xzf $thrift.tar.gz
cd $thrift
# 按照常规的configure,使用--with-openssl,会遇到
# “Error: libcrypto required.”错误,这里使用CPPFLAGS和LDFLAGS替代
./configure --prefix=$THIRD_PARTY_HOME/thrift \
--with-boost=$THIRD_PARTY_HOME/boost \
--with-libevent=$THIRD_PARTY_HOME/libevent \
CPPFLAGS="-I$THIRD_PARTY_HOME/openssl/include" \
LDFLAGS="-ldl -L$THIRD_PARTY_HOME/openssl/lib" \
--with-qt4=no --with-c_glib=no --with-csharp=no \
--with-java=no --with-erlang=no --with-python=no \
--with-perl=no --with-ruby=no --with-haskell=no \
--with-go=no --with-d=no
if test $? -ne 0; then
exit 1
fi
# 完成上述修改后,configure可以成功了,但还需要下面修改,
# 否则make时会报malloc未声明
sed -i -e 's!#define HAVE_MALLOC 0!#define HAVE_MALLOC 1!' config.h
sed -i -e 's!#define HAVE_REALLOC 0!#define HAVE_REALLOC 1!' config.h
sed -i -e 's!#define malloc rpl_malloc!/*#define malloc rpl_malloc*/!' config.h
sed -i -e 's!#define realloc rpl_realloc!/*#define realloc rpl_realloc*/!' config.h
make
if test $? -ne 0; then
exit 1
fi
make install
cd -
# 安装成功提示一下
printf "\n\033[0;32;34minstall SUCCESS\033[m\n"
# 一键安装thrift-0.9.0的脚本
# thrift依赖boost、openssl和libevent
# 下面的变量值可以根据实现做修改
PROJECT_HOME=$HOME/iflow # 项目源码主目录
# thrift及依赖的第三方库源码包存放目录和安装目录,
# 一键脚本要和第三方库源码包放在同一个目录下
boost=boost_1_52_0
openssl=openssl-1.0.1c
libevent=libevent-2.0.19-stable
thrift=thrift-0.9.0
#
# 安装boost
#
printf "\n\033[0;32;34minstalling boost\033[m\n"
tar xzf $boost.tar.gz
cd $boost
./bootstrap.sh
if test $? -ne 0; then
exit 1
fi
./b2 install --prefix=$THIRD_PARTY_HOME/boost
printf "\n\033[0;32;34m./b2 install return $?\033[m\n"
cd -
#
# 安装openssl
#
printf "\n\033[0;32;34minstalling openssl\033[m\n"
tar xzf $openssl.tar.gz
cd $openssl
./config --prefix=$THIRD_PARTY_HOME/openssl shared threads
if test $? -ne 0; then
exit 1
fi
make
if test $? -ne 0; then
exit 1
fi
make install
cd -
#
# 安装libevent
#
printf "\n\033[0;32;34minstalling libevent\033[m\n"
tar xzf $libevent.tar.gz
cd $libevent
./configure --prefix=$THIRD_PARTY_HOME/libevent
if test $? -ne 0; then
exit 1
fi
make
if test $? -ne 0; then
exit 1
fi
make install
cd -
#
# 安装thrift
#
printf "\n\033[0;32;34minstalling thrift\033[m\n"
tar xzf $thrift.tar.gz
cd $thrift
# 按照常规的configure,使用--with-openssl,会遇到
# “Error: libcrypto required.”错误,这里使用CPPFLAGS和LDFLAGS替代
./configure --prefix=$THIRD_PARTY_HOME/thrift \
--with-boost=$THIRD_PARTY_HOME/boost \
--with-libevent=$THIRD_PARTY_HOME/libevent \
CPPFLAGS="-I$THIRD_PARTY_HOME/openssl/include" \
LDFLAGS="-ldl -L$THIRD_PARTY_HOME/openssl/lib" \
--with-qt4=no --with-c_glib=no --with-csharp=no \
--with-java=no --with-erlang=no --with-python=no \
--with-perl=no --with-ruby=no --with-haskell=no \
--with-go=no --with-d=no
if test $? -ne 0; then
exit 1
fi
# 完成上述修改后,configure可以成功了,但还需要下面修改,
# 否则make时会报malloc未声明
sed -i -e 's!#define HAVE_MALLOC 0!#define HAVE_MALLOC 1!' config.h
sed -i -e 's!#define HAVE_REALLOC 0!#define HAVE_REALLOC 1!' config.h
sed -i -e 's!#define malloc rpl_malloc!/*#define malloc rpl_malloc*/!' config.h
sed -i -e 's!#define realloc rpl_realloc!/*#define realloc rpl_realloc*/!' config.h
make
if test $? -ne 0; then
exit 1
fi
make install
cd -
# 安装成功提示一下
printf "\n\033[0;32;34minstall SUCCESS\033[m\n"
- 一键安装thrift-0.9.0的脚本
- 【Thrift一】Thrift编译安装
- 【Apache Thrift】windows下thrift的安装(一)
- 【Apache Thrift】windows下thrift的安装(一)
- windows下thrift的安装(一)
- thrift学习 --- 安装(一)
- thrift brew安装0.9.0
- Thrift 基础教程(一)安装篇
- Thrift交流(一)简单的Thrift
- Thrift交流(一)简单的Thrift
- Thrift交流(一)简单的Thrift
- Thrift交流(一)简单的Thrift
- 一键安装脚本
- Thrift的安装
- thrift的安装和Java编写thrift
- 【脚本】一键安装指定版本 Docker 的脚本
- PHP 7.0.0 一键安装脚本
- memcacheq一键安装脚本
- 24年阁楼藏身,人有多寂寞,爱有多幽深
- memcached学习笔记
- jsp的应用
- oracle常用函数二:字符函数
- Qt中的QString,QByteArray,Qchar, char*
- 一键安装thrift-0.9.0的脚本
- 停靠 LibreOffice 的“导航”窗口最简单的方法
- 【测速】那些搞笑的常数优化的证实
- AfxOleInit()和::CoInitialize(NULL)区别
- ccnet +msbuild +svn 每日构建(二 )编译完成后自动发布并部署文件
- EL表达式概述
- PF_PACKET 设备层编程接口
- maven LTDM 部署前台Tomcat 各种折腾--->自己总结经验
- Eclipse RCP中编辑器(editpart)关闭按钮的屏蔽方法