centos 5.5 下安装cyrus-sasl 时报错
 
make[2]: *** [db_berkeley.lo] ´错误1
make[2]: Leaving directory `/root/postfix/cyrus-sasl-2.1.22/sasldb'
make[1]: *** [all-recursive] 错误 1
make[1]: Leaving directory `/root/postfix/cyrus-sasl-2.1.22'
make: *** [all] 错误2
 
 
修改文件
[root@localhost sasldb]# ls
allockey.c   db_berkeley.c  db_ndbm.c  Makefile     Makefile.in  sasldb.h
allockey.lo  db_gdbm.c      db_none.c  Makefile.am  NTMakefile
[root@localhost sasldb]# vi db_berkeley.c
 
#if DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR >= 1
        ret = (*mbdb)->open(*mbdb, NULL, path, NULL, DB_HASH, flags, 0660);
#else
        ret = (*mbdb)->open(*mbdb, path, NULL, DB_HASH, flags, 0660);
#endif
 
 
改成#if DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR >= 1
        ret = (*mbdb)->open(*mbdb, NULL, path, NULL, DB_HASH, flags, 0660);
#else
        ret = (*mbdb)->open(*mbdb, NULL, path, NULL, DB_HASH, flags, 0660);
#endif
 
重新编译
 
 
依然报错
 
更改:
 
[root@localhost utils]# ls
dbconverter-2.c  Makefile.in     pluginviewer.c      saslpasswd2.8  sfsasl.h
Makefile         NTMakefile      sasldblistusers2.8  saslpasswd.c   smtptest.c
Makefile.am      pluginviewer.8  sasldblistusers.c   sfsasl.c       testsuite.c
[root@localhost utils]# vi dbconverter-2.c
#if DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR >= 1
        ret = (*mbdb)->open(*mbdb, NULL, path, NULL, DB_HASH, DB_CREATE, 0664);
#else
        ret = (*mbdb)->open(*mbdb, NULL, path, NULL, DB_HASH, DB_CREATE, 0664);
#endif
 
然后再次编译,就通过了,但是里面有很多警告,不知道会不会有什么影响!
 
 
还有个错误:(摘自 http://waringid.blog.51cto.com/65148/58144
如果在编译的过程中出现如"client.c:64: error: static declaration of 'global_callbacks' follows non-static declaration saslint.h:112…",需要加一个补丁程序,然后再执行编译过程。我的在rhel4下没出现错误,但在rhel5下出现错误.文件的内容如下:
[root@redhat cyrus-sasl-2.1.21]# vi sasl.patch
--- cyrus-sasl-2.1.20/lib/client.c~ 2003-11-11 11:26:06.000000000 -0500
+++ cyrus-sasl-2.1.20/lib/client.c 2005-05-31 22:34:14.000000000 -0400
@@ -61,7 +61,7 @@
static cmech_list_t *cmechlist; /* global var which holds the list */
-static sasl_global_callbacks_t global_callbacks;
+sasl_global_callbacks_t global_callbacks;
static int _sasl_client_active = 0;
[root@redhat cyrus-sasl-2.1.21]# ./configure --prefix=/usr/local/sasl2 \
--disable-anon -enable-plain --enable-login --enable-sql \
--with-mysql=/usr/local/mysql --with-mysql-includes=/usr/local/mysql/include \
--with-mysql-libs=/usr/local/mysql/lib \
--with-authdaemond=/usr/local/authlib/var/spool/authdaemon/socket
[root@redhat cyrus-sasl-2.1.21]# patch -p1 < sasl.patch  //只在出现下面的错时才用
[root@redhat cyrus-sasl-2.1.21]# make
[root@redhat cyrus-sasl-2.1.21]# make install