kiwi开发环境配备

kiwi开发环境配置
CentOS6


1)mount第三方库
手动mount第三方库
su root
mkdir /mnt/vendor
mount -t cifs -o username="administrator",password="" //192.168.1.170/vendor /mnt/vendor


自动mount第三方库
编辑/etc/rc.d/rc.local,追加以下内容
mkdir /mnt/vendor
mount -t cifs -o username="administrator",password="" //192.168.1.170/vendor /mnt/vendor


mount -t cifs -o username="ming",password="m" //192.168.1.170/kiwi /mnt/kiwi


2)编译ACE-6.1.1
http://www.cs.wustl.edu/~schmidt/ACE.html
#export ACE_ROOT=/vendor/ACE/ACE-6.1.1/ACE_wrappers


创建$ACE_ROOT/ace/config.h
#vi $ACE_ROOT/ace/config.h
内容如下:
#define ACE_USES_WCHAR
#include "ace/config-linux.h"


支持epoll
#vi $ACE_ROOT/ace/config-linux.h
增加如下内容
#define ACE_HAS_EVENT_POLL


创建$ACE_ROOT/include/makeinclude/platform_macros.GNU
#vi $ACE_ROOT/include/makeinclude/platform_macros.GNU
内容如下:
include $(ACE_ROOT)/include/makeinclude/platform_linux.GNU


#cd $ACE_ROOT
#make




3)编译boost


编译bjam
#export BOOST_ROOT=/vendor/boost/boost_1_48_0
#cd $BOOST_ROOT
#./bootstrap.sh


编译boost
#./bjam --toolset=gcc stage debug threading=multi link=shared


2)编译xerces-c 2.8.0


copy xerces-c-src_2_8_0.tar.gz到/vendor/xerces/
cd /vendor/xerces/
tar -xvf xerces-c-src_2_8_0.tar.gz


#export XERCESCROOT=/vendor/xerces/xerces-c-src_2_8_0
#cd $XERCESCROOT/src/xercesc/
#./runConfigure -plinux -cgcc -xg++ -minmem -nsocket -tnative -rpthread


若出现“/bin/sh^M:bad interpreter 没有那个文件或目录”错误字样,原因为脚本文件为dos格式,需要将其转换为unix格式。
#vim configure
:set ff=unix
:wq!
#vim config.sub
:set ff=unix
:wq!
#vim config.guess
:set ff=unix
:wq!
#vim runConfigure
:set ff=unix
:wq!
再次运行
#./runConfigure -plinux -cgcc -xg++ -minmem -nsocket -tnative -rpthread


#make
#make install
注意:这里需要make install安装xercesc库,因为xalan的安装需要用到该库


4)编译Xalan-C++ 1.10
http://xml.apache.org/xalan-c/
#export XERCESCROOT=/vendor/xerces/xerces-c-src_2_8_0/src
#export XALANCROOT=/vendor/xalan-c/Xalan-C_1_10_0-src/xml-xalan/c
#cd $XALANCROOT
#./runConfigure -p linux -c gcc -x g++
#make


出现如下错误:
/vendor/xalan-c/Xalan-C_1_10_0-src/xml-xalan/c/src/xalanc/XalanDOM/XalanDOMString.cpp:251: 错误:‘memmove’在此作用域中尚未声明
/vendor/xalan-c/Xalan-C_1_10_0-src/xml-xalan/c/src/xalanc/XalanDOM/XalanDOMString.cpp: In static member function ‘static xalanc_1_10::XalanDOMString::size_type xalanc_1_10::XalanDOMString::length(const char*)’:
/vendor/xalan-c/Xalan-C_1_10_0-src/xml-xalan/c/src/xalanc/XalanDOM/XalanDOMString.cpp:780: 错误:‘strlen’在此作用域中尚未声明
#vi /vendor/xalan-c/Xalan-C_1_10_0-src/xml-xalan/c/src/xalanc/XalanDOM/XalanDOMString.cpp
在XalanDOMString.cpp中添加如下
#include <string.h>


/vendor/xalan-c/Xalan-C_1_10_0-src/xml-xalan/c/src/xalanc/XMLSupport/FormatterToHTML.cpp:175: 错误:‘memset’在此作用域中尚未声明
#vi /vendor/xalan-c/Xalan-C_1_10_0-src/xml-xalan/c/src/xalanc/XMLSupport/FormatterToHTML.cpp
在FormatterToHTML.cpp中添加如下
#include <string.h>


