Use AC_CHECK_FILE instead of link

This commit is contained in:
Dmitry Belyavskiy 2021-05-04 16:19:38 +02:00
parent c91728d8af
commit 79706966b5

View File

@ -13,36 +13,21 @@ diff -up cyrus-sasl-2.1.27/configure.ac.frombdb cyrus-sasl-2.1.27/configure.ac
plugindir=$withval,
diff -up cyrus-sasl-2.1.27/m4/berkdb.m4.frombdb cyrus-sasl-2.1.27/m4/berkdb.m4
--- cyrus-sasl-2.1.27/m4/berkdb.m4.frombdb 2016-01-29 18:35:35.000000000 +0100
+++ cyrus-sasl-2.1.27/m4/berkdb.m4 2021-04-28 15:36:37.320675385 +0200
@@ -286,3 +286,25 @@ AC_DEFUN([CYRUS_BERKELEY_DB_CHK],
+++ cyrus-sasl-2.1.27/m4/berkdb.m4 2021-05-04 15:58:12.266748283 +0200
@@ -286,3 +286,10 @@ AC_DEFUN([CYRUS_BERKELEY_DB_CHK],
CPPFLAGS=$cmu_save_CPPFLAGS
])
+
+AC_DEFUN([CYRUS_BERKELEY_DB_STATIC_LIB],
+[
+ BDB_SAVE_LDFLAGS=$LDFLAGS
+
+ saved_LIBS=$LIBS
+ for dbname in /usr/lib/libdb-5.3.a \
+ /usr/lib64/libdb-5.3.a
+ do
+ LIBS="$saved_LIBS $dbname -lpthread"
+ AC_TRY_LINK([#include <stdio.h>
+#include <db.h>],
+ [db_create(NULL, NULL, 0);],
+ BDB_STATIC_LIBADD="$dbname -lpthread"; dblib="berkeley";
+ dblib="no")
+ if test "$dblib" = "berkeley"; then break; fi
+ done
+ LIBS=$saved_LIBS
+
+ LDFLAGS=$BDB_SAVE_LDFLAGS
+ BDB_STATIC_LIBADD="$dbname -lpthread"
+BDB_STATIC_LIBADD="/dev/null -lpthread"
+AC_CHECK_FILE([/usr/lib64/libdb-5.3.a],[BDB_STATIC_LIBADD="/usr/lib64/libdb-5.3.a -lpthread "],[])
+AC_CHECK_FILE([/usr/lib/libdb-5.3.a],[BDB_STATIC_LIBADD="/usr/lib/libdb-5.3.a -lpthread"],[])
+])
diff -up cyrus-sasl-2.1.27/m4/sasldb.m4.frombdb cyrus-sasl-2.1.27/m4/sasldb.m4
--- cyrus-sasl-2.1.27/m4/sasldb.m4.frombdb 2017-07-13 20:45:19.000000000 +0200
+++ cyrus-sasl-2.1.27/m4/sasldb.m4 2021-04-28 15:36:37.321675394 +0200
+++ cyrus-sasl-2.1.27/m4/sasldb.m4 2021-05-04 15:51:20.827090074 +0200
@@ -111,7 +111,7 @@ AC_MSG_RESULT($dblib)
SASL_DB_BACKEND="db_${dblib}.lo"
SASL_DB_BACKEND_STATIC="db_${dblib}.o allockey.o"