Skip to content

Commit eae0c14

Browse files
committed
Update autoconf, fix atomics and tests.
1 parent e66a5e6 commit eae0c14

41 files changed

Lines changed: 12208 additions & 6145 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
build_unix/**
2+
compile_commands.json

build_unix/HOWTO

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
Configure and build here, for example on macOS:
2+
3+
../dist/configure --prefix=$(pwd)/install --enable-tcl --with-tcl=/opt/homebrew/opt/tcl-tk@8/lib --enable-test --enable-sequences --disable-dbm --disable-java --disable-sql --disable-static --disable-cxx --enable-compile-commands
4+
5+
then
6+
7+
make && make test
8+
9+

build_vxworks/Makefile.6x

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -476,6 +476,8 @@ bdbvxw/$(MODE_DIR)/Objects/$(BDB_OBJECT_DIR)/src/os/os_addrinfo.o : $(BDB_ROOT)
476476
$(TRACE_FLAG)if [ ! -d "`dirname "$@"`" ]; then mkdir -p "`dirname "$@"`"; fi;echo "building $@"; $(TOOL_PATH)dcc $(DEBUGFLAGS_C-Compiler) $(CC_ARCH_SPEC) -W:c:,-Xclib-optim-off -Xansi -Xlocal-data-area-static-only -Xforce-declarations -Xmake-dependency=0xd $(ADDED_CFLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<"
477477
bdbvxw/$(MODE_DIR)/Objects/$(BDB_OBJECT_DIR)/src/os/os_alloc.o : $(BDB_ROOT)/src/os/os_alloc.c
478478
$(TRACE_FLAG)if [ ! -d "`dirname "$@"`" ]; then mkdir -p "`dirname "$@"`"; fi;echo "building $@"; $(TOOL_PATH)dcc $(DEBUGFLAGS_C-Compiler) $(CC_ARCH_SPEC) -W:c:,-Xclib-optim-off -Xansi -Xlocal-data-area-static-only -Xforce-declarations -Xmake-dependency=0xd $(ADDED_CFLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<"
479+
bdbvxw/$(MODE_DIR)/Objects/$(BDB_OBJECT_DIR)/src/os/os_atomic.o : $(BDB_ROOT)/src/os/os_atomic.c
480+
$(TRACE_FLAG)if [ ! -d "`dirname "$@"`" ]; then mkdir -p "`dirname "$@"`"; fi;echo "building $@"; $(TOOL_PATH)dcc $(DEBUGFLAGS_C-Compiler) $(CC_ARCH_SPEC) -W:c:,-Xclib-optim-off -Xansi -Xlocal-data-area-static-only -Xforce-declarations -Xmake-dependency=0xd $(ADDED_CFLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<"
479481
bdbvxw/$(MODE_DIR)/Objects/$(BDB_OBJECT_DIR)/src/os/os_clock.o : $(BDB_ROOT)/src/os/os_clock.c
480482
$(TRACE_FLAG)if [ ! -d "`dirname "$@"`" ]; then mkdir -p "`dirname "$@"`"; fi;echo "building $@"; $(TOOL_PATH)dcc $(DEBUGFLAGS_C-Compiler) $(CC_ARCH_SPEC) -W:c:,-Xclib-optim-off -Xansi -Xlocal-data-area-static-only -Xforce-declarations -Xmake-dependency=0xd $(ADDED_CFLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<"
481483
bdbvxw/$(MODE_DIR)/Objects/$(BDB_OBJECT_DIR)/src/os/os_cpu.o : $(BDB_ROOT)/src/os/os_cpu.c
@@ -916,6 +918,7 @@ OBJECTS_bdbvxw = \
916918
bdbvxw/$(MODE_DIR)/Objects/$(BDB_OBJECT_DIR)/src/os/os_abort.o \
917919
bdbvxw/$(MODE_DIR)/Objects/$(BDB_OBJECT_DIR)/src/os/os_addrinfo.o \
918920
bdbvxw/$(MODE_DIR)/Objects/$(BDB_OBJECT_DIR)/src/os/os_alloc.o \
921+
bdbvxw/$(MODE_DIR)/Objects/$(BDB_OBJECT_DIR)/src/os/os_atomic.o \
919922
bdbvxw/$(MODE_DIR)/Objects/$(BDB_OBJECT_DIR)/src/os/os_clock.o \
920923
bdbvxw/$(MODE_DIR)/Objects/$(BDB_OBJECT_DIR)/src/os/os_cpu.o \
921924
bdbvxw/$(MODE_DIR)/Objects/$(BDB_OBJECT_DIR)/src/os/os_ctime.o \
@@ -1237,6 +1240,7 @@ DEP_FILES := \
12371240
bdbvxw/$(MODE_DIR)/Objects/$(BDB_OBJECT_DIR)/src/os/os_abort.d \
12381241
bdbvxw/$(MODE_DIR)/Objects/$(BDB_OBJECT_DIR)/src/os/os_addrinfo.d \
12391242
bdbvxw/$(MODE_DIR)/Objects/$(BDB_OBJECT_DIR)/src/os/os_alloc.d \
1243+
bdbvxw/$(MODE_DIR)/Objects/$(BDB_OBJECT_DIR)/src/os/os_atomic.d \
12401244
bdbvxw/$(MODE_DIR)/Objects/$(BDB_OBJECT_DIR)/src/os/os_clock.d \
12411245
bdbvxw/$(MODE_DIR)/Objects/$(BDB_OBJECT_DIR)/src/os/os_cpu.d \
12421246
bdbvxw/$(MODE_DIR)/Objects/$(BDB_OBJECT_DIR)/src/os/os_ctime.d \

build_vxworks/Makefile.6x.small

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -406,6 +406,8 @@ bdbvxw/$(MODE_DIR)/Objects/$(BDB_OBJECT_DIR)/src/os/os_abort.o : $(BDB_ROOT)/sr
406406
$(TRACE_FLAG)if [ ! -d "`dirname "$@"`" ]; then mkdir -p "`dirname "$@"`"; fi;echo "building $@"; $(TOOL_PATH)dcc $(DEBUGFLAGS_C-Compiler) $(CC_ARCH_SPEC) -W:c:,-Xclib-optim-off -Xansi -Xlocal-data-area-static-only -Xforce-declarations -Xmake-dependency=0xd $(ADDED_CFLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<"
407407
bdbvxw/$(MODE_DIR)/Objects/$(BDB_OBJECT_DIR)/src/os/os_alloc.o : $(BDB_ROOT)/src/os/os_alloc.c
408408
$(TRACE_FLAG)if [ ! -d "`dirname "$@"`" ]; then mkdir -p "`dirname "$@"`"; fi;echo "building $@"; $(TOOL_PATH)dcc $(DEBUGFLAGS_C-Compiler) $(CC_ARCH_SPEC) -W:c:,-Xclib-optim-off -Xansi -Xlocal-data-area-static-only -Xforce-declarations -Xmake-dependency=0xd $(ADDED_CFLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<"
409+
bdbvxw/$(MODE_DIR)/Objects/$(BDB_OBJECT_DIR)/src/os/os_atomic.o : $(BDB_ROOT)/src/os/os_atomic.c
410+
$(TRACE_FLAG)if [ ! -d "`dirname "$@"`" ]; then mkdir -p "`dirname "$@"`"; fi;echo "building $@"; $(TOOL_PATH)dcc $(DEBUGFLAGS_C-Compiler) $(CC_ARCH_SPEC) -W:c:,-Xclib-optim-off -Xansi -Xlocal-data-area-static-only -Xforce-declarations -Xmake-dependency=0xd $(ADDED_CFLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<"
409411
bdbvxw/$(MODE_DIR)/Objects/$(BDB_OBJECT_DIR)/src/os/os_clock.o : $(BDB_ROOT)/src/os/os_clock.c
410412
$(TRACE_FLAG)if [ ! -d "`dirname "$@"`" ]; then mkdir -p "`dirname "$@"`"; fi;echo "building $@"; $(TOOL_PATH)dcc $(DEBUGFLAGS_C-Compiler) $(CC_ARCH_SPEC) -W:c:,-Xclib-optim-off -Xansi -Xlocal-data-area-static-only -Xforce-declarations -Xmake-dependency=0xd $(ADDED_CFLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<"
411413
bdbvxw/$(MODE_DIR)/Objects/$(BDB_OBJECT_DIR)/src/os/os_cpu.o : $(BDB_ROOT)/src/os/os_cpu.c
@@ -639,6 +641,7 @@ OBJECTS_bdbvxw = \
639641
bdbvxw/$(MODE_DIR)/Objects/$(BDB_OBJECT_DIR)/src/mutex/mut_tas.o \
640642
bdbvxw/$(MODE_DIR)/Objects/$(BDB_OBJECT_DIR)/src/os/os_abort.o \
641643
bdbvxw/$(MODE_DIR)/Objects/$(BDB_OBJECT_DIR)/src/os/os_alloc.o \
644+
bdbvxw/$(MODE_DIR)/Objects/$(BDB_OBJECT_DIR)/src/os/os_atomic.o \
642645
bdbvxw/$(MODE_DIR)/Objects/$(BDB_OBJECT_DIR)/src/os/os_clock.o \
643646
bdbvxw/$(MODE_DIR)/Objects/$(BDB_OBJECT_DIR)/src/os/os_cpu.o \
644647
bdbvxw/$(MODE_DIR)/Objects/$(BDB_OBJECT_DIR)/src/os/os_ctime.o \
@@ -839,6 +842,7 @@ DEP_FILES := \
839842
bdbvxw/$(MODE_DIR)/Objects/$(BDB_OBJECT_DIR)/src/mutex/mut_tas.d \
840843
bdbvxw/$(MODE_DIR)/Objects/$(BDB_OBJECT_DIR)/src/os/os_abort.d \
841844
bdbvxw/$(MODE_DIR)/Objects/$(BDB_OBJECT_DIR)/src/os/os_alloc.d \
845+
bdbvxw/$(MODE_DIR)/Objects/$(BDB_OBJECT_DIR)/src/os/os_atomic.d \
842846
bdbvxw/$(MODE_DIR)/Objects/$(BDB_OBJECT_DIR)/src/os/os_clock.d \
843847
bdbvxw/$(MODE_DIR)/Objects/$(BDB_OBJECT_DIR)/src/os/os_cpu.d \
844848
bdbvxw/$(MODE_DIR)/Objects/$(BDB_OBJECT_DIR)/src/os/os_ctime.d \

build_vxworks/db_config.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,18 @@
6060
operations. */
6161
/* #undef HAVE_ATOMIC_X86_GCC_ASSEMBLY */
6262