/vendor/xalan-c/Xalan-C_1_10_0-src/xml-xalan/c/src/xalanc/XSLT/ElemNumber.cpp:1472: 错误:‘memset’在此作用域中尚未声明
#vi /vendor/xalan-c/Xalan-C_1_10_0-src/xml-xalan/c/src/xalanc/XSLT/ElemNumber.cpp
在ElemNumber.cpp中添加如下
#include <string.h>


/vendor/xalan-c/Xalan-C_1_10_0-src/xml-xalan/c/src/xalanc/PlatformSupport/DirectoryEnumerator.hpp:346: 错误:‘strlen’在此作用域中尚未声明
#vi /vendor/xalan-c/Xalan-C_1_10_0-src/xml-xalan/c/src/xalanc/PlatformSupport/DirectoryEnumerator.hpp
在DirectoryEnumerator.hpp中添加如下
#include <string.h>




5)安装unixODBC-2.3.0
获取地址:http://www.unixodbc.org/
#cd /vendor/unixODBC/unixODBC-2.3.0
#./configure --prefix=/usr --enable-driver-conf --enable-drivers CPPFLAGS="-DSQL_WCHART_CONVERT -DUNICODE"
#make 
#make install


#vi /etc/profile
追加如下信息:
export ODBCINI=/usr/etc/odbc.ini
export ODBCSYSINI=/usr/etc


#vi /usr/etc/odbcinst.ini
[mysql]
Description     = mysql
Driver          = /vendor/mysql-connector-odbc-5.1.11-linux-glibc2.3-x86-32bit/lib/libmyodbc5.so
Driver64        = 
Setup           = /vendor/unixODBC/unixODBC-2.3.0/DRVConfig/MySQL/.libs/libodbcmyS.so
Setup64         = 
UsageCount      = 1
CPTimeout       = 
CPReuse         = 


#vi /usr/etc/odbc.ini
[sevs_mdb]
Description     = mysql
Driver          = mysql
Server          = 192.168.1.170
Database        = gyb_mdb_2_5_1
Port            = 3306
Socket          =
Option          = 
Stmt            = 


6)编译和配置openssl 1.0.1c(使用系统自带openssl,无须构建openssl)
http://www.openssl.org/source/ 
4457113 May 10 17:20:24 2012 openssl-1.0.1c.tar.gz (MD5) (SHA1) (PGP sign)  [LATEST]


#cd /vendor/openssl/openssl-1.0.1c
#./config shared
#make
#make test(可选)
#make install(可选)




7)berkeley db 4.7.25
http://www.oracle.com/technetwork/products/berkeleydb/downloads/index-082944.html
#cd /vendor/berkeleydb/db-4.7.25/build_unix
#../dist/configure
#make


8)构建zlib-1.2.7(使用系统自带libz,无须构建libz)
http://www.zlib.net/
#cd /vendor/zlib/zlib-1.2.7
#make distclean
#./configure
#make


9)安装和配置oracle odbc
下载:
http://www.oracle.com/technetwork/topics/linuxsoft-082809.html
oracle-instantclient11.2-basic-11.2.0.3.0-1.i386.rpm (57,765,315 bytes) (cksum - 789342999)
oracle-instantclient11.2-odbc-11.2.0.3.0-1.i386.rpm (274,625 bytes) (cksum - 3210519758)


a)安装
#rpm -ivh oracle-instantclient11.2-basic-11.2.0.3.0-1.i386.rpm
#rpm -ivh oracle-instantclient11.2-odbc-11.2.0.3.0-1.i386.rpm


b)配置oracle odbc驱动
#vi /usr/etc/odbcinst.ini
[Oracle 11g ODBC driver]
Description     = Oracle ODBC driver for Oracle 11g
Driver          = /usr/lib/oracle/11.2/client/lib/libsqora.so.11.1
Setup           = 
FileUsage       =
CPTimeout       =
CPReuse         =


#vi /usr/etc/odbc.ini
[MSCM]
Description     = MSCM
Driver          = Oracle 11g ODBC driver
Server          = 192.168.1.104
ServerName      = 192.168.1.104:1521/MSCM002
Port            = 1521
UserID = mmr_app
password = mmr_APP_123


c)将oracle odbc库路径加入系统环境变量
#vi /etc/profile
追加如下信息:
#export LD_LIBRARY_PATH=/usr/lib/oracle/11.2/client/lib:$LD_LIBRARY_PATH


d)修改/etc/hosts文件,追加本机map,否则会报"ORA-21561: OID generation failed"错误
#vi /etc/hosts
追加如下信息:
192.168.1.171 centos62
其中centos62为本机主机名,可以通过hostname命令查看


e)isql MSCM mmr_app mmr_APP_123 -v