summaryrefslogtreecommitdiff
path: root/security/cyrus-saslauthd/patches/patch-ae
blob: f84b0c9dde9833742c5714abe6393e10ab3f598b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
$NetBSD: patch-ae,v 1.1 2006/04/18 17:42:59 jlam Exp $

--- configure.in.orig	2005-05-07 00:54:18.000000000 -0400
+++ configure.in
@@ -80,20 +80,36 @@ if test "$authsasldb" != no; then
   SASL_DB_LIB="$SASL_DB_LIB ../sasldb/.libs/libsasldb.al"
 fi
 
-AC_ARG_WITH(pam, [  --with-pam=DIR          use PAM (rooted in DIR) [yes] ],
-	with_pam=$withval,
-	with_pam=yes)
+AC_ARG_WITH(pam, [  --with-pam=DIR          use PAM (rooted in DIR) [[yes]] ],
+        with_pam=$withval,
+        with_pam=yes)
 if test "$with_pam" != no; then
   if test -d $with_pam; then
     CPPFLAGS="$CPPFLAGS -I${with_pam}/include"
     LDFLAGS="$LDFLAGS -L${with_pam}/lib"
   fi
+  AC_CHECK_HEADERS(security/pam_appl.h pam/pam_appl.h)
   cmu_save_LIBS="$LIBS"
-  AC_CHECK_LIB(pam, pam_start, [
-	  AC_CHECK_HEADER(security/pam_appl.h,,
-			  with_pam=no)],
-		with_pam=no, $SASL_DL_LIB)
-  LIBS="$cmu_save_LIBS"
+  AC_CHECK_FUNC(pam_start, :,
+        LIBS="-lpam $LIBS"
+        AC_TRY_LINK([[
+#include <sys/types.h>
+#ifdef HAVE_PAM_PAM_APPL_H
+#include <pam/pam_appl.h>
+#endif
+#ifdef HAVE_SECURITY_PAM_H
+#include <security/pam_appl.h>
+#endif]],[[
+const char *service="foo";
+const char *user="bar";
+pam_handle_t *pamh;
+struct pam_conv *conv;
+int baz;
+baz = pam_start(service, user, conv, &pamh);
+return 0;
+]], LIBPAM="-lpam")
+)
+  LIBS="$cmu_save_LIBS $LIBPAM"
 fi
 
 AC_ARG_WITH(ipctype, [  --with-ipctype={unix,doors}    use ipctype [unix] ],