configure.in 79.4 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

Kurt Zeilenga's avatar
Kurt Zeilenga committed
54
55
56
57
58
59
60
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"
Kurt Zeilenga's avatar
Kurt Zeilenga committed
61
dnl AC_SUBST(SHTOOL)dnl
62

Kurt Zeilenga's avatar
Kurt Zeilenga committed
63
64
65
66
TB=`$SHTOOL echo -e %B`
TN=`$SHTOOL echo -e %b`

echo "Configuring $TB$OL_STRING$TN ..."
67

68
69
70
71
dnl Determine host platform
dnl		we try not to use this for much
AC_CANONICAL_SYSTEM

72
AM_INIT_AUTOMAKE([$OL_PACKAGE],[$OL_VERSION], [no defines])dnl
Kurt Zeilenga's avatar
Kurt Zeilenga committed
73
74
AC_SUBST(PACKAGE)dnl
AC_SUBST(VERSION)dnl
Kurt Zeilenga's avatar
Kurt Zeilenga committed
75
76
AC_DEFINE_UNQUOTED(OPENLDAP_PACKAGE,"$PACKAGE",Package)
AC_DEFINE_UNQUOTED(OPENLDAP_VERSION,"$VERSION",Version)
77

78
79
80
81
82
83
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
84
AC_SUBST(OPENLDAP_LIBVERSION)dnl
85

86
87
88
OPENLDAP_RELEASE_DATE="$OL_RELEASE_DATE"
AC_SUBST(OPENLDAP_RELEASE_DATE)dnl

89
dnl We use autoconf features new to 2.13.
90
dnl aclocal.m4 should be built using aclocal from automake 1.4
Kurt Zeilenga's avatar
Kurt Zeilenga committed
91
dnl libtool 1.4.2 should be installed.
92
AC_PREREQ(2.13)dnl Required Autoconf version
93

94
AC_CONFIG_HEADER(include/portable.h include/ldap_features.h include/lber_types.h)dnl
95

96
dnl ================================================================
Kurt Zeilenga's avatar
Kurt Zeilenga committed
97
98
99
100
dnl Start Args
AC_MSG_CHECKING(configure arguments)
AC_PREFIX_DEFAULT(/usr/local)

101
102
103
top_builddir=`pwd`
AC_SUBST(top_builddir)dnl

104
105
dnl ----------------------------------------------------------------
dnl --with-subdir
106
ldap_subdir="/openldap"
Kurt Zeilenga's avatar
Kurt Zeilenga committed
107

