]> git.ipfire.org Git - thirdparty/openldap.git/blob - configure.ac
ITS#10166 slapi: fix plugin.c plugin_pblock_new() usage
[thirdparty/openldap.git] / configure.ac
1 dnl $OpenLDAP$
2 dnl This work is part of OpenLDAP Software <http://www.openldap.org/>.
3 dnl
4 dnl Copyright 1998-2022 The OpenLDAP Foundation.
5 dnl All rights reserved.
6 dnl
7 dnl Redistribution and use in source and binary forms, with or without
8 dnl modification, are permitted only as authorized by the OpenLDAP
9 dnl Public License.
10 dnl
11 dnl A copy of this license is available in the file LICENSE in the
12 dnl top-level directory of the distribution or, alternatively, at
13 dnl <http://www.OpenLDAP.org/license.html>.
14 dnl
15 dnl ----------------------------------------------------------------
16 dnl Disable config.cache!
17 define([AC_CACHE_LOAD], )dnl
18 define([AC_CACHE_SAVE], )dnl
19 dnl ----------------------------------------------------------------
20 dnl Disable libtool 1.5 support for languages we don't use
21 define([AC_LIBTOOL_LANG_CXX_CONFIG], [:])dnl
22 define([AC_LIBTOOL_LANG_F77_CONFIG], [:])dnl
23 define([AC_LIBTOOL_LANG_GCJ_CONFIG], [:])dnl
24 dnl ================================================================
25 dnl Configure.in for OpenLDAP
26 AC_COPYRIGHT([[Copyright 1998-2022 The OpenLDAP Foundation. All rights reserved.
27 Restrictions apply, see COPYRIGHT and LICENSE files.]])
28 AC_REVISION([$Id$])
29 AC_INIT([OpenLDAP],,[https://bugs.openldap.org],,[https://www.openldap.org])
30 AC_CONFIG_SRCDIR(build/version.sh)dnl
31 dnl ----------------------------------------------------------------
32 dnl OpenLDAP Autoconf Macros
33 builtin(include, build/openldap.m4)dnl
34 dnl ================================================================
35
36 m4_ifndef([PKG_PREREQ],
37 [m4_fatal([must install pkg-config 0.29 or later before running autoconf/autogen])])
38
39 AC_CONFIG_AUX_DIR(build)dnl
40 AC_CONFIG_MACRO_DIRS([build])
41
42 eval `$ac_aux_dir/version.sh`
43 if test -z "$OL_STRING"; then
44 AC_MSG_ERROR([could not determine version])
45 fi
46
47 if test -f "$ac_aux_dir/shtool" && test ! -d $ac_aux_dir/shtool; then
48 ac_cv_shtool="$ac_aux_dir/shtool"
49 else
50 AC_MSG_ERROR([no shtool found in $ac_aux_dir])
51 fi
52
53 SHTOOL="$ac_cv_shtool"
54 dnl AC_SUBST(SHTOOL)dnl
55
56 TB="" TN=""
57 if test -t 1; then
58 TB="`$SHTOOL echo -e '%B' 2>/dev/null`"
59 TN="`$SHTOOL echo -e '%b' 2>/dev/null`"
60 fi
61
62 OPENLDAP_REPO=""
63 if test -d $ac_aux_dir/../.git; then
64 OPENLDAP_REPO="(from Git clone) "
65 elif test -d $ac_aux_dir/CVS; then
66 OPENLDAP_REPO="(from CVS checkout) "
67 fi
68
69 echo "Configuring ${TB}${OL_STRING}${TN} ${OPENLDAP_REPO}..."
70
71 dnl Determine host platform
72 dnl we try not to use this for much
73 AC_CANONICAL_TARGET([])
74
75 AC_SUBST(PACKAGE,$OL_PACKAGE)dnl
76 AC_SUBST(VERSION,$OL_VERSION)dnl
77 AC_DEFINE_UNQUOTED(OPENLDAP_PACKAGE,"$PACKAGE",Package)
78 AC_DEFINE_UNQUOTED(OPENLDAP_VERSION,"$VERSION",Version)
79
80 AC_DEFINE_UNQUOTED(LDAP_VENDOR_VERSION,$OL_API_INC,Version)
81 AC_DEFINE_UNQUOTED(LDAP_VENDOR_VERSION_MAJOR,$OL_MAJOR,Major)
82 AC_DEFINE_UNQUOTED(LDAP_VENDOR_VERSION_MINOR,$OL_MINOR,Minor)
83 AC_DEFINE_UNQUOTED(LDAP_VENDOR_VERSION_PATCH,$OL_PATCH,Patch)
84
85 OPENLDAP_LIBVERSION=$OL_API_LIB_VERSION
86 AC_SUBST(OPENLDAP_LIBVERSION)dnl
87
88 OPENLDAP_RELEASE_DATE="$OL_RELEASE_DATE"
89 AC_SUBST(OPENLDAP_RELEASE_DATE)dnl
90
91 AC_PREREQ([2.69])dnl Required Autoconf version
92
93 AH_TOP([
94 /* begin of portable.h.pre */
95 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
96 *
97 * Copyright 1998-2022 The OpenLDAP Foundation
98 * All rights reserved.
99 *
100 * Redistribution and use in source and binary forms, with or without
101 * modification, are permitted only as authorized by the OpenLDAP
102 * Public License.
103 *
104 * A copy of this license is available in the file LICENSE in the
105 * top-level directory of the distribution or, alternatively, at
106 * <http://www.OpenLDAP.org/license.html>.
107 */
108
109 #ifndef _LDAP_PORTABLE_H
110 #define _LDAP_PORTABLE_H
111
112 /* define this if needed to get reentrant functions */
113 #ifndef REENTRANT
114 #undef REENTRANT
115 #endif
116 #ifndef _REENTRANT
117 #undef _REENTRANT
118 #endif
119
120 /* define this if needed to get threadsafe functions */
121 #ifndef THREADSAFE
122 #undef THREADSAFE
123 #endif
124 #ifndef _THREADSAFE
125 #undef _THREADSAFE
126 #endif
127 #ifndef THREAD_SAFE
128 #undef THREAD_SAFE
129 #endif
130 #ifndef _THREAD_SAFE
131 #undef _THREAD_SAFE
132 #endif
133
134 #ifndef _SGI_MP_SOURCE
135 #undef _SGI_MP_SOURCE
136 #endif
137
138 /* end of portable.h.pre */
139 ])
140 AH_BOTTOM([
141 /* begin of portable.h.post */
142
143 #define RETSIGTYPE void
144
145 #ifdef _WIN32
146 /* don't suck in all of the win32 api */
147 # define WIN32_LEAN_AND_MEAN 1
148 #endif
149
150 #ifndef LDAP_NEEDS_PROTOTYPES
151 /* force LDAP_P to always include prototypes */
152 #define LDAP_NEEDS_PROTOTYPES 1
153 #endif
154
155 #ifndef LDAP_REL_ENG
156 #if (LDAP_VENDOR_VERSION == 000000) && !defined(LDAP_DEVEL)
157 #define LDAP_DEVEL
158 #endif
159 #if defined(LDAP_DEVEL) && !defined(LDAP_TEST)
160 #define LDAP_TEST
161 #endif
162 #endif
163
164 #ifdef HAVE_STDDEF_H
165 # include <stddef.h>
166 #endif
167
168 #ifdef HAVE_EBCDIC
169 /* ASCII/EBCDIC converting replacements for stdio funcs
170 * vsnprintf and snprintf are used too, but they are already
171 * checked by the configure script
172 */
173 #define fputs ber_pvt_fputs
174 #define fgets ber_pvt_fgets
175 #define printf ber_pvt_printf
176 #define fprintf ber_pvt_fprintf
177 #define vfprintf ber_pvt_vfprintf
178 #define vsprintf ber_pvt_vsprintf
179 #endif
180
181 #include "ac/fdset.h"
182
183 #include "ldap_cdefs.h"
184 #include "ldap_features.h"
185
186 #include "ac/assert.h"
187 #include "ac/localize.h"
188
189 #endif /* _LDAP_PORTABLE_H */
190 /* end of portable.h.post */
191 ])
192
193 AC_CONFIG_HEADERS([include/portable.h:include/portable.hin])
194 AC_CONFIG_HEADERS([include/ldap_features.h:include/ldap_features.hin])
195 AC_CONFIG_HEADERS([include/lber_types.h:include/lber_types.hin])
196
197 dnl ================================================================
198 dnl Start Args
199 AC_MSG_CHECKING(configure arguments)
200 AC_PREFIX_DEFAULT(/usr/local)
201
202 top_builddir=`pwd`
203 AC_SUBST(top_builddir)dnl
204
205 dnl ----------------------------------------------------------------
206 dnl --with-subdir
207 ldap_subdir="/openldap"
208
209 AC_ARG_WITH(subdir,
210 [ --with-subdir=DIR change default subdirectory used for installs],
211 [case "$withval" in
212 no) ldap_subdir=""
213 ;;
214 yes)
215 ;;
216 /*|\\*)
217 ldap_subdir="$withval"
218 ;;
219 *)
220 ldap_subdir="/$withval"
221 ;;
222 esac
223 ])dnl
224
225 AC_SUBST(ldap_subdir)dnl
226
227 dnl ----------------------------------------------------------------
228 dnl General "enable" options
229 dnl set default to traditional to enable the original debug style
230 OL_ARG_ENABLE(debug, [AS_HELP_STRING([--enable-debug], [enable debugging])], yes, [no yes traditional])dnl
231 OL_ARG_ENABLE(dynamic, [AS_HELP_STRING([--enable-dynamic], [enable linking built binaries with dynamic libs])], auto)dnl
232 OL_ARG_ENABLE(syslog, [AS_HELP_STRING([--enable-syslog], [enable syslog support])], auto)dnl
233 dnl OL_ARG_ENABLE(referrals,[AS_HELP_STRING([--enable-referrals], [enable LDAPv2+ Referrals (experimental)])], no)dnl
234 ol_enable_referrals=${ol_enable_referrals-no}
235 OL_ARG_ENABLE(ipv6, [AS_HELP_STRING([--enable-ipv6], [enable IPv6 support])], auto)dnl
236 OL_ARG_ENABLE(local, [AS_HELP_STRING([--enable-local], [enable AF_LOCAL (AF_UNIX) socket support])], auto)dnl
237
238 dnl ----------------------------------------------------------------
239 dnl General "with" options
240 OL_ARG_WITH(cyrus_sasl, [AS_HELP_STRING([--with-cyrus-sasl], [with Cyrus SASL support])],
241 auto, [auto yes no] )
242 OL_ARG_WITH(systemd, [AS_HELP_STRING([--with-systemd], [with systemd service notification support])],
243 auto, [auto yes no] )
244 OL_ARG_WITH(fetch, [AS_HELP_STRING([--with-fetch], [with fetch(3) URL support])],
245 auto, [auto yes no] )
246 OL_ARG_WITH(threads,
247 [AS_HELP_STRING([--with-threads], [with threads library auto|nt|posix|pth|lwp|manual])],
248 auto, [auto nt posix pth lwp yes no manual] )
249 OL_ARG_WITH(tls,
250 [AS_HELP_STRING([--with-tls], [with TLS/SSL support auto|openssl|gnutls|mbedtls])],
251 auto, [auto openssl gnutls mbedtls yes no] )
252 OL_ARG_WITH(yielding_select,
253 [AS_HELP_STRING([--with-yielding-select], [with implicitly yielding select])],
254 auto, [auto yes no manual] )
255 OL_ARG_WITH(mp,
256 [AS_HELP_STRING([--with-mp], [with multiple precision statistics auto|longlong|long|bignum|gmp])],
257 auto, [auto longlong long bignum gmp yes no])
258 OL_ARG_WITH(odbc,
259 [AS_HELP_STRING([--with-odbc], [with specific ODBC support iodbc|unixodbc|odbc32|auto])],
260 auto, [auto iodbc unixodbc odbc32] )
261
262 dnl ----------------------------------------------------------------
263 dnl Server options
264 dnl ----------------------------------------------------------------
265
266 dnl ----------------------------------------------------------------
267 dnl SLAPD OPTIONS
268 SlapdOptions="dynacl \
269 aci \
270 cleartext \
271 crypt \
272 spasswd \
273 modules \
274 rlookups \
275 slapi \
276 slp \
277 wrappers"
278
279 AC_ARG_ENABLE(xxslapdoptions,[
280 SLAPD (Standalone LDAP Daemon) Options:])
281
282 OL_ARG_ENABLE(slapd, [AS_HELP_STRING([--enable-slapd], [enable building slapd])], yes)dnl
283 OL_ARG_ENABLE(dynacl, [AS_HELP_STRING([--enable-dynacl], [enable run-time loadable ACL support (experimental)])], no)dnl
284 OL_ARG_ENABLE(aci, [AS_HELP_STRING([--enable-aci], [enable per-object ACIs (experimental)])], no, [no yes mod])dnl
285 OL_ARG_ENABLE(cleartext, [AS_HELP_STRING([--enable-cleartext], [enable cleartext passwords])], yes)dnl
286 OL_ARG_ENABLE(crypt, [AS_HELP_STRING([--enable-crypt], [enable crypt(3) passwords])], no)dnl
287 OL_ARG_ENABLE(spasswd, [AS_HELP_STRING([--enable-spasswd], [enable (Cyrus) SASL password verification])], no)dnl
288 OL_ARG_ENABLE(modules, [AS_HELP_STRING([--enable-modules], [enable dynamic module support])], no)dnl
289 OL_ARG_ENABLE(rlookups, [AS_HELP_STRING([--enable-rlookups], [enable reverse lookups of client hostnames])], no)dnl
290 OL_ARG_ENABLE(slapi, [AS_HELP_STRING([--enable-slapi], [enable SLAPI support (experimental)])], no)dnl
291 OL_ARG_ENABLE(slp, [AS_HELP_STRING([--enable-slp], [enable SLPv2 support])], no)dnl
292 OL_ARG_ENABLE(wrappers, [AS_HELP_STRING([--enable-wrappers], [enable tcp wrapper support])], no)dnl
293
294 dnl ----------------------------------------------------------------
295 dnl SLAPD Backend Options
296 Backends="dnssrv \
297 ldap \
298 mdb \
299 meta \
300 asyncmeta \
301 null \
302 passwd \
303 perl \
304 relay \
305 sock \
306 sql \
307 wt"
308
309 AC_ARG_ENABLE(xxslapbackends,[
310 SLAPD Backend Options:])
311
312 OL_ARG_ENABLE(backends, [AS_HELP_STRING([--enable-backends], [enable all available backends])],
313 --, [no yes mod])dnl
314 OL_ARG_ENABLE(dnssrv, [AS_HELP_STRING([--enable-dnssrv], [enable dnssrv backend])],
315 no, [no yes mod], ol_enable_backends)dnl
316 OL_ARG_ENABLE(ldap, [AS_HELP_STRING([--enable-ldap], [enable ldap backend])],
317 no, [no yes mod], ol_enable_backends)dnl
318 OL_ARG_ENABLE(mdb, [AS_HELP_STRING([--enable-mdb], [enable mdb database backend])],
319 yes, [no yes mod], ol_enable_backends)dnl
320 OL_ARG_ENABLE(meta, [AS_HELP_STRING([--enable-meta], [enable metadirectory backend])],
321 no, [no yes mod], ol_enable_backends)dnl
322 OL_ARG_ENABLE(asyncmeta, [AS_HELP_STRING([--enable-asyncmeta], [enable asynchronous metadirectory backend])],
323 no, [no yes mod], ol_enable_backends)dnl
324 OL_ARG_ENABLE(null, [AS_HELP_STRING([--enable-null], [enable null backend])],
325 no, [no yes mod], ol_enable_backends)dnl
326 OL_ARG_ENABLE(passwd, [AS_HELP_STRING([--enable-passwd], [enable passwd backend])],
327 no, [no yes mod], ol_enable_backends)dnl
328 OL_ARG_ENABLE(perl, [AS_HELP_STRING([--enable-perl], [enable perl backend])],
329 no, [no yes mod], ol_enable_backends)dnl
330 OL_ARG_ENABLE(relay, [AS_HELP_STRING([--enable-relay], [enable relay backend])],
331 yes, [no yes mod], ol_enable_backends)dnl
332 OL_ARG_ENABLE(sock, [AS_HELP_STRING([--enable-sock], [enable sock backend])],
333 no, [no yes mod], ol_enable_backends)dnl
334 OL_ARG_ENABLE(sql, [AS_HELP_STRING([--enable-sql], [enable sql backend])],
335 no, [no yes mod], ol_enable_backends)dnl
336 OL_ARG_ENABLE(wt, [AS_HELP_STRING([--enable-wt], [enable WiredTiger backend])],
337 no, [no yes mod], ol_enable_backends)dnl
338
339 dnl ----------------------------------------------------------------
340 dnl SLAPD Overlay Options
341 Overlays="accesslog \
342 auditlog \
343 autoca \
344 collect \
345 constraint \
346 dds \
347 deref \
348 dyngroup \
349 dynlist \
350 homedir \
351 memberof \
352 otp \
353 ppolicy \
354 proxycache \
355 refint \
356 remoteauth \
357 retcode \
358 rwm \
359 seqmod \
360 sssvlv \
361 syncprov \
362 translucent \
363 unique \
364 valsort"
365
366 Pwmods="argon2"
367
368 AC_ARG_ENABLE(xxslapoverlays,[
369 SLAPD Overlay Options:])
370
371 OL_ARG_ENABLE(overlays, [AS_HELP_STRING([--enable-overlays], [enable all available overlays])],
372 --, [no yes mod])dnl
373 OL_ARG_ENABLE(accesslog, [AS_HELP_STRING([--enable-accesslog], [In-Directory Access Logging overlay])],
374 no, [no yes mod], ol_enable_overlays)
375 OL_ARG_ENABLE(auditlog, [AS_HELP_STRING([--enable-auditlog], [Audit Logging overlay])],
376 no, [no yes mod], ol_enable_overlays)
377 OL_ARG_ENABLE(autoca, [AS_HELP_STRING([--enable-autoca], [Automatic Certificate Authority overlay])],
378 no, [no yes mod], ol_enable_overlays)
379 OL_ARG_ENABLE(collect, [AS_HELP_STRING([--enable-collect], [Collect overlay])],
380 no, [no yes mod], ol_enable_overlays)
381 OL_ARG_ENABLE(constraint, [AS_HELP_STRING([--enable-constraint], [Attribute Constraint overlay])],
382 no, [no yes mod], ol_enable_overlays)
383 OL_ARG_ENABLE(dds, [AS_HELP_STRING([--enable-dds], [Dynamic Directory Services overlay])],
384 no, [no yes mod], ol_enable_overlays)
385 OL_ARG_ENABLE(deref, [AS_HELP_STRING([--enable-deref], [Dereference overlay])],
386 no, [no yes mod], ol_enable_overlays)
387 OL_ARG_ENABLE(dyngroup, [AS_HELP_STRING([--enable-dyngroup], [Dynamic Group overlay])],
388 no, [no yes mod], ol_enable_overlays)
389 OL_ARG_ENABLE(dynlist, [AS_HELP_STRING([--enable-dynlist], [Dynamic List overlay])],
390 no, [no yes mod], ol_enable_overlays)
391 OL_ARG_ENABLE(homedir, [AS_HELP_STRING([--enable-homedir], [Home Directory Management overlay])],
392 no, [no yes mod], ol_enable_overlays)
393 OL_ARG_ENABLE(memberof, [AS_HELP_STRING([--enable-memberof], [Reverse Group Membership overlay])],
394 no, [no yes mod], ol_enable_overlays)
395 OL_ARG_ENABLE(otp, [AS_HELP_STRING([--enable-otp], [OTP 2-factor authentication overlay])],
396 no, [no yes mod], ol_enable_overlays)
397 OL_ARG_ENABLE(ppolicy, [AS_HELP_STRING([--enable-ppolicy], [Password Policy overlay])],
398 no, [no yes mod], ol_enable_overlays)
399 OL_ARG_ENABLE(proxycache, [AS_HELP_STRING([--enable-proxycache], [Proxy Cache overlay])],
400 no, [no yes mod], ol_enable_overlays)
401 OL_ARG_ENABLE(refint, [AS_HELP_STRING([--enable-refint], [Referential Integrity overlay])],
402 no, [no yes mod], ol_enable_overlays)
403 OL_ARG_ENABLE(remoteauth, [AS_HELP_STRING([--enable-remoteauth], [Deferred Authentication overlay])],
404 no, [no yes mod], ol_enable_overlays)
405 OL_ARG_ENABLE(retcode, [AS_HELP_STRING([--enable-retcode], [Return Code testing overlay])],
406 no, [no yes mod], ol_enable_overlays)
407 OL_ARG_ENABLE(rwm, [AS_HELP_STRING([--enable-rwm], [Rewrite/Remap overlay])],
408 no, [no yes mod], ol_enable_overlays)
409 OL_ARG_ENABLE(seqmod, [AS_HELP_STRING([--enable-seqmod], [Sequential Modify overlay])],
410 no, [no yes mod], ol_enable_overlays)
411 OL_ARG_ENABLE(sssvlv, [AS_HELP_STRING([--enable-sssvlv], [ServerSideSort/VLV overlay])],
412 no, [no yes mod], ol_enable_overlays)
413 OL_ARG_ENABLE(syncprov, [AS_HELP_STRING([--enable-syncprov], [Syncrepl Provider overlay])],
414 yes, [no yes mod], ol_enable_overlays)
415 OL_ARG_ENABLE(translucent, [AS_HELP_STRING([--enable-translucent], [Translucent Proxy overlay])],
416 no, [no yes mod], ol_enable_overlays)
417 OL_ARG_ENABLE(unique, [AS_HELP_STRING([--enable-unique], [Attribute Uniqueness overlay])],
418 no, [no yes mod], ol_enable_overlays)
419 OL_ARG_ENABLE(valsort, [AS_HELP_STRING([--enable-valsort], [Value Sorting overlay])],
420 no, [no yes mod], ol_enable_overlays)
421
422 dnl ----------------------------------------------------------------
423 dnl PASSWORD MODULE OPTIONS
424 AC_ARG_ENABLE(pwmodoptions,[
425 SLAPD Password Module Options:])
426 OL_ARG_ENABLE(argon2, [AS_HELP_STRING([--enable-argon2], [Argon2 password hashing module])],
427 no, [no yes], ol_enable_pwmodules)
428 OL_ARG_WITH(argon2,
429 [AS_HELP_STRING([--with-argon2], [with argon2 support library auto|libsodium|libargon2])],
430 auto, [auto libsodium libargon2 yes no] )
431
432 dnl ----------------------------------------------------------------
433 dnl BALANCER OPTIONS
434 AC_ARG_ENABLE(balanceroptions,[
435 LLOADD (Load Balancer Daemon) Options:])
436 OL_ARG_ENABLE(balancer, [AS_HELP_STRING([--enable-balancer], [enable load balancer])],
437 no, [no yes mod])
438
439 dnl ----------------------------------------------------------------
440 dnl TESTSUITE OPTIONS
441 AC_ARG_ENABLE(testoptions,[
442 Test suite Options:])
443 OL_ARG_ENABLE(harness, [AS_HELP_STRING([--enable-harness], [enable mod_harness])],
444 no, [no yes])
445
446 dnl ----------------------------------------------------------------
447 AC_ARG_ENABLE(xxliboptions,[
448 Library Generation & Linking Options])
449 AC_ENABLE_STATIC
450 AC_ENABLE_SHARED
451 OL_ARG_ENABLE(versioning, [AS_HELP_STRING([--enable-versioning], [Enable versioned symbols in shared library])],
452 auto, [no yes auto])
453 dnl ----------------------------------------------------------------
454 dnl Validate options
455 dnl ----------------------------------------------------------------
456
457 if test $ol_enable_slapd = no ; then
458 dnl SLAPD was specifically disabled
459 dnl Disable all of its options
460
461 for i in $SlapdOptions; do
462 eval "ol_tmp=\$ol_enable_$i"
463 if test $ol_tmp = yes ; then
464 AC_MSG_WARN([slapd disabled, ignoring --enable-$i argument])
465 eval "ol_enable_$i=no"
466 fi
467 done
468
469 for i in $Backends $Overlays $Pwmods; do
470 eval "ol_tmp=\$ol_enable_$i"
471 if test $ol_tmp != no ; then
472 AC_MSG_WARN([slapd disabled, ignoring --enable-$i argument])
473 eval "ol_enable_$i=no"
474 fi
475 done
476
477 if test $ol_enable_balancer = mod ; then
478 AC_MSG_WARN([slapd disabled, ignoring --enable-balancer=mod argument])
479 ol_enable_balancer=no
480 fi
481
482 if test $ol_enable_harness != no ; then
483 AC_MSG_WARN([slapd disabled, ignoring --enable-harness=$ol_enable_harness argument])
484 ol_enable_harness=no
485 fi
486 else
487 dnl If slapd enabled and loadable module support disabled
488 dnl then require at least one built-in backend
489
490 if test $ol_enable_modules = no; then
491
492 for i in backends overlays balancer $Backends $Overlays; do
493 eval "ol_tmp=\$ol_enable_$i"
494 if test -n "$ol_tmp" && test "$ol_tmp" = mod ; then
495 AC_MSG_ERROR([--enable-$i=mod requires --enable-modules])
496 fi
497 done
498
499 for i in harness $Pwmods; do
500 eval "ol_tmp=\$ol_enable_$i"
501 if test -n "$ol_tmp" && test "$ol_tmp" = yes ; then
502 AC_MSG_ERROR([--enable-$i=yes requires --enable-modules])
503 fi
504 done
505
506 ol_any_backend=no
507 for i in $Backends; do
508 eval "ol_tmp=\$ol_enable_$i"
509 if test $ol_tmp = yes; then
510 ol_any_backend=yes
511 fi
512 done
513
514 if test $ol_any_backend = no; then
515 AC_MSG_ERROR([slapd requires a backend])
516 fi
517 fi
518 fi
519
520 if test $ol_enable_aci = yes ; then
521 if test $ol_enable_dynacl = no ; then
522 AC_MSG_ERROR([--enable-aci requires --enable-dynacl])
523 fi
524 elif test $ol_enable_aci = mod ; then
525 AC_MSG_ERROR([ACI build as dynamic module not supported (yet)])
526 fi
527
528 if test $ol_enable_modules = yes ; then
529 if test $ol_enable_dynamic = no ; then
530 AC_MSG_ERROR([--enable-modules requires --enable-dynamic])
531 fi
532 ol_enable_dynamic=yes
533 fi
534
535 if test $ol_enable_balancer != no ; then
536 dnl Load Balancer was specifically enabled
537 if test $ol_with_threads = no ; then
538 AC_MSG_ERROR([Load balancer requires threads])
539 fi
540 fi
541
542 if test $ol_enable_spasswd = yes ; then
543 if test $ol_with_cyrus_sasl = no ; then
544 AC_MSG_ERROR([--enable-spasswd requires --with-cyrus-sasl])
545 fi
546 ol_with_cyrus_sasl=yes
547 fi
548
549 if test $ol_enable_meta/$ol_enable_ldap = yes/no ; then
550 AC_MSG_ERROR([--enable-meta requires --enable-ldap])
551 fi
552
553 if test $ol_enable_asyncmeta/$ol_enable_ldap = yes/no ; then
554 AC_MSG_ERROR([--enable-asyncmeta requires --enable-ldap])
555 fi
556
557 AC_MSG_RESULT(done)
558
559 dnl ----------------------------------------------------------------
560 dnl Initialize vars
561 LDAP_LIBS=
562 SLAPD_NDB_LIBS=
563 SLAPD_NDB_INCS=
564 LTHREAD_LIBS=
565 LEVENT_LIBS=
566 LUTIL_LIBS=
567
568 CLIENT_LIBS=
569
570 SLAPD_LIBS=
571 BALANCER_LIBS=
572
573 BUILD_SLAPD=no
574 BUILD_BALANCER=no
575
576 BUILD_THREAD=no
577
578 BUILD_SLAPI=no
579 SLAPD_SLAPI_DEPEND=
580
581 BUILD_DNSSRV=no
582 BUILD_LDAP=no
583 BUILD_MDB=no
584 BUILD_META=no
585 BUILD_ASYNCMETA=no
586 BUILD_NDB=no
587 BUILD_NULL=no
588 BUILD_PASSWD=no
589 BUILD_PERL=no
590 BUILD_RELAY=no
591 BUILD_SHELL=no
592 BUILD_SOCK=no
593 BUILD_SQL=no
594 BUILD_WT=no
595
596 BUILD_ACCESSLOG=no
597 BUILD_AUDITLOG=no
598 BUILD_AUTOCA=no
599 BUILD_CONSTRAINT=no
600 BUILD_DDS=no
601 BUILD_DENYOP=no
602 BUILD_DEREF=no
603 BUILD_DYNGROUP=no
604 BUILD_DYNLIST=no
605 BUILD_LASTMOD=no
606 BUILD_HOMEDIR=no
607 BUILD_MEMBEROF=no
608 BUILD_OTP=no
609 BUILD_PPOLICY=no
610 BUILD_PROXYCACHE=no
611 BUILD_REFINT=no
612 BUILD_REMOTEAUTH=no
613 BUILD_RETCODE=no
614 BUILD_RWM=no
615 BUILD_SEQMOD=no
616 BUILD_SSSVLV=no
617 BUILD_SYNCPROV=no
618 BUILD_TRANSLUCENT=no
619 BUILD_UNIQUE=no
620 BUILD_VALSORT=no
621
622 BUILD_PW_ARGON2=no
623
624 BUILD_HARNESS=no
625
626 SLAPD_STATIC_OVERLAYS=
627 SLAPD_DYNAMIC_OVERLAYS=
628
629 SLAPD_DYNAMIC_PWMODS=
630
631 SLAPD_MODULES_LDFLAGS=
632 SLAPD_MODULES_CPPFLAGS=
633
634 SLAPD_STATIC_BACKENDS="back-ldif back-monitor"
635 SLAPD_DYNAMIC_BACKENDS=
636
637 SLAPD_PERL_LDFLAGS=
638 MOD_PERL_LDFLAGS=
639 PERL_CPPFLAGS=
640
641 SLAPD_SQL_LDFLAGS=
642 SLAPD_SQL_LIBS=
643 SLAPD_SQL_INCLUDES=
644
645 SASL_LIBS=
646 TLS_LIBS=
647 WITH_TLS_TYPE=no
648 MODULES_LIBS=
649 SLAPI_LIBS=
650 LIBSLAPI=
651 AUTH_LIBS=
652 SYSTEMD_LIBS=
653
654 SLAPD_SLP_LIBS=
655 SLAPD_GMP_LIBS=
656
657 dnl ================================================================
658 dnl Checks for programs
659
660 AC_DEFINE(HAVE_MKVERSION, 1, [define this if you have mkversion])
661
662 dnl ----------------------------------------------------------------
663 dnl
664 dnl Determine which C translator to use
665 dnl
666
667 dnl AIX Thread requires we use cc_r or xlc_r.
668 dnl But only do this IF AIX and CC is not set
669 dnl and threads are auto|yes|posix.
670 dnl
671 dnl If we find cc_r|xlc_r, force pthreads and assume
672 dnl pthread_create is in $LIBS (ie: don't bring in
673 dnl any additional thread libraries)
674 dnl If we do not find cc_r|xlc_r, disable threads
675
676 ol_aix_threads=no
677 case "$target" in
678 *-*-aix*) dnl all AIX is not a good idea.
679 if test -z "$CC" ; then
680 case "$ol_with_threads" in
681 auto | yes | posix) ol_aix_threads=yes ;;
682 esac
683 fi
684 ;;
685 esac
686
687 if test $ol_aix_threads = yes ; then
688 if test -z "${CC}" ; then
689 AC_CHECK_PROGS(CC,cc_r xlc_r cc)
690
691 if test "$CC" = cc ; then
692 dnl no CC! don't allow --with-threads
693 if test $ol_with_threads != auto ; then
694 AC_MSG_ERROR([--with-threads requires cc_r (or other suitable compiler) on AIX])
695 else
696 AC_MSG_WARN([disabling threads, no cc_r on AIX])
697 fi
698 ol_with_threads=no
699 fi
700 fi
701
702 case ${CC} in cc_r | xlc_r)
703 ol_with_threads=posix
704 ol_cv_pthread_create=yes
705 ;;
706 esac
707 fi
708
709 if test -z "${CC}"; then
710 AC_CHECK_PROGS(CC,cc gcc,missing)
711
712 if test "${CC}" = "missing" ; then
713 AC_MSG_ERROR([Unable to locate cc(1) or suitable replacement. Check PATH or set CC.])
714 fi
715 fi
716
717 if test -z "${AR}"; then
718 AC_CHECK_PROGS(AR,ar gar,missing)
719
720 if test "${AR}" = "missing" ; then
721 AC_MSG_ERROR([Unable to locate ar(1) or suitable replacement. Check PATH or set AR.])
722 fi
723 fi
724
725 if test -z "${STRIP}"; then
726 AC_CHECK_PROGS(STRIP,strip,missing)
727
728 if test "${STRIP}" = "missing" ; then
729 AC_MSG_ERROR([Unable to locate strip(1) or suitable replacement. Check PATH or set STRIP.])
730 fi
731 fi
732
733
734 AC_PROG_MAKE_SET
735 LT_INIT(dlopen, win32-dll)
736
737 dnl ----------------------------------------------------------------
738 dnl Perl
739 ol_link_perl=no
740 if test $ol_enable_perl != no ; then
741 AC_PATH_PROG(PERLBIN, perl, /usr/bin/perl)
742
743 if test "no$PERLBIN" = "no" ; then
744 if test $ol_enable_perl = yes ; then
745 AC_MSG_ERROR([could not locate perl])
746 fi
747
748 else
749 PERL_CPPFLAGS="`$PERLBIN -MExtUtils::Embed -e ccopts`"
750 PERL_LDFLAGS="`$PERLBIN -MExtUtils::Embed -e ldopts|sed -e 's/ -lc / /' -e 's/ -lc$//'`"
751
752 if test x"$ol_enable_perl" = "xyes" ; then
753 SLAPD_PERL_LDFLAGS="$PERL_LDFLAGS"
754 else
755 MOD_PERL_LDFLAGS="$PERL_LDFLAGS"
756 fi
757 dnl should check perl version
758 ol_link_perl=yes
759 fi
760 fi
761
762 AC_PROG_CPP
763 OL_MSVC
764
765 dnl ----------------------------------------------------------------
766 dnl Checks for Windows NT
767 case $host_os in
768 *mingw32* ) ac_cv_mingw32=yes ;;
769 *cygwin* ) ac_cv_cygwin=yes ;;
770 *interix* ) ac_cv_interix=yes ;;
771 esac
772
773 AC_CHECK_TOOL(RC, windres, )
774
775 dnl ----------------------------------------------------------------
776 dnl Checks for file extensions
777 AC_EXEEXT
778 AC_OBJEXT
779 AC_DEFINE_UNQUOTED(EXEEXT, "${EXEEXT}", [defined to be the EXE extension])
780
781 dnl ----------------------------------------------------------------
782 dnl BeOS requires -lbe -lroot -lnet
783 AC_CHECK_LIB(be, be_app, [LIBS="$LIBS -lbe -lroot -lnet"], :, [-lroot -lnet])
784
785 dnl ----------------------------------------------------------------
786 dnl OpenLDAP requires STDC features
787 AC_PROG_CC
788 if test "X${ac_cv_prog_cc_stdc}" = "Xno" ; then
789 AC_MSG_ERROR([OpenLDAP requires compiler to support STDC constructs.])
790 fi
791
792 dnl ----------------------------------------------------------------
793 dnl Check cc depend flags
794 OL_MKDEPEND
795 if test "${ol_cv_mkdep}" = no ; then
796 # this will soon become an error
797 AC_MSG_WARN([do not know how to generate dependencies])
798 fi
799
800 dnl ----------------------------------------------------------------
801 dnl Check for AIX security library
802 AC_CHECK_LIB(s, afopen, [
803 AUTH_LIBS=-ls
804 AC_DEFINE(HAVE_AIX_SECURITY,1,[define if you have AIX security lib])
805 ])
806
807 dnl ----------------------------------------------------------------
808 dnl Check for IBM OS/390
809 case "$target" in
810 *-ibm-openedition)
811 ac_cv_func_getopt=no
812 AC_DEFINE(BOTH_STRINGS_H,1,[define to use both <string.h> and <strings.h>])
813 ;;
814 esac
815
816 dnl ----------------------------------------------------------------
817 dnl Check for module support
818 ol_link_modules=no
819 WITH_MODULES_ENABLED=no
820 if test $ol_enable_modules != no ; then
821 AC_CHECK_HEADERS(ltdl.h)
822
823 if test $ac_cv_header_ltdl_h = no ; then
824 AC_MSG_ERROR([could not locate libtool ltdl.h])
825 fi
826
827 AC_CHECK_LIB(ltdl, lt_dlinit, [
828 MODULES_LIBS=-lltdl
829 AC_DEFINE(HAVE_LIBLTDL,1,[define if you have libtool -ltdl])
830 ])
831
832 if test "$ac_cv_lib_ltdl_lt_dlinit" = no ; then
833 AC_MSG_ERROR([could not locate libtool -lltdl])
834 fi
835 ol_link_modules=yes
836 WITH_MODULES_ENABLED=yes
837 fi
838
839 dnl ----------------------------------------------------------------
840 dnl Checks for header files.
841 OL_HEADER_STDC
842
843 if test $ol_cv_header_stdc != yes; then
844 AC_MSG_WARN([could not locate Standard C compliant headers])
845 fi
846
847 AC_HEADER_DIRENT
848 AC_HEADER_SYS_WAIT
849 AC_HEADER_TIOCGWINSZ
850
851 AC_CHECK_HEADERS( \
852 arpa/inet.h \
853 arpa/nameser.h \
854 assert.h \
855 bits/types.h \
856 conio.h \
857 crypt.h \
858 direct.h \
859 errno.h \
860 fcntl.h \
861 filio.h \
862 getopt.h \
863 grp.h \
864 io.h \
865 libutil.h \
866 limits.h \
867 locale.h \
868 malloc.h \
869 memory.h \
870 pwd.h \
871 process.h \
872 sgtty.h \
873 shadow.h \
874 stddef.h \
875 string.h \
876 strings.h \
877 sysexits.h \
878 sys/file.h \
879 sys/filio.h \
880 sys/fstyp.h \
881 sys/errno.h \
882 sys/ioctl.h \
883 sys/param.h \
884 sys/privgrp.h \
885 sys/resource.h \
886 sys/select.h \
887 sys/socket.h \
888 sys/stat.h \
889 sys/syslog.h \
890 sys/time.h \
891 sys/types.h \
892 sys/uio.h \
893 sys/vmount.h \
894 syslog.h \
895 termios.h \
896 unistd.h \
897 utime.h \
898 )
899
900 dnl Only check Winsock on MinGW
901 if test "$ac_cv_mingw32" = yes \
902 -o "$ac_cv_interix" = yes \
903 -o "$ol_cv_msvc" = yes
904 then
905 AC_CHECK_HEADERS( winsock.h winsock2.h )
906 fi
907
908 AC_CHECK_HEADERS( resolv.h, [], [],
909 [$ac_includes_default
910 #include <netinet/in.h>
911 ])
912
913 AC_CHECK_HEADERS( netinet/tcp.h, [], [],
914 [$ac_includes_default
915 #include <netinet/in.h>
916 ])
917
918 AC_CHECK_HEADERS( sys/ucred.h, [], [],
919 [$ac_includes_default
920 #ifdef HAVE_SYS_PARAM_H
921 #include <sys/param.h>
922 #endif
923 ])
924
925 dnl ----------------------------------------------------------------
926 dnl Checks for libraries
927
928 AC_CHECK_FUNCS( sigaction sigset )
929 AC_CHECK_FUNCS( fmemopen )
930
931 dnl HP-UX requires -lV3
932 dnl this is not needed on newer versions of HP-UX
933 if test $ac_cv_func_sigaction = no && test $ac_cv_func_sigaction = no ; then
934 AC_CHECK_LIB(V3, sigset)
935 fi
936
937 if test $ol_cv_msvc = yes ; then
938 ol_cv_winsock=yes
939 fi
940
941 dnl The following is INTENTIONALLY scripted out because shell does not
942 dnl support variable names with the '@' character, which is what
943 dnl autoconf would try to generate if one merely used AC_SEARCH_LIBS
944 if test "$ac_cv_header_winsock_h" = yes; then
945 AC_CACHE_CHECK([for winsock], [ol_cv_winsock],[
946 save_LIBS="$LIBS"
947 for curlib in none ws2_32 wsock32; do
948 if test $curlib != none ; then
949 LIBS="$save_LIBS -l$curlib"
950 fi
951 AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <winsock.h>
952 ]], [[
953 socket(0,0,0);
954 select(0,NULL,NULL,NULL,NULL);
955 closesocket(0);
956 gethostname(NULL,0);
957 ]])],[ol_cv_winsock=$curlib],[ol_cv_winsock=no])
958
959 test "$ol_cv_winsock" != no && break
960 done
961 LIBS="$save_LIBS"
962 ])
963
964 if test $ol_cv_winsock != no ; then
965 AC_DEFINE(HAVE_WINSOCK, 1, [define if you have winsock])
966 ac_cv_func_socket=yes
967 ac_cv_func_select=yes
968 ac_cv_func_closesocket=yes
969 ac_cv_func_gethostname=yes
970
971 if test $ol_cv_winsock != none -a $ol_cv_winsock != yes ; then
972 LIBS="$LIBS -l$ol_cv_winsock"
973 fi
974
975 if test $ol_cv_winsock = ws2_32 -o $ol_cv_winsock = yes ; then
976 AC_DEFINE(HAVE_WINSOCK2, 1, [define if you have winsock2])
977 fi
978 fi
979 fi
980
981 dnl Find socket()
982 dnl Likely combinations:
983 dnl -lsocket [ -lnsl_s | -lnsl ]
984 dnl -linet
985
986 AC_CHECK_FUNC(socket, :, [
987 dnl hopefully we won't include too many libraries
988 AC_CHECK_LIB(socket, main)
989 AC_CHECK_LIB(net, socket)
990 AC_CHECK_LIB(nsl_s, main)
991 AC_CHECK_LIB(nsl, main)
992 AC_CHECK_LIB(inet, socket)
993 AC_CHECK_LIB(gen, main)
994 ])
995
996 dnl require select
997 AC_CHECK_FUNC(select, :, AC_MSG_ERROR([select() required.]))
998
999 if test "${ac_cv_header_winsock_h}" != yes; then
1000 dnl Select arg types
1001 dnl (if this detection becomes permanent, it and the select() detection
1002 dnl should be done before the yielding select test)
1003 AC_FUNC_SELECT_ARGTYPES
1004 fi
1005
1006 dnl check to see if system call automatically restart
1007 dnl AC_SYS_RESTARTABLE_SYSCALLS
1008
1009 dnl ----------------------------------------------------------------
1010 AC_CHECK_FUNCS( poll )
1011 if test $ac_cv_func_poll = yes; then
1012 AC_CHECK_HEADERS( poll.h sys/poll.h )
1013 fi
1014
1015 dnl ----------------------------------------------------------------
1016 AC_CHECK_HEADERS( sys/epoll.h )
1017 if test "${ac_cv_header_sys_epoll_h}" = yes; then
1018 AC_MSG_CHECKING(for epoll system call)
1019 AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <stdlib.h>
1020 #ifdef HAVE_SYS_POLL_H
1021 #include <sys/epoll.h>
1022 #endif
1023 int main(int argc, char **argv)
1024 {
1025 int epfd = epoll_create(256);
1026 exit (epfd == -1 ? 1 : 0);
1027 }]])],[AC_MSG_RESULT(yes)
1028 AC_DEFINE(HAVE_EPOLL,1, [define if your system supports epoll])],[AC_MSG_RESULT(no)],[AC_MSG_RESULT(no)])
1029 fi
1030
1031 dnl ----------------------------------------------------------------
1032 AC_CHECK_HEADERS( sys/event.h )
1033 if test "${ac_cv_header_sys_event_h}" = yes; then
1034 AC_MSG_CHECKING(for kqueue system call)
1035 AC_RUN_IFELSE([AC_LANG_SOURCE([[$ac_includes_default
1036 #ifdef HAVE_SYS_EVENT_H
1037 #include <sys/event.h>
1038 #endif
1039 #ifdef HAVE_SYS_TIME_H
1040 #include <sys/time.h>
1041 #endif
1042 int main(int argc, char **argv)
1043 {
1044 int kqfd = kqueue();
1045 exit (kqfd == -1 ? 1 : 0);
1046 }]])],[AC_MSG_RESULT(yes)
1047 AC_DEFINE(HAVE_KQUEUE,1, [define if your system supports kqueue])],[AC_MSG_RESULT(no)],[AC_MSG_RESULT(no)])
1048 fi
1049
1050 dnl ----------------------------------------------------------------
1051 AC_CHECK_HEADERS( sys/devpoll.h )
1052 dnl "/dev/poll" needs <sys/poll.h> as well...
1053 if test "${ac_cv_header_sys_devpoll_h}" = yes \
1054 -a "${ac_cv_header_poll_h}" = yes ; \
1055 then
1056 AC_MSG_CHECKING(for /dev/poll)
1057 AC_RUN_IFELSE([AC_LANG_SOURCE([[int main(int argc, char **argv)
1058 {
1059 int devpollfd = open("/dev/poll", /* O_RDWR */ 2);
1060 exit (devpollfd == -1 ? 1 : 0);
1061 }]])],[AC_MSG_RESULT(yes)
1062 AC_DEFINE(HAVE_DEVPOLL,1, [define if your system supports /dev/poll])],[AC_MSG_RESULT(no)],[AC_MSG_RESULT(no)])
1063 fi
1064
1065 dnl ----------------------------------------------------------------
1066 OL_STRERROR
1067
1068 dnl ----------------------------------------------------------------
1069 dnl require POSIX regex
1070 AC_CHECK_HEADERS( regex.h, [], [],
1071 [$ac_includes_default
1072 #ifdef HAVE_SYS_TYPES_H
1073 #include <sys/types.h>
1074 #endif
1075 ])
1076
1077 if test "$ac_cv_header_regex_h" != yes ; then
1078 AC_MSG_ERROR([POSIX regex.h required.])
1079 fi
1080 AC_SEARCH_LIBS(regfree, [regex gnuregex],
1081 :, AC_MSG_ERROR([POSIX regex required.]))
1082
1083 OL_POSIX_REGEX
1084 if test "$ol_cv_c_posix_regex" = no ; then
1085 AC_MSG_ERROR([broken POSIX regex!])
1086 fi
1087
1088 dnl ----------------------------------------------------------------
1089 dnl UUID Support
1090
1091 have_uuid=no
1092 AC_CHECK_HEADERS(sys/uuid.h)
1093 dnl The HAVE_UUID_TO_STR code path also needs uuid_create
1094 if test $ac_cv_header_sys_uuid_h = yes ; then
1095 save_LIBS="$LIBS"
1096 AC_SEARCH_LIBS([uuid_to_str], [uuid], [have_uuid=yes], :)
1097 AC_SEARCH_LIBS([uuid_create], [uuid], :, [have_uuid=no])
1098 LIBS="$save_LIBS"
1099
1100 if test $have_uuid = yes ; then
1101 AC_DEFINE(HAVE_UUID_TO_STR,1,
1102 [define if you have uuid_to_str()])
1103
1104 test "$ac_cv_search_uuid_to_str" = "none required" || \
1105 LUTIL_LIBS="$LUTIL_LIBS $ac_cv_search_uuid_to_str"
1106 fi
1107 fi
1108
1109 dnl Look for uuid_generate
1110 dnl The HAVE_UUID_GENERATE code path also needs uuid_unparse_lower
1111 if test $have_uuid = no ; then
1112 AC_CHECK_HEADERS(uuid/uuid.h)
1113 if test $ac_cv_header_uuid_uuid_h = yes ; then
1114 save_LIBS="$LIBS"
1115 AC_SEARCH_LIBS([uuid_generate], [uuid], [have_uuid=yes], :)
1116 AC_SEARCH_LIBS([uuid_unparse_lower], [uuid], :, [have_uuid=no])
1117 LIBS="$save_LIBS"
1118
1119 if test $have_uuid = yes ; then
1120 AC_DEFINE(HAVE_UUID_GENERATE,1,
1121 [define if you have uuid_generate()])
1122
1123 test "$ac_cv_search_uuid_generate" = "none required" || \
1124 LUTIL_LIBS="$LUTIL_LIBS $ac_cv_search_uuid_generate"
1125 fi
1126 fi
1127 fi
1128
1129 dnl For windows, check for the need of RPCRT for UUID function support
1130 if test $have_uuid = no ; then
1131 AC_MSG_CHECKING(to see if -lrpcrt4 is needed for win32 UUID support)
1132 save_LIBS="$LIBS"
1133 LIBS="$LIBS -lrpcrt4"
1134 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
1135 int __stdcall UuidCreate(void *);
1136 int __stdcall UuidToStringA(void *,void **);
1137 ]], [[
1138 UuidCreate(0);
1139 UuidToStringA(0,0);
1140 ]])],[need_rpcrt=yes],[need_rpcrt=no])
1141 if test $need_rpcrt = yes; then
1142 SLAPD_LIBS="$SLAPD_LIBS -lrpcrt4"
1143 CLIENT_LIBS="$CLIENT_LIBS -lrpcrt4"
1144 fi
1145 LIBS="$save_LIBS"
1146 AC_MSG_RESULT($need_rpcrt)
1147 fi
1148
1149 dnl ----------------------------------------------------------------
1150 dnl Check for resolver routines
1151 OL_RESOLVER_LINK
1152
1153 ol_link_dnssrv=no
1154 if test "$ol_cv_lib_resolver" != no ; then
1155 AC_DEFINE(HAVE_RES_QUERY,1,
1156 [define if you have res_query()])
1157
1158 if test "$ol_enable_dnssrv" != no ; then
1159 ol_link_dnssrv=yes
1160 fi
1161
1162 if test "$ol_cv_lib_resolver" != yes ; then
1163 LIBS="$ol_cv_lib_resolver $LIBS"
1164 fi
1165 fi
1166
1167 if test "$ol_enable_dnssrv" = yes || test "$ol_enable_dnssrv" = mod ; then
1168 if test "$ol_link_dnssrv" = no ; then
1169 AC_MSG_ERROR([DNSSRV requires res_query()])
1170 fi
1171 else
1172 ol_enable_dnssrv=no
1173 fi
1174
1175 AC_CHECK_FUNCS( hstrerror )
1176
1177 dnl ----------------------------------------------------------------
1178 dnl PF_INET6 support requires getaddrinfo and INET6_ADDRSTRLEN
1179 dnl PF_LOCAL may use getaddrinfo in available
1180 AC_CHECK_FUNCS( getaddrinfo getnameinfo gai_strerror inet_ntop )
1181
1182 ol_link_ipv6=no
1183 if test $ac_cv_func_getaddrinfo = no || test $ac_cv_func_inet_ntop = no ; then
1184 if test $ol_enable_ipv6 = yes ; then
1185 AC_MSG_ERROR([IPv6 support requires getaddrinfo() and inet_ntop()])
1186 fi
1187 elif test $ol_enable_ipv6 != no ; then
1188 AC_CACHE_CHECK([INET6_ADDRSTRLEN],[ol_cv_inet6_addrstrlen],[
1189 AC_EGREP_CPP(__has_inet6_addrstrlen__,[
1190 # include <netinet/in.h>
1191 # ifdef INET6_ADDRSTRLEN
1192 __has_inet6_addrstrlen__;
1193 # endif
1194 ], [ol_cv_inet6_addrstrlen=yes], [ol_cv_inet6_addrstrlen=no])])
1195
1196
1197 AC_CACHE_CHECK([struct sockaddr_storage],ol_cv_struct_sockaddr_storage,[
1198 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1199 #include <sys/types.h>
1200 #include <sys/socket.h>
1201 ]], [[
1202 struct sockaddr_storage ss;
1203 ]])],[ol_cv_struct_sockaddr_storage=yes],[ol_cv_struct_sockaddr_storage=no])])
1204
1205 if test $ol_cv_inet6_addrstrlen = yes &&
1206 test $ol_cv_struct_sockaddr_storage = yes ; then
1207 ol_link_ipv6=yes
1208 elif test $ol_enable_ipv6 = yes &&
1209 test $ol_cv_inet6_addrstrlen = no ; then
1210 AC_MSG_ERROR([IPv6 support requires INET6_ADDRSTRLEN])
1211 elif test $ol_enable_ipv6 = yes &&
1212 test $ol_cv_struct_sockaddr_storage = no ; then
1213 AC_MSG_ERROR([IPv6 support requires struct sockaddr_storage])
1214 fi
1215 fi
1216
1217 if test $ol_enable_local != no ; then
1218 AC_CHECK_HEADERS( sys/un.h )
1219
1220 if test $ol_enable_local = auto ; then
1221 ol_enable_local=$ac_cv_header_sys_un_h
1222 elif test $ac_cv_header_sys_un_h = no ; then
1223 AC_MSG_ERROR([AF_LOCAL domain support requires sys/un.h])
1224 fi
1225 fi
1226
1227 dnl ----------------------------------------------------------------
1228 dnl TLS/SSL
1229
1230 if test $ol_with_tls = yes ; then
1231 ol_with_tls=auto
1232 fi
1233
1234 ol_link_tls=no
1235 if test $ol_with_tls = openssl || test $ol_with_tls = auto ; then
1236 AC_CHECK_HEADERS(openssl/ssl.h)
1237
1238 if test $ac_cv_header_openssl_ssl_h = yes ; then
1239 AC_PREPROC_IFELSE([AC_LANG_SOURCE(
1240 [[#include <openssl/opensslv.h>]
1241 [#if OPENSSL_VERSION_NUMBER < 0x1010100fL]
1242 [#error "OpenSSL is too old"]
1243 [#endif]])],
1244 , [AC_MSG_FAILURE([OpenSSL 1.1.1 or newer required])])
1245
1246 AC_CHECK_LIB(ssl, SSL_CTX_set_ciphersuites,
1247 [have_openssl=yes], [have_openssl=no],
1248 [-lcrypto])
1249
1250 if test $have_openssl = yes ; then
1251 ol_with_tls=openssl
1252 ol_link_tls=yes
1253 WITH_TLS_TYPE=openssl
1254
1255 AC_DEFINE(HAVE_OPENSSL, 1,
1256 [define if you have OpenSSL])
1257
1258 TLS_LIBS="-lssl -lcrypto"
1259 fi
1260 fi
1261 fi
1262
1263 if test $ol_link_tls = no ; then
1264 if test $ol_with_tls = gnutls || test $ol_with_tls = auto ; then
1265 AC_CHECK_HEADERS(gnutls/gnutls.h)
1266
1267 if test $ac_cv_header_gnutls_gnutls_h = yes ; then
1268 AC_PREPROC_IFELSE([AC_LANG_SOURCE(
1269 [[#include <gnutls/gnutls.h>]
1270 [#if GNUTLS_VERSION_NUMBER < 0x030306]
1271 [#error "GnuTLS is too old"]
1272 [#endif]])],
1273 , [AC_MSG_FAILURE([GnuTLS 3.3.6 or newer required])])
1274
1275 AC_CHECK_LIB(gnutls, gnutls_init,
1276 [have_gnutls=yes], [have_gnutls=no])
1277
1278 if test $have_gnutls = yes ; then
1279 ol_with_tls=gnutls
1280 ol_link_tls=yes
1281 WITH_TLS_TYPE=gnutls
1282
1283 TLS_LIBS="-lgnutls"
1284
1285 AC_DEFINE(HAVE_GNUTLS, 1,
1286 [define if you have GNUtls])
1287 fi
1288 fi
1289 fi
1290 fi
1291
1292 if test $ol_link_tls = no ; then
1293 if test $ol_with_tls = mbedtls || test $ol_with_tls = auto ; then
1294 AC_CHECK_HEADERS(mbedtls/ssl.h)
1295
1296 if test $ac_cv_header_mbedtls_ssl_h = yes ; then
1297 AC_PREPROC_IFELSE([AC_LANG_SOURCE(
1298 [[#include <mbedtls/version.h>]
1299 [#if MBEDTLS_VERSION_NUMBER < 0x02120000]
1300 [#error "mbedtls is too old"]
1301 [#endif]])],
1302 , [AC_MSG_FAILURE([mbedtls 2.18.0 or newer required])])
1303
1304 AC_CHECK_LIB(mbedtls, mbedtls_ssl_init,
1305 [have_mbedtls=yes], [have_mbedtls=no], -lmbedx509 -lmbedcrypto)
1306
1307 if test $have_mbedtls = yes ; then
1308 ol_with_tls=mbedtls
1309 ol_link_tls=yes
1310 WITH_TLS_TYPE=mbedtls
1311
1312 TLS_LIBS="-lmbedtls -lmbedx509 -lmbedcrypto"
1313
1314 AC_DEFINE(HAVE_MBEDTLS, 1,
1315 [define if you have mbedtls])
1316 fi
1317 fi
1318 fi
1319 fi
1320
1321 WITH_TLS=no
1322 if test $ol_link_tls = yes ; then
1323 AC_DEFINE(HAVE_TLS, 1, [define if you have TLS])
1324 WITH_TLS=yes
1325 elif test $ol_with_tls = auto ; then
1326 AC_MSG_WARN([Could not locate TLS/SSL package])
1327 AC_MSG_WARN([TLS data protection not supported!])
1328 elif test $ol_with_tls != no ; then
1329 AC_MSG_ERROR([Could not locate TLS/SSL package])
1330 else
1331 AC_MSG_WARN([TLS data protection not supported!])
1332 fi
1333
1334
1335 dnl ----------------------------------------------------------------
1336 dnl Threads?
1337 ol_link_threads=no
1338
1339 case $ol_with_threads in auto | yes | nt)
1340
1341 OL_NT_THREADS
1342
1343 if test "$ol_cv_nt_threads" = yes ; then
1344 ol_link_threads=nt
1345 ol_with_threads=found
1346 ol_with_yielding_select=yes
1347
1348 AC_DEFINE(HAVE_NT_SERVICE_MANAGER,1,[if you have NT Service Manager])
1349 AC_DEFINE(HAVE_NT_EVENT_LOG,1,[if you have NT Event Log])
1350 fi
1351
1352 if test $ol_with_threads = nt ; then
1353 AC_MSG_ERROR([could not locate NT Threads])
1354 fi
1355 ;;
1356 esac
1357
1358 case $ol_with_threads in auto | yes | posix)
1359
1360 AC_CHECK_HEADERS(pthread.h)
1361
1362 if test $ac_cv_header_pthread_h = yes ; then
1363 OL_POSIX_THREAD_VERSION
1364
1365 if test $ol_cv_pthread_version != 0 ; then
1366 AC_DEFINE_UNQUOTED(HAVE_PTHREADS,$ol_cv_pthread_version,
1367 [define to pthreads API spec revision])
1368 else
1369 AC_MSG_ERROR([unknown pthread version])
1370 fi
1371
1372 # consider threads found
1373 ol_with_threads=found
1374
1375 OL_HEADER_LINUX_THREADS
1376 OL_HEADER_GNU_PTH_PTHREAD_H
1377
1378 if test $ol_cv_header_gnu_pth_pthread_h = no ; then
1379 AC_CHECK_HEADERS(sched.h)
1380 fi
1381
1382 dnl Now the hard part, how to link?
1383 dnl
1384 dnl currently supported checks:
1385 dnl
1386 dnl Check for no flags
1387 dnl pthread_create() in $LIBS
1388 dnl
1389 dnl Check special pthread (final) flags
1390 dnl [skipped] pthread_create() with -mt (Solaris) [disabled]
1391 dnl pthread_create() with -kthread (FreeBSD)
1392 dnl pthread_create() with -pthread (FreeBSD/Digital Unix)
1393 dnl pthread_create() with -pthreads (?)
1394 dnl pthread_create() with -mthreads (AIX)
1395 dnl pthread_create() with -thread (?)
1396 dnl
1397 dnl Check pthread (final) libraries
1398 dnl pthread_mutex_unlock() in -lpthread -lmach -lexc -lc_r (OSF/1)
1399 dnl pthread_mutex_lock() in -lpthread -lmach -lexc (OSF/1)
1400 dnl [skipped] pthread_mutex_trylock() in -lpthread -lexc (OSF/1)
1401 dnl pthread_join() -Wl,-woff,85 -lpthread (IRIX)
1402 dnl pthread_create() in -lpthread (many)
1403 dnl pthread_create() in -lc_r (FreeBSD)
1404 dnl
1405 dnl Check pthread (draft4) flags (deprecated)
1406 dnl pthread_create() with -threads (OSF/1)
1407 dnl
1408 dnl Check pthread (draft4) libraries (deprecated)
1409 dnl pthread_mutex_unlock() in -lpthreads -lmach -lexc -lc_r (OSF/1)
1410 dnl pthread_mutex_lock() in -lpthreads -lmach -lexc (OSF/1)
1411 dnl pthread_mutex_trylock() in -lpthreads -lexc (OSF/1)
1412 dnl pthread_create() in -lpthreads (many)
1413 dnl
1414
1415 dnl pthread_create in $LIBS
1416 AC_CACHE_CHECK([for pthread_create in default libraries],
1417 ol_cv_pthread_create,[
1418 AC_RUN_IFELSE([OL_PTHREAD_TEST_PROGRAM],
1419 [ol_cv_pthread_create=yes],
1420 [ol_cv_pthread_create=no],
1421 [AC_LINK_IFELSE([AC_LANG_PROGRAM([[OL_PTHREAD_TEST_INCLUDES]], [[OL_PTHREAD_TEST_FUNCTION]])],[ol_cv_pthread_create=yes],[ol_cv_pthread_create=no])])])
1422
1423 if test $ol_cv_pthread_create != no ; then
1424 ol_link_threads=posix
1425 ol_link_pthreads=""
1426 fi
1427
1428 dnl OL_PTHREAD_TRY([-mt], [ol_cv_pthread_mt])
1429 OL_PTHREAD_TRY([-kthread], [ol_cv_pthread_kthread])
1430 OL_PTHREAD_TRY([-pthread], [ol_cv_pthread_pthread])
1431 OL_PTHREAD_TRY([-pthreads], [ol_cv_pthread_pthreads])
1432 OL_PTHREAD_TRY([-mthreads], [ol_cv_pthread_mthreads])
1433 OL_PTHREAD_TRY([-thread], [ol_cv_pthread_thread])
1434
1435 OL_PTHREAD_TRY([-lpthread -lmach -lexc -lc_r],
1436 [ol_cv_pthread_lpthread_lmach_lexc_lc_r])
1437 OL_PTHREAD_TRY([-lpthread -lmach -lexc],
1438 [ol_cv_pthread_lpthread_lmach_lexc])
1439 dnl OL_PTHREAD_TRY([-lpthread -lexc],
1440 dnl [ol_cv_pthread_lpthread_lexc])
1441
1442 OL_PTHREAD_TRY([-lpthread -Wl,-woff,85],
1443 [ol_cv_pthread_lib_lpthread_woff])
1444
1445 OL_PTHREAD_TRY([-lpthread], [ol_cv_pthread_lpthread])
1446 OL_PTHREAD_TRY([-lc_r], [ol_cv_pthread_lc_r])
1447
1448 OL_PTHREAD_TRY([-threads], [ol_cv_pthread_threads])
1449
1450 OL_PTHREAD_TRY([-lpthreads -lmach -lexc -lc_r],
1451 [ol_cv_pthread_lpthreads_lmach_lexc_lc_r])
1452 OL_PTHREAD_TRY([-lpthreads -lmach -lexc],
1453 [ol_cv_pthread_lpthreads_lmach_lexc])
1454 OL_PTHREAD_TRY([-lpthreads -lexc],
1455 [ol_cv_pthread_lpthreads_lexc])
1456
1457 OL_PTHREAD_TRY([-lpthreads],[ol_cv_pthread_lib_lpthreads])
1458
1459 if test $ol_link_threads != no ; then
1460 LTHREAD_LIBS="$LTHREAD_LIBS $ol_link_pthreads"
1461
1462 dnl save flags
1463 save_CPPFLAGS="$CPPFLAGS"
1464 save_LIBS="$LIBS"
1465 LIBS="$LTHREAD_LIBS $LIBS"
1466
1467 dnl All POSIX Thread (final) implementations should have
1468 dnl sched_yield instead of pthread yield.
1469 dnl check for both, and thr_yield for Solaris
1470 AC_CHECK_FUNCS(sched_yield pthread_yield thr_yield)
1471
1472 if test $ac_cv_func_sched_yield = no &&
1473 test $ac_cv_func_pthread_yield = no &&
1474 test $ac_cv_func_thr_yield = no ; then
1475 dnl Digital UNIX has sched_yield() in -lrt
1476 AC_CHECK_LIB(rt, sched_yield,
1477 [LTHREAD_LIBS="$LTHREAD_LIBS -lrt"
1478 AC_DEFINE(HAVE_SCHED_YIELD,1,
1479 [Define if you have the sched_yield function.])
1480 ac_cv_func_sched_yield=yes],
1481 [ac_cv_func_sched_yield=no])
1482 fi
1483 if test $ac_cv_func_sched_yield = no &&
1484 test $ac_cv_func_pthread_yield = no &&
1485 test "$ac_cv_func_thr_yield" = no ; then
1486 AC_MSG_WARN([could not locate sched_yield() or pthread_yield()])
1487 fi
1488
1489 dnl Check functions for compatibility
1490 AC_CHECK_FUNCS(pthread_kill)
1491
1492 dnl Check for pthread_rwlock_destroy with <pthread.h>
1493 dnl as pthread_rwlock_t may not be defined.
1494 AC_CACHE_CHECK([for pthread_rwlock_destroy with <pthread.h>],
1495 [ol_cv_func_pthread_rwlock_destroy], [
1496 dnl save the flags
1497 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
1498 #include <pthread.h>
1499 pthread_rwlock_t rwlock;
1500 ]], [[pthread_rwlock_destroy(&rwlock);]])],[ol_cv_func_pthread_rwlock_destroy=yes],[ol_cv_func_pthread_rwlock_destroy=no])
1501 ])
1502 if test $ol_cv_func_pthread_rwlock_destroy = yes ; then
1503 AC_DEFINE(HAVE_PTHREAD_RWLOCK_DESTROY,1,
1504 [define if you have pthread_rwlock_destroy function])
1505 fi
1506
1507 dnl Check for pthread_detach with <pthread.h> inclusion
1508 dnl as it's symbol may have been mangled.
1509 AC_CACHE_CHECK([for pthread_detach with <pthread.h>],
1510 [ol_cv_func_pthread_detach], [
1511 dnl save the flags
1512 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
1513 #include <pthread.h>
1514 pthread_t thread;
1515 ]], [[pthread_detach(thread);]])],[ol_cv_func_pthread_detach=yes],[ol_cv_func_pthread_detach=no])
1516 ])
1517
1518 if test $ol_cv_func_pthread_detach = no ; then
1519 AC_MSG_ERROR([could not locate pthread_detach()])
1520 fi
1521
1522 AC_DEFINE(HAVE_PTHREAD_DETACH,1,
1523 [define if you have pthread_detach function])
1524
1525 dnl Check for setconcurrency functions
1526 AC_CHECK_FUNCS( \
1527 pthread_setconcurrency \
1528 pthread_getconcurrency \
1529 thr_setconcurrency \
1530 thr_getconcurrency \
1531 )
1532
1533 OL_SYS_LINUX_THREADS
1534 OL_LINUX_THREADS
1535
1536 if test $ol_cv_linux_threads = error; then
1537 AC_MSG_ERROR([LinuxThreads header/library mismatch]);
1538 fi
1539
1540 AC_CACHE_CHECK([AC_LANG_SOURCE([if pthread_create() works])],
1541 ol_cv_pthread_create_works,[
1542 AC_RUN_IFELSE([OL_PTHREAD_TEST_PROGRAM],
1543 [ol_cv_pthread_create_works=yes],
1544 [ol_cv_pthread_create_works=no],
1545 [dnl assume yes
1546 ol_cv_pthread_create_works=yes])])
1547
1548 if test $ol_cv_pthread_create_works = no ; then
1549 AC_MSG_ERROR([pthread_create is not usable, check environment settings])
1550 fi
1551
1552 ol_replace_broken_yield=no
1553 dnl case "$target" in
1554 dnl *-*-linux*)
1555 dnl AC_CHECK_FUNCS(nanosleep)
1556 dnl ol_replace_broken_yield=yes
1557 dnl ;;
1558 dnl esac
1559
1560 if test $ol_replace_broken_yield = yes ; then
1561 AC_DEFINE([REPLACE_BROKEN_YIELD],1,
1562 [define if sched_yield yields the entire process])
1563 fi
1564
1565 dnl Check if select causes an yield
1566 if test $ol_with_yielding_select = auto ; then
1567 AC_CACHE_CHECK([if select yields when using pthreads],
1568 ol_cv_pthread_select_yields,[
1569 AC_RUN_IFELSE([AC_LANG_SOURCE([[
1570 #define _XOPEN_SOURCE 500 /* For pthread_setconcurrency() on glibc */
1571 #include <stdlib.h>
1572 #include <stdio.h>
1573 #include <sys/types.h>
1574 #include <sys/time.h>
1575 #include <unistd.h>
1576 #include <pthread.h>
1577 #ifndef NULL
1578 #define NULL (void*) 0
1579 #endif
1580
1581 static int fildes[2];
1582
1583 #ifdef __STDC__
1584 static void *task(void *p)
1585 #else
1586 static void *task(p)
1587 void *p;
1588 #endif
1589 {
1590 int i;
1591 struct timeval tv;
1592
1593 fd_set rfds;
1594
1595 tv.tv_sec=10;
1596 tv.tv_usec=0;
1597
1598 FD_ZERO(&rfds);
1599 FD_SET(fildes[0], &rfds);
1600
1601 /* we're not interested in any fds */
1602 i = select(FD_SETSIZE, &rfds, NULL, NULL, &tv);
1603
1604 if(i < 0) {
1605 perror("select");
1606 exit(10);
1607 }
1608
1609 exit(0); /* if we exit here, the select blocked the whole process */
1610 }
1611
1612 #ifdef __STDC__
1613 int main(int argc, char **argv)
1614 #else
1615 int main(argc, argv)
1616 int argc;
1617 char **argv;
1618 #endif
1619 {
1620 pthread_t t;
1621
1622 /* create a pipe to select */
1623 if(pipe(&fildes[0])) {
1624 perror("select");
1625 exit(1);
1626 }
1627
1628 #ifdef HAVE_PTHREAD_SETCONCURRENCY
1629 (void) pthread_setconcurrency(2);
1630 #else
1631 #ifdef HAVE_THR_SETCONCURRENCY
1632 /* Set Solaris LWP concurrency to 2 */
1633 thr_setconcurrency(2);
1634 #endif
1635 #endif
1636
1637 #if HAVE_PTHREADS < 6
1638 pthread_create(&t, pthread_attr_default, task, NULL);
1639 #else
1640 pthread_create(&t, NULL, task, NULL);
1641 #endif
1642
1643 /* make sure task runs first */
1644 #ifdef HAVE_THR_YIELD
1645 thr_yield();
1646 #elif defined( HAVE_SCHED_YIELD )
1647 sched_yield();
1648 #elif defined( HAVE_PTHREAD_YIELD )
1649 pthread_yield();
1650 #endif
1651
1652 exit(2);
1653 }]])],[ol_cv_pthread_select_yields=no],[ol_cv_pthread_select_yields=yes],[ol_cv_pthread_select_yields=cross])])
1654
1655 if test $ol_cv_pthread_select_yields = cross ; then
1656 AC_MSG_ERROR([crossing compiling: use --with-yielding_select=yes|no|manual])
1657 fi
1658
1659 if test $ol_cv_pthread_select_yields = yes ; then
1660 ol_with_yielding_select=yes
1661 fi
1662 fi
1663
1664 dnl restore flags
1665 CPPFLAGS="$save_CPPFLAGS"
1666 LIBS="$save_LIBS"
1667 else
1668 AC_MSG_ERROR([could not locate usable POSIX Threads])
1669 fi
1670 fi
1671
1672 if test $ol_with_threads = posix ; then
1673 AC_MSG_ERROR([could not locate POSIX Threads])
1674 fi
1675 ;;
1676 esac
1677
1678 case $ol_with_threads in auto | yes | pth)
1679
1680 AC_CHECK_HEADERS(pth.h)
1681
1682 if test $ac_cv_header_pth_h = yes ; then
1683 AC_CHECK_LIB(pth, pth_version, [have_pth=yes], [have_pth=no])
1684
1685 if test $have_pth = yes ; then
1686 AC_DEFINE(HAVE_GNU_PTH,1,[if you have GNU Pth])
1687 LTHREAD_LIBS="$LTHREAD_LIBS -lpth"
1688 ol_link_threads=pth
1689 ol_with_threads=found
1690
1691 if test $ol_with_yielding_select = auto ; then
1692 ol_with_yielding_select=yes
1693 fi
1694 fi
1695 fi
1696 ;;
1697 esac
1698
1699 case $ol_with_threads in auto | yes | lwp)
1700
1701 dnl check for SunOS5 LWP
1702 AC_CHECK_HEADERS(thread.h synch.h)
1703 if test $ac_cv_header_thread_h = yes &&
1704 test $ac_cv_header_synch_h = yes ; then
1705 AC_CHECK_LIB(thread, thr_create, [have_thr=yes], [have_thr=no])
1706
1707 if test $have_thr = yes ; then
1708 AC_DEFINE(HAVE_THR,1,
1709 [if you have Solaris LWP (thr) package])
1710 LTHREAD_LIBS="$LTHREAD_LIBS -lthread"
1711 ol_link_threads=thr
1712
1713 if test $ol_with_yielding_select = auto ; then
1714 ol_with_yielding_select=yes
1715 fi
1716
1717 dnl Check for setconcurrency functions
1718 AC_CHECK_FUNCS( \
1719 thr_setconcurrency \
1720 thr_getconcurrency \
1721 )
1722 fi
1723 fi
1724 ;;
1725 esac
1726
1727 if test $ol_with_yielding_select = yes ; then
1728 AC_DEFINE(HAVE_YIELDING_SELECT,1,
1729 [define if select implicitly yields])
1730 fi
1731
1732 if test $ol_with_threads = manual ; then
1733 dnl User thinks he can manually configure threads.
1734 ol_link_threads=yes
1735
1736 AC_MSG_WARN([thread defines and link options must be set manually])
1737
1738 AC_CHECK_HEADERS(pthread.h sched.h)
1739 AC_CHECK_FUNCS(sched_yield pthread_yield)
1740 OL_HEADER_LINUX_THREADS
1741
1742 AC_CHECK_HEADERS(thread.h synch.h)
1743 fi
1744
1745 if test $ol_link_threads != no && test $ol_link_threads != nt ; then
1746 dnl needed to get reentrant/threadsafe versions
1747 dnl
1748 AC_DEFINE(REENTRANT,1)
1749 AC_DEFINE(_REENTRANT,1)
1750 AC_DEFINE(THREAD_SAFE,1)
1751 AC_DEFINE(_THREAD_SAFE,1)
1752 AC_DEFINE(THREADSAFE,1)
1753 AC_DEFINE(_THREADSAFE,1)
1754 AC_DEFINE(_SGI_MP_SOURCE,1)
1755
1756 dnl The errno declaration may dependent upon _REENTRANT.
1757 dnl If it does, we must link with thread support.
1758 AC_CACHE_CHECK([for thread specific errno],
1759 [ol_cv_errno_thread_specific], [
1760 AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <errno.h>]], [[errno = 0;]])],[ol_cv_errno_thread_specific=yes],[ol_cv_errno_thread_specific=no])
1761 ])
1762
1763 dnl The h_errno declaration may dependent upon _REENTRANT.
1764 dnl If it does, we must link with thread support.
1765 AC_CACHE_CHECK([for thread specific h_errno],
1766 [ol_cv_h_errno_thread_specific], [
1767 AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <netdb.h>]], [[h_errno = 0;]])],[ol_cv_h_errno_thread_specific=yes],[ol_cv_h_errno_thread_specific=no])
1768 ])
1769
1770 if test $ol_cv_errno_thread_specific != yes ||
1771 test $ol_cv_h_errno_thread_specific != yes ; then
1772 LIBS="$LTHREAD_LIBS $LIBS"
1773 LTHREAD_LIBS=""
1774 fi
1775
1776 dnl When in thread environment, use
1777 dnl #if defined( HAVE_REENTRANT_FUNCTIONS ) || defined( HAVE_FUNC_R )
1778 dnl func_r(...);
1779 dnl #else
1780 dnl /* lock */
1781 dnl func(...);
1782 dnl /* unlock */
1783 dnl #endif
1784 dnl
1785 dnl HAVE_REENTRANT_FUNCTIONS is derived from:
1786 dnl _POSIX_REENTRANT_FUNCTIONS
1787 dnl _POSIX_THREAD_SAFE_FUNCTIONS
1788 dnl _POSIX_THREADSAFE_FUNCTIONS
1789 dnl
1790 dnl and is currently defined in <ldap_pvt_thread.h>
1791 dnl
1792 dnl libldap/*.c should only include <ldap_pvt_thread.h> iff
1793 dnl LDAP_R_COMPILE is defined. ie:
1794 dnl #ifdef LDAP_R_COMPILE
1795 dnl # include <ldap_pvt_thread.h>
1796 dnl #endif
1797 dnl
1798 dnl LDAP_R_COMPILE is defined by libldap/ldap-int.h
1799 dnl specifically for compiling the threadsafe version of
1800 dnl the ldap library.
1801 dnl
1802 dnl dnl check for reentrant/threadsafe functions
1803 dnl dnl
1804 dnl dnl note: these should only be used when linking
1805 dnl dnl with $LTHREAD_LIBS
1806 dnl dnl
1807 dnl save_CPPFLAGS="$CPPFLAGS"
1808 dnl save_LIBS="$LIBS"
1809 dnl LIBS="$LTHREAD_LIBS $LIBS"
1810 dnl AC_CHECK_FUNCS( \
1811 dnl gmtime_r \
1812 dnl gethostbyaddr_r gethostbyname_r \
1813 dnl feof_unlocked unlocked_feof \
1814 dnl putc_unlocked unlocked_putc \
1815 dnl flockfile ftrylockfile \
1816 dnl )
1817 dnl CPPFLAGS="$save_CPPFLAGS"
1818 dnl LIBS="$save_LIBS"
1819 fi
1820
1821 if test $ol_link_threads = no ; then
1822 if test $ol_enable_slapd != no; then
1823 AC_MSG_ERROR([slapd requires thread support])
1824 fi
1825
1826 if test $ol_with_threads = yes ; then
1827 AC_MSG_ERROR([no suitable thread support])
1828 fi
1829
1830 if test $ol_with_threads = auto ; then
1831 AC_MSG_WARN([no suitable thread support, disabling threads])
1832 ol_with_threads=no
1833 fi
1834
1835 AC_DEFINE(NO_THREADS,1,
1836 [define if you have (or want) no threads])
1837 LTHREAD_LIBS=""
1838 BUILD_THREAD=no
1839 else
1840 BUILD_THREAD=yes
1841 fi
1842
1843 if test $ol_link_threads != no ; then
1844 AC_DEFINE(LDAP_API_FEATURE_X_OPENLDAP_THREAD_SAFE,1,
1845 [define to 1 if library is thread safe])
1846
1847 dnl This could be enabled without threads if all of the
1848 dnl reentrant functions are available. Needs testing.
1849 AC_DEFINE(LDAP_API_FEATURE_X_OPENLDAP_REENTRANT,1,
1850 [define to 1 if library is reentrant])
1851 fi
1852
1853 dnl ----------------------------------------------------------------
1854 dnl Tests for reentrant functions necessary for reentrant build
1855 AC_CHECK_FUNCS( \
1856 ctime_r \
1857 gmtime_r localtime_r \
1858 gethostbyname_r gethostbyaddr_r \
1859 )
1860
1861 if test "$ac_cv_func_ctime_r" = no ; then
1862 ol_cv_func_ctime_r_nargs=0
1863 else
1864 OL_FUNC_CTIME_R_NARGS
1865 dnl OL_FUNC_CTIME_R_TYPE
1866 fi
1867
1868 if test "$ac_cv_func_gethostbyname_r" = yes ; then
1869 OL_FUNC_GETHOSTBYNAME_R_NARGS
1870 else
1871 ol_cv_func_gethostbyname_r_nargs=0
1872 fi
1873
1874 if test "$ac_cv_func_gethostbyaddr_r" = yes ; then
1875 OL_FUNC_GETHOSTBYADDR_R_NARGS
1876 else
1877 ol_cv_func_gethostbyaddr_r_nargs=0
1878 fi
1879
1880 dnl ----------------------------------------------------------------
1881
1882 if test $ol_enable_dynamic = yes && test $enable_shared = yes ; then
1883 BUILD_LIBS_DYNAMIC=shared
1884 AC_DEFINE(LDAP_LIBS_DYNAMIC, 1, [define if LDAP libs are dynamic])
1885 LTSTATIC=""
1886 else
1887 BUILD_LIBS_DYNAMIC=static
1888 LTSTATIC="-static"
1889 fi
1890 AC_SUBST(LTSTATIC)dnl
1891
1892 dnl ----------------------------------------------------------------
1893 if test $ol_enable_wrappers != no ; then
1894 AC_CHECK_HEADERS(tcpd.h,[
1895 AC_MSG_CHECKING([for TCP wrappers library])
1896 save_LIBS="$LIBS"
1897 LIBS="$LIBS -lwrap"
1898 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
1899 #include <tcpd.h>
1900 int allow_severity = 0;
1901 int deny_severity = 0;
1902
1903 struct request_info *req;
1904 ]], [[
1905 hosts_access(req)
1906 ]])],[AC_MSG_RESULT([-lwrap])
1907 have_wrappers=yes
1908 LIBS="$save_LIBS"],[
1909 dnl try with -lnsl
1910 LIBS="$LIBS -lnsl"
1911 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
1912 #include <tcpd.h>
1913 int allow_severity = 0;
1914 int deny_severity = 0;
1915
1916 struct request_info *req;
1917 ]], [[
1918 hosts_access(req)
1919 ]])],[AC_MSG_RESULT([-lwrap -lnsl])
1920 have_wrappers=yes
1921 LIBS="$save_LIBS -lnsl"],[
1922 AC_MSG_RESULT(no)
1923 have_wrappers=no
1924 LIBS=$save_LIBS])])],[have_wrappers=no])
1925
1926 if test $have_wrappers = yes ; then
1927 AC_DEFINE(HAVE_TCPD,1, [define if you have -lwrap])
1928 WRAP_LIBS="-lwrap"
1929 elif test $ol_enable_wrappers = yes ; then
1930 AC_MSG_ERROR([could not find TCP wrappers, select appropriate options or disable])
1931 else
1932 AC_MSG_WARN([could not find TCP wrappers, support disabled])
1933 WRAP_LIBS=""
1934 fi
1935 fi
1936
1937 dnl ----------------------------------------------------------------
1938 if test $ol_enable_syslog != no ; then
1939 AC_CHECK_FUNC(openlog)
1940 if test $ac_cv_func_openlog = no && test $ol_enable_syslog = yes; then
1941 AC_MSG_ERROR(could not find syslog, select appropriate options or disable)
1942 fi
1943 ol_enable_syslog=$ac_cv_func_openlog
1944 fi
1945
1946 dnl ----------------------------------------------------------------
1947 dnl SQL
1948 ol_link_sql=no
1949 if test $ol_enable_sql != no ; then
1950 AC_CHECK_HEADERS(sql.h sqlext.h,[],[
1951 AC_MSG_ERROR([could not locate SQL headers])
1952 ])
1953
1954 sql_LIBS="$LIBS"
1955 LIBS="$LTHREAD_LIBS $LIBS"
1956
1957 if test $ol_with_odbc = auto ; then
1958 ol_with_odbc="iodbc unixodbc odbc32"
1959 fi
1960
1961 for odbc in $ol_with_odbc ; do
1962 if test $ol_link_sql = no ; then
1963 case $odbc in
1964 iodbc)
1965 AC_CHECK_LIB(iodbc, SQLDriverConnect, [have_iodbc=yes], [have_iodbc=no])
1966 if test $have_iodbc = yes ; then
1967 ol_link_sql="-liodbc"
1968 fi
1969 ;;
1970
1971 unixodbc)
1972 AC_CHECK_LIB(odbc, SQLDriverConnect, [have_odbc=yes], [have_odbc=no])
1973 if test $have_odbc = yes ; then
1974 ol_link_sql="-lodbc"
1975 fi
1976 ;;
1977
1978 odbc32)
1979 AC_CHECK_LIB(odbc32, SQLDriverConnect, [have_odbc32=yes], [have_odbc32=no])
1980
1981 dnl The windows API uses __stdcall which cannot be detected by AC_CHECK_LIB
1982 if test $have_odbc32 = no ; then
1983 AC_MSG_CHECKING([for SQLDriverConnect in -lodbc32 with windows.h])
1984 save_LIBS="$LIBS"
1985 LIBS="$LIBS -lodbc32"
1986 AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <windows.h>
1987 #include <sqlext.h>
1988 ]], [[
1989 SQLDriverConnect(NULL,NULL,NULL,0,NULL,0,NULL,0);
1990 ]])],[have_odbc32=yes], [have_odbc32=no])
1991 LIBS="$save_LIBS"
1992 AC_MSG_RESULT($have_odbc32)
1993 fi
1994
1995 if test $have_odbc32 = yes ; then
1996 ol_link_sql="-lodbc32"
1997 fi
1998 ;;
1999
2000 *)
2001 AC_MSG_ERROR([unknown ODBC library])
2002 ;;
2003 esac
2004 fi
2005 done
2006
2007 LIBS="$sql_LIBS"
2008
2009 if test $ol_link_sql != no ; then
2010 SLAPD_SQL_LIBS="$ol_link_sql"
2011
2012 elif test $ol_enable_sql != auto ; then
2013 AC_MSG_ERROR([could not locate suitable ODBC library])
2014 fi
2015 fi
2016
2017 dnl ----------------------------------------------------------------
2018 dnl WiredTiger
2019 ol_link_wt=no
2020 if test $ol_enable_wt != no ; then
2021 PKG_CHECK_MODULES(WT, wiredtiger)
2022 if test $ol_enable_wt = yes ; then
2023 SLAPD_LIBS="$SLAPD_LIBS \$(WT_LIBS)"
2024 fi
2025 ol_link_wt=yes
2026 fi
2027
2028 dnl ----------------------------------------------------------------
2029 dnl
2030 dnl Check for Cyrus SASL
2031 dnl
2032 WITH_SASL=no
2033 ol_link_sasl=no
2034 ol_link_spasswd=no
2035 if test $ol_with_cyrus_sasl != no ; then
2036 AC_CHECK_HEADERS(sasl/sasl.h sasl.h)
2037
2038 if test $ac_cv_header_sasl_sasl_h = yes ||
2039 test $ac_cv_header_sasl_h = yes; then
2040 AC_CHECK_LIB(sasl2, sasl_client_init,
2041 [ol_link_sasl="-lsasl2"],
2042 [AC_CHECK_LIB(sasl, sasl_client_init,
2043 [ol_link_sasl="-lsasl"])])
2044 fi
2045
2046 if test $ol_link_sasl = no ; then
2047 if test $ol_with_cyrus_sasl != auto ; then
2048 AC_MSG_ERROR([Could not locate Cyrus SASL])
2049 else
2050 AC_MSG_WARN([Could not locate Cyrus SASL])
2051 AC_MSG_WARN([SASL authentication not supported!])
2052 if test $ol_link_tls = no ; then
2053 AC_MSG_WARN([Strong authentication not supported!])
2054 fi
2055 fi
2056 else
2057 OL_SASL_COMPAT
2058 if test $ol_cv_sasl_compat = no ; then
2059 ol_link_sasl=no
2060 AC_MSG_ERROR([Cyrus SASL library located but is incompatible])
2061 fi
2062
2063 AC_DEFINE(HAVE_CYRUS_SASL,1,[define if you have Cyrus SASL])
2064 SASL_LIBS="$ol_link_sasl"
2065 if test $ol_enable_spasswd != no ; then
2066 ol_link_spasswd=yes
2067 fi
2068
2069 ac_save_LIBS="$LIBS"
2070 LIBS="$LIBS $ol_link_sasl"
2071 AC_CHECK_FUNC(sasl_version, [AC_DEFINE(HAVE_SASL_VERSION,1,
2072 [define if your SASL library has sasl_version()])])
2073 LIBS="$ac_save_LIBS"
2074
2075 WITH_SASL=yes
2076 fi
2077
2078 else
2079 AC_MSG_WARN([SASL authentication not supported!])
2080 if test $ol_link_tls = no ; then
2081 AC_MSG_WARN([Strong authentication not supported!])
2082 fi
2083 fi
2084
2085 dnl ----------------------------------------------------------------
2086 dnl
2087 dnl Check for systemd (only if we have a server)
2088 dnl
2089 WITH_SYSTEMD=no
2090 systemdsystemunitdir=
2091 ol_link_systemd=no
2092 if test $ol_enable_slapd = no && test $ol_enable_balancer != yes ; then
2093 if test $ol_with_systemd != no ; then
2094 AC_MSG_WARN([servers disabled, ignoring --with-systemd=$ol_with_systemd argument])
2095 ol_with_systemd=no
2096 fi
2097 fi
2098 if test $ol_with_systemd != no ; then
2099 AC_CHECK_HEADERS(systemd/sd-daemon.h)
2100
2101 if test $ac_cv_header_systemd_sd_daemon_h = yes; then
2102 AC_CHECK_LIB(systemd, sd_notify,
2103 [ol_link_systemd="-lsystemd"])
2104 fi
2105
2106 if test $ol_link_systemd = no ; then
2107 if test $ol_with_systemd != auto ; then
2108 AC_MSG_ERROR([Could not locate systemd])
2109 else
2110 AC_MSG_WARN([Could not locate systemd])
2111 AC_MSG_WARN([systemd service notification not supported!])
2112 fi
2113 else
2114 AC_DEFINE(HAVE_SYSTEMD,1,[define if you have systemd])
2115 SYSTEMD_LIBS="$ol_link_systemd"
2116 WITH_SYSTEMD=yes
2117
2118 PKG_CHECK_VAR(systemdsystemunitdir, systemd, systemdsystemunitdir)
2119 if test -z "$systemdsystemunitdir"; then
2120 if test -d /usr/lib/systemd/system; then
2121 systemdsystemunitdir=/usr/lib/systemd/system
2122 else
2123 systemdsystemunitdir=/lib/systemd/system
2124 fi
2125 fi
2126 fi
2127 fi
2128 AC_SUBST(systemdsystemunitdir)
2129
2130 dnl ----------------------------------------------------------------
2131 dnl Check for entropy sources
2132 if test $cross_compiling != yes && test "$ac_cv_mingw32" != yes ; then
2133 dev=no
2134 if test -r /dev/urandom ; then
2135 dev="/dev/urandom";
2136 elif test -r /idev/urandom ; then
2137 dev="/idev/urandom";
2138 elif test -r /dev/srandom ; then
2139 dev="/dev/srandom";
2140 elif test -r /dev/random ; then
2141 dev="/dev/random";
2142 elif test -r /idev/random ; then
2143 dev="/idev/random";
2144 fi
2145
2146 if test $dev != no ; then
2147 AC_DEFINE_UNQUOTED(URANDOM_DEVICE,"$dev",[set to urandom device])
2148 fi
2149 fi
2150
2151 dnl ----------------------------------------------------------------
2152 dnl
2153 dnl Check for fetch URL support
2154 dnl should be extended to support other fetch URL APIs
2155 dnl
2156 ol_link_fetch=no
2157 if test $ol_with_fetch != no ; then
2158 OL_LIB_FETCH
2159
2160 if test $ol_cv_lib_fetch != no ; then
2161 LIBS="$LIBS $ol_link_fetch"
2162 ol_link_fetch=freebsd
2163
2164 elif test $ol_with_fetch != auto ; then
2165 AC_MSG_ERROR(no suitable API for --with-fetch=$ol_with_fetch)
2166 fi
2167 fi
2168
2169 dnl ----------------------------------------------------------------
2170 dnl FreeBSD (and others) have crypt(3) in -lcrypt
2171 if test $ol_enable_crypt != no ; then
2172 save_LIBS="$LIBS"
2173 LIBS="$TLS_LIBS $LIBS"
2174
2175 AC_CHECK_FUNC(crypt, [have_crypt=yes], [
2176 LIBS="$save_LIBS"
2177 AC_CHECK_LIB(crypt, crypt, [LUTIL_LIBS="$LUTIL_LIBS -lcrypt"
2178 have_crypt=yes], [have_crypt=no])])
2179
2180 LIBS="$TLS_LIBS $LIBS"
2181 AC_CHECK_LIB(crypt, crypt_r, [have_crypt_r=yes], [have_crypt_r=no])
2182
2183 LIBS="$save_LIBS"
2184
2185 if test $have_crypt = yes ; then
2186 AC_DEFINE(HAVE_CRYPT,1, [define if crypt(3) is available])
2187 if test $have_crypt_r = yes ; then
2188 AC_DEFINE(HAVE_CRYPT_R, 1, [define if crypt_r() is also available])
2189 fi
2190 else
2191 AC_MSG_WARN([could not find crypt])
2192 if test $ol_enable_crypt = yes ; then
2193 AC_MSG_ERROR([could not find crypt, select appropriate options or disable])
2194 fi
2195
2196 AC_MSG_WARN([disabling crypt support])
2197 ol_enable_crypt=no
2198 fi
2199 fi
2200
2201 dnl ----------------------------------------------------------------
2202 if test $ol_enable_slp != no ; then
2203 AC_CHECK_HEADERS( slp.h )
2204
2205 if test $ac_cv_header_slp_h = yes ; then
2206 AC_CHECK_LIB(slp, SLPOpen, [have_slp=yes], [have_slp=no])
2207 if test $have_slp = yes ; then
2208 AC_DEFINE(HAVE_SLP, 1, [define if you have -lslp])
2209 SLAPD_SLP_LIBS=-lslp
2210 fi
2211
2212 elif test $ol_enable_slp = yes ; then
2213 AC_MSG_ERROR([SLP not found])
2214 fi
2215 fi
2216
2217 dnl ----------------------------------------------------------------
2218 dnl Libevent
2219 if test $ol_enable_balancer != no ; then
2220 AC_MSG_CHECKING(compiler support for atomics)
2221 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],
2222 [[__atomic_thread_fence( __ATOMIC_ACQUIRE );]])],
2223 [AC_MSG_RESULT(yes)],
2224 [AC_MSG_ERROR(["Balancer requires support for atomic operations"])])
2225
2226 AC_CHECK_LIB(event_extra, evdns_base_new,
2227 [have_libevent=yes
2228 LEVENT_LIBS="$LEVENT_LIBS -levent_core -levent_extra"],
2229 [AC_CHECK_LIB(event, evdns_base_new,
2230 [have_libevent=yes
2231 LEVENT_LIBS="$LEVENT_LIBS -levent"],
2232 [have_libevent=no])])
2233 AC_CHECK_LIB(event, libevent_global_shutdown, [], [have_libevent=no])
2234
2235 if test $have_libevent = yes ; then
2236 AC_DEFINE(HAVE_LIBEVENT, 1, [define if you have -levent])
2237 else
2238 AC_MSG_ERROR([You need libevent 2.1 or later with DNS support to build the load balancer])
2239 fi
2240
2241 AC_CHECK_LIB(m, pow, [BALANCER_LIBS="$BALANCER_LIBS -lm"],
2242 [AC_MSG_ERROR([could not locate pow -lm])])
2243 fi
2244
2245 dnl ----------------------------------------------------------------
2246 dnl Checks for typedefs, structures, and compiler characteristics.
2247
2248 AC_CHECK_TYPE(mode_t, int)
2249 AC_CHECK_TYPE(off_t, long)
2250 AC_CHECK_TYPE(pid_t, int)
2251 AC_CHECK_TYPE(ssize_t, [signed int])
2252 AC_CHECK_TYPE(caddr_t, [char *])
2253 AC_CHECK_TYPE(size_t, unsigned)
2254
2255 AC_CHECK_TYPES([long long])
2256 AC_CHECK_TYPES([ptrdiff_t])
2257
2258
2259 AC_CHECK_TYPE([socklen_t],,, [$ac_includes_default
2260 #ifdef HAVE_SYS_SOCKET_H
2261 #include <sys/socket.h>
2262 #endif
2263 #ifdef HAVE_WINSOCK2
2264 #include <ws2tcpip.h>
2265 #endif])
2266
2267 dnl socklen_t-like type in accept(), default socklen_t or int:
2268 dnl - The OS might define socklen_t without using it. POSIX moved from
2269 dnl int to size_t to socklen_t, hoping to stay at a 32-bit type, and
2270 dnl HP-UX now has selectors for what to use.
2271 dnl - On Solaris 2.8 the prototype has void *len, but the default is OK.
2272 AC_MSG_CHECKING([the type of arg 3 to accept()])
2273 AC_CACHE_VAL(ol_cv_type_ber_socklen_t, [
2274 set socklen_t int unsigned "unsigned long" long size_t
2275 test "$ac_cv_type_socklen_t" = yes || shift
2276 ol_cv_type_ber_socklen_t=$1 guessing="guessing "
2277 for lentype in "$@" ; do for addrtype in "struct sockaddr" void ; do
2278 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([$ac_includes_default
2279 #ifdef HAVE_SYS_SOCKET_H
2280 #include <sys/socket.h>
2281 #endif
2282 extern int accept(int s, $addrtype *ap, $lentype *lp);
2283 ], [
2284 accept(0, (struct sockaddr *) 0, ($lentype *) 0);
2285 ])], [ol_cv_type_ber_socklen_t=$lentype guessing= ; break 2])
2286 done ; done])
2287 AC_MSG_RESULT([$guessing$ol_cv_type_ber_socklen_t *])
2288 AC_DEFINE_UNQUOTED(ber_socklen_t, $ol_cv_type_ber_socklen_t,
2289 [Define to the type of arg 3 for `accept'.])
2290
2291 dnl Modules should use ber_socklen_t, not socklen_t. Define socklen_t
2292 dnl for the time being anyway, for backwards compatibility.
2293 if test "$ac_cv_type_socklen_t" != yes; then
2294 AC_DEFINE_UNQUOTED([socklen_t], [$ol_cv_type_ber_socklen_t],
2295 [Define like ber_socklen_t if <sys/socket.h> does not define.])
2296 fi
2297
2298
2299 AC_CHECK_TYPE([sig_atomic_t],,
2300 [AC_DEFINE_UNQUOTED([sig_atomic_t], [int],
2301 [Define to `int' if <signal.h> does not define.])],
2302 [$ac_includes_default
2303 #include <signal.h>
2304 ])
2305
2306 AC_TYPE_UID_T
2307
2308 AC_CHECK_HEADERS_ONCE([sys/time.h])
2309 AC_STRUCT_TM
2310 AC_CHECK_MEMBERS([struct stat.st_blksize])
2311 AC_CHECK_MEMBERS([struct passwd.pw_gecos],,,[$ac_includes_default
2312 #include <pwd.h>])
2313 AC_CHECK_MEMBERS([struct passwd.pw_passwd],,,[$ac_includes_default
2314 #include <pwd.h>])
2315
2316 OL_C_UPPER_LOWER
2317 AC_C_CONST
2318 OL_C_VOLATILE
2319
2320 if test $cross_compiling = yes ; then
2321 AC_MSG_WARN([Crossing compiling... all bets are off!])
2322 AC_DEFINE(CROSS_COMPILING, 1, [define if cross compiling])
2323 else
2324 AC_C_BIGENDIAN
2325 fi
2326
2327 AC_CHECK_SIZEOF(short)
2328 AC_CHECK_SIZEOF(int)
2329 AC_CHECK_SIZEOF(long)
2330 AC_CHECK_SIZEOF(long long)
2331 AC_CHECK_SIZEOF(wchar_t)
2332
2333 if test "$ac_cv_sizeof_int" -lt 4 ; then
2334 AC_MSG_WARN([OpenLDAP requires 'int' to be 32 bits or greater.])
2335
2336 AC_DEFINE(LBER_INT_T,long,[define to 32-bit or greater integer type])
2337 else
2338 AC_DEFINE(LBER_INT_T,int,[define to 32-bit or greater integer type])
2339 fi
2340
2341 AC_DEFINE(LBER_LEN_T,long,[define to large integer type])
2342 AC_DEFINE(LBER_SOCKET_T,int,[define to socket descriptor type])
2343 AC_DEFINE(LBER_TAG_T,long,[define to large integer type])
2344
2345 dnl ----------------------------------------------------------------
2346 dnl Check for multiple precision support
2347 if test $ol_with_mp = longlong || test $ol_with_mp = auto ; then
2348 if test $ac_cv_sizeof_long_long -gt 4 ; then
2349 ol_with_mp=longlong
2350 AC_DEFINE(USE_MP_LONG_LONG,1,[define to use 'long long' for MP])
2351 elif test $ol_with_mp = longlong ; then
2352 AC_MSG_ERROR([long long unusable for multiple precision])
2353 fi
2354 fi
2355 if test $ol_with_mp = long || test $ol_with_mp = auto ; then
2356 if test $ac_cv_sizeof_long -gt 4 ; then
2357 ol_with_mp=long
2358 AC_DEFINE(USE_MP_LONG,1,[define to use 'long' for MP])
2359 elif test $ol_with_mp = long ; then
2360 AC_MSG_ERROR([long unusable for multiple precision])
2361 fi
2362 fi
2363 if test $ol_with_mp = bignum || test $ol_with_mp = auto ; then
2364 AC_CHECK_HEADERS(openssl/bn.h)
2365 AC_CHECK_HEADERS(openssl/crypto.h)
2366 if test "$ac_cv_header_openssl_bn_h" = "yes" &&
2367 test "$ac_cv_header_openssl_crypto_h" = "yes" &&
2368 test "$ol_with_tls" = "found" ; then
2369 ol_with_mp=bignum
2370 AC_DEFINE(USE_MP_BIGNUM,1,[define to use OpenSSL BIGNUM for MP])
2371 elif test $ol_with_mp = bignum ; then
2372 AC_MSG_ERROR([bignum not available])
2373 fi
2374 fi
2375 if test $ol_with_mp = gmp || test $ol_with_mp = auto ; then
2376 AC_CHECK_HEADERS(gmp.h)
2377 AC_CHECK_LIB(gmp, __gmpz_add_ui)
2378 if test $ac_cv_header_gmp_h = yes && test $ac_cv_lib_gmp___gmpz_add_ui = yes ; then
2379 AC_DEFINE(USE_MP_GMP,1,[define to use GMP for MP])
2380 ol_with_mp=gmp
2381 elif test $ol_with_mp = gmp ; then
2382 AC_MSG_ERROR([gmp not available])
2383 fi
2384 fi
2385 if test $ol_with_mp = auto ; then
2386 ol_with_mp=no
2387 fi
2388
2389 dnl ----------------------------------------------------------------
2390 dnl Checks for library functions.
2391 AC_FUNC_MEMCMP
2392
2393 if test $ac_cv_func_memcmp_working = no ; then
2394 AC_DEFINE(NEED_MEMCMP_REPLACEMENT,1,
2395 [define if memcmp is not 8-bit clean or is otherwise broken])
2396 fi
2397
2398 AC_FUNC_STRFTIME
2399
2400 OL_FUNC_INET_ATON
2401
2402 dnl Check for NT specific routines
2403 AC_CHECK_FUNC(_spawnlp, AC_DEFINE(HAVE_SPAWNLP,1,[if you have spawnlp()]))
2404
2405 AC_CHECK_FUNC(_snprintf, [ac_cv_func_snprintf=yes
2406 AC_DEFINE(snprintf, _snprintf, [define to snprintf routine])
2407 ])
2408
2409 AC_CHECK_FUNCS(vsnprintf _vsnprintf)
2410
2411 if test $ac_cv_func_vsnprintf = no -a $ac_cv_func__vsnprintf = yes ; then
2412 ac_cv_func_vsnprintf=yes
2413 AC_DEFINE(vsnprintf, _vsnprintf, [define to vsnprintf routine])
2414 fi
2415
2416 AC_FUNC_VPRINTF
2417
2418 if test $ac_cv_func_vprintf = yes ; then
2419 dnl check for vsnprintf
2420 AC_CHECK_FUNCS(snprintf vsnprintf)
2421 fi
2422
2423 AC_CHECK_FUNCS( \
2424 bcopy \
2425 clock_gettime \
2426 closesocket \
2427 chroot \
2428 endgrent \
2429 endpwent \
2430 fcntl \
2431 flock \
2432 fstat \
2433 getdtablesize \
2434 geteuid \
2435 getgrgid \
2436 gethostname \
2437 getpassphrase \
2438 getpwuid \
2439 getpwnam \
2440 getspnam \
2441 gettimeofday \
2442 initgroups \
2443 inet_ntoa_b \
2444 ioctl \
2445 lockf \
2446 memcpy \
2447 memmove \
2448 memrchr \
2449 mkstemp \
2450 mktemp \
2451 pipe \
2452 read \
2453 recv \
2454 recvfrom \
2455 setpwfile \
2456 setgid \
2457 setegid \
2458 setsid \
2459 setuid \
2460 seteuid \
2461 signal \
2462 strdup \
2463 strpbrk \
2464 strrchr \
2465 strsep \
2466 strstr \
2467 strtol \
2468 strtoul \
2469 strtoq \
2470 strtouq \
2471 strtoll \
2472 strtoull \
2473 strspn \
2474 sysconf \
2475 waitpid \
2476 wait4 \
2477 write \
2478 send \
2479 sendmsg \
2480 sendto \
2481 )
2482
2483 dnl We actually may need to replace more than this.
2484 AC_REPLACE_FUNCS(getopt getpeereid)
2485
2486 if test "$ac_cv_func_getopt" != yes; then
2487 LIBSRCS="$LIBSRCS getopt.c"
2488 fi
2489
2490 if test "$ac_cv_func_getpeereid" != yes; then
2491 AC_CHECK_FUNCS( getpeerucred )
2492 if test "$ac_cv_func_getpeerucred" != yes ; then
2493 AC_CHECK_MEMBERS([struct msghdr.msg_accrightslen],,,
2494 [$ac_includes_default
2495 #ifdef HAVE_SYS_SOCKET_H
2496 #include <sys/socket.h>
2497 #endif])
2498 if test "$ac_cv_member_struct_msghdr_msg_accrightslen" != yes; then
2499 AC_CHECK_MEMBERS([struct msghdr.msg_control],,,
2500 [$ac_includes_default
2501 #ifdef HAVE_SYS_SOCKET_H
2502 #include <sys/socket.h>
2503 #endif])
2504 fi
2505 AC_CHECK_MEMBERS([struct stat.st_fstype, struct stat.st_vfstype])
2506 if test "$ac_cv_member_struct_stat_st_fstype" = yes; then
2507 AC_COMPILE_IFELSE([AC_LANG_SOURCE([struct stat st; char *ptr=st.st_fstype;])],
2508 AC_DEFINE([HAVE_STRUCT_STAT_ST_FSTYPE_CHAR],1,[define to 1 if st_fstype is char *]),
2509 AC_DEFINE([HAVE_STRUCT_STAT_ST_FSTYPE_INT],1,[define to 1 if st_fstype is int]))
2510 fi
2511 fi
2512 LIBSRCS="$LIBSRCS getpeereid.c"
2513 fi
2514
2515 if test "$ac_cv_func_snprintf" != yes ||
2516 test "$ac_cv_func_vsnprintf" != yes; then
2517 if test "$ac_cv_func_snprintf" != yes; then
2518 AC_DEFINE(snprintf, ber_pvt_snprintf, [define to snprintf routine])
2519 fi
2520 if test "$ac_cv_func_vsnprintf" != yes; then
2521 AC_DEFINE(vsnprintf, ber_pvt_vsnprintf, [define to snprintf routine])
2522 fi
2523 fi
2524
2525 dnl ----------------------------------------------------------------
2526 dnl Sort out defines
2527
2528 if test "$ol_enable_slapi" != no ; then
2529 dnl This check is done also if --enable-modules is used;
2530 dnl it is duplicated here, 'cause it'd be cached anyway
2531 AC_CHECK_HEADERS(ltdl.h)
2532
2533 if test $ac_cv_header_ltdl_h != yes ; then
2534 AC_MSG_ERROR([could not locate <ltdl.h>])
2535 fi
2536 AC_CHECK_LIB(ltdl, lt_dlinit, [
2537 SLAPI_LIBS=-lltdl
2538 LIBSLAPI=slapi/libslapi.la
2539 AC_DEFINE(HAVE_LIBLTDL,1,[define if you have libtool -ltdl])
2540 ],[AC_MSG_ERROR([could not locate libtool -lltdl])])
2541
2542 AC_DEFINE(LDAP_SLAPI,1, [define this to add SLAPI code])
2543 fi
2544
2545 if test "$ol_enable_debug" != no ; then
2546 if test "$ol_enable_debug" = traditional; then
2547 AC_DEFINE(OLD_DEBUG,1,
2548 [define to use the original debug style])
2549 fi
2550 AC_DEFINE(LDAP_DEBUG,1,
2551 [define this to add debugging code])
2552 fi
2553 if test "$ol_enable_syslog" != no ; then
2554 AC_DEFINE(LDAP_SYSLOG,1,
2555 [define this to add syslog code])
2556 fi
2557 if test "$ol_enable_referrals" != no ; then
2558 AC_DEFINE(LDAP_API_FEATURE_X_OPENLDAP_V2_REFERRALS,LDAP_VENDOR_VERSION,
2559 [define to LDAP VENDOR VERSION])
2560 fi
2561 if test "$ol_enable_local" != no; then
2562 AC_DEFINE(LDAP_PF_LOCAL,1,[define to support PF_LOCAL])
2563 fi
2564 if test "$ol_link_ipv6" != no; then
2565 AC_DEFINE(LDAP_PF_INET6,1,[define to support PF_INET6])
2566 fi
2567 if test "$ol_enable_cleartext" != no ; then
2568 AC_DEFINE(SLAPD_CLEARTEXT,1,[define to support cleartext passwords])
2569 fi
2570 if test "$ol_enable_crypt" != no ; then
2571 AC_DEFINE(SLAPD_CRYPT,1,[define to support crypt(3) passwords])
2572 fi
2573 if test "$ol_link_spasswd" != no ; then
2574 AC_DEFINE(SLAPD_SPASSWD,1,[define to support SASL passwords])
2575 fi
2576 if test "$ol_enable_rlookups" != no ; then
2577 AC_DEFINE(SLAPD_RLOOKUPS,1,[define to support reverse lookups])
2578 fi
2579 if test "$ol_enable_aci" != no ; then
2580 if test "$ol_enable_aci" = mod ; then
2581 MFLAG=SLAPD_MOD_DYNAMIC
2582 dnl remove this after moving servers/slapd/aci.c in contrib/slapd-modules/acl
2583 AC_MSG_ERROR([ACI build as dynamic module not supported (yet)])
2584 else
2585 MFLAG=SLAPD_MOD_STATIC
2586 fi
2587 WITH_ACI_ENABLED=$ol_enable_aci
2588 AC_DEFINE_UNQUOTED(SLAPD_ACI_ENABLED,$MFLAG,[define to support per-object ACIs])
2589 else
2590 WITH_ACI_ENABLED=no
2591 fi
2592 if test "$ol_enable_dynacl" != no ; then
2593 AC_DEFINE(SLAP_DYNACL,1,[define to support run-time loadable ACL])
2594 fi
2595
2596 if test "$ol_link_modules" != no ; then
2597 AC_DEFINE(SLAPD_MODULES,1,[define to support modules])
2598 BUILD_SLAPD=yes
2599 SLAPD_MODULES_LDFLAGS="-dlopen self"
2600 fi
2601
2602 AC_DEFINE(SLAPD_MOD_STATIC,1,[statically linked module])
2603 AC_DEFINE(SLAPD_MOD_DYNAMIC,2,[dynamically linked module])
2604
2605 if test "$ol_enable_dnssrv" != no ; then
2606 BUILD_SLAPD=yes
2607 BUILD_DNSSRV=$ol_enable_dnssrv
2608 if test "$ol_enable_dnssrv" = mod ; then
2609 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-dnssrv"
2610 MFLAG=SLAPD_MOD_DYNAMIC
2611 else
2612 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-dnssrv"
2613 MFLAG=SLAPD_MOD_STATIC
2614 fi
2615 AC_DEFINE_UNQUOTED(SLAPD_DNSSRV,$MFLAG,[define to support DNS SRV backend])
2616 fi
2617
2618 if test "$ol_enable_ldap" != no ; then
2619 BUILD_SLAPD=yes
2620 BUILD_LDAP=$ol_enable_ldap
2621 if test "$ol_enable_ldap" = mod ; then
2622 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-ldap"
2623 MFLAG=SLAPD_MOD_DYNAMIC
2624 else
2625 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-ldap"
2626 MFLAG=SLAPD_MOD_STATIC
2627 fi
2628 AC_DEFINE_UNQUOTED(SLAPD_LDAP,$MFLAG,[define to support LDAP backend])
2629 fi
2630
2631 if test "$ol_enable_mdb" != no ; then
2632 BUILD_SLAPD=yes
2633 BUILD_MDB=$ol_enable_mdb
2634 if test "$ol_enable_mdb" = mod ; then
2635 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-mdb"
2636 MFLAG=SLAPD_MOD_DYNAMIC
2637 else
2638 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-mdb"
2639 MFLAG=SLAPD_MOD_STATIC
2640 fi
2641 AC_DEFINE_UNQUOTED(SLAPD_MDB,$MFLAG,[define to support MDB backend])
2642 fi
2643
2644 if test "$ol_enable_meta" != no ; then
2645 BUILD_SLAPD=yes
2646 BUILD_META=$ol_enable_meta
2647 if test "$ol_enable_meta" = mod ; then
2648 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-meta"
2649 MFLAG=SLAPD_MOD_DYNAMIC
2650 else
2651 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-meta"
2652 MFLAG=SLAPD_MOD_STATIC
2653 fi
2654 AC_DEFINE_UNQUOTED(SLAPD_META,$MFLAG,[define to support LDAP Metadirectory backend])
2655 fi
2656
2657 if test "$ol_enable_asyncmeta" != no ; then
2658 BUILD_SLAPD=yes
2659 BUILD_ASYNCMETA=$ol_enable_asyncmeta
2660 if test "$ol_enable_asyncmeta" = mod ; then
2661 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-asyncmeta"
2662 MFLAG=SLAPD_MOD_DYNAMIC
2663 else
2664 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-asyncmeta"
2665 MFLAG=SLAPD_MOD_STATIC
2666 fi
2667 AC_DEFINE_UNQUOTED(SLAPD_ASYNCMETA,$MFLAG,[define to support LDAP Async Metadirectory backend])
2668 fi
2669
2670 if test "$ol_enable_null" != no ; then
2671 BUILD_SLAPD=yes
2672 BUILD_NULL=$ol_enable_null
2673 if test "$ol_enable_null" = mod ; then
2674 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-null"
2675 MFLAG=SLAPD_MOD_DYNAMIC
2676 else
2677 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-null"
2678 MFLAG=SLAPD_MOD_STATIC
2679 fi
2680 AC_DEFINE_UNQUOTED(SLAPD_NULL,$MFLAG,[define to support NULL backend])
2681 fi
2682
2683 if test "$ol_enable_passwd" != no ; then
2684 BUILD_SLAPD=yes
2685 BUILD_PASSWD=$ol_enable_passwd
2686 if test "$ol_enable_passwd" = mod ; then
2687 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-passwd"
2688 MFLAG=SLAPD_MOD_DYNAMIC
2689 else
2690 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-passwd"
2691 MFLAG=SLAPD_MOD_STATIC
2692 fi
2693 AC_DEFINE_UNQUOTED(SLAPD_PASSWD,$MFLAG,[define to support PASSWD backend])
2694 fi
2695
2696 if test "$ol_link_perl" != no ; then
2697 BUILD_SLAPD=yes
2698 BUILD_PERL=$ol_enable_perl
2699 if test "$ol_enable_perl" = mod ; then
2700 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-perl"
2701 MFLAG=SLAPD_MOD_DYNAMIC
2702 else
2703 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-perl"
2704 MFLAG=SLAPD_MOD_STATIC
2705 fi
2706 AC_DEFINE_UNQUOTED(SLAPD_PERL,$MFLAG,[define to support PERL backend])
2707 fi
2708
2709 if test "$ol_enable_relay" != no ; then
2710 BUILD_SLAPD=yes
2711 BUILD_RELAY=$ol_enable_relay
2712 if test "$ol_enable_relay" = mod ; then
2713 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-relay"
2714 MFLAG=SLAPD_MOD_DYNAMIC
2715 else
2716 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-relay"
2717 MFLAG=SLAPD_MOD_STATIC
2718 fi
2719 AC_DEFINE_UNQUOTED(SLAPD_RELAY,$MFLAG,[define to support relay backend])
2720 fi
2721
2722 if test "$ol_enable_sock" != no ; then
2723 BUILD_SLAPD=yes
2724 BUILD_SOCK=$ol_enable_sock
2725 if test "$ol_enable_sock" = mod ; then
2726 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-sock"
2727 MFLAG=SLAPD_MOD_DYNAMIC
2728 else
2729 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-sock"
2730 MFLAG=SLAPD_MOD_STATIC
2731 fi
2732 AC_DEFINE_UNQUOTED(SLAPD_SOCK,$MFLAG,[define to support SOCK backend])
2733 fi
2734
2735 if test "$ol_link_sql" != no ; then
2736 BUILD_SLAPD=yes
2737 BUILD_SQL=$ol_enable_sql
2738 if test "$ol_enable_sql" = mod; then
2739 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-sql"
2740 MFLAG=SLAPD_MOD_DYNAMIC
2741 else
2742 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-sql"
2743 MFLAG=SLAPD_MOD_STATIC
2744 fi
2745 AC_DEFINE_UNQUOTED(SLAPD_SQL,$MFLAG,[define to support SQL backend])
2746 fi
2747
2748 if test "$ol_link_wt" != no ; then
2749 BUILD_SLAPD=yes
2750 BUILD_WT=$ol_enable_wt
2751 if test "$ol_enable_wt" = mod; then
2752 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-wt"
2753 MFLAG=SLAPD_MOD_DYNAMIC
2754 else
2755 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-wt"
2756 MFLAG=SLAPD_MOD_STATIC
2757 fi
2758 AC_DEFINE_UNQUOTED(SLAPD_WT,$MFLAG,[define to support WiredTiger backend])
2759 fi
2760
2761 if test "$ol_enable_accesslog" != no ; then
2762 BUILD_ACCESSLOG=$ol_enable_accesslog
2763 if test "$ol_enable_accesslog" = mod ; then
2764 MFLAG=SLAPD_MOD_DYNAMIC
2765 SLAPD_DYNAMIC_OVERLAYS="$SLAPD_DYNAMIC_OVERLAYS accesslog.la"
2766 else
2767 MFLAG=SLAPD_MOD_STATIC
2768 SLAPD_STATIC_OVERLAYS="$SLAPD_STATIC_OVERLAYS accesslog.o"
2769 fi
2770 AC_DEFINE_UNQUOTED(SLAPD_OVER_ACCESSLOG,$MFLAG,[define for In-Directory Access Logging overlay])
2771 fi
2772
2773 if test "$ol_enable_auditlog" != no ; then
2774 BUILD_AUDITLOG=$ol_enable_auditlog
2775 if test "$ol_enable_auditlog" = mod ; then
2776 MFLAG=SLAPD_MOD_DYNAMIC
2777 SLAPD_DYNAMIC_OVERLAYS="$SLAPD_DYNAMIC_OVERLAYS auditlog.la"
2778 else
2779 MFLAG=SLAPD_MOD_STATIC
2780 SLAPD_STATIC_OVERLAYS="$SLAPD_STATIC_OVERLAYS auditlog.o"
2781 fi
2782 AC_DEFINE_UNQUOTED(SLAPD_OVER_AUDITLOG,$MFLAG,[define for Audit Logging overlay])
2783 fi
2784
2785 if test "$ol_enable_autoca" != no ; then
2786 if test $ol_with_tls != openssl ; then
2787 AC_MSG_ERROR([--enable-autoca=$ol_enable_autoca requires --with-tls=openssl])
2788 fi
2789
2790 BUILD_AUTOCA=$ol_enable_autoca
2791 if test "$ol_enable_autoca" = mod ; then
2792 MFLAG=SLAPD_MOD_DYNAMIC
2793 SLAPD_DYNAMIC_OVERLAYS="$SLAPD_DYNAMIC_OVERLAYS autoca.la"
2794 else
2795 MFLAG=SLAPD_MOD_STATIC
2796 SLAPD_STATIC_OVERLAYS="$SLAPD_STATIC_OVERLAYS autoca.o"
2797 fi
2798 AC_DEFINE_UNQUOTED(SLAPD_OVER_AUTOCA,$MFLAG,[define for Automatic Certificate Authority overlay])
2799 fi
2800
2801 if test "$ol_enable_collect" != no ; then
2802 BUILD_COLLECT=$ol_enable_collect
2803 if test "$ol_enable_collect" = mod ; then
2804 MFLAG=SLAPD_MOD_DYNAMIC
2805 SLAPD_DYNAMIC_OVERLAYS="$SLAPD_DYNAMIC_OVERLAYS collect.la"
2806 else
2807 MFLAG=SLAPD_MOD_STATIC
2808 SLAPD_STATIC_OVERLAYS="$SLAPD_STATIC_OVERLAYS collect.o"
2809 fi
2810 AC_DEFINE_UNQUOTED(SLAPD_OVER_COLLECT,$MFLAG,[define for Collect overlay])
2811 fi
2812
2813 if test "$ol_enable_constraint" != no ; then
2814 BUILD_CONSTRAINT=$ol_enable_constraint
2815 if test "$ol_enable_constraint" = mod ; then
2816 MFLAG=SLAPD_MOD_DYNAMIC
2817 SLAPD_DYNAMIC_OVERLAYS="$SLAPD_DYNAMIC_OVERLAYS constraint.la"
2818 else
2819 MFLAG=SLAPD_MOD_STATIC
2820 SLAPD_STATIC_OVERLAYS="$SLAPD_STATIC_OVERLAYS constraint.o"
2821 fi
2822 AC_DEFINE_UNQUOTED(SLAPD_OVER_CONSTRAINT,$MFLAG,[define for Attribute Constraint overlay])
2823 fi
2824
2825 if test "$ol_enable_dds" != no ; then
2826 BUILD_DDS=$ol_enable_dds
2827 if test "$ol_enable_dds" = mod ; then
2828 MFLAG=SLAPD_MOD_DYNAMIC
2829 SLAPD_DYNAMIC_OVERLAYS="$SLAPD_DYNAMIC_OVERLAYS dds.la"
2830 else
2831 MFLAG=SLAPD_MOD_STATIC
2832 SLAPD_STATIC_OVERLAYS="$SLAPD_STATIC_OVERLAYS dds.o"
2833 fi
2834 AC_DEFINE_UNQUOTED(SLAPD_OVER_DDS,$MFLAG,[define for Dynamic Directory Services overlay])
2835 fi
2836
2837 if test "$ol_enable_deref" != no ; then
2838 BUILD_DEREF=$ol_enable_deref
2839 if test "$ol_enable_deref" = mod ; then
2840 MFLAG=SLAPD_MOD_DYNAMIC
2841 SLAPD_DYNAMIC_OVERLAYS="$SLAPD_DYNAMIC_OVERLAYS deref.la"
2842 else
2843 MFLAG=SLAPD_MOD_STATIC
2844 SLAPD_STATIC_OVERLAYS="$SLAPD_STATIC_OVERLAYS deref.o"
2845 fi
2846 AC_DEFINE_UNQUOTED(SLAPD_OVER_DEREF,$MFLAG,[define for Dynamic Directory Services overlay])
2847 fi
2848
2849 if test "$ol_enable_dyngroup" != no ; then
2850 BUILD_DYNGROUP=$ol_enable_dyngroup
2851 if test "$ol_enable_dyngroup" = mod ; then
2852 MFLAG=SLAPD_MOD_DYNAMIC
2853 SLAPD_DYNAMIC_OVERLAYS="$SLAPD_DYNAMIC_OVERLAYS dyngroup.la"
2854 else
2855 MFLAG=SLAPD_MOD_STATIC
2856 SLAPD_STATIC_OVERLAYS="$SLAPD_STATIC_OVERLAYS dyngroup.o"
2857 fi
2858 AC_DEFINE_UNQUOTED(SLAPD_OVER_DYNGROUP,$MFLAG,[define for Dynamic Group overlay])
2859 fi
2860
2861 if test "$ol_enable_dynlist" != no ; then
2862 BUILD_DYNLIST=$ol_enable_dynlist
2863 if test "$ol_enable_dynlist" = mod ; then
2864 MFLAG=SLAPD_MOD_DYNAMIC
2865 SLAPD_DYNAMIC_OVERLAYS="$SLAPD_DYNAMIC_OVERLAYS dynlist.la"
2866 else
2867 MFLAG=SLAPD_MOD_STATIC
2868 SLAPD_STATIC_OVERLAYS="$SLAPD_STATIC_OVERLAYS dynlist.o"
2869 fi
2870 AC_DEFINE_UNQUOTED(SLAPD_OVER_DYNLIST,$MFLAG,[define for Dynamic List overlay])
2871 fi
2872
2873 if test "$ol_enable_homedir" != no ; then
2874 BUILD_HOMEDIR=$ol_enable_homedir
2875 if test "$ol_enable_homedir" = mod ; then
2876 MFLAG=SLAPD_MOD_DYNAMIC
2877 SLAPD_DYNAMIC_OVERLAYS="$SLAPD_DYNAMIC_OVERLAYS homedir.la"
2878 else
2879 MFLAG=SLAPD_MOD_STATIC
2880 SLAPD_STATIC_OVERLAYS="$SLAPD_STATIC_OVERLAYS homedir.o"
2881 fi
2882 AC_DEFINE_UNQUOTED(SLAPD_OVER_HOMEDIR,$MFLAG,[define for Home Directory Management overlay])
2883 fi
2884
2885 if test "$ol_enable_memberof" != no ; then
2886 BUILD_MEMBEROF=$ol_enable_memberof
2887 if test "$ol_enable_memberof" = mod ; then
2888 MFLAG=SLAPD_MOD_DYNAMIC
2889 SLAPD_DYNAMIC_OVERLAYS="$SLAPD_DYNAMIC_OVERLAYS memberof.la"
2890 else
2891 MFLAG=SLAPD_MOD_STATIC
2892 SLAPD_STATIC_OVERLAYS="$SLAPD_STATIC_OVERLAYS memberof.o"
2893 fi
2894 AC_DEFINE_UNQUOTED(SLAPD_OVER_MEMBEROF,$MFLAG,[define for Reverse Group Membership overlay])
2895 fi
2896
2897 if test "$ol_enable_otp" != no ; then
2898 if test $ol_with_tls = no ; then
2899 AC_MSG_ERROR([--enable-otp=$ol_enable_otp requires --with-tls])
2900 fi
2901
2902 BUILD_OTP=$ol_enable_otp
2903 if test "$ol_enable_otp" = mod ; then
2904 MFLAG=SLAPD_MOD_DYNAMIC
2905 SLAPD_DYNAMIC_OVERLAYS="$SLAPD_DYNAMIC_OVERLAYS otp.la"
2906 else
2907 MFLAG=SLAPD_MOD_STATIC
2908 SLAPD_STATIC_OVERLAYS="$SLAPD_STATIC_OVERLAYS otp.o"
2909 fi
2910 AC_DEFINE_UNQUOTED(SLAPD_OVER_OTP,$MFLAG,[define for OTP 2-factor Authentication overlay])
2911 fi
2912
2913 if test "$ol_enable_ppolicy" != no ; then
2914 BUILD_PPOLICY=$ol_enable_ppolicy
2915 if test "$ol_enable_ppolicy" = mod ; then
2916 MFLAG=SLAPD_MOD_DYNAMIC
2917 SLAPD_DYNAMIC_OVERLAYS="$SLAPD_DYNAMIC_OVERLAYS ppolicy.la"
2918 else
2919 MFLAG=SLAPD_MOD_STATIC
2920 SLAPD_STATIC_OVERLAYS="$SLAPD_STATIC_OVERLAYS ppolicy.o"
2921 fi
2922 AC_DEFINE_UNQUOTED(SLAPD_OVER_PPOLICY,$MFLAG,[define for Password Policy overlay])
2923 fi
2924
2925 if test "$ol_enable_proxycache" != no ; then
2926 BUILD_PROXYCACHE=$ol_enable_proxycache
2927 if test "$ol_enable_proxycache" = mod ; then
2928 MFLAG=SLAPD_MOD_DYNAMIC
2929 SLAPD_DYNAMIC_OVERLAYS="$SLAPD_DYNAMIC_OVERLAYS pcache.la"
2930 else
2931 MFLAG=SLAPD_MOD_STATIC
2932 SLAPD_STATIC_OVERLAYS="$SLAPD_STATIC_OVERLAYS pcache.o"
2933 fi
2934 AC_DEFINE_UNQUOTED(SLAPD_OVER_PROXYCACHE,$MFLAG,[define for Proxy Cache overlay])
2935 fi
2936
2937 if test "$ol_enable_refint" != no ; then
2938 BUILD_REFINT=$ol_enable_refint
2939 if test "$ol_enable_refint" = mod ; then
2940 MFLAG=SLAPD_MOD_DYNAMIC
2941 SLAPD_DYNAMIC_OVERLAYS="$SLAPD_DYNAMIC_OVERLAYS refint.la"
2942 else
2943 MFLAG=SLAPD_MOD_STATIC
2944 SLAPD_STATIC_OVERLAYS="$SLAPD_STATIC_OVERLAYS refint.o"
2945 fi
2946 AC_DEFINE_UNQUOTED(SLAPD_OVER_REFINT,$MFLAG,[define for Referential Integrity overlay])
2947 fi
2948
2949 if test "$ol_enable_remoteauth" != no ; then
2950 BUILD_REMOTEAUTH=$ol_enable_remoteauth
2951 if test "$ol_enable_remoteauth" = mod ; then
2952 MFLAG=SLAPD_MOD_DYNAMIC
2953 SLAPD_DYNAMIC_OVERLAYS="$SLAPD_DYNAMIC_OVERLAYS remoteauth.la"
2954 else
2955 MFLAG=SLAPD_MOD_STATIC
2956 SLAPD_STATIC_OVERLAYS="$SLAPD_STATIC_OVERLAYS remoteauth.o"
2957 fi
2958 AC_DEFINE_UNQUOTED(SLAPD_OVER_REMOTEAUTH,$MFLAG,[define for Deferred Authentication overlay])
2959 fi
2960
2961 if test "$ol_enable_retcode" != no ; then
2962 BUILD_RETCODE=$ol_enable_retcode
2963 if test "$ol_enable_retcode" = mod ; then
2964 MFLAG=SLAPD_MOD_DYNAMIC
2965 SLAPD_DYNAMIC_OVERLAYS="$SLAPD_DYNAMIC_OVERLAYS retcode.la"
2966 else
2967 MFLAG=SLAPD_MOD_STATIC
2968 SLAPD_STATIC_OVERLAYS="$SLAPD_STATIC_OVERLAYS retcode.o"
2969 fi
2970 AC_DEFINE_UNQUOTED(SLAPD_OVER_RETCODE,$MFLAG,[define for Return Code overlay])
2971 fi
2972
2973 if test "$ol_enable_rwm" != no ; then
2974 BUILD_RWM=$ol_enable_rwm
2975 if test "$ol_enable_rwm" = mod ; then
2976 MFLAG=SLAPD_MOD_DYNAMIC
2977 SLAPD_DYNAMIC_OVERLAYS="$SLAPD_DYNAMIC_OVERLAYS rwm.la"
2978 else
2979 MFLAG=SLAPD_MOD_STATIC
2980 SLAPD_STATIC_OVERLAYS="$SLAPD_STATIC_OVERLAYS rwm_x.o"
2981 fi
2982 AC_DEFINE_UNQUOTED(SLAPD_OVER_RWM,$MFLAG,[define for Rewrite/Remap overlay])
2983 fi
2984
2985 if test "$ol_enable_seqmod" != no ; then
2986 BUILD_SEQMOD=$ol_enable_seqmod
2987 if test "$ol_enable_seqmod" = mod ; then
2988 MFLAG=SLAPD_MOD_DYNAMIC
2989 SLAPD_DYNAMIC_OVERLAYS="$SLAPD_DYNAMIC_OVERLAYS seqmod.la"
2990 else
2991 MFLAG=SLAPD_MOD_STATIC
2992 SLAPD_STATIC_OVERLAYS="$SLAPD_STATIC_OVERLAYS seqmod.o"
2993 fi
2994 AC_DEFINE_UNQUOTED(SLAPD_OVER_SEQMOD,$MFLAG,[define for Sequential Modify overlay])
2995 fi
2996
2997 if test "$ol_enable_sssvlv" != no ; then
2998 BUILD_SSSVLV=$ol_enable_sssvlv
2999 if test "$ol_enable_sssvlv" = mod ; then
3000 MFLAG=SLAPD_MOD_DYNAMIC
3001 SLAPD_DYNAMIC_OVERLAYS="$SLAPD_DYNAMIC_OVERLAYS sssvlv.la"
3002 else
3003 MFLAG=SLAPD_MOD_STATIC
3004 SLAPD_STATIC_OVERLAYS="$SLAPD_STATIC_OVERLAYS sssvlv.o"
3005 fi
3006 AC_DEFINE_UNQUOTED(SLAPD_OVER_SSSVLV,$MFLAG,[define for ServerSideSort/VLV overlay])
3007 fi
3008
3009 if test "$ol_enable_syncprov" != no ; then
3010 BUILD_SYNCPROV=$ol_enable_syncprov
3011 if test "$ol_enable_syncprov" = mod ; then
3012 MFLAG=SLAPD_MOD_DYNAMIC
3013 SLAPD_DYNAMIC_OVERLAYS="$SLAPD_DYNAMIC_OVERLAYS syncprov.la"
3014 else
3015 MFLAG=SLAPD_MOD_STATIC
3016 SLAPD_STATIC_OVERLAYS="$SLAPD_STATIC_OVERLAYS syncprov.o"
3017 fi
3018 AC_DEFINE_UNQUOTED(SLAPD_OVER_SYNCPROV,$MFLAG,[define for Syncrepl Provider overlay])
3019 fi
3020
3021 if test "$ol_enable_translucent" != no ; then
3022 BUILD_TRANSLUCENT=$ol_enable_translucent
3023 if test "$ol_enable_translucent" = mod ; then
3024 MFLAG=SLAPD_MOD_DYNAMIC
3025 SLAPD_DYNAMIC_OVERLAYS="$SLAPD_DYNAMIC_OVERLAYS translucent.la"
3026 else
3027 MFLAG=SLAPD_MOD_STATIC
3028 SLAPD_STATIC_OVERLAYS="$SLAPD_STATIC_OVERLAYS translucent.o"
3029 fi
3030 AC_DEFINE_UNQUOTED(SLAPD_OVER_TRANSLUCENT,$MFLAG,[define for Translucent Proxy overlay])
3031 fi
3032
3033 if test "$ol_enable_unique" != no ; then
3034 BUILD_UNIQUE=$ol_enable_unique
3035 if test "$ol_enable_unique" = mod ; then
3036 MFLAG=SLAPD_MOD_DYNAMIC
3037 SLAPD_DYNAMIC_OVERLAYS="$SLAPD_DYNAMIC_OVERLAYS unique.la"
3038 else
3039 MFLAG=SLAPD_MOD_STATIC
3040 SLAPD_STATIC_OVERLAYS="$SLAPD_STATIC_OVERLAYS unique.o"
3041 fi
3042 AC_DEFINE_UNQUOTED(SLAPD_OVER_UNIQUE,$MFLAG,[define for Attribute Uniqueness overlay])
3043 fi
3044
3045 if test "$ol_enable_valsort" != no ; then
3046 BUILD_VALSORT=$ol_enable_valsort
3047 if test "$ol_enable_valsort" = mod ; then
3048 MFLAG=SLAPD_MOD_DYNAMIC
3049 SLAPD_DYNAMIC_OVERLAYS="$SLAPD_DYNAMIC_OVERLAYS valsort.la"
3050 else
3051 MFLAG=SLAPD_MOD_STATIC
3052 SLAPD_STATIC_OVERLAYS="$SLAPD_STATIC_OVERLAYS valsort.o"
3053 fi
3054 AC_DEFINE_UNQUOTED(SLAPD_OVER_VALSORT,$MFLAG,[define for Value Sorting overlay])
3055 fi
3056
3057 ol_link_argon2=no
3058 if test "$ol_enable_argon2" = "yes" ; then
3059 if test $ol_with_argon2 = libargon2 || test $ol_with_argon2 = auto; then
3060 AC_CHECK_HEADERS(argon2.h)
3061 if test $ac_cv_header_argon2_h = yes ; then
3062 AC_CHECK_LIB(argon2, argon2i_hash_encoded,
3063 [have_argon2=yes], [have_argon2=no],
3064 [-largon2])
3065 fi
3066 if test "$have_argon2" = "yes" ; then
3067 ol_with_argon2=libargon2
3068 ol_link_argon2=yes
3069 AC_DEFINE(HAVE_LIBARGON2, 1,
3070 [define if you have libargon2])
3071 ARGON2_LIBS="-largon2"
3072 fi
3073 fi
3074 if test $ol_with_argon2 = libsodium || test $ol_with_argon2 = auto; then
3075 AC_CHECK_HEADERS(sodium.h)
3076 if test $ac_cv_header_sodium_h = yes ; then
3077 AC_CHECK_LIB(sodium, crypto_pwhash_str_alg,
3078 [have_argon2=yes], [have_argon2=no],
3079 [-lsodium])
3080 fi
3081 if test "$have_argon2" = "yes" ; then
3082 ol_with_argon2=libsodium
3083 ol_link_argon2=yes
3084 AC_DEFINE(HAVE_LIBSODIUM, 1,
3085 [define if you have libsodium])
3086 ARGON2_LIBS="-lsodium"
3087 fi
3088 fi
3089
3090 if test "$ol_link_argon2" = no ; then
3091 AC_MSG_ERROR([--enable_argon2=$ol_enable_argon2 requires --with-argon2])
3092 fi
3093
3094 BUILD_PW_ARGON2=$ol_enable_argon2
3095 if test "$ol_enable_argon2" = "yes" ; then
3096 SLAPD_DYNAMIC_PWMODS="$SLAPD_DYNAMIC_PWMODS argon2.la"
3097 fi
3098 AC_DEFINE_UNQUOTED(SLAPD_PWMOD_PW_ARGON2,$SLAPD_MOD_DYNAMIC,[define for Argon2 Password hashing module])
3099 fi
3100
3101 if test "$ol_enable_balancer" != no \
3102 -a "$ol_with_threads" != no \
3103 -a "$have_libevent" = yes ; then
3104 if test "$ol_enable_balancer" = mod; then
3105 BUILD_BALANCER=mod
3106 BALANCER_MAKE="servers/lloadd/Makefile_module.in:build/mod.mk"
3107 else
3108 BUILD_BALANCER=yes
3109 BALANCER_MAKE="servers/lloadd/Makefile_server.in:build/srv.mk"
3110 fi
3111 fi
3112
3113 if test "$ol_enable_slapi" != no ; then
3114 AC_DEFINE(ENABLE_SLAPI,1,[define to enable slapi library])
3115 BUILD_SLAPI=yes
3116 SLAPD_SLAPI_DEPEND=libslapi.a
3117 fi
3118
3119 OL_VERSIONED_SYMBOLS=""
3120 DO_VERSIONED_SYMBOLS="# "
3121 if test $ol_enable_versioning != no; then
3122 LDVS=`$LD --help < /dev/null 2>/dev/null | grep gnu-version-script`
3123 if test -z "$LDVS"; then
3124 LDVS=`$LD --help < /dev/null 2>/dev/null | grep version-script`
3125 if test -z "$LDVS"; then
3126 if test $ol_enable_versioning = "yes" ; then
3127 AC_MSG_ERROR([Library symbol versioning requested but not supported])
3128 fi
3129 else
3130 OL_VERSIONED_SYMBOLS="-Wl,--version-script="
3131 fi
3132 else
3133 OL_VERSIONED_SYMBOLS="-z gnu-version-script="
3134 fi
3135 if test -n "$OL_VERSIONED_SYMBOLS"; then
3136 DO_VERSIONED_SYMBOLS=""
3137 fi
3138 fi
3139
3140 dnl ----------------------------------------------------------------
3141 dnl Test suite
3142
3143 dnl We use 'yes' but mean 'mod' as far as our Makefile infra is concerned
3144 if test $ol_enable_harness != no; then
3145 BUILD_HARNESS=mod
3146 fi
3147
3148 dnl ----------------------------------------------------------------
3149
3150 dnl
3151 dnl For Windows build, we don't want to include -dlopen flags.
3152 dnl They hurt more than they help.
3153 dnl
3154
3155 if test "$ac_cv_mingw32" = yes -o $ol_cv_msvc = yes ; then
3156 PLAT=NT
3157 SLAPD_MODULES_LDFLAGS=
3158 else
3159 PLAT=UNIX
3160 fi
3161
3162 AC_SUBST(LIBSRCS)
3163 AC_SUBST(PLAT)
3164 AC_SUBST(WITH_SASL)
3165 AC_SUBST(WITH_TLS)
3166 AC_SUBST(WITH_MODULES_ENABLED)
3167 AC_SUBST(WITH_ACI_ENABLED)
3168 AC_SUBST(WITH_SYSTEMD)
3169 AC_SUBST(BUILD_THREAD)
3170 AC_SUBST(BUILD_LIBS_DYNAMIC)
3171 AC_SUBST(OL_VERSIONED_SYMBOLS)
3172 AC_SUBST(DO_VERSIONED_SYMBOLS)
3173
3174 AC_SUBST(BUILD_SLAPD)
3175 dnl slapi
3176 AC_SUBST(BUILD_SLAPI)
3177 AC_SUBST(SLAPD_SLAPI_DEPEND)
3178 dnl backends
3179 AC_SUBST(BUILD_DNSSRV)
3180 AC_SUBST(BUILD_LDAP)
3181 AC_SUBST(BUILD_MDB)
3182 AC_SUBST(BUILD_META)
3183 AC_SUBST(BUILD_ASYNCMETA)
3184 AC_SUBST(BUILD_NDB)
3185 AC_SUBST(BUILD_NULL)
3186 AC_SUBST(BUILD_PASSWD)
3187 AC_SUBST(BUILD_RELAY)
3188 AC_SUBST(BUILD_PERL)
3189 AC_SUBST(BUILD_SHELL)
3190 AC_SUBST(BUILD_SOCK)
3191 AC_SUBST(BUILD_SQL)
3192 AC_SUBST(BUILD_WT)
3193 dnl overlays
3194 AC_SUBST(BUILD_ACCESSLOG)
3195 AC_SUBST(BUILD_AUDITLOG)
3196 AC_SUBST(BUILD_AUTOCA)
3197 AC_SUBST(BUILD_COLLECT)
3198 AC_SUBST(BUILD_CONSTRAINT)
3199 AC_SUBST(BUILD_DDS)
3200 AC_SUBST(BUILD_DENYOP)
3201 AC_SUBST(BUILD_DEREF)
3202 AC_SUBST(BUILD_DYNGROUP)
3203 AC_SUBST(BUILD_DYNLIST)
3204 AC_SUBST(BUILD_LASTMOD)
3205 AC_SUBST(BUILD_HOMEDIR)
3206 AC_SUBST(BUILD_MEMBEROF)
3207 AC_SUBST(BUILD_OTP)
3208 AC_SUBST(BUILD_PPOLICY)
3209 AC_SUBST(BUILD_PROXYCACHE)
3210 AC_SUBST(BUILD_REFINT)
3211 AC_SUBST(BUILD_REMOTEAUTH)
3212 AC_SUBST(BUILD_RETCODE)
3213 AC_SUBST(BUILD_RWM)
3214 AC_SUBST(BUILD_SEQMOD)
3215 AC_SUBST(BUILD_SSSVLV)
3216 AC_SUBST(BUILD_SYNCPROV)
3217 AC_SUBST(BUILD_TRANSLUCENT)
3218 AC_SUBST(BUILD_UNIQUE)
3219 AC_SUBST(BUILD_VALSORT)
3220 AC_SUBST(BUILD_BALANCER)
3221 dnl pwmods
3222 AC_SUBST(BUILD_PW_ARGON2)
3223 dnl test suite
3224 AC_SUBST(BUILD_HARNESS)
3225
3226 AC_SUBST(LDAP_LIBS)
3227 AC_SUBST(CLIENT_LIBS)
3228 AC_SUBST(SLAPD_LIBS)
3229 AC_SUBST(BALANCER_LIBS)
3230 AC_SUBST(SLAPD_NDB_LIBS)
3231 AC_SUBST(SLAPD_NDB_INCS)
3232 AC_SUBST(LTHREAD_LIBS)
3233 AC_SUBST(LUTIL_LIBS)
3234 AC_SUBST(LEVENT_LIBS)
3235 AC_SUBST(WRAP_LIBS)
3236
3237 AC_SUBST(SLAPD_MODULES_CPPFLAGS)
3238 AC_SUBST(SLAPD_MODULES_LDFLAGS)
3239
3240 AC_SUBST(SLAPD_NO_STATIC)
3241 AC_SUBST(SLAPD_STATIC_BACKENDS)
3242 AC_SUBST(SLAPD_DYNAMIC_BACKENDS)
3243 AC_SUBST(SLAPD_STATIC_OVERLAYS)
3244 AC_SUBST(SLAPD_DYNAMIC_OVERLAYS)
3245 AC_SUBST(SLAPD_DYNAMIC_PWMODS)
3246
3247 AC_SUBST(PERL_CPPFLAGS)
3248 AC_SUBST(SLAPD_PERL_LDFLAGS)
3249 AC_SUBST(MOD_PERL_LDFLAGS)
3250
3251 AC_SUBST(SASL_LIBS)
3252 AC_SUBST(TLS_LIBS)
3253 AC_SUBST(WITH_TLS_TYPE)
3254 AC_SUBST(MODULES_LIBS)
3255 AC_SUBST(SLAPI_LIBS)
3256 AC_SUBST(LIBSLAPI)
3257 AC_SUBST(AUTH_LIBS)
3258 AC_SUBST(ARGON2_LIBS)
3259 AC_SUBST(SYSTEMD_LIBS)
3260
3261 AC_SUBST(SLAPD_SLP_LIBS)
3262 AC_SUBST(SLAPD_GMP_LIBS)
3263
3264 AC_SUBST(SLAPD_SQL_LDFLAGS)
3265 AC_SUBST(SLAPD_SQL_LIBS)
3266 AC_SUBST(SLAPD_SQL_INCLUDES)
3267
3268 AC_SUBST(WT_CFLAGS)
3269 AC_SUBST(WT_LIBS)
3270
3271 dnl ----------------------------------------------------------------
3272 dnl final help output
3273 AC_ARG_WITH(xxinstall,[
3274 See INSTALL file for further details.])
3275
3276 dnl ----------------------------------------------------------------
3277 dnl final output
3278 dnl
3279
3280 AC_CONFIG_FILES([Makefile:build/top.mk:Makefile.in:build/dir.mk]
3281 [doc/Makefile:build/top.mk:doc/Makefile.in:build/dir.mk]
3282 [doc/man/Makefile:build/top.mk:doc/man/Makefile.in:build/dir.mk]
3283 [doc/man/man1/Makefile:build/top.mk:doc/man/man1/Makefile.in:build/man.mk]
3284 [doc/man/man3/Makefile:build/top.mk:doc/man/man3/Makefile.in:build/man.mk]
3285 [doc/man/man5/Makefile:build/top.mk:doc/man/man5/Makefile.in:build/man.mk]
3286 [doc/man/man8/Makefile:build/top.mk:doc/man/man8/Makefile.in:build/man.mk]
3287 [clients/Makefile:build/top.mk:clients/Makefile.in:build/dir.mk]
3288 [clients/tools/Makefile:build/top.mk:clients/tools/Makefile.in:build/rules.mk]
3289 [include/Makefile:build/top.mk:include/Makefile.in]
3290 [libraries/Makefile:build/top.mk:libraries/Makefile.in:build/dir.mk]
3291 [libraries/liblber/Makefile:build/top.mk:libraries/liblber/Makefile.in:build/lib.mk:build/lib-shared.mk]
3292 [libraries/liblber/lber.pc]
3293 [libraries/libldap/Makefile:build/top.mk:libraries/libldap/Makefile.in:build/lib.mk:build/lib-shared.mk]
3294 [libraries/libldap/ldap.pc]
3295 [libraries/liblunicode/Makefile:build/top.mk:libraries/liblunicode/Makefile.in:build/lib.mk:build/lib-static.mk]
3296 [libraries/liblutil/Makefile:build/top.mk:libraries/liblutil/Makefile.in:build/lib.mk:build/lib-static.mk]
3297 [libraries/librewrite/Makefile:build/top.mk:libraries/librewrite/Makefile.in:build/lib.mk:build/lib-static.mk]
3298 [servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk]
3299 [servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk]
3300 [servers/slapd/back-dnssrv/Makefile:build/top.mk:servers/slapd/back-dnssrv/Makefile.in:build/mod.mk]
3301 [servers/slapd/back-ldap/Makefile:build/top.mk:servers/slapd/back-ldap/Makefile.in:build/mod.mk]
3302 [servers/slapd/back-ldif/Makefile:build/top.mk:servers/slapd/back-ldif/Makefile.in:build/mod.mk]
3303 [servers/slapd/back-mdb/Makefile:build/top.mk:servers/slapd/back-mdb/Makefile.in:build/mod.mk]
3304 [servers/slapd/back-meta/Makefile:build/top.mk:servers/slapd/back-meta/Makefile.in:build/mod.mk]
3305 [servers/slapd/back-asyncmeta/Makefile:build/top.mk:servers/slapd/back-asyncmeta/Makefile.in:build/mod.mk]
3306 [servers/slapd/back-monitor/Makefile:build/top.mk:servers/slapd/back-monitor/Makefile.in:build/mod.mk]
3307 [servers/slapd/back-null/Makefile:build/top.mk:servers/slapd/back-null/Makefile.in:build/mod.mk]
3308 [servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/mod.mk]
3309 [servers/slapd/back-perl/Makefile:build/top.mk:servers/slapd/back-perl/Makefile.in:build/mod.mk]
3310 [servers/slapd/back-relay/Makefile:build/top.mk:servers/slapd/back-relay/Makefile.in:build/mod.mk]
3311 [servers/slapd/back-sock/Makefile:build/top.mk:servers/slapd/back-sock/Makefile.in:build/mod.mk]
3312 [servers/slapd/back-sql/Makefile:build/top.mk:servers/slapd/back-sql/Makefile.in:build/mod.mk]
3313 [servers/slapd/back-wt/Makefile:build/top.mk:servers/slapd/back-wt/Makefile.in:build/mod.mk]
3314 [servers/slapd/slapi/Makefile:build/top.mk:servers/slapd/slapi/Makefile.in:build/lib.mk:build/lib-shared.mk]
3315 [servers/slapd/overlays/Makefile:build/top.mk:servers/slapd/overlays/Makefile.in:build/lib.mk]
3316 [servers/slapd/pwmods/Makefile:build/top.mk:servers/slapd/pwmods/Makefile.in:build/lib.mk]
3317 [servers/lloadd/Makefile:build/top.mk:servers/lloadd/Makefile.in:$BALANCER_MAKE]
3318 [tests/Makefile:build/top.mk:tests/Makefile.in:build/dir.mk]
3319 [tests/run]
3320 [tests/modules/Makefile:build/top.mk:tests/modules/Makefile.in:build/dir.mk]
3321 [tests/modules/mod-harness/Makefile:build/top.mk:tests/modules/mod-harness/Makefile.in:build/mod.mk]
3322 [tests/progs/Makefile:build/top.mk:tests/progs/Makefile.in:build/rules.mk])
3323
3324 AC_CONFIG_COMMANDS([default],[[
3325 chmod +x tests/run
3326 date > stamp-h
3327 BACKENDSC="servers/slapd/backends.c"
3328 echo "Making $BACKENDSC"
3329 rm -f $BACKENDSC
3330 cat > $BACKENDSC << ENDX
3331 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
3332 *
3333 * Copyright 1998-2022 The OpenLDAP Foundation.
3334 * All rights reserved.
3335 *
3336 * Redistribution and use in source and binary forms, with or without
3337 * modification, are permitted only as authorized by the OpenLDAP
3338 * Public License.
3339 *
3340 * A copy of this license is available in the file LICENSE in the
3341 * top-level directory of the distribution or, alternatively, at
3342 * <http://www.OpenLDAP.org/license.html>.
3343 */
3344 /* This file is automatically generated by configure; please do not edit. */
3345
3346 #include "portable.h"
3347 #include "slap.h"
3348
3349 ENDX
3350 if test "${STATIC_BACKENDS}"; then
3351 for b in config ${STATIC_BACKENDS}; do
3352 bb=`echo "${b}" | sed -e 's/back-//'`
3353 cat >> $BACKENDSC << ENDX
3354 extern BI_init ${bb}_back_initialize;
3355 ENDX
3356 done
3357
3358 cat >> $BACKENDSC << ENDX
3359
3360 BackendInfo slap_binfo[] = {
3361 ENDX
3362
3363 for b in config ${STATIC_BACKENDS}; do
3364 bb=`echo "${b}" | sed -e 's/back-//'`
3365 echo " Add ${bb} ..."
3366 cat >> $BACKENDSC << ENDX
3367 { "${bb}", ${bb}_back_initialize },
3368 ENDX
3369 done
3370
3371 cat >> $BACKENDSC << ENDX
3372 { NULL, NULL },
3373 };
3374
3375 /* end of generated file */
3376 ENDX
3377 fi
3378 OVERLAYSC="servers/slapd/overlays/statover.c"
3379 echo "Making $OVERLAYSC"
3380 rm -f $OVERLAYSC
3381 cat > $OVERLAYSC << ENDX
3382 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
3383 *
3384 * Copyright 1998-2022 The OpenLDAP Foundation.
3385 * All rights reserved.
3386 *
3387 * Redistribution and use in source and binary forms, with or without
3388 * modification, are permitted only as authorized by the OpenLDAP
3389 * Public License.
3390 *
3391 * A copy of this license is available in the file LICENSE in the
3392 * top-level directory of the distribution or, alternatively, at
3393 * <http://www.OpenLDAP.org/license.html>.
3394 */
3395 /* This file is automatically generated by configure; please do not edit. */
3396
3397 #include "portable.h"
3398 #include "slap.h"
3399
3400 ENDX
3401 if test "${STATIC_OVERLAYS}"; then
3402 for o in ${STATIC_OVERLAYS}; do
3403 oo=`echo "${o}" | sed -e 's/.o$//' -e 's/_x$//'`
3404 cat >> $OVERLAYSC << ENDX
3405 extern OV_init ${oo}_initialize;
3406 ENDX
3407 done
3408 fi
3409
3410 cat >> $OVERLAYSC << ENDX
3411
3412 OverlayInit slap_oinfo[] = {
3413 ENDX
3414
3415 if test "${STATIC_OVERLAYS}"; then
3416 for o in ${STATIC_OVERLAYS}; do
3417 oo=`echo "${o}" | sed -e 's/.o$//' -e 's/_x$//'`
3418 echo " Add ${oo} ..."
3419 cat >> $OVERLAYSC << ENDX
3420 { "${oo}", ${oo}_initialize },
3421 ENDX
3422 done
3423 fi
3424
3425 cat >> $OVERLAYSC << ENDX
3426 { NULL, NULL },
3427 };
3428
3429 /* end of generated file */
3430 ENDX
3431
3432 if test "${ol_cv_mkdep}" = no; then
3433 echo '(Do not "make depend"; we do not know how to build dependencies)'
3434 else
3435 echo 'Please run "make depend" to build dependencies'
3436 fi
3437 ]],[[
3438 STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS"
3439 STATIC_OVERLAYS="$SLAPD_STATIC_OVERLAYS"
3440 ]])
3441 AC_OUTPUT