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.1 2002-10-13 18:02:19 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.8) |
---|
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=`gcc -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 we extracted this to config/sasldb.m4 |
---|
200 | SASL_DB_PATH_CHECK() |
---|
201 | SASL_DB_CHECK() |
---|
202 | |
---|
203 | AC_CHECK_LIB(dl, dlopen, SASL_DL_LIB="-ldl", SASL_DL_LIB="") |
---|
204 | AC_SUBST(SASL_DL_LIB) |
---|
205 | |
---|
206 | dnl Do we need leading underscores on our symbols? |
---|
207 | |
---|
208 | AC_CHECK_PROGS(NM, nm) |
---|
209 | |
---|
210 | AC_MSG_CHECKING(for underscore before symbols) |
---|
211 | AC_CACHE_VAL(sasl_cv_uscore,[ |
---|
212 | echo "main(){int i=1;} |
---|
213 | foo(){int i=6;}" > conftest.c |
---|
214 | ${CC} -o a.out conftest.c > /dev/null |
---|
215 | if (${NM} a.out | grep _foo) > /dev/null; then |
---|
216 | sasl_cv_uscore=yes |
---|
217 | else |
---|
218 | sasl_cv_uscore=no |
---|
219 | fi]) |
---|
220 | AC_MSG_RESULT($sasl_cv_uscore) |
---|
221 | rm -f conftest.c a.out |
---|
222 | |
---|
223 | if test $sasl_cv_uscore = yes; then |
---|
224 | if test $ac_cv_lib_dl_dlopen = yes ; then |
---|
225 | AC_MSG_CHECKING(whether dlsym adds the underscore for us) |
---|
226 | AC_CACHE_VAL(sasl_cv_dlsym_adds_uscore,AC_TRY_RUN( [ |
---|
227 | #include <dlfcn.h> |
---|
228 | #include <stdio.h> |
---|
229 | foo() { int i=0;} |
---|
230 | main() { void *self, *ptr1, *ptr2; self=dlopen(NULL,RTLD_LAZY); |
---|
231 | if(self) { ptr1=dlsym(self,"foo"); ptr2=dlsym(self,"_foo"); |
---|
232 | if(ptr1 && !ptr2) exit(0); } exit(1); } |
---|
233 | ], [sasl_cv_dlsym_adds_uscore=yes], sasl_cv_dlsym_adds_uscore=no |
---|
234 | AC_DEFINE(DLSYM_NEEDS_UNDERSCORE), |
---|
235 | AC_MSG_WARN(cross-compiler, we'll do our best))) |
---|
236 | |
---|
237 | AC_MSG_RESULT($sasl_cv_dlsym_adds_uscore) |
---|
238 | fi |
---|
239 | fi |
---|
240 | |
---|
241 | dnl See if we can provide a default logging function... |
---|
242 | AC_CHECK_FUNCS(syslog) |
---|
243 | |
---|
244 | CMU_SOCKETS |
---|
245 | |
---|
246 | AC_ARG_WITH(pam, [ --with-pam=DIR use PAM (rooted in DIR) [yes] ], |
---|
247 | with_pam=$withval, |
---|
248 | with_pam=yes) |
---|
249 | if test "$with_pam" != no; then |
---|
250 | if test -d $with_pam; then |
---|
251 | CPPFLAGS="$CPPFLAGS -I${with_pam}/include" |
---|
252 | LDFLAGS="$LDFLAGS -L${with_pam}/lib" |
---|
253 | fi |
---|
254 | cmu_save_LIBS="$LIBS" |
---|
255 | AC_CHECK_LIB(pam, pam_start, [ |
---|
256 | AC_CHECK_HEADER(security/pam_appl.h,, |
---|
257 | with_pam=no)], |
---|
258 | with_pam=no, $SASL_DL_LIB) |
---|
259 | LIBS="$cmu_save_LIBS" |
---|
260 | fi |
---|
261 | |
---|
262 | AC_MSG_CHECKING(for PAM support) |
---|
263 | AC_MSG_RESULT($with_pam) |
---|
264 | LIB_PAM="" |
---|
265 | if test "$with_pam" != no; then |
---|
266 | AC_DEFINE(HAVE_PAM) |
---|
267 | LIB_PAM="-lpam" |
---|
268 | fi |
---|
269 | AC_SUBST(LIB_PAM) |
---|
270 | |
---|
271 | AC_ARG_WITH(saslauthd, [ --with-saslauthd=DIR enable use of the saslauth daemon using state dir DIR ], |
---|
272 | with_saslauthd=$withval, |
---|
273 | with_saslauthd=yes) |
---|
274 | if test "$with_saslauthd" != no; then |
---|
275 | if test "$with_saslauthd" = yes; then |
---|
276 | with_saslauthd="/var/state/saslauthd" |
---|
277 | fi |
---|
278 | AC_DEFINE(HAVE_SASLAUTHD) |
---|
279 | AC_DEFINE_UNQUOTED(PATH_SASLAUTHD_RUNDIR, "$with_saslauthd") |
---|
280 | fi |
---|
281 | AM_CONDITIONAL(SASLAUTHD, test "$with_saslauthd" != no) |
---|
282 | AC_MSG_CHECKING(if I should include saslauthd) |
---|
283 | AC_MSG_RESULT($with_saslauthd) |
---|
284 | |
---|
285 | AC_ARG_WITH(pwcheck, |
---|
286 | [ --with-pwcheck=DIR enable deprecated pwcheck daemon using statedir DIR ], |
---|
287 | with_pwcheck=$withval, |
---|
288 | with_pwcheck=no) |
---|
289 | if test "$with_pwcheck" != no; then |
---|
290 | if test "$with_pwcheck" = yes; then |
---|
291 | with_pwcheck=/var/pwcheck |
---|
292 | fi |
---|
293 | AC_DEFINE(HAVE_PWCHECK) |
---|
294 | AC_DEFINE_UNQUOTED(PWCHECKDIR, "$with_pwcheck") |
---|
295 | AC_CHECK_FUNC(getspnam,PWCHECKMETH="getspnam",PWCHECKMETH="getpwnam") |
---|
296 | AC_SUBST(PWCHECKMETH) |
---|
297 | fi |
---|
298 | AM_CONDITIONAL(PWCHECK, test "$with_pwcheck" != no) |
---|
299 | AC_MSG_CHECKING(if I should include pwcheck) |
---|
300 | AC_MSG_RESULT($with_pwcheck) |
---|
301 | |
---|
302 | AC_ARG_WITH(ipctype, [ --with-ipctype={unix,doors} use ipctype [unix] ], |
---|
303 | with_ipctype=$withval, |
---|
304 | with_ipctype="unix") |
---|
305 | IPCTYPE=$with_ipctype |
---|
306 | AC_SUBST(IPCTYPE) |
---|
307 | if test "$with_ipctype" = "doors"; then |
---|
308 | LIBS="$LIBS -ldoor -lpthread" |
---|
309 | AC_DEFINE(USE_DOORS) |
---|
310 | fi |
---|
311 | |
---|
312 | AC_ARG_ENABLE(alwaystrue, [ --enable-alwaystrue enable the alwaystrue password verifier (discouraged)], |
---|
313 | enable_alwaystrue=$enableval, |
---|
314 | enable_alwaystrue=no) |
---|
315 | if test "$enable_alwaystrue" = yes; then |
---|
316 | AC_DEFINE(HAVE_ALWAYSTRUE) |
---|
317 | fi |
---|
318 | AC_MSG_CHECKING(if I should include the alwaystrue verifier) |
---|
319 | AC_MSG_RESULT($enable_alwaystrue) |
---|
320 | |
---|
321 | dnl sasl_checkapop support |
---|
322 | AC_ARG_ENABLE(checkapop, [ --enable-checkapop enable use of sasl_checkapop [yes] ], |
---|
323 | checkapop=$enableval, |
---|
324 | checkapop=yes) |
---|
325 | |
---|
326 | AC_MSG_CHECKING(if we should enable sasl_checkapop) |
---|
327 | if test "$checkapop" != no; then |
---|
328 | AC_MSG_RESULT(enabled) |
---|
329 | AC_DEFINE(DO_SASL_CHECKAPOP) |
---|
330 | else |
---|
331 | AC_MSG_RESULT(disabled) |
---|
332 | fi |
---|
333 | |
---|
334 | dnl CRAM-MD5 |
---|
335 | AC_ARG_ENABLE(cram, [ --enable-cram enable CRAM-MD5 authentication [yes] ], |
---|
336 | cram=$enableval, |
---|
337 | cram=yes) |
---|
338 | |
---|
339 | AC_MSG_CHECKING(CRAM-MD5) |
---|
340 | if test "$cram" != no; then |
---|
341 | AC_MSG_RESULT(enabled) |
---|
342 | SASL_MECHS="$SASL_MECHS libcrammd5.la" |
---|
343 | if test "$enable_static" = yes; then |
---|
344 | SASL_STATIC_OBJS="$SASL_STATIC_OBJS ../plugins/cram.o" |
---|
345 | AC_DEFINE(STATIC_CRAMMD5) |
---|
346 | fi |
---|
347 | else |
---|
348 | AC_MSG_RESULT(disabled) |
---|
349 | fi |
---|
350 | |
---|
351 | SASL_DES_CHK |
---|
352 | |
---|
353 | dnl DIGEST-MD5 |
---|
354 | AC_ARG_ENABLE(digest, [ --enable-digest enable DIGEST-MD5 authentication [yes] ], |
---|
355 | digest=$enableval, |
---|
356 | digest=yes) |
---|
357 | |
---|
358 | if test "$digest" != no; then |
---|
359 | dnl In order to compile digest, we should look for need libdes. |
---|
360 | if test -d $digest; then |
---|
361 | CPPFLAGS="$CPPFLAGS -I$digest/include" |
---|
362 | LDFLAGS="$LDFLAGS -L$digest/lib" |
---|
363 | fi |
---|
364 | if test "$with_des" = no; then |
---|
365 | AC_WARN(No DES support for DIGEST-MD5) |
---|
366 | fi |
---|
367 | fi |
---|
368 | |
---|
369 | AC_MSG_CHECKING(DIGEST-MD5) |
---|
370 | if test "$digest" != no; then |
---|
371 | AC_MSG_RESULT(enabled) |
---|
372 | SASL_MECHS="$SASL_MECHS libdigestmd5.la" |
---|
373 | if test "$enable_static" = yes; then |
---|
374 | SASL_STATIC_OBJS="$SASL_STATIC_OBJS ../plugins/digestmd5.o" |
---|
375 | AC_DEFINE(STATIC_DIGESTMD5) |
---|
376 | fi |
---|
377 | else |
---|
378 | AC_MSG_RESULT(disabled) |
---|
379 | fi |
---|
380 | |
---|
381 | dnl Test for OpenSSL (required for OTP, SRP and NTLM) |
---|
382 | AC_ARG_WITH(with-openssl,[ --with-openssl=PATH use OpenSSL from PATH], |
---|
383 | with_openssl="${withval}") |
---|
384 | |
---|
385 | case "$with_openssl" in |
---|
386 | no) with_openssl="no";; |
---|
387 | ""|yes) |
---|
388 | dnl if openssl has been compiled with the rsaref2 libraries, |
---|
389 | dnl we need to include the rsaref libraries in the crypto check |
---|
390 | LIB_RSAREF="" |
---|
391 | AC_CHECK_LIB(rsaref, RSAPublicEncrypt, |
---|
392 | LIB_RSAREF="-lRSAglue -lrsaref"; cmu_have_rsaref=yes, |
---|
393 | cmu_have_rsaref=no) |
---|
394 | |
---|
395 | AC_CHECK_HEADER(openssl/evp.h, [ |
---|
396 | AC_CHECK_LIB(crypto, EVP_DigestInit, |
---|
397 | with_openssl="yes", |
---|
398 | with_openssl="no", $LIB_RSAREF)], |
---|
399 | with_openssl=no) |
---|
400 | ;; |
---|
401 | *) |
---|
402 | if test -d $with_openssl; then |
---|
403 | CPPFLAGS="${CPPFLAGS} -I${with_openssl}/include" |
---|
404 | LDFLAGS="${LDFLAGS} -L${with_openssl}/lib" |
---|
405 | else |
---|
406 | with_openssl="no" |
---|
407 | fi |
---|
408 | ;; |
---|
409 | esac |
---|
410 | |
---|
411 | AC_MSG_CHECKING(for OpenSSL) |
---|
412 | AC_MSG_RESULT($with_openssl) |
---|
413 | |
---|
414 | dnl OTP |
---|
415 | AC_ARG_ENABLE(otp, [ --enable-otp enable OTP authentication [yes] ], |
---|
416 | otp=$enableval, |
---|
417 | otp=yes) |
---|
418 | |
---|
419 | if test "$with_openssl" = no; then |
---|
420 | AC_WARN([OpenSSL not found -- OTP will be disabled]) |
---|
421 | otp=no |
---|
422 | fi |
---|
423 | |
---|
424 | AC_MSG_CHECKING(OTP) |
---|
425 | if test "$otp" != no; then |
---|
426 | AC_MSG_RESULT(enabled) |
---|
427 | OTP_LIBS="-lcrypto $LIB_RSAREF" |
---|
428 | |
---|
429 | SASL_MECHS="$SASL_MECHS libotp.la" |
---|
430 | if test "$enable_static" = yes; then |
---|
431 | SASL_STATIC_OBJS="$SASL_STATIC_OBJS ../plugins/otp.o" |
---|
432 | AC_DEFINE(STATIC_OTP) |
---|
433 | fi |
---|
434 | |
---|
435 | dnl Test for OPIE |
---|
436 | AC_ARG_WITH(with-opie,[ --with-opie=PATH use OPIE (One Time Passwords in Everything) from PATH], |
---|
437 | with_opie="${withval}") |
---|
438 | |
---|
439 | case "$with_opie" in |
---|
440 | ""|yes) |
---|
441 | AC_CHECK_LIB(opie, opiechallenge, [ |
---|
442 | AC_CHECK_HEADER(opie.h, with_opie="yes", |
---|
443 | with_opie="no")], |
---|
444 | with_opie="no") |
---|
445 | ;; |
---|
446 | *) |
---|
447 | if test -d $with_opie; then |
---|
448 | CPPFLAGS="${CPPFLAGS} -I${with_opie}/include" |
---|
449 | LDFLAGS="${LDFLAGS} -L${with_opie}/lib" |
---|
450 | else |
---|
451 | with_opie="no" |
---|
452 | fi |
---|
453 | ;; |
---|
454 | esac |
---|
455 | |
---|
456 | AC_MSG_CHECKING(for OPIE) |
---|
457 | AC_MSG_RESULT($with_opie) |
---|
458 | |
---|
459 | if test "$with_opie" != no; then |
---|
460 | AC_DEFINE(HAVE_OPIE) |
---|
461 | OTP_LIBS="$OTP_LIBS -lopie" |
---|
462 | else |
---|
463 | OTP_LIBS="$OTP_LIBS ../sasldb/libsasldb.la \$(SASL_DB_LIB)" |
---|
464 | fi |
---|
465 | |
---|
466 | AC_SUBST(OTP_LIBS) |
---|
467 | |
---|
468 | else |
---|
469 | AC_MSG_RESULT(disabled) |
---|
470 | fi |
---|
471 | |
---|
472 | dnl SRP |
---|
473 | AC_ARG_ENABLE(srp, [ --enable-srp enable SRP authentication [no] ], |
---|
474 | srp=$enableval, |
---|
475 | srp=no) |
---|
476 | |
---|
477 | if test "$with_openssl" = no; then |
---|
478 | AC_WARN([OpenSSL not found -- SRP will be disabled]) |
---|
479 | srp=no |
---|
480 | fi |
---|
481 | |
---|
482 | AC_MSG_CHECKING(SRP) |
---|
483 | if test "$srp" != no; then |
---|
484 | AC_MSG_RESULT(enabled) |
---|
485 | SRP_LIBS="-lcrypto $LIB_RSAREF" |
---|
486 | |
---|
487 | SASL_MECHS="$SASL_MECHS libsrp.la" |
---|
488 | if test "$enable_static" = yes; then |
---|
489 | SASL_STATIC_OBJS="$SASL_STATIC_OBJS ../plugins/srp.o" |
---|
490 | AC_DEFINE(STATIC_SRP) |
---|
491 | fi |
---|
492 | |
---|
493 | dnl srp_setpass support |
---|
494 | AC_ARG_ENABLE(srp_setpass, [ --enable-srp-setpass enable setting SRP secrets with saslpasswd [no]], |
---|
495 | srp_setpass=$enableval, |
---|
496 | srp_setpass=no) |
---|
497 | |
---|
498 | AC_MSG_CHECKING(if we should enable setting SRP secrets with saslpasswd) |
---|
499 | if test "$srp_setpass" != no; then |
---|
500 | AC_MSG_RESULT(enabled) |
---|
501 | AC_DEFINE(DO_SRP_SETPASS) |
---|
502 | SRP_LIBS="$SRP_LIBS ../sasldb/libsasldb.la \$(SASL_DB_LIB)" |
---|
503 | else |
---|
504 | AC_MSG_RESULT(disabled) |
---|
505 | fi |
---|
506 | |
---|
507 | AC_SUBST(SRP_LIBS) |
---|
508 | else |
---|
509 | AC_MSG_RESULT(disabled) |
---|
510 | fi |
---|
511 | |
---|
512 | SASL_KERBEROS_V4_CHK |
---|
513 | SASL_GSSAPI_CHK |
---|
514 | SASL_PLAIN_CHK |
---|
515 | |
---|
516 | if test "$gssapi" != "no"; then |
---|
517 | AC_DEFINE(STATIC_GSSAPIV2) |
---|
518 | fi |
---|
519 | |
---|
520 | dnl ANONYMOUS |
---|
521 | AC_ARG_ENABLE(anon, [ --enable-anon enable ANONYMOUS authentication [yes] ], |
---|
522 | anon=$enableval, |
---|
523 | anon=yes) |
---|
524 | |
---|
525 | AC_MSG_CHECKING(ANONYMOUS) |
---|
526 | if test "$anon" != no; then |
---|
527 | AC_MSG_RESULT(enabled) |
---|
528 | SASL_MECHS="$SASL_MECHS libanonymous.la" |
---|
529 | if test "$enable_static" = yes; then |
---|
530 | SASL_STATIC_OBJS="$SASL_STATIC_OBJS ../plugins/anonymous.o" |
---|
531 | AC_DEFINE(STATIC_ANONYMOUS) |
---|
532 | fi |
---|
533 | else |
---|
534 | AC_MSG_RESULT(disabled) |
---|
535 | fi |
---|
536 | |
---|
537 | dnl LOGIN |
---|
538 | AC_ARG_ENABLE(login, [ --enable-login enable unsupported LOGIN authentication [no] ], |
---|
539 | login=$enableval, |
---|
540 | login=no) |
---|
541 | |
---|
542 | AC_MSG_CHECKING(LOGIN) |
---|
543 | if test "$login" != no; then |
---|
544 | AC_MSG_RESULT(enabled) |
---|
545 | SASL_MECHS="$SASL_MECHS liblogin.la" |
---|
546 | if test "$enable_static" = yes; then |
---|
547 | SASL_STATIC_OBJS="$SASL_STATIC_OBJS ../plugins/login.o" |
---|
548 | AC_DEFINE(STATIC_LOGIN) |
---|
549 | fi |
---|
550 | else |
---|
551 | AC_MSG_RESULT(disabled) |
---|
552 | fi |
---|
553 | |
---|
554 | dnl NTLM |
---|
555 | AC_ARG_ENABLE(ntlm, [ --enable-ntlm enable unsupported NTLM authentication [no] ], |
---|
556 | ntlm=$enableval, |
---|
557 | ntlm=no) |
---|
558 | |
---|
559 | if test "$with_openssl" = no; then |
---|
560 | AC_WARN([OpenSSL not found -- NTLM will be disabled]) |
---|
561 | ntlm=no |
---|
562 | fi |
---|
563 | |
---|
564 | AC_MSG_CHECKING(NTLM) |
---|
565 | if test "$ntlm" != no; then |
---|
566 | AC_MSG_RESULT(enabled) |
---|
567 | NTLM_LIBS="-lcrypto $LIB_RSAREF" |
---|
568 | AC_SUBST(NTLM_LIBS) |
---|
569 | |
---|
570 | SASL_MECHS="$SASL_MECHS libntlm.la" |
---|
571 | if test "$enable_static" = yes; then |
---|
572 | SASL_STATIC_OBJS="$SASL_STATIC_OBJS ../plugins/ntlm.o" |
---|
573 | AC_DEFINE(STATIC_NTLM) |
---|
574 | fi |
---|
575 | else |
---|
576 | AC_MSG_RESULT(disabled) |
---|
577 | fi |
---|
578 | |
---|
579 | |
---|
580 | # make the option show up so people don't whine that it is only in the |
---|
581 | # saslauthd configure script --help |
---|
582 | AC_ARG_WITH(ldap, [ --with-ldap=DIR use LDAP (in DIR) for saslauthd (experimental) [no] ],,) |
---|
583 | |
---|
584 | |
---|
585 | ############################################################################ |
---|
586 | # Simon Loader tries to do auto conf |
---|
587 | dnl MySQL |
---|
588 | AC_ARG_WITH(mysql, [ --with-mysql=PATH enable authentication against a MySQL db (experimental) [no] ], |
---|
589 | with_mysql=$withval, |
---|
590 | with_mysql=no) |
---|
591 | |
---|
592 | # find location of library |
---|
593 | # presuing if one given then correct |
---|
594 | if test "${with_mysql}" = "yes"; then |
---|
595 | for mysqlloc in lib/mysql lib mysql/lib |
---|
596 | do |
---|
597 | if test -f ${prefix}/${mysqlloc}/libmysqlclient.a; then |
---|
598 | with_mysql="${prefix}" |
---|
599 | break |
---|
600 | elif test -f /usr/local/${mysqlloc}/libmysqlclient.a; then |
---|
601 | with_mysql="/usr/local" |
---|
602 | break |
---|
603 | elif test -f /usr/${mysqlloc}/libmysqlclient.a; then |
---|
604 | with_mysql="/usr" |
---|
605 | break |
---|
606 | fi |
---|
607 | done |
---|
608 | fi |
---|
609 | |
---|
610 | LIB_MYSQL="" |
---|
611 | |
---|
612 | case "$with_mysql" in |
---|
613 | no) true;; |
---|
614 | *) |
---|
615 | if test -d ${with_mysql}/lib/mysql; then |
---|
616 | LIB_MYSQL="-L${with_mysql}/lib/mysql" |
---|
617 | elif test -d ${with_mysql}/mysql/lib; then |
---|
618 | LIB_MYSQL="-L${with_mysql}/mysql/lib" |
---|
619 | elif test -d ${with_mysql}/lib; then |
---|
620 | LIB_MYSQL="-L${with_mysql}/lib" |
---|
621 | else |
---|
622 | LIB_MYSQL="-L${with_mysql}" |
---|
623 | fi |
---|
624 | |
---|
625 | LIB_MYSQL_DIR=$LIB_MYSQL |
---|
626 | LIB_MYSQL="$LIB_MYSQL -lmysqlclient" |
---|
627 | |
---|
628 | if test -d ${with_mysql}/include/mysql; then |
---|
629 | CPPFLAGS="${CPPFLAGS} -I${with_mysql}/include/mysql" |
---|
630 | elif test -d ${with_mysql}/mysql/include; then |
---|
631 | CPPFLAGS="${CPPFLAGS} -I${with_mysql}/mysql/include" |
---|
632 | elif test -d ${with_mysql}/include; then |
---|
633 | CPPFLAGS="${CPPFLAGS} -I${with_mysql}/include" |
---|
634 | else |
---|
635 | CPPFLAGS="${CPPFLAGS} -I${with_mysql}" |
---|
636 | fi |
---|
637 | AC_CHECK_LIB(mysqlclient, mysql_select_db,[ |
---|
638 | SASL_MECHS="$SASL_MECHS libmysql.la" |
---|
639 | if test "$enable_static" = yes; then |
---|
640 | SASL_STATIC_OBJS="$SASL_STATIC_OBJS ../plugins/mysql.o" |
---|
641 | AC_DEFINE(STATIC_MYSQL) |
---|
642 | fi |
---|
643 | ], |
---|
644 | [AC_ERROR([MYSQL libarary mysqlclient not found])], $LIB_MYSQL_DIR);; |
---|
645 | |
---|
646 | esac |
---|
647 | AC_SUBST(LIB_MYSQL) |
---|
648 | |
---|
649 | # simon finishes trying to do autoconf |
---|
650 | ############################################################################### |
---|
651 | |
---|
652 | if test "$ac_cv_can_build_shared" = yes; then |
---|
653 | AC_DEFINE(DO_DLOPEN) |
---|
654 | fi |
---|
655 | |
---|
656 | AC_SUBST(SASL_MECHS) |
---|
657 | AC_SUBST(SASL_STATIC_OBJS) |
---|
658 | AC_SUBST(SASL_STATIC_LIBS) |
---|
659 | |
---|
660 | AC_ARG_WITH(plugindir, [ --with-plugindir=DIR set the directory where plugins will |
---|
661 | be found [/usr/lib/sasl2] ], |
---|
662 | plugindir=$withval, |
---|
663 | plugindir=/usr/lib/sasl2) |
---|
664 | AC_DEFINE_UNQUOTED(PLUGINDIR, "$plugindir") |
---|
665 | AC_SUBST(plugindir) |
---|
666 | |
---|
667 | dnl look for rc4 libraries. we accept the CMU one or one from openSSL |
---|
668 | AC_ARG_WITH(rc4, [ --with-rc4 use internal rc4 routines [yes] ], |
---|
669 | with_rc4=$withval, |
---|
670 | with_rc4=yes) |
---|
671 | |
---|
672 | if test "$with_rc4" != no; then |
---|
673 | AC_DEFINE(WITH_RC4) |
---|
674 | fi |
---|
675 | |
---|
676 | building_for_macosx=no |
---|
677 | case "$host_os" in |
---|
678 | darwin*) |
---|
679 | building_for_macosx=yes |
---|
680 | ;; |
---|
681 | esac |
---|
682 | AM_CONDITIONAL(MACOSX, test "$building_for_macosx" = yes) |
---|
683 | |
---|
684 | dnl dmalloc tests |
---|
685 | AC_MSG_CHECKING(for dmalloc library) |
---|
686 | AC_ARG_WITH(dmalloc, [ --with-dmalloc=DIR with DMALLOC support (for test applications) [no] ], |
---|
687 | with_dmalloc=$withval, |
---|
688 | with_dmalloc=no) |
---|
689 | |
---|
690 | DMALLOC_LIBS="" |
---|
691 | |
---|
692 | if test "$with_dmalloc" != "no"; then |
---|
693 | if test "$with_dmalloc" = "yes"; then |
---|
694 | with_dmalloc="/usr/local" |
---|
695 | fi |
---|
696 | |
---|
697 | if test -r "$with_dmalloc/libdmalloc.a"; then |
---|
698 | DMALLOC_LIBS="$with_dmalloc/libdmalloc.a" |
---|
699 | AC_DEFINE(WITH_DMALLOC) |
---|
700 | AC_MSG_RESULT(yes) |
---|
701 | elif test -r "$with_dmalloc/lib/libdmalloc.a"; then |
---|
702 | DMALLOC_LIBS="$with_dmalloc/lib/libdmalloc.a" |
---|
703 | AC_DEFINE(WITH_DMALLOC) |
---|
704 | AC_MSG_RESULT(yes) |
---|
705 | else |
---|
706 | AC_MSG_ERROR(cannot find dmalloc library, please check your installation.) |
---|
707 | fi |
---|
708 | else |
---|
709 | AC_MSG_RESULT(no) |
---|
710 | fi |
---|
711 | |
---|
712 | AC_SUBST(DMALLOC_LIBS) |
---|
713 | |
---|
714 | dnl sfio tests |
---|
715 | AC_MSG_CHECKING(for sfio library) |
---|
716 | AC_ARG_WITH(sfio, [ --with-sfio=DIR with SFIO support (for smtptest/libsfsasl) [no] ], |
---|
717 | with_sfio=$withval, |
---|
718 | with_sfio=no) |
---|
719 | |
---|
720 | if test "$with_sfio" != "no"; then |
---|
721 | if test "$with_sfio" = "yes"; then |
---|
722 | with_sfio="/usr/local" |
---|
723 | fi |
---|
724 | |
---|
725 | AC_DEFUN(SFIO_INC_CHK, |
---|
726 | [if test -r "$with_sfio$1/sfio.h"; then SFIO_DIR=$with_sfio; |
---|
727 | SFIO_INC_DIR=$with_sfio$1]) |
---|
728 | |
---|
729 | AC_DEFUN(SFIO_LIB_CHK,[ |
---|
730 | str="$SFIO_DIR/$1/libsfio.*" |
---|
731 | for i in `echo $str`; do |
---|
732 | if test -r $i; then |
---|
733 | SFIO_LIBDIR=$SFIO_DIR/$1 |
---|
734 | break 2 |
---|
735 | fi |
---|
736 | done |
---|
737 | ]) |
---|
738 | |
---|
739 | SFIO_INC_CHK() |
---|
740 | el[]SFIO_INC_CHK(/include) |
---|
741 | el[]SFIO_INC_CHK(/include/sfio) |
---|
742 | fi |
---|
743 | |
---|
744 | if test -z "$SFIO_DIR"; then |
---|
745 | AC_MSG_ERROR(Cannot find sfio.h, Please check your SFIO installation.) |
---|
746 | fi |
---|
747 | |
---|
748 | SFIO_LIB_CHK(lib) |
---|
749 | SFIO_LIB_CHK(lib/sfio) |
---|
750 | |
---|
751 | if test -z "$SFIO_LIBDIR"; then |
---|
752 | AC_MSG_ERROR(Cannot find sfio library, Please check your SFIO installation.) |
---|
753 | fi |
---|
754 | |
---|
755 | SFIO_INC_FLAGS="-I$SFIO_INC_DIR" |
---|
756 | SFIO_LIB_FLAGS="-L$SFIO_LIBDIR -lsfio" |
---|
757 | SMTPTEST_PROGRAM="smtptest" |
---|
758 | SASL_UTIL_LIBS_EXTRA=libsfsasl2.la |
---|
759 | SASL_UTIL_HEADERS_EXTRA=sfsasl.h |
---|
760 | |
---|
761 | AC_MSG_RESULT(yes) |
---|
762 | else |
---|
763 | AC_MSG_RESULT(no) |
---|
764 | SFIO_INC_FLAGS="" |
---|
765 | SFIO_LIB_FLAGS="" |
---|
766 | SMTPTEST_PROGRAM="" |
---|
767 | SASL_UTIL_LIBS_EXTRA="" |
---|
768 | SASL_UTIL_HEADERS_EXTRA="" |
---|
769 | fi |
---|
770 | |
---|
771 | AC_SUBST(SFIO_INC_FLAGS) |
---|
772 | AC_SUBST(SFIO_LIB_FLAGS) |
---|
773 | AC_SUBST(SMTPTEST_PROGRAM) |
---|
774 | AC_SUBST(SASL_UTIL_LIBS_EXTRA) |
---|
775 | AC_SUBST(SASL_UTIL_HEADERS_EXTRA) |
---|
776 | |
---|
777 | dnl Backwards compatibility with autoconf 2.13 |
---|
778 | ifdef([m4_pattern_allow],[m4_pattern_allow([^LIBOBJS$])]) |
---|
779 | |
---|
780 | dnl check for getsubopt |
---|
781 | sasl_cv_getsubopt=no |
---|
782 | AC_CHECK_FUNC(getsubopt, [AC_DEFINE(HAVE_GETSUBOPT)], [sasl_cv_getsubopt=yes]) |
---|
783 | if test $sasl_cv_getsubopt = yes; then |
---|
784 | LIBOBJS="$LIBOBJS getsubopt.o" |
---|
785 | GETSUBOPT="getsubopt.lo" |
---|
786 | fi |
---|
787 | AC_SUBST(GETSUBOPT) |
---|
788 | |
---|
789 | dnl Check for snprintf |
---|
790 | sasl_cv_snprintf=no |
---|
791 | SNPRINTFOBJS="" |
---|
792 | AC_CHECK_FUNC(snprintf, [AC_DEFINE(HAVE_SNPRINTF)], [sasl_cv_snprintf=yes]) |
---|
793 | AC_CHECK_FUNC(vsnprintf, [AC_DEFINE(HAVE_VSNPRINTF)], [sasl_cv_snprintf=yes]) |
---|
794 | if test $sasl_cv_snprintf = yes; then |
---|
795 | LIBOBJS="$LIBOBJS snprintf.o" |
---|
796 | SNPRINTFOBJS="snprintf.o" |
---|
797 | LTSNPRINTFOBJS="snprintf.lo" |
---|
798 | fi |
---|
799 | AC_SUBST(SNPRINTFOBJS) |
---|
800 | AC_SUBST(LTSNPRINTFOBJS) |
---|
801 | |
---|
802 | dnl do we need to link in -lresolv? |
---|
803 | AC_CHECK_LIB(resolv, inet_aton) |
---|
804 | |
---|
805 | dnl Check for getaddrinfo |
---|
806 | GETADDRINFOOBJS="" |
---|
807 | sasl_cv_getaddrinfo=yes |
---|
808 | IPv6_CHECK_FUNC(getaddrinfo, [IPv6_CHECK_FUNC(gai_strerror, |
---|
809 | [AC_DEFINE(HAVE_GETADDRINFO) |
---|
810 | sasl_cv_getaddrinfo=no])]) |
---|
811 | if test $sasl_cv_getaddrinfo = yes; then |
---|
812 | LIBOBJS="$LIBOBJS getaddrinfo.o" |
---|
813 | GETADDRINFOOBJS="getaddrinfo.o" |
---|
814 | LTGETADDRINFOOBJS="getaddrinfo.lo" |
---|
815 | fi |
---|
816 | AC_SUBST(GETADDRINFOOBJS) |
---|
817 | AC_SUBST(LTGETADDRINFOOBJS) |
---|
818 | |
---|
819 | dnl Check for getnameinfo |
---|
820 | GETNAMEINFOOBJS="" |
---|
821 | sasl_cv_getnameinfo=no |
---|
822 | IPv6_CHECK_FUNC(getnameinfo, |
---|
823 | [AC_DEFINE(HAVE_GETNAMEINFO)], [sasl_cv_getnameinfo=yes]) |
---|
824 | if test $sasl_cv_getnameinfo = yes; then |
---|
825 | LIBOBJS="$LIBOBJS getnameinfo.o" |
---|
826 | GETNAMEINFOOBJS="getnameinfo.o" |
---|
827 | LTGETNAMEINFOOBJS="getnameinfo.lo" |
---|
828 | fi |
---|
829 | AC_SUBST(GETNAMEINFOOBJS) |
---|
830 | AC_SUBST(LTGETNAMEINFOOBJS) |
---|
831 | |
---|
832 | LTLIBOBJS=`echo "$LIBOBJS" | sed 's/\.o/.lo/g'` |
---|
833 | AC_SUBST(LIBOBJS) |
---|
834 | AC_SUBST(LTLIBOBJS) |
---|
835 | |
---|
836 | AC_C_CONST |
---|
837 | AC_C_INLINE |
---|
838 | AC_TYPE_MODE_T |
---|
839 | AC_TYPE_PID_T |
---|
840 | AC_TYPE_SIGNAL |
---|
841 | |
---|
842 | AC_HEADER_TIME |
---|
843 | AC_HEADER_STDC |
---|
844 | AC_HEADER_DIRENT |
---|
845 | AC_HEADER_SYS_WAIT |
---|
846 | 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) |
---|
847 | |
---|
848 | IPv6_CHECK_SS_FAMILY() |
---|
849 | IPv6_CHECK_SA_LEN() |
---|
850 | IPv6_CHECK_SOCKLEN_T() |
---|
851 | |
---|
852 | #AC_FUNC_MEMCMP |
---|
853 | #AC_FUNC_VPRINTF |
---|
854 | AC_CHECK_FUNCS(gethostname getdomainname getpwnam getspnam gettimeofday inet_aton memcpy mkdir select socket strchr strdup strerror strspn strstr strtol jrand48) |
---|
855 | |
---|
856 | if test $enable_cmulocal = yes; then |
---|
857 | AC_WARN([enabling CMU local kludges]) |
---|
858 | AC_DEFINE(KRB4_IGNORE_IP_ADDRESS) |
---|
859 | AC_DEFINE_UNQUOTED(PREFER_MECH, "KERBEROS_V4") |
---|
860 | fi |
---|
861 | |
---|
862 | AC_EGREP_HEADER(sockaddr_storage, sys/socket.h, [ |
---|
863 | AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)]) |
---|
864 | |
---|
865 | AC_SUBST(DIRS) |
---|
866 | |
---|
867 | AC_CONFIG_SUBDIRS(saslauthd) |
---|
868 | |
---|
869 | AC_OUTPUT(Makefile |
---|
870 | include/Makefile |
---|
871 | sasldb/Makefile |
---|
872 | plugins/Makefile |
---|
873 | lib/Makefile |
---|
874 | utils/Makefile |
---|
875 | doc/Makefile |
---|
876 | sample/Makefile |
---|
877 | java/Makefile |
---|
878 | java/CyrusSasl/Makefile |
---|
879 | java/Test/Makefile |
---|
880 | java/javax/Makefile |
---|
881 | java/javax/security/Makefile |
---|
882 | java/javax/security/auth/Makefile |
---|
883 | java/javax/security/auth/callback/Makefile |
---|
884 | pwcheck/Makefile |
---|
885 | man/Makefile) |
---|
886 | |
---|
887 | echo Configuration Complete. Type \'make\' to build. |
---|