summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>2000-08-31 16:11:07 (GMT)
committerFred Drake <fdrake@acm.org>2000-08-31 16:11:07 (GMT)
commitc9cb84703b016ec6d273d979aee6a6a8763846d9 (patch)
tree795b93889517903e0b23612ab7b9d62561fabfbd /Modules
parent6102e29df28fa0707752875e23445ef1d84d5b10 (diff)
downloadcpython-c9cb84703b016ec6d273d979aee6a6a8763846d9.zip
cpython-c9cb84703b016ec6d273d979aee6a6a8763846d9.tar.gz
cpython-c9cb84703b016ec6d273d979aee6a6a8763846d9.tar.bz2
Skip Montanaro <skip@mojam.com>:
Update the build structures to automatically detect the presence of BSD db, including the proper name of the header file to include. Has all the expected niceties associated with yet-more-configure-options. ;) This checkin includes changes for non-generated files only; subsequent checkin will catch those. This is part of SourceForge patch #101272.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/Setup.config.in9
-rw-r--r--Modules/Setup.in3
-rw-r--r--Modules/bsddbmodule.c5
3 files changed, 16 insertions, 1 deletions
diff --git a/Modules/Setup.config.in b/Modules/Setup.config.in
index 8558fb4..1f208bd 100644
--- a/Modules/Setup.config.in
+++ b/Modules/Setup.config.in
@@ -8,3 +8,12 @@
# Garbage collection enabled with --with-cycle-gc
@USE_GC_MODULE@gc gcmodule.c
+
+# You may want this to be built as a dynamically loaded module; uncomment
+# the following line in that case:
+
+#*shared*
+
+# bsddb module enabled by --with-libdb or presence of db.h
+@USE_BSDDB_MODULE@bsddb bsddbmodule.c -ldb
+
diff --git a/Modules/Setup.in b/Modules/Setup.in
index e79852a..ae9352b 100644
--- a/Modules/Setup.in
+++ b/Modules/Setup.in
@@ -361,6 +361,9 @@ new newmodule.c
# (See http://www.jenkon-dev.com/~rd/python/ for an interface to
# BSD DB 2.1.0.)
+# Note: If a db.h file is found by configure, bsddb will be enabled
+# automatically via Setup.config.in
+
#DB=/depot/sundry/src/berkeley-db/db.1.85
#DBPORT=$(DB)/PORT/irix.5.3
#bsddb bsddbmodule.c -I$(DBPORT)/include -I$(DBPORT) $(DBPORT)/libdb.a
diff --git a/Modules/bsddbmodule.c b/Modules/bsddbmodule.c
index a956ada..48c221e 100644
--- a/Modules/bsddbmodule.c
+++ b/Modules/bsddbmodule.c
@@ -30,8 +30,11 @@ redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
-/* If using Berkeley DB 2.0 or newer, change this include to <db_185.h>: */
+#ifdef HAVE_DB_185_H
+#include <db_185.h>
+#else
#include <db.h>
+#endif
/* Please don't include internal header files of the Berkeley db package
(it messes up the info required in the Setup file) */