108
AC_ARG_WITH(subdir,
Kurt Zeilenga's avatar
Kurt Zeilenga committed
109
[  --with-subdir=DIR       change default subdirectory used for installs],
110
111
112
113
114
115
[case "$withval" in
	no) ldap_subdir=""
		;;
	yes)
		;;
	/*|\\*)
116
		ldap_subdir="$withval"
117
118
119
120
121
		;;
	*)
		ldap_subdir="/$withval"
		;;
esac
122
123
])dnl

124
125
AC_SUBST(ldap_subdir)dnl

126
127
dnl ----------------------------------------------------------------
dnl General "enable" options
128
129
130
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
131
OL_ARG_ENABLE(cache,[  --enable-cache	  enable caching (experimental)], no)dnl
132
OL_ARG_ENABLE(referrals,[  --enable-referrals	  enable LDAPv2+ Referrals (experimental)], no)dnl
133
134
dnl OL_ARG_ENABLE(kbind,[  --enable-kbind	  enable LDAPv2+ Kerberos IV bind (deprecated)], no)dnl
ol_enable_kbind=${ol_enable_kbind-no}
135
136
137
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
OL_ARG_ENABLE(x_compile,[  --enable-x-compile	  enable cross compiling],
138
	no, [yes no])dnl
Kurt Zeilenga's avatar
Kurt Zeilenga committed
139

140
dnl ----------------------------------------------------------------
Kurt Zeilenga's avatar
Kurt Zeilenga committed
141
dnl General "with" options
142
dnl OL_ARG_ENABLE(dmalloc,[  --enable-dmalloc	  enable debug malloc support], no)dnl
143

144
OL_ARG_WITH(cyrus_sasl,[  --with-cyrus-sasl	  with Cyrus SASL support],
145
	auto, [auto yes no] )
146
OL_ARG_WITH(fetch,[  --with-fetch		  with freeBSD fetch URL support],
147
	auto, [auto yes no] )
148
OL_ARG_WITH(kerberos,[  --with-kerberos	  with Kerberos support],
149
	auto, [auto k5 k5only k425 kth k4 afs yes no])
150
OL_ARG_WITH(readline,[  --with-readline	  with readline support],
151
	auto, [auto yes no] )
152
OL_ARG_WITH(threads,[  --with-threads	  with threads],
153
	auto, [auto nt posix mach pth lwp yes no manual] )
154
OL_ARG_WITH(tls,[  --with-tls		  with TLS/SSL support],
Bart Hartgers's avatar
   
Bart Hartgers committed
155
	auto, [auto ssleay openssl yes no] )
156
OL_ARG_WITH(yielding_select,[  --with-yielding-select  with implicitly yielding select],
157
	auto, [auto yes no manual] )
Kurt Zeilenga's avatar
Kurt Zeilenga committed
158

159
dnl ----------------------------------------------------------------
Kurt Zeilenga's avatar
Kurt Zeilenga committed
160
dnl Server options
161
dnl ----------------------------------------------------------------
Kurt Zeilenga's avatar
Kurt Zeilenga committed
162

163
dnl ----------------------------------------------------------------
Kurt Zeilenga's avatar
Kurt Zeilenga committed
164
dnl SLAPD OPTIONS
Kurt Zeilenga's avatar
Kurt Zeilenga committed
165
166
AC_ARG_WITH(xxslapdoptions,[
SLAPD (Standalone LDAP Daemon) Options:])
167
OL_ARG_ENABLE(slapd,[  --enable-slapd	  enable building slapd], yes)dnl
Kurt Zeilenga's avatar
Kurt Zeilenga committed
168
OL_ARG_ENABLE(aci,[    --enable-aci	  enable per-object ACIs (experimental)], no)dnl
169
OL_ARG_ENABLE(cleartext,[    --enable-cleartext	  enable cleartext passwords], yes)dnl
170
OL_ARG_ENABLE(crypt,[    --enable-crypt	  enable crypt(3) passwords], no)dnl
171
OL_ARG_ENABLE(dynamic,[    --enable-dynamic	  enable linking built binaries with dynamic libs], no)dnl
Kurt Zeilenga's avatar
Cleanup    
Kurt Zeilenga committed
172
OL_ARG_ENABLE(kpasswd,[    --enable-kpasswd	  enable Kerberos password verification], no)dnl
173
OL_ARG_ENABLE(lmpasswd,[    --enable-lmpasswd	  enable LAN Manager passwords], no)dnl
174
175
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
176
dnl OL_ARG_ENABLE(multimaster,[    --enable-multimaster  enable multimaster replication], no)dnl
177
ol_enable_multimaster=${ol_enable_multimaster-no}
178
OL_ARG_ENABLE(phonetic,[    --enable-phonetic	  enable phonetic/soundex], no)dnl
179
180
OL_ARG_ENABLE(rewrite,[    --enable-rewrite	  enable DN rewriting in back-ldap and back-meta], no)dnl
OL_ARG_ENABLE(rlookups,[    --enable-rlookups	  enable reverse lookups of client hostnames], no)dnl
Kurt Zeilenga's avatar
Kurt Zeilenga committed
181
OL_ARG_ENABLE(slp, [    --enable-slp          enable SLPv2 support], no)dnl     
182
OL_ARG_ENABLE(wrappers,[    --enable-wrappers	  enable tcp wrapper support], no)dnl
Kurt Zeilenga's avatar
Kurt Zeilenga committed
183
184

dnl SLAPD Backend options
185
OL_ARG_ENABLE(bdb,[    --enable-bdb	  enable Berkeley DB backend], yes)dnl
186
OL_ARG_WITH(bdb_module,[    --with-bdb-module     module type static|dynamic], static,
187
	[static dynamic])
188
OL_ARG_ENABLE(dnssrv,[    --enable-dnssrv	  enable dnssrv backend], no)dnl
189
OL_ARG_WITH(dnssrv_module,[    --with-dnssrv-module  module type static|dynamic], static,
190
	[static dynamic])
191
OL_ARG_ENABLE(ldap,[    --enable-ldap	  enable ldap backend], no)dnl
192
OL_ARG_WITH(ldap_module,[    --with-ldap-module	  module type static|dynamic], static,
193
	[static dynamic])
194
OL_ARG_ENABLE(ldbm,[    --enable-ldbm	  enable ldbm backend], no)dnl
195
OL_ARG_WITH(ldbm_api,[    --with-ldbm-api       with LDBM API auto|berkeley|bcompat|mdbm|gdbm], auto,
Kurt Zeilenga's avatar
Kurt Zeilenga committed
196
	[auto berkeley bcompat mdbm gdbm])
197
OL_ARG_WITH(ldbm_module,[    --with-ldbm-module	  module type static|dynamic], static,
Kurt Zeilenga's avatar
Kurt Zeilenga committed
198
	[static dynamic])
199
OL_ARG_WITH(ldbm_type,[    --with-ldbm-type	  use LDBM type auto|btree|hash], auto,
Kurt Zeilenga's avatar
Kurt Zeilenga committed
200
	[auto btree hash])
Pierangelo Masarati's avatar
Pierangelo Masarati committed
201
OL_ARG_ENABLE(meta,[    --enable-meta	  enable metadirectory backend], no)dnl
202
OL_ARG_WITH(meta_module,[    --with-meta-module	  module type static|dynamic], static,
Pierangelo Masarati's avatar
Pierangelo Masarati committed
203
	[static dynamic])
204
OL_ARG_ENABLE(monitor,[    --enable-monitor	  enable monitor backend], no)dnl
205
OL_ARG_WITH(monitor_module,[    --with-monitor-module module type static|dynamic], static,
206
	[static dynamic])
207
OL_ARG_ENABLE(null,[    --enable-null	  enable null backend], no)dnl
208
OL_ARG_WITH(null_module,[    --with-null-module	  module type static|dynamic], static,
209
	[static dynamic])
210
OL_ARG_ENABLE(passwd,[    --enable-passwd	  enable passwd backend], no)dnl
211
OL_ARG_WITH(passwd_module,[    --with-passwd-module  module type static|dynamic], static,
212
	[static dynamic])
213
OL_ARG_ENABLE(perl,[    --enable-perl	  enable perl backend], no)dnl
214
OL_ARG_WITH(perl_module,[    --with-perl-module	  module type static|dynamic], static,
215
	[static dynamic])
216
OL_ARG_ENABLE(shell,[    --enable-shell	  enable shell backend], no)dnl
217
OL_ARG_WITH(shell_module,[    --with-shell-module	  module type static|dynamic], static,
218
	[static dynamic])
219
OL_ARG_ENABLE(sql,[    --enable-sql	  enable sql backend], no)dnl
220
OL_ARG_WITH(sql_module,[    --with-sql-module	  module type static|dynamic], static,
221
	[static dynamic])
222
OL_ARG_ENABLE(tcl,[    --enable-tcl	  enable tcl backend], no)dnl
223
OL_ARG_WITH(tcl_module,[    --with-tcl-module	  module type static|dynamic], static,
224
	[static dynamic])
Kurt Zeilenga's avatar
Kurt Zeilenga committed
225

226
dnl ----------------------------------------------------------------
Kurt Zeilenga's avatar
Kurt Zeilenga committed
227
dnl SLURPD OPTIONS
Kurt Zeilenga's avatar
Kurt Zeilenga committed
228
229
AC_ARG_WITH(xxslurpdoptions,[
SLURPD (Replication Daemon) Options:])
230
OL_ARG_ENABLE(slurpd,[  --enable-slurpd	  enable building slurpd], auto)dnl
Kurt Zeilenga's avatar
Kurt Zeilenga committed
231

232
dnl ----------------------------------------------------------------
Kurt Zeilenga's avatar
Kurt Zeilenga committed
233
234
AC_ARG_WITH(xxliboptions,[
Library Generation & Linking Options])
Kurt Zeilenga's avatar
Kurt Zeilenga committed
235
236
237
AC_ENABLE_STATIC
dnl AC_DISABLE_SHARED
AC_ENABLE_SHARED
238

239
240
dnl ----------------------------------------------------------------

241
dnl General "enable" options
242
# validate options
Kurt Zeilenga's avatar
Kurt Zeilenga committed
243
244
if test $ol_enable_slapd = no ; then
	dnl SLAPD was specificallly disabled
245
246
247
	if test $ol_enable_bdb = yes ; then
		AC_MSG_WARN([slapd disabled, ignoring --enable-bdb argument])
	fi
248
249
250
	if test $ol_enable_dnssrv = yes ; then
		AC_MSG_WARN([slapd disabled, ignoring --enable-dnssrv argument])
	fi
251
	if test $ol_enable_ldap = yes ; then
Kurt Zeilenga's avatar
Kurt Zeilenga committed
252
		AC_MSG_WARN([slapd disabled, ignoring --enable-ldap argument])
253
	fi
Kurt Zeilenga's avatar
Kurt Zeilenga committed
254
	if test $ol_enable_ldbm = yes ; then
Kurt Zeilenga's avatar
Kurt Zeilenga committed
255
		AC_MSG_WARN([slapd disabled, ignoring --enable-ldbm argument])
Kurt Zeilenga's avatar
Kurt Zeilenga committed
256
	fi
Pierangelo Masarati's avatar
Pierangelo Masarati committed
257
258
259
	if test $ol_enable_meta = yes ; then
		AC_MSG_WARN([slapd disabled, ignoring --enable-meta argument])
	fi
Pierangelo Masarati's avatar
Pierangelo Masarati committed
260
	if test $ol_enable_monitor = yes ; then
261
262
		AC_MSG_WARN([slapd disabled, ignoring --enable-monitor argument])
	fi
263
264
265
	if test $ol_enable_null = yes ; then
		AC_MSG_WARN([slapd disabled, ignoring --enable-null argument])
	fi
Kurt Zeilenga's avatar
Kurt Zeilenga committed
266
	if test $ol_enable_passwd = yes ; then
Kurt Zeilenga's avatar
Kurt Zeilenga committed
267
		AC_MSG_WARN([slapd disabled, ignoring --enable-passwd argument])
Kurt Zeilenga's avatar
Kurt Zeilenga committed
268
	fi
269
	if test $ol_enable_perl = yes ; then
Kurt Zeilenga's avatar
Kurt Zeilenga committed
270
		AC_MSG_WARN([slapd disabled, ignoring --enable-perl argument])
271
	fi
Kurt Zeilenga's avatar
Kurt Zeilenga committed
272
	if test $ol_enable_shell = yes ; then
Kurt Zeilenga's avatar
Kurt Zeilenga committed
273
		AC_MSG_WARN([slapd disabled, ignoring --enable-shell argument])
Kurt Zeilenga's avatar
Kurt Zeilenga committed
274
	fi
275
	if test $ol_enable_tcl = yes ; then
Kurt Zeilenga's avatar
Kurt Zeilenga committed
276
		AC_MSG_WARN([slapd disabled, ignoring --enable-tcl argument])
277
	fi
278
279
280
	if test $ol_enable_sql = yes ; then
		AC_MSG_WARN([slapd disabled, ignoring --enable-sql argument])
	fi
281
	if test $ol_enable_modules = yes ; then
Kurt Zeilenga's avatar
Kurt Zeilenga committed
282
		AC_MSG_WARN([slapd disabled, ignoring --enable-modules argument])
283
	fi
284
285
286
	if test $ol_enable_multimaster = yes ; then
		AC_MSG_WARN([slapd disabled, ignoring --enable-multimaster argument])
	fi
Kurt Zeilenga's avatar
Kurt Zeilenga committed
287
	if test $ol_enable_wrappers = yes ; then
Kurt Zeilenga's avatar
Kurt Zeilenga committed
288
		AC_MSG_WARN([slapd disabled, ignoring --enable-wrappers argument])
Kurt Zeilenga's avatar
Kurt Zeilenga committed
289
290
	fi
	if test $ol_enable_phonetic = yes ; then
Kurt Zeilenga's avatar
Kurt Zeilenga committed
291
		AC_MSG_WARN([slapd disabled, ignoring --enable-phonetic argument])
Kurt Zeilenga's avatar
Kurt Zeilenga committed
292
293
	fi
	if test $ol_enable_rlookups = yes ; then
Kurt Zeilenga's avatar
Kurt Zeilenga committed
294
		AC_MSG_WARN([slapd disabled, ignoring --enable-rlookups argument])
Kurt Zeilenga's avatar
Kurt Zeilenga committed
295
	fi
296
297
298
	if test $ol_enable_aci = yes ; then
		AC_MSG_WARN([slapd disabled, ignoring --enable-aci argument])
	fi
Kurt Zeilenga's avatar
Kurt Zeilenga committed
299
	if test $ol_with_ldbm_api != auto ; then
Kurt Zeilenga's avatar
Kurt Zeilenga committed
300
		AC_MSG_WARN([slapd disabled, ignoring --with-ldbm-api argument])
Kurt Zeilenga's avatar
Kurt Zeilenga committed
301
302
	fi
	if test $ol_with_ldbm_type != auto ; then
Kurt Zeilenga's avatar
Kurt Zeilenga committed
303
		AC_MSG_WARN([slapd disabled, ignoring --with-ldbm-type argument])
Kurt Zeilenga's avatar
Kurt Zeilenga committed
304
	fi
305
306
307
	if test $ol_with_bdb_module != static ; then
		AC_MSG_WARN([slapd disabled, ignoring --with-bdb-module argument])
	fi
308
309
310
	if test $ol_with_dnssrv_module != static ; then
		AC_MSG_WARN([slapd disabled, ignoring --with-dnssrv-module argument])
	fi
311
312
313
314
315
316
	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
317
318
319
	if test $ol_with_meta_module != static ; then
		AC_MSG_WARN([slapd disabled, ignoring --with-meta-module argument])
	fi
320
321
322
	if test $ol_with_monitor_module != static ; then
		AC_MSG_WARN([slapd disabled, ignoring --with-monitor-module argument])
	fi
323
324
325
	if test $ol_with_null_module != static ; then
		AC_MSG_WARN([slapd disabled, ignoring --with-null-module argument])
	fi
326
327
328
329
330
331
332
333
334
335
336
337
	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
338
339
340
	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
341
	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
Kurt Zeilenga's avatar
Kurt Zeilenga committed
347
348

	# force settings to no
349
	ol_enable_bdb=no
350
	ol_enable_dnssrv=no
351
	ol_enable_ldap=no
Kurt Zeilenga's avatar
Kurt Zeilenga committed
352
	ol_enable_ldbm=no
Pierangelo Masarati's avatar
Pierangelo Masarati committed
353
	ol_enable_meta=no
354
	ol_enable_monitor=no
355
	ol_enable_null=no
Kurt Zeilenga's avatar
Kurt Zeilenga committed
356
	ol_enable_passwd=no
357
358
	ol_enable_perl=no
	ol_enable_shell=no
359
	ol_enable_tcl=no
360
	ol_enable_sql=no
361
362

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

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

373
	ol_with_bdb_module=static
374
	ol_with_dnssrv_module=static
375
376
	ol_with_ldap_module=static
	ol_with_ldbm_module=static
Pierangelo Masarati's avatar
Pierangelo Masarati committed
377
	ol_with_meta_module=static
378
	ol_with_monitor_module=static
379
	ol_with_null_module=static
380
381
382
383
	ol_with_passwd_module=static
	ol_with_perl_module=static
	ol_with_shell_module=static
	ol_with_tcl_module=static
384
	ol_with_sql_module=static
385

Kurt Zeilenga's avatar
Kurt Zeilenga committed
386
387
	ol_enable_slurpd=no

Pierangelo Masarati's avatar
Pierangelo Masarati committed
388
389
	ol_enable_rewrite=no

Kurt Zeilenga's avatar
Kurt Zeilenga committed
390
391
392
393
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
394
		AC_MSG_WARN([LDBM disabled, ignoring --with-ldbm-api argument])
Kurt Zeilenga's avatar
Kurt Zeilenga committed
395
396
397
	fi

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

401
402
403
404
	if test $ol_with_ldbm_module != static ; then
		AC_MSG_WARN([LDBM disabled, ignoring --with-ldbm-module argument])
	fi

405
	if test $ol_enable_modules != yes -a \
406
		$ol_enable_bdb = no -a \
407
		$ol_enable_dnssrv = no -a \
408
		$ol_enable_ldap = no -a \
Pierangelo Masarati's avatar
Pierangelo Masarati committed
409
		$ol_enable_meta = no -a \
410
		$ol_enable_monitor = no -a \
411
		$ol_enable_null = no -a \
412
		$ol_enable_passwd = no -a \
413
		$ol_enable_perl = no -a \
414
		$ol_enable_shell = no -a \
415
416
		$ol_enable_sql = no -a \
		$ol_enable_tcl = no ; then
417
418
419
420
421
422
423

		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
424
425
426
427
	fi

	ol_with_ldbm_api=no
	ol_with_ldbm_type=no
428
	ol_with_ldbm_module=static
Kurt Zeilenga's avatar
Kurt Zeilenga committed
429

430
431
432
433
	if test $ol_enable_bdb != no ; then
		ol_with_ldbm_api=berkeley
	fi

Kurt Zeilenga's avatar
Kurt Zeilenga committed
434
435
436
437
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
438
		AC_MSG_ERROR([GDBM only supports LDBM type hash])
Kurt Zeilenga's avatar
Kurt Zeilenga committed
439
	fi
Juan Gomez's avatar
Juan Gomez committed
440
441
442
443
	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
444
445
	if test $ol_with_ldbm_api = ndbm -a \
		$ol_with_ldbm_type = btree ; then
Kurt Zeilenga's avatar
Kurt Zeilenga committed
446
		AC_MSG_ERROR([NDBM only supports LDBM type hash])
Kurt Zeilenga's avatar
Kurt Zeilenga committed
447
	fi
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462

	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
463
464
465
466
467
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
468
		AC_MSG_ERROR([slurpd requires threads])
Kurt Zeilenga's avatar
Kurt Zeilenga committed
469
470
471
	fi
fi

Kurt Zeilenga's avatar
Kurt Zeilenga committed
472
473
474
475
476
477
if test $ol_enable_lmpasswd = yes ; then
	if test $ol_with_tls = no ; then
		AC_MSG_ERROR([LAN Manager passwords require OpenSSL])
	fi
fi

478
479
480
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
481
	elif test $ol_with_kerberos = auto ; then
482
		ol_with_kerberos=yes
483
	fi
484

485
elif test $ol_enable_kbind = no -o $ol_enable_kpasswd = no ; then
486
487
488
	if test $ol_with_kerberos = auto ; then
		ol_with_kerberos=no
	elif test $ol_with_kerberos != no ; then
489
		AC_MSG_WARN([Kerberos detection enabled unnecessarily]);
490
		ol_with_kerberos=no
491
	fi
492
493
fi

494
495
496
497
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
498
	ol_with_cyrus_sasl=yes
499
500
fi

Kurt Zeilenga's avatar
Kurt Zeilenga committed
501
502
AC_MSG_RESULT(done)

503
504
dnl ----------------------------------------------------------------
dnl Initialize vars
Kurt Zeilenga's avatar
Kurt Zeilenga committed
505
LDAP_LIBS=
506
LDIF_LIBS=
Kurt Zeilenga's avatar
Kurt Zeilenga committed
507
508
509
510
511
512
513
514
515
516
LDBM_LIBS=
LTHREAD_LIBS=
LUTIL_LIBS=

SLAPD_LIBS=
SLURPD_LIBS=

BUILD_SLAPD=no
BUILD_SLURPD=no

517
518
BUILD_THREAD=no

519
BUILD_BDB=no
520
BUILD_DNSSRV=no
521
BUILD_LDAP=no
Kurt Zeilenga's avatar
Kurt Zeilenga committed
522
BUILD_LDBM=no
Pierangelo Masarati's avatar
Pierangelo Masarati committed
523
BUILD_META=no
524
BUILD_MONITOR=no
525
BUILD_NULL=no
Kurt Zeilenga's avatar
Kurt Zeilenga committed
526
BUILD_PASSWD=no
527
BUILD_PERL=no
Kurt Zeilenga's avatar
Kurt Zeilenga committed
528
BUILD_SHELL=no
529
BUILD_SQL=no
530
BUILD_TCL=no
Kurt Zeilenga's avatar
Kurt Zeilenga committed
531

532
BUILD_BDB_DYNAMIC=static
533
BUILD_DNSSRV_DYNAMIC=static
Howard Chu's avatar
Howard Chu committed
534
535
BUILD_LDAP_DYNAMIC=static
BUILD_LDBM_DYNAMIC=static
Pierangelo Masarati's avatar
Pierangelo Masarati committed
536
BUILD_META_DYNAMIC=static
537
BUILD_MONITOR_DYNAMIC=static
538
BUILD_NULL_DYNAMIC=static
Howard Chu's avatar
Howard Chu committed
539
540
541
542
BUILD_PASSWD_DYNAMIC=static
BUILD_PERL_DYNAMIC=static
BUILD_SHELL_DYNAMIC=static
BUILD_TCL_DYNAMIC=static
543
BUILD_SQL_DYNAMIC=static
544

545
546
547
SLAPD_MODULES_LDFLAGS=
SLAPD_MODULES_CPPFLAGS=

548
549
550
SLAPD_STATIC_BACKENDS=
SLAPD_DYNAMIC_BACKENDS=

551
SLAPD_PERL_LDFLAGS=
552
553
MOD_PERL_LDFLAGS=
PERL_CPPFLAGS=
554

555
556
557
558
SLAPD_SQL_LDFLAGS=
SLAPD_SQL_LIBS=
SLAPD_SQL_INCLUDES=

559
MOD_TCL_LIB=
560
561
KRB4_LIBS=
KRB5_LIBS=
562
READLINE_LIBS=
563
SASL_LIBS=
Kurt Zeilenga's avatar
Kurt Zeilenga committed
564
TERMCAP_LIBS=
Bart Hartgers's avatar
   
Bart Hartgers committed
565
TLS_LIBS=
566
MODULES_LIBS=
567
AUTH_LIBS=
Kurt Zeilenga's avatar
Kurt Zeilenga committed
568

569
570
SLAPD_SLP_LIBS=

571
dnl ================================================================
Kurt Zeilenga's avatar
Kurt Zeilenga committed
572
573
dnl Checks for programs

Kurt Zeilenga's avatar
Kurt Zeilenga committed
574
AC_PROG_INSTALL
575

576
577
AC_DEFINE(HAVE_MKVERSION, 1, [define this if you have mkversion])

578
dnl ----------------------------------------------------------------
579
580
581
582
dnl
dnl Determine which C translator to use
dnl

583
dnl AIX Thread requires we use cc_r or xlc_r.
Kurt Zeilenga's avatar
Kurt Zeilenga committed
584
585
dnl But only do this IF AIX and CC is not set
dnl and threads are auto|yes|posix.
586
dnl
587
dnl If we find cc_r|xlc_r, force pthreads and assume
588
589
dnl		pthread_create is in $LIBS (ie: don't bring in
dnl		any additional thread libraries)
590
dnl If we do not find cc_r|xlc_r, disable threads
591
592

ol_aix_threads=no
593
case "$target" in
Kurt Zeilenga's avatar
Kurt Zeilenga committed
594
*-*-aix*) dnl all AIX is not a good idea.
595
	if test -z "$CC" ; then
Kurt Zeilenga's avatar
Kurt Zeilenga committed
596
		case "$ol_with_threads" in
597
		auto | yes |  posix) ol_aix_threads=yes ;;
Kurt Zeilenga's avatar
Kurt Zeilenga committed
598
599
600
601
		esac
	fi
;;
esac
602

603
604
605
606
607
608
609
610
611
612
613
614
615
616
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
617

618
	if test "${CC}" = "cc_r" -o "${CC}" = "xlc_r" ; then
619
620
621
622
623
		ol_with_threads=posix
		ol_cv_pthread_create=yes
	fi
fi

Kurt Zeilenga's avatar
Kurt Zeilenga committed
624
if test -z "${CC}"; then
Kurt Zeilenga's avatar
Kurt Zeilenga committed
625
	AC_CHECK_PROGS(CC,cc gcc,missing)
Kurt Zeilenga's avatar
Kurt Zeilenga committed
626
627

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

632
633
634
635
if test -z "${AR}"; then
	AC_CHECK_PROGS(AR,ar gar,missing)

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

Howard Chu's avatar
Howard Chu committed
640
AC_LIBTOOL_WIN32_DLL
641
AC_LIBTOOL_DLOPEN
Kurt Zeilenga's avatar
Kurt Zeilenga committed
642
AC_PROG_LIBTOOL
Kurt Zeilenga's avatar
Kurt Zeilenga committed
643

644
AC_PROG_AWK
645
646
OL_PROG_LN_H
AC_PROG_LN_S
647

Kurt Zeilenga's avatar
Kurt Zeilenga committed
648
649
650
651
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)

652
653
dnl ----------------------------------------------------------------
dnl Perl
654
655
ol_link_perl=no
if test $ol_enable_perl != no ; then
656
657
658
	AC_PATH_PROG(PERLBIN, perl, /usr/bin/perl)

	if test "no$PERLBIN" = "no" ; then
659
660
661
		if test $ol_enable_perl = yes ; then
			AC_MSG_ERROR([could not locate perl])
		fi
662

663
	else
664
		PERL_CPPFLAGS="`$PERLBIN -MExtUtils::Embed -e ccopts`"
Kurt Zeilenga's avatar
Kurt Zeilenga committed
665
		if test x"$ol_with_perl_module" = "xstatic" ; then
666
667
668
669
			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
670
671
672
		dnl should check perl version
		ol_link_perl=yes
	fi
673
674
fi

675
AC_PROG_CPP
676

677
678
dnl ----------------------------------------------------------------
dnl Cross compiling checks
679
if test $cross_compiling = yes -a $ol_enable_x_compile = yes; then
680
	AC_MSG_WARN([cross compiling....  some functionality will be removed.])
681
682

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

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

691
dnl ----------------------------------------------------------------
692
dnl Checks for UNIX Variants
Kurt Zeilenga's avatar
Kurt Zeilenga committed
693
694
695
dnl AC_AIX
dnl AC_ISC_POSIX
dnl AC_MINIX
Kurt Zeilenga's avatar
Kurt Zeilenga committed
696

697
dnl ----------------------------------------------------------------
698
699
700
701
702
703
dnl Checks for system services
AC_CYGWIN
AC_MINGW32
AC_EXEEXT
AC_OBJEXT

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

706
dnl ----------------------------------------------------------------
707
708
709
dnl BeOS requires -lbe -lroot -lnet
AC_CHECK_LIB(be, be_app, [LIBS="$LIBS -lbe -lroot -lnet"], :, [-lroot -lnet])

710
dnl ----------------------------------------------------------------
711
712
713
dnl OpenLDAP requires STDC features
AM_PROG_CC_STDC
if test "X${am_cv_prog_cc_stdc}" = "Xno" ; then
714
	AC_MSG_ERROR([OpenLDAP requires compiler to support STDC constructs.])
715
716
fi

717
dnl ----------------------------------------------------------------
718
dnl Check cc depend flags
Kurt Zeilenga's avatar
Kurt Zeilenga committed
719
720
721
722
723
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
724

725
726
727
728
729
730
731
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])
])

732

733
dnl ----------------------------------------------------------------
734
735
736
737
738
739
740
741
742
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
743
	AC_CHECK_LIB(ltdl, lt_dlinit, [
Kurt Zeilenga's avatar
Kurt Zeilenga committed
744
745
		MODULES_LIBS=-lltdl
		AC_DEFINE(HAVE_LIBLTDL,1,[define if you have libtool -ltdl])
Howard Chu's avatar
Howard Chu committed
746
747
	])

748
749
750
751
752
	if test "$ac_cv_lib_ltdl_lt_dlinit" = no ; then
		AC_MSG_ERROR([could not locate libtool -lltdl])
	fi
	ol_link_modules=yes
else
753
	ol_with_bdb_module=static
754
	ol_with_dnssrv_module=static
755
756
	ol_with_ldap_module=static
	ol_with_ldbm_module=static
Pierangelo Masarati's avatar
Pierangelo Masarati committed
757
	ol_with_meta_module=static
758
	ol_with_monitor_module=static
759
	ol_with_null_module=static
760
761
762
763
	ol_with_passwd_module=static
	ol_with_perl_module=static
	ol_with_shell_module=static
	ol_with_tcl_module=static
764
	ol_with_sql_module=static
765
766
fi

767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
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
787
	conio.h			\
788
	crypt.h			\
Howard Chu's avatar
Howard Chu committed
789
	direct.h		\
790
791
792
793
794
	errno.h			\
	fcntl.h			\
	filio.h			\
	getopt.h		\
	grp.h			\
Howard Chu's avatar
Howard Chu committed
795
	io.h			\
796
797
798
799
800
801
802
803
	libutil.h		\
	limits.h		\
	locale.h		\
	netinet/tcp.h	\
	malloc.h		\
	memory.h		\
	psap.h			\
	pwd.h			\
Howard Chu's avatar
Howard Chu committed
804
	process.h		\
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
	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		\
826
	winsock.h		\
Howard Chu's avatar
Howard Chu committed
827
	winsock2.h		\
828
829
)

Howard Chu's avatar
Howard Chu committed
830

831
dnl ----------------------------------------------------------------
Kurt Zeilenga's avatar
Kurt Zeilenga committed
832
833
dnl Checks for libraries

834
835
AC_CHECK_FUNC(dlopen, :, [AC_CHECK_LIB(dl, dlopen)])

836
837
838
dnl HP-UX requires -lV3
dnl this is not needed on newer versions of HP-UX
AC_CHECK_LIB(V3, sigset)
839

Howard Chu's avatar
Howard Chu committed
840
841
842
843
844
845
846
847
848
849
850
851
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
852
853
			],
			[
Howard Chu's avatar
Howard Chu committed
854
855
856
857
			socket@12();
			select@20();
			closesocket@4();
			gethostname@8();
Kurt Zeilenga's avatar
Kurt Zeilenga committed
858
859
			],
			have_winsock=yes, have_winsock=no)
Howard Chu's avatar
Howard Chu committed
860
861
862

	if test $have_winsock = yes; then
		AC_DEFINE(HAVE_WINSOCK, 1, [define if you have winsock])
863
864
865
866
		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
867
868
869
870
871
872
		if test $curlib = ws2_32; then
			have_winsock=winsock2
			AC_DEFINE(HAVE_WINSOCK2, 1,
				  [define if you have winsock2])
		fi
		break
873
	fi
Howard Chu's avatar
Howard Chu committed
874
875
876
	LIBS="$save_LIBS"
done
AC_MSG_RESULT($have_winsock)
Howard Chu's avatar
Howard Chu committed
877

Kurt Zeilenga's avatar
Kurt Zeilenga committed
878
879
880
881
882
dnl Find socket()
dnl Likely combinations:
dnl		-lsocket [ -lnsl_s | -lnsl ]
dnl		-linet

Kurt Zeilenga's avatar
Kurt Zeilenga committed
883
AC_CHECK_FUNC(socket, :, [	
Kurt Zeilenga's avatar
Kurt Zeilenga committed
884
885
886
887
888
889
890
891
892
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
893
dnl require select
894
895
AC_CHECK_FUNC(select, :, AC_MSG_ERROR([select() required.]))

Howard Chu's avatar
Howard Chu committed
896
if test "${ac_cv_header_winsock_h}" != yes; then
Kurt Zeilenga's avatar
Kurt Zeilenga committed
897
898
899
900
	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
901
fi
902

903
dnl check to see if system call automatically restart
904
dnl AC_SYS_RESTARTABLE_SYSCALLS
905

906
dnl ----------------------------------------------------------------
Kurt Zeilenga's avatar
Kurt Zeilenga committed
907
dnl require POSIX regex
908
909
910
911
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
912
AC_SEARCH_LIBS(regfree, [regex gnuregex],
Kurt Zeilenga's avatar
Kurt Zeilenga committed
913
	:, AC_MSG_ERROR([POSIX regex required.]))
914
915
916
917
918
919

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

920
dnl ----------------------------------------------------------------
Kurt Zeilenga's avatar
Kurt Zeilenga committed
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
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

939
dnl For windows, check for the need of RPCRT for UUID function support
Kurt Zeilenga's avatar
Kurt Zeilenga committed
940
941
942
943
944
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([
945
946
947
948
949
950
951
952
		char UuidCreate@4();
		char UuidToStringA@8();
		],
		[
		UuidCreate@4();
		UuidToStringA@8();
		],
		need_rpcrt=yes, need_rpcrt=no)
Kurt Zeilenga's avatar
Kurt Zeilenga committed
953
954
955
956
957
	if test $need_rpcrt = yes; then
		SLAPD_LIBS="$SLAPD_LIBS -lrpcrt4"
	fi
	LIBS="$save_LIBS"
	AC_MSG_RESULT($need_rpcrt)
958
959
fi

960
dnl ----------------------------------------------------------------
961
dnl Check for resolver routines
962
963
dnl	  need to check for both res_query and __res_query
dnl   need to check -lc, -lbind, and -lresolv
964
965
ol_link_dnssrv=no
AC_CHECK_FUNC(res_query,:)
966
967
968
969
970
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

971
972
973
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
974
fi
975

976
977
978
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
979
fi
Kurt Zeilenga's avatar
Kurt Zeilenga committed
980

981
982
983
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