Changeset 288


Ignore:
Timestamp:
28/12/2005 11:38:04 (6 years ago)
Author:
martin
Message:

Now supports Berkeley DB versions >= 4.1 in addition to 1.x. The versions inbetween are not supported because they require code changes and I don't have them available to test against.

Location:
box/trunk
Files:
3 added
2 edited

Legend:

Unmodified
Added
Removed
  • box/trunk/bin/bbackupd/BackupClientInodeToIDMap.cpp

    r217 r288  
    1515        #include <fcntl.h> 
    1616        #include <limits.h> 
    17         #include DB_HEADER 
     17        #include <db.h> 
    1818        #include <sys/stat.h> 
    1919#endif 
     
    6666        if(dbp != 0) 
    6767        { 
    68 #ifdef BERKELY_V4 
     68#if BDB_VERSION_MAJOR >= 3 
    6969                dbp->close(0); 
    7070#else 
     
    9595         
    9696        // Open the database file 
    97 #ifdef BERKELY_V4 
     97#if BDB_VERSION_MAJOR >= 3 
    9898        dbp = new Db(0,0); 
    9999        dbp->set_pagesize(1024);                /* Page size: 1K. */ 
     
    147147        if(dbp != 0) 
    148148        { 
    149 #ifdef BERKELY_V4 
     149#if BDB_VERSION_MAJOR >= 3 
    150150                if(dbp->close(0) != 0) 
    151151#else 
     
    189189        rec.mInDirectory = InDirectory; 
    190190 
    191 #ifdef BERKELY_V4 
     191#if BDB_VERSION_MAJOR >= 3 
    192192        Dbt key(&InodeRef, sizeof(InodeRef)); 
    193193        Dbt data(&rec, sizeof(rec)); 
     
    251251        } 
    252252 
    253 #ifdef BERKELY_V4 
     253#if BDB_VERSION_MAJOR >= 3 
    254254        Dbt key(&InodeRef, sizeof(InodeRef)); 
    255255        Dbt data(0, 0); 
     
    281281 
    282282        // Check for sensible return 
    283 #ifdef BERKELY_V4 
     283#if BDB_VERSION_MAJOR >= 3 
    284284        if(key.get_data() == 0 || data.get_size() != sizeof(IDBRecord)) 
    285285        { 
  • box/trunk/configure.ac

    r286 r288  
    3333if test "$target_os" != "mingw32" -a "$target_os" != "winnt"; then 
    3434  AC_SEARCH_LIBS([nanosleep], [rt], [ac_have_nanosleep=yes], 
    35                  [AC_MSG_ERROR([[Cannot find a short sleep function (nanosleep)]])]) 
    36 fi 
    37 AC_CHECK_LIB([z], [zlibVersion],, [AC_MSG_ERROR([[Cannot find zlib]])]) 
    38 AX_CHECK_BDB_V1 
     35                 [AC_MSG_ERROR([[cannot find a short sleep function (nanosleep)]])]) 
     36fi 
     37AC_CHECK_LIB([z], [zlibVersion],, [AC_MSG_ERROR([[cannot find zlib]])]) 
    3938VL_LIB_READLINE 
    4039have_libreadline=no 
    4140test "x$vl_cv_lib_readline" != "xno" && have_libreadline=yes 
    4241 
     42## Check for Berkely DB. Restrict to certain versions 
     43AX_PATH_BDB(, [ 
     44  LIBS="$BDB_LIBS $LIBS" 
     45  LDFLAGS="$BDB_LDFLAGS $LDFLAGS" 
     46  CPPFLAGS="$CPPFLAGS $BDB_CPPFLAGS" 
     47 
     48  AX_COMPARE_VERSION([$BDB_VERSION],[ge],[4.1],, 
     49    [AX_COMPARE_VERSION([$BDB_VERSION],[lt],[2],, 
     50      [AC_MSG_ERROR([[only Berkely DB versions 1.x or at least 4.1 are currently supported]])] 
     51      )] 
     52  ) 
     53  AX_SPLIT_VERSION([BDB_VERSION], [$BDB_VERSION]) 
     54]) 
    4355 
    4456## Check for Open SSL, use old versions only if explicitly requested 
     
    179191 
    180192Large files:         $have_large_file_support 
    181 Berkeley DB:         $ac_have_bdb 
     193Berkeley DB:         $ax_path_bdb_ok 
    182194Readline:            $have_libreadline 
    183195Extended attributes: $ac_cv_header_sys_xattr_h 
     
    205217    ;; 
    206218esac 
    207  
    208 if test "x$ac_have_bdb" != "xyes"; then 
    209   echo 
    210   AC_MSG_WARN([[db is not installed -- will run in reduced efficiency mode without it]]) 
    211 fi 
Note: See TracChangeset for help on using the changeset viewer.