configure.in 78.5 KB
Newer Older
1
dnl $OpenLDAP$
Kurt Zeilenga's avatar
Kurt Zeilenga committed
2
dnl This work is part of OpenLDAP Software <http://www.openldap.org/>.
3
dnl
Kurt Zeilenga's avatar
Kurt Zeilenga committed
4
dnl Copyright 1998-2004 The OpenLDAP Foundation.
Kurt Zeilenga's avatar
Kurt Zeilenga committed
5
6
dnl All rights reserved.
dnl
7
8
dnl Redistribution and use in source and binary forms, with or without
dnl modification, are permitted only as authorized by the OpenLDAP
Kurt Zeilenga's avatar
Kurt Zeilenga committed
9
10
11
12
13
dnl Public License.
dnl
dnl A copy of this license is available in the file LICENSE in the
dnl top-level directory of the distribution or, alternatively, at
dnl <http://www.OpenLDAP.org/license.html>.
14
dnl
15
dnl ----------------------------------------------------------------
Kurt Zeilenga's avatar
Kurt Zeilenga committed
16
dnl
17
18
19
20
21
22
23
dnl Redefine AC_INIT_BINSH to provide RCS IDs and copyright notice
dnl at top of generated configure script.  Prints simple copyright.
define([AC_INIT_BINSH],
[[#! /bin/sh
# $]OpenLDAP[$
# from] translit([$OpenLDAP$], $")] [

Kurt Zeilenga's avatar
Kurt Zeilenga committed
24
25
# This work is part of OpenLDAP Software <http://www.openldap.org/>.
#
Kurt Zeilenga's avatar
Kurt Zeilenga committed
26
# Copyright 1998-2004 The OpenLDAP Foundation.
Kurt Zeilenga's avatar
Kurt Zeilenga committed
27
28
# All rights reserved.
#
29
30
# Redistribution and use in source and binary forms, with or without
# modification, are permitted only as authorized by the OpenLDAP
Kurt Zeilenga's avatar
Kurt Zeilenga committed
31
32
33
34
35
# Public License.
#
# A copy of this license is available in the file LICENSE in the
# top-level directory of the distribution or, alternatively, at
# <http://www.OpenLDAP.org/license.html>.
36

Kurt Zeilenga's avatar
Kurt Zeilenga committed
37
echo "Copyright 1998-2004 The OpenLDAP Foundation. All rights reserved."
38
echo "	Restrictions apply, see COPYRIGHT and LICENSE files."
39
])dnl
40
41
42
43
dnl ----------------------------------------------------------------
dnl Disable config.cache!
define([AC_CACHE_LOAD], )dnl
define([AC_CACHE_SAVE], )dnl
Kurt Zeilenga's avatar
Kurt Zeilenga committed
44
dnl ================================================================
Kurt Zeilenga's avatar
Kurt Zeilenga committed
45
dnl Configure.in for OpenLDAP
46
AC_INIT(build/version.sh)dnl
47

48
49
50
51
52
53
54
55
56
57
# set unset (borrowed from autoconf 2.49c)
if (OL_FOO=OL_FOO; unset OL_FOO) >/dev/null 2>&1; then
  ol_unset=unset
else
  ol_unset=false
fi
# unset CDPATH
$ol_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }

AC_CONFIG_AUX_DIR(build)dnl
58

59
60
eval `$ac_aux_dir/version.sh`
if test -z "$OL_STRING"; then
61
62
63
	AC_MSG_ERROR([could not determine version])
fi

64
65
66
67
68
69
70
71
if test -f "$ac_aux_dir/shtool" -a ! -d $ac_aux_dir/shtool; then
	ac_cv_shtool="$ac_aux_dir/shtool"
else
	AC_MSG_ERROR([no shtool found in $ac_aux_dir])
fi

SHTOOL="$ac_cv_shtool"
dnl AC_SUBST(SHTOOL)dnl
72

Kurt Zeilenga's avatar
Kurt Zeilenga committed
73
74
TB="`$SHTOOL echo -e '%B' 2>/dev/null`"
TN="`$SHTOOL echo -e '%b' 2>/dev/null`"
Kurt Zeilenga's avatar
Kurt Zeilenga committed
75

76
77
78
79
80
81
OPENLDAP_CVS=""
if test -d $ac_aux_dir/CVS; then
	OPENLDAP_CVS="(from CVS sources) "
fi

echo "Configuring ${TB}${OL_STRING}${TN} ${OPENLDAP_CVS}..."
82

83
84
85
86
dnl Determine host platform
dnl		we try not to use this for much
AC_CANONICAL_SYSTEM

87
88
89
90
91
AM_INIT_AUTOMAKE([$OL_PACKAGE],[$OL_VERSION], [no defines])dnl
AC_SUBST(PACKAGE)dnl
AC_SUBST(VERSION)dnl
AC_DEFINE_UNQUOTED(OPENLDAP_PACKAGE,"$PACKAGE",Package)
AC_DEFINE_UNQUOTED(OPENLDAP_VERSION,"$VERSION",Version)
Kurt Zeilenga's avatar
Kurt Zeilenga committed
92

93
94
95
96
AC_DEFINE_UNQUOTED(LDAP_VENDOR_VERSION,$OL_API_INC,Version)
AC_DEFINE_UNQUOTED(LDAP_VENDOR_VERSION_MAJOR,$OL_MAJOR,Major)
AC_DEFINE_UNQUOTED(LDAP_VENDOR_VERSION_MINOR,$OL_MINOR,Minor)
AC_DEFINE_UNQUOTED(LDAP_VENDOR_VERSION_PATCH,$OL_PATCH,Patch)
97

Kurt Zeilenga's avatar
Kurt Zeilenga committed
98
99
100
101
OPENLDAP_LIBRELEASE=$OL_API_LIB_RELEASE
AC_SUBST(OPENLDAP_LIBRELEASE)dnl

OPENLDAP_LIBVERSION=$OL_API_LIB_VERSION
Kurt Zeilenga's avatar
Kurt Zeilenga committed
102
AC_SUBST(OPENLDAP_LIBVERSION)dnl
103

104
105
106
OPENLDAP_RELEASE_DATE="$OL_RELEASE_DATE"
AC_SUBST(OPENLDAP_RELEASE_DATE)dnl

Kurt Zeilenga's avatar
Kurt Zeilenga committed
107
dnl We use autoconf features new to 2.13.  Later versions like won't work.
108
dnl aclocal.m4 should be built using aclocal from automake 1.4
Kurt Zeilenga's avatar
Kurt Zeilenga committed
109
dnl libtool 1.4.3 should be installed.
110
AC_PREREQ(2.13)dnl Required Autoconf version
111

112
AC_CONFIG_HEADER(include/portable.h include/ldap_features.h include/lber_types.h)dnl
113

