blob: c5a42359b99bf49e5864730672bf9533dc369569 [file] [log] [blame]
Andrew Geissler87f5cff2022-09-30 13:13:31 -05001From 1915754179401b6ee00f0e2ffd844596778e43a2 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Thu, 1 Sep 2022 12:05:02 -0700
4Subject: [PATCH] configure: Check for function from libdb during configure
5
6checking for main in AC_CHECK_LIB is not the right check to find out if
7a library exists or not, using a function provided by library is more
8appropriate and will help using newer compilers and autoconf in future
9
10Upstream-Status: Submitted [https://github.com/PADL/pam_ccreds/pull/2]
11Signed-off-by: Khem Raj <raj.khem@gmail.com>
12---
13 configure.in | 4 ++--
14 1 file changed, 2 insertions(+), 2 deletions(-)
15
16diff --git a/configure.in b/configure.in
17index 3829d9f..3d52933 100644
18--- a/configure.in
19+++ b/configure.in
20@@ -72,9 +72,9 @@ AC_CHECK_HEADERS(pam/pam_appl.h pam/pam_misc.h pam/pam_modules.h)
21
22 AC_CHECK_HEADERS(db.h)
23
24-AC_CHECK_LIB(db, main,[LIBS="-ldb $LIBS" found_db_lib=yes],,$LIBS)
25+AC_CHECK_LIB(db, db_create,[LIBS="-ldb $LIBS" found_db_lib=yes],,$LIBS)
26 if test -z "$found_db_lib"; then
27- AC_CHECK_LIB(db1, main,[LIBS="-ldb1 $LIBS" found_db_lib=yes],,$LIBS)
28+ AC_CHECK_LIB(db1, db_create,[LIBS="-ldb1 $LIBS" found_db_lib=yes],,$LIBS)
29 fi
30
31 AC_CHECK_LIB(pam, pam_start)
32--
332.37.3
34