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

Kurt Zeilenga's avatar
Kurt Zeilenga committed
19
# Copyright 1998-2002 The OpenLDAP Foundation.  All Rights Reserved.
20
# 
21
22
23
24
25
# Redistribution and use in source and binary forms, with or without
# modification, are permitted only as authorized by the OpenLDAP
# Public License.  A copy of this license is available at
# http://www.OpenLDAP.org/license.html or in file LICENSE in the
# top-level directory of the distribution.
26

Kurt Zeilenga's avatar
Kurt Zeilenga committed
27
echo "Copyright 1998-2002 The OpenLDAP Foundation,  All Rights Reserved."
Kurt Zeilenga's avatar
Kurt Zeilenga committed
28
echo "Restrictions apply, see COPYRIGHT and LICENSE files."
29
])dnl
30
dnl ----------------------------------------------------------------
31
32
33
dnl Disable config.cache!
define([AC_CACHE_LOAD], )dnl
define([AC_CACHE_SAVE], )dnl
Kurt Zeilenga's avatar
Kurt Zeilenga committed
34
dnl ================================================================
Kurt Zeilenga's avatar
Kurt Zeilenga committed
35
dnl Configure.in for OpenLDAP
36
AC_INIT(build/version.sh)dnl
37

38
# set unset (borrowed from autoconf 2.49c)
Kurt Zeilenga's avatar
Kurt Zeilenga committed
39
if (OL_FOO=OL_FOO; unset OL_FOO) >/dev/null 2>&1; then
40
41
42
43
44
  ol_unset=unset
else
  ol_unset=false
fi
# unset CDPATH
45
$ol_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
46

47
AC_CONFIG_AUX_DIR(build)dnl
48

49
50
eval `$ac_aux_dir/version.sh`
if test -z "$OL_STRING"; then
51
52
53
	AC_MSG_ERROR([could not determine version])
fi

54
55
56
57
58
ac_cv_shtool=$ac_aux_dir/shtool
SHTOOL=$ac_cv_shtool
AC_SUBST(SHTOOL)

$SHTOOL echo -e "Configuring %B${OL_STRING}%b ..."
59

60
61
62
63
dnl Determine host platform
dnl		we try not to use this for much
AC_CANONICAL_SYSTEM

64
AM_INIT_AUTOMAKE([$OL_PACKAGE],[$OL_VERSION], [no defines])dnl
Kurt Zeilenga's avatar
Kurt Zeilenga committed
65
66
AC_SUBST(PACKAGE)dnl
AC_SUBST(VERSION)dnl
Kurt Zeilenga's avatar
Kurt Zeilenga committed
67
68
AC_DEFINE_UNQUOTED(OPENLDAP_PACKAGE,"$PACKAGE",Package)
AC_DEFINE_UNQUOTED(OPENLDAP_VERSION,"$VERSION",Version)
69

70
71
72
73
74
75
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)

OPENLDAP_LIBVERSION=$OL_API_LIB
Kurt Zeilenga's avatar
Kurt Zeilenga committed
76
AC_SUBST(OPENLDAP_LIBVERSION)dnl
77

78
dnl We use autoconf features new to 2.13.
79
dnl aclocal.m4 should be built using aclocal from automake 1.4
Kurt Zeilenga's avatar
Kurt Zeilenga committed
80
dnl libtool 1.4.2 should be installed.
81
AC_PREREQ(2.13)dnl Required Autoconf version
82

83
AC_CONFIG_HEADER(include/portable.h include/ldap_features.h include/lber_types.h)dnl
84

85
dnl ================================================================
Kurt Zeilenga's avatar
Kurt Zeilenga committed
86
87
88
89
dnl Start Args
AC_MSG_CHECKING(configure arguments)
AC_PREFIX_DEFAULT(/usr/local)

90
91
92
top_builddir=`pwd`
AC_SUBST(top_builddir)dnl

93
94
dnl ----------------------------------------------------------------
dnl --with-subdir
95
ldap_subdir="/openldap"
Kurt Zeilenga's avatar
Kurt Zeilenga committed
96