63+
/* Define to 1 to use GCC __atomic_* builtins for atomic operations. */
64+
/* #undef HAVE_ATOMIC_BUILTINS */
65+
66+
/* Define to 1 to use GCC __sync_* builtins for atomic operations. */
67+
/* #undef HAVE_SYNC_BUILTINS */
68+
69+
/* Define to 1 for ARM64/AArch64 atomic operation support. */
70+
/* #undef HAVE_ATOMIC_AARCH64 */
71+
72+
/* Define to 1 if 64-bit atomic operations are supported. */
73+
/* #undef HAVE_ATOMIC_64BIT */
74+
6375
/* Define to 1 if you have the `backtrace' function. */
6476
/* #undef HAVE_BACKTRACE */
6577

build_vxworks/db_config_small.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,18 @@
6060
operations. */
6161
/* #undef HAVE_ATOMIC_X86_GCC_ASSEMBLY */
6262

63+
/* Define to 1 to use GCC __atomic_* builtins for atomic operations. */
64+
/* #undef HAVE_ATOMIC_BUILTINS */
65+
66+
/* Define to 1 to use GCC __sync_* builtins for atomic operations. */
67+
/* #undef HAVE_SYNC_BUILTINS */
68+
69+
/* Define to 1 for ARM64/AArch64 atomic operation support. */
70+
/* #undef HAVE_ATOMIC_AARCH64 */
71+
72+
/* Define to 1 if 64-bit atomic operations are supported. */
73+
/* #undef HAVE_ATOMIC_64BIT */
74+
6375
/* Define to 1 if you have the `backtrace' function. */
6476
/* #undef HAVE_BACKTRACE */
6577

