Imported Upstream version 2.1.25
Ondřej Surý
12 years ago
0 | dnl | |
1 | dnl macros for configure.in to detect openssl | |
2 | dnl $Id: openssl.m4,v 1.11 2006/05/17 18:30:19 murch Exp $ | |
3 | dnl | |
4 | ||
5 | AC_DEFUN([CMU_HAVE_OPENSSL], [ | |
6 | AC_REQUIRE([CMU_FIND_LIB_SUBDIR]) | |
7 | AC_ARG_WITH(openssl,[ --with-openssl=PATH use OpenSSL from PATH], | |
8 | with_openssl=$withval, with_openssl="yes") | |
9 | ||
10 | save_CPPFLAGS=$CPPFLAGS | |
11 | save_LDFLAGS=$LDFLAGS | |
12 | ||
13 | if test -d $with_openssl; then | |
14 | CPPFLAGS="${CPPFLAGS} -I${with_openssl}/include" | |
15 | CMU_ADD_LIBPATH(${with_openssl}/$CMU_LIB_SUBDIR) | |
16 | fi | |
17 | ||
18 | case "$with_openssl" in | |
19 | no) | |
20 | with_openssl="no";; | |
21 | *) | |
22 | dnl if openssl has been compiled with the rsaref2 libraries, | |
23 | dnl we need to include the rsaref libraries in the crypto check | |
24 | LIB_RSAREF="" | |
25 | AC_CHECK_LIB(rsaref, RSAPublicEncrypt, | |
26 | cmu_have_rsaref=yes; | |
27 | [AC_CHECK_LIB(RSAglue, RSAPublicEncrypt, | |
28 | LIB_RSAREF="-lRSAglue -lrsaref", | |
29 | LIB_RSAREF="-lrsaref")], | |
30 | cmu_have_rsaref=no) | |
31 | ||
32 | AC_CHECK_HEADER(openssl/evp.h, [ | |
33 | AC_CHECK_LIB(crypto, EVP_DigestInit, | |
34 | with_openssl="yes", | |
35 | with_openssl="no", | |
36 | $LIB_RSAREF $LIB_SOCKET)], | |
37 | with_openssl=no) | |
38 | ;; | |
39 | esac | |
40 | ||
41 | if test "$with_openssl" != "no"; then | |
42 | AC_DEFINE(HAVE_OPENSSL,[],[Do we have OpenSSL?]) | |
43 | else | |
44 | CPPFLAGS=$save_CPPFLAGS | |
45 | LDFLAGS=$save_LDFLAGS | |
46 | fi | |
47 | ]) |
0 | # sasl2.m4--sasl2 libraries and includes | |
1 | # Rob Siemborski | |
2 | # $Id: sasl2.m4,v 1.53 2008/03/03 22:06:34 wescraig Exp $ | |
3 | ||
4 | # SASL2_CRYPT_CHK | |
5 | # --------------- | |
6 | AC_DEFUN([SASL_GSSAPI_CHK], | |
7 | [AC_REQUIRE([SASL2_CRYPT_CHK]) | |
8 | AC_REQUIRE([CMU_SOCKETS]) | |
9 | AC_ARG_ENABLE([gssapi], | |
10 | [AC_HELP_STRING([--enable-gssapi=<DIR>], | |
11 | [enable GSSAPI authentication [yes]])], | |
12 | [gssapi=$enableval], | |
13 | [gssapi=yes]) | |
14 | AC_ARG_WITH([gss_impl], | |
15 | [AC_HELP_STRING([--with-gss_impl={heimdal|mit|cybersafe|seam|auto}], | |
16 | [choose specific GSSAPI implementation [[auto]]])], | |
17 | [gss_impl=$withval], | |
18 | [gss_impl=auto]) | |
19 | ||
20 | if test "$gssapi" != no; then | |
21 | platform= | |
22 | case "${host}" in | |
23 | *-*-linux*) | |
24 | platform=__linux | |
25 | ;; | |
26 | *-*-hpux*) | |
27 | platform=__hpux | |
28 | ;; | |
29 | *-*-irix*) | |
30 | platform=__irix | |
31 | ;; | |
32 | *-*-solaris2*) | |
33 | # When should we use __sunos? | |
34 | platform=__solaris | |
35 | ;; | |
36 | *-*-aix*) | |
37 | ###_AIX | |
38 | platform=__aix | |
39 | ;; | |
40 | *) | |
41 | AC_WARN([The system type is not recognized. If you believe that CyberSafe GSSAPI works on this platform, please update the configure script]) | |
42 | if test "$gss_impl" = "cybersafe"; then | |
43 | AC_ERROR([CyberSafe was forced, cannot continue as platform is not supported]) | |
44 | fi | |
45 | ;; | |
46 | esac | |
47 | ||
48 | cmu_saved_CPPFLAGS=$CPPFLAGS | |
49 | ||
50 | if test -d ${gssapi}; then | |
51 | CPPFLAGS="$CPPFLAGS -I$gssapi/include" | |
52 | # We want to keep -I in our CPPFLAGS, but only if we succeed | |
53 | cmu_saved_CPPFLAGS=$CPPFLAGS | |
54 | ### I am not sure how useful is this (and whether this is required at all | |
55 | ### especially when we have to provide two -L flags for new CyberSafe | |
56 | LDFLAGS="$LDFLAGS -L$gssapi/lib" | |
57 | ||
58 | if test -n "$platform"; then | |
59 | if test "$gss_impl" = "auto" -o "$gss_impl" = "cybersafe"; then | |
60 | CPPFLAGS="$CPPFLAGS -D$platform" | |
61 | if test -d "${gssapi}/appsec-sdk/include"; then | |
62 | CPPFLAGS="$CPPFLAGS -I${gssapi}/appsec-sdk/include" | |
63 | fi | |
64 | fi | |
65 | fi | |
66 | fi | |
67 | AC_CHECK_HEADER([gssapi.h],, | |
68 | [AC_CHECK_HEADER([gssapi/gssapi.h],, | |
69 | [AC_WARN([Disabling GSSAPI - no include files found]); gssapi=no])]) | |
70 | ||
71 | CPPFLAGS=$cmu_saved_CPPFLAGS | |
72 | ||
73 | fi | |
74 | ||
75 | if test "$gssapi" != no; then | |
76 | if test "$ac_cv_header_gssapi_h" = "yes" -o "$ac_cv_header_gssapi_gssapi_h" = "yes"; then | |
77 | AC_DEFINE(HAVE_GSSAPI_H,,[Define if you have the gssapi.h header file]) | |
78 | fi | |
79 | ||
80 | # We need to find out which gssapi implementation we are | |
81 | # using. Supported alternatives are: MIT Kerberos 5, | |
82 | # Heimdal Kerberos 5 (http://www.pdc.kth.se/heimdal), | |
83 | # CyberSafe Kerberos 5 (http://www.cybersafe.com/) | |
84 | # and Sun SEAM (http://wwws.sun.com/software/security/kerberos/) | |
85 | # | |
86 | # The choice is reflected in GSSAPIBASE_LIBS | |
87 | ||
88 | AC_CHECK_LIB(resolv,res_search) | |
89 | if test -d ${gssapi}; then | |
90 | gssapi_dir="${gssapi}/lib" | |
91 | GSSAPIBASE_LIBS="-L$gssapi_dir" | |
92 | GSSAPIBASE_STATIC_LIBS="-L$gssapi_dir" | |
93 | else | |
94 | # FIXME: This is only used for building cyrus, and then only as | |
95 | # a real hack. it needs to be fixed. | |
96 | gssapi_dir="/usr/local/lib" | |
97 | fi | |
98 | ||
99 | # Check a full link against the Heimdal libraries. | |
100 | # If this fails, check a full link against the MIT libraries. | |
101 | # If this fails, check a full link against the CyberSafe libraries. | |
102 | # If this fails, check a full link against the Solaris 8 and up libgss. | |
103 | ||
104 | if test "$gss_impl" = "auto" -o "$gss_impl" = "heimdal"; then | |
105 | gss_failed=0 | |
106 | AC_CHECK_LIB(gssapi,gss_unwrap,gss_impl="heimdal",gss_failed=1, | |
107 | ${GSSAPIBASE_LIBS} -lgssapi -lkrb5 -lasn1 -lroken ${LIB_CRYPT} ${LIB_DES} -lcom_err ${LIB_SOCKET}) | |
108 | if test "$gss_impl" != "auto" -a "$gss_failed" = "1"; then | |
109 | gss_impl="failed" | |
110 | fi | |
111 | fi | |
112 | ||
113 | if test "$gss_impl" = "auto" -o "$gss_impl" = "mit"; then | |
114 | # check for libkrb5support first | |
115 | AC_CHECK_LIB(krb5support,krb5int_getspecific,K5SUP=-lkrb5support K5SUPSTATIC=$gssapi_dir/libkrb5support.a,,${LIB_SOCKET}) | |
116 | ||
117 | gss_failed=0 | |
118 | AC_CHECK_LIB(gssapi_krb5,gss_unwrap,gss_impl="mit",gss_failed=1, | |
119 | ${GSSAPIBASE_LIBS} -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err ${K5SUP} ${LIB_SOCKET}) | |
120 | if test "$gss_impl" != "auto" -a "$gss_failed" = "1"; then | |
121 | gss_impl="failed" | |
122 | fi | |
123 | fi | |
124 | ||
125 | # For Cybersafe one has to set a platform define in order to make compilation work | |
126 | if test "$gss_impl" = "auto" -o "$gss_impl" = "cybersafe"; then | |
127 | ||
128 | cmu_saved_CPPFLAGS=$CPPFLAGS | |
129 | cmu_saved_GSSAPIBASE_LIBS=$GSSAPIBASE_LIBS | |
130 | # FIXME - Note that the libraries are in .../lib64 for 64bit kernels | |
131 | if test -d "${gssapi}/appsec-rt/lib"; then | |
132 | GSSAPIBASE_LIBS="$GSSAPIBASE_LIBS -L${gssapi}/appsec-rt/lib" | |
133 | fi | |
134 | CPPFLAGS="$CPPFLAGS -D$platform" | |
135 | if test -d "${gssapi}/appsec-sdk/include"; then | |
136 | CPPFLAGS="$CPPFLAGS -I${gssapi}/appsec-sdk/include" | |
137 | fi | |
138 | ||
139 | gss_failed=0 | |
140 | ||
141 | # Check for CyberSafe with two libraries first, than fall back to a single | |
142 | # library (older CyberSafe) | |
143 | ||
144 | unset ac_cv_lib_gss_csf_gss_acq_user | |
145 | AC_CHECK_LIB(gss,csf_gss_acq_user,gss_impl="cybersafe03", | |
146 | [unset ac_cv_lib_gss_csf_gss_acq_user; | |
147 | AC_CHECK_LIB(gss,csf_gss_acq_user,gss_impl="cybersafe", | |
148 | gss_failed=1,$GSSAPIBASE_LIBS -lgss)], | |
149 | [${GSSAPIBASE_LIBS} -lgss -lcstbk5]) | |
150 | ||
151 | if test "$gss_failed" = "1"; then | |
152 | # Restore variables | |
153 | GSSAPIBASE_LIBS=$cmu_saved_GSSAPIBASE_LIBS | |
154 | CPPFLAGS=$cmu_saved_CPPFLAGS | |
155 | ||
156 | if test "$gss_impl" != "auto"; then | |
157 | gss_impl="failed" | |
158 | fi | |
159 | fi | |
160 | fi | |
161 | ||
162 | if test "$gss_impl" = "auto" -o "$gss_impl" = "seam"; then | |
163 | gss_failed=0 | |
164 | AC_CHECK_LIB(gss,gss_unwrap,gss_impl="seam",gss_failed=1,-lgss) | |
165 | if test "$gss_impl" != "auto" -a "$gss_failed" = "1"; then | |
166 | gss_impl="failed" | |
167 | fi | |
168 | fi | |
169 | ||
170 | if test "$gss_impl" = "mit"; then | |
171 | GSSAPIBASE_LIBS="$GSSAPIBASE_LIBS -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err ${K5SUP}" | |
172 | GSSAPIBASE_STATIC_LIBS="$GSSAPIBASE_LIBS $gssapi_dir/libgssapi_krb5.a $gssapi_dir/libkrb5.a $gssapi_dir/libk5crypto.a $gssapi_dir/libcom_err.a ${K5SUPSTATIC}" | |
173 | elif test "$gss_impl" = "heimdal"; then | |
174 | CPPFLAGS="$CPPFLAGS -DKRB5_HEIMDAL" | |
175 | GSSAPIBASE_LIBS="$GSSAPIBASE_LIBS -lgssapi -lkrb5 -lasn1 -lroken ${LIB_CRYPT} ${LIB_DES} -lcom_err" | |
176 | GSSAPIBASE_STATIC_LIBS="$GSSAPIBASE_STATIC_LIBS $gssapi_dir/libgssapi.a $gssapi_dir/libkrb5.a $gssapi_dir/libasn1.a $gssapi_dir/libroken.a $gssapi_dir/libcom_err.a ${LIB_CRYPT}" | |
177 | elif test "$gss_impl" = "cybersafe03"; then | |
178 | # Version of CyberSafe with two libraries | |
179 | CPPFLAGS="$CPPFLAGS -D$platform -I${gssapi}/appsec-sdk/include" | |
180 | GSSAPIBASE_LIBS="$GSSAPIBASE_LIBS -lgss -lcstbk5" | |
181 | # there is no static libgss for CyberSafe | |
182 | GSSAPIBASE_STATIC_LIBS=none | |
183 | elif test "$gss_impl" = "cybersafe"; then | |
184 | CPPFLAGS="$CPPFLAGS -D$platform -I${gssapi}/appsec-sdk/include" | |
185 | GSSAPIBASE_LIBS="$GSSAPIBASE_LIBS -lgss" | |
186 | # there is no static libgss for CyberSafe | |
187 | GSSAPIBASE_STATIC_LIBS=none | |
188 | elif test "$gss_impl" = "seam"; then | |
189 | GSSAPIBASE_LIBS=-lgss | |
190 | # there is no static libgss on Solaris 8 and up | |
191 | GSSAPIBASE_STATIC_LIBS=none | |
192 | elif test "$gss_impl" = "failed"; then | |
193 | gssapi="no" | |
194 | GSSAPIBASE_LIBS= | |
195 | GSSAPIBASE_STATIC_LIBS= | |
196 | AC_WARN([Disabling GSSAPI - specified library not found]) | |
197 | else | |
198 | gssapi="no" | |
199 | GSSAPIBASE_LIBS= | |
200 | GSSAPIBASE_STATIC_LIBS= | |
201 | AC_WARN([Disabling GSSAPI - no library]) | |
202 | fi | |
203 | fi | |
204 | ||
205 | # | |
206 | # Cybersafe defines both GSS_C_NT_HOSTBASED_SERVICE and GSS_C_NT_USER_NAME | |
207 | # in gssapi\rfckrb5.h | |
208 | # | |
209 | if test "$gssapi" != "no"; then | |
210 | if test "$gss_impl" = "cybersafe" -o "$gss_impl" = "cybersafe03"; then | |
211 | AC_EGREP_CPP(hostbased_service_gss_nt_yes, | |
212 | [#include <gssapi/gssapi.h> | |
213 | #ifdef GSS_C_NT_HOSTBASED_SERVICE | |
214 | hostbased_service_gss_nt_yes | |
215 | #endif], | |
216 | [AC_DEFINE(HAVE_GSS_C_NT_HOSTBASED_SERVICE,, | |
217 | [Define if your GSSAPI implimentation defines GSS_C_NT_HOSTBASED_SERVICE])], | |
218 | [AC_WARN([Cybersafe define not found])]) | |
219 | ||
220 | elif test "$ac_cv_header_gssapi_h" = "yes"; then | |
221 | AC_EGREP_HEADER(GSS_C_NT_HOSTBASED_SERVICE, gssapi.h, | |
222 | [AC_DEFINE(HAVE_GSS_C_NT_HOSTBASED_SERVICE,, | |
223 | [Define if your GSSAPI implimentation defines GSS_C_NT_HOSTBASED_SERVICE])]) | |
224 | elif test "$ac_cv_header_gssapi_gssapi_h"; then | |
225 | AC_EGREP_HEADER(GSS_C_NT_HOSTBASED_SERVICE, gssapi/gssapi.h, | |
226 | [AC_DEFINE(HAVE_GSS_C_NT_HOSTBASED_SERVICE,, | |
227 | [Define if your GSSAPI implimentation defines GSS_C_NT_HOSTBASED_SERVICE])]) | |
228 | fi | |
229 | ||
230 | if test "$gss_impl" = "cybersafe" -o "$gss_impl" = "cybersafe03"; then | |
231 | AC_EGREP_CPP(user_name_yes_gss_nt, | |
232 | [#include <gssapi/gssapi.h> | |
233 | #ifdef GSS_C_NT_USER_NAME | |
234 | user_name_yes_gss_nt | |
235 | #endif], | |
236 | [AC_DEFINE(HAVE_GSS_C_NT_USER_NAME,, | |
237 | [Define if your GSSAPI implimentation defines GSS_C_NT_USER_NAME])], | |
238 | [AC_WARN([Cybersafe define not found])]) | |
239 | elif test "$ac_cv_header_gssapi_h" = "yes"; then | |
240 | AC_EGREP_HEADER(GSS_C_NT_USER_NAME, gssapi.h, | |
241 | [AC_DEFINE(HAVE_GSS_C_NT_USER_NAME,, | |
242 | [Define if your GSSAPI implimentation defines GSS_C_NT_USER_NAME])]) | |
243 | elif test "$ac_cv_header_gssapi_gssapi_h"; then | |
244 | AC_EGREP_HEADER(GSS_C_NT_USER_NAME, gssapi/gssapi.h, | |
245 | [AC_DEFINE(HAVE_GSS_C_NT_USER_NAME,, | |
246 | [Define if your GSSAPI implimentation defines GSS_C_NT_USER_NAME])]) | |
247 | fi | |
248 | fi | |
249 | ||
250 | GSSAPI_LIBS="" | |
251 | AC_MSG_CHECKING([GSSAPI]) | |
252 | if test "$gssapi" != no; then | |
253 | AC_MSG_RESULT([with implementation ${gss_impl}]) | |
254 | AC_CHECK_LIB(resolv,res_search,GSSAPIBASE_LIBS="$GSSAPIBASE_LIBS -lresolv") | |
255 | SASL_MECHS="$SASL_MECHS libgssapiv2.la" | |
256 | SASL_STATIC_OBJS="$SASL_STATIC_OBJS gssapi.o" | |
257 | SASL_STATIC_SRCS="$SASL_STATIC_SRCS \$(top_srcdir)/plugins/gssapi.c" | |
258 | ||
259 | cmu_save_LIBS="$LIBS" | |
260 | LIBS="$LIBS $GSSAPIBASE_LIBS" | |
261 | AC_CHECK_FUNCS(gsskrb5_register_acceptor_identity) | |
262 | LIBS="$cmu_save_LIBS" | |
263 | else | |
264 | AC_MSG_RESULT([disabled]) | |
265 | fi | |
266 | AC_SUBST(GSSAPI_LIBS) | |
267 | AC_SUBST(GSSAPIBASE_LIBS) | |
268 | ])# SASL_GSSAPI_CHK | |
269 | ||
270 | ||
271 | # SASL_SET_GSSAPI_LIBS | |
272 | # -------------------- | |
273 | AC_DEFUN([SASL_SET_GSSAPI_LIBS], | |
274 | [SASL_GSSAPI_LIBS_SET="yes" | |
275 | ]) | |
276 | ||
277 | ||
278 | # CMU_SASL2 | |
279 | # --------- | |
280 | # What we want to do here is setup LIB_SASL with what one would | |
281 | # generally want to have (e.g. if static is requested, make it that, | |
282 | # otherwise make it dynamic. | |
283 | # | |
284 | # We also want to create LIB_DYN_SASL and DYNSASLFLAGS. | |
285 | # | |
286 | # Also sets using_static_sasl to "no" "static" or "staticonly" | |
287 | # | |
288 | AC_DEFUN([CMU_SASL2], | |
289 | [AC_REQUIRE([SASL_GSSAPI_CHK]) | |
290 | ||
291 | AC_ARG_WITH(sasl, | |
292 | [AC_HELP_STRING([--with-sasl=DIR],[Compile with libsasl2 in <DIR>])], | |
293 | with_sasl="$withval", | |
294 | with_sasl="yes") | |
295 | ||
296 | AC_ARG_WITH(staticsasl, | |
297 | [AC_HELP_STRING([--with-staticsasl=DIR], | |
298 | [Compile with staticly linked libsasl2 in <DIR>])], | |
299 | [with_staticsasl="$withval"; | |
300 | if test $with_staticsasl != "no"; then | |
301 | using_static_sasl="static" | |
302 | fi], | |
303 | [with_staticsasl="no"; using_static_sasl="no"]) | |
304 | ||
305 | SASLFLAGS="" | |
306 | LIB_SASL="" | |
307 | ||
308 | cmu_saved_CPPFLAGS=$CPPFLAGS | |
309 | cmu_saved_LDFLAGS=$LDFLAGS | |
310 | cmu_saved_LIBS=$LIBS | |
311 | ||
312 | if test ${with_staticsasl} != "no"; then | |
313 | if test -d ${with_staticsasl}; then | |
314 | if test -d ${with_staticsasl}/lib64 ; then | |
315 | ac_cv_sasl_where_lib=${with_staticsasl}/lib64 | |
316 | else | |
317 | ac_cv_sasl_where_lib=${with_staticsasl}/lib | |
318 | fi | |
319 | ac_cv_sasl_where_lib=${with_staticsasl}/lib | |
320 | ac_cv_sasl_where_inc=${with_staticsasl}/include | |
321 | ||
322 | SASLFLAGS="-I$ac_cv_sasl_where_inc" | |
323 | LIB_SASL="-L$ac_cv_sasl_where_lib" | |
324 | CPPFLAGS="${cmu_saved_CPPFLAGS} -I${ac_cv_sasl_where_inc}" | |
325 | LDFLAGS="${cmu_saved_LDFLAGS} -L${ac_cv_sasl_where_lib}" | |
326 | else | |
327 | with_staticsasl="/usr" | |
328 | fi | |
329 | ||
330 | AC_CHECK_HEADER(sasl/sasl.h, | |
331 | [AC_CHECK_HEADER(sasl/saslutil.h, | |
332 | [for i42 in lib64 lib; do | |
333 | if test -r ${with_staticsasl}/$i42/libsasl2.a; then | |
334 | ac_cv_found_sasl=yes | |
335 | AC_MSG_CHECKING([for static libsasl]) | |
336 | LIB_SASL="$LIB_SASL ${with_staticsasl}/$i42/libsasl2.a" | |
337 | fi | |
338 | done | |
339 | if test ! "$ac_cv_found_sasl" = "yes"; then | |
340 | AC_MSG_CHECKING([for static libsasl]) | |
341 | AC_ERROR([Could not find ${with_staticsasl}/lib*/libsasl2.a]) | |
342 | fi])]) | |
343 | ||
344 | AC_MSG_RESULT([found]) | |
345 | ||
346 | if test "x$SASL_GSSAPI_LIBS_SET" = "x"; then | |
347 | LIB_SASL="$LIB_SASL $GSSAPIBASE_STATIC_LIBS" | |
348 | else | |
349 | SASL_GSSAPI_LIBS_SET="" | |
350 | cmu_saved_LIBS="$GSSAPIBASE_STATIC_LIBS $cmu_saved_LIBS" | |
351 | fi | |
352 | fi | |
353 | ||
354 | if test -d ${with_sasl}; then | |
355 | ac_cv_sasl_where_lib=${with_sasl}/lib | |
356 | ac_cv_sasl_where_inc=${with_sasl}/include | |
357 | ||
358 | DYNSASLFLAGS="-I$ac_cv_sasl_where_inc" | |
359 | if test "$ac_cv_sasl_where_lib" != ""; then | |
360 | CMU_ADD_LIBPATH_TO($ac_cv_sasl_where_lib, LIB_DYN_SASL) | |
361 | fi | |
362 | LIB_DYN_SASL="$LIB_DYN_SASL -lsasl2" | |
363 | CPPFLAGS="${cmu_saved_CPPFLAGS} -I${ac_cv_sasl_where_inc}" | |
364 | LDFLAGS="${cmu_saved_LDFLAGS} -L${ac_cv_sasl_where_lib}" | |
365 | fi | |
366 | ||
367 | # be sure to check for a SASLv2 specific function | |
368 | AC_CHECK_HEADER(sasl/sasl.h, | |
369 | [AC_CHECK_HEADER(sasl/saslutil.h, | |
370 | [AC_CHECK_LIB(sasl2, prop_get, | |
371 | ac_cv_found_sasl=yes, | |
372 | ac_cv_found_sasl=no)], | |
373 | ac_cv_found_sasl=no)], | |
374 | ac_cv_found_sasl=no) | |
375 | ||
376 | if test "$ac_cv_found_sasl" = "yes"; then | |
377 | if test "$ac_cv_sasl_where_lib" != ""; then | |
378 | CMU_ADD_LIBPATH_TO($ac_cv_sasl_where_lib, DYNLIB_SASL) | |
379 | fi | |
380 | DYNLIB_SASL="$DYNLIB_SASL -lsasl2" | |
381 | if test "$using_static_sasl" != "static"; then | |
382 | LIB_SASL=$DYNLIB_SASL | |
383 | SASLFLAGS=$DYNSASLFLAGS | |
384 | fi | |
385 | else | |
386 | DYNLIB_SASL="" | |
387 | DYNSASLFLAGS="" | |
388 | using_static_sasl="staticonly" | |
389 | fi | |
390 | ||
391 | if test "x$SASL_GSSAPI_LIBS_SET" != "x"; then | |
392 | SASL_GSSAPI_LIBS_SET="" | |
393 | cmu_saved_LIBS="$GSSAPIBASE_LIBS $cmu_saved_LIBS" | |
394 | fi | |
395 | ||
396 | LIBS="$cmu_saved_LIBS" | |
397 | LDFLAGS="$cmu_saved_LDFLAGS" | |
398 | CPPFLAGS="$cmu_saved_CPPFLAGS" | |
399 | ||
400 | AC_SUBST(LIB_DYN_SASL) | |
401 | AC_SUBST(DYNSASLFLAGS) | |
402 | AC_SUBST(LIB_SASL) | |
403 | AC_SUBST(SASLFLAGS) | |
404 | ])# CMU_SASL2 | |
405 | ||
406 | ||
407 | # CMU_SASL2_REQUIRED | |
408 | # ------------------ | |
409 | AC_DEFUN([CMU_SASL2_REQUIRED], | |
410 | [AC_REQUIRE([CMU_SASL2]) | |
411 | if test "$ac_cv_found_sasl" != "yes"; then | |
412 | AC_ERROR([Cannot continue without libsasl2. | |
413 | Get it from ftp://ftp.andrew.cmu.edu/pub/cyrus-mail/.]) | |
414 | fi]) | |
415 | ||
416 | ||
417 | # CMU_SASL2_REQUIRE_VER | |
418 | # --------------------- | |
419 | AC_DEFUN([CMU_SASL2_REQUIRE_VER], | |
420 | [AC_REQUIRE([CMU_SASL2_REQUIRED]) | |
421 | ||
422 | cmu_saved_CPPFLAGS=$CPPFLAGS | |
423 | CPPFLAGS="$CPPFLAGS $SASLFLAGS" | |
424 | ||
425 | AC_TRY_CPP([ | |
426 | #include <sasl/sasl.h> | |
427 | ||
428 | #ifndef SASL_VERSION_MAJOR | |
429 | #error SASL_VERSION_MAJOR not defined | |
430 | #endif | |
431 | #ifndef SASL_VERSION_MINOR | |
432 | #error SASL_VERSION_MINOR not defined | |
433 | #endif | |
434 | #ifndef SASL_VERSION_STEP | |
435 | #error SASL_VERSION_STEP not defined | |
436 | #endif | |
437 | ||
438 | #if SASL_VERSION_MAJOR < $1 || SASL_VERSION_MINOR < $2 || SASL_VERSION_STEP < $3 | |
439 | #error SASL version is less than $1.$2.$3 | |
440 | #endif | |
441 | ],, | |
442 | [AC_ERROR([Incorrect SASL headers found. This package requires SASL $1.$2.$3 or newer.])]) | |
443 | ||
444 | CPPFLAGS=$cmu_saved_CPPFLAGS | |
445 | ])# CMU_SASL2_REQUIRE_VER | |
446 | ||
447 | ||
448 | # CMU_SASL2_CHECKAPOP_REQUIRED | |
449 | # ---------------------------- | |
450 | AC_DEFUN([CMU_SASL2_CHECKAPOP_REQUIRED], | |
451 | [AC_REQUIRE([CMU_SASL2_REQUIRED]) | |
452 | ||
453 | cmu_saved_LDFLAGS=$LDFLAGS | |
454 | ||
455 | LDFLAGS="$LDFLAGS $LIB_SASL" | |
456 | ||
457 | AC_CHECK_LIB(sasl2, sasl_checkapop, | |
458 | [AC_DEFINE(HAVE_APOP,[],[Does SASL support APOP?])], | |
459 | [AC_MSG_ERROR([libsasl2 without working sasl_checkapop. Cannot continue.])]) | |
460 | ||
461 | LDFLAGS=$cmu_saved_LDFLAGS | |
462 | ])# CMU_SASL2_CHECKAPOP_REQUIRED | |
463 | ||
464 | ||
465 | # SASL2_CRYPT_CHK | |
466 | # --------------- | |
467 | AC_DEFUN([SASL2_CRYPT_CHK], | |
468 | [AC_CHECK_FUNC(crypt, cmu_have_crypt=yes, | |
469 | [AC_CHECK_LIB(crypt, crypt, | |
470 | LIB_CRYPT="-lcrypt"; cmu_have_crypt=yes, | |
471 | cmu_have_crypt=no)]) | |
472 | AC_SUBST(LIB_CRYPT) | |
473 | ])# SASL2_CRYPT_CHK |
0 | # sasl2.m4--sasl2 libraries and includes | |
1 | # Rob Siemborski | |
2 | # $Id: sasl2.m4,v 1.53 2008/03/03 22:06:34 wescraig Exp $ | |
3 | ||
4 | # SASL2_CRYPT_CHK | |
5 | # --------------- | |
6 | AC_DEFUN([SASL_GSSAPI_CHK], | |
7 | [AC_REQUIRE([SASL2_CRYPT_CHK]) | |
8 | AC_REQUIRE([CMU_SOCKETS]) | |
9 | AC_ARG_ENABLE([gssapi], | |
10 | [AC_HELP_STRING([--enable-gssapi=<DIR>], | |
11 | [enable GSSAPI authentication [yes]])], | |
12 | [gssapi=$enableval], | |
13 | [gssapi=yes]) | |
14 | AC_ARG_WITH([gss_impl], | |
15 | [AC_HELP_STRING([--with-gss_impl={heimdal|mit|cybersafe|seam|auto}], | |
16 | [choose specific GSSAPI implementation [[auto]]])], | |
17 | [gss_impl=$withval], | |
18 | [gss_impl=auto]) | |
19 | ||
20 | if test "$gssapi" != no; then | |
21 | platform= | |
22 | case "${host}" in | |
23 | *-*-linux*) | |
24 | platform=__linux | |
25 | ;; | |
26 | *-*-hpux*) | |
27 | platform=__hpux | |
28 | ;; | |
29 | *-*-irix*) | |
30 | platform=__irix | |
31 | ;; | |
32 | *-*-solaris2*) | |
33 | # When should we use __sunos? | |
34 | platform=__solaris | |
35 | ;; | |
36 | *-*-aix*) | |
37 | ###_AIX | |
38 | platform=__aix | |
39 | ;; | |
40 | *) | |
41 | AC_WARN([The system type is not recognized. If you believe that CyberSafe GSSAPI works on this platform, please update the configure script]) | |
42 | if test "$gss_impl" = "cybersafe"; then | |
43 | AC_ERROR([CyberSafe was forced, cannot continue as platform is not supported]) | |
44 | fi | |
45 | ;; | |
46 | esac | |
47 | ||
48 | cmu_saved_CPPFLAGS=$CPPFLAGS | |
49 | ||
50 | if test -d ${gssapi}; then | |
51 | CPPFLAGS="$CPPFLAGS -I$gssapi/include" | |
52 | # We want to keep -I in our CPPFLAGS, but only if we succeed | |
53 | cmu_saved_CPPFLAGS=$CPPFLAGS | |
54 | ### I am not sure how useful is this (and whether this is required at all | |
55 | ### especially when we have to provide two -L flags for new CyberSafe | |
56 | LDFLAGS="$LDFLAGS -L$gssapi/lib" | |
57 | ||
58 | if test -n "$platform"; then | |
59 | if test "$gss_impl" = "auto" -o "$gss_impl" = "cybersafe"; then | |
60 | CPPFLAGS="$CPPFLAGS -D$platform" | |
61 | if test -d "${gssapi}/appsec-sdk/include"; then | |
62 | CPPFLAGS="$CPPFLAGS -I${gssapi}/appsec-sdk/include" | |
63 | fi | |
64 | fi | |
65 | fi | |
66 | fi | |
67 | AC_CHECK_HEADER([gssapi.h],, | |
68 | [AC_CHECK_HEADER([gssapi/gssapi.h],, | |
69 | [AC_WARN([Disabling GSSAPI - no include files found]); gssapi=no])]) | |
70 | ||
71 | CPPFLAGS=$cmu_saved_CPPFLAGS | |
72 | ||
73 | fi | |
74 | ||
75 | if test "$gssapi" != no; then | |
76 | if test "$ac_cv_header_gssapi_h" = "yes" -o "$ac_cv_header_gssapi_gssapi_h" = "yes"; then | |
77 | AC_DEFINE(HAVE_GSSAPI_H,,[Define if you have the gssapi.h header file]) | |
78 | fi | |
79 | ||
80 | # We need to find out which gssapi implementation we are | |
81 | # using. Supported alternatives are: MIT Kerberos 5, | |
82 | # Heimdal Kerberos 5 (http://www.pdc.kth.se/heimdal), | |
83 | # CyberSafe Kerberos 5 (http://www.cybersafe.com/) | |
84 | # and Sun SEAM (http://wwws.sun.com/software/security/kerberos/) | |
85 | # | |
86 | # The choice is reflected in GSSAPIBASE_LIBS | |
87 | ||
88 | AC_CHECK_LIB(resolv,res_search) | |
89 | if test -d ${gssapi}; then | |
90 | gssapi_dir="${gssapi}/lib" | |
91 | GSSAPIBASE_LIBS="-L$gssapi_dir" | |
92 | GSSAPIBASE_STATIC_LIBS="-L$gssapi_dir" | |
93 | else | |
94 | # FIXME: This is only used for building cyrus, and then only as | |
95 | # a real hack. it needs to be fixed. | |
96 | gssapi_dir="/usr/local/lib" | |
97 | fi | |
98 | ||
99 | # Check a full link against the Heimdal libraries. | |
100 | # If this fails, check a full link against the MIT libraries. | |
101 | # If this fails, check a full link against the CyberSafe libraries. | |
102 | # If this fails, check a full link against the Solaris 8 and up libgss. | |
103 | ||
104 | if test "$gss_impl" = "auto" -o "$gss_impl" = "heimdal"; then | |
105 | gss_failed=0 | |
106 | AC_CHECK_LIB(gssapi,gss_unwrap,gss_impl="heimdal",gss_failed=1, | |
107 | ${GSSAPIBASE_LIBS} -lgssapi -lkrb5 -lasn1 -lroken ${LIB_CRYPT} ${LIB_DES} -lcom_err ${LIB_SOCKET}) | |
108 | if test "$gss_impl" != "auto" -a "$gss_failed" = "1"; then | |
109 | gss_impl="failed" | |
110 | fi | |
111 | fi | |
112 | ||
113 | if test "$gss_impl" = "auto" -o "$gss_impl" = "mit"; then | |
114 | # check for libkrb5support first | |
115 | AC_CHECK_LIB(krb5support,krb5int_getspecific,K5SUP=-lkrb5support K5SUPSTATIC=$gssapi_dir/libkrb5support.a,,${LIB_SOCKET}) | |
116 | ||
117 | gss_failed=0 | |
118 | AC_CHECK_LIB(gssapi_krb5,gss_unwrap,gss_impl="mit",gss_failed=1, | |
119 | ${GSSAPIBASE_LIBS} -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err ${K5SUP} ${LIB_SOCKET}) | |
120 | if test "$gss_impl" != "auto" -a "$gss_failed" = "1"; then | |
121 | gss_impl="failed" | |
122 | fi | |
123 | fi | |
124 | ||
125 | # For Cybersafe one has to set a platform define in order to make compilation work | |
126 | if test "$gss_impl" = "auto" -o "$gss_impl" = "cybersafe"; then | |
127 | ||
128 | cmu_saved_CPPFLAGS=$CPPFLAGS | |
129 | cmu_saved_GSSAPIBASE_LIBS=$GSSAPIBASE_LIBS | |
130 | # FIXME - Note that the libraries are in .../lib64 for 64bit kernels | |
131 | if test -d "${gssapi}/appsec-rt/lib"; then | |
132 | GSSAPIBASE_LIBS="$GSSAPIBASE_LIBS -L${gssapi}/appsec-rt/lib" | |
133 | fi | |
134 | CPPFLAGS="$CPPFLAGS -D$platform" | |
135 | if test -d "${gssapi}/appsec-sdk/include"; then | |
136 | CPPFLAGS="$CPPFLAGS -I${gssapi}/appsec-sdk/include" | |
137 | fi | |
138 | ||
139 | gss_failed=0 | |
140 | ||
141 | # Check for CyberSafe with two libraries first, than fall back to a single | |
142 | # library (older CyberSafe) | |
143 | ||
144 | unset ac_cv_lib_gss_csf_gss_acq_user | |
145 | AC_CHECK_LIB(gss,csf_gss_acq_user,gss_impl="cybersafe03", | |
146 | [unset ac_cv_lib_gss_csf_gss_acq_user; | |
147 | AC_CHECK_LIB(gss,csf_gss_acq_user,gss_impl="cybersafe", | |
148 | gss_failed=1,$GSSAPIBASE_LIBS -lgss)], | |
149 | [${GSSAPIBASE_LIBS} -lgss -lcstbk5]) | |
150 | ||
151 | if test "$gss_failed" = "1"; then | |
152 | # Restore variables | |
153 | GSSAPIBASE_LIBS=$cmu_saved_GSSAPIBASE_LIBS | |
154 | CPPFLAGS=$cmu_saved_CPPFLAGS | |
155 | ||
156 | if test "$gss_impl" != "auto"; then | |
157 | gss_impl="failed" | |
158 | fi | |
159 | fi | |
160 | fi | |
161 | ||
162 | if test "$gss_impl" = "auto" -o "$gss_impl" = "seam"; then | |
163 | gss_failed=0 | |
164 | AC_CHECK_LIB(gss,gss_unwrap,gss_impl="seam",gss_failed=1,-lgss) | |
165 | if test "$gss_impl" != "auto" -a "$gss_failed" = "1"; then | |
166 | gss_impl="failed" | |
167 | fi | |
168 | fi | |
169 | ||
170 | if test "$gss_impl" = "mit"; then | |
171 | GSSAPIBASE_LIBS="$GSSAPIBASE_LIBS -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err ${K5SUP}" | |
172 | GSSAPIBASE_STATIC_LIBS="$GSSAPIBASE_LIBS $gssapi_dir/libgssapi_krb5.a $gssapi_dir/libkrb5.a $gssapi_dir/libk5crypto.a $gssapi_dir/libcom_err.a ${K5SUPSTATIC}" | |
173 | elif test "$gss_impl" = "heimdal"; then | |
174 | CPPFLAGS="$CPPFLAGS -DKRB5_HEIMDAL" | |
175 | GSSAPIBASE_LIBS="$GSSAPIBASE_LIBS -lgssapi -lkrb5 -lasn1 -lroken ${LIB_CRYPT} ${LIB_DES} -lcom_err" | |
176 | GSSAPIBASE_STATIC_LIBS="$GSSAPIBASE_STATIC_LIBS $gssapi_dir/libgssapi.a $gssapi_dir/libkrb5.a $gssapi_dir/libasn1.a $gssapi_dir/libroken.a $gssapi_dir/libcom_err.a ${LIB_CRYPT}" | |
177 | elif test "$gss_impl" = "cybersafe03"; then | |
178 | # Version of CyberSafe with two libraries | |
179 | CPPFLAGS="$CPPFLAGS -D$platform -I${gssapi}/appsec-sdk/include" | |
180 | GSSAPIBASE_LIBS="$GSSAPIBASE_LIBS -lgss -lcstbk5" | |
181 | # there is no static libgss for CyberSafe | |
182 | GSSAPIBASE_STATIC_LIBS=none | |
183 | elif test "$gss_impl" = "cybersafe"; then | |
184 | CPPFLAGS="$CPPFLAGS -D$platform -I${gssapi}/appsec-sdk/include" | |
185 | GSSAPIBASE_LIBS="$GSSAPIBASE_LIBS -lgss" | |
186 | # there is no static libgss for CyberSafe | |
187 | GSSAPIBASE_STATIC_LIBS=none | |
188 | elif test "$gss_impl" = "seam"; then | |
189 | GSSAPIBASE_LIBS=-lgss | |
190 | # there is no static libgss on Solaris 8 and up | |
191 | GSSAPIBASE_STATIC_LIBS=none | |
192 | elif test "$gss_impl" = "failed"; then | |
193 | gssapi="no" | |
194 | GSSAPIBASE_LIBS= | |
195 | GSSAPIBASE_STATIC_LIBS= | |
196 | AC_WARN([Disabling GSSAPI - specified library not found]) | |
197 | else | |
198 | gssapi="no" | |
199 | GSSAPIBASE_LIBS= | |
200 | GSSAPIBASE_STATIC_LIBS= | |
201 | AC_WARN([Disabling GSSAPI - no library]) | |
202 | fi | |
203 | fi | |
204 | ||
205 | # | |
206 | # Cybersafe defines both GSS_C_NT_HOSTBASED_SERVICE and GSS_C_NT_USER_NAME | |
207 | # in gssapi\rfckrb5.h | |
208 | # | |
209 | if test "$gssapi" != "no"; then | |
210 | if test "$gss_impl" = "cybersafe" -o "$gss_impl" = "cybersafe03"; then | |
211 | AC_EGREP_CPP(hostbased_service_gss_nt_yes, | |
212 | [#include <gssapi/gssapi.h> | |
213 | #ifdef GSS_C_NT_HOSTBASED_SERVICE | |
214 | hostbased_service_gss_nt_yes | |
215 | #endif], | |
216 | [AC_DEFINE(HAVE_GSS_C_NT_HOSTBASED_SERVICE,, | |
217 | [Define if your GSSAPI implimentation defines GSS_C_NT_HOSTBASED_SERVICE])], | |
218 | [AC_WARN([Cybersafe define not found])]) | |
219 | ||
220 | elif test "$ac_cv_header_gssapi_h" = "yes"; then | |
221 | AC_EGREP_HEADER(GSS_C_NT_HOSTBASED_SERVICE, gssapi.h, | |
222 | [AC_DEFINE(HAVE_GSS_C_NT_HOSTBASED_SERVICE,, | |
223 | [Define if your GSSAPI implimentation defines GSS_C_NT_HOSTBASED_SERVICE])]) | |
224 | elif test "$ac_cv_header_gssapi_gssapi_h"; then | |
225 | AC_EGREP_HEADER(GSS_C_NT_HOSTBASED_SERVICE, gssapi/gssapi.h, | |
226 | [AC_DEFINE(HAVE_GSS_C_NT_HOSTBASED_SERVICE,, | |
227 | [Define if your GSSAPI implimentation defines GSS_C_NT_HOSTBASED_SERVICE])]) | |
228 | fi | |
229 | ||
230 | if test "$gss_impl" = "cybersafe" -o "$gss_impl" = "cybersafe03"; then | |
231 | AC_EGREP_CPP(user_name_yes_gss_nt, | |
232 | [#include <gssapi/gssapi.h> | |
233 | #ifdef GSS_C_NT_USER_NAME | |
234 | user_name_yes_gss_nt | |
235 | #endif], | |
236 | [AC_DEFINE(HAVE_GSS_C_NT_USER_NAME,, | |
237 | [Define if your GSSAPI implimentation defines GSS_C_NT_USER_NAME])], | |
238 | [AC_WARN([Cybersafe define not found])]) | |
239 | elif test "$ac_cv_header_gssapi_h" = "yes"; then | |
240 | AC_EGREP_HEADER(GSS_C_NT_USER_NAME, gssapi.h, | |
241 | [AC_DEFINE(HAVE_GSS_C_NT_USER_NAME,, | |
242 | [Define if your GSSAPI implimentation defines GSS_C_NT_USER_NAME])]) | |
243 | elif test "$ac_cv_header_gssapi_gssapi_h"; then | |
244 | AC_EGREP_HEADER(GSS_C_NT_USER_NAME, gssapi/gssapi.h, | |
245 | [AC_DEFINE(HAVE_GSS_C_NT_USER_NAME,, | |
246 | [Define if your GSSAPI implimentation defines GSS_C_NT_USER_NAME])]) | |
247 | fi | |
248 | fi | |
249 | ||
250 | GSSAPI_LIBS="" | |
251 | AC_MSG_CHECKING([GSSAPI]) | |
252 | if test "$gssapi" != no; then | |
253 | AC_MSG_RESULT([with implementation ${gss_impl}]) | |
254 | AC_CHECK_LIB(resolv,res_search,GSSAPIBASE_LIBS="$GSSAPIBASE_LIBS -lresolv") | |
255 | SASL_MECHS="$SASL_MECHS libgssapiv2.la" | |
256 | SASL_STATIC_OBJS="$SASL_STATIC_OBJS gssapi.o" | |
257 | SASL_STATIC_SRCS="$SASL_STATIC_SRCS ../plugins/gssapi.c" | |
258 | ||
259 | cmu_save_LIBS="$LIBS" | |
260 | LIBS="$LIBS $GSSAPIBASE_LIBS" | |
261 | AC_CHECK_FUNCS(gsskrb5_register_acceptor_identity) | |
262 | LIBS="$cmu_save_LIBS" | |
263 | else | |
264 | AC_MSG_RESULT([disabled]) | |
265 | fi | |
266 | AC_SUBST(GSSAPI_LIBS) | |
267 | AC_SUBST(GSSAPIBASE_LIBS) | |
268 | ])# SASL_GSSAPI_CHK | |
269 | ||
270 | ||
271 | # SASL_SET_GSSAPI_LIBS | |
272 | # -------------------- | |
273 | AC_DEFUN([SASL_SET_GSSAPI_LIBS], | |
274 | [SASL_GSSAPI_LIBS_SET="yes" | |
275 | ]) | |
276 | ||
277 | ||
278 | # CMU_SASL2 | |
279 | # --------- | |
280 | # What we want to do here is setup LIB_SASL with what one would | |
281 | # generally want to have (e.g. if static is requested, make it that, | |
282 | # otherwise make it dynamic. | |
283 | # | |
284 | # We also want to create LIB_DYN_SASL and DYNSASLFLAGS. | |
285 | # | |
286 | # Also sets using_static_sasl to "no" "static" or "staticonly" | |
287 | # | |
288 | AC_DEFUN([CMU_SASL2], | |
289 | [AC_REQUIRE([SASL_GSSAPI_CHK]) | |
290 | ||
291 | AC_ARG_WITH(sasl, | |
292 | [AC_HELP_STRING([--with-sasl=DIR],[Compile with libsasl2 in <DIR>])], | |
293 | with_sasl="$withval", | |
294 | with_sasl="yes") | |
295 | ||
296 | AC_ARG_WITH(staticsasl, | |
297 | [AC_HELP_STRING([--with-staticsasl=DIR], | |
298 | [Compile with staticly linked libsasl2 in <DIR>])], | |
299 | [with_staticsasl="$withval"; | |
300 | if test $with_staticsasl != "no"; then | |
301 | using_static_sasl="static" | |
302 | fi], | |
303 | [with_staticsasl="no"; using_static_sasl="no"]) | |
304 | ||
305 | SASLFLAGS="" | |
306 | LIB_SASL="" | |
307 | ||
308 | cmu_saved_CPPFLAGS=$CPPFLAGS | |
309 | cmu_saved_LDFLAGS=$LDFLAGS | |
310 | cmu_saved_LIBS=$LIBS | |
311 | ||
312 | if test ${with_staticsasl} != "no"; then | |
313 | if test -d ${with_staticsasl}; then | |
314 | if test -d ${with_staticsasl}/lib64 ; then | |
315 | ac_cv_sasl_where_lib=${with_staticsasl}/lib64 | |
316 | else | |
317 | ac_cv_sasl_where_lib=${with_staticsasl}/lib | |
318 | fi | |
319 | ac_cv_sasl_where_lib=${with_staticsasl}/lib | |
320 | ac_cv_sasl_where_inc=${with_staticsasl}/include | |
321 | ||
322 | SASLFLAGS="-I$ac_cv_sasl_where_inc" | |
323 | LIB_SASL="-L$ac_cv_sasl_where_lib" | |
324 | CPPFLAGS="${cmu_saved_CPPFLAGS} -I${ac_cv_sasl_where_inc}" | |
325 | LDFLAGS="${cmu_saved_LDFLAGS} -L${ac_cv_sasl_where_lib}" | |
326 | else | |
327 | with_staticsasl="/usr" | |
328 | fi | |
329 | ||
330 | AC_CHECK_HEADER(sasl/sasl.h, | |
331 | [AC_CHECK_HEADER(sasl/saslutil.h, | |
332 | [for i42 in lib64 lib; do | |
333 | if test -r ${with_staticsasl}/$i42/libsasl2.a; then | |
334 | ac_cv_found_sasl=yes | |
335 | AC_MSG_CHECKING([for static libsasl]) | |
336 | LIB_SASL="$LIB_SASL ${with_staticsasl}/$i42/libsasl2.a" | |
337 | fi | |
338 | done | |
339 | if test ! "$ac_cv_found_sasl" = "yes"; then | |
340 | AC_MSG_CHECKING([for static libsasl]) | |
341 | AC_ERROR([Could not find ${with_staticsasl}/lib*/libsasl2.a]) | |
342 | fi])]) | |
343 | ||
344 | AC_MSG_RESULT([found]) | |
345 | ||
346 | if test "x$SASL_GSSAPI_LIBS_SET" = "x"; then | |
347 | LIB_SASL="$LIB_SASL $GSSAPIBASE_STATIC_LIBS" | |
348 | else | |
349 | SASL_GSSAPI_LIBS_SET="" | |
350 | cmu_saved_LIBS="$GSSAPIBASE_STATIC_LIBS $cmu_saved_LIBS" | |
351 | fi | |
352 | fi | |
353 | ||
354 | if test -d ${with_sasl}; then | |
355 | ac_cv_sasl_where_lib=${with_sasl}/lib | |
356 | ac_cv_sasl_where_inc=${with_sasl}/include | |
357 | ||
358 | DYNSASLFLAGS="-I$ac_cv_sasl_where_inc" | |
359 | if test "$ac_cv_sasl_where_lib" != ""; then | |
360 | CMU_ADD_LIBPATH_TO($ac_cv_sasl_where_lib, LIB_DYN_SASL) | |
361 | fi | |
362 | LIB_DYN_SASL="$LIB_DYN_SASL -lsasl2" | |
363 | CPPFLAGS="${cmu_saved_CPPFLAGS} -I${ac_cv_sasl_where_inc}" | |
364 | LDFLAGS="${cmu_saved_LDFLAGS} -L${ac_cv_sasl_where_lib}" | |
365 | fi | |
366 | ||
367 | # be sure to check for a SASLv2 specific function | |
368 | AC_CHECK_HEADER(sasl/sasl.h, | |
369 | [AC_CHECK_HEADER(sasl/saslutil.h, | |
370 | [AC_CHECK_LIB(sasl2, prop_get, | |
371 | ac_cv_found_sasl=yes, | |
372 | ac_cv_found_sasl=no)], | |
373 | ac_cv_found_sasl=no)], | |
374 | ac_cv_found_sasl=no) | |
375 | ||
376 | if test "$ac_cv_found_sasl" = "yes"; then | |
377 | if test "$ac_cv_sasl_where_lib" != ""; then | |
378 | CMU_ADD_LIBPATH_TO($ac_cv_sasl_where_lib, DYNLIB_SASL) | |
379 | fi | |
380 | DYNLIB_SASL="$DYNLIB_SASL -lsasl2" | |
381 | if test "$using_static_sasl" != "static"; then | |
382 | LIB_SASL=$DYNLIB_SASL | |
383 | SASLFLAGS=$DYNSASLFLAGS | |
384 | fi | |
385 | else | |
386 | DYNLIB_SASL="" | |
387 | DYNSASLFLAGS="" | |
388 | using_static_sasl="staticonly" | |
389 | fi | |
390 | ||
391 | if test "x$SASL_GSSAPI_LIBS_SET" != "x"; then | |
392 | SASL_GSSAPI_LIBS_SET="" | |
393 | cmu_saved_LIBS="$GSSAPIBASE_LIBS $cmu_saved_LIBS" | |
394 | fi | |
395 | ||
396 | LIBS="$cmu_saved_LIBS" | |
397 | LDFLAGS="$cmu_saved_LDFLAGS" | |
398 | CPPFLAGS="$cmu_saved_CPPFLAGS" | |
399 | ||
400 | AC_SUBST(LIB_DYN_SASL) | |
401 | AC_SUBST(DYNSASLFLAGS) | |
402 | AC_SUBST(LIB_SASL) | |
403 | AC_SUBST(SASLFLAGS) | |
404 | ])# CMU_SASL2 | |
405 | ||
406 | ||
407 | # CMU_SASL2_REQUIRED | |
408 | # ------------------ | |
409 | AC_DEFUN([CMU_SASL2_REQUIRED], | |
410 | [AC_REQUIRE([CMU_SASL2]) | |
411 | if test "$ac_cv_found_sasl" != "yes"; then | |
412 | AC_ERROR([Cannot continue without libsasl2. | |
413 | Get it from ftp://ftp.andrew.cmu.edu/pub/cyrus-mail/.]) | |
414 | fi]) | |
415 | ||
416 | ||
417 | # CMU_SASL2_REQUIRE_VER | |
418 | # --------------------- | |
419 | AC_DEFUN([CMU_SASL2_REQUIRE_VER], | |
420 | [AC_REQUIRE([CMU_SASL2_REQUIRED]) | |
421 | ||
422 | cmu_saved_CPPFLAGS=$CPPFLAGS | |
423 | CPPFLAGS="$CPPFLAGS $SASLFLAGS" | |
424 | ||
425 | AC_TRY_CPP([ | |
426 | #include <sasl/sasl.h> | |
427 | ||
428 | #ifndef SASL_VERSION_MAJOR | |
429 | #error SASL_VERSION_MAJOR not defined | |
430 | #endif | |
431 | #ifndef SASL_VERSION_MINOR | |
432 | #error SASL_VERSION_MINOR not defined | |
433 | #endif | |
434 | #ifndef SASL_VERSION_STEP | |
435 | #error SASL_VERSION_STEP not defined | |
436 | #endif | |
437 | ||
438 | #if SASL_VERSION_MAJOR < $1 || SASL_VERSION_MINOR < $2 || SASL_VERSION_STEP < $3 | |
439 | #error SASL version is less than $1.$2.$3 | |
440 | #endif | |
441 | ],, | |
442 | [AC_ERROR([Incorrect SASL headers found. This package requires SASL $1.$2.$3 or newer.])]) | |
443 | ||
444 | CPPFLAGS=$cmu_saved_CPPFLAGS | |
445 | ])# CMU_SASL2_REQUIRE_VER | |
446 | ||
447 | ||
448 | # CMU_SASL2_CHECKAPOP_REQUIRED | |
449 | # ---------------------------- | |
450 | AC_DEFUN([CMU_SASL2_CHECKAPOP_REQUIRED], | |
451 | [AC_REQUIRE([CMU_SASL2_REQUIRED]) | |
452 | ||
453 | cmu_saved_LDFLAGS=$LDFLAGS | |
454 | ||
455 | LDFLAGS="$LDFLAGS $LIB_SASL" | |
456 | ||
457 | AC_CHECK_LIB(sasl2, sasl_checkapop, | |
458 | [AC_DEFINE(HAVE_APOP,[],[Does SASL support APOP?])], | |
459 | [AC_MSG_ERROR([libsasl2 without working sasl_checkapop. Cannot continue.])]) | |
460 | ||
461 | LDFLAGS=$cmu_saved_LDFLAGS | |
462 | ])# CMU_SASL2_CHECKAPOP_REQUIRED | |
463 | ||
464 | ||
465 | # SASL2_CRYPT_CHK | |
466 | # --------------- | |
467 | AC_DEFUN([SASL2_CRYPT_CHK], | |
468 | [AC_CHECK_FUNC(crypt, cmu_have_crypt=yes, | |
469 | [AC_CHECK_LIB(crypt, crypt, | |
470 | LIB_CRYPT="-lcrypt"; cmu_have_crypt=yes, | |
471 | cmu_have_crypt=no)]) | |
472 | AC_SUBST(LIB_CRYPT) | |
473 | ])# SASL2_CRYPT_CHK |
0 | dnl checking for kerberos 4 libraries (and DES) | |
1 | ||
2 | AC_DEFUN([SASL_DES_CHK], [ | |
3 | AC_ARG_WITH(des, [ --with-des=DIR with DES (look in DIR) [yes] ], | |
4 | with_des=$withval, | |
5 | with_des=yes) | |
6 | ||
7 | LIB_DES="" | |
8 | if test "$with_des" != no; then | |
9 | if test -d $with_des; then | |
10 | CPPFLAGS="$CPPFLAGS -I${with_des}/include" | |
11 | LDFLAGS="$LDFLAGS -L${with_des}/lib" | |
12 | fi | |
13 | ||
14 | if test "$with_openssl" != no; then | |
15 | dnl check for openssl installing -lcrypto, then make vanilla check | |
16 | AC_CHECK_LIB(crypto, des_cbc_encrypt, [ | |
17 | AC_CHECK_HEADER(openssl/des.h, [AC_DEFINE(WITH_SSL_DES,[],[Use OpenSSL DES Implementation]) | |
18 | LIB_DES="-lcrypto"; | |
19 | with_des=yes], | |
20 | with_des=no)], | |
21 | with_des=no, $LIB_RSAREF) | |
22 | ||
23 | dnl same test again, different symbol name | |
24 | if test "$with_des" = no; then | |
25 | AC_CHECK_LIB(crypto, DES_cbc_encrypt, [ | |
26 | AC_CHECK_HEADER(openssl/des.h, [AC_DEFINE(WITH_SSL_DES,[],[Use OpenSSL DES Implementation]) | |
27 | LIB_DES="-lcrypto"; | |
28 | with_des=yes], | |
29 | with_des=no)], | |
30 | with_des=no, $LIB_RSAREF) | |
31 | fi | |
32 | fi | |
33 | ||
34 | if test "$with_des" = no; then | |
35 | AC_CHECK_LIB(des, des_cbc_encrypt, [LIB_DES="-ldes"; | |
36 | with_des=yes], with_des=no) | |
37 | fi | |
38 | ||
39 | if test "$with_des" = no; then | |
40 | AC_CHECK_LIB(des425, des_cbc_encrypt, [LIB_DES="-ldes425"; | |
41 | with_des=yes], with_des=no) | |
42 | fi | |
43 | ||
44 | if test "$with_des" = no; then | |
45 | AC_CHECK_LIB(des524, des_cbc_encrypt, [LIB_DES="-ldes524"; | |
46 | with_des=yes], with_des=no) | |
47 | fi | |
48 | ||
49 | if test "$with_des" = no; then | |
50 | dnl if openssl is around, we might be able to use that for des | |
51 | ||
52 | dnl if openssl has been compiled with the rsaref2 libraries, | |
53 | dnl we need to include the rsaref libraries in the crypto check | |
54 | LIB_RSAREF="" | |
55 | AC_CHECK_LIB(rsaref, RSAPublicEncrypt, | |
56 | LIB_RSAREF="-lRSAglue -lrsaref"; cmu_have_rsaref=yes, | |
57 | cmu_have_rsaref=no) | |
58 | ||
59 | AC_CHECK_LIB(crypto, des_cbc_encrypt, [ | |
60 | AC_CHECK_HEADER(openssl/des.h, [AC_DEFINE(WITH_SSL_DES,[],[Use OpenSSL DES Implementation]) | |
61 | LIB_DES="-lcrypto"; | |
62 | with_des=yes], | |
63 | with_des=no)], | |
64 | with_des=no, $LIB_RSAREF) | |
65 | fi | |
66 | fi | |
67 | ||
68 | if test "$with_des" != no; then | |
69 | AC_DEFINE(WITH_DES,[],[Use DES]) | |
70 | fi | |
71 | ||
72 | AC_SUBST(LIB_DES) | |
73 | ]) | |
74 | ||
75 | AC_DEFUN([SASL_KERBEROS_V4_CHK], [ | |
76 | AC_REQUIRE([SASL_DES_CHK]) | |
77 | ||
78 | AC_ARG_ENABLE(krb4, [ --enable-krb4 enable KERBEROS_V4 authentication [[no]] ], | |
79 | krb4=$enableval, | |
80 | krb4=no) | |
81 | ||
82 | if test "$krb4" != no; then | |
83 | dnl In order to compile kerberos4, we need libkrb and libdes. | |
84 | dnl (We've already gotten libdes from SASL_DES_CHK) | |
85 | dnl we might need -lresolv for kerberos | |
86 | AC_CHECK_LIB(resolv,res_search) | |
87 | ||
88 | dnl if we were ambitious, we would look more aggressively for the | |
89 | dnl krb4 install | |
90 | if test -d ${krb4}; then | |
91 | AC_CACHE_CHECK(for Kerberos includes, cyrus_krbinclude, [ | |
92 | for krbhloc in include/kerberosIV include/kerberos include | |
93 | do | |
94 | if test -f ${krb4}/${krbhloc}/krb.h ; then | |
95 | cyrus_krbinclude=${krb4}/${krbhloc} | |
96 | break | |
97 | fi | |
98 | done | |
99 | ]) | |
100 | ||
101 | if test -n "${cyrus_krbinclude}"; then | |
102 | CPPFLAGS="$CPPFLAGS -I${cyrus_krbinclude}" | |
103 | fi | |
104 | LDFLAGS="$LDFLAGS -L$krb4/lib" | |
105 | fi | |
106 | ||
107 | if test "$with_des" != no; then | |
108 | AC_CHECK_HEADER(krb.h, [ | |
109 | AC_CHECK_LIB(com_err, com_err, [ | |
110 | AC_CHECK_LIB(krb, krb_mk_priv, | |
111 | [COM_ERR="-lcom_err"; SASL_KRB_LIB="-lkrb"; krb4lib="yes"], | |
112 | krb4lib=no, $LIB_DES -lcom_err)], [ | |
113 | AC_CHECK_LIB(krb, krb_mk_priv, | |
114 | [COM_ERR=""; SASL_KRB_LIB="-lkrb"; krb4lib="yes"], | |
115 | krb4lib=no, $LIB_DES)])], krb4="no") | |
116 | ||
117 | if test "$krb4" != "no" -a "$krb4lib" = "no"; then | |
118 | AC_CHECK_LIB(krb4, krb_mk_priv, | |
119 | [COM_ERR=""; SASL_KRB_LIB="-lkrb4"; krb4=yes], | |
120 | krb4=no, $LIB_DES) | |
121 | fi | |
122 | if test "$krb4" = no; then | |
123 | AC_WARN(No Kerberos V4 found) | |
124 | fi | |
125 | else | |
126 | AC_WARN(No DES library found for Kerberos V4 support) | |
127 | krb4=no | |
128 | fi | |
129 | fi | |
130 | ||
131 | if test "$krb4" != no; then | |
132 | cmu_save_LIBS="$LIBS" | |
133 | LIBS="$LIBS $SASL_KRB_LIB" | |
134 | AC_CHECK_FUNCS(krb_get_err_text) | |
135 | LIBS="$cmu_save_LIBS" | |
136 | fi | |
137 | ||
138 | AC_MSG_CHECKING(KERBEROS_V4) | |
139 | if test "$krb4" != no; then | |
140 | AC_MSG_RESULT(enabled) | |
141 | SASL_MECHS="$SASL_MECHS libkerberos4.la" | |
142 | SASL_STATIC_SRCS="$SASL_STATIC_SRCS \$(top_srcdir)/plugins/kerberos4.c" | |
143 | SASL_STATIC_OBJS="$SASL_STATIC_OBJS kerberos4.o" | |
144 | AC_DEFINE(STATIC_KERBEROS4,[],[User KERBEROS_V4 Staticly]) | |
145 | AC_DEFINE(HAVE_KRB,[],[Do we have Kerberos 4 Support?]) | |
146 | SASL_KRB_LIB="$SASL_KRB_LIB $LIB_DES $COM_ERR" | |
147 | else | |
148 | AC_MSG_RESULT(disabled) | |
149 | fi | |
150 | AC_SUBST(SASL_KRB_LIB) | |
151 | ]) | |
152 |
0 | dnl Check for PLAIN (and therefore crypt) | |
1 | ||
2 | AC_DEFUN([SASL_PLAIN_CHK],[ | |
3 | AC_REQUIRE([SASL2_CRYPT_CHK]) | |
4 | ||
5 | dnl PLAIN | |
6 | AC_ARG_ENABLE(plain, [ --enable-plain enable PLAIN authentication [yes] ], | |
7 | plain=$enableval, | |
8 | plain=yes) | |
9 | ||
10 | PLAIN_LIBS="" | |
11 | if test "$plain" != no; then | |
12 | dnl In order to compile plain, we need crypt. | |
13 | if test "$cmu_have_crypt" = yes; then | |
14 | PLAIN_LIBS=$LIB_CRYPT | |
15 | fi | |
16 | fi | |
17 | AC_SUBST(PLAIN_LIBS) | |
18 | ||
19 | AC_MSG_CHECKING(PLAIN) | |
20 | if test "$plain" != no; then | |
21 | AC_MSG_RESULT(enabled) | |
22 | SASL_MECHS="$SASL_MECHS libplain.la" | |
23 | if test "$enable_static" = yes; then | |
24 | SASL_STATIC_OBJS="$SASL_STATIC_OBJS plain.o" | |
25 | SASL_STATIC_SRCS="$SASL_STATIC_SRCS \$(top_srcdir)/plugins/plain.c" | |
26 | AC_DEFINE(STATIC_PLAIN,[],[Link PLAIN Staticly]) | |
27 | fi | |
28 | else | |
29 | AC_MSG_RESULT(disabled) | |
30 | fi | |
31 | ]) |
0 | dnl Functions to check what database to use for libsasldb | |
1 | ||
2 | dnl Berkeley DB specific checks first.. | |
3 | ||
4 | dnl Figure out what database type we're using | |
5 | AC_DEFUN([SASL_DB_CHECK], [ | |
6 | cmu_save_LIBS="$LIBS" | |
7 | AC_ARG_WITH(dblib, [ --with-dblib=DBLIB set the DB library to use [berkeley] ], | |
8 | dblib=$withval, | |
9 | dblib=auto_detect) | |
10 | ||
11 | CYRUS_BERKELEY_DB_OPTS() | |
12 | ||
13 | SASL_DB_LIB="" | |
14 | ||
15 | case "$dblib" in | |
16 | dnl this is unbelievably painful due to confusion over what db-3 should be | |
17 | dnl named. arg. | |
18 | berkeley) | |
19 | CYRUS_BERKELEY_DB_CHK() | |
20 | CPPFLAGS="${CPPFLAGS} ${BDB_INCADD}" | |
21 | SASL_DB_INC=$BDB_INCADD | |
22 | SASL_DB_LIB="${BDB_LIBADD}" | |
23 | ;; | |
24 | gdbm) | |
25 | AC_ARG_WITH(gdbm,[ --with-gdbm=PATH use gdbm from PATH], | |
26 | with_gdbm="${withval}") | |
27 | ||
28 | case "$with_gdbm" in | |
29 | ""|yes) | |
30 | AC_CHECK_HEADER(gdbm.h, [ | |
31 | AC_CHECK_LIB(gdbm, gdbm_open, SASL_DB_LIB="-lgdbm", | |
32 | dblib="no")], | |
33 | dblib="no") | |
34 | ;; | |
35 | *) | |
36 | if test -d $with_gdbm; then | |
37 | CPPFLAGS="${CPPFLAGS} -I${with_gdbm}/include" | |
38 | LDFLAGS="${LDFLAGS} -L${with_gdbm}/lib" | |
39 | SASL_DB_LIB="-lgdbm" | |
40 | else | |
41 | with_gdbm="no" | |
42 | fi | |
43 | esac | |
44 | ;; | |
45 | ndbm) | |
46 | dnl We want to attempt to use -lndbm if we can, just in case | |
47 | dnl there's some version of it installed and overriding libc | |
48 | AC_CHECK_HEADER(ndbm.h, [ | |
49 | AC_CHECK_LIB(ndbm, dbm_open, SASL_DB_LIB="-lndbm", [ | |
50 | AC_CHECK_FUNC(dbm_open,,dblib="no")])], | |
51 | dblib="no") | |
52 | ;; | |
53 | auto_detect) | |
54 | dnl How about berkeley db? | |
55 | CYRUS_BERKELEY_DB_CHK() | |
56 | if test "$dblib" = no; then | |
57 | dnl How about ndbm? | |
58 | AC_CHECK_HEADER(ndbm.h, [ | |
59 | AC_CHECK_LIB(ndbm, dbm_open, | |
60 | dblib="ndbm"; SASL_DB_LIB="-lndbm", | |
61 | dblib="weird")], | |
62 | dblib="no") | |
63 | if test "$dblib" = "weird"; then | |
64 | dnl Is ndbm in the standard library? | |
65 | AC_CHECK_FUNC(dbm_open, dblib="ndbm", dblib="no") | |
66 | fi | |
67 | ||
68 | if test "$dblib" = no; then | |
69 | dnl Can we use gdbm? | |
70 | AC_CHECK_HEADER(gdbm.h, [ | |
71 | AC_CHECK_LIB(gdbm, gdbm_open, dblib="gdbm"; | |
72 | SASL_DB_LIB="-lgdbm", dblib="no")], | |
73 | dblib="no") | |
74 | fi | |
75 | else | |
76 | dnl we took Berkeley | |
77 | CPPFLAGS="${CPPFLAGS} ${BDB_INCADD}" | |
78 | SASL_DB_INC=$BDB_INCADD | |
79 | SASL_DB_LIB="${BDB_LIBADD}" | |
80 | fi | |
81 | ;; | |
82 | none) | |
83 | ;; | |
84 | no) | |
85 | ;; | |
86 | *) | |
87 | AC_MSG_WARN([Bad DB library implementation specified;]) | |
88 | AC_ERROR([Use either \"berkeley\", \"gdbm\", \"ndbm\" or \"none\"]) | |
89 | dblib=no | |
90 | ;; | |
91 | esac | |
92 | LIBS="$cmu_save_LIBS" | |
93 | ||
94 | AC_MSG_CHECKING(DB library to use) | |
95 | AC_MSG_RESULT($dblib) | |
96 | ||
97 | SASL_DB_BACKEND="db_${dblib}.lo" | |
98 | SASL_DB_BACKEND_STATIC="db_${dblib}.o allockey.o" | |
99 | SASL_DB_BACKEND_STATIC_SRCS="\$(top_srcdir)/sasldb/db_${dblib}.c \$(top_srcdir)/sasldb/allockey.c" | |
100 | SASL_DB_UTILS="saslpasswd2 sasldblistusers2" | |
101 | SASL_DB_MANS="saslpasswd2.8 sasldblistusers2.8" | |
102 | ||
103 | case "$dblib" in | |
104 | gdbm) | |
105 | SASL_MECHS="$SASL_MECHS libsasldb.la" | |
106 | AC_DEFINE(SASL_GDBM,[],[Use GDBM for SASLdb]) | |
107 | ;; | |
108 | ndbm) | |
109 | SASL_MECHS="$SASL_MECHS libsasldb.la" | |
110 | AC_DEFINE(SASL_NDBM,[],[Use NDBM for SASLdb]) | |
111 | ;; | |
112 | berkeley) | |
113 | SASL_MECHS="$SASL_MECHS libsasldb.la" | |
114 | AC_DEFINE(SASL_BERKELEYDB,[],[Use BerkeleyDB for SASLdb]) | |
115 | ;; | |
116 | *) | |
117 | AC_MSG_WARN([Disabling SASL authentication database support]) | |
118 | dnl note that we do not add libsasldb.la to SASL_MECHS, since it | |
119 | dnl will just fail to load anyway. | |
120 | SASL_DB_BACKEND="db_none.lo" | |
121 | SASL_DB_BACKEND_STATIC="db_none.o" | |
122 | SASL_DB_BACKEND_STATIC_SRCS="\$(top_srcdir)/sasldb/db_none.c" | |
123 | SASL_DB_UTILS="" | |
124 | SASL_DB_MANS="" | |
125 | SASL_DB_LIB="" | |
126 | ;; | |
127 | esac | |
128 | ||
129 | if test "$enable_static" = yes; then | |
130 | if test "$dblib" != "none"; then | |
131 | SASL_STATIC_SRCS="$SASL_STATIC_SRCS \$(top_srcdir)/plugins/sasldb.c $SASL_DB_BACKEND_STATIC_SRCS" | |
132 | SASL_STATIC_OBJS="$SASL_STATIC_OBJS sasldb.o $SASL_DB_BACKEND_STATIC" | |
133 | AC_DEFINE(STATIC_SASLDB,[],[Link SASLdb Staticly]) | |
134 | else | |
135 | SASL_STATIC_OBJS="$SASL_STATIC_OBJS $SASL_DB_BACKEND_STATIC" | |
136 | SASL_STATIC_SRCS="$SASL_STATIC_SRCS $SASL_DB_BACKEND_STATIC_SRCS" | |
137 | fi | |
138 | fi | |
139 | ||
140 | AC_SUBST(SASL_DB_UTILS) | |
141 | AC_SUBST(SASL_DB_MANS) | |
142 | AC_SUBST(SASL_DB_BACKEND) | |
143 | AC_SUBST(SASL_DB_BACKEND_STATIC) | |
144 | AC_SUBST(SASL_DB_INC) | |
145 | AC_SUBST(SASL_DB_LIB) | |
146 | ]) | |
147 | ||
148 | dnl Figure out what database path we're using | |
149 | AC_DEFUN([SASL_DB_PATH_CHECK], [ | |
150 | AC_ARG_WITH(dbpath, [ --with-dbpath=PATH set the DB path to use [/etc/sasldb2] ], | |
151 | dbpath=$withval, | |
152 | dbpath=/etc/sasldb2) | |
153 | AC_MSG_CHECKING(DB path to use) | |
154 | AC_MSG_RESULT($dbpath) | |
155 | AC_DEFINE_UNQUOTED(SASL_DB_PATH, "$dbpath", [Path to default SASLdb database])]) |
0 | #Can this be autogenerated? | |
1 | #Keep in sync with include/sasl.h and win32/include/config.h | |
2 | SASL_VERSION_MAJOR=2 | |
3 | SASL_VERSION_MINOR=1 | |
4 | SASL_VERSION_STEP=25 | |
5 | ||
6 | !IF "$(STATIC)" == "" | |
7 | STATIC=yes | |
8 | !ENDIF | |
9 | ||
10 | # Uncomment the following line, if you want to use Visual Studio 6 | |
11 | #VCVER=6 | |
12 | ||
13 | # Use in Visual Studio 6 & 7: | |
14 | #EXCEPTHANDLING=/GX | |
15 | ||
16 | # Use in Visual Studio 8: | |
17 | EXCEPTHANDLING=/EHsc | |
18 | ||
19 | # Define compiler/linker/etc. | |
20 | ||
21 | CPP=cl.exe /nologo | |
22 | LINK32=link.exe /nologo | |
23 | LINK32DLL=$(LINK32) /dll | |
24 | LINK32EXE=$(LINK32) | |
25 | # It seems that -lib must be the first parameter | |
26 | LINK32LIB=link.exe /lib /nologo | |
27 | ||
28 | SYS_LIBS=ws2_32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib | |
29 | ||
30 | !IF "$(BITS)" == "64" | |
31 | SYS_LIBS=$(SYS_LIBS) bufferoverflowU.lib | |
32 | !ENDIF | |
33 | ||
34 | # Define the minimal Windows OS you want to run on:40 (NT), 50 (W2K), 51 (XP) | |
35 | # Default is no restrictions. Currently we only check for 51 or later. | |
36 | #TARGET_WIN_SYSTEM=51 | |
37 | ||
38 | !IF "$(TARGET_WIN_SYSTEM)" == "" | |
39 | !IF "$(VERBOSE)" != "0" | |
40 | !MESSAGE Applications and libraries should run on any Win32 system. | |
41 | !ENDIF | |
42 | TARGET_WIN_SYSTEM=0 | |
43 | !ENDIF | |
44 | ||
45 | # prefix variable is currently only being used by install target | |
46 | !IF "$(prefix)" == "" | |
47 | prefix=C:\CMU | |
48 | !IF "$(VERBOSE)" != "0" | |
49 | !MESSAGE Default installation directory is $(prefix). | |
50 | !ENDIF | |
51 | !ENDIF | |
52 | ||
53 | !IF "$(CFG)" == "" | |
54 | CFG=Release | |
55 | !IF "$(VERBOSE)" != "0" | |
56 | !MESSAGE No configuration specified. Defaulting to $(CFG). | |
57 | !ENDIF | |
58 | !ENDIF | |
59 | ||
60 | !IF "$(DB_LIB)" == "" | |
61 | DB_LIB=libdb41s.lib | |
62 | !IF "$(VERBOSE)" != "0" | |
63 | !MESSAGE Defaulting SleepyCat library name to $(DB_LIB). | |
64 | !ENDIF | |
65 | !ENDIF | |
66 | ||
67 | !IF "$(DB_INCLUDE)" == "" | |
68 | DB_INCLUDE=c:\work\isode\db\build_win32 | |
69 | !IF "$(VERBOSE)" != "0" | |
70 | !MESSAGE Defaulting SleepyCat include path to $(DB_INCLUDE). | |
71 | !ENDIF | |
72 | !ENDIF | |
73 | ||
74 | !IF "$(DB_LIBPATH)" == "" | |
75 | DB_LIBPATH=c:\work\isode\db\build_win32\Release_static | |
76 | !IF "$(VERBOSE)" != "0" | |
77 | !MESSAGE Defaulting SleepyCat library path to $(DB_LIBPATH). | |
78 | !ENDIF | |
79 | !ENDIF | |
80 | ||
81 | !IF "$(OPENSSL_INCLUDE)" == "" | |
82 | OPENSSL_INCLUDE="D:\openssl\engine-0.9.6g-md3\include" | |
83 | !IF "$(VERBOSE)" != "0" | |
84 | !MESSAGE Defaulting OpenSSL Include path to $(OPENSSL_INCLUDE). | |
85 | !ENDIF | |
86 | !ENDIF | |
87 | ||
88 | !IF "$(OPENSSL_LIBPATH)" == "" | |
89 | OPENSSL_LIBPATH="D:\openssl\engine-0.9.6g-md3\lib" | |
90 | !IF "$(VERBOSE)" != "0" | |
91 | !MESSAGE Defaulting OpenSSL library path to $(OPENSSL_LIBPATH). | |
92 | !ENDIF | |
93 | !ENDIF | |
94 | ||
95 | !IF "$(GSSAPI_INCLUDE)" == "" | |
96 | GSSAPI_INCLUDE="C:\Program Files\CyberSafe\Developer Pack\ApplicationSecuritySDK\include" | |
97 | !IF "$(VERBOSE)" != "0" | |
98 | !MESSAGE Defaulting GSSAPI Include path to $(GSSAPI_INCLUDE). | |
99 | !ENDIF | |
100 | !ENDIF | |
101 | ||
102 | !IF "$(GSSAPI_LIBPATH)" == "" | |
103 | GSSAPI_LIBPATH="C:\Program Files\CyberSafe\Developer Pack\ApplicationSecuritySDK\lib" | |
104 | !IF "$(VERBOSE)" != "0" | |
105 | !MESSAGE Defaulting GSSAPI library path to $(GSSAPI_LIBPATH). | |
106 | !ENDIF | |
107 | !ENDIF | |
108 | ||
109 | !IF "$(SQLITE_INCLUDE)" == "" | |
110 | SQLITE_INCLUDES=/I"C:\work\open_source\sqllite\sqlite\src" /I"C:\work\open_source\sqllite\sqlite\win32" | |
111 | !IF "$(VERBOSE)" != "0" | |
112 | !MESSAGE Defaulting SQLITE_INCLUDES includes to $(SQLITE_INCLUDES). | |
113 | !ENDIF | |
114 | !ENDIF | |
115 | ||
116 | !IF "$(SQLITE_LIBPATH)" == "" | |
117 | SQLITE_LIBPATH="C:\work\open_source\sqllite\sqlite\objs" | |
118 | !IF "$(VERBOSE)" != "0" | |
119 | !MESSAGE Defaulting SQLITE library path to $(SQLITE_LIBPATH). | |
120 | !ENDIF | |
121 | !ENDIF | |
122 | ||
123 | !IF "$(SQLITE_INCLUDE3)" == "" | |
124 | SQLITE_INCLUDES3=/I"c:\work\sqlite\generated" | |
125 | !IF "$(VERBOSE)" != "0" | |
126 | !MESSAGE Defaulting SQLITE_INCLUDES3 includes to $(SQLITE_INCLUDES3). | |
127 | !ENDIF | |
128 | !ENDIF | |
129 | ||
130 | !IF "$(SQLITE_LIBPATH3)" == "" | |
131 | SQLITE_LIBPATH3="c:\work\sqlite\objs.NT" | |
132 | !IF "$(VERBOSE)" != "0" | |
133 | !MESSAGE Defaulting SQLITE library path to $(SQLITE_LIBPATH3). | |
134 | !ENDIF | |
135 | !ENDIF | |
136 | ||
137 | !IF "$(LDAP_LIB_BASE)" == "" | |
138 | LDAP_LIB_BASE = c:\work\open_source\openldap\openldap-head\ldap\Debug | |
139 | !IF "$(VERBOSE)" != "0" | |
140 | !MESSAGE Defaulting LDAP library path to $(LDAP_LIB_BASE). | |
141 | !ENDIF | |
142 | !ENDIF | |
143 | ||
144 | !IF "$(LDAP_INCLUDE)" == "" | |
145 | LDAP_INCLUDE = c:\work\open_source\openldap\openldap-head\ldap\include | |
146 | !IF "$(VERBOSE)" != "0" | |
147 | !MESSAGE Defaulting LDAP include path to $(LDAP_INCLUDE). | |
148 | !ENDIF | |
149 | !ENDIF | |
150 | ||
151 | !IF "$(OS)" == "Windows_NT" | |
152 | NULL= | |
153 | !ELSE | |
154 | NULL=nul | |
155 | !ENDIF | |
156 | ||
157 | ||
158 | !IF "$(CFG)" == "Release" | |
159 | ||
160 | !IF "$(CODEGEN)" == "" | |
161 | !IF "$(STATIC)" == "yes" | |
162 | CODEGEN=/MT | |
163 | !ELSE | |
164 | CODEGEN=/MD | |
165 | !ENDIF | |
166 | !IF "$(VERBOSE)" != "0" | |
167 | !MESSAGE Codegeneration defaulting to $(CODEGEN). | |
168 | !ENDIF | |
169 | !ENDIF | |
170 | ||
171 | !IF "$(VCVER)" != "6" | |
172 | ENABLE_WIN64_WARNINGS=/Wp64 | |
173 | !ENDIF | |
174 | ||
175 | CPP_PROJ= $(CODEGEN) /W3 $(EXCEPTHANDLING) /O2 $(ENABLE_WIN64_WARNINGS) /Zi /D "NDEBUG" $(CPPFLAGS) /FD /c | |
176 | ||
177 | incremental=no | |
178 | ||
179 | # This use to contain /machine:I386. This breaks cross compiling to Windows 64. | |
180 | # It doesn't seem that the /machine option is needed anyway. | |
181 | LINK32_FLAGS=/debug | |
182 | ||
183 | !ELSEIF "$(CFG)" == "Debug" | |
184 | ||
185 | !IF "$(CODEGEN)" == "" | |
186 | !IF "$(STATIC)" == "yes" | |
187 | CODEGEN=/MTd | |
188 | !ELSE | |
189 | CODEGEN=/MDd | |
190 | !ENDIF | |
191 | !IF "$(VERBOSE)" != "0" | |
192 | !MESSAGE Codegeneration defaulting to $(CODEGEN). | |
193 | !ENDIF | |
194 | !ENDIF | |
195 | ||
196 | CPP_PROJ=$(CODEGEN) /W3 /Gm $(EXCEPTHANDLING) /ZI /Od /D "_DEBUG" $(CPPFLAGS) /FD /GZ /c | |
197 | ||
198 | incremental=yes | |
199 | ||
200 | # This use to contain /machine:I386. This breaks cross compiling to Windows 64. | |
201 | # It doesn't seem that the /machine option is needed anyway. | |
202 | LINK32_FLAGS=/debug /pdbtype:sept | |
203 | ||
204 | !ENDIF | |
205 | ||
206 | LINK32DLL_FLAGS=/incremental:$(incremental) $(LINK32_FLAGS) $(SYS_LIBS) $(EXTRA_LIBS) | |
207 | ||
208 | # Assume we are only building console applications | |
209 | LINK32EXE_FLAGS=/subsystem:console /incremental:$(incremental) $(LINK32_FLAGS) $(SYS_LIBS) $(EXTRA_LIBS) | |
210 | ||
211 | # Assume we are only building console applications | |
212 | LINK32EXE_FLAGS=/subsystem:console /incremental:$(incremental) $(LINK32_FLAGS) $(SYS_LIBS) $(EXTRA_LIBS) | |
213 | ||
214 | LINK32LIB_FLAGS=$(LINK32_FLAGS) |
0 | #Can this be autogenerated? | |
1 | #Keep in sync with include/sasl.h and win32/include/config.h | |
2 | SASL_VERSION_MAJOR=2 | |
3 | SASL_VERSION_MINOR=1 | |
4 | SASL_VERSION_STEP=25 | |
5 | ||
6 | !IF "$(STATIC)" == "" | |
7 | STATIC=yes | |
8 | !ENDIF | |
9 | ||
10 | # Uncomment the following line, if you want to use Visual Studio 6 | |
11 | #VCVER=6 | |
12 | ||
13 | # Use in Visual Studio 6 & 7: | |
14 | #EXCEPTHANDLING=/GX | |
15 | ||
16 | # Use in Visual Studio 8: | |
17 | EXCEPTHANDLING=/EHsc | |
18 | ||
19 | # Define compiler/linker/etc. | |
20 | ||
21 | CPP=cl.exe /nologo | |
22 | LINK32=link.exe /nologo | |
23 | LINK32DLL=$(LINK32) /dll | |
24 | LINK32EXE=$(LINK32) | |
25 | # It seems that -lib must be the first parameter | |
26 | LINK32LIB=link.exe /lib /nologo | |
27 | ||
28 | SYS_LIBS=ws2_32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib | |
29 | ||
30 | !IF "$(BITS)" == "64" | |
31 | SYS_LIBS=$(SYS_LIBS) bufferoverflowU.lib | |
32 | !ENDIF | |
33 | ||
34 | # Define the minimal Windows OS you want to run on:40 (NT), 50 (W2K), 51 (XP) | |
35 | # Default is no restrictions. Currently we only check for 51 or later. | |
36 | #TARGET_WIN_SYSTEM=51 | |
37 | ||
38 | !IF "$(TARGET_WIN_SYSTEM)" == "" | |
39 | !IF "$(VERBOSE)" != "0" | |
40 | !MESSAGE Applications and libraries should run on any Win32 system. | |
41 | !ENDIF | |
42 | TARGET_WIN_SYSTEM=0 | |
43 | !ENDIF | |
44 | ||
45 | # prefix variable is currently only being used by install target | |
46 | !IF "$(prefix)" == "" | |
47 | prefix=C:\CMU | |
48 | !IF "$(VERBOSE)" != "0" | |
49 | !MESSAGE Default installation directory is $(prefix). | |
50 | !ENDIF | |
51 | !ENDIF | |
52 | ||
53 | !IF "$(CFG)" == "" | |
54 | CFG=Release | |
55 | !IF "$(VERBOSE)" != "0" | |
56 | !MESSAGE No configuration specified. Defaulting to $(CFG). | |
57 | !ENDIF | |
58 | !ENDIF | |
59 | ||
60 | !IF "$(DB_LIB)" == "" | |
61 | DB_LIB=libdb41s.lib | |
62 | !IF "$(VERBOSE)" != "0" | |
63 | !MESSAGE Defaulting SleepyCat library name to $(DB_LIB). | |
64 | !ENDIF | |
65 | !ENDIF | |
66 | ||
67 | !IF "$(DB_INCLUDE)" == "" | |
68 | DB_INCLUDE=c:\work\isode\db\build_win32 | |
69 | !IF "$(VERBOSE)" != "0" | |
70 | !MESSAGE Defaulting SleepyCat include path to $(DB_INCLUDE). | |
71 | !ENDIF | |
72 | !ENDIF | |
73 | ||
74 | !IF "$(DB_LIBPATH)" == "" | |
75 | DB_LIBPATH=c:\work\isode\db\build_win32\Release_static | |
76 | !IF "$(VERBOSE)" != "0" | |
77 | !MESSAGE Defaulting SleepyCat library path to $(DB_LIBPATH). | |
78 | !ENDIF | |
79 | !ENDIF | |
80 | ||
81 | !IF "$(OPENSSL_INCLUDE)" == "" | |
82 | OPENSSL_INCLUDE="D:\openssl\engine-0.9.6g-md3\include" | |
83 | !IF "$(VERBOSE)" != "0" | |
84 | !MESSAGE Defaulting OpenSSL Include path to $(OPENSSL_INCLUDE). | |
85 | !ENDIF | |
86 | !ENDIF | |
87 | ||
88 | !IF "$(OPENSSL_LIBPATH)" == "" | |
89 | OPENSSL_LIBPATH="D:\openssl\engine-0.9.6g-md3\lib" | |
90 | !IF "$(VERBOSE)" != "0" | |
91 | !MESSAGE Defaulting OpenSSL library path to $(OPENSSL_LIBPATH). | |
92 | !ENDIF | |
93 | !ENDIF | |
94 | ||
95 | !IF "$(GSSAPI_INCLUDE)" == "" | |
96 | GSSAPI_INCLUDE="C:\Program Files\CyberSafe\Developer Pack\ApplicationSecuritySDK\include" | |
97 | !IF "$(VERBOSE)" != "0" | |
98 | !MESSAGE Defaulting GSSAPI Include path to $(GSSAPI_INCLUDE). | |
99 | !ENDIF | |
100 | !ENDIF | |
101 | ||
102 | !IF "$(GSSAPI_LIBPATH)" == "" | |
103 | GSSAPI_LIBPATH="C:\Program Files\CyberSafe\Developer Pack\ApplicationSecuritySDK\lib" | |
104 | !IF "$(VERBOSE)" != "0" | |
105 | !MESSAGE Defaulting GSSAPI library path to $(GSSAPI_LIBPATH). | |
106 | !ENDIF | |
107 | !ENDIF | |
108 | ||
109 | !IF "$(SQLITE_INCLUDE)" == "" | |
110 | SQLITE_INCLUDES=/I"C:\work\open_source\sqllite\sqlite\src" /I"C:\work\open_source\sqllite\sqlite\win32" | |
111 | !IF "$(VERBOSE)" != "0" | |
112 | !MESSAGE Defaulting SQLITE_INCLUDES includes to $(SQLITE_INCLUDES). | |
113 | !ENDIF | |
114 | !ENDIF | |
115 | ||
116 | !IF "$(SQLITE_LIBPATH)" == "" | |
117 | SQLITE_LIBPATH="C:\work\open_source\sqllite\sqlite\objs" | |
118 | !IF "$(VERBOSE)" != "0" | |
119 | !MESSAGE Defaulting SQLITE library path to $(SQLITE_LIBPATH). | |
120 | !ENDIF | |
121 | !ENDIF | |
122 | ||
123 | !IF "$(SQLITE_INCLUDE3)" == "" | |
124 | SQLITE_INCLUDES3=/I"c:\work\sqlite\generated" | |
125 | !IF "$(VERBOSE)" != "0" | |
126 | !MESSAGE Defaulting SQLITE_INCLUDES3 includes to $(SQLITE_INCLUDES3). | |
127 | !ENDIF | |
128 | !ENDIF | |
129 | ||
130 | !IF "$(SQLITE_LIBPATH3)" == "" | |
131 | SQLITE_LIBPATH3="c:\work\sqlite\objs.NT" | |
132 | !IF "$(VERBOSE)" != "0" | |
133 | !MESSAGE Defaulting SQLITE library path to $(SQLITE_LIBPATH3). | |
134 | !ENDIF | |
135 | !ENDIF | |
136 | ||
137 | !IF "$(LDAP_LIB_BASE)" == "" | |
138 | LDAP_LIB_BASE = c:\work\open_source\openldap\openldap-head\ldap\Debug | |
139 | !IF "$(VERBOSE)" != "0" | |
140 | !MESSAGE Defaulting LDAP library path to $(LDAP_LIB_BASE). | |
141 | !ENDIF | |
142 | !ENDIF | |
143 | ||
144 | !IF "$(LDAP_INCLUDE)" == "" | |
145 | LDAP_INCLUDE = c:\work\open_source\openldap\openldap-head\ldap\include | |
146 | !IF "$(VERBOSE)" != "0" | |
147 | !MESSAGE Defaulting LDAP include path to $(LDAP_INCLUDE). | |
148 | !ENDIF | |
149 | !ENDIF | |
150 | ||
151 | !IF "$(OS)" == "Windows_NT" | |
152 | NULL= | |
153 | !ELSE | |
154 | NULL=nul | |
155 | !ENDIF | |
156 | ||
157 | ||
158 | !IF "$(CFG)" == "Release" | |
159 | ||
160 | !IF "$(CODEGEN)" == "" | |
161 | !IF "$(STATIC)" == "yes" | |
162 | CODEGEN=/MT | |
163 | !ELSE | |
164 | CODEGEN=/MD | |
165 | !ENDIF | |
166 | !IF "$(VERBOSE)" != "0" | |
167 | !MESSAGE Codegeneration defaulting to $(CODEGEN). | |
168 | !ENDIF | |
169 | !ENDIF | |
170 | ||
171 | !IF "$(VCVER)" != "6" | |
172 | ENABLE_WIN64_WARNINGS=/Wp64 | |
173 | !ENDIF | |
174 | ||
175 | CPP_PROJ= $(CODEGEN) /W3 $(EXCEPTHANDLING) /O2 $(ENABLE_WIN64_WARNINGS) /Zi /D "NDEBUG" $(CPPFLAGS) /FD /c | |
176 | ||
177 | incremental=no | |
178 | ||
179 | # This use to contain /machine:I386. This breaks cross compiling to Windows 64. | |
180 | # It doesn't seem that the /machine option is needed anyway. | |
181 | LINK32_FLAGS=/debug | |
182 | ||
183 | !ELSEIF "$(CFG)" == "Debug" | |
184 | ||
185 | !IF "$(CODEGEN)" == "" | |
186 | !IF "$(STATIC)" == "yes" | |
187 | CODEGEN=/MTd | |
188 | !ELSE | |
189 | CODEGEN=/MDd | |
190 | !ENDIF | |
191 | !IF "$(VERBOSE)" != "0" | |
192 | !MESSAGE Codegeneration defaulting to $(CODEGEN). | |
193 | !ENDIF | |
194 | !ENDIF | |
195 | ||
196 | CPP_PROJ=$(CODEGEN) /W3 /Gm $(EXCEPTHANDLING) /ZI /Od /D "_DEBUG" $(CPPFLAGS) /FD /GZ /c | |
197 | ||
198 | incremental=yes | |
199 | ||
200 | # This use to contain /machine:I386. This breaks cross compiling to Windows 64. | |
201 | # It doesn't seem that the /machine option is needed anyway. | |
202 | LINK32_FLAGS=/debug /pdbtype:sept | |
203 | ||
204 | !ENDIF | |
205 | ||
206 | LINK32DLL_FLAGS=/incremental:$(incremental) $(LINK32_FLAGS) $(SYS_LIBS) $(EXTRA_LIBS) | |
207 | ||
208 | # Assume we are only building console applications | |
209 | LINK32EXE_FLAGS=/subsystem:console /incremental:$(incremental) $(LINK32_FLAGS) $(SYS_LIBS) $(EXTRA_LIBS) | |
210 | ||
211 | # Assume we are only building console applications | |
212 | LINK32EXE_FLAGS=/subsystem:console /incremental:$(incremental) $(LINK32_FLAGS) $(SYS_LIBS) $(EXTRA_LIBS) | |
213 | ||
214 | LINK32LIB_FLAGS=$(LINK32_FLAGS) |