114
dnl ================================================================
Kurt Zeilenga's avatar
Kurt Zeilenga committed
115
116
117
118
dnl Start Args
AC_MSG_CHECKING(configure arguments)
AC_PREFIX_DEFAULT(/usr/local)

119
120
121
top_builddir=`pwd`
AC_SUBST(top_builddir)dnl

122
123
dnl ----------------------------------------------------------------
dnl --with-subdir
124
ldap_subdir="/openldap"
Kurt Zeilenga's avatar
Kurt Zeilenga committed
125

126
AC_ARG_WITH(subdir,
Kurt Zeilenga's avatar
Kurt Zeilenga committed
127
[  --with-subdir=DIR       change default subdirectory used for installs],
128
129
130
131
132
133
[case "$withval" in
	no) ldap_subdir=""
		;;
	yes)
		;;
	/*|\\*)
134
		ldap_subdir="$withval"
135
136
137
138
139
		;;
	*)
		ldap_subdir="/$withval"
		;;
esac
140
141
])dnl

142
143
AC_SUBST(ldap_subdir)dnl

144
145
dnl ----------------------------------------------------------------
dnl General "enable" options
146
147
148
149
150
OL_ARG_ENABLE(debug,[  --enable-debug 	  enable debugging], yes)dnl
OL_ARG_ENABLE(dynamic,[  --enable-dynamic	  enable linking built binaries with dynamic libs], no)dnl
OL_ARG_ENABLE(syslog,[  --enable-syslog	  enable syslog support], auto)dnl
OL_ARG_ENABLE(proctitle,[  --enable-proctitle	  enable proctitle support], yes)dnl
dnl OL_ARG_ENABLE(referrals,[  --enable-referrals	  enable LDAPv2+ Referrals (experimental)], no)dnl
151
ol_enable_referrals=${ol_enable_referrals-no}
152
dnl OL_ARG_ENABLE(kbind,[  --enable-kbind	  enable LDAPv2+ Kerberos IV bind (deprecated)], no)dnl
153
ol_enable_kbind=${ol_enable_kbind-no}
154
155
OL_ARG_ENABLE(ipv6,[  --enable-ipv6 	  enable IPv6 support], auto)dnl
OL_ARG_ENABLE(local,[  --enable-local	  enable AF_LOCAL (AF_UNIX) socket support], auto)dnl
Kurt Zeilenga's avatar
Kurt Zeilenga committed
156

157
dnl ----------------------------------------------------------------
Kurt Zeilenga's avatar
Kurt Zeilenga committed
158
dnl General "with" options
159
160
161
162
163
164
dnl OL_ARG_ENABLE(dmalloc,[  --enable-dmalloc	  enable debug malloc support], no)dnl

OL_ARG_WITH(cyrus_sasl,[  --with-cyrus-sasl	  with Cyrus SASL support],
	auto, [auto yes no] )
OL_ARG_WITH(fetch,[  --with-fetch		  with fetch(3) URL support],
	auto, [auto yes no] )
Kurt Zeilenga's avatar
Kurt Zeilenga committed
165
166
dnl	OL_ARG_WITH(kerberos,[  --with-kerberos	  with Kerberos support],
dnl		auto, [auto k5 k5only k425 kth k4 afs yes no])
Howard Chu's avatar
Howard Chu committed
167
ol_with_kerberos=${ol_with_kerberos-auto}
168
169
170
171
172
173
OL_ARG_WITH(threads,[  --with-threads	  with threads],
	auto, [auto nt posix mach pth lwp yes no manual] )
OL_ARG_WITH(tls,[  --with-tls		  with TLS/SSL support],
	auto, [auto ssleay openssl yes no] )
OL_ARG_WITH(yielding_select,[  --with-yielding-select  with implicitly yielding select],
	auto, [auto yes no manual] )
Kurt Zeilenga's avatar
Kurt Zeilenga committed
174

175
dnl ----------------------------------------------------------------
Kurt Zeilenga's avatar
Kurt Zeilenga committed
176
dnl Server options
177
178
dnl ----------------------------------------------------------------

179
dnl ----------------------------------------------------------------
Kurt Zeilenga's avatar
Kurt Zeilenga committed
180
dnl SLAPD OPTIONS
181
182
183
184
185
186
187
188
189
190
AC_ARG_WITH(xxslapdoptions,[
SLAPD (Standalone LDAP Daemon) Options:])
OL_ARG_ENABLE(slapd,[  --enable-slapd	  enable building slapd], yes)dnl
OL_ARG_ENABLE(aci,[    --enable-aci	  enable per-object ACIs (experimental)], no)dnl
OL_ARG_ENABLE(cleartext,[    --enable-cleartext	  enable cleartext passwords], yes)dnl
OL_ARG_ENABLE(crypt,[    --enable-crypt	  enable crypt(3) passwords], no)dnl
OL_ARG_ENABLE(lmpasswd,[    --enable-lmpasswd	  enable LAN Manager passwords], no)dnl
OL_ARG_ENABLE(spasswd,[    --enable-spasswd	  enable (Cyrus) SASL password verification], no)dnl
OL_ARG_ENABLE(modules,[    --enable-modules	  enable dynamic module support], no)dnl
dnl OL_ARG_ENABLE(multimaster,[    --enable-multimaster  enable multimaster replication], no)dnl
191
ol_enable_multimaster=${ol_enable_multimaster-no}
192
OL_ARG_ENABLE(rewrite,[    --enable-rewrite	  enable DN rewriting in back-ldap and the rwm overlay], auto)dnl
193
OL_ARG_ENABLE(rlookups,[    --enable-rlookups	  enable reverse lookups of client hostnames], no)dnl
194
OL_ARG_ENABLE(slapi,[    --enable-slapi        enable SLAPI support (experimental)], no)dnl
195
196
197
OL_ARG_ENABLE(slp,[    --enable-slp          enable SLPv2 support], no)dnl     
OL_ARG_ENABLE(wrappers,[    --enable-wrappers	  enable tcp wrapper support], no)dnl

Kurt Zeilenga's avatar
cleanup    
Kurt Zeilenga committed
198
199
dnl ----------------------------------------------------------------
dnl SLAPD Backend Options
200
201
202
Backends="bdb dnssrv hdb ldap ldbm meta monitor null \
	passwd perl relay shell sql"

203
AC_ARG_WITH(xxslapbackends,[
Kurt Zeilenga's avatar
cleanup    
Kurt Zeilenga committed
204
205
SLAPD Backend Options:])

Kurt Zeilenga's avatar
cleanup    
Kurt Zeilenga committed
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
OL_ARG_ENABLE(backends,[    --enable-backends	  enable all available backends no|yes|mod],
	no, [no yes mod])dnl
OL_ARG_ENABLE(bdb,[    --enable-bdb	  enable Berkeley DB backend no|yes|mod],
	yes, [no yes mod])dnl
OL_ARG_ENABLE(dnssrv,[    --enable-dnssrv	  enable dnssrv backend no|yes|mod],
	no, [no yes mod])dnl
OL_ARG_ENABLE(hdb,[    --enable-hdb	  enable Hierarchical DB backend no|yes|mod],
	no, [no yes mod])dnl
OL_ARG_ENABLE(ldap,[    --enable-ldap	  enable ldap backend no|yes|mod],
	no, [no yes mod])dnl
OL_ARG_ENABLE(ldbm,[    --enable-ldbm	  enable ldbm backend no|yes|mod], no,
	[no yes mod])dnl
OL_ARG_WITH(ldbm_api,[      --with-ldbm-api     with LDBM API auto|berkeley|bcompat|mdbm|gdbm],
	auto, [auto berkeley bcompat mdbm gdbm])
OL_ARG_WITH(ldbm_type,[      --with-ldbm-type	  use LDBM type auto|btree|hash],
	auto, [auto btree hash])
OL_ARG_ENABLE(meta,[    --enable-meta	  enable metadirectory backend no|yes|mod],
	no, [no yes mod])dnl
OL_ARG_ENABLE(monitor,[    --enable-monitor	  enable monitor backend no|yes|mod],
	yes, [no yes mod])dnl
OL_ARG_ENABLE(null,[    --enable-null	  enable null backend no|yes|mod],
	no, [no yes mod])dnl
OL_ARG_ENABLE(passwd,[    --enable-passwd	  enable passwd backend no|yes|mod],
	no, [no yes mod])dnl
OL_ARG_ENABLE(perl,[    --enable-perl	  enable perl backend no|yes|mod],
	no, [no yes mod])dnl
OL_ARG_ENABLE(relay,[    --enable-relay  	  enable relay backend no|yes|mod],
	yes, [no yes mod])dnl
OL_ARG_ENABLE(shell,[    --enable-shell	  enable shell backend no|yes|mod],
	no, [no yes mod])dnl
OL_ARG_ENABLE(sql,[    --enable-sql	  enable sql backend no|yes|mod],
	no, [no yes mod])dnl
Kurt Zeilenga's avatar
Kurt Zeilenga committed
238

Howard Chu's avatar
Howard Chu committed
239
240
dnl ----------------------------------------------------------------
dnl SLAPD Overlay Options
241
242
Overlays="chain denyop dyngroup lastmod ppolicy proxycache rwm \
	refint unique"
243

Howard Chu's avatar
Howard Chu committed
244
245
AC_ARG_WITH(xxslapoverlays,[
SLAPD Overlay Options:])
Kurt Zeilenga's avatar
cleanup    
Kurt Zeilenga committed
246

Kurt Zeilenga's avatar
cleanup    
Kurt Zeilenga committed
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
OL_ARG_ENABLE(overlays,[    --enable-overlays	  enable all available overlays no|yes|mod],
	no, [no yes mod])dnl
OL_ARG_ENABLE(chain,[    --enable-chain   	  LDAP Chain Response no|yes|mod],
	no, [no yes mod])
OL_ARG_ENABLE(denyop,[    --enable-denyop  	  Deny Operation overlay no|yes|mod],
	no, [no yes mod])
OL_ARG_ENABLE(dyngroup,[    --enable-dyngroup	  Dynamic Group overlay no|yes|mod],
	no, [no yes mod])
OL_ARG_ENABLE(lastmod,[    --enable-lastmod	  Last Modification overlay no|yes|mod],
	no, [no yes mod])
OL_ARG_ENABLE(ppolicy,[    --enable-ppolicy	  Password Policy overlay no|yes|mod],
	no, [no yes mod])
OL_ARG_ENABLE(proxycache,[    --enable-proxycache	  Proxy Cache overlay no|yes|mod],
	no, [no yes mod])
OL_ARG_ENABLE(refint,[    --enable-refint	  Referential Integrity overlay no|yes|mod],
	no, [no yes mod])
OL_ARG_ENABLE(rwm,[    --enable-rwm       	  Rewrite/Remap overlay no|yes|mod],
	no, [no yes mod])
OL_ARG_ENABLE(unique,[    --enable-unique       Attribute Uniqueness overlay no|yes|mod],
	no, [no yes mod])
267

Howard Chu's avatar
Howard Chu committed
268

269
dnl ----------------------------------------------------------------
Kurt Zeilenga's avatar
Kurt Zeilenga committed
270
dnl SLURPD OPTIONS
271
272
273
AC_ARG_WITH(xxslurpdoptions,[
SLURPD (Replication Daemon) Options:])
OL_ARG_ENABLE(slurpd,[  --enable-slurpd	  enable building slurpd], auto)dnl
Kurt Zeilenga's avatar
Kurt Zeilenga committed
274

275
dnl ----------------------------------------------------------------
276
277
AC_ARG_WITH(xxliboptions,[
Library Generation & Linking Options])
Kurt Zeilenga's avatar
Kurt Zeilenga committed
278
279
AC_ENABLE_STATIC
AC_ENABLE_SHARED
280

281
282
dnl ----------------------------------------------------------------

283
dnl General "enable" options
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
# Activate any backends that were not explicitly enabled.
# Note that back_bdb defaults to "yes" so this loop won't touch it.
if test $ol_enable_backends != no ; then
	for i in $Backends; do
		eval "ol_tmp=\$ol_enable_$i"
		if test $ol_tmp = no ; then
			eval "ol_enable_$i=$ol_enable_backends"
		fi
	done
fi
# Activate the overlays
if test $ol_enable_overlays != no ; then
	for i in $Overlays; do
		eval "ol_tmp=\$ol_enable_$i"
		if test $ol_tmp = no ; then
			eval "ol_enable_$i=$ol_enable_overlays"
		fi
	done
fi

304
# validate options
Kurt Zeilenga's avatar
Kurt Zeilenga committed
305
306
if test $ol_enable_slapd = no ; then
	dnl SLAPD was specificallly disabled
307
308
309
	if test $ol_enable_slapi = yes ; then
		AC_MSG_WARN([slapd disabled, ignoring --enable-slapi argument])
	fi
310
311
312
	if test $ol_enable_backends != no ; then
		AC_MSG_WARN([slapd disabled, ignoring --enable-backends argument])
	fi
313
314
315
316
	for i in $Backends; do
		eval "ol_tmp=\$ol_enable_$i"
		if test $ol_tmp != no ; then
			AC_MSG_WARN([slapd disabled, ignoring --enable-$i argument])
Howard Chu's avatar
Howard Chu committed
317
			eval "ol_enable_$i=no"
318
319
		fi
	done
320
	if test $ol_enable_modules = yes ; then
Kurt Zeilenga's avatar
Kurt Zeilenga committed
321
		AC_MSG_WARN([slapd disabled, ignoring --enable-modules argument])
322
	fi
323
324
325
	if test $ol_enable_multimaster = yes ; then
		AC_MSG_WARN([slapd disabled, ignoring --enable-multimaster argument])
	fi
Kurt Zeilenga's avatar
Kurt Zeilenga committed
326
	if test $ol_enable_wrappers = yes ; then
Kurt Zeilenga's avatar
Kurt Zeilenga committed
327
		AC_MSG_WARN([slapd disabled, ignoring --enable-wrappers argument])
Kurt Zeilenga's avatar
Kurt Zeilenga committed
328
329
	fi
	if test $ol_enable_rlookups = yes ; then
Kurt Zeilenga's avatar
Kurt Zeilenga committed
330
		AC_MSG_WARN([slapd disabled, ignoring --enable-rlookups argument])
Kurt Zeilenga's avatar
Kurt Zeilenga committed
331
	fi
332
333
334
	if test $ol_enable_aci = yes ; then
		AC_MSG_WARN([slapd disabled, ignoring --enable-aci argument])
	fi
Kurt Zeilenga's avatar
Kurt Zeilenga committed
335
	if test $ol_with_ldbm_api != auto ; then
Kurt Zeilenga's avatar
Kurt Zeilenga committed
336
		AC_MSG_WARN([slapd disabled, ignoring --with-ldbm-api argument])
Kurt Zeilenga's avatar
Kurt Zeilenga committed
337
338
	fi
	if test $ol_with_ldbm_type != auto ; then
Kurt Zeilenga's avatar
Kurt Zeilenga committed
339
		AC_MSG_WARN([slapd disabled, ignoring --with-ldbm-type argument])
Kurt Zeilenga's avatar
Kurt Zeilenga committed
340
341
	fi
	if test $ol_enable_slurpd = yes ; then
Kurt Zeilenga's avatar
Kurt Zeilenga committed
342
		AC_MSG_ERROR([slurpd requires slapd])
Kurt Zeilenga's avatar
Kurt Zeilenga committed
343
	fi
Pierangelo Masarati's avatar
Pierangelo Masarati committed
344
345
346
	if test $ol_enable_rewrite = yes ; then
		AC_MSG_WARN([slapd disabled, ignoring --enable-rewrite argument])
	fi
Pierangelo Masarati's avatar
Pierangelo Masarati committed
347
	dnl overlays
348
349
350
	if test $ol_enable_overlays != no ; then
		AC_MSG_WARN([slapd disabled, ignoring --enable-overlays argument])
	fi
351
352
353
354
	for i in $Overlays; do
		eval "ol_tmp=\$ol_enable_$i"
		if test $ol_tmp != no ; then
			AC_MSG_WARN([slapd disabled, ignoring --enable-$i argument])
Howard Chu's avatar
Howard Chu committed
355
			eval "ol_enable_$i=no"
356
357
		fi
	done
Kurt Zeilenga's avatar
Kurt Zeilenga committed
358
359

	# force settings to no
360
	ol_enable_slapi=no
361

362
363
	ol_enable_backends=no
	ol_enable_overlays=no
364
	ol_enable_modules=no
365
	ol_enable_multimaster=no
Kurt Zeilenga's avatar
Kurt Zeilenga committed
366
	ol_enable_rlookups=no
367
	ol_enable_aci=no
368
369
	ol_enable_wrappers=no

Kurt Zeilenga's avatar
Kurt Zeilenga committed
370
371
	ol_with_ldbm_api=no
	ol_with_ldbm_type=no
372

Kurt Zeilenga's avatar
Kurt Zeilenga committed
373
374
	ol_enable_slurpd=no

Pierangelo Masarati's avatar
Pierangelo Masarati committed
375
376
	ol_enable_rewrite=no

Kurt Zeilenga's avatar
Kurt Zeilenga committed
377
378
379
380
elif test $ol_enable_ldbm = no ; then
	dnl SLAPD without LDBM

	if test $ol_with_ldbm_api != auto ; then
Kurt Zeilenga's avatar
Kurt Zeilenga committed
381
		AC_MSG_WARN([LDBM disabled, ignoring --with-ldbm-api argument])
Kurt Zeilenga's avatar
Kurt Zeilenga committed
382
383
384
	fi

	if test $ol_with_ldbm_type != auto ; then
Kurt Zeilenga's avatar
Kurt Zeilenga committed
385
		AC_MSG_WARN([LDBM disabled, ignoring --with-ldbm-type argument])
Kurt Zeilenga's avatar
Kurt Zeilenga committed
386
387
	fi

388
	if test $ol_enable_modules != yes -a \
389
		$ol_enable_bdb = no -a \
390
		$ol_enable_dnssrv = no -a \
Howard Chu's avatar
Howard Chu committed
391
		$ol_enable_hdb = no -a \
392
		$ol_enable_ldap = no -a \
Pierangelo Masarati's avatar
Pierangelo Masarati committed
393
		$ol_enable_meta = no -a \
394
		$ol_enable_monitor = no -a \
395
		$ol_enable_null = no -a \
396
		$ol_enable_passwd = no -a \
397
		$ol_enable_perl = no -a \
398
		$ol_enable_relay = no -a \
399
		$ol_enable_shell = no -a \
400
		$ol_enable_sql = no ; then
401
402
403
404
405
406
407

		if test $ol_enable_slapd = yes ; then
			AC_MSG_ERROR([slapd requires a backend])
		else
			AC_MSG_WARN([skipping slapd, no backend specified])
			ol_enable_slapd=no
		fi
Kurt Zeilenga's avatar
Kurt Zeilenga committed
408
409
410
411
412
	fi

	ol_with_ldbm_api=no
	ol_with_ldbm_type=no

Howard Chu's avatar
Howard Chu committed
413
	if test $ol_enable_bdb != no -o $ol_enable_hdb != no; then
414
415
416
		ol_with_ldbm_api=berkeley
	fi

Kurt Zeilenga's avatar
Kurt Zeilenga committed
417
418
419
420
else
	dnl SLAPD with LDBM
	if test $ol_with_ldbm_api = gdbm -a \
		$ol_with_ldbm_type = btree ; then
Kurt Zeilenga's avatar
Kurt Zeilenga committed
421
		AC_MSG_ERROR([GDBM only supports LDBM type hash])
Kurt Zeilenga's avatar
Kurt Zeilenga committed
422
	fi
Juan Gomez's avatar
Juan Gomez committed
423
424
425
426
	if test $ol_with_ldbm_api = mdbm -a \
		$ol_with_ldbm_type = btree ; then
		AC_MSG_ERROR([MDBM only supports LDBM type hash])
	fi
Kurt Zeilenga's avatar
Kurt Zeilenga committed
427
428
	if test $ol_with_ldbm_api = ndbm -a \
		$ol_with_ldbm_type = btree ; then
Kurt Zeilenga's avatar
Kurt Zeilenga committed
429
		AC_MSG_ERROR([NDBM only supports LDBM type hash])
Kurt Zeilenga's avatar
Kurt Zeilenga committed
430
	fi
431

Howard Chu's avatar
Howard Chu committed
432
	if test $ol_enable_bdb != no -o $ol_enable_hdb != no ; then
433
434
435
		if test $ol_with_ldbm_api = auto ; then
			ol_with_ldbm_api=berkeley
		elif test $ol_with_ldbm_api != berkeley ; then
Howard Chu's avatar
Howard Chu committed
436
			AC_MSG_ERROR([LDBM API not compatible with BDB/HDB])
437
438
		fi
	fi
Kurt Zeilenga's avatar
Kurt Zeilenga committed
439
440
fi

441
442
443
444
if test $ol_enable_chain != no -a $ol_enable_ldap = no ; then
	AC_MSG_ERROR([--enable-chain requires --enable-ldap])
fi

445
446
447
448
if test $ol_enable_meta = yes -a $ol_enable_ldap = no ; then
	AC_MSG_ERROR([--enable-meta requires --enable-ldap])
fi

Kurt Zeilenga's avatar
Kurt Zeilenga committed
449
450
451
if test $ol_enable_slurpd = yes ; then
	dnl SLURPD was specifically enabled
	if test $ol_with_threads = no ; then
Kurt Zeilenga's avatar
Kurt Zeilenga committed
452
		AC_MSG_ERROR([slurpd requires threads])
Kurt Zeilenga's avatar
Kurt Zeilenga committed
453
454
455
	fi
fi

Kurt Zeilenga's avatar
Kurt Zeilenga committed
456
457
458
459
460
461
if test $ol_enable_lmpasswd = yes ; then
	if test $ol_with_tls = no ; then
		AC_MSG_ERROR([LAN Manager passwords require OpenSSL])
	fi
fi

Howard Chu's avatar
Howard Chu committed
462
if test $ol_enable_kbind = yes ; then
463
464
	if test $ol_with_kerberos = no ; then
		AC_MSG_ERROR([options require --with-kerberos])
Kurt Zeilenga's avatar
Kurt Zeilenga committed
465
	elif test $ol_with_kerberos = auto ; then
466
		ol_with_kerberos=yes
467
	fi
468

Howard Chu's avatar
Howard Chu committed
469
elif test $ol_enable_kbind = no ; then
470
471
472
	if test $ol_with_kerberos = auto ; then
		ol_with_kerberos=no
	elif test $ol_with_kerberos != no ; then
473
		AC_MSG_WARN([Kerberos detection enabled unnecessarily]);
474
		ol_with_kerberos=no
475
	fi
476
477
fi

478
479
480
481
if test $ol_enable_spasswd = yes ; then
	if test $ol_with_cyrus_sasl = no ; then
		AC_MSG_ERROR([options require --with-cyrus-sasl])
	fi
Kurt Zeilenga's avatar
Kurt Zeilenga committed
482
	ol_with_cyrus_sasl=yes
483
484
fi

Kurt Zeilenga's avatar
Kurt Zeilenga committed
485
486
AC_MSG_RESULT(done)

487
488
dnl ----------------------------------------------------------------
dnl Initialize vars
Kurt Zeilenga's avatar
Kurt Zeilenga committed
489
490
491
492
493
494
495
496
497
498
499
LDAP_LIBS=
LDBM_LIBS=
LTHREAD_LIBS=
LUTIL_LIBS=

SLAPD_LIBS=
SLURPD_LIBS=

BUILD_SLAPD=no
BUILD_SLURPD=no

500
501
BUILD_THREAD=no

502
503
504
BUILD_SLAPI=no
SLAPD_SLAPI_DEPEND=

505
BUILD_BDB=no
506
BUILD_DNSSRV=no
Howard Chu's avatar
Howard Chu committed
507
BUILD_HDB=no
508
BUILD_LDAP=no
Kurt Zeilenga's avatar
Kurt Zeilenga committed
509
BUILD_LDBM=no
Pierangelo Masarati's avatar
Pierangelo Masarati committed
510
BUILD_META=no
511
BUILD_MONITOR=no
512
BUILD_NULL=no
Kurt Zeilenga's avatar
Kurt Zeilenga committed
513
BUILD_PASSWD=no
514
BUILD_PERL=no
515
BUILD_RELAY=no
Kurt Zeilenga's avatar
Kurt Zeilenga committed
516
BUILD_SHELL=no
517
BUILD_SQL=no
Kurt Zeilenga's avatar
Kurt Zeilenga committed
518

Pierangelo Masarati's avatar
Pierangelo Masarati committed
519
520
BUILD_CHAIN=no
BUILD_DENYOP=no
Howard Chu's avatar
Howard Chu committed
521
BUILD_DYNGROUP=no
522
BUILD_LASTMOD=no
Howard Chu's avatar
Howard Chu committed
523
BUILD_PPOLICY=no
Howard Chu's avatar
Howard Chu committed
524
BUILD_PROXYCACHE=no
525
BUILD_REFINT=no
526
BUILD_RWM=no
527
BUILD_UNIQUE=no
Howard Chu's avatar
Howard Chu committed
528
529
530

SLAPD_DYNAMIC_OVERLAYS=

531
532
533
SLAPD_MODULES_LDFLAGS=
SLAPD_MODULES_CPPFLAGS=

534
535
536
SLAPD_STATIC_BACKENDS=
SLAPD_DYNAMIC_BACKENDS=

537
SLAPD_PERL_LDFLAGS=
538
539
MOD_PERL_LDFLAGS=
PERL_CPPFLAGS=
540

541
542
543
544
SLAPD_SQL_LDFLAGS=
SLAPD_SQL_LIBS=
SLAPD_SQL_INCLUDES=

545
546
KRB4_LIBS=
KRB5_LIBS=
547
SASL_LIBS=
Bart Hartgers's avatar
   
Bart Hartgers committed
548
TLS_LIBS=
549
MODULES_LIBS=
550
SLAPI_LIBS=
Pierangelo Masarati's avatar
Pierangelo Masarati committed
551
552
LIBSLAPI=
LIBSLAPITOOLS=
553
AUTH_LIBS=
Kurt Zeilenga's avatar
Kurt Zeilenga committed
554

555
556
SLAPD_SLP_LIBS=

557
dnl ================================================================
Kurt Zeilenga's avatar
Kurt Zeilenga committed
558
559
dnl Checks for programs

Kurt Zeilenga's avatar
Kurt Zeilenga committed
560
AC_PROG_INSTALL
561

562
563
AC_DEFINE(HAVE_MKVERSION, 1, [define this if you have mkversion])

564
dnl ----------------------------------------------------------------
565
566
567
568
dnl
dnl Determine which C translator to use
dnl

569
dnl AIX Thread requires we use cc_r or xlc_r.
Kurt Zeilenga's avatar
Kurt Zeilenga committed
570
571
dnl But only do this IF AIX and CC is not set
dnl and threads are auto|yes|posix.
572
dnl
573
dnl If we find cc_r|xlc_r, force pthreads and assume
574
575
dnl		pthread_create is in $LIBS (ie: don't bring in
dnl		any additional thread libraries)
576
dnl If we do not find cc_r|xlc_r, disable threads
577
578

ol_aix_threads=no
579
case "$target" in
Kurt Zeilenga's avatar
Kurt Zeilenga committed
580
*-*-aix*) dnl all AIX is not a good idea.
581
	if test -z "$CC" ; then
Kurt Zeilenga's avatar
Kurt Zeilenga committed
582
		case "$ol_with_threads" in
583
		auto | yes |  posix) ol_aix_threads=yes ;;
Kurt Zeilenga's avatar
Kurt Zeilenga committed
584
585
586
587
		esac
	fi
;;
esac
588

589
590
591
592
593
594
595
596
597
598
599
600
601
602
if test $ol_aix_threads = yes ; then
	if test -z "${CC}" ; then
		AC_CHECK_PROGS(CC,cc_r xlc_r cc)

		if test "$CC" = cc ; then
			dnl no CC! don't allow --with-threads
			if test $ol_with_threads != auto ; then
				AC_MSG_ERROR([--with-threads requires cc_r (or other suitable compiler) on AIX])
			else
				AC_MSG_WARN([disabling threads, no cc_r on AIX])
			fi
			ol_with_threads=no
  		fi
	fi
Kurt Zeilenga's avatar
Kurt Zeilenga committed
603

604
	if test "${CC}" = "cc_r" -o "${CC}" = "xlc_r" ; then
605
606
607
608
609
		ol_with_threads=posix
		ol_cv_pthread_create=yes
	fi
fi

Kurt Zeilenga's avatar
Kurt Zeilenga committed
610
if test -z "${CC}"; then
Kurt Zeilenga's avatar
Kurt Zeilenga committed
611
	AC_CHECK_PROGS(CC,cc gcc,missing)
Kurt Zeilenga's avatar
Kurt Zeilenga committed
612
613

	if test "${CC}" = "missing" ; then
Kurt Zeilenga's avatar
Kurt Zeilenga committed
614
		AC_MSG_ERROR([Unable to locate cc(1) or suitable replacement.  Check PATH or set CC.])
Kurt Zeilenga's avatar
Kurt Zeilenga committed
615
	fi
Kurt Zeilenga's avatar
Kurt Zeilenga committed
616
617
fi

618
619
620
621
if test -z "${AR}"; then
	AC_CHECK_PROGS(AR,ar gar,missing)

	if test "${AR}" = "missing" ; then
Kurt Zeilenga's avatar
Kurt Zeilenga committed
622
		AC_MSG_ERROR([Unable to locate ar(1) or suitable replacement.  Check PATH or set AR.])
623
624
	fi
fi
625

Howard Chu's avatar
Howard Chu committed
626
AC_LIBTOOL_WIN32_DLL
627
AC_LIBTOOL_DLOPEN
Kurt Zeilenga's avatar
Kurt Zeilenga committed
628
AC_PROG_LIBTOOL
Kurt Zeilenga's avatar
Kurt Zeilenga committed
629

630
631
OL_PROG_LN_H
AC_PROG_LN_S
632

633
634
dnl ----------------------------------------------------------------
dnl Perl
635
636
ol_link_perl=no
if test $ol_enable_perl != no ; then
637
638
639
	AC_PATH_PROG(PERLBIN, perl, /usr/bin/perl)

	if test "no$PERLBIN" = "no" ; then
640
641
642
		if test $ol_enable_perl = yes ; then
			AC_MSG_ERROR([could not locate perl])
		fi
643

644
	else
645
		PERL_CPPFLAGS="`$PERLBIN -MExtUtils::Embed -e ccopts`"
646
		PERL_LDFLAGS="`$PERLBIN -MExtUtils::Embed -e ldopts|sed -e 's/ -lc / /' -e 's/ -lc$//'`"
Kurt Zeilenga's avatar
Kurt Zeilenga committed
647

648
		if test x"$ol_enable_perl" = "xyes" ; then
Kurt Zeilenga's avatar
Kurt Zeilenga committed
649
			SLAPD_PERL_LDFLAGS="$PERL_LDFLAGS"
650
		else
Kurt Zeilenga's avatar
Kurt Zeilenga committed
651
			MOD_PERL_LDFLAGS="$PERL_LDFLAGS"
652
		fi
653
654
655
		dnl should check perl version
		ol_link_perl=yes
	fi
656
657
fi

658
AC_PROG_CPP
659

660
dnl ----------------------------------------------------------------
661
dnl Checks for UNIX Variants
Kurt Zeilenga's avatar
Kurt Zeilenga committed
662
663
664
dnl AC_AIX
dnl AC_ISC_POSIX
dnl AC_MINIX
Kurt Zeilenga's avatar
Kurt Zeilenga committed
665

666
dnl ----------------------------------------------------------------
667
668
669
670
671
dnl Checks for system services
AC_CYGWIN
AC_MINGW32
AC_EXEEXT
AC_OBJEXT
672

Kurt Zeilenga's avatar
Kurt Zeilenga committed
673
AC_DEFINE_UNQUOTED(EXEEXT, "${EXEEXT}", [defined to be the EXE extension])
674

675
dnl ----------------------------------------------------------------
676
677
678
dnl BeOS requires -lbe -lroot -lnet
AC_CHECK_LIB(be, be_app, [LIBS="$LIBS -lbe -lroot -lnet"], :, [-lroot -lnet])

679
dnl ----------------------------------------------------------------
680
681
682
dnl OpenLDAP requires STDC features
AM_PROG_CC_STDC
if test "X${am_cv_prog_cc_stdc}" = "Xno" ; then
683
	AC_MSG_ERROR([OpenLDAP requires compiler to support STDC constructs.])
684
685
fi

686
dnl ----------------------------------------------------------------
687
dnl Check cc depend flags
Kurt Zeilenga's avatar
Kurt Zeilenga committed
688
689
690
691
692
OL_MKDEPEND
if test "${ol_cv_mkdep}" = no ; then
	# this will soon become an error
	AC_MSG_WARN([do not know how to generate dependencies])
fi
693

694
695
dnl ----------------------------------------------------------------
dnl Check for AIX security library
696
AC_CHECK_LIB(s, afopen, [
697
698
699
700
	AUTH_LIBS=-ls
	AC_DEFINE(HAVE_AIX_SECURITY,1,[define if you have AIX security lib])
])

701
702
703
704
705
706
707
708
dnl ----------------------------------------------------------------
dnl Check for IBM OS/390
case "$target" in
*-ibm-openedition)
	ac_cv_func_getopt=no
	AC_DEFINE(BOTH_STRINGS_H,1,[define to use both <string.h> and <strings.h>])
	;;
esac
709

710
dnl ----------------------------------------------------------------
711
712
713
714
715
716
717
718
719
dnl Check for module support
ol_link_modules=no
if test $ol_enable_modules != no ; then
	AC_CHECK_HEADERS(ltdl.h)

	if test $ac_cv_header_ltdl_h = no ; then
		AC_MSG_ERROR([could not locate libtool ltdl.h])
	fi

Howard Chu's avatar
Howard Chu committed
720
	AC_CHECK_LIB(ltdl, lt_dlinit, [
Kurt Zeilenga's avatar
Kurt Zeilenga committed
721
722
		MODULES_LIBS=-lltdl
		AC_DEFINE(HAVE_LIBLTDL,1,[define if you have libtool -ltdl])
Howard Chu's avatar
Howard Chu committed
723
724
	])

725
726
727
728
	if test "$ac_cv_lib_ltdl_lt_dlinit" = no ; then
		AC_MSG_ERROR([could not locate libtool -lltdl])
	fi
	ol_link_modules=yes
729

730
else
731
732
733
734
	for i in $Backends; do
		eval "ol_tmp=\$ol_enable_$i"
		if test $ol_tmp = mod ; then
			AC_MSG_WARN([building static $i backend])
Howard Chu's avatar
Howard Chu committed
735
			eval "ol_enable_$i=yes"
736
737
738
739
740
741
		fi
	done
	for i in $Overlays; do
		eval "ol_tmp=\$ol_enable_$i"
		if test $ol_tmp = mod ; then
			AC_MSG_WARN([building static $i overlay])
Howard Chu's avatar
Howard Chu committed
742
			eval "ol_enable_$i=yes"
743
744
		fi
	done
745
746
fi

747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
dnl ----------------------------------------------------------------
dnl Checks for header files.
OL_HEADER_STDC

if test $ol_cv_header_stdc != yes; then
	AC_MSG_WARN([could not locate Standard C compliant headers])
fi

AC_HEADER_DIRENT
AC_HEADER_SYS_WAIT
AM_HEADER_TIOCGWINSZ_NEEDS_SYS_IOCTL
if test $am_cv_sys_posix_termios = yes ; then
	AC_DEFINE(HAVE_POSIX_TERMIOS,1,
		[define if you have POSIX termios])
fi

AC_CHECK_HEADERS(	\
	arpa/inet.h		\
	arpa/nameser.h	\
	assert.h		\
767
	bits/types.h	\
Howard Chu's avatar
Howard Chu committed
768
	conio.h			\
769
	crypt.h			\
Howard Chu's avatar
Howard Chu committed
770
	direct.h		\
771
772
773
774
775
	errno.h			\
	fcntl.h			\
	filio.h			\
	getopt.h		\
	grp.h			\
Howard Chu's avatar
Howard Chu committed
776
	io.h			\
777
778
779
780
781
782
783
784
	libutil.h		\
	limits.h		\
	locale.h		\
	netinet/tcp.h	\
	malloc.h		\
	memory.h		\
	psap.h			\
	pwd.h			\
Howard Chu's avatar
Howard Chu committed
785
	process.h		\
786
	resolv.h		\
787
788
789
790
791
792
793
794
795
796
797
798
799
800
	sgtty.h			\
	shadow.h		\
	stddef.h		\
	string.h		\
	strings.h		\
	sysexits.h		\
	sys/file.h		\
	sys/filio.h		\
	sys/errno.h		\
	sys/ioctl.h		\
	sys/param.h		\
	sys/resource.h	\
	sys/select.h	\
	sys/socket.h	\
801
	sys/stat.h		\
802
803
804
	sys/syslog.h	\
	sys/time.h		\
	sys/types.h		\
805
	sys/ucred.h		\
806
	sys/uio.h		\
807
808
809
	syslog.h		\
	termios.h		\
	unistd.h		\
810
	winsock.h		\
Howard Chu's avatar
Howard Chu committed
811
	winsock2.h		\
812
813
)

Howard Chu's avatar
Howard Chu committed
814

815
dnl ----------------------------------------------------------------
Kurt Zeilenga's avatar
Kurt Zeilenga committed
816
817
dnl Checks for libraries

818
819
820
dnl HP-UX requires -lV3
dnl this is not needed on newer versions of HP-UX
AC_CHECK_LIB(V3, sigset)
821

Howard Chu's avatar
Howard Chu committed
822
823
824
dnl The following is INTENTIONALLY scripted out because shell does not
dnl support variable names with the '@' character, which is what
dnl autoconf would try to generate if one merely used AC_SEARCH_LIBS
825
826
if test "$ac_cv_header_winsock_h" = yes; then
AC_CACHE_CHECK([for winsock], [ol_cv_winsock],
Howard Chu's avatar
Howard Chu committed
827
828
829
save_LIBS="$LIBS"
for curlib in ws2_32 wsock32; do
	LIBS="$LIBS -l$curlib"
830
	AC_TRY_LINK([#include <winsock.h>
Kurt Zeilenga's avatar
Kurt Zeilenga committed
831
832
			],
			[
833
834
835
836
			socket(0,0,0);
			select(0,NULL,NULL,NULL,NULL);
			closesocket(0);
			gethostname(NULL,0);
Kurt Zeilenga's avatar
Kurt Zeilenga committed
837
			],
838
			ol_cv_winsock=yes, ol_cv_winsock=no)
Howard Chu's avatar
Howard Chu committed
839

840
	if test $ol_cv_winsock = yes; then
Howard Chu's avatar
Howard Chu committed
841
		AC_DEFINE(HAVE_WINSOCK, 1, [define if you have winsock])
842
843
844
845
		ac_cv_func_socket=yes
		ac_cv_func_select=yes
		ac_cv_func_closesocket=yes
		ac_cv_func_gethostname=yes
Howard Chu's avatar
Howard Chu committed
846
		if test $curlib = ws2_32; then
847
			ol_cv_winsock=winsock2
Howard Chu's avatar
Howard Chu committed
848
849
850
851
			AC_DEFINE(HAVE_WINSOCK2, 1,
				  [define if you have winsock2])
		fi
		break
852
	fi
Howard Chu's avatar
Howard Chu committed
853
	LIBS="$save_LIBS"
854
855
done)
fi
Howard Chu's avatar
Howard Chu committed
856

Kurt Zeilenga's avatar
Kurt Zeilenga committed
857
858
859
860
861
dnl Find socket()
dnl Likely combinations:
dnl		-lsocket [ -lnsl_s | -lnsl ]
dnl		-linet

Kurt Zeilenga's avatar
Kurt Zeilenga committed
862
AC_CHECK_FUNC(socket, :, [	
Kurt Zeilenga's avatar
Kurt Zeilenga committed
863
864
865
866
867
868
869
870
871
dnl hopefully we won't include too many libraries
	AC_CHECK_LIB(socket, main)
	AC_CHECK_LIB(net, main)
	AC_CHECK_LIB(nsl_s, main)
	AC_CHECK_LIB(nsl, main)
	AC_CHECK_LIB(inet, socket)
	AC_CHECK_LIB(gen, main)
])

Kurt Zeilenga's avatar
Kurt Zeilenga committed
872
dnl require select
873
874
AC_CHECK_FUNC(select, :, AC_MSG_ERROR([select() required.]))

Howard Chu's avatar
Howard Chu committed
875
if test "${ac_cv_header_winsock_h}" != yes; then
Kurt Zeilenga's avatar
Kurt Zeilenga committed
876
877
878
879
	dnl Select arg types
	dnl (if this detection becomes permenent, it and the select() detection
	dnl should be done before the yielding select test) 
	AC_FUNC_SELECT_ARGTYPES
Howard Chu's avatar
Howard Chu committed
880
fi
881

882
dnl check to see if system call automatically restart
883
dnl AC_SYS_RESTARTABLE_SYSCALLS
884

Kurt Zeilenga's avatar
Kurt Zeilenga committed
885
886
887
888
dnl ----------------------------------------------------------------
# strerror checks
OL_STRERROR

889
dnl ----------------------------------------------------------------
Kurt Zeilenga's avatar
Kurt Zeilenga committed
890
dnl require POSIX regex
891
892
893
894
AC_CHECK_HEADERS( regex.h )
if test "$ac_cv_header_regex_h" != yes ; then
	AC_MSG_ERROR([POSIX regex.h required.])
fi
Howard Chu's avatar
Howard Chu committed
895
AC_SEARCH_LIBS(regfree, [regex gnuregex],
Kurt Zeilenga's avatar
Kurt Zeilenga committed
896
	:, AC_MSG_ERROR([POSIX regex required.]))
897
898
899
900
901
902

OL_POSIX_REGEX
if test "$ol_cv_c_posix_regex" = no ; then
	AC_MSG_ERROR([broken POSIX regex!])
fi

903
dnl ----------------------------------------------------------------
Kurt Zeilenga's avatar
Kurt Zeilenga committed
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
dnl UUID Support

have_uuid=no
AC_CHECK_HEADERS(sys/uuid.h)
if test $ac_cv_header_sys_uuid_h = yes ; then
	save_LIBS="$LIBS"
	AC_SEARCH_LIBS(uuid_to_str, uuid, [have_uuid=yes], :)
	LIBS="$save_LIBS"

	if test have_uuid = yes ; then
		AC_DEFINE(HAVE_UUID_TO_STR,1,
			[define if you have uuid_to_str()])

		test "$ac_cv_search_uuid_to_str" = "none required" || \
			SLAPD_LIBS="$SLAPD_LIBS $ac_cv_search_uuid_to_str"
	fi
fi

922
dnl For windows, check for the need of RPCRT for UUID function support
Kurt Zeilenga's avatar
Kurt Zeilenga committed
923
924
925
926
927
if test $have_uuid = no ; then
	AC_MSG_CHECKING(to see if -lrpcrt4 is needed for win32 UUID support)
	save_LIBS="$LIBS"
	LIBS="$LIBS -lrpcrt4"
	AC_TRY_LINK([
928
929
		int __stdcall UuidCreate(void *);
		int __stdcall UuidToStringA(void *,void **);
930
931
		],
		[
932
933
		UuidCreate(0);
		UuidToStringA(0,0);
934
935
		],
		need_rpcrt=yes, need_rpcrt=no)
Kurt Zeilenga's avatar
Kurt Zeilenga committed
936
937
938
939
940
	if test $need_rpcrt = yes; then
		SLAPD_LIBS="$SLAPD_LIBS -lrpcrt4"
	fi
	LIBS="$save_LIBS"
	AC_MSG_RESULT($need_rpcrt)
941
942
fi

943
dnl ----------------------------------------------------------------
944
dnl Check for resolver routines
945
946
dnl	  need to check for both res_query and __res_query
dnl   need to check -lc, -lbind, and -lresolv
947
948
ol_link_dnssrv=no
AC_CHECK_FUNC(res_query,:)
949
950
951
952
953
if test $ac_cv_func_res_query = no ; then 
	AC_CHECK_FUNC(__res_query,:)
	ac_cv_func_res_query=$ac_cv_func___res_query
fi

954
955
956
if test $ac_cv_func_res_query = no ; then 
	AC_CHECK_LIB(bind, res_query)
	ac_cv_func_res_query=$ac_cv_lib_bind_res_query
957
fi
958

959
960
961
if test $ac_cv_func_res_query = no ; then 
	AC_CHECK_LIB(bind, __res_query)
	ac_cv_func_res_query=$ac_cv_lib_bind___res_query
962
fi
Kurt Zeilenga's avatar
Kurt Zeilenga committed
963

964
965
966
if test $ac_cv_func_res_query = no ; then 
	AC_CHECK_LIB(resolv, res_query)
	ac_cv_func_res_query=$ac_cv_lib_resolv_res_query
967
968
fi

969
970
971
972
973
if test $ac_cv_func_res_query = no ; then 
	AC_CHECK_LIB(resolv, __res_query)
	ac_cv_func_res_query=$ac_cv_lib_resolv___res_query
fi

974
975
976
977
978
979
980
if test "$ac_cv_func_res_query" = yes ; then
	AC_DEFINE(HAVE_RES_QUERY,1,
		[define if you have res_query()])

	if test $ol_enable_dnssrv != no ; then
		ol_link_dnssrv=yes
	fi
981
fi
982

983
if test "$ol_enable_dnssrv" != no -a "$ol_link_dnssrv" = no ; then
984
985
	AC_MSG_ERROR([DNSSRV requires res_query()])
fi
Kurt Zeilenga's avatar
Kurt Zeilenga committed
986

Kurt Zeilenga's avatar
Kurt Zeilenga committed
987
988
AC_CHECK_FUNCS( hstrerror )

Kurt Zeilenga's avatar
Kurt Zeilenga committed
989
990
991
dnl ----------------------------------------------------------------
dnl PF_INET6 support requires getaddrinfo and INET6_ADDRSTRLEN
dnl PF_LOCAL may use getaddrinfo in available
992
AC_CHECK_FUNCS( getaddrinfo getnameinfo gai_strerror inet_ntop )
Kurt Zeilenga's avatar
Kurt Zeilenga committed
993
994

ol_link_ipv6=no
995
if test $ac_cv_func_getaddrinfo = no -o $ac_cv_func_inet_ntop = no ; then
Kurt Zeilenga's avatar
Kurt Zeilenga committed
996
	if test $ol_enable_ipv6 = yes ; then
997
		AC_MSG_ERROR([IPv6 support requires getaddrinfo() and inet_ntop()])
Kurt Zeilenga's avatar
Kurt Zeilenga committed
998
	fi
999
elif test $ol_enable_ipv6 != no ; then
Kurt Zeilenga's avatar
Kurt Zeilenga committed
1000
	AC_CACHE_CHECK([INET6_ADDRSTRLEN],[ol_cv_inet6_addrstrlen],[