build_windows/db_config.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,18 @@
5252
operations. */
5353
/* #undef HAVE_ATOMIC_X86_GCC_ASSEMBLY */
5454

55+
/* Define to 1 to use GCC __atomic_* builtins for atomic operations. */
56+
/* #undef HAVE_ATOMIC_BUILTINS */
57+
58+
/* Define to 1 to use GCC __sync_* builtins for atomic operations. */
59+
/* #undef HAVE_SYNC_BUILTINS */
60+
61+
/* Define to 1 for ARM64/AArch64 atomic operation support. */
62+
/* #undef HAVE_ATOMIC_AARCH64 */
63+
64+
/* Define to 1 if 64-bit atomic operations are supported. */
65+
/* #undef HAVE_ATOMIC_64BIT */
66+
5567
/* Define to 1 if you have the `backtrace' function. */
5668
/* Define to 1 if you have the `backtrace' function. */
5769
/* #undef HAVE_BACKTRACE */

dist/Makefile.in

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ DTRACE_OBJS= @ADDITIONAL_OBJS@ @REPLACEMENT_OBJS@ @CRYPTO_OBJS@ \
282282
mp_fmethod@o@ mp_fopen@o@ mp_fput@o@ mp_fset@o@ mp_method@o@ \
283283
mp_mvcc@o@ mp_region@o@ mp_register@o@ mp_resize@o@ mp_stat@o@ \
284284
mp_sync@o@ mp_trickle@o@ openflags@o@ os_abort@o@ os_abs@o@ \
285-
os_alloc@o@ os_clock@o@ os_cpu@o@ os_ctime@o@ os_config@o@ \
285+
os_alloc@o@ os_atomic@o@ os_clock@o@ os_cpu@o@ os_ctime@o@ os_config@o@ \
286286
os_dir@o@ os_errno@o@ os_fid@o@ os_flock@o@ os_fsync@o@ \
287287
os_getenv@o@ os_handle@o@ os_map@o@ os_method@o@ os_mkdir@o@ \
288288
os_open@o@ os_path@o@ os_pid@o@ os_rename@o@ os_root@o@ \
@@ -840,6 +840,27 @@ all: @BUILD_TARGET@
840840

