分类: C/C++
2011-03-30 14:23:44
1, 操作系统为RedHat Enterprise Linux 5, 选择了最小化安装。我们的目的是不使用系统里现有的库,全部使用我们自己编译的,这样做的目的是搭建出一个不依赖系统jabberd。
2, 准备了使用的安装包:
cyrus-sasl-2.1.23.tar.gz
jabberd-2.2.11.tar.bz2
libidn-1.19.tar.gz
openssl-1.0.0a.tar.gz
expat-2.0.1.tar.gz
libgcrypt-1.4.6.tar.bz2
mysql-5.0.91-linux-i686-glibc23.tar.gz
udns_0.0.9.tar.gz
zlib-1.2.5.tar.gz
libgsasl-1.4.4.tar.gz
3, 创建目录:
mkdir -p /usr/local/easyjabberd/app
4, 先安装MySQL:
我们下载了mysql的是已经编译好的二进制包,直接解压缩就可以使用
(1), tar zxvf mysql-5.0.91-linux-i686-glibc23.tar.gz
(2), cp -R mysql-5.0.91-linux-i686-glibc23 /usr/local/easyjabberd/app/mysql
5, 安装expat,用作XML解析
(1), tar zxvf expat-2.0.1.tar.gz
(2), ./configure --prefix=/usr/local/easyjabberd/app/expat
(3), make
(4), make install
6, 安装libidn
(1), tar zxvf libidn-1.19.tar.gz
(2), ./configure --prefix=/usr/local/easyjabberd/app/libidn
(3), make
(4), make install
7, 安装udns
udns的configure没有提供--prefix,所以我们编译后,手动拷贝所需要的文件到/usr/local/easyjabberd/app/udns目录下
(1), mkdir -p /usr/local/easyjabberd/app/udns/include
(2), mkdir -p /usr/local/easyjabberd/app/udns/lib
(3), ./configure
(4), make
(5), cp udns.h /usr/local/easyjabberd/app/udns/include/
(6), cp libudns.a /usr/local/easyjabberd/app/udns/lib/
8, 安装openssl
(1), tar zxvf openssl-1.0.0a.tar.gz
(2), cd openssl-1.0.0a
(3), ./config --prefix=/usr/local/easyjabberd/app/
(4), make
(4), make install
9, 安装Cyrus sasl
(1), tar zxvf cyrus-sasl-2.1.23.tar.gz
(2), cd cyrus-sasl-2.1.23
(3), ./configure --prefix=/usr/local/easyjabberd/app/ --with-openssl=/usr/local/easyjabberd/app/ CPPFLAGS="-I/usr/local/easyjabberd/app/include/ -I/usr/local/easyjabberd
/app/include/openssl" LDFLAGS="-L/usr/local/easyjabberd/app/lib"
(4), make
(5), make install
10, 安装zlib
(1), tar zxvf zlib-1.2.5.tar.gz
(2), cd zlib-1.2.5
(3), ./configure --prefix=/usr/local/easyjabberd/app/
(4), make
(5), make install
11, 安装Jabberd2
(1), tar jxvf jabberd-2.2.11.tar.bz2
(2), cd jabberd-2.2.11
(3), ./configure --prefix=/usr/local/easyjabberd/jabberd2 --enable-mysql=/usr/local/easyjabberd/mysql/ CFLAGS="-I/usr/local/easyjabberd/app/include -I/usr/local/easyjabberd/app/include/openssl" LDFLAGS="-L/usr/local/easyjabberd/app/lib -Wl,-R/usr/local/easyjabberd/app/lib" --with-extra-include-path=/usr/local/easyjabberd/app/include --with-extra-library-path=/usr/local/easyjabberd/app/lib --with-sasl=cyrus --enable-mio=epoll
(4), make
(5), 调试报错,sx/sasl_cyrus.c 23行注释掉
(6), make
(7), make install
好了,如果一切顺利,到这里Jabberd2服务器已经编译、安装完成。
Ryanliang_cu2012-05-29 20:55:13
/bin/sh ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I.. -I/home/push/wuliang/program/jabberd2/app/include -I/home/push/wuliang/program/jabberd2/app/include -I/home/push/wuliang/program/jabberd2/app/include/openssl -funsigned-char -MT sasl_cyrus.lo -MD -MP -MF .deps/sasl_cyrus.Tpo -c -o sasl_cyrus.lo sasl_cyrus.c
libtool: compile: gcc -DHAVE_CONFIG_H -I. -I.. -I/home/push/wuliang/program/jabberd2/app/include -I/home/push/wulian