2 # Process this file with autoconf to produce a configure script.
5 AC_INIT(Berkeley DB, __EDIT_DB_VERSION__,
6 [Oracle Technology Network Berkeley DB forum],
7 db-__EDIT_DB_VERSION__)
8 AC_CONFIG_SRCDIR([../db/db.c])
9 AC_CONFIG_HEADERS([db_config.h:config.hin])
11 AC_CONFIG_MACRO_DIR([aclocal])
17 # Don't build in the top-level or dist directories.
18 AC_MSG_CHECKING(if building in the top-level or dist directories)
19 if [ test -d db_archive -o -f configure.ac ] ; then
22 Berkeley DB should not be built in the top-level or "dist" directories. \
23 Change directory to the build_unix directory and run ../dist/configure \
29 # Substitution variables.
30 AC_SUBST(ADDITIONAL_INCS)
31 AC_SUBST(ADDITIONAL_LANG)
32 AC_SUBST(ADDITIONAL_OBJS)
33 AC_SUBST(ADDITIONAL_PROGS)
34 AC_SUBST(BUILD_TARGET)
36 AC_SUBST(CONFIGURATION_ARGS)
37 AC_SUBST(CONFIGURATION_PATH)
46 AC_SUBST(DEFAULT_LIB_CXX)
47 AC_SUBST(DEFAULT_LIB_STL)
49 AC_SUBST(INSTALL_LIBS)
50 AC_SUBST(INSTALL_TARGET)
60 AC_SUBST(LIBTSO_MODSUFFIX)
61 AC_SUBST(LIBTSO_MODULE)
64 AC_SUBST(MAKEFILE_CCLINK)
65 AC_SUBST(MAKEFILE_CXX)
66 AC_SUBST(MAKEFILE_CXXLINK)
67 AC_SUBST(MAKEFILE_SOLINK)
68 AC_SUBST(MAKEFILE_XSOLINK)
70 AC_SUBST(PATH_SEPARATOR)
72 AC_SUBST(REPLACEMENT_OBJS)
73 AC_SUBST(RPC_CLIENT_OBJS)
74 AC_SUBST(RPC_SERVER_H)
81 # The Windows public header has two extra symbols we need to remove.
82 AC_SUBST(platform_header)
83 AC_SUBST(platform_footer)
85 # Set the default installation location.
86 AC_PREFIX_DEFAULT(/usr/local/BerkeleyDB.__EDIT_DB_VERSION_MAJOR__.__EDIT_DB_VERSION_MINOR__)
88 # Configure the version information.
89 AC_SUBST(DB_VERSION_MAJOR)
90 DB_VERSION_MAJOR="__EDIT_DB_VERSION_MAJOR__"
91 AC_SUBST(DB_VERSION_MINOR)
92 DB_VERSION_MINOR="__EDIT_DB_VERSION_MINOR__"
93 AC_SUBST(DB_VERSION_PATCH)
94 DB_VERSION_PATCH="__EDIT_DB_VERSION_PATCH__"
95 AC_SUBST(DB_VERSION_STRING)
96 DB_VERSION_STRING='"__EDIT_DB_VERSION_STRING__"'
97 AC_SUBST(DB_VERSION_UNIQUE_NAME)
99 # Process all options before using them.
102 # Set some #defines based on configuration options.
103 if test "$db_cv_diagnostic" = "yes"; then
104 AC_DEFINE(DIAGNOSTIC)
105 AH_TEMPLATE(DIAGNOSTIC,
106 [Define to 1 if you want a version with run-time diagnostic checking.])
108 if test "$db_cv_debug_rop" = "yes"; then
110 AH_TEMPLATE(DEBUG_ROP,
111 [Define to 1 if you want a version that logs read operations.])
113 if test "$db_cv_debug_wop" = "yes"; then
115 AH_TEMPLATE(DEBUG_WOP,
116 [Define to 1 if you want a version that logs write operations.])
118 if test "$db_cv_umrw" = "yes"; then
121 [Define to 1 to mask harmless uninitialized memory read/writes.])
124 if test "$db_cv_test" = "yes"; then
125 AC_DEFINE(CONFIG_TEST)
126 AH_TEMPLATE(CONFIG_TEST,
127 [Define to 1 if you want to build a version for running the test suite.])
130 AH_TEMPLATE(HAVE_UPGRADE_SUPPORT,
131 [Define to 1 if port includes historic database upgrade support.])
132 AC_DEFINE(HAVE_UPGRADE_SUPPORT)
134 # Check for programs used in building and installation.
138 BUILD_TARGET="library_build"
139 INSTALL_TARGET="library_install"
141 # Respect the environment LIBS settings
144 # This is where we handle stuff that autoconf can't handle: compiler,
145 # preprocessor and load flags, libraries that the standard tests don't
148 # There are additional libraries we need for some compiler/architecture
151 # Some architectures require DB to be compiled with special flags and/or
152 # libraries for threaded applications
154 # The makefile CC may be different than the CC used in config testing,
155 # because the makefile CC may be set to use $(LIBTOOL).
157 # Don't override anything if it's already set from the environment.
163 CPPFLAGS="$CPPFLAGS -D_LINUX_SOURCE_COMPAT";;
165 # IBM's XLC compilers (at least versions 7/8/9) generate incorrect code
166 # when ordinary optimization is enabled because they make strong
167 # assumptions about the types held at each memory location, and some
168 # Berkeley DB code violates those assumptions. [#16141]
169 optimize_debug="-O2 -qalias=noansi"
171 CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE"
172 LDFLAGS="$LDFLAGS -Wl,-brtl";;
173 bsdi3*) CC=${CC-"shlicc2"}
174 LIBSO_LIBS="$LIBSO_LIBS -lipc";;
176 CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE -D_REENTRANT";;
178 CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE"
179 LDFLAGS="$LDFLAGS -pthread";;
180 gnu*|k*bsd*-gnu|linux*)
181 CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE -D_REENTRANT";;
182 hpux*) CPPFLAGS="$CPPFLAGS -D_REENTRANT";;
183 irix*) optimize_debug="-O2"
184 CPPFLAGS="$CPPFLAGS -D_SGI_MP_SOURCE";;
185 mpeix*) CPPFLAGS="$CPPFLAGS -D_POSIX_SOURCE -D_SOCKET_SOURCE"
186 LIBSO_LIBS="$LIBSO_LIBS -lsocket -lsvipc";;
187 osf*) CPPFLAGS="$CPPFLAGS -pthread";;
188 *qnx*) qnx_build="yes"
190 AH_TEMPLATE(HAVE_QNX, [Define to 1 if building on QNX.]);;
192 CPPFLAGS="$CPPFLAGS -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS ";;
195 # If the user wants a debugging environment, change any compiler optimization
196 # flags to -g. We used to add -g to the -O compiler flags, but compilers are
197 # good enough at code re-organization that debugging with -O no longer works.
198 # If you want to compile with a different set of flags, specify CFLAGS in the
199 # environment before configuring.
200 if test "$db_cv_debug" = "yes"; then
202 AH_TEMPLATE(DEBUG, [Define to 1 if you want a debugging version.])
207 # Set CFLAGS/CXXFLAGS. We MUST set the flags before we call autoconf
208 # compiler configuration macros, because if we don't, they set CFLAGS
209 # to no optimization and -g, which isn't what we want.
210 CFLAGS=${CFLAGS-$optimize_debug}
211 CXXFLAGS=${CXXFLAGS-"$CFLAGS"}
213 # The default compiler is cc (NOT gcc), the default CFLAGS is as specified
214 # above, NOT what is set by AC_PROG_CC, as it won't set optimization flags
215 # for any compiler other than gcc.
218 # We know what compiler we're going to use, now. Set per-compiler flags.
219 if test "$GCC" = "yes"; then
220 # Use -O3 if we're using gcc, unless we're doing a small build, in
221 # which case we use -Os alone. The code size for -O3 is quite a
222 # bit larger than -O2: a compromise is "-Os -finline-functions",
223 # it's smaller and explicitly inlining the functions helps Berkeley
226 if test "$db_cv_smallbuild" = "yes"; then
227 CFLAGS=`echo "$CFLAGS" | sed 's/-O /-Os /g'`
229 CFLAGS=`echo "$CFLAGS" | sed 's/-O /-O3 /g'`
234 hpux11*) CPPFLAGS="$CPPFLAGS -mt";;
238 # Check for "const" and "inline" keywords.
242 # We use prototypes and the keyword "const" in db.h which doesn't include
243 # db_config.h, so we have to figure out what to do there.
245 # There is an autoconf AC_C_PROTOTYPES macro, but as all it does is define
246 # db_config.h variables, it doesn't help us.
248 # We don't have much choice, we look at internal autoconf variables.
249 if test "$ac_cv_c_const" != "yes"; then
250 DB_CONST="#define const"
253 # Clear __P, some other systems use it too.
254 DB_PROTO1="#undef __P"
255 if test "$ac_cv_prog_cc_c89" = "no"; then
256 DB_PROTO2="#define __P(protos) ()"
258 DB_PROTO2="#define __P(protos) protos"
261 # Because of shared library building, the ${CC} used for config tests
262 # may be different than the ${CC} we want to put in the Makefile.
263 # The latter is known as ${MAKEFILE_CC} in this script.
265 MAKEFILE_CCLINK="${CC}"
267 MAKEFILE_CXXLINK="nocxx"
269 # See if we need the C++ compiler at all. If so, we'd like to find one that
270 # interoperates with the C compiler we chose. Since we prefered cc over gcc,
271 # we'll also prefer the vendor's compiler over g++/gcc. If we're wrong, the
272 # user can set CC and CXX in their environment before running configure.
274 # AC_PROG_CXX sets CXX, but it uses $CXX and $CCC (in that order) as its
276 if test "$db_cv_cxx" = "yes"; then
277 if test "$GCC" != "yes"; then
279 aix*) AC_CHECK_TOOL(CCC, xlC_r)
280 LIBXSO_LIBS="-lC_r $LIBXSO_LIBS"
281 LIBSO_LIBS="-lC_r $LIBSO_LIBS";;
282 hpux*) AC_CHECK_TOOL(CCC, aCC);;
283 irix*) AC_CHECK_TOOL(CCC, CC);;
284 osf*) AC_CHECK_TOOL(CCC, cxx)
285 CXXFLAGS="$CXXFLAGS -D__USE_STD_IOSTREAM"
286 test -d /usr/include.dtk &&
287 CXXFLAGS="$CXXFLAGS -I/usr/include.dtk";;
288 solaris*) AC_CHECK_TOOL(CCC, CC);;
292 ###### WORKAROUND: SEE SR #7938
294 ###############################
296 MAKEFILE_CXX="${CXX}"
297 MAKEFILE_CXXLINK="${CXX}"
300 # Do some gcc specific configuration.
303 # We need the -Kthread/-pthread flag when compiling on SCO/Caldera's UnixWare
304 # and OpenUNIX releases. We can't make the test until we know which compiler
307 sysv5UnixWare*|sysv5OpenUNIX8*)
308 if test "$GCC" == "yes"; then
309 CPPFLAGS="$CPPFLAGS -pthread"
310 LDFLAGS="$LDFLAGS -pthread"
312 CPPFLAGS="$CPPFLAGS -Kthread"
313 LDFLAGS="$LDFLAGS -Kthread"
317 # Export our compiler preferences for the libtool configuration.
321 # Libtool configuration.
324 SOFLAGS="-rpath \$(libdir)"
326 # Set SOSUFFIX and friends
333 INSTALLER="\$(LIBTOOL) --mode=install cp -p"
335 MAKEFILE_CC="\$(LIBTOOL) --mode=compile ${MAKEFILE_CC}"
336 MAKEFILE_SOLINK="\$(LIBTOOL) --mode=link ${MAKEFILE_CCLINK} -avoid-version"
337 MAKEFILE_CCLINK="\$(LIBTOOL) --mode=link ${MAKEFILE_CCLINK}"
338 MAKEFILE_CXX="\$(LIBTOOL) --mode=compile ${MAKEFILE_CXX}"
339 MAKEFILE_XSOLINK="\$(LIBTOOL) --mode=link ${MAKEFILE_CXXLINK} -avoid-version"
340 MAKEFILE_CXXLINK="\$(LIBTOOL) --mode=link ${MAKEFILE_CXXLINK}"
345 MAKEFILE_SOLINK="$MAKEFILE_SOLINK -no-undefined"
346 MAKEFILE_XSOLINK="$MAKEFILE_XSOLINK -no-undefined";;
352 LIBTSO_MODSUFFIX=".dylib";;
355 LIBTSO_MODSUFFIX=$MODSUFFIX;;
357 LIBTSO_MODULE="-module"
358 LIBTSO_MODSUFFIX=$MODSUFFIX;;
362 if test "$enable_shared" = "no"; then
363 DEFAULT_LIB="\$(libdb_version)"
367 DEFAULT_LIB="\$(libso_target)"
368 POSTLINK="\$(LIBTOOL) --mode=execute true"
371 INSTALL_LIBS="$DEFAULT_LIB"
372 if test "$enable_static" = "yes"; then
373 INSTALL_LIBS="$INSTALL_LIBS \$(libdb)"
377 if test "$db_cv_cxx" = "yes"; then
378 if test "$enable_shared" = "no"; then
379 DEFAULT_LIB_CXX="\$(libcxx_version)"
381 if test "$enable_shared" = "yes"; then
382 DEFAULT_LIB_CXX="\$(libxso_target)"
384 INSTALL_LIBS="$INSTALL_LIBS $DEFAULT_LIB_CXX"
385 if test "$enable_static" = "yes"; then
386 INSTALL_LIBS="$INSTALL_LIBS \$(libcxx)"
391 if test "$db_cv_java" = "yes"; then
392 # Java requires shared libraries.
393 if test "$enable_shared" = "no"; then
394 AC_MSG_ERROR([Java requires shared libraries])
397 # A classpath that includes . is needed to check for Java
398 # Since Cygwin uses Windows' javac, we need Windows path separators
400 cygwin*) CLASSPATH=".;$CLASSPATH";;
401 *) CLASSPATH=".:$CLASSPATH";;
409 AC_MSG_CHECKING(java version)
412 JAVA_VERSION=`$JAVA -version 2>&1 |
413 sed -e '/Java Version:/!d' -e 's/.*Java Version: \([[^ ]]*\)[[ ]]*/\1/'` ;;
414 * ) JAVA_VERSION=`$JAVA -version 2>&1 |
415 sed -e '/ version /!d' -e 's/.*"\(.*\)".*/\1/'` ;;
417 AC_MSG_RESULT($JAVA_VERSION)
418 case "$JAVA_VERSION" in
419 1.[[3456789]]* | 1.[[1-9]][[0-9]]* | [[23456789]]* ) ;;
421 AC_MSG_ERROR([Java version 1.3 or higher required, got $JAVA_VERSION]) ;;
424 # Because of the code that SWIG generates to cast between pointers and
425 # integers, we need to add the flag "-fno-strict-aliasing" to the gcc
426 # command line when compiling the JNI code. This is documented in
427 # [#14953] and at http://www.swig.org/Doc1.3/Java.html
428 if test "${GCC}" = "yes"; then
429 SWIGCFLAGS="-fno-strict-aliasing"
432 for JNI_INCLUDE_DIR in $JNI_INCLUDE_DIRS
434 CPPFLAGS="$CPPFLAGS -I$JNI_INCLUDE_DIR"
437 ADDITIONAL_LANG="$ADDITIONAL_LANG java"
438 INSTALL_LIBS="$INSTALL_LIBS \$(libjso_target)"
444 if test "$db_cv_mingw" = "yes"; then
446 PATH_SEPARATOR="\\\\/:"
449 AC_DEFINE(STDC_HEADERS)
453 AC_DEFINE(HAVE_SYSTEM_INCLUDE_FILES)
457 if test "$db_cv_stl" = "yes"; then
458 AC_CXX_SUPPORTS_TEMPLATES
461 if test "$enable_shared" = "no"; then
462 DEFAULT_LIB_STL="\$(libstl_version)"
464 if test "$enable_shared" = "yes"; then
465 DEFAULT_LIB_STL="\$(libstlso_target)"
467 ADDITIONAL_INCS="dbstl_common.h dbstl_set.h dbstl_vector.h dbstl_exception.h dbstl_map.h dbstl_utility.h dbstl_dbc.h dbstl_dbt.h dbstl_base_iterator.h dbstl_container.h dbstl_element_ref.h dbstl_inner_utility.h dbstl_resource_manager.h $ADDITIONAL_INCS"
468 INSTALL_LIBS="$INSTALL_LIBS $DEFAULT_LIB_STL"
469 if test "$enable_static" = "yes"; then
470 INSTALL_LIBS="$INSTALL_LIBS \$(libstl)"
474 # Checks for include files, structures, C types.
478 AC_CHECK_HEADERS(execinfo.h sys/select.h sys/socket.h sys/time.h)
479 AC_CHECK_MEMBERS([struct stat.st_blksize])
482 AC_CACHE_CHECK([for ANSI C exit success/failure values], db_cv_exit_defines, [
483 AC_TRY_COMPILE([#include <stdlib.h>], return (EXIT_SUCCESS);,
484 [db_cv_exit_defines=yes], [db_cv_exit_defines=no])])
485 if test "$db_cv_exit_defines" = "yes"; then
486 AC_DEFINE(HAVE_EXIT_SUCCESS)
487 AH_TEMPLATE(HAVE_EXIT_SUCCESS,
488 [Define to 1 if platform has EXIT_SUCCESS/EXIT_FAILURE #defines.])
491 AC_CACHE_CHECK([for getopt optreset variable], db_cv_optreset, [
492 AC_TRY_LINK([#include <unistd.h>], extern int optreset; optreset = 1;,
493 [db_cv_optreset=yes], [db_cv_optreset=no])])
494 if test "$db_cv_optreset" = "yes"; then
495 AC_DEFINE(HAVE_GETOPT_OPTRESET)
496 AH_TEMPLATE(HAVE_GETOPT_OPTRESET,
497 [Define to 1 if getopt supports the optreset variable.])
501 # We do this first because it changes $LIBSO_LIBS.
504 # Check for native (system call or instruction set) support for
505 # atomic increment, decrement, and compare & exchange.
508 # Test for various functions/libraries -- do tests that change library values
511 # Update LIBS, so we're testing against the current list of libraries.
514 # The yield function on Solaris is almost certainly pthread_yield (LWP threads
515 # or POSIX pthreads), or thr_yield (UI threads). There's an outside chance it
516 # is sched_yield() though, only available in -lrt on Solaris.
517 AC_SEARCH_LIBS(sched_yield, rt)
519 # The Berkeley DB library calls fdatasync, only available in -lrt on Solaris.
520 AC_SEARCH_LIBS(fdatasync, rt)
522 AC_SEARCH_LIBS(getaddrinfo, nsl socket)
523 AC_SEARCH_LIBS(hstrerror, resolv)
525 # Those tests updated LIBS, update our internal list.
529 # We could be more exact about whether these libraries are needed, but don't
530 # bother -- if they exist, we load them, it's only the test programs anyway.
531 AC_HAVE_LIBRARY(m, TEST_LIBS="$TEST_LIBS -lm")
532 AC_HAVE_LIBRARY(nsl, TEST_LIBS="$TEST_LIBS -lnsl")
533 AC_HAVE_LIBRARY(socket, TEST_LIBS="$TEST_LIBS -lsocket")
535 # Checks for system functions for which we have replacements.
537 # The only portable getcwd call is getcwd(char *, size_t), where the
538 # buffer is non-NULL -- Solaris can't handle a NULL buffer, and they
541 abort atoi atol getcwd getenv getopt isalpha isdigit isprint\
542 isspace memcmp memcpy memmove printf qsort raise rand strcasecmp\
543 strcat strchr strdup strerror strncat strncmp strrchr strsep\
546 # Check for system functions we optionally use.
548 _fstati64 backtrace backtrace_symbols directio fchmod fclose\
549 fcntl fdatasync fgetc fgets fopen fwrite getgid\
550 getrusage getuid hstrerror mprotect pstat_getdynamic\
551 pthread_self pthread_yield random sched_yield select setgid setuid\
552 sigaction snprintf stat sysconf vsnprintf yield)
557 # We've run into a problem with ftruncate on Alpha/Tru64, the issue is that
558 # after a truncate the last page of the file mmaps as all zeros. So just don't
563 [ftruncate ignored on $host_os-$host_vendor.]);;
565 AC_CHECK_FUNCS(ftruncate);;
569 # HP-UX has pread/pwrite, but it doesn't work with largefile support.
570 # NCR's version of System V R 4.3 has pread/pwrite symbols, but no support.
571 case "$host_os-$host_vendor" in
574 [pread/pwrite interfaces ignored on $host_os-$host_vendor.]);;
576 AC_CHECK_FUNCS(pread pwrite);;
579 # Check for getaddrinfo; do the test explicitly instead of using AC_CHECK_FUNCS
580 # because <netdb.h> isn't a standard include file.
581 AC_CACHE_CHECK([for getaddrinfo], db_cv_getaddrinfo, [
583 #include <sys/types.h>
584 #include <netdb.h>], [
585 getaddrinfo(0, 0, 0, 0);
586 ], [db_cv_getaddrinfo=yes], [db_cv_getaddrinfo=no])])
587 if test "$db_cv_getaddrinfo" = "yes"; then
588 AC_DEFINE(HAVE_GETADDRINFO)
589 AH_TEMPLATE(HAVE_GETADDRINFO,
590 [Define to 1 if you have the `getaddrinfo' function.])
593 # Check for the fcntl F_SETFD flag to deny child process access to file
595 AC_CACHE_CHECK([for fcntl/F_SETFD], db_cv_fcntl_f_setfd, [
597 #include <sys/types.h>
598 #include <fcntl.h>], [
599 fcntl(1, F_SETFD, 1);
600 ], [db_cv_fcntl_f_setfd=yes], [db_cv_fcntl_f_setfd=no])])
601 if test "$db_cv_fcntl_f_setfd" = "yes"; then
602 AC_DEFINE(HAVE_FCNTL_F_SETFD)
603 AH_TEMPLATE(HAVE_FCNTL_F_SETFD,
604 [Define to 1 if fcntl/F_SETFD denies child access to file descriptors.])
607 # A/UX has a broken getopt(3).
609 aux*) AC_LIBOBJ([getopt]);;
612 # Linux has a broken O_DIRECT flag, but you can't detect it at configure time.
613 # Linux and SGI require buffer alignment we may not match, otherwise writes
614 # will fail. Default to not using the O_DIRECT flag.
615 if test "$db_cv_o_direct" = "yes"; then
616 AC_CACHE_CHECK([for open/O_DIRECT], db_cv_open_o_direct, [
618 #include <sys/types.h>
619 #include <fcntl.h>], [
620 open("a", O_RDONLY | O_DIRECT, 0);
621 ], [db_cv_open_o_direct=yes], [db_cv_open_o_direct=no])])
623 "$db_cv_o_direct" = "yes" -a "$db_cv_open_o_direct" = "yes"; then
624 AC_DEFINE(HAVE_O_DIRECT)
625 AH_TEMPLATE(HAVE_O_DIRECT,
626 [Define to 1 if you have the O_DIRECT flag.])
630 # Check for largefile support.
633 # Figure out how to create shared regions.
635 # First, we look for mmap.
637 # BSD/OS has mlock(2), but it doesn't work until the 4.1 release.
639 # Nextstep (version 3.3) apparently supports mmap(2) (the mmap symbol
640 # is defined in the C library) but does not support munmap(2). Don't
641 # try to use mmap if we can't find munmap.
643 # Ultrix has mmap(2), but it doesn't work.
647 AC_MSG_WARN([mlock(2) interface ignored on $host_os-$host_vendor.])
649 AC_CHECK_FUNCS(mmap munmap, , mmap_ok=no);;
651 AC_MSG_WARN([mmap(2) interface ignored on $host_os-$host_vendor.]);;
654 AC_CHECK_FUNCS(mlock munlock)
655 AC_CHECK_FUNCS(mmap munmap, , mmap_ok=no);;
658 # Second, we look for shmget.
660 # SunOS has the shmget(2) interfaces, but there appears to be a missing
661 # #include <debug/debug.h> file, so we ignore them.
665 AC_MSG_WARN([shmget(2) interface ignored on $host_os-$host_vendor.]);;
668 AC_CHECK_FUNCS(shmget, , shmget_ok=no)
670 # Check for shmctl to lock down shared memory segments.
671 AC_CACHE_CHECK([for shmctl], db_cv_shmctl_shm_lock, [
673 #include <sys/types.h>
676 #include <stdio.h>], [
677 shmctl(0, SHM_LOCK, NULL);
678 ], [db_cv_shmctl_shm_lock=yes], [db_cv_shmctl_shm_lock=no])])
679 if test "$db_cv_shmctl_shm_lock" = "yes"; then
680 AC_DEFINE(HAVE_SHMCTL_SHM_LOCK)
681 AH_TEMPLATE(HAVE_SHMCTL_SHM_LOCK,
682 [Define to 1 if shmctl/SHM_LOCK locks down shared memory segments.])
686 # We require either mmap/munmap(2) or shmget(2).
687 if test "$mmap_ok" = "no" -a "$shmget_ok" = "no"; then
688 AC_MSG_WARN([Neither mmap/munmap(2) or shmget(2) library functions.])
691 # Optional RPC client/server.
692 if test "$db_cv_rpc" = "yes"; then
696 # Optional Tcl support.
697 if test "$db_cv_tcl" = "yes"; then
701 # Optional sequence code.
702 AM_SEQUENCE_CONFIGURE
704 # Optional DB 1.85 compatibility API.
705 if test "$db_cv_compat185" = "yes"; then
706 ADDITIONAL_INCS="db_185.h $ADDITIONAL_INCS"
708 ADDITIONAL_OBJS="db185${o} $ADDITIONAL_OBJS"
711 # Optional utilities.
712 if test "$db_cv_dump185" = "yes"; then
713 ADDITIONAL_PROGS="db_dump185 $ADDITIONAL_PROGS"
716 # You can disable pieces of functionality to save space.
718 # Btree is always configured: it is the standard method, and Hash off-page
719 # duplicates require it.
720 ADDITIONAL_OBJS="$ADDITIONAL_OBJS \$(BTREE_OBJS)"
722 # Compression can be disabled.
723 if test "$db_cv_build_compression" = "yes"; then
724 AC_DEFINE(HAVE_COMPRESSION)
725 AH_TEMPLATE(HAVE_COMPRESSION, [Define to 1 if building compression support.])
728 # Partitioning can be disabled.
729 if test "$db_cv_build_partition" = "yes"; then
730 AC_DEFINE(HAVE_PARTITION)
731 AH_TEMPLATE(HAVE_PARTITION, [Define to 1 if building partitioned database support.])
734 # Hash can be disabled.
735 if test "$db_cv_build_hash" = "yes"; then
737 AH_TEMPLATE(HAVE_HASH, [Define to 1 if building Hash access method.])
738 ADDITIONAL_OBJS="$ADDITIONAL_OBJS \$(HASH_OBJS)"
739 if test "$db_cv_build_verify" = "yes"; then
740 ADDITIONAL_OBJS="$ADDITIONAL_OBJS \$(HASH_VRFY_OBJS)"
743 ADDITIONAL_OBJS="$ADDITIONAL_OBJS hash_stub${o}"
746 # Queue can be disabled.
747 if test "$db_cv_build_queue" = "yes"; then
748 AC_DEFINE(HAVE_QUEUE)
749 AH_TEMPLATE(HAVE_QUEUE, [Define to 1 if building Queue access method.])
750 ADDITIONAL_OBJS="$ADDITIONAL_OBJS \$(QUEUE_OBJS)"
751 if test "$db_cv_build_verify" = "yes"; then
752 ADDITIONAL_OBJS="$ADDITIONAL_OBJS \$(QUEUE_VRFY_OBJS)"
755 ADDITIONAL_OBJS="$ADDITIONAL_OBJS qam_stub${o}"
758 # Replication can be disabled.
759 if test "$db_cv_build_replication" = "yes"; then
760 AC_DEFINE(HAVE_REPLICATION)
761 AH_TEMPLATE(HAVE_REPLICATION,
762 [Define to 1 if building replication support.])
763 ADDITIONAL_OBJS="$ADDITIONAL_OBJS \$(REP_OBJS)"
765 # If we're building replication and detected POSIX threads, build the
766 # replication manager.
767 AH_TEMPLATE(HAVE_REPLICATION_THREADS,
768 [Define to 1 if building the Berkeley DB replication framework.])
770 if test "$ac_cv_header_pthread_h" = yes; then
771 AC_DEFINE(HAVE_REPLICATION_THREADS)
773 # Solaris requires the socket and nsl libraries to build the
774 # replication manager. Don't add nsl regardless of the OS,
775 # it causes RPC to fail on AIX 4.3.3.
778 AC_HAVE_LIBRARY(nsl, LIBSO_LIBS="$LIBSO_LIBS -lnsl")
779 AC_HAVE_LIBRARY(socket,
780 LIBSO_LIBS="$LIBSO_LIBS -lsocket");;
782 ADDITIONAL_OBJS="$ADDITIONAL_OBJS \$(REPMGR_OBJS)"
784 ADDITIONAL_OBJS="$ADDITIONAL_OBJS repmgr_stub${o}"
787 ADDITIONAL_OBJS="$ADDITIONAL_OBJS rep_stub${o} repmgr_stub${o}"
790 # The statistics code can be disabled.
791 if test "$db_cv_build_statistics" = "yes"; then
792 AC_DEFINE(HAVE_STATISTICS)
793 AH_TEMPLATE(HAVE_STATISTICS,
794 [Define to 1 if building statistics support.])
797 # The verification code can be disabled.
798 if test "$db_cv_build_verify" = "yes"; then
799 AC_DEFINE(HAVE_VERIFY)
800 AH_TEMPLATE(HAVE_VERIFY,
801 [Define to 1 if building access method verification support.])
802 ADDITIONAL_OBJS="$ADDITIONAL_OBJS \$(BTREE_VRFY_OBJS)"
804 ADDITIONAL_OBJS="$ADDITIONAL_OBJS db_vrfy_stub${o}"
807 # The crypto code can be disabled.
808 if test -d "$srcdir/../crypto" -a "$db_cv_build_cryptography" = "yes"; then
809 AC_DEFINE(HAVE_CRYPTO)
810 AH_TEMPLATE(HAVE_CRYPTO,
811 [Define to 1 if Berkeley DB release includes strong cryptography.])
813 CRYPTO_OBJS="\$(CRYPTO_OBJS)"
815 CRYPTO_OBJS="crypto_stub${o}"
818 # The mutex code can be disabled, and if there aren't any mutexes, then there's
819 # no reason to include the locking code.
820 if test "$db_cv_build_mutexsupport" = "yes"; then
821 ADDITIONAL_OBJS="$ADDITIONAL_OBJS \$(LOCK_OBJS) \$(MUTEX_OBJS)"
823 ADDITIONAL_OBJS="$ADDITIONAL_OBJS lock_stub${o} mut_stub${o}"
826 # If DIAGNOSTIC is defined, include the log print routines in the library
827 # itself, various diagnostic modes use them.
828 if test "$db_cv_diagnostic" = "yes"; then
829 ADDITIONAL_OBJS="$ADDITIONAL_OBJS \$(PRINT_OBJS)"
832 # If building for QNX, we need additional OS files.
833 if test "$qnx_build" = "yes"; then
834 ADDITIONAL_OBJS="$ADDITIONAL_OBJS os_qnx_fsync${o} os_qnx_open${o}"
837 # We need to add the additional object files into the Makefile with the correct
838 # suffix. We can't use $LTLIBOBJS itself, because that variable has $U encoded
839 # in it for automake, and that's not what we want. See SR #7227 for additional
842 # XXX: I'm not sure this is correct.
843 REPLACEMENT_OBJS=`echo "$LIB@&t@OBJS" |
844 sed "s,\.[[^.]]* ,$o ,g;s,\.[[^.]]*$,$o,"`
846 # This is necessary so that .o files in LIBOBJS are also built via
847 # the ANSI2KNR-filtering rules.
848 LIB@&t@OBJS=`echo "$LIB@&t@OBJS" |
849 sed 's,\.[[^.]]* ,$U&,g;s,\.[[^.]]*$,$U&,'`
850 LTLIBOBJS=`echo "$LIB@&t@OBJS" |
851 sed 's,\.[[^.]]* ,.lo ,g;s,\.[[^.]]*$,.lo,'`
854 # Initial output file list.
855 CREATE_LIST="Makefile \
856 db_cxx.h:$srcdir/../dbinc/db_cxx.in \
857 db_int.h:$srcdir/../dbinc/db_int.in \
858 clib_port.h:$srcdir/../dist/clib_port.in \
859 include.tcl:$srcdir/../test/include.tcl"
861 # Create the db.h file from a source file, a list of global function
862 # prototypes, and, if configured for unique names, a list of #defines
863 # to do DB_VERSION_UNIQUE_NAME substitution.
864 if test "$db_cv_uniquename" = "yes"; then
865 CREATE_LIST="$CREATE_LIST \
866 db.h:$srcdir/../dbinc/db.in:$srcdir/../dbinc_auto/api_flags.in:$srcdir/../dbinc_auto/ext_def.in:$srcdir/../dbinc_auto/ext_prot.in"
868 CREATE_LIST="$CREATE_LIST \
869 db.h:$srcdir/../dbinc/db.in:$srcdir/../dbinc_auto/api_flags.in:$srcdir/../dbinc_auto/ext_prot.in"
872 # If configured for unique names, create the db_int_uext.h file (which
873 # does the DB_VERSION_UNIQUE_NAME substitution), which is included by
875 if test "$db_cv_uniquename" = "yes"; then
876 CREATE_LIST="$CREATE_LIST \
877 db_int_def.h:$srcdir/../dbinc_auto/int_def.in"
878 db_int_def='#include "db_int_def.h"'
881 # Create the db_185.h and db185_int.h files from source files, a list of
882 # global function prototypes, and, if configured for unique names, a list
883 # of #defines to do DB_VERSION_UNIQUE_NAME substitution.
884 if test "$db_cv_compat185" = "yes"; then
885 if test "$db_cv_uniquename" = "yes"; then
886 CREATE_LIST="$CREATE_LIST \
887 db_185.h:$srcdir/../dbinc/db_185.in:$srcdir/../dbinc_auto/ext_185_def.in:$srcdir/../dbinc_auto/ext_185_prot.in \
888 db185_int.h:$srcdir/../db185/db185_int.in:$srcdir/../dbinc_auto/ext_185_def.in:$srcdir/../dbinc_auto/ext_185_prot.in"
890 CREATE_LIST="$CREATE_LIST \
891 db_185.h:$srcdir/../dbinc/db_185.in:$srcdir/../dbinc_auto/ext_185_prot.in \
892 db185_int.h:$srcdir/../db185/db185_int.in:$srcdir/../dbinc_auto/ext_185_prot.in"
896 if test "$db_cv_stl" = "yes"; then
897 CREATE_LIST="$CREATE_LIST \
898 dbstl_common.h:$srcdir/../stl/dbstl_common.in"
901 AC_CONFIG_FILES($CREATE_LIST)