mysql for aix6.1_AIX6.1用g++安装Poco-1.6.1-all

项目终于到了把程序往小型机上部署的阶段了。不得不说AIX真是让人恶心,一个Poco编译弄了我1周时间。网上根本没有相关的资料。

1. AIX下安装gcc/g++:

在ftp://ftp.software.ibm.com/aix/freeSoftware/aixtoolbox/RPMS/ppc/gcc/下载:

gcc-4.2.0-3.aix6.1.ppc.rpm

libgcc-4.2.0-3.aix6.1.ppc.rpm

libstdcplusplus-4.2.0-3.aix6.1.ppc.rpm

libstdcplusplus-devel-4.2.0-3.aix6.1.ppc.rpm

gcc-cplusplus-4.2.0-3.aix6.1.ppc.rpm

并通过rpm –ivh 依次安装.

2. Poco进行configure时,会报错,提示在AIX下要安装补丁,补丁在Poco根目录下的patches/AIX/xlC8.diff。

> cp patches/AIX/xlC8.diff ./

> patch -p0 < xlC8.diff

运行失败,检查vi xlC8.diff发现这个补丁文件是Poco1.3版本时候的了,行号根本匹配不上,于是自己按照xlC8.diff

文件内容一个个文件修改了一下,还好升级的文件不是很多,之后用diff -ur自动生成了xlC8.diff文件,有些地方还需

要修改,项目工期紧张,没时间修改了,之后会把修改后的xlC8.diff文件传上来。

最后一步将patches/AIX目录删除。

3. 修改配置选项

> ./configure --omit=NetSSL_OpenSSL,Crypto,Data/ODBC,Data/MySQL --prefix=/opt/poco --no-tests --no-samples

> gmake -s

报错,找不到xlc_r,查看AIX上根本没有安装xlc IBM的编辑器。由于收费软件所以放弃,改用gcc/g++编译。

如果AIX安装了xlc的小伙伴们可以试试直接安装是否有什么问题。

由于用gcc/g++编译,第2步的diff升级可能不需要了,这里我没有测试。我依然用的修改后的文件编译。

因为Poco给出的AIX配置编译选项是放在根目录下的build/config/AIX文件,查看里面都是xlc的编译选项。于是自己参照Linux做了一个配

置文件AIX_GCC,放到build/config目录下,内容为:(失败过很多次修改的结果,花费时间1周!)

1 #2 # $Id: //poco/1.6/build/config/AIX_GCC#2 $

3 #4 # AIX5 #6 # Make settings for Linux 2.6/gcc 4.2

7 #8 #9

10 #11 # General Settings12 #13 LINKMODE ?=SHARED14

15 #16 # Define Tools17 #18 CC = ${CROSS_COMPILE}gcc

19 CXX = ${CROSS_COMPILE}g++

20 LINK =$(CXX)21 LIB = ${CROSS_COMPILE}ar -cr22 RANLIB =${CROSS_COMPILE}ranlib23 #SHLIB = $(CXX) -shared -Wl,-soname,$(notdir $@) -o $@24 SHLIB = $(CXX) -shared -Wl,-brtl -maix64 -fconserve-space -o $@25 SHLIBLN = $(POCO_BASE)/build/script/shlibln26 STRIP =${CROSS_COMPILE}strip27 DEP = $(POCO_BASE)/build/script/makedepend.gcc

28 SHELL = sh

29 RM = rm -rf30 CP = cp

31 MKDIR = mkdir -p32

33 #34 # Extension forShared Libraries35 #36 SHAREDLIBEXT =.so.$(target_version)37 SHAREDLIBLINKEXT =.so38

39 #40 # Compiler and Linker Flags41 #42 CFLAGS = -maix64 -fconserve-space43 CFLAGS32 =

44 CFLAGS64 =

45 #CXXFLAGS = -Wall -Wno-sign-compare46 CXXFLAGS = -maix64 -fconserve-space -Wno-sign-compare47 CXXFLAGS32 =

