1
1
PHP_ARG_WITH([ mongodb-sasl] ,
2
2
[ whether to enable SASL for Kerberos authentication] ,
3
- [ AS_HELP_STRING ( [ --with-mongodb-sasl=@<:@ auto/no/cyrus/gssapi @:>@ ] ,
3
+ [ AS_HELP_STRING ( [ --with-mongodb-sasl=@<:@ auto/no/cyrus@:>@ ] ,
4
4
[ MongoDB: Enable SASL for Kerberos authentication [ default=auto] ] ) ] ,
5
5
[ auto] ,
6
6
[ no] )
7
7
8
- AS_IF ( [ test "$os_darwin" = "yes" -a \( "$PHP_MONGODB_SASL" = "gssapi" -o "$PHP_MONGODB_SASL" = "auto" \)] ,[
9
- dnl PHP_FRAMEWORKS is only used for SAPI builds, so use MONGODB_SHARED_LIBADD for shared builds
10
- if test "$ext_shared" = "yes"; then
11
- MONGODB_SHARED_LIBADD="-framework GSS $MONGODB_SHARED_LIBADD"
12
- else
13
- PHP_ADD_FRAMEWORK([ GSS] )
14
- fi
15
- PHP_MONGODB_SASL="gssapi"
16
- ] )
17
-
18
8
AS_IF ( [ test "$PHP_MONGODB_SASL" = "cyrus" -o "$PHP_MONGODB_SASL" = "auto"] ,[
19
9
found_cyrus="no"
20
10
@@ -40,23 +30,16 @@ AS_IF([test "$PHP_MONGODB_SASL" = "cyrus" -o "$PHP_MONGODB_SASL" = "auto"],[
40
30
fi
41
31
] )
42
32
43
- if test "$PHP_MONGODB_SASL" = "cyrus" -a "$found_cyrus" != "yes"; then
44
- AC_MSG_ERROR ( [ Cyrus SASL libraries and development headers could not be found] )
33
+ if test "$found_cyrus" = "yes"; then
34
+ PHP_CHECK_LIBRARY([ sasl2] ,
35
+ [ sasl_client_done] ,
36
+ [ have_sasl_client_done=yes] ,
37
+ [ have_sasl_client_done=no] ,
38
+ $MONGODB_SHARED_LIBADD)
45
39
fi
46
- ] )
47
-
48
- AS_IF ( [ test "$PHP_MONGODB_SASL" = "gssapi" -o "$PHP_MONGODB_SASL" = "auto"] ,[
49
- found_gssapi="no"
50
40
51
- PKG_CHECK_MODULES([ PHP_MONGODB_SASL] ,[ krb5-gssapi] ,[
52
- PHP_MONGODB_MONGOC_CFLAGS="$PHP_MONGODB_MONGOC_CFLAGS $PHP_MONGODB_SASL_CFLAGS"
53
- PHP_EVAL_LIBLINE([ $PHP_MONGODB_SASL_LIBS] ,[ MONGODB_SHARED_LIBADD] )
54
- PHP_MONGODB_SASL="gssapi"
55
- found_gssapi="yes"
56
- ] )
57
-
58
- if test "$PHP_MONGODB_SASL" = "gssapi" -a "$found_gssapi" != "yes"; then
59
- AC_MSG_ERROR ( [ GSSAPI libraries and development headers could not be found] )
41
+ if test "$PHP_MONGODB_SASL" = "cyrus" -a "$found_cyrus" != "yes"; then
42
+ AC_MSG_ERROR ( [ Cyrus SASL libraries and development headers could not be found] )
60
43
fi
61
44
] )
62
45
@@ -65,34 +48,27 @@ AS_IF([test "$PHP_MONGODB_SASL" = "auto"],[
65
48
] )
66
49
67
50
dnl Warn for unsupported values (e.g. Cyrus SASL search path)
68
- if test ! \( "$PHP_MONGODB_SASL" = "cyrus" -o "$PHP_MONGODB_SASL" = "gssapi" -o "$PHP_MONGODB_SASL" = " no" \); then
51
+ if test ! \( "$PHP_MONGODB_SASL" = "cyrus" -o "$PHP_MONGODB_SASL" = "no" \); then
69
52
AC_MSG_WARN ( [ unsupported --with-mongodb-sasl value: $PHP_MONGODB_SASL] )
70
53
fi
71
54
72
55
AC_MSG_CHECKING ( [ which SASL library to use] )
73
56
AC_MSG_RESULT ( [ $PHP_MONGODB_SASL] )
74
57
75
- dnl Disable Windows SSPI
58
+ dnl Disable Windows SSPI and GSSAPI
76
59
AC_SUBST ( MONGOC_ENABLE_SASL_SSPI , 0 )
60
+ AC_SUBST ( MONGOC_ENABLE_SASL_GSSAPI , 0 )
77
61
78
- if test "$PHP_MONGODB_SASL" = "cyrus" -o "$PHP_MONGODB_SASL" = "gssapi" ; then
62
+ if test "$PHP_MONGODB_SASL" = "cyrus"; then
79
63
AC_SUBST ( MONGOC_ENABLE_SASL , 1 )
80
- if test "$PHP_MONGODB_SASL" = "cyrus" ; then
81
- AC_SUBST ( MONGOC_ENABLE_SASL_CYRUS , 1 )
82
- AC_SUBST ( MONGOC_ENABLE_SASL_GSSAPI , 0 )
83
- if test "x$have_sasl_client_done" = "xyes"; then
84
- AC_SUBST ( MONGOC_HAVE_SASL_CLIENT_DONE , 1 )
85
- else
86
- AC_SUBST ( MONGOC_HAVE_SASL_CLIENT_DONE , 0 )
87
- fi
88
- elif test "$PHP_MONGODB_SASL" = "gssapi"; then
89
- AC_SUBST ( MONGOC_ENABLE_SASL_CYRUS , 0 )
90
- AC_SUBST ( MONGOC_ENABLE_SASL_GSSAPI , 1 )
64
+ AC_SUBST ( MONGOC_ENABLE_SASL_CYRUS , 1 )
65
+ if test "x$have_sasl_client_done" = "xyes"; then
66
+ AC_SUBST ( MONGOC_HAVE_SASL_CLIENT_DONE , 1 )
67
+ else
91
68
AC_SUBST ( MONGOC_HAVE_SASL_CLIENT_DONE , 0 )
92
69
fi
93
70
else
94
71
AC_SUBST ( MONGOC_ENABLE_SASL , 0 )
95
72
AC_SUBST ( MONGOC_ENABLE_SASL_CYRUS , 0 )
96
- AC_SUBST ( MONGOC_ENABLE_SASL_GSSAPI , 0 )
97
73
AC_SUBST ( MONGOC_HAVE_SASL_CLIENT_DONE , 0 )
98
74
fi
0 commit comments