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_MSG_RESULT([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_MSG_RESULT([OpenLDAP --with-$1 $ol_with_$1])
67 dnl ====================================================================
68 dnl check if hard links are supported.
70 AC_DEFUN([OL_PROG_LN_H], [# test for ln hardlink support
71 AC_MSG_CHECKING(whether ln works)
72 AC_CACHE_VAL(ol_cv_prog_LN_H,
73 [rm -f conftest.src conftest.dst
74 echo "conftest" > conftest.src
75 if ln conftest.src conftest.dst 2>/dev/null
81 rm -f conftest.src conftest.dst
83 LN_H="$ol_cv_prog_LN_H"
84 if test "$ol_cv_prog_LN_H" = "ln"; then
92 dnl ====================================================================
93 dnl Check for dependency generation flag
94 AC_DEFUN([OL_MKDEPEND], [# test for make depend flag
97 if test -z "${MKDEP}"; then
99 if test -z "${MKDEP_FLAGS}"; then
100 AC_CACHE_CHECK([for ${OL_MKDEP} depend flag], ol_cv_mkdep, [
102 for flag in "-M" "-xM"; do
103 cat > conftest.c <<EOF
106 if AC_TRY_COMMAND($OL_MKDEP $flag conftest.c) \
107 | egrep '^conftest\.'"${ac_objext}" >/dev/null 2>&1
109 if test ! -f conftest."${ac_object}" ; then
111 OL_MKDEP_FLAGS="$flag"
120 OL_MKDEP_FLAGS="${MKDEP_FLAGS}"
125 OL_MKDEP_FLAGS="${MKDEP_FLAGS}"
128 AC_SUBST(OL_MKDEP_FLAGS)
131 dnl ====================================================================
132 dnl Check if system uses EBCDIC instead of ASCII
133 AC_DEFUN([OL_CPP_EBCDIC], [# test for EBCDIC
134 AC_CACHE_CHECK([for EBCDIC],ol_cv_cpp_ebcdic,[
135 AC_PREPROC_IFELSE([AC_LANG_SOURCE([[
137 #include <__ASCII__/generate_error.h>
139 ]])],[ol_cv_cpp_ebcdic=yes],[ol_cv_cpp_ebcdic=no])])
140 if test $ol_cv_cpp_ebcdic = yes ; then
141 AC_DEFINE(HAVE_EBCDIC,1, [define if system uses EBCDIC instead of ASCII])
145 dnl --------------------------------------------------------------------
146 dnl OpenLDAP version of STDC header check w/ EBCDIC support
147 AC_DEFUN([OL_HEADER_STDC],
149 AC_REQUIRE([OL_CPP_EBCDIC])dnl
150 AC_CACHE_CHECK([for ANSI C header files], ol_cv_header_stdc,
151 [AC_PREPROC_IFELSE([AC_LANG_SOURCE([[#include <stdlib.h>
154 #include <float.h>]])],[ol_cv_header_stdc=yes],[ol_cv_header_stdc=no])
156 if test $ol_cv_header_stdc = yes; then
157 # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
158 AC_EGREP_HEADER(memchr, string.h, , ol_cv_header_stdc=no)
161 if test $ol_cv_header_stdc = yes; then
162 # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
163 AC_EGREP_HEADER(free, stdlib.h, , ol_cv_header_stdc=no)
166 if test $ol_cv_header_stdc = yes; then
167 # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
168 AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <ctype.h>
170 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
171 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
173 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
174 || ('j' <= (c) && (c) <= 'r') \
175 || ('s' <= (c) && (c) <= 'z'))
176 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
178 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
179 int main () { int i; for (i = 0; i < 256; i++)
180 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
182 ]])],[],[ol_cv_header_stdc=no],[:])
184 if test $ol_cv_header_stdc = yes; then
185 AC_DEFINE(STDC_HEADERS)
187 ac_cv_header_stdc=disable
190 dnl ====================================================================
191 dnl Check if struct passwd has pw_gecos
192 AC_DEFUN([OL_STRUCT_PASSWD_PW_GECOS], [# test for pw_gecos in struct passwd
193 AC_CACHE_CHECK([struct passwd for pw_gecos],ol_cv_struct_passwd_pw_gecos,[
194 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <pwd.h>]], [[
196 pwd.pw_gecos = pwd.pw_name;
197 ]])],[ol_cv_struct_passwd_pw_gecos=yes],[ol_cv_struct_passwd_pw_gecos=no])])
198 if test $ol_cv_struct_passwd_pw_gecos = yes ; then
199 AC_DEFINE(HAVE_PW_GECOS,1, [define if struct passwd has pw_gecos])
203 dnl --------------------------------------------------------------------
204 dnl Check if struct passwd has pw_passwd
205 AC_DEFUN([OL_STRUCT_PASSWD_PW_PASSWD], [# test for pw_passwd in struct passwd
206 AC_CACHE_CHECK([struct passwd for pw_passwd],ol_cv_struct_passwd_pw_passwd,[
207 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <pwd.h>]], [[
209 pwd.pw_passwd = pwd.pw_name;
210 ]])],[ol_cv_struct_passwd_pw_passwd=yes],[ol_cv_struct_passwd_pw_passwd=no])])
211 if test $ol_cv_struct_passwd_pw_passwd = yes ; then
212 AC_DEFINE(HAVE_PW_PASSWD,1, [define if struct passwd has pw_passwd])
216 dnl ====================================================================
217 dnl DNS resolver macros
218 AC_DEFUN([OL_RESOLVER_TRY],
219 [if test $ol_cv_lib_resolver = no ; then
220 AC_CACHE_CHECK([for resolver link (]ifelse($2,,default,$2)[)],[$1],
222 ol_RESOLVER_LIB=ifelse($2,,,$2)
224 LIBS="$ol_RESOLVER_LIB $LIBS"
226 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
227 #ifdef HAVE_SYS_TYPES_H
228 # include <sys/types.h>
230 #include <netinet/in.h>
231 #ifdef HAVE_ARPA_NAMESER_H
232 # include <arpa/nameser.h>
239 char *request = NULL;
240 unsigned char reply[64*1024];
241 unsigned char host[64*1024];
245 /* Bind 8/9 interface */
246 len = res_query(request, ns_c_in, ns_t_srv, reply, sizeof(reply));
248 /* Bind 4 interface */
252 len = res_query(request, C_IN, T_SRV, reply, sizeof(reply));
256 /* Bind 8/9 interface */
258 #elif defined(HFIXEDSZ)
259 /* Bind 4 interface w/ HFIXEDSZ */
262 /* Bind 4 interface w/o HFIXEDSZ */
265 status = dn_expand( reply, reply+len, p, host, sizeof(host));
266 }]])],[$1=yes],[$1=no])
271 if test $$1 = yes ; then
272 ol_cv_lib_resolver=ifelse($2,,yes,$2)
276 dnl --------------------------------------------------------------------
277 dnl Try to locate appropriate library
278 AC_DEFUN([OL_RESOLVER_LINK],
279 [ol_cv_lib_resolver=no
280 OL_RESOLVER_TRY(ol_cv_resolver_none)
281 OL_RESOLVER_TRY(ol_cv_resolver_resolv,[-lresolv])
282 OL_RESOLVER_TRY(ol_cv_resolver_bind,[-lbind])
285 dnl ====================================================================
286 dnl Berkeley DB macros
288 dnl --------------------------------------------------------------------
290 AC_DEFUN([OL_BERKELEY_DB_TRY],
291 [if test $ol_cv_lib_db = no ; then
292 AC_CACHE_CHECK([for Berkeley DB link (]ifelse($2,,default,$2)[)],[$1],
294 ol_DB_LIB=ifelse($2,,,$2)
296 LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
298 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
305 #ifndef DB_VERSION_MAJOR
306 # define DB_VERSION_MAJOR 1
310 #define NULL ((void*)0)
313 #if DB_VERSION_MAJOR > 1
316 int major, minor, patch;
318 version = db_version( &major, &minor, &patch );
320 if( major != DB_VERSION_MAJOR ||
321 minor < DB_VERSION_MINOR )
323 printf("Berkeley DB version mismatch\n"
324 "\theader: %s\n\tlibrary: %s\n",
325 DB_VERSION_STRING, version);
331 #if DB_VERSION_MAJOR > 2
332 db_env_create( NULL, 0 );
333 #elif DB_VERSION_MAJOR > 1
336 (void) dbopen( NULL, 0, 0, 0, NULL);
338 ]])],[$1=yes],[$1=no])
343 if test $$1 = yes ; then
344 ol_cv_lib_db=ifelse($2,,yes,$2)
349 dnl --------------------------------------------------------------------
350 dnl Try to locate appropriate library
351 AC_DEFUN([OL_BERKELEY_DB_LINK],
353 OL_BERKELEY_DB_TRY(ol_cv_db_none)
354 OL_BERKELEY_DB_TRY(ol_cv_db_db43,[-ldb43])
355 OL_BERKELEY_DB_TRY(ol_cv_db_db_43,[-ldb-43])
356 OL_BERKELEY_DB_TRY(ol_cv_db_db_4_dot_3,[-ldb-4.3])
357 OL_BERKELEY_DB_TRY(ol_cv_db_db_4_3,[-ldb-4-3])
358 OL_BERKELEY_DB_TRY(ol_cv_db_db42,[-ldb42])
359 OL_BERKELEY_DB_TRY(ol_cv_db_db_42,[-ldb-42])
360 OL_BERKELEY_DB_TRY(ol_cv_db_db_4_dot_2,[-ldb-4.2])
361 OL_BERKELEY_DB_TRY(ol_cv_db_db_4_2,[-ldb-4-2])
362 OL_BERKELEY_DB_TRY(ol_cv_db_db_4,[-ldb-4])
363 OL_BERKELEY_DB_TRY(ol_cv_db_db4,[-ldb4])
364 OL_BERKELEY_DB_TRY(ol_cv_db_db,[-ldb])
365 OL_BERKELEY_DB_TRY(ol_cv_db_db41,[-ldb41])
366 OL_BERKELEY_DB_TRY(ol_cv_db_db_41,[-ldb-41])
367 OL_BERKELEY_DB_TRY(ol_cv_db_db_4_dot_1,[-ldb-4.1])
368 OL_BERKELEY_DB_TRY(ol_cv_db_db_4_1,[-ldb-4-1])
369 OL_BERKELEY_DB_TRY(ol_cv_db_db3,[-ldb3])
370 OL_BERKELEY_DB_TRY(ol_cv_db_db_3,[-ldb-3])
371 OL_BERKELEY_DB_TRY(ol_cv_db_db2,[-ldb2])
372 OL_BERKELEY_DB_TRY(ol_cv_db_db_2,[-ldb-2])
373 OL_BERKELEY_DB_TRY(ol_cv_db_db1,[-ldb1])
374 OL_BERKELEY_DB_TRY(ol_cv_db_db_1,[-ldb-1])
377 dnl --------------------------------------------------------------------
378 dnl Check if Berkeley DB version
379 AC_DEFUN([OL_BERKELEY_DB_VERSION],
380 [AC_CACHE_CHECK([for Berkeley DB version match], [ol_cv_berkeley_db_version], [
382 LIBS="$LTHREAD_LIBS $LIBS"
383 if test $ol_cv_lib_db != yes ; then
384 LIBS="$ol_cv_lib_db $LIBS"
387 AC_RUN_IFELSE([AC_LANG_SOURCE([[
393 #ifndef DB_VERSION_MAJOR
394 # define DB_VERSION_MAJOR 1
397 #define NULL ((void *)0)
401 #if DB_VERSION_MAJOR > 1
403 int major, minor, patch;
405 version = db_version( &major, &minor, &patch );
407 if( major != DB_VERSION_MAJOR ||
408 minor != DB_VERSION_MINOR ||
409 patch != DB_VERSION_PATCH )
411 printf("Berkeley DB version mismatch\n"
412 "\theader: %s\n\tlibrary: %s\n",
413 DB_VERSION_STRING, version);
419 }]])],[ol_cv_berkeley_db_version=yes],[ol_cv_berkeley_db_version=no],[ol_cv_berkeley_db_version=cross])
424 if test $ol_cv_berkeley_db_version = no ; then
425 AC_MSG_ERROR([Berkeley DB version mismatch])
429 dnl --------------------------------------------------------------------
430 dnl Check if Berkeley DB supports DB_THREAD
431 AC_DEFUN([OL_BERKELEY_DB_THREAD],
432 [AC_CACHE_CHECK([for Berkeley DB thread support], [ol_cv_berkeley_db_thread], [
434 LIBS="$LTHREAD_LIBS $LIBS"
435 if test $ol_cv_lib_db != yes ; then
436 LIBS="$ol_cv_lib_db $LIBS"
439 AC_RUN_IFELSE([AC_LANG_SOURCE([[
446 #define NULL ((void *)0)
451 u_int32_t flags = DB_CREATE |
457 #if DB_VERSION_MAJOR > 2
460 rc = db_env_create( &env, 0 );
462 flags |= DB_INIT_MPOOL;
463 #ifdef DB_MPOOL_PRIVATE
464 flags |= DB_MPOOL_PRIVATE;
468 printf("BerkeleyDB: %s\n", db_strerror(rc) );
472 #if (DB_VERSION_MAJOR > 3) || (DB_VERSION_MINOR >= 1)
473 rc = env->open( env, NULL, flags, 0 );
475 rc = env->open( env, NULL, NULL, flags, 0 );
479 rc = env->close( env, 0 );
483 printf("BerkeleyDB: %s\n", db_strerror(rc) );
489 memset( &env, '\0', sizeof(env) );
491 rc = db_appinit( NULL, NULL, &env, flags );
497 unlink("__db_mpool.share");
498 unlink("__db_lock.share");
502 }]])],[ol_cv_berkeley_db_thread=yes],[ol_cv_berkeley_db_thread=no],[ol_cv_berkeley_db_thread=cross])
507 if test $ol_cv_berkeley_db_thread != no ; then
508 AC_DEFINE(HAVE_BERKELEY_DB_THREAD, 1,
509 [define if Berkeley DB has DB_THREAD support])
513 dnl --------------------------------------------------------------------
515 AC_DEFUN([OL_BERKELEY_DB],
516 [ol_cv_berkeley_db=no
517 AC_CHECK_HEADERS(db.h)
518 if test $ac_cv_header_db_h = yes; then
520 if test "$ol_cv_lib_db" != no ; then
521 ol_cv_berkeley_db=yes
522 OL_BERKELEY_DB_VERSION
523 OL_BERKELEY_DB_THREAD
527 dnl --------------------------------------------------------------------
528 dnl Check for version compatility with back-bdb
529 AC_DEFUN([OL_BDB_COMPAT],
530 [AC_CACHE_CHECK([Berkeley DB version for BDB/HDB backends], [ol_cv_bdb_compat],[
531 AC_EGREP_CPP(__db_version_compat,[
534 /* this check could be improved */
535 #ifndef DB_VERSION_MAJOR
536 # define DB_VERSION_MAJOR 1
538 #ifndef DB_VERSION_MINOR
539 # define DB_VERSION_MINOR 0
542 /* require 4.2 or later */
543 #if (DB_VERSION_MAJOR >= 4) && (DB_VERSION_MINOR >= 2)
546 ], [ol_cv_bdb_compat=yes], [ol_cv_bdb_compat=no])])
549 dnl --------------------------------------------------------------------
550 dnl Find old Berkeley DB 1.85/1.86
551 AC_DEFUN([OL_BERKELEY_COMPAT_DB],
552 [AC_CHECK_HEADERS(db_185.h db.h)
553 if test $ac_cv_header_db_185_h = yes -o $ac_cv_header_db_h = yes; then
554 AC_CACHE_CHECK([if Berkeley DB header compatibility], [ol_cv_header_db1],[
555 AC_EGREP_CPP(__db_version_1,[
562 /* this check could be improved */
563 #ifndef DB_VERSION_MAJOR
564 # define DB_VERSION_MAJOR 1
567 #if DB_VERSION_MAJOR == 1
570 ], [ol_cv_header_db1=yes], [ol_cv_header_db1=no])])
572 if test $ol_cv_header_db1 = yes ; then
574 if test "$ol_cv_lib_db" != no ; then
575 ol_cv_berkeley_db=yes
581 dnl ====================================================================
582 dnl Check if GDBM library exists
583 dnl Check for gdbm_open in standard libraries or -lgdbm
585 dnl defines ol_cv_lib_gdbm to 'yes' or '-lgdbm' or 'no'
586 dnl 'yes' implies gdbm_open is in $LIBS
589 dnl AC_CHECK_FUNC(gdbm_open)
590 dnl AC_CHECK_LIB(gdbm,gdbm_open)
592 AC_DEFUN([OL_LIB_GDBM],
593 [AC_CACHE_CHECK(for GDBM library, [ol_cv_lib_gdbm],
595 AC_CHECK_FUNC(gdbm_open,[ol_cv_lib_gdbm=yes], [
596 AC_CHECK_LIB(gdbm,gdbm_open,[ol_cv_lib_gdbm=-lgdbm],[ol_cv_lib_gdbm=no])
602 dnl --------------------------------------------------------------------
603 dnl Check if GDBM exists
605 dnl defines ol_cv_gdbm to 'yes' or 'no'
609 dnl AC_CHECK_HEADERS(gdbm.h)
612 [AC_REQUIRE([OL_LIB_GDBM])
613 AC_CHECK_HEADERS(gdbm.h)
614 AC_CACHE_CHECK(for db, [ol_cv_gdbm], [
615 if test $ol_cv_lib_gdbm = no -o $ac_cv_header_gdbm_h = no ; then
621 if test $ol_cv_gdbm = yes ; then
622 AC_DEFINE(HAVE_GDBM,1, [define if GNU DBM is available])
626 dnl ====================================================================
627 dnl Check if MDBM library exists
628 dnl Check for mdbm_open in standard libraries or -lmdbm
630 dnl defines ol_cv_lib_mdbm to 'yes' or '-lmdbm' or 'no'
631 dnl 'yes' implies mdbm_open is in $LIBS
634 dnl AC_CHECK_FUNC(mdbm_set_chain)
635 dnl AC_CHECK_LIB(mdbm,mdbm_set_chain)
637 AC_DEFUN([OL_LIB_MDBM],
638 [AC_CACHE_CHECK(for MDBM library, [ol_cv_lib_mdbm],
640 AC_CHECK_FUNC(mdbm_set_chain,[ol_cv_lib_mdbm=yes], [
641 AC_CHECK_LIB(mdbm,mdbm_set_chain,[ol_cv_lib_mdbm=-lmdbm],[ol_cv_lib_mdbm=no])
647 dnl --------------------------------------------------------------------
648 dnl Check if MDBM exists
650 dnl defines ol_cv_mdbm to 'yes' or 'no'
654 dnl AC_CHECK_HEADERS(mdbm.h)
657 [AC_REQUIRE([OL_LIB_MDBM])
658 AC_CHECK_HEADERS(mdbm.h)
659 AC_CACHE_CHECK(for db, [ol_cv_mdbm], [
660 if test $ol_cv_lib_mdbm = no -o $ac_cv_header_mdbm_h = no ; then
666 if test $ol_cv_mdbm = yes ; then
667 AC_DEFINE(HAVE_MDBM,1, [define if MDBM is available])
671 dnl ====================================================================
672 dnl Check if NDBM library exists
673 dnl Check for dbm_open in standard libraries or -lndbm or -ldbm
675 dnl defines ol_cv_lib_ndbm to 'yes' or '-lndbm' or -ldbm or 'no'
676 dnl 'yes' implies ndbm_open is in $LIBS
679 dnl AC_CHECK_FUNC(dbm_open)
680 dnl AC_CHECK_LIB(ndbm,dbm_open)
681 dnl AC_CHECK_LIB(dbm,dbm_open)
684 dnl should also check SVR4 case: dbm_open() in -lucb but that
685 dnl would requiring dealing with -L/usr/ucblib
687 AC_DEFUN([OL_LIB_NDBM],
688 [AC_CACHE_CHECK(for NDBM library, [ol_cv_lib_ndbm],
690 AC_CHECK_FUNC(dbm_open,[ol_cv_lib_ndbm=yes], [
691 AC_CHECK_LIB(ndbm,dbm_open,[ol_cv_lib_ndbm=-lndbm], [
692 AC_CHECK_LIB(dbm,dbm_open,[ol_cv_lib_ndbm=-ldbm],
693 [ol_cv_lib_ndbm=no])dnl
700 dnl --------------------------------------------------------------------
701 dnl Check if NDBM exists
703 dnl defines ol_cv_ndbm to 'yes' or 'no'
707 dnl AC_CHECK_HEADERS(ndbm.h)
710 dnl Doesn't handle SVR4 case (see above)
713 [AC_REQUIRE([OL_LIB_NDBM])
714 AC_CHECK_HEADERS(ndbm.h)
715 AC_CACHE_CHECK(for db, [ol_cv_ndbm], [
716 if test $ol_cv_lib_ndbm = no -o $ac_cv_header_ndbm_h = no ; then
722 if test $ol_cv_ndbm = yes ; then
723 AC_DEFINE(HAVE_NDBM,1, [define if NDBM is available])
727 dnl ====================================================================
728 dnl Check POSIX Thread version
730 dnl defines ol_cv_pthread_version to 4, 5, 6, 7, 8, 10, depending on the
731 dnl version of the POSIX.4a Draft that is implemented.
732 dnl 10 == POSIX.4a Final == POSIX.1c-1996 for our purposes.
733 dnl Existence of pthread.h should be tested separately.
736 dnl pthread_detach() was dropped in Draft 8, it is present
737 dnl in every other version
738 dnl PTHREAD_CREATE_UNDETACHED is only in Draft 7, it was called
739 dnl PTHREAD_CREATE_JOINABLE after that
740 dnl pthread_attr_create was renamed to pthread_attr_init in Draft 6.
741 dnl Draft 6-10 has _init, Draft 4-5 has _create.
742 dnl pthread_attr_default was dropped in Draft 6, only 4 and 5 have it
743 dnl PTHREAD_MUTEX_INITIALIZER was introduced in Draft 5. It's not
744 dnl interesting to us because we don't try to statically
745 dnl initialize mutexes. 5-10 has it.
747 dnl Draft 9 and 10 are equivalent for our purposes.
749 AC_DEFUN([OL_POSIX_THREAD_VERSION],
750 [AC_CACHE_CHECK([POSIX thread version],[ol_cv_pthread_version],[
751 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
752 # include <pthread.h>
754 int i = PTHREAD_CREATE_JOINABLE;
756 AC_EGREP_HEADER(pthread_detach,pthread.h,
757 ol_cv_pthread_version=10, ol_cv_pthread_version=8)],[
758 AC_EGREP_CPP(draft7,[
759 # include <pthread.h>
760 # ifdef PTHREAD_CREATE_UNDETACHED
763 ], ol_cv_pthread_version=7, [
764 AC_EGREP_HEADER(pthread_attr_init,pthread.h,
765 ol_cv_pthread_version=6, [
766 AC_EGREP_CPP(draft5,[
767 # include <pthread.h>
768 #ifdef PTHREAD_MUTEX_INITIALIZER
771 ], ol_cv_pthread_version=5, ol_cv_pthread_version=4) ]) ]) ])
775 dnl --------------------------------------------------------------------
776 AC_DEFUN([OL_PTHREAD_TEST_INCLUDES], [[
777 /* pthread test headers */
779 #if HAVE_PTHREADS < 7
783 #define NULL (void*)0
789 return (void *) (p == NULL);
792 AC_DEFUN([OL_PTHREAD_TEST_FUNCTION],[[
793 /* pthread test function */
794 #ifndef PTHREAD_CREATE_DETACHED
795 #define PTHREAD_CREATE_DETACHED 1
799 int detach = PTHREAD_CREATE_DETACHED;
801 #if HAVE_PTHREADS > 4
805 status = pthread_attr_init(&attr);
806 if( status ) return status;
808 #if HAVE_PTHREADS < 7
809 status = pthread_attr_setdetachstate(&attr, &detach);
810 if( status < 0 ) status = errno;
812 status = pthread_attr_setdetachstate(&attr, detach);
814 if( status ) return status;
815 status = pthread_create( &t, &attr, task, NULL );
816 #if HAVE_PTHREADS < 7
817 if( status < 0 ) status = errno;
819 if( status ) return status;
821 /* Draft 4 pthreads */
822 status = pthread_create( &t, pthread_attr_default, task, NULL );
823 if( status ) return errno;
825 /* give thread a chance to complete */
826 /* it should remain joinable and hence detachable */
829 status = pthread_detach( &t );
830 if( status ) return errno;
833 #ifdef HAVE_LINUX_THREADS
834 pthread_kill_other_threads_np();
840 AC_DEFUN([OL_PTHREAD_TEST_PROGRAM],
841 [OL_PTHREAD_TEST_INCLUDES
847 OL_PTHREAD_TEST_FUNCTION
850 dnl --------------------------------------------------------------------
851 AC_DEFUN([OL_PTHREAD_TRY], [# Pthread try link: $1 ($2)
852 if test "$ol_link_threads" = no ; then
854 AC_CACHE_CHECK([for pthread link with $1], [$2], [
859 AC_RUN_IFELSE([OL_PTHREAD_TEST_PROGRAM],
862 [AC_TRY_LINK(OL_PTHREAD_TEST_INCLUDES,OL_PTHREAD_TEST_FUNCTION,
869 if test $$2 = yes ; then
870 ol_link_pthreads="$1"
871 ol_link_threads=posix
876 dnl ====================================================================
877 dnl Check GNU Pth pthread Header
879 dnl defines ol_cv_header linux_threads to 'yes' or 'no'
880 dnl 'no' implies pthreads.h is not LinuxThreads or pthreads.h
881 dnl doesn't exists. Existance of pthread.h should separately
884 AC_DEFUN([OL_HEADER_GNU_PTH_PTHREAD_H], [
885 AC_CACHE_CHECK([for GNU Pth pthread.h],
886 [ol_cv_header_gnu_pth_pthread_h],
887 [AC_EGREP_CPP(__gnu_pth__,
888 [#include <pthread.h>
889 #ifdef _POSIX_THREAD_IS_GNU_PTH
893 [ol_cv_header_gnu_pth_pthread_h=yes],
894 [ol_cv_header_gnu_pth_pthread_h=no])
897 dnl ====================================================================
898 dnl Check for NT Threads
899 AC_DEFUN([OL_NT_THREADS], [
900 AC_CHECK_FUNC(_beginthread)
902 if test $ac_cv_func__beginthread = yes ; then
903 AC_DEFINE(HAVE_NT_THREADS,1,[if you have NT Threads])
907 dnl ====================================================================
908 dnl Check LinuxThreads Header
910 dnl defines ol_cv_header linux_threads to 'yes' or 'no'
911 dnl 'no' implies pthreads.h is not LinuxThreads or pthreads.h
912 dnl doesn't exists. Existance of pthread.h should separately
915 AC_DEFUN([OL_HEADER_LINUX_THREADS], [
916 AC_CACHE_CHECK([for LinuxThreads pthread.h],
917 [ol_cv_header_linux_threads],
918 [AC_EGREP_CPP(pthread_kill_other_threads_np,
919 [#include <pthread.h>],
920 [ol_cv_header_linux_threads=yes],
921 [ol_cv_header_linux_threads=no])
923 if test $ol_cv_header_linux_threads = yes; then
924 AC_DEFINE(HAVE_LINUX_THREADS,1,[if you have LinuxThreads])
927 dnl --------------------------------------------------------------------
928 dnl Check LinuxThreads Implementation
930 dnl defines ol_cv_sys_linux_threads to 'yes' or 'no'
931 dnl 'no' implies pthreads implementation is not LinuxThreads.
933 AC_DEFUN([OL_SYS_LINUX_THREADS], [
934 AC_CHECK_FUNCS(pthread_kill_other_threads_np)
935 AC_CACHE_CHECK([for LinuxThreads implementation],
936 [ol_cv_sys_linux_threads],
937 [ol_cv_sys_linux_threads=$ac_cv_func_pthread_kill_other_threads_np])
940 dnl --------------------------------------------------------------------
941 dnl Check LinuxThreads consistency
942 AC_DEFUN([OL_LINUX_THREADS], [
943 AC_REQUIRE([OL_HEADER_LINUX_THREADS])
944 AC_REQUIRE([OL_SYS_LINUX_THREADS])
945 AC_CACHE_CHECK([for LinuxThreads consistency], [ol_cv_linux_threads], [
946 if test $ol_cv_header_linux_threads = yes -a \
947 $ol_cv_sys_linux_threads = yes; then
948 ol_cv_linux_threads=yes
949 elif test $ol_cv_header_linux_threads = no -a \
950 $ol_cv_sys_linux_threads = no; then
951 ol_cv_linux_threads=no
953 ol_cv_linux_threads=error
958 dnl ====================================================================
959 dnl Check for POSIX Regex
960 AC_DEFUN([OL_POSIX_REGEX], [
961 AC_CACHE_CHECK([for compatible POSIX regex],ol_cv_c_posix_regex,[
962 AC_RUN_IFELSE([AC_LANG_SOURCE([[
963 #include <sys/types.h>
965 static char *pattern, *string;
973 if(regcomp(&re, pattern, 0)) {
977 string = "ALL MATCH";
979 rc = regexec(&re, string, 0, (void*)0, 0);
984 }]])],[ol_cv_c_posix_regex=yes],[ol_cv_c_posix_regex=no],[ol_cv_c_posix_regex=cross])])
987 dnl ====================================================================
988 dnl Check if toupper() requires islower() to be called first
989 AC_DEFUN([OL_C_UPPER_LOWER],
990 [AC_CACHE_CHECK([if toupper() requires islower()],ol_cv_c_upper_lower,[
991 AC_RUN_IFELSE([AC_LANG_SOURCE([[
995 if ('C' == toupper('C'))
999 }]])],[ol_cv_c_upper_lower=no],[ol_cv_c_upper_lower=yes],[ol_cv_c_upper_lower=safe])])
1000 if test $ol_cv_c_upper_lower != no ; then
1001 AC_DEFINE(C_UPPER_LOWER,1, [define if toupper() requires islower()])
1005 dnl ====================================================================
1006 dnl Error string checks
1008 dnl Check for declaration of sys_errlist in one of stdio.h and errno.h.
1009 dnl Declaration of sys_errlist on BSD4.4 interferes with our declaration.
1010 dnl Reported by Keith Bostic.
1011 AC_DEFUN([OL_SYS_ERRLIST],
1012 [AC_CACHE_CHECK([declaration of sys_errlist],ol_cv_dcl_sys_errlist,[
1013 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1015 #include <sys/types.h>
1019 #endif ]], [[char *c = (char *) *sys_errlist]])],[ol_cv_dcl_sys_errlist=yes
1020 ol_cv_have_sys_errlist=yes],[ol_cv_dcl_sys_errlist=no])])
1022 # It's possible (for near-UNIX clones) that sys_errlist doesn't exist
1023 if test $ol_cv_dcl_sys_errlist = no ; then
1024 AC_DEFINE(DECL_SYS_ERRLIST,1,
1025 [define if sys_errlist is not declared in stdio.h or errno.h])
1027 AC_CACHE_CHECK([existence of sys_errlist],ol_cv_have_sys_errlist,[
1028 AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <errno.h>]], [[char *c = (char *) *sys_errlist]])],[ol_cv_have_sys_errlist=yes],[ol_cv_have_sys_errlist=no])])
1030 if test $ol_cv_have_sys_errlist = yes ; then
1031 AC_DEFINE(HAVE_SYS_ERRLIST,1,
1032 [define if you actually have sys_errlist in your libs])
1035 AC_DEFUN([OL_NONPOSIX_STRERROR_R],
1036 [AC_CACHE_CHECK([non-posix strerror_r],ol_cv_nonposix_strerror_r,[
1037 AC_EGREP_CPP(strerror_r,[#include <string.h>],
1038 ol_decl_strerror_r=yes, ol_decl_strerror_r=no)dnl
1040 if test $ol_decl_strerror_r = yes ; then
1041 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <string.h>]], [[ /* from autoconf 2.59 */
1043 char x = *strerror_r (0, buf, sizeof buf);
1044 char *p = strerror_r (0, buf, sizeof buf);
1045 ]])],[ol_cv_nonposix_strerror_r=yes],[ol_cv_nonposix_strerror_r=no])
1047 AC_RUN_IFELSE([AC_LANG_SOURCE([[
1051 strerror_r( 1, buf, sizeof buf );
1052 exit( buf[0] == 0 );
1054 ]])],[ol_cv_nonposix_strerror_r=yes],[ol_cv_nonposix_strerror=no],[ol_cv_nonposix_strerror=no])
1057 if test $ol_cv_nonposix_strerror_r = yes ; then
1058 AC_DEFINE(HAVE_NONPOSIX_STRERROR_R,1,
1059 [define if strerror_r returns char* instead of int])
1063 AC_DEFUN([OL_STRERROR],
1064 [OL_SYS_ERRLIST dnl TEMPORARY
1065 AC_CHECK_FUNCS(strerror strerror_r)
1066 ol_cv_func_strerror_r=no
1067 if test "${ac_cv_func_strerror_r}" = yes ; then
1068 OL_NONPOSIX_STRERROR_R
1069 elif test "${ac_cv_func_strerror}" = no ; then
1073 dnl ====================================================================
1074 dnl Early MIPS compilers (used in Ultrix 4.2) don't like
1075 dnl "int x; int *volatile a = &x; *a = 0;"
1076 dnl -- borrowed from PDKSH
1077 AC_DEFUN([OL_C_VOLATILE],
1078 [AC_CACHE_CHECK(if compiler understands volatile, ol_cv_c_volatile,
1079 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[int x, y, z;]], [[volatile int a; int * volatile b = x ? &y : &z;
1080 /* Older MIPS compilers (eg., in Ultrix 4.2) don't like *b = 0 */
1081 *b = 0;]])],[ol_cv_c_volatile=yes],[ol_cv_c_volatile=no])])
1082 if test $ol_cv_c_volatile = yes; then
1085 AC_DEFINE(volatile,,[define as empty if volatile is not supported])
1089 dnl ====================================================================
1090 dnl Look for fetch(3)
1091 AC_DEFUN([OL_LIB_FETCH],
1093 LIBS="-lfetch -lcom_err $LIBS"
1094 AC_CACHE_CHECK([fetch(3) library],ol_cv_lib_fetch,[
1095 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
1096 #include <sys/param.h>
1098 #include <fetch.h>]], [[struct url *u = fetchParseURL("file:///"); ]])],[ol_cv_lib_fetch=yes],[ol_cv_lib_fetch=no])])
1100 if test $ol_cv_lib_fetch != no ; then
1101 ol_link_fetch="-lfetch -lcom_err"
1102 AC_DEFINE(HAVE_FETCH,1,
1103 [define if you actually have FreeBSD fetch(3)])
1107 dnl ====================================================================
1108 dnl Define sig_atomic_t if not defined in signal.h
1109 AC_DEFUN([OL_TYPE_SIG_ATOMIC_T],
1110 [AC_CACHE_CHECK(for sig_atomic_t, ol_cv_type_sig_atomic_t,
1111 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <signal.h>]], [[sig_atomic_t atomic;]])],[ol_cv_type_sig_atomic_t=yes],[ol_cv_type_sig_atomic_t=no])])
1112 if test $ol_cv_type_sig_atomic_t = no; then
1113 AC_DEFINE(sig_atomic_t,int,
1114 [define to atomic type if sig_atomic_t is not available])
1118 dnl ====================================================================
1119 dnl Define socklen_t if not defined in sys/types.h or sys/socket.h
1120 AC_DEFUN([OL_TYPE_SOCKLEN_T],
1121 [AC_CACHE_CHECK(for socklen_t, ol_cv_type_socklen_t,
1122 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1123 #ifdef HAVE_SYS_TYPES_H
1124 #include <sys/types.h>
1126 #ifdef HAVE_SYS_SOCKET_H
1127 #include <sys/socket.h>
1129 ]], [[socklen_t len;]])],[ol_cv_type_socklen_t=yes],[ol_cv_type_socklen_t=no])])
1130 if test $ol_cv_type_socklen_t = no; then
1131 AC_DEFINE(socklen_t, int,
1132 [define to int if socklen_t is not available])
1136 dnl ====================================================================
1137 dnl Define inet_aton is available
1138 AC_DEFUN([OL_FUNC_INET_ATON],
1139 [AC_CACHE_CHECK([for inet_aton()], ol_cv_func_inet_aton,
1140 [AC_LINK_IFELSE([AC_LANG_PROGRAM([[
1141 #ifdef HAVE_SYS_TYPES_H
1142 # include <sys/types.h>
1144 #ifdef HAVE_SYS_SOCKET_H
1145 # include <sys/socket.h>
1146 # ifdef HAVE_SYS_SELECT_H
1147 # include <sys/select.h>
1149 # include <netinet/in.h>
1150 # ifdef HAVE_ARPA_INET_H
1151 # include <arpa/inet.h>
1154 ]], [[struct in_addr in;
1155 int rc = inet_aton( "255.255.255.255", &in );]])],[ol_cv_func_inet_aton=yes],[ol_cv_func_inet_aton=no])])
1156 if test $ol_cv_func_inet_aton != no; then
1157 AC_DEFINE(HAVE_INET_ATON, 1,
1158 [define to you inet_aton(3) is available])
1162 dnl ====================================================================
1163 dnl check no of arguments for ctime_r
1164 AC_DEFUN([OL_FUNC_CTIME_R_NARGS],
1165 [AC_CACHE_CHECK(number of arguments of ctime_r, ol_cv_func_ctime_r_nargs,
1166 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]], [[time_t ti; char *buffer; ctime_r(&ti,buffer,32);]])],[ol_cv_func_ctime_r_nargs3=yes],[ol_cv_func_ctime_r_nargs3=no])
1168 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]], [[time_t ti; char *buffer; ctime_r(&ti,buffer);]])],[ol_cv_func_ctime_r_nargs2=yes],[ol_cv_func_ctime_r_nargs2=no])
1170 if test $ol_cv_func_ctime_r_nargs3 = yes -a \
1171 $ol_cv_func_ctime_r_nargs2 = no ; then
1173 ol_cv_func_ctime_r_nargs=3
1175 elif test $ol_cv_func_ctime_r_nargs3 = no -a \
1176 $ol_cv_func_ctime_r_nargs2 = yes ; then
1178 ol_cv_func_ctime_r_nargs=2
1181 ol_cv_func_ctime_r_nargs=0
1185 if test $ol_cv_func_ctime_r_nargs -gt 1 ; then
1186 AC_DEFINE_UNQUOTED(CTIME_R_NARGS, $ol_cv_func_ctime_r_nargs,
1187 [set to the number of arguments ctime_r() expects])
1191 dnl --------------------------------------------------------------------
1192 dnl check return type of ctime_r()
1193 AC_DEFUN([OL_FUNC_CTIME_R_TYPE],
1194 [AC_CACHE_CHECK(return type of ctime_r, ol_cv_func_ctime_r_type,
1195 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]], [[extern int (ctime_r)();]])],[ol_cv_func_ctime_r_type="int"],[ol_cv_func_ctime_r_type="charp"])
1197 if test $ol_cv_func_ctime_r_type = "int" ; then
1198 AC_DEFINE(CTIME_R_RETURNS_INT,1, [define if ctime_r() returns int])
1201 dnl ====================================================================
1202 dnl check no of arguments for gethostbyname_r
1203 AC_DEFUN([OL_FUNC_GETHOSTBYNAME_R_NARGS],
1204 [AC_CACHE_CHECK(number of arguments of gethostbyname_r,
1205 ol_cv_func_gethostbyname_r_nargs,
1206 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
1207 #include <sys/socket.h>
1208 #include <netinet/in.h>
1210 #define BUFSIZE (sizeof(struct hostent)+10)]], [[struct hostent hent; char buffer[BUFSIZE];
1211 int bufsize=BUFSIZE;int h_errno;
1212 (void)gethostbyname_r("segovia.cs.purdue.edu", &hent,
1213 buffer, bufsize, &h_errno);]])],[ol_cv_func_gethostbyname_r_nargs5=yes],[ol_cv_func_gethostbyname_r_nargs5=no])
1215 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
1216 #include <sys/socket.h>
1217 #include <netinet/in.h>
1219 #define BUFSIZE (sizeof(struct hostent)+10)]], [[struct hostent hent;struct hostent *rhent;
1220 char buffer[BUFSIZE];
1221 int bufsize=BUFSIZE;int h_errno;
1222 (void)gethostbyname_r("localhost", &hent, buffer, bufsize,
1223 &rhent, &h_errno);]])],[ol_cv_func_gethostbyname_r_nargs6=yes],[ol_cv_func_gethostbyname_r_nargs6=no])
1225 if test $ol_cv_func_gethostbyname_r_nargs5 = yes -a \
1226 $ol_cv_func_gethostbyname_r_nargs6 = no ; then
1228 ol_cv_func_gethostbyname_r_nargs=5
1230 elif test $ol_cv_func_gethostbyname_r_nargs5 = no -a \
1231 $ol_cv_func_gethostbyname_r_nargs6 = yes ; then
1233 ol_cv_func_gethostbyname_r_nargs=6
1236 ol_cv_func_gethostbyname_r_nargs=0
1239 if test $ol_cv_func_gethostbyname_r_nargs -gt 1 ; then
1240 AC_DEFINE_UNQUOTED(GETHOSTBYNAME_R_NARGS,
1241 $ol_cv_func_gethostbyname_r_nargs,
1242 [set to the number of arguments gethostbyname_r() expects])
1246 dnl check no of arguments for gethostbyaddr_r
1247 AC_DEFUN([OL_FUNC_GETHOSTBYADDR_R_NARGS],
1248 [AC_CACHE_CHECK(number of arguments of gethostbyaddr_r,
1249 [ol_cv_func_gethostbyaddr_r_nargs],
1250 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
1251 #include <sys/socket.h>
1252 #include <netinet/in.h>
1254 #define BUFSIZE (sizeof(struct hostent)+10)]], [[struct hostent hent; char buffer[BUFSIZE];
1256 size_t alen=sizeof(struct in_addr);
1257 int bufsize=BUFSIZE;int h_errno;
1258 (void)gethostbyaddr_r( (void *)&(add.s_addr),
1259 alen, AF_INET, &hent, buffer, bufsize, &h_errno);]])],[ol_cv_func_gethostbyaddr_r_nargs7=yes],[ol_cv_func_gethostbyaddr_r_nargs7=no])
1261 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
1262 #include <sys/socket.h>
1263 #include <netinet/in.h>
1265 #define BUFSIZE (sizeof(struct hostent)+10)]], [[struct hostent hent;
1266 struct hostent *rhent; char buffer[BUFSIZE];
1268 size_t alen=sizeof(struct in_addr);
1269 int bufsize=BUFSIZE;int h_errno;
1270 (void)gethostbyaddr_r( (void *)&(add.s_addr),
1271 alen, AF_INET, &hent, buffer, bufsize,
1272 &rhent, &h_errno);]])],[ol_cv_func_gethostbyaddr_r_nargs8=yes],[ol_cv_func_gethostbyaddr_r_nargs8=no])
1274 if test $ol_cv_func_gethostbyaddr_r_nargs7 = yes -a \
1275 $ol_cv_func_gethostbyaddr_r_nargs8 = no ; then
1277 ol_cv_func_gethostbyaddr_r_nargs=7
1279 elif test $ol_cv_func_gethostbyaddr_r_nargs7 = no -a \
1280 $ol_cv_func_gethostbyaddr_r_nargs8 = yes ; then
1282 ol_cv_func_gethostbyaddr_r_nargs=8
1285 ol_cv_func_gethostbyaddr_r_nargs=0
1288 if test $ol_cv_func_gethostbyaddr_r_nargs -gt 1 ; then
1289 AC_DEFINE_UNQUOTED(GETHOSTBYADDR_R_NARGS,
1290 $ol_cv_func_gethostbyaddr_r_nargs,
1291 [set to the number of arguments gethostbyaddr_r() expects])
1295 dnl --------------------------------------------------------------------
1296 dnl Check for Cyrus SASL version compatility
1297 AC_DEFUN([OL_SASL_COMPAT],
1298 [AC_CACHE_CHECK([Cyrus SASL library version], [ol_cv_sasl_compat],[
1299 AC_EGREP_CPP(__sasl_compat,[
1300 #ifdef HAVE_SASL_SASL_H
1301 #include <sasl/sasl.h>
1306 /* Require 2.1.15+ */
1307 #if SASL_VERSION_MAJOR == 2 && SASL_VERSION_MINOR > 1
1308 char *__sasl_compat = "2.2+ or better okay (we guess)";
1309 #elif SASL_VERSION_MAJOR == 2 && SASL_VERSION_MINOR == 1 \
1310 && SASL_VERSION_STEP >=15
1311 char *__sasl_compat = "2.1.15+ or better okay";
1313 ], [ol_cv_sasl_compat=yes], [ol_cv_sasl_compat=no])])
1315 dnl ====================================================================
1316 dnl check for msg_accrights in msghdr
1317 AC_DEFUN([OL_MSGHDR_MSG_ACCRIGHTS],
1318 [AC_CACHE_CHECK(for msg_accrights in msghdr, ol_cv_msghdr_msg_accrights,
1319 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/socket.h>]], [[struct msghdr m; m.msg_accrightslen=0]])],[ol_cv_msghdr_msg_accrights=yes],[ol_cv_msghdr_msg_accrights=no])
1321 if test $ol_cv_msghdr_msg_accrights = "yes" ; then
1322 AC_DEFINE(HAVE_MSGHDR_MSG_ACCRIGHTS,1,
1323 [define if struct msghdr has msg_accrights])
1326 dnl ====================================================================
1327 dnl check for cmsghdr
1328 AC_DEFUN([OL_MSGHDR_MSG_CONTROL],
1329 [AC_CACHE_CHECK(for msg_control in msghdr, ol_cv_msghdr_msg_control,
1330 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/socket.h>]], [[struct msghdr m; m.msg_control=(struct cmsghdr *)0]])],[ol_cv_msghdr_msg_control=yes],[ol_cv_msghdr_msg_control=no])
1332 if test $ol_cv_msghdr_msg_control = "yes" ; then
1333 AC_DEFINE(HAVE_MSGHDR_MSG_CONTROL,1,
1334 [define if struct msghdr has msg_control])
1337 AC_DEFUN([OL_SSL_COMPAT],
1338 [AC_CACHE_CHECK([OpenSSL library version (CRL checking capability)], [ol_cv_ssl_crl_compat],[
1339 AC_EGREP_CPP(__ssl_compat,[
1340 #ifdef HAVE_OPENSSL_SSL_H
1341 #include <openssl/ssl.h>
1346 /* Require 0.9.7d+ */
1347 #if OPENSSL_VERSION_NUMBER >= 0x0090704fL
1348 char *__ssl_compat = "0.9.7d";
1350 ], [ol_cv_ssl_crl_compat=yes], [ol_cv_ssl_crl_compat=no])])