48 CXXFLAGS64 =

49 LINKFLAGS =

50 LINKFLAGS32 =

51 LINKFLAGS64 =

52 STATICOPT_CC =

53 STATICOPT_CXX =

54 STATICOPT_LINK = -static55 SHAREDOPT_CC = -fPIC56 SHAREDOPT_CXX = -fPIC57 #SHAREDOPT_LINK = -Wl,-rpath,$(LIBPATH)58 SHAREDOPT_LINK = -Wl,-brtl -maix64 -fconserve-space59 DEBUGOPT_CC = -g -D_DEBUG60 DEBUGOPT_CXX = -g -D_DEBUG61 DEBUGOPT_LINK = -g62 RELEASEOPT_CC = -O2 -DNDEBUG63 RELEASEOPT_CXX = -O2 -DNDEBUG64 RELEASEOPT_LINK = -O265

66 #67 # System Specific Flags68 #69 #SYSFLAGS = -D_XOPEN_SOURCE=500 -D_REENTRANT -D_THREAD_SAFE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -DPOCO_HAVE_FD_EPOLL70 SYSFLAGS = -D_REENTRANT -D_THREAD_SAFE -D__powerpc__71

72 #73 # System Specific Libraries74 #75 SYSLIBS = -lpthread -ldl -lrt

PS:于2015-11-09修改,之前的版本依然有BUG,编译后的POCO执行string赋值时会出现段错误。

4. 执行

> ./configure --omit=NetSSL_OpenSSL,Crypto,Data/ODBC,Data/MySQL --prefix=/opt/poco --no-tests --no-samples --config=AIX_GCC

成功后。

> gmake -s

编译到Data的时候,文件RecordSet.cpp的时候,382行结尾出问题,g++报错,段错误,然后崩了!这个问题没找到解决办法,因为我没有用到

这个文件,所以我将关联的三个文件从Poco中Makefile中删除,Data/Makefile修改后部分:

objects = AbstractBinder AbstractBinding AbstractExtraction AbstractExtractor \

AbstractPreparation AbstractPreparator ArchiveStrategy Transaction \

Bulk Connector DataException Date DynamicLOB Limit MetaColumn \

PooledSessionHolder PooledSessionImpl Position \

Range Row RowFormatter \

SimpleRowFormatter Session SessionFactory SessionImpl \

SessionPool SessionPoolContainer SQLChannel \

Statement StatementCreator StatementImpl Time

> gmake -s

成功。

su - root

密码。

cd Poco目录

> gmake install

修改install目录的权限。OK!

转载请注明出处。。。。。。。。。。。。。。。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
(注:若需要下载帮助文档,请搜索poco-1.6.1-all-doc) 本资源介绍:Introduction The POCO C++ Libraries are a collection of open source C++ class libraries that simplify and accelerate the development of network-centric, portable applications in C++. The libraries integrate perfectly with the C++ Standard Library and fill many of the functional gaps left open by it. Their modular and efficient design and implementation makes the POCO C++ Libraries extremely well suited for embedded development, an area where the C++ programming language is becoming increasingly popular, due to its suitability for both low-level (device I/O, interrupt handlers, etc.) and high-level object-oriented development. Of course, POCO is also ready for enterprise-level challenges. POCO Libraries POCO consists of four core libraries, and a number of add-on libraries. The core libraries are Foundation, XML, Util and Net. Two of the add-on libraries are NetSSL, providing SSL support for the network classes in the Net library, and Data, a library for uniformly accessing different SQL databases. POCO aims to be for network-centric, cross-platform C++ software development what Apple's Cocoa is for Mac development, or Ruby on Rails is for Web development — a powerful, yet easy and fun to use platform to build your applications upon. POCO is built strictly using standard ANSI/ISO C++, including the standard library. The contributors attempt to find a good balance between using advanced C++ features and keeping the classes comprehensible and the code clean, consistent and easy to maintain.

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值