]> granicus.if.org Git - python/commitdiff
Skip Montanaro <skip@mojam.com>:
authorFred Drake <fdrake@acm.org>
Thu, 31 Aug 2000 16:11:07 +0000 (16:11 +0000)
committerFred Drake <fdrake@acm.org>
Thu, 31 Aug 2000 16:11:07 +0000 (16:11 +0000)
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.

Modules/Setup.config.in
Modules/Setup.in
Modules/bsddbmodule.c
acconfig.h
configure.in

index 8558fb4448cd13e2d0560c7ceafb270aae20bf3e..1f208bdfa875cbd42063c9158196f40b0bddbed4 100644 (file)
@@ -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
+
index e79852ad1912fdedb1d6f8dc9251338c0a7a5699..ae9352b9421b79c25669333ccdf018d27786c5cc 100644 (file)
@@ -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
index a956ada61a9b4f30ef695da37d564d2d599beac7..48c221e7eb332fa9837fee25d702c03b6a02236a 100644 (file)
@@ -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) */
 
index d8b0fc3c177dac99df10440da1d5626bdff18278..6eb9feb47da5cd1832361b479c22b3c8c5abe360 100644 (file)
    (shared library plus accessory files). */
 #undef WITH_NEXT_FRAMEWORK
 
+/* Define if you want to use BSD db. */
+#undef WITH_LIBDB
+
 /* Define if you want to build an interpreter with many run-time checks  */
 #undef Py_DEBUG
 
index 3af6c3f4b1c2f2f4742c2a66f486aef0ef6f8117..69ddf547d08c262490339c81d6a9350ec1aca7fd 100644 (file)
@@ -369,7 +369,7 @@ dnl AC_MSG_RESULT($cpp_type)
 AC_HEADER_STDC
 AC_CHECK_HEADERS(dlfcn.h fcntl.h limits.h locale.h ncurses.h poll.h pthread.h \
 signal.h stdarg.h stddef.h stdlib.h thread.h unistd.h utime.h \
-sys/audioio.h sys/file.h sys/lock.h \
+sys/audioio.h sys/file.h sys/lock.h db_185.h db.h \
 sys/param.h sys/select.h sys/socket.h sys/time.h sys/times.h \
 sys/un.h sys/utsname.h sys/wait.h pty.h libutil.h)
 AC_HEADER_DIRENT
@@ -812,6 +812,30 @@ else
 fi
 AC_MSG_RESULT($with_cycle_gc)
 
+# Check for LIBDB support
+# either --with-libdb or, in its absence, the presence of db.h
+AC_SUBST(USE_BSDDB_MODULE)
+USE_BSDDB_MODULE=""
+AC_MSG_CHECKING(for --with-libdb)
+AC_ARG_WITH(libdb,
+[  --with(out)-libdb               disable/enable bsddb module])
+
+# default is enabled
+if test -z "$with_libdb"
+then with_libdb="yes"
+fi
+# if we found db.h, enable, unless with_libdb is expressly set to "no"
+if test "$ac_cv_header_db_h" = "yes" -a "$with_libdb" != "no"
+then with_libdb="yes"
+fi
+if test "$with_libdb" = "no"
+then
+    USE_BSDDB_MODULE="#"
+else
+    AC_DEFINE(WITH_LIBDB)
+fi
+AC_MSG_RESULT($with_libdb)
+
 # Check for --with-wctype-functions
 AC_MSG_CHECKING(for --with-wctype-functions)
 AC_ARG_WITH(wctype-functions,