diff options
author | Paul Marquess <paul.marquess@btinternet.com> | 1997-12-16 22:25:29 +0000 |
---|---|---|
committer | Malcolm Beattie <mbeattie@sable.ox.ac.uk> | 1997-12-17 13:18:34 +0000 |
commit | 1f70e1ea8280242937e42514e140f4e467e09404 (patch) | |
tree | 3057ccd04eb28e46b931edf3649652aca21738fc /Configure | |
parent | dd96f567babd77c258fd51112ff376f11f0b32ac (diff) | |
download | perl-1f70e1ea8280242937e42514e140f4e467e09404.tar.gz |
Upgrade DB_File to 1.56:
Subject: DB_File-1.56 for _55
p4raw-id: //depot/perl@372
Diffstat (limited to 'Configure')
-rwxr-xr-x | Configure | 40 |
1 files changed, 33 insertions, 7 deletions
@@ -8273,7 +8273,7 @@ eval $inhdr case "$i_db" in $define) - : Check db version. We can not use version 2. + : Check db version. echo " " echo "Checking Berkeley DB version ..." >&4 $cat >try.c <<EOCP @@ -8286,13 +8286,33 @@ $define) #include <db.h> main() { -#ifdef DB_VERSION_MAJOR /* DB version >= 2: not yet. */ - printf("You have Berkeley DB Version %d.%d\n", - DB_VERSION_MAJOR, DB_VERSION_MINOR); - printf("Perl currently only supports up to version 1.86.\n"); - exit(2); +#ifdef DB_VERSION_MAJOR /* DB version >= 2 */ + int Major, Minor, Patch ; + (void)db_version(&Major, &Minor, &Patch) ; + printf("You have Berkeley DB Version 2 or greater\n"); + + printf("db.h is from Berkeley DB Version %d.%d.%d\n", + DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH); + printf("libdb is from Berkeley DB Version %d.%d.%d\n", + Major, Minor, Patch) ; + + /* check that db.h & libdb are compatible */ + if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) { + printf("db.h and libdb are incompatible\n") ; + exit(3); + } + + printf("db.h and libdb are compatible\n") ; + /* needs to be >= 2.05 */ + if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { + printf("but Perl needs Berkeley DB 2.0.5 or greater\n") ; + exit(2); + } + + exit(0); #else #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC) + printf("You have Berkeley DB Version 1\n"); exit(0); /* DB version < 2: the coast is clear. */ #else exit(1); /* <db.h> not Berkeley DB? */ @@ -8301,7 +8321,7 @@ main() } EOCP if $cc $optimize $ccflags $ldflags -o try try.c $libs && ./try; then - echo 'Looks OK. (Perl supports up to version 1.86).' >&4 + echo 'Looks OK.' >&4 else echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4 i_db=$undef @@ -8332,6 +8352,8 @@ define) #endif #include <sys/types.h> #include <db.h> + +#ifndef DB_VERSION_MAJOR u_int32_t hash_cb (ptr, size) const void *ptr; size_t size; @@ -8342,6 +8364,7 @@ main() { info.hash = hash_cb; } +#endif EOCP if $cc $ccflags -c try.c >try.out 2>&1 ; then if $contains warning try.out >>/dev/null 2>&1 ; then @@ -8374,6 +8397,8 @@ define) #endif #include <sys/types.h> #include <db.h> + +#ifndef DB_VERSION_MAJOR size_t prefix_cb (key1, key2) const DBT *key1; const DBT *key2; @@ -8384,6 +8409,7 @@ main() { info.prefix = prefix_cb; } +#endif EOCP if $cc $ccflags -c try.c >try.out 2>&1 ; then if $contains warning try.out >>/dev/null 2>&1 ; then |