841841
install: all @INSTALL_TARGET@
842842

843+
test: cutest
844+
./cutest
845+
846+
##################################################
847+
# compile_commands.json generation for LSP support.
848+
# Requires bear (https://github.com/rizsotto/Bear).
849+
# Enable with: ../dist/configure --enable-compile-commands
850+
##################################################
851+
BEAR= @BEAR@
852+
853+
compile-commands:
854+
@if test -z "$(BEAR)"; then \
855+
echo "Error: bear not found. Reconfigure with --enable-compile-commands." >&2; \
856+
exit 1; \
857+
fi
858+
$(BEAR) -o compile_commands.json -- $(MAKE) library_build
859+
@echo "Generated compile_commands.json"
860+
861+
compile-commands-build:
862+
$(BEAR) -o compile_commands.json -- $(MAKE) library_build
863+
843864
##################################################
844865
# Library and standard utilities build.
845866
##################################################
@@ -1201,6 +1222,7 @@ mostly-clean clean:
12011222
$(RM) -r RUN_LOG RUNQUEUE TESTDIR TESTDIR.A TEST.LIST
12021223
$(RM) -r logtrack_seen.db test_micro test_mutex .libs
12031224
$(RM) -r $(LIB_INSTALL_FILE_LIST)
1225+
$(RM) compile_commands.json
12041226
@subdir_cmd@
12051227

