Blob Blame History Raw
Berkeley DB 4.8 is currently unmaintained.  This is a downstream-only patch:
https://bugzilla.redhat.com/show_bug.cgi?id=2179373

diff -Naur db-4.8.30.NC.old/dist/aclocal/clock.m4 db-4.8.30.NC/dist/aclocal/clock.m4
--- db-4.8.30.NC.old/dist/aclocal/clock.m4	2023-03-16 17:29:41.590391954 +0100
+++ db-4.8.30.NC/dist/aclocal/clock.m4	2023-03-16 20:25:53.746678514 +0100
@@ -21,6 +21,8 @@
 AC_CACHE_CHECK([for clock_gettime monotonic clock], db_cv_clock_monotonic, [
 AC_TRY_RUN([
 #include <sys/time.h>
+#include <time.h>
+int
 main() {
 	struct timespec t;
 	return (clock_gettime(CLOCK_MONOTONIC, &t) != 0);
diff -Naur db-4.8.30.NC.old/dist/aclocal/mutex.m4 db-4.8.30.NC/dist/aclocal/mutex.m4
--- db-4.8.30.NC.old/dist/aclocal/mutex.m4	2023-03-16 17:29:41.591391960 +0100
+++ db-4.8.30.NC/dist/aclocal/mutex.m4	2023-03-16 20:46:57.039502577 +0100
@@ -4,6 +4,8 @@
 AC_DEFUN(AM_PTHREADS_SHARED, [
 AC_TRY_RUN([
 #include <pthread.h>
+#include <stdlib.h>
+int
 main() {
 	pthread_cond_t cond;
 	pthread_mutex_t mutex;
@@ -24,7 +26,8 @@
 	pthread_mutexattr_destroy(&mutexattr));
 }], [db_cv_mutex="$1"],,
 AC_TRY_LINK([
-#include <pthread.h>],[
+#include <pthread.h>
+#include <stdlib.h>],[
 	pthread_cond_t cond;
 	pthread_mutex_t mutex;
 	pthread_condattr_t condattr;
@@ -46,6 +49,8 @@
 AC_DEFUN(AM_PTHREADS_PRIVATE, [
 AC_TRY_RUN([
 #include <pthread.h>
+#include <stdlib.h>
+int
 main() {
 	pthread_cond_t cond;
 	pthread_mutex_t mutex;
@@ -64,7 +69,8 @@
 	pthread_mutexattr_destroy(&mutexattr));
 }], [db_cv_mutex="$1"],,
 AC_TRY_LINK([
-#include <pthread.h>],[
+#include <pthread.h>
+#include <stdlib.h>],[
 	pthread_cond_t cond;
 	pthread_mutex_t mutex;
 	pthread_condattr_t condattr;
@@ -158,7 +164,8 @@
 	# LWP threads: _lwp_XXX
 	if test "$db_cv_mutex" = no; then
 	AC_TRY_LINK([
-	#include <synch.h>],[
+	#include <synch.h>
+	#include <stdlib.h>],[
 		static lwp_mutex_t mi = SHAREDMUTEX;
 		static lwp_cond_t ci = SHAREDCV;
 		lwp_mutex_t mutex = mi;
@@ -174,7 +181,8 @@
 	LIBS="$LIBS -lthread"
 	AC_TRY_LINK([
 	#include <thread.h>
-	#include <synch.h>],[
+	#include <synch.h>
+	#include <stdlib.h>],[
 		mutex_t mutex;
 		cond_t cond;
 		int type = USYNC_PROCESS;
@@ -189,7 +197,8 @@
 	if test "$db_cv_mutex" = no -o "$db_cv_mutex" = ui_only; then
 	AC_TRY_LINK([
 	#include <thread.h>
-	#include <synch.h>],[
+	#include <synch.h>
+	#include <stdlib.h>],[
 		mutex_t mutex;
 		cond_t cond;
 		int type = USYNC_PROCESS;
@@ -211,7 +220,8 @@
 	# anyway.
 	#
 	# x86/gcc: FreeBSD, NetBSD, BSD/OS, Linux
-	AC_TRY_COMPILE(,[
+	AC_TRY_COMPILE([
+	#include <stdlib.h>],[
 	#if (defined(i386) || defined(__i386__)) && defined(__GNUC__)
 		exit(0);
 	#else
@@ -220,7 +230,8 @@
 	], [db_cv_mutex="$db_cv_mutex/x86/gcc-assembly"])
 
 	# x86_64/gcc: FreeBSD, NetBSD, BSD/OS, Linux
-	AC_TRY_COMPILE(,[
+	AC_TRY_COMPILE([
+	#include <stdlib.h>],[
 	#if (defined(x86_64) || defined(__x86_64__)) && defined(__GNUC__)
 		exit(0);
 	#else
@@ -242,7 +253,8 @@
 	], [db_cv_mutex="$db_cv_mutex/Solaris/_lock_try/membar"])
 
 	# Sparc/gcc: SunOS, Solaris, ultrasparc assembler support
-	AC_TRY_COMPILE(,[
+	AC_TRY_COMPILE([
+	#include <stdlib.h>],[
 	#if defined(__sparc__) && defined(__GNUC__)
 		asm volatile ("membar #StoreStore|#StoreLoad|#LoadStore");
 		exit(0);
@@ -280,7 +292,8 @@
 # Try HPPA before general msem test, it needs special alignment.
 if test "$db_cv_mutex" = no; then
 AC_TRY_LINK([
-#include <sys/mman.h>],[
+#include <sys/mman.h>
+#include <stdlib.h>],[
 #if defined(__hppa)
 	typedef msemaphore tsl_t;
 	msemaphore x;
@@ -298,7 +311,8 @@
 if test "$db_cv_mutex" = no; then
 AC_TRY_LINK([
 #include <sys/types.h>
-#include <sys/mman.h>],[
+#include <sys/mman.h>
+#include <stdlib.h>],[
 	typedef msemaphore tsl_t;
 	msemaphore x;
 	msem_init(&x, 0);
@@ -324,7 +338,8 @@
 
 # SCO: UnixWare has threads in libthread, but OpenServer doesn't.
 if test "$db_cv_mutex" = no; then
-AC_TRY_COMPILE(,[
+AC_TRY_COMPILE([
+#include <stdlib.h>],[
 #if defined(__USLC__)
 	exit(0);
 #else
@@ -381,7 +396,8 @@
 
 # Tru64/cc
 if test "$db_cv_mutex" = no; then
-AC_TRY_COMPILE(,[
+AC_TRY_COMPILE([
+#include <stdlib.h>],[
 #if defined(__alpha) && defined(__DECC)
 	exit(0);
 #else
@@ -392,7 +408,8 @@
 
 # Alpha/gcc
 if test "$db_cv_mutex" = no; then
-AC_TRY_COMPILE(,[
+AC_TRY_COMPILE([
+#include <stdlib.h>],[
 #if defined(__alpha) && defined(__GNUC__)
 	exit(0);
 #else
@@ -403,7 +420,8 @@
 
 # ARM/gcc: Linux
 if test "$db_cv_mutex" = no; then
-AC_TRY_COMPILE(,[
+AC_TRY_COMPILE([
+#include <stdlib.h>],[
 #if defined(__arm__) && defined(__GNUC__)
 	exit(0);
 #else
@@ -414,7 +432,8 @@
 
 # MIPS/gcc: Linux
 if test "$db_cv_mutex" = no; then
-AC_TRY_COMPILE(,[
+AC_TRY_COMPILE([
+#include <stdlib.h>],[
 #if (defined(__mips) || defined(__mips__)) && defined(__GNUC__)
 	exit(0);
 #else
@@ -425,7 +444,8 @@
 
 # PaRisc/gcc: HP/UX
 if test "$db_cv_mutex" = no; then
-AC_TRY_COMPILE(,[
+AC_TRY_COMPILE([
+#include <stdlib.h>],[
 #if (defined(__hppa) || defined(__hppa__)) && defined(__GNUC__)
 	exit(0);
 #else
@@ -436,7 +456,8 @@
 
 # PPC/gcc:
 if test "$db_cv_mutex" = no; then
-AC_TRY_COMPILE(,[
+AC_TRY_COMPILE([
+#include <stdlib.h>],[
 #if (defined(__powerpc__) || defined(__ppc__)) && defined(__GNUC__)
 	exit(0);
 #else
@@ -447,7 +468,8 @@
 
 # 68K/gcc: SunOS
 if test "$db_cv_mutex" = no; then
-AC_TRY_COMPILE(,[
+AC_TRY_COMPILE([
+#include <stdlib.h>],[
 #if (defined(mc68020) || defined(sun3)) && defined(__GNUC__)
 	exit(0);
 #else
@@ -458,7 +480,8 @@
 
 # S390/cc: IBM OS/390 Unix
 if test "$db_cv_mutex" = no; then
-AC_TRY_COMPILE(,[
+AC_TRY_COMPILE([
+#include <stdlib.h>],[
 #if defined(__MVS__) && defined(__IBMC__)
 	exit(0);
 #else
@@ -469,7 +492,8 @@
 
 # S390/gcc: Linux
 if test "$db_cv_mutex" = no; then
-AC_TRY_COMPILE(,[
+AC_TRY_COMPILE([
+#include <stdlib.h>],[
 #if defined(__s390__) && defined(__GNUC__)
 	exit(0);
 #else
@@ -480,7 +504,8 @@
 
 # ia64/gcc: Linux
 if test "$db_cv_mutex" = no; then
-AC_TRY_COMPILE(,[
+AC_TRY_COMPILE([
+#include <stdlib.h>],[
 #if defined(__ia64) && defined(__GNUC__)
 	exit(0);
 #else
@@ -491,7 +516,8 @@
 
 # uts/cc: UTS
 if test "$db_cv_mutex" = no; then
-AC_TRY_COMPILE(,[
+AC_TRY_COMPILE([
+#include <stdlib.h>],[
 #if defined(_UTS)
 	exit(0);
 #else
@@ -812,7 +838,8 @@
 fi
 
 if test "$db_cv_atomic" = no; then
-	AC_TRY_COMPILE(,[
+	AC_TRY_COMPILE([
+	#include <stdlib.h>],[
 	#if ((defined(i386) || defined(__i386__)) && defined(__GNUC__))
 		exit(0);
 	#elif ((defined(x86_64) || defined(__x86_64__)) && defined(__GNUC__))
@@ -825,7 +852,8 @@
 
 if test "$db_cv_atomic" = no; then
 AC_TRY_LINK([
-#include <sys/atomic.h>],[
+#include <sys/atomic.h>
+#include <stdlib.h>],[
 	volatile unsigned val = 1;
 	exit (atomic_inc_uint_nv(&val) != 2 ||
 	      atomic_dec_uint_nv(&val) != 1 ||
diff -Naur db-4.8.30.NC.old/dist/aclocal/sequence.m4 db-4.8.30.NC/dist/aclocal/sequence.m4
--- db-4.8.30.NC.old/dist/aclocal/sequence.m4	2023-03-16 17:29:41.591391960 +0100
+++ db-4.8.30.NC/dist/aclocal/sequence.m4	2023-03-16 21:47:07.623110108 +0100
@@ -43,6 +43,9 @@
 	# test, which won't test for the appropriate printf format strings.
 	if test "$db_cv_build_sequence" = "yes"; then
 		AC_TRY_RUN([
+		#include <stdio.h>
+		#include <string.h>
+		int
 		main() {
 			$db_cv_seq_type l;
 			unsigned $db_cv_seq_type u;
@@ -59,7 +62,9 @@
 				return (1);
 			return (0);
 		}],, [db_cv_build_sequence="no"],
-		AC_TRY_LINK(,[
+		AC_TRY_LINK([
+			#include <stdio.h>
+			#include <string.h>],[
 			$db_cv_seq_type l;
 			unsigned $db_cv_seq_type u;
 			char buf@<:@100@:>@;
diff -Naur db-4.8.30.NC.old/dist/configure db-4.8.30.NC/dist/configure
--- db-4.8.30.NC.old/dist/configure	2023-03-16 17:29:41.587391937 +0100
+++ db-4.8.30.NC/dist/configure	2023-03-17 15:34:52.507864862 +0100
@@ -3057,7 +3057,7 @@
 
 DB_VERSION_PATCH="30"
 
-DB_VERSION_STRING='"Berkeley DB 4.8.30: (April  9, 2010)"'
+DB_VERSION_STRING='"Berkeley DB 4.8.30: (March 17, 2023)"'
 
 
 # Process all options before using them.
@@ -18756,6 +18756,7 @@
 /* end confdefs.h.  */
 
 #include <pthread.h>
+#include <stdlib.h>
 int
 main ()
 {
@@ -18792,6 +18793,8 @@
 /* end confdefs.h.  */
 
 #include <pthread.h>
+#include <stdlib.h>
+int
 main() {
 	pthread_cond_t cond;
 	pthread_mutex_t mutex;
@@ -18828,6 +18831,7 @@
 /* end confdefs.h.  */
 
 #include <pthread.h>
+#include <stdlib.h>
 int
 main ()
 {
@@ -18864,6 +18868,8 @@
 /* end confdefs.h.  */
 
 #include <pthread.h>
+#include <stdlib.h>
+int
 main() {
 	pthread_cond_t cond;
 	pthread_mutex_t mutex;
@@ -18899,6 +18905,7 @@
 /* end confdefs.h.  */
 
 #include <pthread.h>
+#include <stdlib.h>
 int
 main ()
 {
@@ -18933,6 +18940,8 @@
 /* end confdefs.h.  */
 
 #include <pthread.h>
+#include <stdlib.h>
+int
 main() {
 	pthread_cond_t cond;
 	pthread_mutex_t mutex;
@@ -18967,6 +18976,7 @@
 /* end confdefs.h.  */
 
 #include <pthread.h>
+#include <stdlib.h>
 int
 main ()
 {
@@ -19001,6 +19011,8 @@
 /* end confdefs.h.  */
 
 #include <pthread.h>
+#include <stdlib.h>
+int
 main() {
 	pthread_cond_t cond;
 	pthread_mutex_t mutex;
@@ -19038,6 +19050,7 @@
 /* end confdefs.h.  */
 
 	#include <synch.h>
+	#include <stdlib.h>
 int
 main ()
 {
@@ -19069,6 +19082,7 @@
 
 	#include <thread.h>
 	#include <synch.h>
+	#include <stdlib.h>
 int
 main ()
 {
@@ -19099,6 +19113,7 @@
 
 	#include <thread.h>
 	#include <synch.h>
+	#include <stdlib.h>
 int
 main ()
 {
@@ -19136,6 +19151,7 @@
 	cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
+	#include <stdlib.h>
 int
 main ()
 {
@@ -19159,6 +19175,7 @@
 	cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
+	#include <stdlib.h>
 int
 main ()
 {
@@ -19210,6 +19227,7 @@
 	cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
+	#include <stdlib.h>
 int
 main ()
 {
@@ -19277,6 +19295,7 @@
 /* end confdefs.h.  */
 
 #include <sys/mman.h>
+#include <stdlib.h>
 int
 main ()
 {
@@ -19310,6 +19329,7 @@
 
 #include <sys/types.h>
 #include <sys/mman.h>
+#include <stdlib.h>
 int
 main ()
 {
@@ -19366,6 +19386,7 @@
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
+#include <stdlib.h>
 int
 main ()
 {
@@ -19497,6 +19518,7 @@
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
+#include <stdlib.h>
 int
 main ()
 {
@@ -19522,6 +19544,7 @@
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
+#include <stdlib.h>
 int
 main ()
 {
@@ -19547,6 +19570,7 @@
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
+#include <stdlib.h>
 int
 main ()
 {
@@ -19572,6 +19596,7 @@
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
+#include <stdlib.h>
 int
 main ()
 {
@@ -19597,6 +19622,7 @@
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
+#include <stdlib.h>
 int
 main ()
 {
@@ -19622,6 +19648,7 @@
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
+#include <stdlib.h>
 int
 main ()
 {
@@ -19647,6 +19674,7 @@
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
+#include <stdlib.h>
 int
 main ()
 {
@@ -19672,6 +19700,7 @@
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
+#include <stdlib.h>
 int
 main ()
 {
@@ -19697,6 +19726,7 @@
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
+#include <stdlib.h>
 int
 main ()
 {
@@ -19722,6 +19752,7 @@
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
+#include <stdlib.h>
 int
 main ()
 {
@@ -19747,6 +19778,7 @@
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
+#include <stdlib.h>
 int
 main ()
 {
@@ -20198,6 +20230,7 @@
 	cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
+	#include <stdlib.h>
 int
 main ()
 {
@@ -20225,6 +20258,7 @@
 /* end confdefs.h.  */
 
 #include <sys/atomic.h>
+#include <stdlib.h>
 int
 main ()
 {
@@ -20743,6 +20777,8 @@
 /* end confdefs.h.  */
 
 #include <sys/time.h>
+#include <time.h>
+int
 main() {
 	struct timespec t;
 	return (clock_gettime(CLOCK_MONOTONIC, &t) != 0);
@@ -21600,6 +21636,8 @@
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
+			#include <stdio.h>
+			#include <string.h>
 int
 main ()
 {
@@ -21634,6 +21672,9 @@
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
+		#include <stdio.h>
+		#include <string.h>
+		int
 		main() {
 			$db_cv_seq_type l;
 			unsigned $db_cv_seq_type u;