1 | dnl configure.in for the SASL library |
---|
2 | dnl Rob Siemborski |
---|
3 | dnl Rob Earhart |
---|
4 | dnl $Id: configure.in,v 1.1.1.2 2003-02-12 22:34:21 ghudson Exp $ |
---|
5 | dnl |
---|
6 | dnl Copyright (c) 2001 Carnegie Mellon University. All rights reserved. |
---|
7 | dnl |
---|
8 | dnl Redistribution and use in source and binary forms, with or without |
---|
9 | dnl modification, are permitted provided that the following conditions |
---|
10 | dnl are met: |
---|
11 | dnl |
---|
12 | dnl 1. Redistributions of source code must retain the above copyright |
---|
13 | dnl notice, this list of conditions and the following disclaimer. |
---|
14 | dnl |
---|
15 | dnl 2. Redistributions in binary form must reproduce the above copyright |
---|
16 | dnl notice, this list of conditions and the following disclaimer in |
---|
17 | dnl the documentation and/or other materials provided with the |
---|
18 | dnl distribution. |
---|
19 | dnl |
---|
20 | dnl 3. The name "Carnegie Mellon University" must not be used to |
---|
21 | dnl endorse or promote products derived from this software without |
---|
22 | dnl prior written permission. For permission or any other legal |
---|
23 | dnl details, please contact |
---|
24 | dnl Office of Technology Transfer |
---|
25 | dnl Carnegie Mellon University |
---|
26 | dnl 5000 Forbes Avenue |
---|
27 | dnl Pittsburgh, PA 15213-3890 |
---|
28 | dnl (412) 268-4387, fax: (412) 268-7395 |
---|
29 | dnl tech-transfer@andrew.cmu.edu |
---|
30 | dnl |
---|
31 | dnl 4. Redistributions of any form whatsoever must retain the following |
---|
32 | dnl acknowledgment: |
---|
33 | dnl \"This product includes software developed by Computing Services |
---|
34 | dnl at Carnegie Mellon University (http://www.cmu.edu/computing/).\" |
---|
35 | dnl |
---|
36 | dnl CARNEGIE MELLON UNIVERSITY DISCLAIMS ALL WARRANTIES WITH REGARD TO |
---|
37 | dnl THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY |
---|
38 | dnl AND FITNESS, IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY BE LIABLE |
---|
39 | dnl FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES |
---|
40 | dnl WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN |
---|
41 | dnl AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING |
---|
42 | dnl OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
---|
43 | dnl |
---|
44 | AC_INIT(lib/saslint.h) |
---|
45 | |
---|
46 | dnl use ./config.cache as the default cache file. |
---|
47 | dnl we require a cache file to successfully configure our build. |
---|
48 | if test $cache_file = "/dev/null"; then |
---|
49 | cache_file="./config.cache" |
---|
50 | AC_CACHE_LOAD |
---|
51 | fi |
---|
52 | |
---|
53 | AC_CONFIG_AUX_DIR(config) |
---|
54 | AM_CONFIG_HEADER(config.h) |
---|
55 | AC_CANONICAL_HOST |
---|
56 | |
---|
57 | dnl |
---|
58 | dnl REMINDER: When changing the version number here, please also update |
---|
59 | dnl the values in win32/include/config.h and include/sasl.h as well. |
---|
60 | dnl |
---|
61 | AM_INIT_AUTOMAKE(cyrus-sasl, 2.1.12) |
---|
62 | CMU_INIT_AUTOMAKE |
---|
63 | |
---|
64 | # and include our config dir scripts |
---|
65 | ACLOCAL="$ACLOCAL -I \$(top_srcdir)/config" |
---|
66 | |
---|
67 | DIRS="" |
---|
68 | |
---|
69 | AC_ARG_ENABLE(cmulocal, [ --enable-cmulocal enable local mods for CMU [no]],,enable_cmulocal=no) |
---|
70 | |
---|
71 | AC_ARG_ENABLE(sample, [ --enable-sample compile sample code [yes]],,enable_sample=yes) |
---|
72 | |
---|
73 | AC_PROG_CC |
---|
74 | AC_PROG_CPP |
---|
75 | AC_PROG_AWK |
---|
76 | AC_PROG_LN_S |
---|
77 | AC_PROG_MAKE_SET |
---|
78 | AC_PROG_RANLIB |
---|
79 | AC_PROG_INSTALL |
---|
80 | CMU_C___ATTRIBUTE__ |
---|
81 | |
---|
82 | dnl check for -R, etc. switch |
---|
83 | CMU_GUESS_RUNPATH_SWITCH |
---|
84 | dnl let's just link against local. otherwise we never find anything useful. |
---|
85 | if test "$ac_cv_prog_gcc" = yes; then |
---|
86 | dnl xxx we should add -W at some point (but that might scare people) |
---|
87 | CFLAGS="-Wall ${CFLAGS}" |
---|
88 | GCC_VERSION=`$CC -v 2>&1 | sed -n -e '/version/s/.*version \([[0-9]]\)\..*/\1/p'` |
---|
89 | if test "$GCC_VERSION" != "3"; then |
---|
90 | CPPFLAGS="${CPPFLAGS} -I/usr/local/include" |
---|
91 | fi |
---|
92 | else |
---|
93 | CPPFLAGS="${CPPFLAGS} -I/usr/local/include" |
---|
94 | fi |
---|
95 | CMU_ADD_LIBPATH("/usr/local/lib") |
---|
96 | |
---|
97 | AM_DISABLE_STATIC |
---|
98 | |
---|
99 | dnl xxx compatibility |
---|
100 | AC_ARG_WITH(staticsasl) |
---|
101 | if test "$with_staticsasl" = yes; then |
---|
102 | enable_shared=yes |
---|
103 | enable_static=yes |
---|
104 | fi |
---|
105 | |
---|
106 | save_target=$target |
---|
107 | if test -z "$target"; then |
---|
108 | target="NONE" |
---|
109 | fi |
---|
110 | |
---|
111 | CMU_PROG_LIBTOOL |
---|
112 | |
---|
113 | target=$save_target |
---|
114 | |
---|
115 | dnl ltconfig might not have found support for shared libs |
---|
116 | dnl just do static libs if so. |
---|
117 | if test "$ac_cv_can_build_shared" = no; then |
---|
118 | enable_shared=no |
---|
119 | enable_static=yes |
---|
120 | fi |
---|
121 | |
---|
122 | if test "$enable_static" = yes; then |
---|
123 | SASL_STATIC_LIBS=libsasl2.a |
---|
124 | else |
---|
125 | SASL_STATIC_LIBS= |
---|
126 | fi |
---|
127 | |
---|
128 | AC_ARG_ENABLE(staticdlopen, [ --enable-staticdlopen try dynamic plugins when we are a static libsasl [no] ], |
---|
129 | enable_staticdlopen=$enableval, |
---|
130 | enable_staticdlopen=no) |
---|
131 | |
---|
132 | if test "$enable_staticdlopen" = yes; then |
---|
133 | AC_DEFINE(TRY_DLOPEN_WHEN_STATIC) |
---|
134 | fi |
---|
135 | |
---|
136 | if test "$ac_cv_prog_gcc" = yes; then |
---|
137 | CFLAGS="-Wall -W ${CFLAGS}" |
---|
138 | fi |
---|
139 | |
---|
140 | AC_ARG_WITH(purecov,[ --with-purecov link with purecov]) |
---|
141 | if test "$with_purecov" = yes; then |
---|
142 | AC_CHECK_PROGS(PURECOV, purecov) |
---|
143 | fi |
---|
144 | AC_ARG_WITH(purify,[ --with-purify link with purify]) |
---|
145 | if test "$with_purify" = yes; then |
---|
146 | AC_CHECK_PROGS(PURIFY, purify) |
---|
147 | fi |
---|
148 | |
---|
149 | AC_ARG_ENABLE(java, [ --enable-java compile Java support [no]], |
---|
150 | enable_java=yes, enable_java=no) |
---|
151 | if test "$enable_java" = yes; then |
---|
152 | AC_PATH_PROG(JAVAC, javac, no) |
---|
153 | AC_PATH_PROGS(JAVAH, javah kaffeh, no) |
---|
154 | AC_CHECK_PROGS(JAVADOC, javadoc, :) |
---|
155 | if test "$JAVAC" = "no" -o "$JAVAH" = "no"; then |
---|
156 | AC_WARN([Disabling Java support]) |
---|
157 | enable_java=no |
---|
158 | fi |
---|
159 | else |
---|
160 | # Make distcheck work |
---|
161 | JAVAC="true" |
---|
162 | JAVAH="true" |
---|
163 | JAVADOC="true" |
---|
164 | fi |
---|
165 | AM_CONDITIONAL(JAVA, test "$enable_java" = yes) |
---|
166 | |
---|
167 | if test "$enable_java" = yes; then |
---|
168 | AC_MSG_CHECKING([JNI cpp flags]) |
---|
169 | AC_CACHE_VAL(sasl_cv_java_includes,[ |
---|
170 | if test `echo $JAVAH | sed 's,.*/,,'` = "kaffeh"; then |
---|
171 | sasl_cv_java_includes=-I`echo $JAVAH | sed -e 's,/bin.*,/include/kaffe,'` |
---|
172 | else |
---|
173 | java_base=`echo $JAVAC | sed 's,/bin.*,'','` |
---|
174 | |
---|
175 | AC_ARG_WITH(javabase, [ --with-javabase=PATH set path to find jni.h in [/usr/java/include] ], |
---|
176 | java_base=$withval,) |
---|
177 | |
---|
178 | |
---|
179 | sasl_cv_java_includes='' |
---|
180 | for dir in `find ${java_base}/include -follow -type d -print | grep -v green_threads`; do |
---|
181 | sasl_cv_java_includes="${sasl_cv_java_includes} -I$dir" |
---|
182 | done |
---|
183 | fi |
---|
184 | |
---|
185 | sasl_cv_java_includes="${sasl_cv_java_includes} -I$javapath/include"]) |
---|
186 | |
---|
187 | JAVA_INCLUDES=$sasl_cv_java_includes |
---|
188 | AC_SUBST(JAVA_INCLUDES) |
---|
189 | AC_MSG_RESULT(ok) |
---|
190 | |
---|
191 | JAVAROOT=".." |
---|
192 | AC_SUBST(JAVAROOT) |
---|
193 | JAVAC=`echo "$JAVAC" | sed 's,.*/,,'` |
---|
194 | JAVAH=`echo "$JAVAH" | sed 's,.*/,,'` |
---|
195 | fi |
---|
196 | |
---|
197 | AM_CONDITIONAL(SAMPLE, test "$enable_sample" = yes) |
---|
198 | |
---|
199 | dnl call before we do the berkeley DB checks |
---|
200 | CMU_SOCKETS |
---|
201 | |
---|
202 | dnl we extracted this to config/sasldb.m4 |
---|
203 | SASL_DB_PATH_CHECK() |
---|
204 | SASL_DB_CHECK() |
---|
205 | |
---|
206 | AC_CHECK_LIB(dl, dlopen, SASL_DL_LIB="-ldl", SASL_DL_LIB="") |
---|
207 | AC_SUBST(SASL_DL_LIB) |
---|
208 | |
---|
209 | dnl Do we need leading underscores on our symbols? |
---|
210 | |
---|
211 | AC_CHECK_PROGS(NM, nm) |
---|
212 | |
---|
213 | AC_MSG_CHECKING(for underscore before symbols) |
---|
214 | AC_CACHE_VAL(sasl_cv_uscore,[ |
---|
215 | echo "main(){int i=1;} |
---|
216 | foo(){int i=6;}" > conftest.c |
---|
217 | ${CC} -o a.out conftest.c > /dev/null |
---|
218 | if (${NM} a.out | grep _foo) > /dev/null; then |
---|
219 | sasl_cv_uscore=yes |
---|
220 | else |
---|
221 | sasl_cv_uscore=no |
---|
222 | fi]) |
---|
223 | AC_MSG_RESULT($sasl_cv_uscore) |
---|
224 | rm -f conftest.c a.out |
---|
225 | |
---|
226 | if test $sasl_cv_uscore = yes; then |
---|
227 | if test $ac_cv_lib_dl_dlopen = yes ; then |
---|
228 | AC_MSG_CHECKING(whether dlsym adds the underscore for us) |
---|
229 | AC_CACHE_VAL(sasl_cv_dlsym_adds_uscore,AC_TRY_RUN( [ |
---|
230 | #include <dlfcn.h> |
---|
231 | #include <stdio.h> |
---|
232 | foo() { int i=0;} |
---|
233 | main() { void *self, *ptr1, *ptr2; self=dlopen(NULL,RTLD_LAZY); |
---|
234 | if(self) { ptr1=dlsym(self,"foo"); ptr2=dlsym(self,"_foo"); |
---|
235 | if(ptr1 && !ptr2) exit(0); } exit(1); } |
---|
236 | ], [sasl_cv_dlsym_adds_uscore=yes], sasl_cv_dlsym_adds_uscore=no |
---|
237 | AC_DEFINE(DLSYM_NEEDS_UNDERSCORE), |
---|
238 | AC_MSG_WARN(cross-compiler, we'll do our best))) |
---|
239 | |
---|
240 | AC_MSG_RESULT($sasl_cv_dlsym_adds_uscore) |
---|
241 | fi |
---|
242 | fi |
---|
243 | |
---|
244 | dnl See if we can provide a default logging function... |
---|
245 | AC_CHECK_FUNCS(syslog) |
---|
246 | |
---|
247 | AC_ARG_WITH(pam, [ --with-pam=DIR use PAM (rooted in DIR) [yes] ], |
---|
248 | with_pam=$withval, |
---|
249 | with_pam=yes) |
---|
250 | if test "$with_pam" != no; then |
---|
251 | if test -d $with_pam; then |
---|
252 | CPPFLAGS="$CPPFLAGS -I${with_pam}/include" |
---|
253 | LDFLAGS="$LDFLAGS -L${with_pam}/lib" |
---|
254 | fi |
---|
255 | cmu_save_LIBS="$LIBS" |
---|
256 | AC_CHECK_LIB(pam, pam_start, [ |
---|
257 | AC_CHECK_HEADER(security/pam_appl.h,, |
---|
258 | with_pam=no)], |
---|
259 | with_pam=no, $SASL_DL_LIB) |
---|
260 | LIBS="$cmu_save_LIBS" |
---|
261 | fi |
---|
262 | |
---|
263 | AC_MSG_CHECKING(for PAM support) |
---|
264 | AC_MSG_RESULT($with_pam) |
---|
265 | LIB_PAM="" |
---|
266 | if test "$with_pam" != no; then |
---|
267 | AC_DEFINE(HAVE_PAM) |
---|
268 | LIB_PAM="-lpam" |
---|
269 | fi |
---|
270 | AC_SUBST(LIB_PAM) |
---|
271 | |
---|
272 | AC_ARG_WITH(saslauthd, [ --with-saslauthd=DIR enable use of the saslauth daemon using state dir DIR ], |
---|
273 | with_saslauthd=$withval, |
---|
274 | with_saslauthd=yes) |
---|
275 | if test "$with_saslauthd" != no; then |
---|
276 | if test "$with_saslauthd" = yes; then |
---|
277 | with_saslauthd="/var/state/saslauthd" |
---|
278 | fi |
---|
279 | AC_DEFINE(HAVE_SASLAUTHD) |
---|
280 | AC_DEFINE_UNQUOTED(PATH_SASLAUTHD_RUNDIR, "$with_saslauthd") |
---|
281 | fi |
---|
282 | AM_CONDITIONAL(SASLAUTHD, test "$with_saslauthd" != no) |
---|
283 | AC_MSG_CHECKING(if I should include saslauthd) |
---|
284 | AC_MSG_RESULT($with_saslauthd) |
---|
285 | |
---|
286 | AC_ARG_WITH(pwcheck, |
---|
287 | [ --with-pwcheck=DIR enable deprecated pwcheck daemon using statedir DIR ], |
---|
288 | with_pwcheck=$withval, |
---|
289 | with_pwcheck=no) |
---|
290 | if test "$with_pwcheck" != no; then |
---|
291 | if test "$with_pwcheck" = yes; then |
---|
292 | with_pwcheck=/var/pwcheck |
---|
293 | fi |
---|
294 | AC_DEFINE(HAVE_PWCHECK) |
---|
295 | AC_DEFINE_UNQUOTED(PWCHECKDIR, "$with_pwcheck") |
---|
296 | AC_CHECK_FUNC(getspnam,PWCHECKMETH="getspnam",PWCHECKMETH="getpwnam") |
---|
297 | AC_SUBST(PWCHECKMETH) |
---|
298 | fi |
---|
299 | AM_CONDITIONAL(PWCHECK, test "$with_pwcheck" != no) |
---|
300 | AC_MSG_CHECKING(if I should include pwcheck) |
---|
301 | AC_MSG_RESULT($with_pwcheck) |
---|
302 | |
---|
303 | AC_ARG_WITH(ipctype, [ --with-ipctype={unix,doors} use ipctype [unix] ], |
---|
304 | with_ipctype=$withval, |
---|
305 | with_ipctype="unix") |
---|
306 | IPCTYPE=$with_ipctype |
---|
307 | AC_SUBST(IPCTYPE) |
---|
308 | if test "$with_ipctype" = "doors"; then |
---|
309 | LIBS="$LIBS -ldoor -lpthread" |
---|
310 | AC_DEFINE(USE_DOORS) |
---|
311 | fi |
---|
312 | |
---|
313 | AC_ARG_ENABLE(alwaystrue, [ --enable-alwaystrue enable the alwaystrue password verifier (discouraged)], |
---|
314 | enable_alwaystrue=$enableval, |
---|
315 | enable_alwaystrue=no) |
---|
316 | if test "$enable_alwaystrue" = yes; then |
---|
317 | AC_DEFINE(HAVE_ALWAYSTRUE) |
---|
318 | fi |
---|
319 | AC_MSG_CHECKING(if I should include the alwaystrue verifier) |
---|
320 | AC_MSG_RESULT($enable_alwaystrue) |
---|
321 | |
---|
322 | dnl sasl_checkapop support |
---|
323 | AC_ARG_ENABLE(checkapop, [ --enable-checkapop enable use of sasl_checkapop [yes] ], |
---|
324 | checkapop=$enableval, |
---|
325 | checkapop=yes) |
---|
326 | |
---|
327 | AC_MSG_CHECKING(if we should enable sasl_checkapop) |
---|
328 | if test "$checkapop" != no; then |
---|
329 | AC_MSG_RESULT(enabled) |
---|
330 | AC_DEFINE(DO_SASL_CHECKAPOP) |
---|
331 | else |
---|
332 | AC_MSG_RESULT(disabled) |
---|
333 | fi |
---|
334 | |
---|
335 | dnl CRAM-MD5 |
---|
336 | AC_ARG_ENABLE(cram, [ --enable-cram enable CRAM-MD5 authentication [yes] ], |
---|
337 | cram=$enableval, |
---|
338 | cram=yes) |
---|
339 | |
---|
340 | AC_MSG_CHECKING(CRAM-MD5) |
---|
341 | if test "$cram" != no; then |
---|
342 | AC_MSG_RESULT(enabled) |
---|
343 | SASL_MECHS="$SASL_MECHS libcrammd5.la" |
---|
344 | if test "$enable_static" = yes; then |
---|
345 | SASL_STATIC_OBJS="$SASL_STATIC_OBJS ../plugins/cram.o" |
---|
346 | AC_DEFINE(STATIC_CRAMMD5) |
---|
347 | fi |
---|
348 | else |
---|
349 | AC_MSG_RESULT(disabled) |
---|
350 | fi |
---|
351 | |
---|
352 | SASL_DES_CHK |
---|
353 | |
---|
354 | dnl DIGEST-MD5 |
---|
355 | AC_ARG_ENABLE(digest, [ --enable-digest enable DIGEST-MD5 authentication [yes] ], |
---|
356 | digest=$enableval, |
---|
357 | digest=yes) |
---|
358 | |
---|
359 | if test "$digest" != no; then |
---|
360 | dnl In order to compile digest, we should look for need libdes. |
---|
361 | if test -d $digest; then |
---|
362 | CPPFLAGS="$CPPFLAGS -I$digest/include" |
---|
363 | LDFLAGS="$LDFLAGS -L$digest/lib" |
---|
364 | fi |
---|
365 | if test "$with_des" = no; then |
---|
366 | AC_WARN(No DES support for DIGEST-MD5) |
---|
367 | fi |
---|
368 | fi |
---|
369 | |
---|
370 | AC_MSG_CHECKING(DIGEST-MD5) |
---|
371 | if test "$digest" != no; then |
---|
372 | AC_MSG_RESULT(enabled) |
---|
373 | SASL_MECHS="$SASL_MECHS libdigestmd5.la" |
---|
374 | if test "$enable_static" = yes; then |
---|
375 | SASL_STATIC_OBJS="$SASL_STATIC_OBJS ../plugins/digestmd5.o" |
---|
376 | AC_DEFINE(STATIC_DIGESTMD5) |
---|
377 | fi |
---|
378 | else |
---|
379 | AC_MSG_RESULT(disabled) |
---|
380 | fi |
---|
381 | |
---|
382 | CMU_HAVE_OPENSSL |
---|
383 | AC_MSG_CHECKING(for OpenSSL) |
---|
384 | AC_MSG_RESULT($with_openssl) |
---|
385 | |
---|
386 | dnl OTP |
---|
387 | AC_ARG_ENABLE(otp, [ --enable-otp enable OTP authentication [yes] ], |
---|
388 | otp=$enableval, |
---|
389 | otp=yes) |
---|
390 | |
---|
391 | if test "$with_openssl" = no; then |
---|
392 | AC_WARN([OpenSSL not found -- OTP will be disabled]) |
---|
393 | otp=no |
---|
394 | fi |
---|
395 | |
---|
396 | AC_MSG_CHECKING(OTP) |
---|
397 | if test "$otp" != no; then |
---|
398 | AC_MSG_RESULT(enabled) |
---|
399 | OTP_LIBS="-lcrypto $LIB_RSAREF" |
---|
400 | |
---|
401 | SASL_MECHS="$SASL_MECHS libotp.la" |
---|
402 | if test "$enable_static" = yes; then |
---|
403 | SASL_STATIC_OBJS="$SASL_STATIC_OBJS ../plugins/otp.o" |
---|
404 | AC_DEFINE(STATIC_OTP) |
---|
405 | fi |
---|
406 | |
---|
407 | dnl Test for OPIE |
---|
408 | AC_ARG_WITH(with-opie,[ --with-opie=PATH use OPIE (One Time Passwords in Everything) from PATH], |
---|
409 | with_opie="${withval}") |
---|
410 | |
---|
411 | case "$with_opie" in |
---|
412 | ""|yes) |
---|
413 | AC_CHECK_LIB(opie, opiechallenge, [ |
---|
414 | AC_CHECK_HEADER(opie.h, with_opie="yes", |
---|
415 | with_opie="no")], |
---|
416 | with_opie="no") |
---|
417 | ;; |
---|
418 | *) |
---|
419 | if test -d $with_opie; then |
---|
420 | CPPFLAGS="${CPPFLAGS} -I${with_opie}/include" |
---|
421 | LDFLAGS="${LDFLAGS} -L${with_opie}/lib" |
---|
422 | else |
---|
423 | with_opie="no" |
---|
424 | fi |
---|
425 | ;; |
---|
426 | esac |
---|
427 | |
---|
428 | AC_MSG_CHECKING(for OPIE) |
---|
429 | AC_MSG_RESULT($with_opie) |
---|
430 | |
---|
431 | if test "$with_opie" != no; then |
---|
432 | AC_DEFINE(HAVE_OPIE) |
---|
433 | OTP_LIBS="$OTP_LIBS -lopie" |
---|
434 | else |
---|
435 | OTP_LIBS="$OTP_LIBS ../sasldb/libsasldb.la \$(SASL_DB_LIB)" |
---|
436 | fi |
---|
437 | |
---|
438 | AC_SUBST(OTP_LIBS) |
---|
439 | |
---|
440 | else |
---|
441 | AC_MSG_RESULT(disabled) |
---|
442 | fi |
---|
443 | |
---|
444 | dnl SRP |
---|
445 | AC_ARG_ENABLE(srp, [ --enable-srp enable SRP authentication [no] ], |
---|
446 | srp=$enableval, |
---|
447 | srp=no) |
---|
448 | |
---|
449 | if test "$with_openssl" = no; then |
---|
450 | AC_WARN([OpenSSL not found -- SRP will be disabled]) |
---|
451 | srp=no |
---|
452 | fi |
---|
453 | |
---|
454 | AC_MSG_CHECKING(SRP) |
---|
455 | if test "$srp" != no; then |
---|
456 | AC_MSG_RESULT(enabled) |
---|
457 | SRP_LIBS="-lcrypto $LIB_RSAREF" |
---|
458 | |
---|
459 | SASL_MECHS="$SASL_MECHS libsrp.la" |
---|
460 | if test "$enable_static" = yes; then |
---|
461 | SASL_STATIC_OBJS="$SASL_STATIC_OBJS ../plugins/srp.o" |
---|
462 | AC_DEFINE(STATIC_SRP) |
---|
463 | fi |
---|
464 | |
---|
465 | dnl srp_setpass support |
---|
466 | AC_ARG_ENABLE(srp_setpass, [ --enable-srp-setpass enable setting SRP secrets with saslpasswd [no]], |
---|
467 | srp_setpass=$enableval, |
---|
468 | srp_setpass=no) |
---|
469 | |
---|
470 | AC_MSG_CHECKING(if we should enable setting SRP secrets with saslpasswd) |
---|
471 | if test "$srp_setpass" != no; then |
---|
472 | AC_MSG_RESULT(enabled) |
---|
473 | AC_DEFINE(DO_SRP_SETPASS) |
---|
474 | SRP_LIBS="$SRP_LIBS ../sasldb/libsasldb.la \$(SASL_DB_LIB)" |
---|
475 | else |
---|
476 | AC_MSG_RESULT(disabled) |
---|
477 | fi |
---|
478 | |
---|
479 | AC_SUBST(SRP_LIBS) |
---|
480 | else |
---|
481 | AC_MSG_RESULT(disabled) |
---|
482 | fi |
---|
483 | |
---|
484 | SASL_KERBEROS_V4_CHK |
---|
485 | SASL_GSSAPI_CHK |
---|
486 | SASL_PLAIN_CHK |
---|
487 | |
---|
488 | if test "$gssapi" != "no"; then |
---|
489 | AC_DEFINE(STATIC_GSSAPIV2) |
---|
490 | fi |
---|
491 | |
---|
492 | dnl ANONYMOUS |
---|
493 | AC_ARG_ENABLE(anon, [ --enable-anon enable ANONYMOUS authentication [yes] ], |
---|
494 | anon=$enableval, |
---|
495 | anon=yes) |
---|
496 | |
---|
497 | AC_MSG_CHECKING(ANONYMOUS) |
---|
498 | if test "$anon" != no; then |
---|
499 | AC_MSG_RESULT(enabled) |
---|
500 | SASL_MECHS="$SASL_MECHS libanonymous.la" |
---|
501 | if test "$enable_static" = yes; then |
---|
502 | SASL_STATIC_OBJS="$SASL_STATIC_OBJS ../plugins/anonymous.o" |
---|
503 | AC_DEFINE(STATIC_ANONYMOUS) |
---|
504 | fi |
---|
505 | else |
---|
506 | AC_MSG_RESULT(disabled) |
---|
507 | fi |
---|
508 | |
---|
509 | dnl LOGIN |
---|
510 | AC_ARG_ENABLE(login, [ --enable-login enable unsupported LOGIN authentication [no] ], |
---|
511 | login=$enableval, |
---|
512 | login=no) |
---|
513 | |
---|
514 | AC_MSG_CHECKING(LOGIN) |
---|
515 | if test "$login" != no; then |
---|
516 | AC_MSG_RESULT(enabled) |
---|
517 | SASL_MECHS="$SASL_MECHS liblogin.la" |
---|
518 | if test "$enable_static" = yes; then |
---|
519 | SASL_STATIC_OBJS="$SASL_STATIC_OBJS ../plugins/login.o" |
---|
520 | AC_DEFINE(STATIC_LOGIN) |
---|
521 | fi |
---|
522 | else |
---|
523 | AC_MSG_RESULT(disabled) |
---|
524 | fi |
---|
525 | |
---|
526 | dnl NTLM |
---|
527 | AC_ARG_ENABLE(ntlm, [ --enable-ntlm enable unsupported NTLM authentication [no] ], |
---|
528 | ntlm=$enableval, |
---|
529 | ntlm=no) |
---|
530 | |
---|
531 | if test "$with_openssl" = no; then |
---|
532 | AC_WARN([OpenSSL not found -- NTLM will be disabled]) |
---|
533 | ntlm=no |
---|
534 | fi |
---|
535 | |
---|
536 | AC_MSG_CHECKING(NTLM) |
---|
537 | if test "$ntlm" != no; then |
---|
538 | AC_MSG_RESULT(enabled) |
---|
539 | NTLM_LIBS="-lcrypto $LIB_RSAREF" |
---|
540 | AC_SUBST(NTLM_LIBS) |
---|
541 | |
---|
542 | SASL_MECHS="$SASL_MECHS libntlm.la" |
---|
543 | if test "$enable_static" = yes; then |
---|
544 | SASL_STATIC_OBJS="$SASL_STATIC_OBJS ../plugins/ntlm.o" |
---|
545 | AC_DEFINE(STATIC_NTLM) |
---|
546 | fi |
---|
547 | else |
---|
548 | AC_MSG_RESULT(disabled) |
---|
549 | fi |
---|
550 | |
---|
551 | |
---|
552 | # make the option show up so people don't whine that it is only in the |
---|
553 | # saslauthd configure script --help |
---|
554 | AC_ARG_WITH(ldap, [ --with-ldap=DIR use LDAP (in DIR) for saslauthd (experimental) [no] ],,) |
---|
555 | |
---|
556 | |
---|
557 | ############################################################################ |
---|
558 | # Simon Loader tries to do auto conf |
---|
559 | dnl MySQL |
---|
560 | AC_ARG_WITH(mysql, [ --with-mysql=PATH enable authentication against a MySQL db (experimental) [no] ], |
---|
561 | with_mysql=$withval, |
---|
562 | with_mysql=no) |
---|
563 | |
---|
564 | # find location of library |
---|
565 | # presuing if one given then correct |
---|
566 | if test "${with_mysql}" = "yes"; then |
---|
567 | for mysqlloc in lib/mysql lib mysql/lib |
---|
568 | do |
---|
569 | if test -f ${prefix}/${mysqlloc}/libmysqlclient.a; then |
---|
570 | with_mysql="${prefix}" |
---|
571 | break |
---|
572 | elif test -f /usr/local/${mysqlloc}/libmysqlclient.a; then |
---|
573 | with_mysql="/usr/local" |
---|
574 | break |
---|
575 | elif test -f /usr/${mysqlloc}/libmysqlclient.a; then |
---|
576 | with_mysql="/usr" |
---|
577 | break |
---|
578 | fi |
---|
579 | done |
---|
580 | fi |
---|
581 | |
---|
582 | LIB_MYSQL="" |
---|
583 | |
---|
584 | case "$with_mysql" in |
---|
585 | no) true;; |
---|
586 | *) |
---|
587 | if test -d ${with_mysql}/lib/mysql; then |
---|
588 | LIB_MYSQL="-L${with_mysql}/lib/mysql" |
---|
589 | elif test -d ${with_mysql}/mysql/lib; then |
---|
590 | LIB_MYSQL="-L${with_mysql}/mysql/lib" |
---|
591 | elif test -d ${with_mysql}/lib; then |
---|
592 | LIB_MYSQL="-L${with_mysql}/lib" |
---|
593 | else |
---|
594 | LIB_MYSQL="-L${with_mysql}" |
---|
595 | fi |
---|
596 | |
---|
597 | LIB_MYSQL_DIR=$LIB_MYSQL |
---|
598 | LIB_MYSQL="$LIB_MYSQL -lmysqlclient" |
---|
599 | |
---|
600 | if test -d ${with_mysql}/include/mysql; then |
---|
601 | CPPFLAGS="${CPPFLAGS} -I${with_mysql}/include/mysql" |
---|
602 | elif test -d ${with_mysql}/mysql/include; then |
---|
603 | CPPFLAGS="${CPPFLAGS} -I${with_mysql}/mysql/include" |
---|
604 | elif test -d ${with_mysql}/include; then |
---|
605 | CPPFLAGS="${CPPFLAGS} -I${with_mysql}/include" |
---|
606 | else |
---|
607 | CPPFLAGS="${CPPFLAGS} -I${with_mysql}" |
---|
608 | fi |
---|
609 | AC_CHECK_LIB(mysqlclient, mysql_select_db,[ |
---|
610 | SASL_MECHS="$SASL_MECHS libmysql.la" |
---|
611 | if test "$enable_static" = yes; then |
---|
612 | SASL_STATIC_OBJS="$SASL_STATIC_OBJS ../plugins/mysql.o" |
---|
613 | AC_DEFINE(STATIC_MYSQL) |
---|
614 | fi |
---|
615 | ], |
---|
616 | [AC_ERROR([MYSQL libarary mysqlclient not found])], $LIB_MYSQL_DIR);; |
---|
617 | |
---|
618 | esac |
---|
619 | AC_SUBST(LIB_MYSQL) |
---|
620 | |
---|
621 | # simon finishes trying to do autoconf |
---|
622 | ############################################################################### |
---|
623 | |
---|
624 | if test "$ac_cv_can_build_shared" = yes; then |
---|
625 | AC_DEFINE(DO_DLOPEN) |
---|
626 | fi |
---|
627 | |
---|
628 | AC_SUBST(SASL_MECHS) |
---|
629 | AC_SUBST(SASL_STATIC_OBJS) |
---|
630 | AC_SUBST(SASL_STATIC_LIBS) |
---|
631 | |
---|
632 | AC_ARG_WITH(plugindir, [ --with-plugindir=DIR set the directory where plugins will |
---|
633 | be found [/usr/lib/sasl2] ], |
---|
634 | plugindir=$withval, |
---|
635 | plugindir=/usr/lib/sasl2) |
---|
636 | AC_DEFINE_UNQUOTED(PLUGINDIR, "$plugindir") |
---|
637 | AC_SUBST(plugindir) |
---|
638 | |
---|
639 | dnl look for rc4 libraries. we accept the CMU one or one from openSSL |
---|
640 | AC_ARG_WITH(rc4, [ --with-rc4 use internal rc4 routines [yes] ], |
---|
641 | with_rc4=$withval, |
---|
642 | with_rc4=yes) |
---|
643 | |
---|
644 | if test "$with_rc4" != no; then |
---|
645 | AC_DEFINE(WITH_RC4) |
---|
646 | fi |
---|
647 | |
---|
648 | building_for_macosx=no |
---|
649 | case "$host_os" in |
---|
650 | darwin*) |
---|
651 | building_for_macosx=yes |
---|
652 | ;; |
---|
653 | esac |
---|
654 | AM_CONDITIONAL(MACOSX, test "$building_for_macosx" = yes) |
---|
655 | |
---|
656 | dnl dmalloc tests |
---|
657 | AC_MSG_CHECKING(for dmalloc library) |
---|
658 | AC_ARG_WITH(dmalloc, [ --with-dmalloc=DIR with DMALLOC support (for test applications) [no] ], |
---|
659 | with_dmalloc=$withval, |
---|
660 | with_dmalloc=no) |
---|
661 | |
---|
662 | DMALLOC_LIBS="" |
---|
663 | |
---|
664 | if test "$with_dmalloc" != "no"; then |
---|
665 | if test "$with_dmalloc" = "yes"; then |
---|
666 | with_dmalloc="/usr/local" |
---|
667 | fi |
---|
668 | |
---|
669 | if test -r "$with_dmalloc/libdmalloc.a"; then |
---|
670 | DMALLOC_LIBS="$with_dmalloc/libdmalloc.a" |
---|
671 | AC_DEFINE(WITH_DMALLOC) |
---|
672 | AC_MSG_RESULT(yes) |
---|
673 | elif test -r "$with_dmalloc/lib/libdmalloc.a"; then |
---|
674 | DMALLOC_LIBS="$with_dmalloc/lib/libdmalloc.a" |
---|
675 | AC_DEFINE(WITH_DMALLOC) |
---|
676 | AC_MSG_RESULT(yes) |
---|
677 | else |
---|
678 | AC_MSG_ERROR(cannot find dmalloc library, please check your installation.) |
---|
679 | fi |
---|
680 | else |
---|
681 | AC_MSG_RESULT(no) |
---|
682 | fi |
---|
683 | |
---|
684 | AC_SUBST(DMALLOC_LIBS) |
---|
685 | |
---|
686 | dnl sfio tests |
---|
687 | AC_MSG_CHECKING(for sfio library) |
---|
688 | AC_ARG_WITH(sfio, [ --with-sfio=DIR with SFIO support (for smtptest/libsfsasl) [no] ], |
---|
689 | with_sfio=$withval, |
---|
690 | with_sfio=no) |
---|
691 | |
---|
692 | if test "$with_sfio" != "no"; then |
---|
693 | if test "$with_sfio" = "yes"; then |
---|
694 | with_sfio="/usr/local" |
---|
695 | fi |
---|
696 | |
---|
697 | AC_DEFUN(SFIO_INC_CHK, |
---|
698 | [if test -r "$with_sfio$1/sfio.h"; then SFIO_DIR=$with_sfio; |
---|
699 | SFIO_INC_DIR=$with_sfio$1]) |
---|
700 | |
---|
701 | AC_DEFUN(SFIO_LIB_CHK,[ |
---|
702 | str="$SFIO_DIR/$1/libsfio.*" |
---|
703 | for i in `echo $str`; do |
---|
704 | if test -r $i; then |
---|
705 | SFIO_LIBDIR=$SFIO_DIR/$1 |
---|
706 | break 2 |
---|
707 | fi |
---|
708 | done |
---|
709 | ]) |
---|
710 | |
---|
711 | SFIO_INC_CHK() |
---|
712 | el[]SFIO_INC_CHK(/include) |
---|
713 | el[]SFIO_INC_CHK(/include/sfio) |
---|
714 | fi |
---|
715 | |
---|
716 | if test -z "$SFIO_DIR"; then |
---|
717 | AC_MSG_ERROR(Cannot find sfio.h, Please check your SFIO installation.) |
---|
718 | fi |
---|
719 | |
---|
720 | SFIO_LIB_CHK(lib) |
---|
721 | SFIO_LIB_CHK(lib/sfio) |
---|
722 | |
---|
723 | if test -z "$SFIO_LIBDIR"; then |
---|
724 | AC_MSG_ERROR(Cannot find sfio library, Please check your SFIO installation.) |
---|
725 | fi |
---|
726 | |
---|
727 | SFIO_INC_FLAGS="-I$SFIO_INC_DIR" |
---|
728 | SFIO_LIB_FLAGS="-L$SFIO_LIBDIR -lsfio" |
---|
729 | SMTPTEST_PROGRAM="smtptest" |
---|
730 | SASL_UTIL_LIBS_EXTRA=libsfsasl2.la |
---|
731 | SASL_UTIL_HEADERS_EXTRA=sfsasl.h |
---|
732 | |
---|
733 | AC_MSG_RESULT(yes) |
---|
734 | else |
---|
735 | AC_MSG_RESULT(no) |
---|
736 | SFIO_INC_FLAGS="" |
---|
737 | SFIO_LIB_FLAGS="" |
---|
738 | SMTPTEST_PROGRAM="" |
---|
739 | SASL_UTIL_LIBS_EXTRA="" |
---|
740 | SASL_UTIL_HEADERS_EXTRA="" |
---|
741 | fi |
---|
742 | |
---|
743 | AC_SUBST(SFIO_INC_FLAGS) |
---|
744 | AC_SUBST(SFIO_LIB_FLAGS) |
---|
745 | AC_SUBST(SMTPTEST_PROGRAM) |
---|
746 | AC_SUBST(SASL_UTIL_LIBS_EXTRA) |
---|
747 | AC_SUBST(SASL_UTIL_HEADERS_EXTRA) |
---|
748 | |
---|
749 | dnl Backwards compatibility with autoconf 2.13 |
---|
750 | ifdef([m4_pattern_allow],[m4_pattern_allow([^LIBOBJS$])]) |
---|
751 | |
---|
752 | dnl check for getsubopt |
---|
753 | sasl_cv_getsubopt=no |
---|
754 | AC_CHECK_FUNC(getsubopt, [AC_DEFINE(HAVE_GETSUBOPT)], [sasl_cv_getsubopt=yes]) |
---|
755 | if test $sasl_cv_getsubopt = yes; then |
---|
756 | LIBOBJS="$LIBOBJS getsubopt.o" |
---|
757 | GETSUBOPT="getsubopt.lo" |
---|
758 | fi |
---|
759 | AC_SUBST(GETSUBOPT) |
---|
760 | |
---|
761 | dnl Check for snprintf |
---|
762 | sasl_cv_snprintf=no |
---|
763 | SNPRINTFOBJS="" |
---|
764 | AC_CHECK_FUNC(snprintf, [AC_DEFINE(HAVE_SNPRINTF)], [sasl_cv_snprintf=yes]) |
---|
765 | AC_CHECK_FUNC(vsnprintf, [AC_DEFINE(HAVE_VSNPRINTF)], [sasl_cv_snprintf=yes]) |
---|
766 | if test $sasl_cv_snprintf = yes; then |
---|
767 | LIBOBJS="$LIBOBJS snprintf.o" |
---|
768 | SNPRINTFOBJS="snprintf.o" |
---|
769 | LTSNPRINTFOBJS="snprintf.lo" |
---|
770 | fi |
---|
771 | AC_SUBST(SNPRINTFOBJS) |
---|
772 | AC_SUBST(LTSNPRINTFOBJS) |
---|
773 | |
---|
774 | dnl do we need to link in -lresolv? |
---|
775 | AC_CHECK_LIB(resolv, inet_aton) |
---|
776 | |
---|
777 | dnl Check for getaddrinfo |
---|
778 | GETADDRINFOOBJS="" |
---|
779 | sasl_cv_getaddrinfo=yes |
---|
780 | IPv6_CHECK_FUNC(getaddrinfo, [IPv6_CHECK_FUNC(gai_strerror, |
---|
781 | [AC_DEFINE(HAVE_GETADDRINFO) |
---|
782 | sasl_cv_getaddrinfo=no])]) |
---|
783 | if test $sasl_cv_getaddrinfo = yes; then |
---|
784 | LIBOBJS="$LIBOBJS getaddrinfo.o" |
---|
785 | GETADDRINFOOBJS="getaddrinfo.o" |
---|
786 | LTGETADDRINFOOBJS="getaddrinfo.lo" |
---|
787 | fi |
---|
788 | AC_SUBST(GETADDRINFOOBJS) |
---|
789 | AC_SUBST(LTGETADDRINFOOBJS) |
---|
790 | |
---|
791 | dnl Check for getnameinfo |
---|
792 | GETNAMEINFOOBJS="" |
---|
793 | sasl_cv_getnameinfo=no |
---|
794 | IPv6_CHECK_FUNC(getnameinfo, |
---|
795 | [AC_DEFINE(HAVE_GETNAMEINFO)], [sasl_cv_getnameinfo=yes]) |
---|
796 | if test $sasl_cv_getnameinfo = yes; then |
---|
797 | LIBOBJS="$LIBOBJS getnameinfo.o" |
---|
798 | GETNAMEINFOOBJS="getnameinfo.o" |
---|
799 | LTGETNAMEINFOOBJS="getnameinfo.lo" |
---|
800 | fi |
---|
801 | AC_SUBST(GETNAMEINFOOBJS) |
---|
802 | AC_SUBST(LTGETNAMEINFOOBJS) |
---|
803 | |
---|
804 | LTLIBOBJS=`echo "$LIBOBJS" | sed 's/\.o/.lo/g'` |
---|
805 | AC_SUBST(LIBOBJS) |
---|
806 | AC_SUBST(LTLIBOBJS) |
---|
807 | |
---|
808 | AC_C_CONST |
---|
809 | AC_C_INLINE |
---|
810 | AC_TYPE_MODE_T |
---|
811 | AC_TYPE_PID_T |
---|
812 | AC_TYPE_SIGNAL |
---|
813 | |
---|
814 | AC_HEADER_TIME |
---|
815 | AC_HEADER_STDC |
---|
816 | AC_HEADER_DIRENT |
---|
817 | AC_HEADER_SYS_WAIT |
---|
818 | AC_CHECK_HEADERS(dlfcn.h fcntl.h limits.h malloc.h paths.h strings.h sys/file.h sys/time.h syslog.h unistd.h inttypes.h sys/uio.h sys/param.h sysexits.h stdarg.h varargs.h) |
---|
819 | |
---|
820 | IPv6_CHECK_SS_FAMILY() |
---|
821 | IPv6_CHECK_SA_LEN() |
---|
822 | IPv6_CHECK_SOCKLEN_T() |
---|
823 | |
---|
824 | #AC_FUNC_MEMCMP |
---|
825 | #AC_FUNC_VPRINTF |
---|
826 | AC_CHECK_FUNCS(gethostname getdomainname getpwnam getspnam gettimeofday inet_aton memcpy mkdir select socket strchr strdup strerror strspn strstr strtol jrand48) |
---|
827 | |
---|
828 | if test $enable_cmulocal = yes; then |
---|
829 | AC_WARN([enabling CMU local kludges]) |
---|
830 | AC_DEFINE(KRB4_IGNORE_IP_ADDRESS) |
---|
831 | AC_DEFINE_UNQUOTED(PREFER_MECH, "KERBEROS_V4") |
---|
832 | fi |
---|
833 | |
---|
834 | AC_EGREP_HEADER(sockaddr_storage, sys/socket.h, [ |
---|
835 | AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)]) |
---|
836 | |
---|
837 | AC_SUBST(DIRS) |
---|
838 | |
---|
839 | AC_CONFIG_SUBDIRS(saslauthd) |
---|
840 | |
---|
841 | AC_OUTPUT(Makefile |
---|
842 | include/Makefile |
---|
843 | sasldb/Makefile |
---|
844 | plugins/Makefile |
---|
845 | lib/Makefile |
---|
846 | utils/Makefile |
---|
847 | doc/Makefile |
---|
848 | sample/Makefile |
---|
849 | java/Makefile |
---|
850 | java/CyrusSasl/Makefile |
---|
851 | java/Test/Makefile |
---|
852 | java/javax/Makefile |
---|
853 | java/javax/security/Makefile |
---|
854 | java/javax/security/auth/Makefile |
---|
855 | java/javax/security/auth/callback/Makefile |
---|
856 | pwcheck/Makefile |
---|
857 | man/Makefile) |
---|
858 | |
---|
859 | echo Configuration Complete. Type \'make\' to build. |
---|