summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSuren A. Chilingaryan <csa@dside.dyndns.org>2007-05-09 20:42:52 +0000
committerSuren A. Chilingaryan <csa@dside.dyndns.org>2007-05-09 20:42:52 +0000
commitfd502754926131e3562a2210ff81af111ccaf867 (patch)
treeff62efd1b045adec527bce51a0aa939a0eca020e
parentc72478ce90d83e355ad7782991d20cbbd2664fd3 (diff)
downloadlibrcc-fd502754926131e3562a2210ff81af111ccaf867.tar.gz
librcc-fd502754926131e3562a2210ff81af111ccaf867.tar.bz2
librcc-fd502754926131e3562a2210ff81af111ccaf867.tar.xz
librcc-fd502754926131e3562a2210ff81af111ccaf867.zip
VERSION 0.2.4: Ultimate fixes
- Autoconf: check if ssize_t size_t types are missing in sys/types.h - Autoconf: really check for iconv.h residing in /usr/local - Support for older versions of BerkleyDB (fallback to original approach)
-rw-r--r--VERSION2
-rw-r--r--configure.in15
-rw-r--r--src/rccdb4.c14
-rw-r--r--src/rccexternal.h2
4 files changed, 22 insertions, 11 deletions
diff --git a/VERSION b/VERSION
index 2d2ef05..abd4105 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-0.2.4CVS
+0.2.4
diff --git a/configure.in b/configure.in
index 1de9595..7f85408 100644
--- a/configure.in
+++ b/configure.in
@@ -46,10 +46,19 @@ AM_PROG_CC_C_O
AC_PROG_INSTALL
AM_PROG_LIBTOOL
+AC_C_CONST
+AC_TYPE_SIZE_T
+AC_CHECK_TYPE(ssize_t, long)
+
+
pkgdatadir=${libdir}/rcc/
AC_SUBST(pkgdatadir)
CFLAGS="$CFLAGS -Wall -Wpointer-arith"
+if test ! -f /usr/include/iconv.h -a -f /usr/local/include/iconv.h ; then
+ CFLAGS+=" -I/usr/local/include"
+ LIBS+=" -L/usr/local/lib"
+fi
dnl Checks for programs.
AC_PATH_PROG(RM, rm, /bin/rm)
@@ -57,11 +66,7 @@ AC_PATH_PROG(MV, mv, /bin/mv)
AC_PATH_PROG(TAR, tar, /bin/tar)
dnl Checks for header files.
-AC_CHECK_HEADERS(iconv.h,, [
- CFLAGS+=" -I/usr/local/include"
- LIBS+=" -L/usr/local/lib"
- AC_CHECK_HEADERS(iconv.h,, [AC_MSG_ERROR(Missing iconv header)])
-])
+AC_CHECK_HEADERS(iconv.h,, [AC_MSG_ERROR(Missing iconv header)])
AC_CHECK_HEADERS(mntent.h pwd.h sys/types.h sys/stat.h sys/file.h sys/socket.h sys/un.h sys/time.h sys/select.h sys/wait.h signal.h unistd.h fcntl.h)
AC_TRY_COMPILE([#include <langinfo.h>],
diff --git a/src/rccdb4.c b/src/rccdb4.c
index 1eb5d44..d21f36b 100644
--- a/src/rccdb4.c
+++ b/src/rccdb4.c
@@ -17,14 +17,16 @@ db4_context rccDb4CreateContext(const char *dbpath, rcc_db4_flags flags) {
DB_ENV *dbe;
DB *db;
-# if 0
+# ifndef DB_LOG_AUTOREMOVE
+# ifdef DB_VERSION_MISMATCH
char stmp[160];
-# endif
+# endif /* DB_VERSION_MISMATCH */
+# endif /* DB_LOG_AUTOREMOVE */
err = db_env_create(&dbe, 0);
if (err) return NULL;
-# if 1
+# ifdef DB_LOG_AUTOREMOVE
dbe->set_flags(dbe, DB_LOG_AUTOREMOVE, 1);
dbe->set_lg_max(dbe, 131072);
@@ -33,8 +35,9 @@ db4_context rccDb4CreateContext(const char *dbpath, rcc_db4_flags flags) {
err = dbe->open(dbe, dbpath, DB_CREATE|DB_INIT_TXN|DB_USE_ENVIRON|DB_INIT_LOCK|DB_INIT_MPOOL|DB_RECOVER, 00644);
rccUnLock();
}
-# else
+# else /* DB_LOG_AUTOREMOVE */
err = dbe->open(dbe, dbpath, DB_CREATE|DB_INIT_CDB|DB_INIT_MPOOL, 00644);
+# ifdef DB_VERSION_MISMATCH
if (err == DB_VERSION_MISMATCH) {
if (!rccLock()) {
err = dbe->open(dbe, dbpath, DB_CREATE|DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_USE_ENVIRON|DB_PRIVATE|DB_RECOVER, 0);
@@ -59,7 +62,8 @@ db4_context rccDb4CreateContext(const char *dbpath, rcc_db4_flags flags) {
err = dbe->open(dbe, dbpath, DB_CREATE|DB_INIT_CDB|DB_INIT_MPOOL, 00644);
}
-# endif
+# endif /* DB_VERSION_MISMATCH */
+# endif /* DB_LOG_AUTOREMOVE */
if (err) {
// fprintf(stderr, "BerkelyDB initialization failed: %i (%s)\n", err, db_strerror(err));
diff --git a/src/rccexternal.h b/src/rccexternal.h
index 1038329..181a6ec 100644
--- a/src/rccexternal.h
+++ b/src/rccexternal.h
@@ -1,6 +1,8 @@
#ifndef _RCC_EXTERNAL_H
#define _RCC_EXTERNAL_H
+#include "../config.h"
+
typedef enum rcc_external_module_t {
RCC_EXTERNAL_MODULE_CONTROL = 0,
RCC_EXTERNAL_MODULE_OPTIONS,