1 dnl OpenLDAP Autoconf Macros
3 dnl This work is part of OpenLDAP Software <http://www.openldap.org/>.
5 dnl Copyright 1998-2005 The OpenLDAP Foundation.
6 dnl All rights reserved.
8 dnl Redistribution and use in source and binary forms, with or without
9 dnl modification, are permitted only as authorized by the OpenLDAP
12 dnl A copy of this license is available in the file LICENSE in the
13 dnl top-level directory of the distribution or, alternatively, at
14 dnl <http://www.OpenLDAP.org/license.html>.
16 dnl --------------------------------------------------------------------
17 dnl Restricted form of AC_ARG_ENABLE that limits user options
21 dnl $3 = default value (auto). "--" means do not set it by default
22 dnl $4 = allowed values (auto yes no)
23 AC_DEFUN([OL_ARG_ENABLE], [# OpenLDAP --enable-$1
24 AC_ARG_ENABLE($1,ifelse($3,--,[$2],
25 [changequote(<,>)<$2 [>ifelse($3,,auto,$3)<]>changequote([,])]),[
27 for ol_val in ifelse($4,,[auto yes no],[$4]) ; do
28 if test "$enableval" = "$ol_val" ; then
32 if test "$ol_arg" = "invalid" ; then
33 AC_MSG_ERROR(bad value $enableval for --enable-$1)
35 ol_enable_$1="$ol_arg"
37 [ ol_enable_$1=ifelse($3,,"auto","$3")]]))dnl
38 dnl AC_VERBOSE(OpenLDAP -enable-$1 $ol_enable_$1)
42 dnl --------------------------------------------------------------------
43 dnl Restricted form of AC_ARG_WITH that limits user options
47 dnl $3 = default value (no)
48 dnl $4 = allowed values (yes or no)
49 AC_DEFUN([OL_ARG_WITH], [# OpenLDAP --with-$1
50 AC_ARG_WITH($1,changequote(<,>)<$2 [>ifelse($3,,yes,$3)<]>changequote([,]),[
52 for ol_val in ifelse($4,,[yes no],[$4]) ; do
53 if test "$withval" = "$ol_val" ; then
57 if test "$ol_arg" = "invalid" ; then
58 AC_MSG_ERROR(bad value $withval for --with-$1)
62 [ ol_with_$1=ifelse($3,,"no","$3")])dnl
63 dnl AC_VERBOSE(OpenLDAP --with-$1 $ol_with_$1)
67 dnl ====================================================================
69 AC_DEFUN(AC_COMPILE_CHECK_SIZEOF,
70 [changequote(<<, >>)dnl
71 dnl The name to #define.
72 define(<<AC_TYPE_NAME>>, translit(sizeof_$1, [a-z *], [A-Z_P]))dnl
73 dnl The cache variable name.
74 define(<<AC_CV_NAME>>, translit(ac_cv_sizeof_$1, [ *], [_p]))dnl
76 AC_MSG_CHECKING(size of $1)
77 AC_CACHE_VAL(AC_CV_NAME,
78 [for ac_size in 4 8 1 2 16 $2 ; do # List sizes in rough order of prevalence.
79 AC_TRY_COMPILE([#include "confdefs.h"
81 #include <sys/types.h>
83 ], [switch (0) case 0: case (sizeof ($1) == $ac_size):;], AC_CV_NAME=$ac_size)
84 if test x$AC_CV_NAME != x ; then break; fi
87 if test x$AC_CV_NAME = x ; then
88 AC_MSG_ERROR([cannot determine a size for $1])
90 AC_MSG_RESULT($AC_CV_NAME)
91 AC_DEFINE_UNQUOTED(AC_TYPE_NAME, $AC_CV_NAME, [The number of bytes in type $1])
92 undefine([AC_TYPE_NAME])dnl
93 undefine([AC_CV_NAME])dnl
95 dnl ====================================================================
96 dnl check if hard links are supported.
98 AC_DEFUN([OL_PROG_LN_H], [# test for ln hardlink support
99 AC_MSG_CHECKING(whether ln works)
100 AC_CACHE_VAL(ol_cv_prog_LN_H,
101 [rm -f conftest.src conftest.dst
102 echo "conftest" > conftest.src
103 if ln conftest.src conftest.dst 2>/dev/null
109 rm -f conftest.src conftest.dst
111 LN_H="$ol_cv_prog_LN_H"
112 if test "$ol_cv_prog_LN_H" = "ln"; then
120 dnl ====================================================================
121 dnl Check for dependency generation flag
122 AC_DEFUN([OL_MKDEPEND], [# test for make depend flag
125 if test -z "${MKDEP}"; then
127 if test -z "${MKDEP_FLAGS}"; then
128 AC_CACHE_CHECK([for ${OL_MKDEP} depend flag], ol_cv_mkdep, [
130 for flag in "-M" "-xM"; do
131 cat > conftest.c <<EOF
134 if AC_TRY_COMMAND($OL_MKDEP $flag conftest.c) \
135 | egrep '^conftest\.'"${ac_objext}" >/dev/null 2>&1
137 if test ! -f conftest."${ac_object}" ; then
139 OL_MKDEP_FLAGS="$flag"
148 OL_MKDEP_FLAGS="${MKDEP_FLAGS}"
153 OL_MKDEP_FLAGS="${MKDEP_FLAGS}"
156 AC_SUBST(OL_MKDEP_FLAGS)
159 dnl ====================================================================
160 dnl Check if system uses EBCDIC instead of ASCII
161 AC_DEFUN([OL_CPP_EBCDIC], [# test for EBCDIC
162 AC_CACHE_CHECK([for EBCDIC],ol_cv_cpp_ebcdic,[
165 #include <__ASCII__/generate_error.h>
168 [ol_cv_cpp_ebcdic=yes],
169 [ol_cv_cpp_ebcdic=no])])
170 if test $ol_cv_cpp_ebcdic = yes ; then
171 AC_DEFINE(HAVE_EBCDIC,1, [define if system uses EBCDIC instead of ASCII])
175 dnl --------------------------------------------------------------------
176 dnl OpenLDAP version of STDC header check w/ EBCDIC support
177 AC_DEFUN(OL_HEADER_STDC,
179 AC_REQUIRE([OL_CPP_EBCDIC])dnl
180 AC_CACHE_CHECK([for ANSI C header files], ol_cv_header_stdc,
181 [AC_TRY_CPP([#include <stdlib.h>
184 #include <float.h>], ol_cv_header_stdc=yes, ol_cv_header_stdc=no)
186 if test $ol_cv_header_stdc = yes; then
187 # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
188 AC_EGREP_HEADER(memchr, string.h, , ol_cv_header_stdc=no)
191 if test $ol_cv_header_stdc = yes; then
192 # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
193 AC_EGREP_HEADER(free, stdlib.h, , ol_cv_header_stdc=no)
196 if test $ol_cv_header_stdc = yes; then
197 # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
198 AC_TRY_RUN([#include <ctype.h>
200 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
201 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
203 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
204 || ('j' <= (c) && (c) <= 'r') \
205 || ('s' <= (c) && (c) <= 'z'))
206 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
208 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
209 int main () { int i; for (i = 0; i < 256; i++)
210 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
212 ], , ol_cv_header_stdc=no, :)
214 if test $ol_cv_header_stdc = yes; then
215 AC_DEFINE(STDC_HEADERS)
217 ac_cv_header_stdc=disable
220 dnl ====================================================================
221 dnl Check if struct passwd has pw_gecos
222 AC_DEFUN([OL_STRUCT_PASSWD_PW_GECOS], [# test for pw_gecos in struct passwd
223 AC_CACHE_CHECK([struct passwd for pw_gecos],ol_cv_struct_passwd_pw_gecos,[
224 AC_TRY_COMPILE([#include <pwd.h>],[
226 pwd.pw_gecos = pwd.pw_name;
228 [ol_cv_struct_passwd_pw_gecos=yes],
229 [ol_cv_struct_passwd_pw_gecos=no])])
230 if test $ol_cv_struct_passwd_pw_gecos = yes ; then
231 AC_DEFINE(HAVE_PW_GECOS,1, [define if struct passwd has pw_gecos])
235 dnl --------------------------------------------------------------------
236 dnl Check if struct passwd has pw_passwd
237 AC_DEFUN([OL_STRUCT_PASSWD_PW_PASSWD], [# test for pw_passwd in struct passwd
238 AC_CACHE_CHECK([struct passwd for pw_passwd],ol_cv_struct_passwd_pw_passwd,[
239 AC_TRY_COMPILE([#include <pwd.h>],[
241 pwd.pw_passwd = pwd.pw_name;
243 [ol_cv_struct_passwd_pw_passwd=yes],
244 [ol_cv_struct_passwd_pw_passwd=no])])
245 if test $ol_cv_struct_passwd_pw_passwd = yes ; then
246 AC_DEFINE(HAVE_PW_PASSWD,1, [define if struct passwd has pw_passwd])
250 dnl ====================================================================
251 dnl DNS resolver macros
252 AC_DEFUN([OL_RESOLVER_TRY],
253 [if test $ol_cv_lib_resolver = no ; then
254 AC_CACHE_CHECK([for resolver link (]ifelse($2,,default,$2)[)],[$1],
256 ol_RESOLVER_LIB=ifelse($2,,,$2)
258 LIBS="$ol_RESOLVER_LIB $LIBS"
261 #ifdef HAVE_SYS_TYPES_H
262 # include <sys/types.h>
264 #include <netinet/in.h>
265 #ifdef HAVE_ARPA_NAMESER_H
266 # include <arpa/nameser.h>
273 char *request = NULL;
274 unsigned char reply[64*1024];
275 unsigned char host[64*1024];
279 /* Bind 8/9 interface */
280 len = res_query(request, ns_c_in, ns_t_srv, reply, sizeof(reply));
282 /* Bind 4 interface */
286 len = res_query(request, C_IN, T_SRV, reply, sizeof(reply));
290 /* Bind 8/9 interface */
292 #elif defined(HFIXEDSZ)
293 /* Bind 4 interface w/ HFIXEDSZ */
296 /* Bind 4 interface w/o HFIXEDSZ */
299 status = dn_expand( reply, reply+len, p, host, sizeof(host));
305 if test $$1 = yes ; then
306 ol_cv_lib_resolver=ifelse($2,,yes,$2)
310 dnl --------------------------------------------------------------------
311 dnl Try to locate appropriate library
312 AC_DEFUN([OL_RESOLVER_LINK],
313 [ol_cv_lib_resolver=no
314 OL_RESOLVER_TRY(ol_cv_resolver_none)
315 OL_RESOLVER_TRY(ol_cv_resolver_resolv,[-lresolv])
316 OL_RESOLVER_TRY(ol_cv_resolver_bind,[-lbind])
319 dnl ====================================================================
320 dnl Berkeley DB macros
322 dnl --------------------------------------------------------------------
324 AC_DEFUN([OL_BERKELEY_DB_TRY],
325 [if test $ol_cv_lib_db = no ; then
326 AC_CACHE_CHECK([for Berkeley DB link (]ifelse($2,,default,$2)[)],[$1],
328 ol_DB_LIB=ifelse($2,,,$2)
330 LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
339 #ifndef DB_VERSION_MAJOR
340 # define DB_VERSION_MAJOR 1
344 #define NULL ((void*)0)
347 #if DB_VERSION_MAJOR > 1
350 int major, minor, patch;
352 version = db_version( &major, &minor, &patch );
354 if( major != DB_VERSION_MAJOR ||
355 minor < DB_VERSION_MINOR )
357 printf("Berkeley DB version mismatch\n"
358 "\theader: %s\n\tlibrary: %s\n",
359 DB_VERSION_STRING, version);
365 #if DB_VERSION_MAJOR > 2
366 db_env_create( NULL, 0 );
367 #elif DB_VERSION_MAJOR > 1
370 (void) dbopen( NULL, 0, 0, 0, NULL);
377 if test $$1 = yes ; then
378 ol_cv_lib_db=ifelse($2,,yes,$2)
383 dnl --------------------------------------------------------------------
384 dnl Try to locate appropriate library
385 AC_DEFUN([OL_BERKELEY_DB_LINK],
387 OL_BERKELEY_DB_TRY(ol_cv_db_none)
388 OL_BERKELEY_DB_TRY(ol_cv_db_db43,[-ldb43])
389 OL_BERKELEY_DB_TRY(ol_cv_db_db_43,[-ldb-43])
390 OL_BERKELEY_DB_TRY(ol_cv_db_db_4_dot_3,[-ldb-4.3])
391 OL_BERKELEY_DB_TRY(ol_cv_db_db_4_3,[-ldb-4-3])
392 OL_BERKELEY_DB_TRY(ol_cv_db_db42,[-ldb42])
393 OL_BERKELEY_DB_TRY(ol_cv_db_db_42,[-ldb-42])
394 OL_BERKELEY_DB_TRY(ol_cv_db_db_4_dot_2,[-ldb-4.2])
395 OL_BERKELEY_DB_TRY(ol_cv_db_db_4_2,[-ldb-4-2])
396 OL_BERKELEY_DB_TRY(ol_cv_db_db_4,[-ldb-4])
397 OL_BERKELEY_DB_TRY(ol_cv_db_db4,[-ldb4])
398 OL_BERKELEY_DB_TRY(ol_cv_db_db,[-ldb])
399 OL_BERKELEY_DB_TRY(ol_cv_db_db41,[-ldb41])
400 OL_BERKELEY_DB_TRY(ol_cv_db_db_41,[-ldb-41])
401 OL_BERKELEY_DB_TRY(ol_cv_db_db_4_dot_1,[-ldb-4.1])
402 OL_BERKELEY_DB_TRY(ol_cv_db_db_4_1,[-ldb-4-1])
403 OL_BERKELEY_DB_TRY(ol_cv_db_db3,[-ldb3])
404 OL_BERKELEY_DB_TRY(ol_cv_db_db_3,[-ldb-3])
405 OL_BERKELEY_DB_TRY(ol_cv_db_db2,[-ldb2])
406 OL_BERKELEY_DB_TRY(ol_cv_db_db_2,[-ldb-2])
407 OL_BERKELEY_DB_TRY(ol_cv_db_db1,[-ldb1])
408 OL_BERKELEY_DB_TRY(ol_cv_db_db_1,[-ldb-1])
411 dnl --------------------------------------------------------------------
412 dnl Check if Berkeley DB version
413 AC_DEFUN([OL_BERKELEY_DB_VERSION],
414 [AC_CACHE_CHECK([for Berkeley DB version match], [ol_cv_berkeley_db_version], [
416 LIBS="$LTHREAD_LIBS $LIBS"
417 if test $ol_cv_lib_db != yes ; then
418 LIBS="$ol_cv_lib_db $LIBS"
427 #ifndef DB_VERSION_MAJOR
428 # define DB_VERSION_MAJOR 1
431 #define NULL ((void *)0)
435 #if DB_VERSION_MAJOR > 1
437 int major, minor, patch;
439 version = db_version( &major, &minor, &patch );
441 if( major != DB_VERSION_MAJOR ||
442 minor != DB_VERSION_MINOR ||
443 patch != DB_VERSION_PATCH )
445 printf("Berkeley DB version mismatch\n"
446 "\theader: %s\n\tlibrary: %s\n",
447 DB_VERSION_STRING, version);
454 [ol_cv_berkeley_db_version=yes],
455 [ol_cv_berkeley_db_version=no],
456 [ol_cv_berkeley_db_version=cross])
461 if test $ol_cv_berkeley_db_version = no ; then
462 AC_MSG_ERROR([Berkeley DB version mismatch])
466 dnl --------------------------------------------------------------------
467 dnl Check if Berkeley DB supports DB_THREAD
468 AC_DEFUN([OL_BERKELEY_DB_THREAD],
469 [AC_CACHE_CHECK([for Berkeley DB thread support], [ol_cv_berkeley_db_thread], [
471 LIBS="$LTHREAD_LIBS $LIBS"
472 if test $ol_cv_lib_db != yes ; then
473 LIBS="$ol_cv_lib_db $LIBS"
483 #define NULL ((void *)0)
488 u_int32_t flags = DB_CREATE |
494 #if DB_VERSION_MAJOR > 2
497 rc = db_env_create( &env, 0 );
499 flags |= DB_INIT_MPOOL;
500 #ifdef DB_MPOOL_PRIVATE
501 flags |= DB_MPOOL_PRIVATE;
505 printf("BerkeleyDB: %s\n", db_strerror(rc) );
509 #if (DB_VERSION_MAJOR > 3) || (DB_VERSION_MINOR >= 1)
510 rc = env->open( env, NULL, flags, 0 );
512 rc = env->open( env, NULL, NULL, flags, 0 );
516 rc = env->close( env, 0 );
520 printf("BerkeleyDB: %s\n", db_strerror(rc) );
526 memset( &env, '\0', sizeof(env) );
528 rc = db_appinit( NULL, NULL, &env, flags );
534 unlink("__db_mpool.share");
535 unlink("__db_lock.share");
540 [ol_cv_berkeley_db_thread=yes],
541 [ol_cv_berkeley_db_thread=no],
542 [ol_cv_berkeley_db_thread=cross])
547 if test $ol_cv_berkeley_db_thread != no ; then
548 AC_DEFINE(HAVE_BERKELEY_DB_THREAD, 1,
549 [define if Berkeley DB has DB_THREAD support])
553 dnl --------------------------------------------------------------------
555 AC_DEFUN([OL_BERKELEY_DB],
556 [ol_cv_berkeley_db=no
557 AC_CHECK_HEADERS(db.h)
558 if test $ac_cv_header_db_h = yes; then
560 if test "$ol_cv_lib_db" != no ; then
561 ol_cv_berkeley_db=yes
562 OL_BERKELEY_DB_VERSION
563 OL_BERKELEY_DB_THREAD
567 dnl --------------------------------------------------------------------
568 dnl Check for version compatility with back-bdb
569 AC_DEFUN([OL_BDB_COMPAT],
570 [AC_CACHE_CHECK([Berkeley DB version for BDB backend], [ol_cv_bdb_compat],[
571 AC_EGREP_CPP(__db_version_compat,[
574 /* this check could be improved */
575 #ifndef DB_VERSION_MAJOR
576 # define DB_VERSION_MAJOR 1
578 #ifndef DB_VERSION_MINOR
579 # define DB_VERSION_MINOR 0
582 /* require 4.2 or later */
583 #if (DB_VERSION_MAJOR >= 4) && (DB_VERSION_MINOR >= 2)
586 ], [ol_cv_bdb_compat=yes], [ol_cv_bdb_compat=no])])
589 dnl --------------------------------------------------------------------
590 dnl Find old Berkeley DB 1.85/1.86
591 AC_DEFUN([OL_BERKELEY_COMPAT_DB],
592 [AC_CHECK_HEADERS(db_185.h db.h)
593 if test $ac_cv_header_db_185_h = yes -o $ac_cv_header_db_h = yes; then
594 AC_CACHE_CHECK([if Berkeley DB header compatibility], [ol_cv_header_db1],[
595 AC_EGREP_CPP(__db_version_1,[
602 /* this check could be improved */
603 #ifndef DB_VERSION_MAJOR
604 # define DB_VERSION_MAJOR 1
607 #if DB_VERSION_MAJOR == 1
610 ], [ol_cv_header_db1=yes], [ol_cv_header_db1=no])])
612 if test $ol_cv_header_db1 = yes ; then
614 if test "$ol_cv_lib_db" != no ; then
615 ol_cv_berkeley_db=yes
621 dnl ====================================================================
622 dnl Check if GDBM library exists
623 dnl Check for gdbm_open in standard libraries or -lgdbm
625 dnl defines ol_cv_lib_gdbm to 'yes' or '-lgdbm' or 'no'
626 dnl 'yes' implies gdbm_open is in $LIBS
629 dnl AC_CHECK_FUNC(gdbm_open)
630 dnl AC_CHECK_LIB(gdbm,gdbm_open)
632 AC_DEFUN([OL_LIB_GDBM],
633 [AC_CACHE_CHECK(for GDBM library, [ol_cv_lib_gdbm],
635 AC_CHECK_FUNC(gdbm_open,[ol_cv_lib_gdbm=yes], [
636 AC_CHECK_LIB(gdbm,gdbm_open,[ol_cv_lib_gdbm=-lgdbm],[ol_cv_lib_gdbm=no])
642 dnl --------------------------------------------------------------------
643 dnl Check if GDBM exists
645 dnl defines ol_cv_gdbm to 'yes' or 'no'
649 dnl AC_CHECK_HEADERS(gdbm.h)
652 [AC_REQUIRE([OL_LIB_GDBM])
653 AC_CHECK_HEADERS(gdbm.h)
654 AC_CACHE_CHECK(for db, [ol_cv_gdbm], [
655 if test $ol_cv_lib_gdbm = no -o $ac_cv_header_gdbm_h = no ; then
661 if test $ol_cv_gdbm = yes ; then
662 AC_DEFINE(HAVE_GDBM,1, [define if GNU DBM is available])
666 dnl ====================================================================
667 dnl Check if MDBM library exists
668 dnl Check for mdbm_open in standard libraries or -lmdbm
670 dnl defines ol_cv_lib_mdbm to 'yes' or '-lmdbm' or 'no'
671 dnl 'yes' implies mdbm_open is in $LIBS
674 dnl AC_CHECK_FUNC(mdbm_set_chain)
675 dnl AC_CHECK_LIB(mdbm,mdbm_set_chain)
677 AC_DEFUN([OL_LIB_MDBM],
678 [AC_CACHE_CHECK(for MDBM library, [ol_cv_lib_mdbm],
680 AC_CHECK_FUNC(mdbm_set_chain,[ol_cv_lib_mdbm=yes], [
681 AC_CHECK_LIB(mdbm,mdbm_set_chain,[ol_cv_lib_mdbm=-lmdbm],[ol_cv_lib_mdbm=no])
687 dnl --------------------------------------------------------------------
688 dnl Check if MDBM exists
690 dnl defines ol_cv_mdbm to 'yes' or 'no'
694 dnl AC_CHECK_HEADERS(mdbm.h)
697 [AC_REQUIRE([OL_LIB_MDBM])
698 AC_CHECK_HEADERS(mdbm.h)
699 AC_CACHE_CHECK(for db, [ol_cv_mdbm], [
700 if test $ol_cv_lib_mdbm = no -o $ac_cv_header_mdbm_h = no ; then
706 if test $ol_cv_mdbm = yes ; then
707 AC_DEFINE(HAVE_MDBM,1, [define if MDBM is available])
711 dnl ====================================================================
712 dnl Check if NDBM library exists
713 dnl Check for dbm_open in standard libraries or -lndbm or -ldbm
715 dnl defines ol_cv_lib_ndbm to 'yes' or '-lndbm' or -ldbm or 'no'
716 dnl 'yes' implies ndbm_open is in $LIBS
719 dnl AC_CHECK_FUNC(dbm_open)
720 dnl AC_CHECK_LIB(ndbm,dbm_open)
721 dnl AC_CHECK_LIB(dbm,dbm_open)
724 dnl should also check SVR4 case: dbm_open() in -lucb but that
725 dnl would requiring dealing with -L/usr/ucblib
727 AC_DEFUN([OL_LIB_NDBM],
728 [AC_CACHE_CHECK(for NDBM library, [ol_cv_lib_ndbm],
730 AC_CHECK_FUNC(dbm_open,[ol_cv_lib_ndbm=yes], [
731 AC_CHECK_LIB(ndbm,dbm_open,[ol_cv_lib_ndbm=-lndbm], [
732 AC_CHECK_LIB(dbm,dbm_open,[ol_cv_lib_ndbm=-ldbm],
733 [ol_cv_lib_ndbm=no])dnl
740 dnl --------------------------------------------------------------------
741 dnl Check if NDBM exists
743 dnl defines ol_cv_ndbm to 'yes' or 'no'
747 dnl AC_CHECK_HEADERS(ndbm.h)
750 dnl Doesn't handle SVR4 case (see above)
753 [AC_REQUIRE([OL_LIB_NDBM])
754 AC_CHECK_HEADERS(ndbm.h)
755 AC_CACHE_CHECK(for db, [ol_cv_ndbm], [
756 if test $ol_cv_lib_ndbm = no -o $ac_cv_header_ndbm_h = no ; then
762 if test $ol_cv_ndbm = yes ; then
763 AC_DEFINE(HAVE_NDBM,1, [define if NDBM is available])
767 dnl ====================================================================
768 dnl Check POSIX Thread version
770 dnl defines ol_cv_pthread_version to 4, 5, 6, 7, 8, 10, depending on the
771 dnl version of the POSIX.4a Draft that is implemented.
772 dnl 10 == POSIX.4a Final == POSIX.1c-1996 for our purposes.
773 dnl Existence of pthread.h should be tested separately.
776 dnl pthread_detach() was dropped in Draft 8, it is present
777 dnl in every other version
778 dnl PTHREAD_CREATE_UNDETACHED is only in Draft 7, it was called
779 dnl PTHREAD_CREATE_JOINABLE after that
780 dnl pthread_attr_create was renamed to pthread_attr_init in Draft 6.
781 dnl Draft 6-10 has _init, Draft 4-5 has _create.
782 dnl pthread_attr_default was dropped in Draft 6, only 4 and 5 have it
783 dnl PTHREAD_MUTEX_INITIALIZER was introduced in Draft 5. It's not
784 dnl interesting to us because we don't try to statically
785 dnl initialize mutexes. 5-10 has it.
787 dnl Draft 9 and 10 are equivalent for our purposes.
789 AC_DEFUN([OL_POSIX_THREAD_VERSION],
790 [AC_CACHE_CHECK([POSIX thread version],[ol_cv_pthread_version],[
792 # include <pthread.h>
794 int i = PTHREAD_CREATE_JOINABLE;
796 AC_EGREP_HEADER(pthread_detach,pthread.h,
797 ol_cv_pthread_version=10, ol_cv_pthread_version=8)],[
798 AC_EGREP_CPP(draft7,[
799 # include <pthread.h>
800 # ifdef PTHREAD_CREATE_UNDETACHED
803 ], ol_cv_pthread_version=7, [
804 AC_EGREP_HEADER(pthread_attr_init,pthread.h,
805 ol_cv_pthread_version=6, [
806 AC_EGREP_CPP(draft5,[
807 # include <pthread.h>
808 #ifdef PTHREAD_MUTEX_INITIALIZER
811 ], ol_cv_pthread_version=5, ol_cv_pthread_version=4) ]) ]) ])
815 dnl --------------------------------------------------------------------
816 AC_DEFUN([OL_PTHREAD_TEST_INCLUDES],
817 [/* pthread test headers */
819 #if HAVE_PTHREADS < 7
823 #define NULL (void*)0
829 return (void *) (p == NULL);
832 AC_DEFUN([OL_PTHREAD_TEST_FUNCTION],[
833 /* pthread test function */
834 #ifndef PTHREAD_CREATE_DETACHED
835 #define PTHREAD_CREATE_DETACHED 1
839 int detach = PTHREAD_CREATE_DETACHED;
841 #if HAVE_PTHREADS > 4
845 status = pthread_attr_init(&attr);
846 if( status ) return status;
848 #if HAVE_PTHREADS < 7
849 status = pthread_attr_setdetachstate(&attr, &detach);
850 if( status < 0 ) status = errno;
852 status = pthread_attr_setdetachstate(&attr, detach);
854 if( status ) return status;
855 status = pthread_create( &t, &attr, task, NULL );
856 #if HAVE_PTHREADS < 7
857 if( status < 0 ) status = errno;
859 if( status ) return status;
861 /* Draft 4 pthreads */
862 status = pthread_create( &t, pthread_attr_default, task, NULL );
863 if( status ) return errno;
865 /* give thread a chance to complete */
866 /* it should remain joinable and hence detachable */
869 status = pthread_detach( &t );
870 if( status ) return errno;
873 #ifdef HAVE_LINUX_THREADS
874 pthread_kill_other_threads_np();
880 AC_DEFUN([OL_PTHREAD_TEST_PROGRAM],
881 [OL_PTHREAD_TEST_INCLUDES
887 OL_PTHREAD_TEST_FUNCTION
890 dnl --------------------------------------------------------------------
891 AC_DEFUN([OL_PTHREAD_TRY], [# Pthread try link: $1 ($2)
892 if test "$ol_link_threads" = no ; then
894 AC_CACHE_CHECK([for pthread link with $1], [$2], [
899 AC_TRY_RUN(OL_PTHREAD_TEST_PROGRAM,
901 [AC_TRY_LINK(OL_PTHREAD_TEST_INCLUDES,OL_PTHREAD_TEST_FUNCTION,
908 if test $$2 = yes ; then
909 ol_link_pthreads="$1"
910 ol_link_threads=posix
915 dnl ====================================================================
916 dnl Check GNU Pth pthread Header
918 dnl defines ol_cv_header linux_threads to 'yes' or 'no'
919 dnl 'no' implies pthreads.h is not LinuxThreads or pthreads.h
920 dnl doesn't exists. Existance of pthread.h should separately
923 AC_DEFUN([OL_HEADER_GNU_PTH_PTHREAD_H], [
924 AC_CACHE_CHECK([for GNU Pth pthread.h],
925 [ol_cv_header_gnu_pth_pthread_h],
926 [AC_EGREP_CPP(__gnu_pth__,
927 [#include <pthread.h>
928 #ifdef _POSIX_THREAD_IS_GNU_PTH
932 [ol_cv_header_gnu_pth_pthread_h=yes],
933 [ol_cv_header_gnu_pth_pthread_h=no])
936 dnl ====================================================================
937 dnl Check for NT Threads
938 AC_DEFUN([OL_NT_THREADS], [
939 AC_CHECK_FUNC(_beginthread)
941 if test $ac_cv_func__beginthread = yes ; then
942 AC_DEFINE(HAVE_NT_THREADS,1,[if you have NT Threads])
946 dnl ====================================================================
947 dnl Check LinuxThreads Header
949 dnl defines ol_cv_header linux_threads to 'yes' or 'no'
950 dnl 'no' implies pthreads.h is not LinuxThreads or pthreads.h
951 dnl doesn't exists. Existance of pthread.h should separately
954 AC_DEFUN([OL_HEADER_LINUX_THREADS], [
955 AC_CACHE_CHECK([for LinuxThreads pthread.h],
956 [ol_cv_header_linux_threads],
957 [AC_EGREP_CPP(pthread_kill_other_threads_np,
958 [#include <pthread.h>],
959 [ol_cv_header_linux_threads=yes],
960 [ol_cv_header_linux_threads=no])
962 if test $ol_cv_header_linux_threads = yes; then
963 AC_DEFINE(HAVE_LINUX_THREADS,1,[if you have LinuxThreads])
966 dnl --------------------------------------------------------------------
967 dnl Check LinuxThreads Implementation
969 dnl defines ol_cv_sys_linux_threads to 'yes' or 'no'
970 dnl 'no' implies pthreads implementation is not LinuxThreads.
972 AC_DEFUN([OL_SYS_LINUX_THREADS], [
973 AC_CHECK_FUNCS(pthread_kill_other_threads_np)
974 AC_CACHE_CHECK([for LinuxThreads implementation],
975 [ol_cv_sys_linux_threads],
976 [ol_cv_sys_linux_threads=$ac_cv_func_pthread_kill_other_threads_np])
979 dnl --------------------------------------------------------------------
980 dnl Check LinuxThreads consistency
981 AC_DEFUN([OL_LINUX_THREADS], [
982 AC_REQUIRE([OL_HEADER_LINUX_THREADS])
983 AC_REQUIRE([OL_SYS_LINUX_THREADS])
984 AC_CACHE_CHECK([for LinuxThreads consistency], [ol_cv_linux_threads], [
985 if test $ol_cv_header_linux_threads = yes -a \
986 $ol_cv_sys_linux_threads = yes; then
987 ol_cv_linux_threads=yes
988 elif test $ol_cv_header_linux_threads = no -a \
989 $ol_cv_sys_linux_threads = no; then
990 ol_cv_linux_threads=no
992 ol_cv_linux_threads=error
997 dnl ====================================================================
998 dnl Check for POSIX Regex
999 AC_DEFUN([OL_POSIX_REGEX], [
1000 AC_CACHE_CHECK([for compatible POSIX regex],ol_cv_c_posix_regex,[
1002 #include <sys/types.h>
1004 static char *pattern, *string;
1012 if(regcomp(&re, pattern, 0)) {
1016 string = "ALL MATCH";
1018 rc = regexec(&re, string, 0, (void*)0, 0);
1024 [ol_cv_c_posix_regex=yes],
1025 [ol_cv_c_posix_regex=no],
1026 [ol_cv_c_posix_regex=cross])])
1029 dnl ====================================================================
1030 dnl Check if toupper() requires islower() to be called first
1031 AC_DEFUN([OL_C_UPPER_LOWER],
1032 [AC_CACHE_CHECK([if toupper() requires islower()],ol_cv_c_upper_lower,[
1037 if ('C' == toupper('C'))
1042 [ol_cv_c_upper_lower=no],
1043 [ol_cv_c_upper_lower=yes],
1044 [ol_cv_c_upper_lower=safe])])
1045 if test $ol_cv_c_upper_lower != no ; then
1046 AC_DEFINE(C_UPPER_LOWER,1, [define if toupper() requires islower()])
1050 dnl ====================================================================
1051 dnl Error string checks
1053 dnl Check for declaration of sys_errlist in one of stdio.h and errno.h.
1054 dnl Declaration of sys_errlist on BSD4.4 interferes with our declaration.
1055 dnl Reported by Keith Bostic.
1056 AC_DEFUN([OL_SYS_ERRLIST],
1057 [AC_CACHE_CHECK([declaration of sys_errlist],ol_cv_dcl_sys_errlist,[
1060 #include <sys/types.h>
1065 [char *c = (char *) *sys_errlist],
1066 [ol_cv_dcl_sys_errlist=yes
1067 ol_cv_have_sys_errlist=yes],
1068 [ol_cv_dcl_sys_errlist=no])])
1070 # It's possible (for near-UNIX clones) that sys_errlist doesn't exist
1071 if test $ol_cv_dcl_sys_errlist = no ; then
1072 AC_DEFINE(DECL_SYS_ERRLIST,1,
1073 [define if sys_errlist is not declared in stdio.h or errno.h])
1075 AC_CACHE_CHECK([existence of sys_errlist],ol_cv_have_sys_errlist,[
1076 AC_TRY_LINK([#include <errno.h>],
1077 [char *c = (char *) *sys_errlist],
1078 [ol_cv_have_sys_errlist=yes],
1079 [ol_cv_have_sys_errlist=no])])
1081 if test $ol_cv_have_sys_errlist = yes ; then
1082 AC_DEFINE(HAVE_SYS_ERRLIST,1,
1083 [define if you actually have sys_errlist in your libs])
1086 AC_DEFUN([OL_NONPOSIX_STRERROR_R],
1087 [AC_CACHE_CHECK([non-posix strerror_r],ol_cv_nonposix_strerror_r,[
1088 AC_EGREP_CPP(strerror_r,[#include <string.h>],
1089 ol_decl_strerror_r=yes, ol_decl_strerror_r=no)dnl
1091 if test $ol_decl_strerror_r = yes ; then
1092 AC_TRY_COMPILE([#include <string.h>],
1093 [ /* from autoconf 2.59 */
1095 char x = *strerror_r (0, buf, sizeof buf);
1096 char *p = strerror_r (0, buf, sizeof buf);
1097 ], ol_cv_nonposix_strerror_r=yes, ol_cv_nonposix_strerror_r=no)
1103 strerror_r( 1, buf, sizeof buf );
1104 exit( buf[0] == 0 );
1106 ], ol_cv_nonposix_strerror_r=yes, ol_cv_nonposix_strerror=no, ol_cv_nonposix_strerror=no)
1109 if test $ol_cv_nonposix_strerror_r = yes ; then
1110 AC_DEFINE(HAVE_NONPOSIX_STRERROR_R,1,
1111 [define if strerror_r returns char* instead of int])
1115 AC_DEFUN([OL_STRERROR],
1116 [OL_SYS_ERRLIST dnl TEMPORARY
1117 AC_CHECK_FUNCS(strerror strerror_r)
1118 ol_cv_func_strerror_r=no
1119 if test "${ac_cv_func_strerror_r}" = yes ; then
1120 OL_NONPOSIX_STRERROR_R
1121 elif test "${ac_cv_func_strerror}" = no ; then
1125 dnl ====================================================================
1126 dnl Early MIPS compilers (used in Ultrix 4.2) don't like
1127 dnl "int x; int *volatile a = &x; *a = 0;"
1128 dnl -- borrowed from PDKSH
1129 AC_DEFUN(OL_C_VOLATILE,
1130 [AC_CACHE_CHECK(if compiler understands volatile, ol_cv_c_volatile,
1131 [AC_TRY_COMPILE([int x, y, z;],
1132 [volatile int a; int * volatile b = x ? &y : &z;
1133 /* Older MIPS compilers (eg., in Ultrix 4.2) don't like *b = 0 */
1134 *b = 0;], ol_cv_c_volatile=yes, ol_cv_c_volatile=no)])
1135 if test $ol_cv_c_volatile = yes; then
1138 AC_DEFINE(volatile,,[define as empty if volatile is not supported])
1142 dnl ====================================================================
1143 dnl Look for fetch(3)
1144 AC_DEFUN([OL_LIB_FETCH],
1146 LIBS="-lfetch -lcom_err $LIBS"
1147 AC_CACHE_CHECK([fetch(3) library],ol_cv_lib_fetch,[
1149 #include <sys/param.h>
1151 #include <fetch.h>],
1152 [struct url *u = fetchParseURL("file:///"); ],
1153 [ol_cv_lib_fetch=yes],
1154 [ol_cv_lib_fetch=no])])
1156 if test $ol_cv_lib_fetch != no ; then
1157 ol_link_fetch="-lfetch -lcom_err"
1158 AC_DEFINE(HAVE_FETCH,1,
1159 [define if you actually have FreeBSD fetch(3)])
1163 dnl ====================================================================
1164 dnl Define sig_atomic_t if not defined in signal.h
1165 AC_DEFUN(OL_TYPE_SIG_ATOMIC_T,
1166 [AC_CACHE_CHECK(for sig_atomic_t, ol_cv_type_sig_atomic_t,
1167 [AC_TRY_COMPILE([#include <signal.h>], [sig_atomic_t atomic;],
1168 ol_cv_type_sig_atomic_t=yes, ol_cv_type_sig_atomic_t=no)])
1169 if test $ol_cv_type_sig_atomic_t = no; then
1170 AC_DEFINE(sig_atomic_t,int,
1171 [define to atomic type if sig_atomic_t is not available])
1175 dnl ====================================================================
1176 dnl Define socklen_t if not defined in sys/types.h or sys/socket.h
1177 AC_DEFUN(OL_TYPE_SOCKLEN_T,
1178 [AC_CACHE_CHECK(for socklen_t, ol_cv_type_socklen_t,
1180 #ifdef HAVE_SYS_TYPES_H
1181 #include <sys/types.h>
1183 #ifdef HAVE_SYS_SOCKET_H
1184 #include <sys/socket.h>
1186 ], [socklen_t len;],
1187 ol_cv_type_socklen_t=yes, ol_cv_type_socklen_t=no)])
1188 if test $ol_cv_type_socklen_t = no; then
1189 AC_DEFINE(socklen_t, int,
1190 [define to int if socklen_t is not available])
1194 dnl ====================================================================
1195 dnl Define inet_aton is available
1196 AC_DEFUN(OL_FUNC_INET_ATON,
1197 [AC_CACHE_CHECK([for inet_aton()], ol_cv_func_inet_aton,
1199 #ifdef HAVE_SYS_TYPES_H
1200 # include <sys/types.h>
1202 #ifdef HAVE_SYS_SOCKET_H
1203 # include <sys/socket.h>
1204 # ifdef HAVE_SYS_SELECT_H
1205 # include <sys/select.h>
1207 # include <netinet/in.h>
1208 # ifdef HAVE_ARPA_INET_H
1209 # include <arpa/inet.h>
1212 ], [struct in_addr in;
1213 int rc = inet_aton( "255.255.255.255", &in );],
1214 ol_cv_func_inet_aton=yes, ol_cv_func_inet_aton=no)])
1215 if test $ol_cv_func_inet_aton != no; then
1216 AC_DEFINE(HAVE_INET_ATON, 1,
1217 [define to you inet_aton(3) is available])
1221 dnl ====================================================================
1222 dnl check no of arguments for ctime_r
1223 AC_DEFUN(OL_FUNC_CTIME_R_NARGS,
1224 [AC_CACHE_CHECK(number of arguments of ctime_r, ol_cv_func_ctime_r_nargs,
1225 [AC_TRY_COMPILE([#include <time.h>],
1226 [time_t ti; char *buffer; ctime_r(&ti,buffer,32);],
1227 ol_cv_func_ctime_r_nargs3=yes,
1228 ol_cv_func_ctime_r_nargs3=no)
1230 AC_TRY_COMPILE([#include <time.h>],
1231 [time_t ti; char *buffer; ctime_r(&ti,buffer);],
1232 ol_cv_func_ctime_r_nargs2=yes,
1233 ol_cv_func_ctime_r_nargs2=no)
1235 if test $ol_cv_func_ctime_r_nargs3 = yes -a \
1236 $ol_cv_func_ctime_r_nargs2 = no ; then
1238 ol_cv_func_ctime_r_nargs=3
1240 elif test $ol_cv_func_ctime_r_nargs3 = no -a \
1241 $ol_cv_func_ctime_r_nargs2 = yes ; then
1243 ol_cv_func_ctime_r_nargs=2
1246 ol_cv_func_ctime_r_nargs=0
1250 if test $ol_cv_func_ctime_r_nargs -gt 1 ; then
1251 AC_DEFINE_UNQUOTED(CTIME_R_NARGS, $ol_cv_func_ctime_r_nargs,
1252 [set to the number of arguments ctime_r() expects])
1256 dnl --------------------------------------------------------------------
1257 dnl check return type of ctime_r()
1258 AC_DEFUN(OL_FUNC_CTIME_R_TYPE,
1259 [AC_CACHE_CHECK(return type of ctime_r, ol_cv_func_ctime_r_type,
1260 [AC_TRY_COMPILE([#include <time.h>],
1261 [extern int (ctime_r)();],
1262 ol_cv_func_ctime_r_type="int", ol_cv_func_ctime_r_type="charp")
1264 if test $ol_cv_func_ctime_r_type = "int" ; then
1265 AC_DEFINE(CTIME_R_RETURNS_INT,1, [define if ctime_r() returns int])
1268 dnl ====================================================================
1269 dnl check no of arguments for gethostbyname_r
1270 AC_DEFUN(OL_FUNC_GETHOSTBYNAME_R_NARGS,
1271 [AC_CACHE_CHECK(number of arguments of gethostbyname_r,
1272 ol_cv_func_gethostbyname_r_nargs,
1273 [AC_TRY_COMPILE([#include <sys/types.h>
1274 #include <sys/socket.h>
1275 #include <netinet/in.h>
1277 #define BUFSIZE (sizeof(struct hostent)+10)],
1278 [struct hostent hent; char buffer[BUFSIZE];
1279 int bufsize=BUFSIZE;int h_errno;
1280 (void)gethostbyname_r("segovia.cs.purdue.edu", &hent,
1281 buffer, bufsize, &h_errno);],
1282 ol_cv_func_gethostbyname_r_nargs5=yes,
1283 ol_cv_func_gethostbyname_r_nargs5=no)
1285 AC_TRY_COMPILE([#include <sys/types.h>
1286 #include <sys/socket.h>
1287 #include <netinet/in.h>
1289 #define BUFSIZE (sizeof(struct hostent)+10)],
1290 [struct hostent hent;struct hostent *rhent;
1291 char buffer[BUFSIZE];
1292 int bufsize=BUFSIZE;int h_errno;
1293 (void)gethostbyname_r("localhost", &hent, buffer, bufsize,
1294 &rhent, &h_errno);],
1295 ol_cv_func_gethostbyname_r_nargs6=yes,
1296 ol_cv_func_gethostbyname_r_nargs6=no)
1298 if test $ol_cv_func_gethostbyname_r_nargs5 = yes -a \
1299 $ol_cv_func_gethostbyname_r_nargs6 = no ; then
1301 ol_cv_func_gethostbyname_r_nargs=5
1303 elif test $ol_cv_func_gethostbyname_r_nargs5 = no -a \
1304 $ol_cv_func_gethostbyname_r_nargs6 = yes ; then
1306 ol_cv_func_gethostbyname_r_nargs=6
1309 ol_cv_func_gethostbyname_r_nargs=0
1312 if test $ol_cv_func_gethostbyname_r_nargs -gt 1 ; then
1313 AC_DEFINE_UNQUOTED(GETHOSTBYNAME_R_NARGS,
1314 $ol_cv_func_gethostbyname_r_nargs,
1315 [set to the number of arguments gethostbyname_r() expects])
1319 dnl check no of arguments for gethostbyaddr_r
1320 AC_DEFUN(OL_FUNC_GETHOSTBYADDR_R_NARGS,
1321 [AC_CACHE_CHECK(number of arguments of gethostbyaddr_r,
1322 [ol_cv_func_gethostbyaddr_r_nargs],
1323 [AC_TRY_COMPILE([#include <sys/types.h>
1324 #include <sys/socket.h>
1325 #include <netinet/in.h>
1327 #define BUFSIZE (sizeof(struct hostent)+10)],
1328 [struct hostent hent; char buffer[BUFSIZE];
1330 size_t alen=sizeof(struct in_addr);
1331 int bufsize=BUFSIZE;int h_errno;
1332 (void)gethostbyaddr_r( (void *)&(add.s_addr),
1333 alen, AF_INET, &hent, buffer, bufsize, &h_errno);],
1334 ol_cv_func_gethostbyaddr_r_nargs7=yes,
1335 ol_cv_func_gethostbyaddr_r_nargs7=no)
1337 AC_TRY_COMPILE([#include <sys/types.h>
1338 #include <sys/socket.h>
1339 #include <netinet/in.h>
1341 #define BUFSIZE (sizeof(struct hostent)+10)],
1342 [struct hostent hent;
1343 struct hostent *rhent; char buffer[BUFSIZE];
1345 size_t alen=sizeof(struct in_addr);
1346 int bufsize=BUFSIZE;int h_errno;
1347 (void)gethostbyaddr_r( (void *)&(add.s_addr),
1348 alen, AF_INET, &hent, buffer, bufsize,
1349 &rhent, &h_errno);],
1350 ol_cv_func_gethostbyaddr_r_nargs8=yes,
1351 ol_cv_func_gethostbyaddr_r_nargs8=no)
1353 if test $ol_cv_func_gethostbyaddr_r_nargs7 = yes -a \
1354 $ol_cv_func_gethostbyaddr_r_nargs8 = no ; then
1356 ol_cv_func_gethostbyaddr_r_nargs=7
1358 elif test $ol_cv_func_gethostbyaddr_r_nargs7 = no -a \
1359 $ol_cv_func_gethostbyaddr_r_nargs8 = yes ; then
1361 ol_cv_func_gethostbyaddr_r_nargs=8
1364 ol_cv_func_gethostbyaddr_r_nargs=0
1367 if test $ol_cv_func_gethostbyaddr_r_nargs -gt 1 ; then
1368 AC_DEFINE_UNQUOTED(GETHOSTBYADDR_R_NARGS,
1369 $ol_cv_func_gethostbyaddr_r_nargs,
1370 [set to the number of arguments gethostbyaddr_r() expects])
1374 dnl --------------------------------------------------------------------
1375 dnl Check for Cyrus SASL version compatility
1376 AC_DEFUN([OL_SASL_COMPAT],
1377 [AC_CACHE_CHECK([Cyrus SASL library version], [ol_cv_sasl_compat],[
1378 AC_EGREP_CPP(__sasl_compat,[
1379 #ifdef HAVE_SASL_SASL_H
1380 #include <sasl/sasl.h>
1385 /* Require 2.1.15+ */
1386 #if SASL_VERSION_MAJOR == 2 && SASL_VERSION_MINOR > 1
1387 char *__sasl_compat = "2.2+ or better okay (we guess)";
1388 #elif SASL_VERSION_MAJOR == 2 && SASL_VERSION_MINOR == 1 \
1389 && SASL_VERSION_STEP >=15
1390 char *__sasl_compat = "2.1.15+ or better okay";
1392 ], [ol_cv_sasl_compat=yes], [ol_cv_sasl_compat=no])])
1394 dnl ====================================================================
1395 dnl check for msg_accrights in msghdr
1396 AC_DEFUN(OL_MSGHDR_MSG_ACCRIGHTS,
1397 [AC_CACHE_CHECK(for msg_accrights in msghdr, ol_cv_msghdr_msg_accrights,
1398 [AC_TRY_COMPILE([#include <sys/socket.h>],
1399 [struct msghdr m; m.msg_accrightslen=0],
1400 ol_cv_msghdr_msg_accrights=yes, ol_cv_msghdr_msg_accrights=no)
1402 if test $ol_cv_msghdr_msg_accrights = "yes" ; then
1403 AC_DEFINE(HAVE_MSGHDR_MSG_ACCRIGHTS,1,
1404 [define if struct msghdr has msg_accrights])
1407 dnl ====================================================================
1408 dnl check for cmsghdr
1409 AC_DEFUN(OL_MSGHDR_MSG_CONTROL,
1410 [AC_CACHE_CHECK(for msg_control in msghdr, ol_cv_msghdr_msg_control,
1411 [AC_TRY_COMPILE([#include <sys/socket.h>],
1412 [struct msghdr m; m.msg_control=(struct cmsghdr *)0],
1413 ol_cv_msghdr_msg_control=yes, ol_cv_msghdr_msg_control=no)
1415 if test $ol_cv_msghdr_msg_control = "yes" ; then
1416 AC_DEFINE(HAVE_MSGHDR_MSG_CONTROL,1,
1417 [define if struct msghdr has msg_control])
1420 AC_DEFUN([OL_SSL_COMPAT],
1421 [AC_CACHE_CHECK([OpenSSL library version (CRL checking capability)], [ol_cv_ssl_crl_compat],[
1422 AC_EGREP_CPP(__ssl_compat,[
1423 #ifdef HAVE_OPENSSL_SSL_H
1424 #include <openssl/ssl.h>
1429 /* Require 0.9.7d+ */
1430 #if OPENSSL_VERSION_NUMBER >= 0x0090704fL
1431 char *__ssl_compat = "0.9.7d";
1433 ], [ol_cv_ssl_crl_compat=yes], [ol_cv_ssl_crl_compat=no])])