97
AC_ARG_WITH(subdir,
Kurt Zeilenga's avatar
Kurt Zeilenga committed
98
[  --with-subdir=DIR       change default subdirectory used for installs],
99
100
101
102
103
104
[case "$withval" in
	no) ldap_subdir=""
		;;
	yes)
		;;
	/*|\\*)
105
		ldap_subdir="$withval"
106
107
108
109
110
		;;
	*)
		ldap_subdir="/$withval"
		;;
esac
111
112
])dnl

113
114
AC_SUBST(ldap_subdir)dnl

115
116
dnl ----------------------------------------------------------------
dnl General "enable" options
117
118
119
OL_ARG_ENABLE(debug,[  --enable-debug 	  enable debugging], yes)dnl
OL_ARG_ENABLE(syslog,[  --enable-syslog	  enable syslog support], auto)dnl
OL_ARG_ENABLE(proctitle,[  --enable-proctitle	  enable proctitle support], yes)dnl
Kurt Zeilenga's avatar
Kurt Zeilenga committed
120
OL_ARG_ENABLE(cache,[  --enable-cache	  enable caching (experimental)], no)dnl
121
122
OL_ARG_ENABLE(referrals,[  --enable-referrals	  enable LDAPv2+ Referrals (experimental)], no)dnl
OL_ARG_ENABLE(kbind,[  --enable-kbind	  enable LDAPv2+ Kerberos IV bind (deprecated)], no)dnl
123
124
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
125
OL_ARG_ENABLE(rewrite,[  --enable-rewrite	  enable rewrite], no)dnl
126
OL_ARG_ENABLE(x_compile,[  --enable-x-compile	  enable cross compiling],
127
	no, [yes no])dnl
Kurt Zeilenga's avatar
Kurt Zeilenga committed
128

129
dnl ----------------------------------------------------------------
Kurt Zeilenga's avatar
Kurt Zeilenga committed
130
dnl General "with" options
131
dnl OL_ARG_ENABLE(dmalloc,[  --enable-dmalloc	  enable debug malloc support], no)dnl
132

133
OL_ARG_WITH(cyrus_sasl,[  --with-cyrus-sasl	  with Cyrus SASL support],
134
	auto, [auto yes no] )
135
OL_ARG_WITH(fetch,[  --with-fetch		  with fetch URL support],
136
	auto, [auto yes no] )
137
OL_ARG_WITH(kerberos,[  --with-kerberos	  with Kerberos support],
138
	auto, [auto k5 k5only k425 kth k4 afs yes no])
139
OL_ARG_WITH(readline,[  --with-readline	  with readline support],
140
	auto, [auto yes no] )
141
OL_ARG_WITH(threads,[  --with-threads	  with threads],
142
	auto, [auto nt posix mach pth lwp yes no manual] )
143
OL_ARG_WITH(tls,[  --with-tls		  with TLS/SSL support],
Bart Hartgers's avatar
   
Bart Hartgers committed
144
	auto, [auto ssleay openssl yes no] )
145
OL_ARG_WITH(yielding_select,[  --with-yielding-select  with implicitly yielding select],
146
	auto, [auto yes no manual] )
Kurt Zeilenga's avatar
Kurt Zeilenga committed
147

148
dnl ----------------------------------------------------------------
Kurt Zeilenga's avatar
Kurt Zeilenga committed
149
dnl Server options
150
dnl ----------------------------------------------------------------
Kurt Zeilenga's avatar
Kurt Zeilenga committed
151

152
dnl ----------------------------------------------------------------
Kurt Zeilenga's avatar
Kurt Zeilenga committed
153
dnl SLAPD OPTIONS
154
AC_ARG_WITH(xxslapdoptions,[SLAPD (Standalone LDAP Daemon) Options:])
155
OL_ARG_ENABLE(slapd,[  --enable-slapd	  enable building slapd], yes)dnl
Kurt Zeilenga's avatar
Kurt Zeilenga committed
156
OL_ARG_ENABLE(aci,[    --enable-aci	  enable per-object ACIs (experimental)], no)dnl
157
OL_ARG_ENABLE(cleartext,[    --enable-cleartext	  enable cleartext passwords], yes)dnl
158
OL_ARG_ENABLE(crypt,[    --enable-crypt	  enable crypt(3) passwords], no)dnl
159
OL_ARG_ENABLE(dynamic,[    --enable-dynamic	  enable linking built binaries with dynamic libs], no)dnl
Kurt Zeilenga's avatar
Cleanup    
Kurt Zeilenga committed
160
OL_ARG_ENABLE(kpasswd,[    --enable-kpasswd	  enable Kerberos password verification], no)dnl
161
OL_ARG_ENABLE(lmpasswd,[    --enable-lmpasswd	  enable LAN Manager passwords], no)dnl
162
163
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
164
dnl OL_ARG_ENABLE(multimaster,[    --enable-multimaster  enable multimaster replication], no)dnl
165
OL_ARG_ENABLE(phonetic,[    --enable-phonetic	  enable phonetic/soundex], no)dnl
166
OL_ARG_ENABLE(rlookups,[    --enable-rlookups	  enable reverse lookups], no)dnl
Kurt Zeilenga's avatar
Kurt Zeilenga committed
167
OL_ARG_ENABLE(slp, [    --enable-slp          enable SLPv2 support], no)dnl     
168
OL_ARG_ENABLE(wrappers,[    --enable-wrappers	  enable tcp wrapper support], no)dnl
Kurt Zeilenga's avatar
Kurt Zeilenga committed
169
170

dnl SLAPD Backend options
171
OL_ARG_ENABLE(bdb,[    --enable-bdb	  enable Berkeley DB backend], yes)dnl
Kurt Zeilenga's avatar
Kurt Zeilenga committed
172
OL_ARG_WITH(bdb_module,[    --with-bdb-module     module type], static,
173
	[static dynamic])
174
175
OL_ARG_ENABLE(dnssrv,[    --enable-dnssrv	  enable dnssrv backend], no)dnl
OL_ARG_WITH(dnssrv_module,[    --with-dnssrv-module  module type], static,
176
	[static dynamic])
177
178
OL_ARG_ENABLE(ldap,[    --enable-ldap	  enable ldap backend], no)dnl
OL_ARG_WITH(ldap_module,[    --with-ldap-module	  module type], static,
179
	[static dynamic])
180
OL_ARG_ENABLE(ldbm,[    --enable-ldbm	  enable ldbm backend], no)dnl
181
OL_ARG_WITH(ldbm_api,[    --with-ldbm-api       with LDBM API], auto,
Kurt Zeilenga's avatar
Kurt Zeilenga committed
182
	[auto berkeley bcompat mdbm gdbm])
183
OL_ARG_WITH(ldbm_module,[    --with-ldbm-module	  module type], static,
Kurt Zeilenga's avatar
Kurt Zeilenga committed
184
	[static dynamic])
185
OL_ARG_WITH(ldbm_type,[    --with-ldbm-type	  use LDBM type], auto,
Kurt Zeilenga's avatar
Kurt Zeilenga committed
186
	[auto btree hash])
Pierangelo Masarati's avatar
Pierangelo Masarati committed
187
188
189
OL_ARG_ENABLE(meta,[    --enable-meta	  enable metadirectory backend], no)dnl
OL_ARG_WITH(meta_module,[    --with-meta-module	  module type], static,
	[static dynamic])
190
OL_ARG_ENABLE(monitor,[    --enable-monitor	  enable monitor backend], no)dnl
Kurt Zeilenga's avatar
Kurt Zeilenga committed
191
OL_ARG_WITH(monitor_module,[    --with-monitor-module module type], static,
192
	[static dynamic])
193
194
OL_ARG_ENABLE(passwd,[    --enable-passwd	  enable passwd backend], no)dnl
OL_ARG_WITH(passwd_module,[    --with-passwd-module  module type], static,
195
	[static dynamic])
196
197
OL_ARG_ENABLE(perl,[    --enable-perl	  enable perl backend], no)dnl
OL_ARG_WITH(perl_module,[    --with-perl-module	  module type], static,
198
	[static dynamic])
199
200
OL_ARG_ENABLE(shell,[    --enable-shell	  enable shell backend], no)dnl
OL_ARG_WITH(shell_module,[    --with-shell-module	  module type], static,
201
	[static dynamic])
202
203
OL_ARG_ENABLE(sql,[    --enable-sql	  enable sql backend], no)dnl
OL_ARG_WITH(sql_module,[    --with-sql-module	  module type], static,
204
	[static dynamic])
205
206
OL_ARG_ENABLE(tcl,[    --enable-tcl	  enable tcl backend], no)dnl
OL_ARG_WITH(tcl_module,[    --with-tcl-module	  module type], static,
207
	[static dynamic])
Kurt Zeilenga's avatar
Kurt Zeilenga committed
208

209
dnl ----------------------------------------------------------------
Kurt Zeilenga's avatar
Kurt Zeilenga committed
210
dnl SLURPD OPTIONS
Kurt Zeilenga's avatar
Kurt Zeilenga committed
211
AC_ARG_WITH(xxslurpdoptions,[SLURPD (Replication Daemon) Options:])
212
OL_ARG_ENABLE(slurpd,[  --enable-slurpd	  enable building slurpd], auto)dnl
Kurt Zeilenga's avatar
Kurt Zeilenga committed
213

214
dnl ----------------------------------------------------------------
215
AC_ARG_WITH(xxliboptions,[Library Generation & Linking Options])
Kurt Zeilenga's avatar
Kurt Zeilenga committed
216
217
218
AC_ENABLE_STATIC
dnl AC_DISABLE_SHARED
AC_ENABLE_SHARED
219

220
221
dnl ----------------------------------------------------------------

222
dnl General "enable" options
223
# validate options
Kurt Zeilenga's avatar
Kurt Zeilenga committed
224
225
if test $ol_enable_slapd = no ; then
	dnl SLAPD was specificallly disabled
226
227
228
	if test $ol_enable_bdb = yes ; then
		AC_MSG_WARN([slapd disabled, ignoring --enable-bdb argument])
	fi
229
230
231
	if test $ol_enable_dnssrv = yes ; then
		AC_MSG_WARN([slapd disabled, ignoring --enable-dnssrv argument])
	fi
232
	if test $ol_enable_ldap = yes ; then
Kurt Zeilenga's avatar
Kurt Zeilenga committed
233
		AC_MSG_WARN([slapd disabled, ignoring --enable-ldap argument])
234
	fi
Kurt Zeilenga's avatar
Kurt Zeilenga committed
235
	if test $ol_enable_ldbm = yes ; then
Kurt Zeilenga's avatar
Kurt Zeilenga committed
236
		AC_MSG_WARN([slapd disabled, ignoring --enable-ldbm argument])
Kurt Zeilenga's avatar
Kurt Zeilenga committed
237
	fi
Pierangelo Masarati's avatar
Pierangelo Masarati committed
238
239
240
	if test $ol_enable_meta = yes ; then
		AC_MSG_WARN([slapd disabled, ignoring --enable-meta argument])
	fi
Pierangelo Masarati's avatar
Pierangelo Masarati committed
241
	if test $ol_enable_monitor = yes ; then
242
243
		AC_MSG_WARN([slapd disabled, ignoring --enable-monitor argument])
	fi
Kurt Zeilenga's avatar
Kurt Zeilenga committed
244
	if test $ol_enable_passwd = yes ; then
Kurt Zeilenga's avatar
Kurt Zeilenga committed
245
		AC_MSG_WARN([slapd disabled, ignoring --enable-passwd argument])
Kurt Zeilenga's avatar
Kurt Zeilenga committed
246
	fi
247
	if test $ol_enable_perl = yes ; then
Kurt Zeilenga's avatar
Kurt Zeilenga committed
248
		AC_MSG_WARN([slapd disabled, ignoring --enable-perl argument])
249
	fi
Kurt Zeilenga's avatar
Kurt Zeilenga committed
250
	if test $ol_enable_shell = yes ; then
Kurt Zeilenga's avatar
Kurt Zeilenga committed
251
		AC_MSG_WARN([slapd disabled, ignoring --enable-shell argument])
Kurt Zeilenga's avatar
Kurt Zeilenga committed
252
	fi
253
	if test $ol_enable_tcl = yes ; then
Kurt Zeilenga's avatar
Kurt Zeilenga committed
254
		AC_MSG_WARN([slapd disabled, ignoring --enable-tcl argument])
255
	fi
256
257
258
	if test $ol_enable_sql = yes ; then
		AC_MSG_WARN([slapd disabled, ignoring --enable-sql argument])
	fi
259
	if test $ol_enable_modules = yes ; then
Kurt Zeilenga's avatar
Kurt Zeilenga committed
260
		AC_MSG_WARN([slapd disabled, ignoring --enable-modules argument])
261
	fi
262
263
264
dnl	if test $ol_enable_multimaster = yes ; then
dnl		AC_MSG_WARN([slapd disabled, ignoring --enable-multimaster argument])
dnl	fi
Kurt Zeilenga's avatar
Kurt Zeilenga committed
265
	if test $ol_enable_wrappers = yes ; then
Kurt Zeilenga's avatar
Kurt Zeilenga committed
266
		AC_MSG_WARN([slapd disabled, ignoring --enable-wrappers argument])
Kurt Zeilenga's avatar
Kurt Zeilenga committed
267
268
	fi
	if test $ol_enable_phonetic = yes ; then
Kurt Zeilenga's avatar
Kurt Zeilenga committed
269
		AC_MSG_WARN([slapd disabled, ignoring --enable-phonetic argument])
Kurt Zeilenga's avatar
Kurt Zeilenga committed
270
271
	fi
	if test $ol_enable_rlookups = yes ; then
Kurt Zeilenga's avatar
Kurt Zeilenga committed
272
		AC_MSG_WARN([slapd disabled, ignoring --enable-rlookups argument])
Kurt Zeilenga's avatar
Kurt Zeilenga committed
273
	fi
274
275
276
	if test $ol_enable_aci = yes ; then
		AC_MSG_WARN([slapd disabled, ignoring --enable-aci argument])
	fi
Kurt Zeilenga's avatar
Kurt Zeilenga committed
277
	if test $ol_with_ldbm_api != auto ; then
Kurt Zeilenga's avatar
Kurt Zeilenga committed
278
		AC_MSG_WARN([slapd disabled, ignoring --with-ldbm-api argument])
Kurt Zeilenga's avatar
Kurt Zeilenga committed
279
280
	fi
	if test $ol_with_ldbm_type != auto ; then
Kurt Zeilenga's avatar
Kurt Zeilenga committed
281
		AC_MSG_WARN([slapd disabled, ignoring --with-ldbm-type argument])
Kurt Zeilenga's avatar
Kurt Zeilenga committed
282
	fi
283
284
285
	if test $ol_with_bdb_module != static ; then
		AC_MSG_WARN([slapd disabled, ignoring --with-bdb-module argument])
	fi
286
287
288
	if test $ol_with_dnssrv_module != static ; then
		AC_MSG_WARN([slapd disabled, ignoring --with-dnssrv-module argument])
	fi
289
290
291
292
293
294
	if test $ol_with_ldap_module != static ; then
		AC_MSG_WARN([slapd disabled, ignoring --with-ldap-module argument])
	fi
	if test $ol_with_ldbm_module != static ; then
		AC_MSG_WARN([slapd disabled, ignoring --with-ldbm-module argument])
	fi
Pierangelo Masarati's avatar
Pierangelo Masarati committed
295
296
297
	if test $ol_with_meta_module != static ; then
		AC_MSG_WARN([slapd disabled, ignoring --with-meta-module argument])
	fi
298
299
300
	if test $ol_with_monitor_module != static ; then
		AC_MSG_WARN([slapd disabled, ignoring --with-monitor-module argument])
	fi
301
302
303
304
305
306
307
308
309
310
311
312
	if test $ol_with_passwd_module != static ; then
		AC_MSG_WARN([slapd disabled, ignoring --with-passwd-module argument])
	fi
	if test $ol_with_perl_module != static ; then
		AC_MSG_WARN([slapd disabled, ignoring --with-perl-module argument])
	fi
	if test $ol_with_shell_module != static ; then
		AC_MSG_WARN([slapd disabled, ignoring --with-shell-module argument])
	fi
	if test $ol_with_tcl_module != static ; then
		AC_MSG_WARN([slapd disabled, ignoring --with-tcl-module argument])
	fi
313
314
315
	if test $ol_with_sql_module != static ; then
		AC_MSG_WARN([slapd disabled, ignoring --with-sql-module argument])
	fi
Kurt Zeilenga's avatar
Kurt Zeilenga committed
316
	if test $ol_enable_slurpd = yes ; then
Kurt Zeilenga's avatar
Kurt Zeilenga committed
317
		AC_MSG_ERROR([slurpd requires slapd])
Kurt Zeilenga's avatar
Kurt Zeilenga committed
318
	fi
Pierangelo Masarati's avatar
Pierangelo Masarati committed
319
320
321
	if test $ol_enable_rewrite = yes ; then
		AC_MSG_WARN([slapd disabled, ignoring --enable-rewrite argument])
	fi
Kurt Zeilenga's avatar
Kurt Zeilenga committed
322
323

	# force settings to no
324
	ol_enable_bdb=no
325
	ol_enable_dnssrv=no
326
	ol_enable_ldap=no
Kurt Zeilenga's avatar
Kurt Zeilenga committed
327
	ol_enable_ldbm=no
Pierangelo Masarati's avatar
Pierangelo Masarati committed
328
	ol_enable_meta=no
329
	ol_enable_monitor=no
Kurt Zeilenga's avatar
Kurt Zeilenga committed
330
	ol_enable_passwd=no
331
332
	ol_enable_perl=no
	ol_enable_shell=no
333
	ol_enable_tcl=no
334
	ol_enable_sql=no
335
336

	ol_enable_modules=no
337
dnl	ol_enable_multimaster=no
Kurt Zeilenga's avatar
Kurt Zeilenga committed
338
339
	ol_enable_phonetic=no
	ol_enable_rlookups=no
340
	ol_enable_aci=no
341
	ol_enable_wrappers=no
342
	ol_enable_dynamic=no
343

Kurt Zeilenga's avatar
Kurt Zeilenga committed
344
345
	ol_with_ldbm_api=no
	ol_with_ldbm_type=no
346

347
	ol_with_bdb_module=static
348
	ol_with_dnssrv_module=static
349
350
	ol_with_ldap_module=static
	ol_with_ldbm_module=static
Pierangelo Masarati's avatar
Pierangelo Masarati committed
351
	ol_with_meta_module=static
352
	ol_with_monitor_module=static
353
354
355
356
	ol_with_passwd_module=static
	ol_with_perl_module=static
	ol_with_shell_module=static
	ol_with_tcl_module=static
357
	ol_with_sql_module=static
358

Kurt Zeilenga's avatar
Kurt Zeilenga committed
359
360
	ol_enable_slurpd=no

Pierangelo Masarati's avatar
Pierangelo Masarati committed
361
362
	ol_enable_rewrite=no

Kurt Zeilenga's avatar
Kurt Zeilenga committed
363
364
365
366
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
367
		AC_MSG_WARN([LDBM disabled, ignoring --with-ldbm-api argument])
Kurt Zeilenga's avatar
Kurt Zeilenga committed
368
369
370
	fi

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

374
375
376
377
	if test $ol_with_ldbm_module != static ; then
		AC_MSG_WARN([LDBM disabled, ignoring --with-ldbm-module argument])
	fi

378
	if test $ol_enable_modules != yes -a \
379
		$ol_enable_bdb = no -a \
380
		$ol_enable_dnssrv = no -a \
381
		$ol_enable_ldap = no -a \
Pierangelo Masarati's avatar
Pierangelo Masarati committed
382
		$ol_enable_meta = no -a \
383
		$ol_enable_monitor = no -a \
384
		$ol_enable_passwd = no -a \
385
		$ol_enable_perl = no -a \
386
		$ol_enable_shell = no -a \
387
388
		$ol_enable_sql = no -a \
		$ol_enable_tcl = no ; then
389
390
391
392
393
394
395

		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
396
397
398
399
	fi

	ol_with_ldbm_api=no
	ol_with_ldbm_type=no
400
	ol_with_ldbm_module=static
Kurt Zeilenga's avatar
Kurt Zeilenga committed
401

402
403
404
405
	if test $ol_enable_bdb != no ; then
		ol_with_ldbm_api=berkeley
	fi

Kurt Zeilenga's avatar
Kurt Zeilenga committed
406
407
408
409
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
410
		AC_MSG_ERROR([GDBM only supports LDBM type hash])
Kurt Zeilenga's avatar
Kurt Zeilenga committed
411
	fi
Juan Gomez's avatar
Juan Gomez committed
412
413
414
415
	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
416
417
	if test $ol_with_ldbm_api = ndbm -a \
		$ol_with_ldbm_type = btree ; then
Kurt Zeilenga's avatar
Kurt Zeilenga committed
418
		AC_MSG_ERROR([NDBM only supports LDBM type hash])
Kurt Zeilenga's avatar
Kurt Zeilenga committed
419
	fi
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434

	if test $ol_enable_bdb = yes ; then
		if test $ol_with_ldbm_api = auto ; then
			ol_with_ldbm_api=berkeley
		elif test $ol_with_ldbm_api != berkeley ; then
			AC_MSG_ERROR([LDBM API not compatible with BDB])
		fi

	elif test $ol_enable_bdb = auto ; then
		if test $ol_with_ldbm_api != berkeley \
			-o $ol_with_ldbm_api != auto ; then
			AC_MSG_WARN([LDBM API not compatible with BDB, disabling BDB])
			ol_enable_bdb=no
		fi
	fi
Kurt Zeilenga's avatar
Kurt Zeilenga committed
435
436
437
438
439
fi

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
440
		AC_MSG_ERROR([slurpd requires threads])
Kurt Zeilenga's avatar
Kurt Zeilenga committed
441
442
443
	fi
fi

Kurt Zeilenga's avatar
Kurt Zeilenga committed
444
445
446
447
448
449
if test $ol_enable_lmpasswd = yes ; then
	if test $ol_with_tls = no ; then
		AC_MSG_ERROR([LAN Manager passwords require OpenSSL])
	fi
fi

450
451
452
if test $ol_enable_kbind = yes -o $ol_enable_kpasswd = yes ; then
	if test $ol_with_kerberos = no ; then
		AC_MSG_ERROR([options require --with-kerberos])
Kurt Zeilenga's avatar
Kurt Zeilenga committed
453
	elif test $ol_with_kerberos = auto ; then
454
		ol_with_kerberos=yes
455
	fi
456

457
elif test $ol_enable_kbind = no -o $ol_enable_kpasswd = no ; then
458
459
460
	if test $ol_with_kerberos = auto ; then
		ol_with_kerberos=no
	elif test $ol_with_kerberos != no ; then
461
		AC_MSG_WARN([Kerberos detection enabled unnecessarily]);
462
		ol_with_kerberos=no
463
	fi
464
465
fi

466
467
468
469
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
470
	ol_with_cyrus_sasl=yes
471
472
fi

Kurt Zeilenga's avatar
Kurt Zeilenga committed
473
474
AC_MSG_RESULT(done)

475
476
dnl ----------------------------------------------------------------
dnl Initialize vars
Kurt Zeilenga's avatar
Kurt Zeilenga committed
477
LDAP_LIBS=
478
LDIF_LIBS=
479
LDBM_LIB=
Kurt Zeilenga's avatar
Kurt Zeilenga committed
480
481
482
483
484
485
486
487
488
489
LDBM_LIBS=
LTHREAD_LIBS=
LUTIL_LIBS=

SLAPD_LIBS=
SLURPD_LIBS=

BUILD_SLAPD=no
BUILD_SLURPD=no

490
491
BUILD_THREAD=no

492
BUILD_BDB=no
493
BUILD_DNSSRV=no
494
BUILD_LDAP=no
Kurt Zeilenga's avatar
Kurt Zeilenga committed
495
BUILD_LDBM=no
Pierangelo Masarati's avatar
Pierangelo Masarati committed
496
BUILD_META=no
497
BUILD_MONITOR=no
Kurt Zeilenga's avatar
Kurt Zeilenga committed
498
BUILD_PASSWD=no
499
BUILD_PERL=no
Kurt Zeilenga's avatar
Kurt Zeilenga committed
500
BUILD_SHELL=no
501
BUILD_SQL=no
502
BUILD_TCL=no
Kurt Zeilenga's avatar
Kurt Zeilenga committed
503

504
BUILD_BDB_DYNAMIC=static
505
BUILD_DNSSRV_DYNAMIC=static
Howard Chu's avatar
Howard Chu committed
506
507
BUILD_LDAP_DYNAMIC=static
BUILD_LDBM_DYNAMIC=static
Pierangelo Masarati's avatar
Pierangelo Masarati committed
508
BUILD_META_DYNAMIC=static
509
BUILD_MONITOR_DYNAMIC=static
Howard Chu's avatar
Howard Chu committed
510
511
512
513
BUILD_PASSWD_DYNAMIC=static
BUILD_PERL_DYNAMIC=static
BUILD_SHELL_DYNAMIC=static
BUILD_TCL_DYNAMIC=static
514
BUILD_SQL_DYNAMIC=static
515

516
517
SLAPD_MODULES_LDFLAGS=
SLAPD_MODULES_CPPFLAGS=
518
SLAPD_MODULES_LIST=
519

520
521
522
SLAPD_STATIC_BACKENDS=
SLAPD_DYNAMIC_BACKENDS=

523
SLAPD_PERL_LDFLAGS=
524
525
MOD_PERL_LDFLAGS=
PERL_CPPFLAGS=
526

527
528
529
530
SLAPD_SQL_LDFLAGS=
SLAPD_SQL_LIBS=
SLAPD_SQL_INCLUDES=

531
MOD_TCL_LIB=
532
533
KRB4_LIBS=
KRB5_LIBS=
534
READLINE_LIBS=
535
SASL_LIBS=
Kurt Zeilenga's avatar
Kurt Zeilenga committed
536
TERMCAP_LIBS=
Bart Hartgers's avatar
   
Bart Hartgers committed
537
TLS_LIBS=
538
MODULES_LIBS=
539
AUTH_LIBS=
Kurt Zeilenga's avatar
Kurt Zeilenga committed
540

541
542
SLAPD_SLP_LIBS=

543
dnl ================================================================
Kurt Zeilenga's avatar
Kurt Zeilenga committed
544
545
dnl Checks for programs

546
dnl AC_PROG_INSTALL
547

548
549
AC_DEFINE(HAVE_MKVERSION, 1, [define this if you have mkversion])

550
dnl ----------------------------------------------------------------
551
552
553
554
dnl
dnl Determine which C translator to use
dnl

555
dnl AIX Thread requires we use cc_r or xlc_r.
Kurt Zeilenga's avatar
Kurt Zeilenga committed
556
557
dnl But only do this IF AIX and CC is not set
dnl and threads are auto|yes|posix.
558
dnl
559
dnl If we find cc_r|xlc_r, force pthreads and assume
560
561
dnl		pthread_create is in $LIBS (ie: don't bring in
dnl		any additional thread libraries)
562
dnl If we do not find cc_r|xlc_r, disable threads
563
564

ol_aix_threads=no
565
case "$target" in
Kurt Zeilenga's avatar
Kurt Zeilenga committed
566
*-*-aix*) dnl all AIX is not a good idea.
567
	if test -z "$CC" ; then
Kurt Zeilenga's avatar
Kurt Zeilenga committed
568
		case "$ol_with_threads" in
569
		auto | yes |  posix) ol_aix_threads=yes ;;
Kurt Zeilenga's avatar
Kurt Zeilenga committed
570
571
572
573
		esac
	fi
;;
esac
574

575
576
577
578
579
580
581
582
583
584
585
586
587
588
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
589

590
	if test "${CC}" = "cc_r" -o "${CC}" = "xlc_r" ; then
591
592
593
594
595
		ol_with_threads=posix
		ol_cv_pthread_create=yes
	fi
fi

Kurt Zeilenga's avatar
Kurt Zeilenga committed
596
597
598
599
600
601
602
603
if test -z "${CC}"; then
	AC_CHECK_PROGS(CC,cc)
fi

dnl The default CFLAGS is empty NOT whatever AC_PROG_CC sets.
dnl (for now, let autoconf sort this out)
dnl CFLAGS=${CFLAGS-""}

Kurt Zeilenga's avatar
Kurt Zeilenga committed
604
AC_CHECK_PROGS(AR,ar gar,ar)
605

Howard Chu's avatar
Howard Chu committed
606
AC_LIBTOOL_WIN32_DLL
607
AC_LIBTOOL_DLOPEN
Kurt Zeilenga's avatar
Kurt Zeilenga committed
608
AC_PROG_LIBTOOL
Kurt Zeilenga's avatar
Kurt Zeilenga committed
609

610
AC_PROG_AWK
611
OL_PROG_LN_H
612
613
AC_PROG_LN_S

614
615
616
617
if test "$LN_H" = "cp" -a "$LN_S" = "ln"; then
	LN_S="$LN_H"
fi

Kurt Zeilenga's avatar
Kurt Zeilenga committed
618
619
620
621
622
AC_PATH_PROG(SENDMAIL, sendmail, /usr/lib/sendmail,
	$PATH:/usr/libexec:/usr/lib:/usr/sbin:/usr/etc:/etc)
AC_PATH_PROG(EDITOR, vi, /usr/ucb/vi, $PATH:/usr/ucb)
AC_PATH_PROG(FINGER, finger, /usr/ucb/finger, $PATH:/usr/ucb)

623
624
dnl ----------------------------------------------------------------
dnl Perl
625
626
ol_link_perl=no
if test $ol_enable_perl != no ; then
627
628
629
	AC_PATH_PROG(PERLBIN, perl, /usr/bin/perl)

	if test "no$PERLBIN" = "no" ; then
630
631
632
		if test $ol_enable_perl = yes ; then
			AC_MSG_ERROR([could not locate perl])
		fi
633

634
	else
635
		PERL_CPPFLAGS="`$PERLBIN -MExtUtils::Embed -e ccopts`"
Kurt Zeilenga's avatar
Kurt Zeilenga committed
636
		if test x"$ol_with_perl_module" = "xstatic" ; then
637
638
639
640
			SLAPD_PERL_LDFLAGS="`$PERLBIN -MExtUtils::Embed -e ldopts|sed -e s/-lc//`"
		else
			MOD_PERL_LDFLAGS="`$PERLBIN -MExtUtils::Embed -e ldopts|sed -e s/-lc//`"
		fi
641
642
643
		dnl should check perl version
		ol_link_perl=yes
	fi
644
645
fi

646
AC_PROG_CPP
647

648
649
dnl ----------------------------------------------------------------
dnl Cross compiling checks
650
if test $cross_compiling = yes -a $ol_enable_x_compile = yes; then
651
	AC_MSG_WARN([cross compiling....  some functionality will be removed.])
652
653

elif test $cross_compiling = no -a $ol_enable_x_compile = yes; then
654
655
	AC_MSG_WARN([programs compiled here do run here...])
	AC_MSG_ERROR([  if not cross compiling, use --disable-x-compile.])
656
657

elif test $cross_compiling = yes -a $ol_enable_x_compile = no; then
658
659
	AC_MSG_WARN([programs compiled here do not run here...])
	AC_MSG_ERROR([  if cross compiling,  add --enable-x-compile.])
660
661
fi

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

668
dnl ----------------------------------------------------------------
669
670
671
672
673
674
dnl Checks for system services
AC_CYGWIN
AC_MINGW32
AC_EXEEXT
AC_OBJEXT

675
676
AC_DEFINE_UNQUOTED( EXEEXT, "${EXEEXT}", [defined to be the EXE extension])

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

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

688
dnl ----------------------------------------------------------------
689
dnl Check cc depend flags
Kurt Zeilenga's avatar
Kurt Zeilenga committed
690
691
692
693
694
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
695

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

703

704
dnl ----------------------------------------------------------------
705
706
707
708
709
710
711
712
713
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
714
	AC_CHECK_LIB(ltdl, lt_dlinit, [
Kurt Zeilenga's avatar
Kurt Zeilenga committed
715
716
		MODULES_LIBS=-lltdl
		AC_DEFINE(HAVE_LIBLTDL,1,[define if you have libtool -ltdl])
Howard Chu's avatar
Howard Chu committed
717
718
	])

719
720
721
722
723
	if test "$ac_cv_lib_ltdl_lt_dlinit" = no ; then
		AC_MSG_ERROR([could not locate libtool -lltdl])
	fi
	ol_link_modules=yes
else
724
	ol_with_bdb_module=static
725
	ol_with_dnssrv_module=static
726
727
	ol_with_ldap_module=static
	ol_with_ldbm_module=static
Pierangelo Masarati's avatar
Pierangelo Masarati committed
728
	ol_with_meta_module=static
729
	ol_with_monitor_module=static
730
731
732
733
	ol_with_passwd_module=static
	ol_with_perl_module=static
	ol_with_shell_module=static
	ol_with_tcl_module=static
734
	ol_with_sql_module=static
735
736
fi

737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
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		\
Howard Chu's avatar
Howard Chu committed
757
	conio.h			\
758
	crypt.h			\
Howard Chu's avatar
Howard Chu committed
759
	direct.h		\
760
761
762
763
764
	errno.h			\
	fcntl.h			\
	filio.h			\
	getopt.h		\
	grp.h			\
Howard Chu's avatar
Howard Chu committed
765
	io.h			\
766
767
768
769
770
771
772
773
	libutil.h		\
	limits.h		\
	locale.h		\
	netinet/tcp.h	\
	malloc.h		\
	memory.h		\
	psap.h			\
	pwd.h			\
Howard Chu's avatar
Howard Chu committed
774
	process.h		\
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
	resolv.h		\
	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	\
	sys/syslog.h	\
	sys/time.h		\
	sys/types.h		\
	syslog.h		\
	termios.h		\
	unistd.h		\
796
	winsock.h		\
Howard Chu's avatar
Howard Chu committed
797
	winsock2.h		\
798
799
)

Howard Chu's avatar
Howard Chu committed
800

801
dnl ----------------------------------------------------------------
Kurt Zeilenga's avatar
Kurt Zeilenga committed
802
803
dnl Checks for libraries

804
805
AC_CHECK_FUNC(dlopen, :, [AC_CHECK_LIB(dl, dlopen)])

806
807
808
dnl HP-UX requires -lV3
dnl this is not needed on newer versions of HP-UX
AC_CHECK_LIB(V3, sigset)
809

Howard Chu's avatar
Howard Chu committed
810
811
812
813
814
815
816
817
818
819
820
821
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
AC_MSG_CHECKING(for winsock)
save_LIBS="$LIBS"
for curlib in ws2_32 wsock32; do
	LIBS="$LIBS -l$curlib"
	AC_TRY_LINK([
			char socket@12();
			char select@20();
			char closesocket@4();
			char gethostname@8();
Kurt Zeilenga's avatar
Kurt Zeilenga committed
822
823
			],
			[
Howard Chu's avatar
Howard Chu committed
824
825
826
827
			socket@12();
			select@20();
			closesocket@4();
			gethostname@8();
Kurt Zeilenga's avatar
Kurt Zeilenga committed
828
829
			],
			have_winsock=yes, have_winsock=no)
Howard Chu's avatar
Howard Chu committed
830
831
832

	if test $have_winsock = yes; then
		AC_DEFINE(HAVE_WINSOCK, 1, [define if you have winsock])
833
834
835
836
		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
837
838
839
840
841
842
		if test $curlib = ws2_32; then
			have_winsock=winsock2
			AC_DEFINE(HAVE_WINSOCK2, 1,
				  [define if you have winsock2])
		fi
		break
843
	fi
Howard Chu's avatar
Howard Chu committed
844
845
846
	LIBS="$save_LIBS"
done
AC_MSG_RESULT($have_winsock)
Howard Chu's avatar
Howard Chu committed
847

Kurt Zeilenga's avatar
Kurt Zeilenga committed
848
849
850
851
852
dnl Find socket()
dnl Likely combinations:
dnl		-lsocket [ -lnsl_s | -lnsl ]
dnl		-linet

Kurt Zeilenga's avatar
Kurt Zeilenga committed
853
AC_CHECK_FUNC(socket, :, [	
Kurt Zeilenga's avatar
Kurt Zeilenga committed
854
855
856
857
858
859
860
861
862
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
863
dnl require select
864
865
AC_CHECK_FUNC(select, :, AC_MSG_ERROR([select() required.]))

Howard Chu's avatar
Howard Chu committed
866
if test "${ac_cv_header_winsock_h}" != yes; then
Kurt Zeilenga's avatar
Kurt Zeilenga committed
867
868
869
870
	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
871
fi
872

873
dnl check to see if system call automatically restart
874
dnl AC_SYS_RESTARTABLE_SYSCALLS
875

876
dnl ----------------------------------------------------------------
Kurt Zeilenga's avatar
Kurt Zeilenga committed
877
dnl require POSIX regex
878
879
880
881
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
882
AC_SEARCH_LIBS(regfree, [regex gnuregex],
Kurt Zeilenga's avatar
Kurt Zeilenga committed
883
	:, AC_MSG_ERROR([POSIX regex required.]))
884
885
886
887
888
889

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

890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
dnl ----------------------------------------------------------------
dnl For windows, check for the need of RPCRT for UUID function support
AC_MSG_CHECKING(to see if -lrpcrt4 is needed for win32 UUID support)
save_LIBS="$LIBS"
LIBS="$LIBS -lrpcrt4"
AC_TRY_LINK([
		char UuidCreate@4();
		char UuidToStringA@8();
		],
		[
		UuidCreate@4();
		UuidToStringA@8();
		],
		need_rpcrt=yes, need_rpcrt=no)
if test $need_rpcrt = yes; then
	SLAPD_LIBS="$SLAPD_LIBS -lrpcrt4"
fi
LIBS="$save_LIBS"
AC_MSG_RESULT($need_rpcrt)

910
dnl ----------------------------------------------------------------
911
dnl Check for resolver routines
912
913
dnl	  need to check for both res_query and __res_query
dnl   need to check -lc, -lbind, and -lresolv
914
915
ol_link_dnssrv=no
AC_CHECK_FUNC(res_query,:)
916
917
918
919
920
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

921
922
923
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
924
fi
925

926
927
928
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
929
fi
Kurt Zeilenga's avatar
Kurt Zeilenga committed
930

931
932
933
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
934
935
fi

936
937
938
939
940
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

941
942
943
944
945
946
947
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
948
fi
949

950
951
952
if test "$ol_enable_dnssrv" = yes -a "$ol_link_dnssrv" = no ; then
	AC_MSG_ERROR([DNSSRV requires res_query()])
fi
Kurt Zeilenga's avatar
Kurt Zeilenga committed
953

Kurt Zeilenga's avatar
Kurt Zeilenga committed
954
955
956
dnl ----------------------------------------------------------------
dnl PF_INET6 support requires getaddrinfo and INET6_ADDRSTRLEN
dnl PF_LOCAL may use getaddrinfo in available
957
AC_CHECK_FUNCS( getaddrinfo gai_strerror inet_ntop )
Kurt Zeilenga's avatar
Kurt Zeilenga committed
958
959

ol_link_ipv6=no
960
if test $ac_cv_func_getaddrinfo = no -o $ac_cv_func_inet_ntop = no ; then
Kurt Zeilenga's avatar
Kurt Zeilenga committed
961
	if test $ol_enable_ipv6 = yes ; then
962
		AC_MSG_ERROR([IPv6 support requires getaddrinfo() and inet_ntop()])
Kurt Zeilenga's avatar
Kurt Zeilenga committed
963
	fi
964
elif test $ol_enable_ipv6 != no ; then
Kurt Zeilenga's avatar
Kurt Zeilenga committed
965
966
	AC_CACHE_CHECK([INET6_ADDRSTRLEN],[ol_cv_inet6_addrstrlen],[
		AC_EGREP_CPP(__has_inet6_addrstrlen__,[
Kurt Zeilenga's avatar
Kurt Zeilenga committed
967
#			include <netinet/in.h>
Kurt Zeilenga's avatar
Kurt Zeilenga committed
968
969
#			ifdef INET6_ADDRSTRLEN
				__has_inet6_addrstrlen__;
Kurt Zeilenga's avatar
Kurt Zeilenga committed
970
#			endif
Kurt Zeilenga's avatar
Kurt Zeilenga committed
971
		], [ol_cv_inet6_addrstrlen=yes], [ol_cv_inet6_addrstrlen=no])])
Kurt Zeilenga's avatar
Kurt Zeilenga committed
972

Kurt Zeilenga's avatar
Kurt Zeilenga committed
973
	if test $ol_cv_inet6_addrstrlen = yes ; then
Kurt Zeilenga's avatar
Kurt Zeilenga committed
974
		ol_link_ipv6=yes
Kurt Zeilenga's avatar
Kurt Zeilenga committed
975
	elif test $ol_enable_ipv6 = yes ; then
Kurt Zeilenga's avatar
Kurt Zeilenga committed
976
977
978
979
980
981
982
983
984
985
986
987
988
989
		AC_MSG_ERROR([IPv6 support requires INET6_ADDRSTRLEN])
	fi
fi

if test $ol_enable_local != no ; then
	AC_CHECK_HEADERS( sys/un.h )

	if test $ol_enable_local = auto ; then
		ol_enable_local=$ac_cv_header_sys_un_h
	elif test $ac_cv_header_sys_un_h = no ; then
		AC_MSG_ERROR([AF_LOCAL domain support requires sys/un.h])
	fi
fi

990
991
dnl ----------------------------------------------------------------
dnl Kerberos
992
993
ol_link_kbind=no
ol_link_kpasswd=no
994
ol_link_krb5=no
995
ol_link_krb4=no