以前的邮件系统安装在Redhat9.0上,现在需要迁移到FC4上,结果出现了一系列问题,经过两天调试终于解决,现在写出来分享以下,让大家少走弯路:)
问题一:
现象:
configure cyrus-imapd-2.2.3包时,出现错误:
checking for db_open in -ldb... no
configure: error: Berkeley DB 3.x or later was not found. You may need to supply the --with-bdb-libdir or --with-bdb-incdir configure options.
原因:
因为FC4上默认安装的是db-4.3.27 ,而我又自己装了较低的版本,产生冲突!
解决办法:
升级imap,安装cyrus-imapd-2.2.12版本,使用系统默认db4即可!如果自己自定义安装db最好也安装与系统版本相同的包,我试过将系统自带的包卸载,重新装低版本的,也可以(但是要把/usr/local/bdb/include下的文件拷到/usr/include/db4和/usr/include下,否则还是不行)!
问题二:
现象:
make cyrus-imapd-2.2.12时出现
imapopts.h:181: error: array type has incomplete element type(即错误:未完成的数组类型)
原因:
因为FC4使用gcc4.0版本,有些语法不支持,属于bug
解决:
使用patch修复bug,patch内容如下:
--------------------------------------------------
#! /bin/sh /usr/share/dpatch/dpatch-run
## 50-FTBFS-gcc-4.0-fix.dpatch
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: Fix FTBFS when compiling with gcc-4.0, there is imapopts is used before declared
@DPATCH@
diff -urN /emailserver/install/src2/cyrus-imapd-2.2.12/tools/config2header /emailserver/install/src2/cyrus-imapd-2.2.12/tools/config2header
--- /emailserver/install/src2/cyrus-imapd-2.2.12/tools/config2header 2004-06-22 21:02:31.000000000 +0200
+++ /emailserver/install/src2/cyrus-imapd-2.2.12/tools/config2header 2005-06-22 07:56:17.180293688 +0200
@@ -214,7 +214,6 @@
print HFILE <<EOF
IMAPOPT_LAST
};
-extern struct imapopt_s imapopts[];
enum enum_value {
IMAP_ENUM_ZERO = 0,
@@ -260,6 +259,8 @@
print HFILE <<EOF
};
+extern struct imapopt_s imapopts[];
+
#endif /* INCLUDED_IMAPOPTIONS_H */
EOF
;
--------------------------------------------------
把以上内容存为dpatch-run,放在 /usr/share/dpatch/dpatch-run,路径改为你自己的,然后使用命令patch -p0 < dpatch-run
(需要注意缩进,其实就是将语句extern struct imapopt_s imapopts[];放到263行下而已!)