1 dnl configure.in for the SASL library
4 dnl $Id: configure.in,v 1.213.2.1 2009/04/27 17:58:25 murch Exp $
6 dnl Copyright (c) 2001 Carnegie Mellon University. All rights reserved.
8 dnl Redistribution and use in source and binary forms, with or without
9 dnl modification, are permitted provided that the following conditions
12 dnl 1. Redistributions of source code must retain the above copyright
13 dnl notice, this list of conditions and the following disclaimer.
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
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
31 dnl 4. Redistributions of any form whatsoever must retain the following
33 dnl \"This product includes software developed by Computing Services
34 dnl at Carnegie Mellon University (http://www.cmu.edu/computing/).\"
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.
44 AC_INIT(lib/saslint.h)
47 dnl use ./config.cache as the default cache file.
48 dnl we require a cache file to successfully configure our build.
49 if test $cache_file = "/dev/null"; then
50 cache_file="./config.cache"
54 AC_CONFIG_AUX_DIR(config)
59 dnl REMINDER: When changing the version number here, please also update
60 dnl the values in win32/include/config.h and include/sasl.h as well.
62 AM_INIT_AUTOMAKE(cyrus-sasl, 2.1.23)
65 # and include our config dir scripts
66 ACLOCAL="$ACLOCAL -I \$(top_srcdir)/config"
70 AC_ARG_ENABLE(cmulocal,
71 [AC_HELP_STRING([--enable-cmulocal],
72 [enable local mods for CMU [[no]]])],
77 [AC_HELP_STRING([--enable-sample],
78 [compile sample code [[yes]]])],
89 dnl check for -R, etc. switch
90 CMU_GUESS_RUNPATH_SWITCH
93 AC_ARG_WITH(staticsasl)
94 if test "$with_staticsasl" = yes; then
100 if test -z "$target"; then
110 if test "$enable_static" = yes; then
111 SASL_STATIC_LIBS=libsasl2.a
116 AC_ARG_ENABLE(staticdlopen, [ --enable-staticdlopen try dynamic plugins when we are a static libsasl [[no]] ],
117 enable_staticdlopen=$enableval,
118 enable_staticdlopen=no)
120 if test "$enable_staticdlopen" = yes; then
121 AC_DEFINE(TRY_DLOPEN_WHEN_STATIC,[],[Should we try to dlopen() plugins while staticly compiled?])
124 if test "$ac_cv_prog_gcc" = yes; then
125 CFLAGS="-Wall -W ${CFLAGS}"
128 AC_ARG_WITH(purecov,[ --with-purecov link with purecov])
129 if test "$with_purecov" = yes; then
130 AC_CHECK_PROGS(PURECOV, purecov)
132 AC_ARG_WITH(purify,[ --with-purify link with purify])
133 if test "$with_purify" = yes; then
134 AC_CHECK_PROGS(PURIFY, purify)
137 AC_ARG_ENABLE(java, [ --enable-java compile Java support [[no]]],
138 enable_java=$enableval, enable_java=no)
139 if test "$enable_java" = yes; then
140 AC_PATH_PROG(JAVAC, javac, no)
141 AC_PATH_PROGS(JAVAH, javah kaffeh, no)
142 AC_CHECK_PROGS(JAVADOC, javadoc, :)
143 if test "$JAVAC" = "no" -o "$JAVAH" = "no"; then
144 AC_WARN([Disabling Java support])
148 # Make distcheck work
153 AM_CONDITIONAL(JAVA, test "$enable_java" = yes)
155 if test "$enable_java" = yes; then
156 AC_MSG_CHECKING([JNI cpp flags])
157 AC_CACHE_VAL(sasl_cv_java_includes,[
158 if test `echo $JAVAH | sed 's,.*/,,'` = "kaffeh"; then
159 sasl_cv_java_includes=-I`echo $JAVAH | sed -e 's,/bin.*,/include/kaffe,'`
161 java_base=`echo $JAVAC | sed 's,/bin.*,'','`
163 AC_ARG_WITH(javabase, [ --with-javabase=PATH set path to find jni.h in [/usr/java/include] ],
167 sasl_cv_java_includes=''
168 for dir in `find ${java_base}/include -follow -type d -print | grep -v green_threads`; do
169 sasl_cv_java_includes="${sasl_cv_java_includes} -I$dir"
173 sasl_cv_java_includes="${sasl_cv_java_includes} -I$javapath/include"])
175 JAVA_INCLUDES=$sasl_cv_java_includes
176 AC_SUBST(JAVA_INCLUDES)
181 JAVAC=`echo "$JAVAC" | sed 's,.*/,,'`
182 JAVAH=`echo "$JAVAH" | sed 's,.*/,,'`
185 AM_CONDITIONAL(SAMPLE, test "$enable_sample" = yes)
187 dnl call before we do the berkeley DB checks
190 dnl we extracted this to config/sasldb.m4
194 # Do we not install the SASL DB man pages?
195 AM_CONDITIONAL(NO_SASL_DB_MANS, test "x$SASL_DB_MANS" = "x")
197 AC_ARG_ENABLE(keep_db_open, [ --enable-keep-db-open keep handle to Berkeley DB open for improved performance [[no]] ],
198 keep_db_open=$enableval,
201 # Disable if Berkeley DB is not used
202 if test "$dblib" != berkeley; then
206 if test "$keep_db_open" = yes; then
207 AC_DEFINE(KEEP_DB_OPEN,[],[Should we keep handle to Berkeley DB open in SASLDB plugin?])
209 AC_MSG_CHECKING(if Berkeley DB handle is kept open in SASLDB)
210 AC_MSG_RESULT($keep_db_open)
212 AC_CHECK_LIB(dl, dlopen, SASL_DL_LIB="-ldl", SASL_DL_LIB="")
213 AC_SUBST(SASL_DL_LIB)
217 AC_ARG_WITH(devrandom, [ --with-devrandom=PATH set the path to /dev/random [[/dev/random]] ],
219 devrandom=/dev/random)
220 AC_MSG_CHECKING(/dev/random to use)
221 AC_MSG_RESULT($devrandom)
222 AC_DEFINE_UNQUOTED(SASL_DEV_RANDOM, "$devrandom", [File to use for source of randomness])
224 dnl Do we need leading underscores on our symbols?
226 AC_CHECK_PROGS(NM, nm)
228 AC_MSG_CHECKING(for underscore before symbols)
229 AC_CACHE_VAL(sasl_cv_uscore,[
230 echo "main(){int i=1;}
231 foo(){int i=6;}" > conftest.c
232 ${CC} -o a.out conftest.c > /dev/null
233 if (${NM} a.out | grep _foo) > /dev/null; then
238 AC_MSG_RESULT($sasl_cv_uscore)
239 rm -f conftest.c a.out
241 if test $sasl_cv_uscore = yes; then
242 if test $ac_cv_lib_dl_dlopen = yes ; then
243 AC_MSG_CHECKING(whether dlsym adds the underscore for us)
244 cmu_save_LIBS="$LIBS"
245 LIBS="$LIBS $SASL_DL_LIB"
246 AC_CACHE_VAL(sasl_cv_dlsym_adds_uscore,AC_TRY_RUN( [
250 main() { void *self, *ptr1, *ptr2; self=dlopen(NULL,RTLD_LAZY);
251 if(self) { ptr1=dlsym(self,"foo"); ptr2=dlsym(self,"_foo");
252 if(ptr1 && !ptr2) exit(0); } exit(1); }
253 ], [sasl_cv_dlsym_adds_uscore=yes], sasl_cv_dlsym_adds_uscore=no
254 AC_DEFINE(DLSYM_NEEDS_UNDERSCORE, [], [Do we need a leading _ for dlsym?]),
255 AC_MSG_WARN(cross-compiler, we'll do our best)))
256 LIBS="$cmu_save_LIBS"
257 AC_MSG_RESULT($sasl_cv_dlsym_adds_uscore)
261 dnl See if we can provide a default logging function...
262 AC_CHECK_FUNCS(syslog)
264 AC_ARG_WITH(pam, [ --with-pam=DIR use PAM (rooted in DIR) [[yes]] ],
267 if test "$with_pam" != no; then
268 if test -d $with_pam; then
269 CPPFLAGS="$CPPFLAGS -I${with_pam}/include"
270 LDFLAGS="$LDFLAGS -L${with_pam}/lib"
272 AC_CHECK_HEADERS(security/pam_appl.h pam/pam_appl.h)
273 cmu_save_LIBS="$LIBS"
274 AC_CHECK_FUNC(pam_start, :,
277 #include <sys/types.h>
278 #ifdef HAVE_PAM_PAM_APPL_H
279 #include <pam/pam_appl.h>
281 #ifdef HAVE_SECURITY_PAM_H
282 #include <security/pam_appl.h>
284 const char *service="foo";
285 const char *user="bar";
287 struct pam_conv *conv;
289 baz = pam_start(service, user, conv, &pamh);
293 LIBS="$cmu_save_LIBS $LIBPAM"
296 AC_ARG_WITH(saslauthd, [ --with-saslauthd=DIR enable use of the saslauth daemon using state dir DIR ],
297 with_saslauthd=$withval,
299 if test "$with_saslauthd" != no; then
300 if test "$with_saslauthd" = yes; then
301 with_saslauthd="/var/state/saslauthd"
303 AC_DEFINE(HAVE_SASLAUTHD,[],[Include support for saslauthd?])
304 AC_DEFINE_UNQUOTED(PATH_SASLAUTHD_RUNDIR, "$with_saslauthd",
305 [Where do we look for saslauthd's socket?])
307 AM_CONDITIONAL(SASLAUTHD, test "$with_saslauthd" != no)
308 AC_MSG_CHECKING(if I should include saslauthd)
309 AC_MSG_RESULT($with_saslauthd)
311 AC_ARG_WITH(authdaemond, [ --with-authdaemond=PATH enable use of authdaemon with default socket=PATH [[yes]] ],
312 with_authdaemon=$withval,
314 if test "$with_authdaemon" != no; then
315 if test "$with_authdaemon" = yes; then
316 with_authdaemon="/dev/null"
318 AC_DEFINE(HAVE_AUTHDAEMON,[],[Include support for Courier's authdaemond?])
319 AC_DEFINE_UNQUOTED(PATH_AUTHDAEMON_SOCKET, "$with_authdaemon",
320 [Where do we look for Courier authdaemond's socket?])
322 AC_MSG_CHECKING(to include Courier authdaemond support)
323 AC_MSG_RESULT($with_authdaemon)
326 [ --with-pwcheck=DIR enable deprecated pwcheck daemon using statedir DIR ],
327 with_pwcheck=$withval,
329 if test "$with_pwcheck" != no; then
330 if test "$with_pwcheck" = yes; then
331 with_pwcheck=/var/pwcheck
333 AC_DEFINE(HAVE_PWCHECK,[],[Include Support for pwcheck daemon?])
334 AC_DEFINE_UNQUOTED(PWCHECKDIR, "$with_pwcheck", [Location of pwcheck socket])
335 AC_CHECK_FUNC(getspnam,PWCHECKMETH="getspnam",PWCHECKMETH="getpwnam")
336 AC_SUBST(PWCHECKMETH)
338 AM_CONDITIONAL(PWCHECK, test "$with_pwcheck" != no)
339 AC_MSG_CHECKING(if I should include pwcheck)
340 AC_MSG_RESULT($with_pwcheck)
342 AC_ARG_WITH(ipctype, [ --with-ipctype={unix,doors} use ipctype [[unix]] ],
343 with_ipctype=$withval,
345 IPCTYPE=$with_ipctype
348 if test "$with_ipctype" = "doors"; then
350 AC_DEFINE(USE_DOORS,[],[use the doors IPC API for saslauthd?])
354 AC_ARG_ENABLE(alwaystrue, [ --enable-alwaystrue enable the alwaystrue password verifier (discouraged)],
355 enable_alwaystrue=$enableval,
356 enable_alwaystrue=no)
357 if test "$enable_alwaystrue" = yes; then
358 AC_DEFINE(HAVE_ALWAYSTRUE, [], [Enable 'alwaystrue' password verifier?])
360 AC_MSG_CHECKING(if I should include the alwaystrue verifier)
361 AC_MSG_RESULT($enable_alwaystrue)
363 dnl sasl_checkapop support
364 AC_ARG_ENABLE(checkapop, [ --enable-checkapop enable use of sasl_checkapop [[yes]] ],
365 checkapop=$enableval,
368 AC_MSG_CHECKING(if we should enable sasl_checkapop)
369 if test "$checkapop" != no; then
370 AC_MSG_RESULT(enabled)
371 AC_DEFINE(DO_SASL_CHECKAPOP, [], [should we support sasl_checkapop?])
373 AC_MSG_RESULT(disabled)
377 AC_ARG_ENABLE(cram, [ --enable-cram enable CRAM-MD5 authentication [[yes]] ],
381 AC_MSG_CHECKING(CRAM-MD5)
382 if test "$cram" != no; then
383 AC_MSG_RESULT(enabled)
384 SASL_MECHS="$SASL_MECHS libcrammd5.la"
385 if test "$enable_static" = yes; then
386 SASL_STATIC_OBJS="$SASL_STATIC_OBJS cram.o"
387 SASL_STATIC_SRCS="$SASL_STATIC_SRCS ../plugins/cram.c"
388 AC_DEFINE(STATIC_CRAMMD5, [], [Link CRAM-MD5 Staticly])
391 AC_MSG_RESULT(disabled)
395 AC_MSG_CHECKING(for OpenSSL)
396 AC_MSG_RESULT($with_openssl)
401 AC_ARG_ENABLE(digest, [ --enable-digest enable DIGEST-MD5 authentication [[yes]] ],
405 if test "$digest" != no; then
406 dnl In order to compile digest, we should look for need libdes.
407 if test -d $digest; then
408 CPPFLAGS="$CPPFLAGS -I$digest/include"
409 LDFLAGS="$LDFLAGS -L$digest/lib"
411 if test "$with_des" = no; then
412 AC_WARN(No DES support for DIGEST-MD5)
416 AC_MSG_CHECKING(DIGEST-MD5)
417 if test "$digest" != no; then
418 AC_MSG_RESULT(enabled)
419 SASL_MECHS="$SASL_MECHS libdigestmd5.la"
420 if test "$enable_static" = yes; then
421 SASL_STATIC_SRCS="$SASL_STATIC_SRCS ../plugins/digestmd5.c"
422 SASL_STATIC_OBJS="$SASL_STATIC_OBJS digestmd5.o"
423 AC_DEFINE(STATIC_DIGESTMD5, [], [Link DIGEST-MD5 Staticly])
426 AC_MSG_RESULT(disabled)
430 AC_ARG_ENABLE(otp, [ --enable-otp enable OTP authentication [[yes]] ],
434 if test "$with_openssl" = no; then
435 AC_WARN([OpenSSL not found -- OTP will be disabled])
440 if test "$otp" != no; then
441 AC_MSG_RESULT(enabled)
442 OTP_LIBS="-lcrypto $LIB_RSAREF"
444 SASL_MECHS="$SASL_MECHS libotp.la"
445 if test "$enable_static" = yes; then
446 SASL_STATIC_SRCS="$SASL_STATIC_SRCS ../plugins/otp.c"
447 SASL_STATIC_OBJS="$SASL_STATIC_OBJS otp.o"
448 AC_DEFINE(STATIC_OTP, [], [Link OTP Staticly])
452 AC_ARG_WITH(with-opie,[ --with-opie=PATH use OPIE (One Time Passwords in Everything) from PATH],
453 with_opie="${withval}")
457 AC_CHECK_LIB(opie, opiechallenge, [
458 AC_CHECK_HEADER(opie.h, with_opie="yes",
463 if test -d $with_opie; then
464 CPPFLAGS="${CPPFLAGS} -I${with_opie}/include"
465 LDFLAGS="${LDFLAGS} -L${with_opie}/lib"
472 AC_MSG_CHECKING(for OPIE)
473 AC_MSG_RESULT($with_opie)
475 if test "$with_opie" != no; then
476 AC_DEFINE(HAVE_OPIE,[],[Use OPIE for server-side OTP?])
477 OTP_LIBS="$OTP_LIBS -lopie"
483 AC_MSG_RESULT(disabled)
487 AC_ARG_ENABLE(srp, [ --enable-srp enable SRP authentication [[no]] ],
491 if test "$with_openssl" = no; then
492 AC_WARN([OpenSSL not found -- SRP will be disabled])
497 if test "$srp" != no; then
498 AC_MSG_RESULT(enabled)
499 SRP_LIBS="-lcrypto $LIB_RSAREF"
501 SASL_MECHS="$SASL_MECHS libsrp.la"
502 if test "$enable_static" = yes; then
503 SASL_STATIC_SRCS="$SASL_STATIC_SRCS ../plugins/srp.c"
504 SASL_STATIC_OBJS="$SASL_STATIC_OBJS srp.o"
505 AC_DEFINE(STATIC_SRP, [], [Link SRP Staticly])
508 dnl srp_setpass support
509 AC_ARG_ENABLE(srp_setpass, [ --enable-srp-setpass enable setting SRP secrets with saslpasswd [[no]]],
510 srp_setpass=$enableval,
513 AC_MSG_CHECKING(if we should enable setting SRP secrets with saslpasswd)
514 if test "$srp_setpass" != no; then
515 AC_MSG_RESULT(enabled)
516 AC_DEFINE(DO_SRP_SETPASS, [], [should we support setpass() for SRP?])
518 AC_MSG_RESULT(disabled)
523 AC_MSG_RESULT(disabled)
526 dnl Kerberos based Mechanisms
530 if test "$gssapi" != "no"; then
531 AC_DEFINE(STATIC_GSSAPIV2,[],[Link GSSAPI Staticly])
533 if test "$gss_impl" = "mit"; then
536 AC_MSG_CHECKING(to use mutexes aroung GSS calls)
537 AC_ARG_ENABLE(gss_mutexes, [ --enable-gss_mutexes use mutexes around calls to the GSS library],
538 use_gss_mutexes=$enableval,
539 use_gss_mutexes=$mutex_default)
540 if test $use_gss_mutexes = "yes"; then
541 AC_DEFINE(GSS_USE_MUTEXES, [], [should we mutex-wrap calls into the GSS library?])
543 AC_MSG_RESULT($use_gss_mutexes)
550 AC_ARG_ENABLE(anon, [ --enable-anon enable ANONYMOUS authentication [[yes]] ],
554 AC_MSG_CHECKING(ANONYMOUS)
555 if test "$anon" != no; then
556 AC_MSG_RESULT(enabled)
557 SASL_MECHS="$SASL_MECHS libanonymous.la"
558 if test "$enable_static" = yes; then
559 SASL_STATIC_OBJS="$SASL_STATIC_OBJS anonymous.o"
560 SASL_STATIC_SRCS="$SASL_STATIC_SRCS ../plugins/anonymous.c"
561 AC_DEFINE(STATIC_ANONYMOUS, [], [Link ANONYMOUS Staticly])
564 AC_MSG_RESULT(disabled)
568 AC_ARG_ENABLE(login, [ --enable-login enable unsupported LOGIN authentication [[no]] ],
572 AC_MSG_CHECKING(LOGIN)
573 if test "$login" != no; then
574 AC_MSG_RESULT(enabled)
575 SASL_MECHS="$SASL_MECHS liblogin.la"
576 if test "$enable_static" = yes; then
577 SASL_STATIC_SRCS="$SASL_STATIC_SRCS ../plugins/login.c"
578 SASL_STATIC_OBJS="$SASL_STATIC_OBJS login.o"
579 AC_DEFINE(STATIC_LOGIN,[],[Link LOGIN Staticly])
582 AC_MSG_RESULT(disabled)
586 AC_ARG_ENABLE(ntlm, [ --enable-ntlm enable unsupported NTLM authentication [[no]] ],
590 if test "$with_openssl" = no; then
591 AC_WARN([OpenSSL not found -- NTLM will be disabled])
595 AC_MSG_CHECKING(NTLM)
596 if test "$ntlm" != no; then
597 AC_MSG_RESULT(enabled)
598 NTLM_LIBS="-lcrypto $LIB_RSAREF"
601 SASL_MECHS="$SASL_MECHS libntlm.la"
602 if test "$enable_static" = yes; then
603 SASL_STATIC_SRCS="$SASL_STATIC_SRCS ../plugins/ntlm.c"
604 SASL_STATIC_OBJS="$SASL_STATIC_OBJS ntlm.o"
605 AC_DEFINE(STATIC_NTLM,[],[Link NTLM Staticly])
608 AC_MSG_RESULT(disabled)
612 AC_ARG_ENABLE(passdss, [ --enable-passdss enable PASSDSS authentication (experimental) [[no]] ],
616 if test "$with_openssl" = no; then
617 AC_WARN([OpenSSL not found -- PASSDSS will be disabled])
621 AC_MSG_CHECKING(PASSDSS)
622 if test "$passdss" != no; then
623 AC_MSG_RESULT(enabled)
624 PASSDSS_LIBS="-lcrypto $LIB_RSAREF"
625 AC_SUBST(PASSDSS_LIBS)
627 SASL_MECHS="$SASL_MECHS libpassdss.la"
628 if test "$enable_static" = yes; then
629 SASL_STATIC_OBJS="$SASL_STATIC_OBJS passdss.o"
630 SASL_STATIC_SRCS="$SASL_STATIC_SRCS ../plugins/passdss.c"
631 AC_DEFINE(STATIC_PASSDSS,[],[Link PASSDSS Staticly])
634 AC_MSG_RESULT(disabled)
638 # make the option show up so people don't whine that it is only in the
639 # saslauthd configure script --help
640 AC_ARG_WITH(ldap, [ --with-ldap=DIR use LDAP (in DIR) for saslauthd [no] ],,with_ldap=no)
644 dnl This flag also changes the requirements of --with-mysql and --with-pgsql
646 dnl Desired behavior:
648 dnl doesn't require mysql or postgres if --disable-sql is chosen
649 dnl requires at least one (but not both) if --enable-sql is chosen
651 AC_ARG_ENABLE(sql, [ --enable-sql enable SQL auxprop [[no]] ],
656 if test "$sql" != no; then
657 AC_MSG_RESULT(enabled)
658 SASL_MECHS="$SASL_MECHS libsql.la"
659 if test "$enable_static" = yes; then
660 SASL_STATIC_SRCS="$SASL_STATIC_SRCS ../plugins/sql.c"
661 SASL_STATIC_OBJS="$SASL_STATIC_OBJS sql.o"
662 AC_DEFINE(STATIC_SQL,[],[Link SQL plugin staticly])
665 AC_MSG_RESULT(disabled)
669 AC_ARG_WITH(mysql, [ --with-mysql=PATH use MySQL from PATH ],
673 # find location of library
674 # presuming if one given then correct
675 if test "${with_mysql}" = "yes"; then
677 for mysqlloc in lib/mysql lib mysql/lib
679 if test -f ${prefix}/${mysqlloc}/libmysqlclient.a; then
680 with_mysql="${prefix}"
682 elif test -f /usr/local/${mysqlloc}/libmysqlclient.a; then
683 with_mysql="/usr/local"
685 elif test -f /usr/${mysqlloc}/libmysqlclient.a; then
694 case "$with_mysql" in
696 notfound) AC_WARN([MySQL Library not found]); true;;
698 if test -d ${with_mysql}/lib/mysql; then
699 CMU_ADD_LIBPATH_TO(${with_mysql}/lib/mysql, LIB_MYSQL)
700 elif test -d ${with_mysql}/mysql/lib; then
701 CMU_ADD_LIBPATH_TO(${with_mysql}/mysql/lib, LIB_MYSQL)
702 elif test -d ${with_mysql}/lib; then
703 CMU_ADD_LIBPATH_TO(${with_mysql}/lib, LIB_MYSQL)
705 CMU_ADD_LIBPATH_TO(${with_mysql}, LIB_MYSQL)
708 LIB_MYSQL_DIR=$LIB_MYSQL
709 LIB_MYSQL="$LIB_MYSQL -lmysqlclient"
711 if test -d ${with_mysql}/include/mysql; then
712 CPPFLAGS="${CPPFLAGS} -I${with_mysql}/include/mysql"
713 elif test -d ${with_mysql}/mysql/include; then
714 CPPFLAGS="${CPPFLAGS} -I${with_mysql}/mysql/include"
715 elif test -d ${with_mysql}/include; then
716 CPPFLAGS="${CPPFLAGS} -I${with_mysql}/include"
718 CPPFLAGS="${CPPFLAGS} -I${with_mysql}"
721 save_LDFLAGS=$LDFLAGS
722 LDFLAGS="$LDFLAGS $LIB_MYSQL_DIR"
723 AC_CHECK_LIB(mysqlclient, mysql_select_db,
724 AC_DEFINE(HAVE_MYSQL, [], [Do we have mysql support?]),
725 [AC_WARN([MySQL library mysqlclient does not work])
727 LDFLAGS=$save_LDFLAGS;;
733 AC_ARG_WITH(pgsql, [ --with-pgsql=PATH use PostgreSQL from PATH ],
737 # find location of library
738 # presuing if one given then correct
739 if test "${with_pgsql}" = "yes"; then
741 for pgsqlloc in lib/pgsql lib pgsql/lib
743 if test -f ${prefix}/${pgsqlloc}/libpq.a; then
744 with_pgsql="${prefix}"
746 elif test -f /usr/local/${pgsqlloc}/libpq.a; then
747 with_pgsql="/usr/local"
749 elif test -f /usr/${pgsqlloc}/libpq.a; then
758 case "$with_pgsql" in
760 notfound) AC_WARN([PostgreSQL Library not found]); true;;
762 if test -d ${with_pgsql}/lib/pgsql; then
763 CMU_ADD_LIBPATH_TO(${with_pgsql}/lib/pgsql, LIB_PGSQL)
764 elif test -d ${with_pgsql}/pgsql/lib; then
765 CMU_ADD_LIBPATH_TO(${with_pgsql}/pgsql/lib, LIB_PGSQL)
766 elif test -d ${with_pgsql}/lib; then
767 CMU_ADD_LIBPATH_TO(${with_pgsql}/lib, LIB_PGSQL)
769 CMU_ADD_LIBPATH_TO(${with_pgsql}, LIB_PGSQL)
772 LIB_PGSQL_DIR=$LIB_PGSQL
773 LIB_PGSQL="$LIB_PGSQL -lpq"
775 if test -d ${with_pgsql}/include/pgsql; then
776 CPPFLAGS="${CPPFLAGS} -I${with_pgsql}/include/pgsql"
777 elif test -d ${with_pgsql}/pgsql/include; then
778 CPPFLAGS="${CPPFLAGS} -I${with_pgsql}/pgsql/include"
779 elif test -d ${with_pgsql}/include; then
780 CPPFLAGS="${CPPFLAGS} -I${with_pgsql}/include"
782 CPPFLAGS="${CPPFLAGS} -I${with_pgsql}"
786 save_LDFLAGS=$LDFLAGS
787 LDFLAGS="$LDFLAGS $LIB_PGSQL_DIR"
788 AC_CHECK_LIB(pq, PQsetdbLogin, AC_DEFINE(HAVE_PGSQL,[],
789 [Do we have Postgres support?]),
790 [AC_WARN([PostgreSQL Library pq does not work])
792 LDFLAGS=$save_LDFLAGS;;
798 AC_ARG_WITH(sqlite, [ --with-sqlite=PATH use SQLite from PATH ],
799 with_sqlite=$withval,
802 # find location of library
803 # presuing if one given then correct
804 if test "${with_sqlite}" = "yes"; then
808 if test -f ${prefix}/${sqliteloc}/libsqlite.a; then
809 with_sqlite="${prefix}"
811 elif test -f /usr/local/${sqliteloc}/libsqlite.a; then
812 with_sqlite="/usr/local"
814 elif test -f /usr/${sqliteloc}/libsqlite.a; then
823 case "$with_sqlite" in
825 notfound) AC_WARN([SQLite Library not found]); true;;
827 if test -d ${with_sqlite}/lib; then
828 LIB_SQLITE="-L${with_sqlite}/lib -R${with_sqlite}/lib"
830 LIB_SQLITE="-L${with_sqlite} -R${with_sqlite}"
833 LIB_SQLITE_DIR=$LIB_SQLITE
834 LIB_SQLITE="$LIB_SQLITE -lsqlite"
836 if test -d ${with_sqlite}/include; then
837 CPPFLAGS="${CPPFLAGS} -I${with_sqlite}/include"
839 CPPFLAGS="${CPPFLAGS} -I${with_sqlite}"
841 AC_CHECK_LIB(sqlite, sqlite_open, AC_DEFINE(HAVE_SQLITE,[],
842 [Do we have SQLite support?]),
843 [AC_WARN([SQLite Library sqlite does not work])
844 with_sqlite=no], $LIB_SQLITE_DIR);;
849 if test "$sql" = yes -a "$with_pgsql" = no -a "$with_mysql" = no -a "$with_sqlite" = no; then
850 AC_ERROR([--enable-sql chosen but neither Postgres nor MySQL nor SQLite found])
853 if test "$enable_shared" = yes; then
854 AC_DEFINE(DO_DLOPEN,[],[Should we build a shared plugin (via dlopen) library?])
858 AC_ARG_ENABLE(ldapdb, [ --enable-ldapdb enable LDAPDB plugin [no] ],
861 AC_MSG_CHECKING(LDAPDB)
862 if test "$ldapdb" != no; then
863 AC_MSG_RESULT(enabled)
865 if test "$with_ldap" = no; then
866 AC_MSG_ERROR([Cannot enable LDAPDB plugin: You need to specify --with-ldap])
869 save_CPPFLAGS=$CPPFLAGS
870 save_LDFLAGS=$LDFLAGS
872 if test -d $with_ldap; then
873 CPPFLAGS="${CPPFLAGS} -I${with_ldap}/include"
874 CMU_ADD_LIBPATH(${with_ldap}/lib)
877 AC_CHECK_HEADERS(ldap.h lber.h)
879 if test $ac_cv_header_ldap_h = yes -a $ac_cv_header_lber_h = yes; then
882 if test "$cmu_cv_openldap_api" = yes; then
883 AC_CHECK_LIB(ldap, ldap_initialize, [ cmu_link_openldap="-lldap -llber" ], [ cmu_link_openldap=no ],-llber)
887 if test "$cmu_cv_openldap_api" = no -o "$cmu_link_openldap" = no; then
888 AC_MSG_ERROR([Cannot enable LDAPDB plugin: Could not locate OpenLDAP])
892 if test "$cmu_cv_openldap_compat" = no; then
893 AC_MSG_ERROR([Cannot enable LDAPDB plugin: OpenLDAP library located but incompatible])
895 LIB_LDAP=$cmu_link_openldap
898 SASL_MECHS="$SASL_MECHS libldapdb.la"
899 if test "$enable_static" = yes; then
900 SASL_STATIC_SRCS="$SASL_STATIC_SRCS ../plugins/ldapdb.c"
901 SASL_STATIC_OBJS="$SASL_STATIC_OBJS ldapdb.o"
902 AC_DEFINE(STATIC_LDAPDB,[],[Link ldapdb plugin Staticly])
907 if test "$cmu_cv_openldap_compat" != yes; then
908 CPPFLAGS=$save_CPPFLAGS
909 LDFLAGS=$save_LDFLAGS
912 AC_MSG_RESULT(disabled)
916 AC_SUBST(SASL_STATIC_SRCS)
917 AC_SUBST(SASL_STATIC_OBJS)
918 AC_SUBST(SASL_STATIC_LIBS)
920 AC_ARG_WITH(plugindir, [ --with-plugindir=DIR set the directory where plugins will
921 be found [[/usr/lib/sasl2]] ],
923 plugindir=/usr/lib/sasl2)
924 AC_DEFINE_UNQUOTED(PLUGINDIR, "$plugindir", [Runtime plugin location])
927 AC_ARG_WITH(configdir, [ --with-configdir=DIR set the directory where config files will
928 be found [/usr/lib/sasl2] ],
930 configdir=$plugindir:/etc/sasl2)
931 AC_DEFINE_UNQUOTED(CONFIGDIR, "$configdir", [Runtime config file location])
934 dnl look for rc4 libraries. we accept the CMU one or one from openSSL
935 AC_ARG_WITH(rc4, [ --with-rc4 use internal rc4 routines [[yes]] ],
939 if test "$with_rc4" != no; then
940 AC_DEFINE(WITH_RC4,[],[Use internal RC4 implementation?])
943 building_for_macosx=no
946 AC_ARG_ENABLE(macos-framework, [ --disable-macos-framework disable building and installing replacement SASL2 Framework for MacOS X-provided SASL Framework [[no]]],building_for_macosx=no,building_for_macosx=yes)
949 AM_CONDITIONAL(MACOSX, test "$building_for_macosx" = yes)
952 AC_MSG_CHECKING(for dmalloc library)
953 AC_ARG_WITH(dmalloc, [ --with-dmalloc=DIR with DMALLOC support (for test applications) [[no]] ],
954 with_dmalloc=$withval,
959 if test "$with_dmalloc" != "no"; then
960 if test "$with_dmalloc" = "yes"; then
961 with_dmalloc="/usr/local"
964 if test -r "$with_dmalloc/libdmalloc.a"; then
965 DMALLOC_LIBS="$with_dmalloc/libdmalloc.a"
966 AC_DEFINE(WITH_DMALLOC,[],[Linking against dmalloc?])
968 elif test -r "$with_dmalloc/lib/libdmalloc.a"; then
969 DMALLOC_LIBS="$with_dmalloc/lib/libdmalloc.a"
970 AC_DEFINE(WITH_DMALLOC,[],[Linking against dmalloc?])
973 AC_MSG_ERROR(cannot find dmalloc library, please check your installation.)
979 AC_SUBST(DMALLOC_LIBS)
982 AC_MSG_CHECKING(for sfio library)
983 AC_ARG_WITH(sfio, [ --with-sfio=DIR with SFIO support (for smtptest/libsfsasl) [[no]] ],
987 if test "$with_sfio" != "no"; then
988 if test "$with_sfio" = "yes"; then
989 with_sfio="/usr/local"
992 AC_DEFUN([SFIO_INC_CHK],
993 [if test -r "$with_sfio$1/sfio.h"; then SFIO_DIR=$with_sfio;
994 SFIO_INC_DIR=$with_sfio$1])
996 AC_DEFUN([SFIO_LIB_CHK],[
997 str="$SFIO_DIR/$1/libsfio.*"
998 for i in `echo $str`; do
1000 SFIO_LIBDIR=$SFIO_DIR/$1
1007 el[]SFIO_INC_CHK(/include)
1008 el[]SFIO_INC_CHK(/include/sfio)
1011 if test -z "$SFIO_DIR"; then
1012 AC_MSG_ERROR(Cannot find sfio.h, Please check your SFIO installation.)
1016 SFIO_LIB_CHK(lib/sfio)
1018 if test -z "$SFIO_LIBDIR"; then
1019 AC_MSG_ERROR(Cannot find sfio library, Please check your SFIO installation.)
1022 SFIO_INC_FLAGS="-I$SFIO_INC_DIR"
1023 SFIO_LIB_FLAGS="-L$SFIO_LIBDIR -lsfio"
1024 SMTPTEST_PROGRAM="smtptest"
1025 SASL_UTIL_LIBS_EXTRA=libsfsasl2.la
1026 SASL_UTIL_HEADERS_EXTRA=sfsasl.h
1034 SASL_UTIL_LIBS_EXTRA=""
1035 SASL_UTIL_HEADERS_EXTRA=""
1038 AC_SUBST(SFIO_INC_FLAGS)
1039 AC_SUBST(SFIO_LIB_FLAGS)
1040 AC_SUBST(SMTPTEST_PROGRAM)
1041 AC_SUBST(SASL_UTIL_LIBS_EXTRA)
1042 AC_SUBST(SASL_UTIL_HEADERS_EXTRA)
1044 dnl check for getsubopt
1045 sasl_cv_getsubopt=no
1046 AC_CHECK_FUNC(getsubopt, [AC_DEFINE(HAVE_GETSUBOPT,[],
1047 [do we have getsubopt()?])], [sasl_cv_getsubopt=yes])
1048 if test $sasl_cv_getsubopt = yes; then
1049 AC_LIBOBJ(getsubopt)
1050 GETSUBOPT="getsubopt.lo"
1054 dnl Check for snprintf
1057 AC_CHECK_FUNC(snprintf, [AC_DEFINE(HAVE_SNPRINTF,[],[Does the system have snprintf()?])], [sasl_cv_snprintf=yes])
1058 AC_CHECK_FUNC(vsnprintf, [AC_DEFINE(HAVE_VSNPRINTF,[],[Does the system have vsnprintf()?])], [sasl_cv_snprintf=yes])
1059 if test $sasl_cv_snprintf = yes; then
1061 SNPRINTFOBJS="snprintf.o"
1062 LTSNPRINTFOBJS="snprintf.lo"
1064 AC_SUBST(SNPRINTFOBJS)
1065 AC_SUBST(LTSNPRINTFOBJS)
1067 dnl do we need to link in -lresolv?
1068 AC_CHECK_LIB(resolv, inet_aton)
1070 dnl Check for getaddrinfo
1072 sasl_cv_getaddrinfo=yes
1073 IPv6_CHECK_FUNC(getaddrinfo, [IPv6_CHECK_FUNC(gai_strerror,
1074 [AC_DEFINE(HAVE_GETADDRINFO,[],[Do we have a getaddrinfo() function?])
1075 sasl_cv_getaddrinfo=no])])
1076 if test $sasl_cv_getaddrinfo = yes; then
1077 AC_LIBOBJ(getaddrinfo)
1078 GETADDRINFOOBJS="getaddrinfo.o"
1079 LTGETADDRINFOOBJS="getaddrinfo.lo"
1081 AC_SUBST(GETADDRINFOOBJS)
1082 AC_SUBST(LTGETADDRINFOOBJS)
1084 dnl Check for getnameinfo
1086 sasl_cv_getnameinfo=no
1087 IPv6_CHECK_FUNC(getnameinfo,
1088 [AC_DEFINE(HAVE_GETNAMEINFO,[],[Do we have a getnameinfo() function?])], [sasl_cv_getnameinfo=yes])
1089 if test $sasl_cv_getnameinfo = yes; then
1090 AC_LIBOBJ(getnameinfo)
1091 GETNAMEINFOOBJS="getnameinfo.o"
1092 LTGETNAMEINFOOBJS="getnameinfo.lo"
1094 AC_SUBST(GETNAMEINFOOBJS)
1095 AC_SUBST(LTGETNAMEINFOOBJS)
1097 LTLIBOBJS=`echo "$LIB@&t@OBJS" | sed 's,\.[[^.]]* ,.lo ,g;s,\.[[^.]]*$,.lo,'`
1110 AC_CHECK_HEADERS(des.h 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)
1112 IPv6_CHECK_SS_FAMILY()
1114 IPv6_CHECK_SOCKLEN_T()
1118 AC_CHECK_FUNCS(gethostname getdomainname getpwnam getspnam gettimeofday inet_aton memcpy mkdir select socket strchr strdup strerror strspn strstr strtol jrand48)
1120 if test $enable_cmulocal = yes; then
1121 AC_WARN([enabling CMU local kludges])
1122 AC_DEFINE(KRB4_IGNORE_IP_ADDRESS,[],[Ignore IP Address in Kerberos 4 tickets?])
1123 AC_DEFINE_UNQUOTED(PREFER_MECH, "KERBEROS_V4", [Force a preferred mechanism])
1126 AC_EGREP_HEADER(sockaddr_storage, sys/socket.h, [
1127 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE,[],[Do we have struct sockaddr_stroage?])])
1131 AC_CONFIG_SUBDIRS(saslauthd)
1134 /* acconfig.h - autoheader configuration input */
1136 * Copyright (c) 1998-2003 Carnegie Mellon University. All rights reserved.
1138 * Redistribution and use in source and binary forms, with or without
1139 * modification, are permitted provided that the following conditions
1142 * 1. Redistributions of source code must retain the above copyright
1143 * notice, this list of conditions and the following disclaimer.
1145 * 2. Redistributions in binary form must reproduce the above copyright
1146 * notice, this list of conditions and the following disclaimer in
1147 * the documentation and/or other materials provided with the
1150 * 3. The name "Carnegie Mellon University" must not be used to
1151 * endorse or promote products derived from this software without
1152 * prior written permission. For permission or any other legal
1153 * details, please contact
1154 * Office of Technology Transfer
1155 * Carnegie Mellon University
1156 * 5000 Forbes Avenue
1157 * Pittsburgh, PA 15213-3890
1158 * (412) 268-4387, fax: (412) 268-7395
1159 * tech-transfer@andrew.cmu.edu
1161 * 4. Redistributions of any form whatsoever must retain the following
1163 * "This product includes software developed by Computing Services
1164 * at Carnegie Mellon University (http://www.cmu.edu/computing/)."
1166 * CARNEGIE MELLON UNIVERSITY DISCLAIMS ALL WARRANTIES WITH REGARD TO
1167 * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
1168 * AND FITNESS, IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY BE LIABLE
1169 * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
1170 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
1171 * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
1172 * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
1182 /* Create a struct iovec if we need one */
1183 #if !defined(_WIN32) && !defined(HAVE_SYS_UIO_H)
1184 /* (win32 is handled in sasl.h) */
1190 #include <sys/types.h>
1191 #include <sys/uio.h>
1194 /* location of the random number generator */
1198 #define DEV_RANDOM SASL_DEV_RANDOM
1200 /* if we've got krb_get_err_txt, we might as well use it;
1201 especially since krb_err_txt isn't in some newer distributions
1202 (MIT Kerb for Mac 4 being a notable example). If we don't have
1203 it, we fall back to the krb_err_txt array */
1204 #ifdef HAVE_KRB_GET_ERR_TEXT
1205 #define get_krb_err_txt krb_get_err_text
1207 #define get_krb_err_txt(X) (krb_err_txt[(X)])
1210 /* Make Solaris happy... */
1211 #ifndef __EXTENSIONS__
1212 #define __EXTENSIONS__
1215 /* Make Linux happy... */
1220 #ifndef HAVE___ATTRIBUTE__
1221 /* Can't use attributes... */
1222 #define __attribute__(foo)
1225 #define SASL_PATH_ENV_VAR "SASL_PATH"
1226 #define SASL_CONF_PATH_ENV_VAR "SASL_CONF_PATH"
1229 #include <sys/types.h>
1230 #include <sys/socket.h>
1233 # ifdef HAVE_SYS_PARAM_H
1234 # include <sys/param.h>
1237 # include <winsock2.h>
1241 #include <netinet/in.h>
1243 #ifndef HAVE_SOCKLEN_T
1244 typedef unsigned int socklen_t;
1245 #endif /* HAVE_SOCKLEN_T */
1247 #ifndef HAVE_STRUCT_SOCKADDR_STORAGE
1248 #define _SS_MAXSIZE 128 /* Implementation specific max size */
1249 #define _SS_PADSIZE (_SS_MAXSIZE - sizeof (struct sockaddr))
1251 struct sockaddr_storage {
1252 struct sockaddr ss_sa;
1253 char __ss_pad2[_SS_PADSIZE];
1255 # define ss_family ss_sa.sa_family
1256 #endif /* !HAVE_STRUCT_SOCKADDR_STORAGE */
1259 /* Define it to something that should never appear */
1260 #define AF_INET6 AF_MAX
1263 #ifndef HAVE_GETADDRINFO
1264 #define getaddrinfo sasl_getaddrinfo
1265 #define freeaddrinfo sasl_freeaddrinfo
1266 #define gai_strerror sasl_gai_strerror
1269 #ifndef HAVE_GETNAMEINFO
1270 #define getnameinfo sasl_getnameinfo
1273 #if !defined(HAVE_GETNAMEINFO) || !defined(HAVE_GETADDRINFO)
1277 #ifndef AI_NUMERICHOST /* support glibc 2.0.x */
1278 #define AI_NUMERICHOST 4
1279 #define NI_NUMERICHOST 2
1280 #define NI_NAMEREQD 4
1281 #define NI_NUMERICSERV 8
1284 /* Defined in RFC 1035. max strlen is only 253 due to length bytes. */
1285 #ifndef MAXHOSTNAMELEN
1286 #define MAXHOSTNAMELEN 255
1289 #ifndef HAVE_SYSEXITS_H
1292 #include "sysexits.h"
1295 /* Get the correct time.h */
1296 #if TIME_WITH_SYS_TIME
1297 # include <sys/time.h>
1300 # if HAVE_SYS_TIME_H
1301 # include <sys/time.h>
1307 #ifndef HIER_DELIMITER
1308 #define HIER_DELIMITER '/'
1311 #endif /* CONFIG_H */
1314 AC_CONFIG_HEADERS(config.h)
1325 java/CyrusSasl/Makefile
1328 java/javax/security/Makefile
1329 java/javax/security/auth/Makefile
1330 java/javax/security/auth/callback/Makefile
1334 echo Configuration Complete. Type \'make\' to build.