summaryrefslogtreecommitdiff
blob: 617ef76ee876da295516bcf3942028c762096899 (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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
--- nss-ldapd-0.6.4/configure.ac	2008-07-20 02:43:29.000000000 -0700
+++ nss-ldapd-0.6.4.new/configure.ac	2008-08-11 12:25:54.000000000 -0700
@@ -105,6 +105,22 @@
   fi
 done
 
+AC_MSG_CHECKING(--enable-sasl argument)
+AC_ARG_ENABLE(sasl,
+              AS_HELP_STRING([--enable-sasl],
+                             [enable sasl support]),
+              [enable_sasl=$enableval],
+              [enable_sasl="no"])
+AC_MSG_RESULT($enable_sasl)
+
+AC_MSG_CHECKING(--enable-kerberos argument)
+AC_ARG_ENABLE(kerberos,
+              AS_HELP_STRING([--enable-kerberos],
+                             [enable kerberos support]),
+              [enable_kerberos=$enableval],
+              [enable_kerberos="no"])
+AC_MSG_RESULT($enable_kerberos)
+
 AC_ARG_WITH(ldap-lib,
             AS_HELP_STRING([--with-ldap-lib=TYPE],
                            [select ldap library (auto|netscape5|netscape4|netscape3|umich|openldap) @<:@auto@:>@]))
@@ -153,11 +169,19 @@
 AC_CHECK_HEADERS(ctype.h)
 AC_CHECK_HEADERS(getopt.h)
 AC_CHECK_HEADERS(sys/un.h)
-AC_CHECK_HEADERS(sasl.h sasl/sasl.h)
+
+if test "$enable_sasl" = "yes"; then
+    AC_CHECK_HEADERS(sasl.h sasl/sasl.h)
+    AC_CHECK_HEADERS(gsssasl.h)
+fi
+
 AC_CHECK_HEADERS(strings.h)
 AC_CHECK_HEADERS(gssldap.h)
-AC_CHECK_HEADERS(gsssasl.h)
-AC_CHECK_HEADERS(gssapi/gssapi_krb5.h gssapi.h)
+
+if test "$enable_kerberos" = "yes"; then
+    AC_CHECK_HEADERS(gssapi/gssapi_krb5.h gssapi.h)
+fi
+
 AC_CHECK_HEADERS(grp.h)
 AC_CHECK_HEADERS(sys/socket.h)
 AC_CHECK_HEADERS(sys/ucred.h)
@@ -249,13 +273,15 @@
     #include <sys/un.h>
     #include <sys/types.h>])
 
-AC_CHECK_TYPE(sasl_interact_t,
-    AC_DEFINE(HAVE_SASL_INTERACT_T,1,[Define to 1 if you have a `sasl_interact_t' definition.]),,[
-    #ifdef HAVE_SASL_SASL_H
-    #include <sasl/sasl.h>
-    #elif defined(HAVE_SASL_H)
-    #include <sasl.h>
-    #endif])
+if test "$enable_sasl" = "yes"; then
+    AC_CHECK_TYPE(sasl_interact_t,
+        AC_DEFINE(HAVE_SASL_INTERACT_T,1,[Define to 1 if you have a `sasl_interact_t' definition.]),,[
+        #ifdef HAVE_SASL_SASL_H
+        #include <sasl/sasl.h>
+        #elif defined(HAVE_SASL_H)
+        #include <sasl.h>
+        #endif])
+fi
 
 # checks for LDAP library
 save_LIBS="$LIBS"
@@ -269,10 +295,13 @@
 LIBS="$PTHREAD_LIBS $LIBS"
 CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
 
-AC_CHECK_LIB(gssapi, gss_krb5_ccache_name,[LIBS="-lgssapi $LIBS" found_gssapi_lib=yes],,$LIBS)
-if test -z "$found_gssapi_lib"
-then
-  AC_CHECK_LIB(gssapi_krb5, gss_krb5_ccache_name,[LIBS="-lgssapi_krb5 $LIBS"],,$LIBS)
+if test "$enable_kerberos" = "yes"; then
+    AC_CHECK_LIB(gssapi, gss_krb5_ccache_name,[LIBS="-lgssapi $LIBS" found_gssapi_lib=yes],,$LIBS)
+
+    if test -z "$found_gssapi_lib"
+    then
+        AC_CHECK_LIB(gssapi_krb5, gss_krb5_ccache_name,[LIBS="-lgssapi_krb5 $LIBS"],,$LIBS)
+    fi
 fi
 
 if test -z "$found_ldap_lib" -a \( $with_ldap_lib = auto -o $with_ldap_lib = umich -o $with_ldap_lib = openldap \)
@@ -312,14 +341,21 @@
   AC_CHECK_LIB(pthread, main)
 fi
 AC_CHECK_LIB(gssldap, ldap_gss_bind,[LIBS="-lgssldap $LIBS"],,$LIBS)
-AC_CHECK_LIB(sasl2, sasl_client_init)
 
-AC_CHECK_FUNCS(sasl_auxprop_request)
-AC_CHECK_FUNCS(gss_krb5_ccache_name)
+if test "$enable_sasl" = "yes"; then
+    AC_CHECK_LIB(sasl2, sasl_client_init)
+    AC_CHECK_FUNCS(sasl_auxprop_request)
+    AC_CHECK_FUNCS(ldap_sasl_interactive_bind_s)
+fi
+
+if test "$enable_kerberos" = "yes"; then
+    AC_CHECK_FUNCS(gss_krb5_ccache_name)
+fi
+
 AC_CHECK_FUNCS(ldap_parse_result ldap_memfree ldap_controls_free ldap_control_free)
 AC_CHECK_FUNCS(ldap_explode_dn ldap_explode_rdn ldap_set_option ldap_get_option)
 AC_CHECK_FUNCS(ldap_abandon ldap_simple_bind_s ldap_unbind ldap_set_rebind_proc)
-AC_CHECK_FUNCS(ldap_sasl_interactive_bind_s ldap_initialize ldap_search_ext)
+AC_CHECK_FUNCS(ldap_initialize ldap_search_ext)
 AC_CHECK_FUNCS(ldap_create_control)
 AC_CHECK_FUNCS(ldap_domain2hostlist ldap_domain2dn)
 AC_CHECK_FUNCS(ldap_get_values ldap_value_free ldap_get_dn)