12061228
REALCLEAN_LIST=\
@@ -2219,6 +2241,8 @@ os_addrinfo@o@: $(srcdir)/os/os_addrinfo.c
22192241
$(CC) $(CFLAGS) $?
22202242
os_alloc@o@: $(srcdir)/os/os_alloc.c
22212243
$(CC) $(CFLAGS) $?
2244+
os_atomic@o@: $(srcdir)/os/os_atomic.c
2245+
$(CC) $(CFLAGS) $?
22222246
os_clock@o@: $(srcdir)/@OSDIR@/os_clock.c
22232247
$(CC) $(CFLAGS) $?
22242248
os_config@o@: $(srcdir)/@OSDIR@/os_config.c

dist/RELEASE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ DB_VERSION_LETTER="g"
55
DB_VERSION_RELEASE=2
66
DB_VERSION_MAJOR=5
77
DB_VERSION_MINOR=3
8-
DB_VERSION_PATCH=28
8+
DB_VERSION_PATCH=29
99
DB_VERSION="$DB_VERSION_MAJOR.$DB_VERSION_MINOR.$DB_VERSION_PATCH"
1010
DB_VERSION_FULL="$DB_VERSION_FAMILY.$DB_VERSION_RELEASE.$DB_VERSION_MAJOR.$DB_VERSION_MINOR.$DB_VERSION_PATCH"
1111

dist/aclocal/clock.m4

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,14 @@ esac
1919
# run the program if possible, because we don't trust the #define's
2020
# existence to mean the clock really exists.
2121
AC_CACHE_CHECK([for clock_gettime monotonic clock], db_cv_clock_monotonic, [
22-
AC_TRY_RUN([
23-
#include <sys/time.h>
24-
main() {
22+
AC_RUN_IFELSE([AC_LANG_PROGRAM([[#include <sys/time.h>]], [[
2523
struct timespec t;
2624
return (clock_gettime(CLOCK_MONOTONIC, &t) != 0);
27-
}], db_cv_clock_monotonic=yes, db_cv_clock_monotonic=no,
28-
AC_TRY_LINK([
29-
#include <sys/time.h>], [
25+
]])], [db_cv_clock_monotonic=yes], [db_cv_clock_monotonic=no],
26+
[AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <sys/time.h>]], [[
3027
struct timespec t;
3128
clock_gettime(CLOCK_MONOTONIC, &t);
32-
], db_cv_clock_monotonic=yes, db_cv_clock_monotonic=no))
29+
]])], [db_cv_clock_monotonic=yes], [db_cv_clock_monotonic=no])])
3330
])
3431
if test "$db_cv_clock_monotonic" = "yes"; then
3532
AC_DEFINE(HAVE_CLOCK_MONOTONIC)
@@ -46,10 +43,10 @@ fi
4643
AC_CHECK_FUNCS(ctime_r)
4744
if test "$ac_cv_func_ctime_r" = "yes"; then
4845
AC_CACHE_CHECK([for 2 or 3 argument version of ctime_r], db_cv_ctime_r_3arg, [
49-
AC_TRY_LINK([
50-
#include <time.h>], [
46+
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
47+
#include <time.h>]], [[
5148
ctime_r(NULL, NULL, 100);
52-
], [db_cv_ctime_r_3arg="3-argument"], [db_cv_ctime_r_3arg="2-argument"])])
49+
]])], [db_cv_ctime_r_3arg="3-argument"], [db_cv_ctime_r_3arg="2-argument"])])
5350
fi
5451
if test "$db_cv_ctime_r_3arg" = "3-argument"; then
5552
AC_DEFINE(HAVE_CTIME_R_3ARG)

0 commit comments

Comments
 (0)