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

18
# Copyright 1998-2000 The OpenLDAP Foundation.  All Rights Reserved.
19
20
21
22
23
# 
# Redistribution and use in source and binary forms 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.
24

25
echo "Copyright 1998-2000 The OpenLDAP Foundation,  All Rights Reserved."
26
echo "Copying restrictions apply, see COPYRIGHT file."
27
])dnl
28
dnl ----------------------------------------------------------------
29
30
31
dnl Disable config.cache!
define([AC_CACHE_LOAD], )dnl
define([AC_CACHE_SAVE], )dnl
Kurt Zeilenga's avatar
Kurt Zeilenga committed
32
dnl ================================================================
Kurt Zeilenga's avatar
Kurt Zeilenga committed
33
dnl Configure.in for OpenLDAP
34
AC_INIT(build/version)dnl
35
AC_CONFIG_AUX_DIR(build)dnl
36
37
38
39
40
41

OL_VERSION=`cat $ac_aux_dir/version`
if test -z "$OL_VERSION"; then
	AC_MSG_ERROR([could not determine version])
fi

42
43
echo "Configuring OpenLDAP $OL_VERSION ..."

44
45
46
47
dnl Determine host platform
dnl		we try not to use this for much
AC_CANONICAL_SYSTEM

48
AM_INIT_AUTOMAKE(OpenLDAP,[$OL_VERSION], [no defines])dnl
49
50
AC_SUBST(PACKAGE)
AC_SUBST(VERSION)
Kurt Zeilenga's avatar
Kurt Zeilenga committed
51
52
AC_DEFINE_UNQUOTED(OPENLDAP_PACKAGE,"$PACKAGE",Package)
AC_DEFINE_UNQUOTED(OPENLDAP_VERSION,"$VERSION",Version)
53

54
dnl We use autoconf features new to 2.13.
55
56
dnl aclocal.m4 should be built using aclocal from automake 1.4
dnl libtool 1.3.3 should be installed.
57
AC_PREREQ(2.13)dnl Required Autoconf version
58

59
AC_CONFIG_HEADER(include/portable.h include/ldap_features.h include/lber_types.h)dnl
60

61
dnl ================================================================
Kurt Zeilenga's avatar
Kurt Zeilenga committed
62
63
64
65
dnl Start Args
AC_MSG_CHECKING(configure arguments)
AC_PREFIX_DEFAULT(/usr/local)

66
67
68
top_builddir=`pwd`
AC_SUBST(top_builddir)dnl

69
70
dnl ----------------------------------------------------------------
dnl --with-subdir
71
ldap_subdir="/openldap"
Kurt Zeilenga's avatar
Kurt Zeilenga committed
72

73
74
75
76
77
78
79
80
AC_ARG_WITH(subdir,
[  --with-subdir=DIR change default subdirectory used for installs],
[case "$withval" in
	no) ldap_subdir=""
		;;
	yes)
		;;
	/*|\\*)
81
		ldap_subdir="$withval"
82
83
84
85
86
		;;
	*)
		ldap_subdir="/$withval"
		;;
esac
87
88
])dnl

89
90
AC_SUBST(ldap_subdir)dnl

91
92
dnl ----------------------------------------------------------------
dnl General "enable" options
93
OL_ARG_ENABLE(debug,[  --enable-debug 	enable debugging], yes)dnl
94
OL_ARG_ENABLE(syslog,[  --enable-syslog	enable syslog support], auto)dnl
Kurt Zeilenga's avatar
Kurt Zeilenga committed
95
OL_ARG_ENABLE(proctitle,[  --enable-proctitle	enable proctitle support], yes)dnl
Kurt Zeilenga's avatar
Kurt Zeilenga committed
96
OL_ARG_ENABLE(cache,[  --enable-cache	enable caching], yes)dnl
97
OL_ARG_ENABLE(dns,[  --enable-dns		enable V2 DX Referrals extension], no)dnl
98
OL_ARG_ENABLE(referrals,[  --enable-referrals	enable V2 Referrals extension], yes)dnl
99
OL_ARG_ENABLE(kbind,[  --enable-kbind	enable V2 Kerberos IV bind], auto)dnl
Kurt Zeilenga's avatar
Kurt Zeilenga committed
100
OL_ARG_ENABLE(cldap,[  --enable-cldap	enable connectionless ldap], no)dnl
101
OL_ARG_ENABLE(ldapi,[  --enable-ldapi	enable domain socket (PF_LOCAL) ldap], no)dnl
102
103
OL_ARG_ENABLE(x_compile,[  --enable-x-compile	enable cross compiling],
	no, [yes no])dnl
Kurt Zeilenga's avatar
Kurt Zeilenga committed
104

105
dnl ----------------------------------------------------------------
Kurt Zeilenga's avatar
Kurt Zeilenga committed
106
dnl General "with" options
107
108
OL_ARG_ENABLE(dmalloc,[  --enable-dmalloc	enable debug malloc support], no)dnl

Kurt Zeilenga's avatar
Kurt Zeilenga committed
109
OL_ARG_WITH(cyrus_sasl,[  --with-cyrus-sasl	with Cyrus SASL support],
110
	auto, [auto yes no] )
Kurt Zeilenga's avatar
Kurt Zeilenga committed
111
OL_ARG_WITH(fetch,[  --with-fetch		with fetch URL support],
112
	auto, [auto yes no] )
113
114
OL_ARG_WITH(kerberos,[  --with-kerberos	with support],
	auto, [auto k5 k5only k425 kth k4 afs yes no])
Kurt Zeilenga's avatar
Kurt Zeilenga committed
115
OL_ARG_WITH(readline,[  --with-readline	with readline support],
116
	auto, [auto yes no] )
Kurt Zeilenga's avatar
Kurt Zeilenga committed
117
OL_ARG_WITH(threads,[  --with-threads	use threads],
118
	auto, [auto nt posix mach pth lwp yes no manual] )
Kurt Zeilenga's avatar
Kurt Zeilenga committed
119
OL_ARG_WITH(tls,[  --with-tls		with TLS/SSL support],
Bart Hartgers's avatar
   
Bart Hartgers committed
120
	auto, [auto ssleay openssl yes no] )
121
122
OL_ARG_WITH(yielding_select,[  --with-yielding-select	with implicitly yielding select],
	auto, [auto yes no manual] )
Kurt Zeilenga's avatar
Kurt Zeilenga committed
123

124
dnl ----------------------------------------------------------------
Kurt Zeilenga's avatar
Kurt Zeilenga committed
125
dnl Server options
126
dnl ----------------------------------------------------------------
Kurt Zeilenga's avatar
Kurt Zeilenga committed
127
dnl LDAPD OPTIONS
128
AC_ARG_WITH(xxldapdoptions,[LDAPD (X.500-to-LDAP Gateway) Options:])
Kurt Zeilenga's avatar
Kurt Zeilenga committed
129
130
OL_ARG_ENABLE(ldapd,[  --enable-ldapd	enable building ldapd], no)dnl

131
dnl ----------------------------------------------------------------
Kurt Zeilenga's avatar
Kurt Zeilenga committed
132
dnl SLAPD OPTIONS
133
AC_ARG_WITH(xxslapdoptions,[SLAPD (Standalone LDAP Daemon) Options:])
Kurt Zeilenga's avatar
Kurt Zeilenga committed
134
OL_ARG_ENABLE(slapd,[  --enable-slapd	enable building slapd], yes)dnl
135
OL_ARG_ENABLE(cleartext,[    --enable-cleartext	enable cleartext passwords], yes)dnl
Kurt Zeilenga's avatar
Kurt Zeilenga committed
136
OL_ARG_ENABLE(crypt,[    --enable-crypt	enable crypt(3) passwords], auto)dnl
137
OL_ARG_ENABLE(kpasswd,[    --enable-kpasswd	enable kerberos password verification], no)dnl
138
139
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
140
OL_ARG_ENABLE(multimaster,[    --enable-multimaster	enable multimaster replication], no)dnl
Kurt Zeilenga's avatar
Kurt Zeilenga committed
141
OL_ARG_ENABLE(phonetic,[    --enable-phonetic	enable phonetic/soundex], no)dnl
142
OL_ARG_ENABLE(quipu,[    --enable-quipu	build quipu migration tools], no)dnl
Kurt Zeilenga's avatar
Kurt Zeilenga committed
143
OL_ARG_ENABLE(rlookups,[    --enable-rlookups	enable reverse lookups], auto)dnl
144
OL_ARG_ENABLE(aci,[    --enable-aci	enable per-object ACIs], no)dnl
145
OL_ARG_ENABLE(wrappers,[    --enable-wrappers	enable tcp wrapper support], no)dnl
146
OL_ARG_ENABLE(dynamic,[    --enable-dynamic	enable linking built binaries with dynamic libs], no)dnl
Kurt Zeilenga's avatar
Kurt Zeilenga committed
147
148

dnl SLAPD Backend options
149
OL_ARG_ENABLE(bdb2,[    --enable-bdb2	enable bdb2 backend], no)dnl
150
151
OL_ARG_WITH(bdb2_module,[      --with-bdb2-module	module type], static,
	[static dynamic])
152
153
154
OL_ARG_ENABLE(dnssrv,[    --enable-dnssrv	enable bdb2 backend], no)dnl
OL_ARG_WITH(dnssrv_module,[      --with-dnssrv-module	module type], static,
	[static dynamic])
155
OL_ARG_ENABLE(ldap,[    --enable-ldap	enable ldap backend], no)dnl
156
157
OL_ARG_WITH(ldap_module,[      --with-ldap-module	module type], static,
	[static dynamic])
Kurt Zeilenga's avatar
Kurt Zeilenga committed
158
159
OL_ARG_ENABLE(ldbm,[    --enable-ldbm	enable ldbm backend], yes)dnl
OL_ARG_WITH(ldbm_api,[      --with-ldbm-api	use LDBM API], auto,
Kurt Zeilenga's avatar
Kurt Zeilenga committed
160
	[auto berkeley bcompat mdbm gdbm])
Kurt Zeilenga's avatar
Kurt Zeilenga committed
161
162
OL_ARG_WITH(ldbm_module,[      --with-ldbm-module	module type], static,
	[static dynamic])
Kurt Zeilenga's avatar
Kurt Zeilenga committed
163
164
165
OL_ARG_WITH(ldbm_type,[      --with-ldbm-type	use LDBM type], auto,
	[auto btree hash])
OL_ARG_ENABLE(passwd,[    --enable-passwd	enable passwd backend], no)dnl
166
167
OL_ARG_WITH(passwd_module,[      --with-passwd-module	module type], static,
	[static dynamic])
168
OL_ARG_ENABLE(perl,[    --enable-perl	enable perl backend], no)dnl
169
170
OL_ARG_WITH(perl_module,[      --with-perl-module	module type], static,
	[static dynamic])
Kurt Zeilenga's avatar
Kurt Zeilenga committed
171
OL_ARG_ENABLE(shell,[    --enable-shell	enable shell backend], no)dnl
172
173
OL_ARG_WITH(shell_module,[      --with-shell-module	module type], static,
	[static dynamic])
174
175
176
OL_ARG_ENABLE(sql,[    --enable-sql	enable sql backend], no)dnl
OL_ARG_WITH(sql_module,[      --with-sql-module	module type], static,
	[static dynamic])
177
178
179
OL_ARG_ENABLE(tcl,[    --enable-tcl	enable tcl backend], no)dnl
OL_ARG_WITH(tcl_module,[      --with-tcl-module	module type], static,
	[static dynamic])
Kurt Zeilenga's avatar
Kurt Zeilenga committed
180

181
dnl ----------------------------------------------------------------
Kurt Zeilenga's avatar
Kurt Zeilenga committed
182
dnl SLURPD OPTIONS
Kurt Zeilenga's avatar
Kurt Zeilenga committed
183
AC_ARG_WITH(xxslurpdoptions,[SLURPD (Replication Daemon) Options:])
Kurt Zeilenga's avatar
Kurt Zeilenga committed
184
185
OL_ARG_ENABLE(slurpd,[  --enable-slurpd	enable building slurpd], auto)dnl

186
dnl ----------------------------------------------------------------
187
AC_ARG_WITH(xxliboptions,[Library Generation & Linking Options])
Kurt Zeilenga's avatar
Kurt Zeilenga committed
188
189
190
AC_ENABLE_STATIC
dnl AC_DISABLE_SHARED
AC_ENABLE_SHARED
191

192
193
dnl ----------------------------------------------------------------

194
dnl General "enable" options
195
# validate options
196
197
198
199
200
201
202
if test $ol_enable_dns = yes ; then
	if test $ol_enable_referrals = no ; then
		AC_MSG_ERROR([DNS requires --enable-referrals])
	fi
	if test $ol_enable_referrals = auto ; then
		AC_MSG_WARN([DNS requires referrals, adding --enable-referrals])
		ol_enable_referrals=yes
203
204
205
	fi
fi

Kurt Zeilenga's avatar
Kurt Zeilenga committed
206
207
if test $ol_enable_slapd = no ; then
	dnl SLAPD was specificallly disabled
208
	if test $ol_enable_bdb2 = yes ; then
Kurt Zeilenga's avatar
Kurt Zeilenga committed
209
		AC_MSG_WARN([slapd disabled, ignoring --enable-bdb2 argument])
210
	fi
211
212
213
	if test $ol_enable_dnssrv = yes ; then
		AC_MSG_WARN([slapd disabled, ignoring --enable-dnssrv argument])
	fi
214
	if test $ol_enable_ldap = yes ; then
Kurt Zeilenga's avatar
Kurt Zeilenga committed
215
		AC_MSG_WARN([slapd disabled, ignoring --enable-ldap argument])
216
	fi
Kurt Zeilenga's avatar
Kurt Zeilenga committed
217
	if test $ol_enable_ldbm = yes ; then
Kurt Zeilenga's avatar
Kurt Zeilenga committed
218
		AC_MSG_WARN([slapd disabled, ignoring --enable-ldbm argument])
Kurt Zeilenga's avatar
Kurt Zeilenga committed
219
220
	fi
	if test $ol_enable_passwd = yes ; then
Kurt Zeilenga's avatar
Kurt Zeilenga committed
221
		AC_MSG_WARN([slapd disabled, ignoring --enable-passwd argument])
Kurt Zeilenga's avatar
Kurt Zeilenga committed
222
	fi
223
	if test $ol_enable_perl = yes ; then
Kurt Zeilenga's avatar
Kurt Zeilenga committed
224
		AC_MSG_WARN([slapd disabled, ignoring --enable-perl argument])
225
	fi
Kurt Zeilenga's avatar
Kurt Zeilenga committed
226
	if test $ol_enable_shell = yes ; then
Kurt Zeilenga's avatar
Kurt Zeilenga committed
227
		AC_MSG_WARN([slapd disabled, ignoring --enable-shell argument])
Kurt Zeilenga's avatar
Kurt Zeilenga committed
228
	fi
229
	if test $ol_enable_tcl = yes ; then
Kurt Zeilenga's avatar
Kurt Zeilenga committed
230
		AC_MSG_WARN([slapd disabled, ignoring --enable-tcl argument])
231
	fi
232
233
234
	if test $ol_enable_sql = yes ; then
		AC_MSG_WARN([slapd disabled, ignoring --enable-sql argument])
	fi
235
	if test $ol_enable_modules = yes ; then
Kurt Zeilenga's avatar
Kurt Zeilenga committed
236
		AC_MSG_WARN([slapd disabled, ignoring --enable-modules argument])
237
	fi
238
239
240
	if test $ol_enable_multimaster = yes ; then
		AC_MSG_WARN([slapd disabled, ignoring --enable-multimaster argument])
	fi
Kurt Zeilenga's avatar
Kurt Zeilenga committed
241
	if test $ol_enable_wrappers = yes ; then
Kurt Zeilenga's avatar
Kurt Zeilenga committed
242
		AC_MSG_WARN([slapd disabled, ignoring --enable-wrappers argument])
Kurt Zeilenga's avatar
Kurt Zeilenga committed
243
244
	fi
	if test $ol_enable_phonetic = yes ; then
Kurt Zeilenga's avatar
Kurt Zeilenga committed
245
		AC_MSG_WARN([slapd disabled, ignoring --enable-phonetic argument])
Kurt Zeilenga's avatar
Kurt Zeilenga committed
246
	fi
247
248
249
	if test $ol_enable_quipu = yes ; then
		AC_MSG_WARN([slapd disabled, ignoring --enable-quipu argument])
	fi
Kurt Zeilenga's avatar
Kurt Zeilenga committed
250
	if test $ol_enable_rlookups = yes ; then
Kurt Zeilenga's avatar
Kurt Zeilenga committed
251
		AC_MSG_WARN([slapd disabled, ignoring --enable-rlookups argument])
Kurt Zeilenga's avatar
Kurt Zeilenga committed
252
	fi
253
254
255
	if test $ol_enable_aci = yes ; then
		AC_MSG_WARN([slapd disabled, ignoring --enable-aci argument])
	fi
Kurt Zeilenga's avatar
Kurt Zeilenga committed
256
	if test $ol_with_ldbm_api != auto ; then
Kurt Zeilenga's avatar
Kurt Zeilenga committed
257
		AC_MSG_WARN([slapd disabled, ignoring --with-ldbm-api argument])
Kurt Zeilenga's avatar
Kurt Zeilenga committed
258
259
	fi
	if test $ol_with_ldbm_type != auto ; then
Kurt Zeilenga's avatar
Kurt Zeilenga committed
260
		AC_MSG_WARN([slapd disabled, ignoring --with-ldbm-type argument])
Kurt Zeilenga's avatar
Kurt Zeilenga committed
261
	fi
262
263
264
	if test $ol_with_bdb2_module != static ; then
		AC_MSG_WARN([slapd disabled, ignoring --with-bdb2-module argument])
	fi
265
266
267
	if test $ol_with_dnssrv_module != static ; then
		AC_MSG_WARN([slapd disabled, ignoring --with-dnssrv-module argument])
	fi
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
	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
	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
286
287
288
	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
289
	if test $ol_enable_slurpd = yes ; then
Kurt Zeilenga's avatar
Kurt Zeilenga committed
290
		AC_MSG_ERROR([slurpd requires slapd])
Kurt Zeilenga's avatar
Kurt Zeilenga committed
291
292
293
	fi

	# force settings to no
294
	ol_enable_bdb2=no
295
	ol_enable_dnssrv=no
296
	ol_enable_ldap=no
Kurt Zeilenga's avatar
Kurt Zeilenga committed
297
298
	ol_enable_ldbm=no
	ol_enable_passwd=no
299
300
	ol_enable_perl=no
	ol_enable_shell=no
301
	ol_enable_tcl=no
302
	ol_enable_sql=no
303
304

	ol_enable_modules=no
305
	ol_enable_multimaster=no
Kurt Zeilenga's avatar
Kurt Zeilenga committed
306
	ol_enable_phonetic=no
307
	ol_enable_quipu=no
Kurt Zeilenga's avatar
Kurt Zeilenga committed
308
	ol_enable_rlookups=no
309
	ol_enable_aci=no
310
	ol_enable_wrappers=no
311
	ol_enable_dynamic=no
312

Kurt Zeilenga's avatar
Kurt Zeilenga committed
313
314
	ol_with_ldbm_api=no
	ol_with_ldbm_type=no
315

316
	ol_with_bdb2_module=static
317
	ol_with_dnssrv_module=static
318
319
320
321
322
323
	ol_with_ldap_module=static
	ol_with_ldbm_module=static
	ol_with_passwd_module=static
	ol_with_perl_module=static
	ol_with_shell_module=static
	ol_with_tcl_module=static
324
	ol_with_sql_module=static
325

Kurt Zeilenga's avatar
Kurt Zeilenga committed
326
327
328
329
330
331
	ol_enable_slurpd=no

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
332
		AC_MSG_WARN([LDBM disabled, ignoring --with-ldbm-api argument])
Kurt Zeilenga's avatar
Kurt Zeilenga committed
333
334
335
	fi

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

339
340
341
342
	if test $ol_with_ldbm_module != static ; then
		AC_MSG_WARN([LDBM disabled, ignoring --with-ldbm-module argument])
	fi

343
	if test $ol_enable_bdb2 = yes ; then
344
345
346
		AC_MSG_ERROR([BDB2 requires --enable-ldbm])
	fi

347
	if test $ol_enable_modules != yes -a \
348
		$ol_enable_dnssrv = no -a \
349
		$ol_enable_ldap = no -a \
350
		$ol_enable_passwd = no -a \
351
		$ol_enable_perl = no -a \
352
		$ol_enable_shell = no -a \
353
354
		$ol_enable_sql = no -a \
		$ol_enable_tcl = no ; then
Kurt Zeilenga's avatar
Kurt Zeilenga committed
355
		AC_MSG_ERROR([slapd requires a backend])
Kurt Zeilenga's avatar
Kurt Zeilenga committed
356
357
358
359
	fi

	ol_with_ldbm_api=no
	ol_with_ldbm_type=no
360
	ol_with_ldbm_module=static
Kurt Zeilenga's avatar
Kurt Zeilenga committed
361

362
363
364
365
elif test $ol_enable_bdb2 = yes ; then
	dnl SLAPD with BDB2

	if test $ol_with_ldbm_api != auto -a \
Kurt Zeilenga's avatar
Kurt Zeilenga committed
366
367
		$ol_with_ldbm_api != berkeley ; then
		AC_MSG_ERROR([BDB2 requires LDBM API berkeley or auto])
368
369
370
371
	fi

	ol_with_ldbm_api=db2

Kurt Zeilenga's avatar
Kurt Zeilenga committed
372
373
374
else
	dnl SLAPD with LDBM

375
376
	if test $ol_enable_bdb2 != no ; then
		if test $ol_with_ldbm_api != auto -a \
Kurt Zeilenga's avatar
Kurt Zeilenga committed
377
378
			$ol_with_ldbm_api != berkeley ; then
			AC_MSG_WARN([BDB2 requires LDBM api berkeley or auto])
379
380
381
382
			ol_enable_bdb2=no
		fi
	fi

Kurt Zeilenga's avatar
Kurt Zeilenga committed
383
384
	if test $ol_with_ldbm_api = gdbm -a \
		$ol_with_ldbm_type = btree ; then
Kurt Zeilenga's avatar
Kurt Zeilenga committed
385
		AC_MSG_ERROR([GDBM only supports LDBM type hash])
Kurt Zeilenga's avatar
Kurt Zeilenga committed
386
	fi
Juan Gomez's avatar
Juan Gomez committed
387
388
389
390
	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
391
392
	if test $ol_with_ldbm_api = ndbm -a \
		$ol_with_ldbm_type = btree ; then
Kurt Zeilenga's avatar
Kurt Zeilenga committed
393
		AC_MSG_ERROR([NDBM only supports LDBM type hash])
Kurt Zeilenga's avatar
Kurt Zeilenga committed
394
395
396
397
398
399
	fi
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
400
		AC_MSG_ERROR([slurpd requires threads])
Kurt Zeilenga's avatar
Kurt Zeilenga committed
401
402
403
	fi
fi

404
405
406
407
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])
	fi
408
409
410
411
412
413
elif test $ol_enable_kbind = no -o $ol_enable_kpasswd = no ; then
	if test $ol_with_kerberos != auto ; then
		AC_MSG_WARN([Kerberos detection enabled unnecessarily]);
	else
		ol_with_kerberos=no
	fi
414
415
fi

416
417
418
419
if test $ol_enable_spasswd = yes ; then
	if test $ol_with_cyrus_sasl = no ; then
		AC_MSG_ERROR([options require --with-cyrus-sasl])
	fi
420
	ol_link_spasswd=yes
421
422
fi

Kurt Zeilenga's avatar
Kurt Zeilenga committed
423
424
AC_MSG_RESULT(done)

425
426
dnl ----------------------------------------------------------------
dnl Initialize vars
Kurt Zeilenga's avatar
Kurt Zeilenga committed
427
LDAP_LIBS=
428
LDIF_LIBS=
Kurt Zeilenga's avatar
Kurt Zeilenga committed
429
430
431
432
433
434
435
436
437
438
439
440
LDBM_LIBS=
LTHREAD_LIBS=
LUTIL_LIBS=

LDAPD_LIBS=
SLAPD_LIBS=
SLURPD_LIBS=

BUILD_LDAPD=no
BUILD_SLAPD=no
BUILD_SLURPD=no

441
442
443
BUILD_QUIPU=no
BUILD_THREAD=no

444
BUILD_BDB2=no
445
BUILD_DNSSRV=no
446
BUILD_LDAP=no
Kurt Zeilenga's avatar
Kurt Zeilenga committed
447
448
BUILD_LDBM=no
BUILD_PASSWD=no
449
BUILD_PERL=no
Kurt Zeilenga's avatar
Kurt Zeilenga committed
450
BUILD_SHELL=no
451
BUILD_SQL=no
452
BUILD_TCL=no
Kurt Zeilenga's avatar
Kurt Zeilenga committed
453

Howard Chu's avatar
Howard Chu committed
454
BUILD_BDB2_DYNAMIC=static
455
BUILD_DNSSRV_DYNAMIC=static
Howard Chu's avatar
Howard Chu committed
456
457
458
459
460
461
BUILD_LDAP_DYNAMIC=static
BUILD_LDBM_DYNAMIC=static
BUILD_PASSWD_DYNAMIC=static
BUILD_PERL_DYNAMIC=static
BUILD_SHELL_DYNAMIC=static
BUILD_TCL_DYNAMIC=static
462
BUILD_SQL_DYNAMIC=static
463

464
465
SLAPD_MODULES_LDFLAGS=
SLAPD_MODULES_CPPFLAGS=
466
SLAPD_MODULES_LIST=
467

468
SLAPD_PERL_LDFLAGS=
469
470
MOD_PERL_LDFLAGS=
PERL_CPPFLAGS=
471

472
473
474
475
SLAPD_SQL_LDFLAGS=
SLAPD_SQL_LIBS=
SLAPD_SQL_INCLUDES=

476
MOD_TCL_LIB=
477
478
KRB4_LIBS=
KRB5_LIBS=
479
READLINE_LIBS=
480
SASL_LIBS=
Kurt Zeilenga's avatar
Kurt Zeilenga committed
481
TERMCAP_LIBS=
Bart Hartgers's avatar
   
Bart Hartgers committed
482
TLS_LIBS=
483
MODULES_LIBS=
484
AUTH_LIBS=
Kurt Zeilenga's avatar
Kurt Zeilenga committed
485

486
dnl ================================================================
Kurt Zeilenga's avatar
Kurt Zeilenga committed
487
488
dnl Checks for programs

489
dnl AC_PROG_INSTALL
490

491
492
AC_DEFINE(HAVE_MKVERSION, 1, [define this if you have mkversion])

493
dnl ----------------------------------------------------------------
494
495
496
497
dnl
dnl Determine which C translator to use
dnl

498
dnl AIX Thread requires we use cc_r or xlc_r.
Kurt Zeilenga's avatar
Kurt Zeilenga committed
499
500
dnl But only do this IF AIX and CC is not set
dnl and threads are auto|yes|posix.
501
dnl
502
dnl If we find cc_r|xlc_r, force pthreads and assume
503
504
dnl		pthread_create is in $LIBS (ie: don't bring in
dnl		any additional thread libraries)
505
dnl If we do not find cc_r|xlc_r, disable threads
506
507

ol_aix_threads=no
508
case "$target" in
Kurt Zeilenga's avatar
Kurt Zeilenga committed
509
*-*-aix*) dnl all AIX is not a good idea.
510
	if test -z "$CC" ; then
Kurt Zeilenga's avatar
Kurt Zeilenga committed
511
		case "$ol_with_threads" in
512
		auto | yes |  posix) ol_aix_threads=yes ;;
Kurt Zeilenga's avatar
Kurt Zeilenga committed
513
514
515
516
		esac
	fi
;;
esac
517

518
519
520
521
522
523
524
525
526
527
528
529
530
531
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
532

533
	if test "${CC}" = "cc_r" -o "${CC}" = "xlc_r" ; then
534
535
536
537
538
		ol_with_threads=posix
		ol_cv_pthread_create=yes
	fi
fi

Kurt Zeilenga's avatar
Kurt Zeilenga committed
539
540
541
542
543
544
545
546
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-""}

Howard Chu's avatar
Howard Chu committed
547
AC_LIBTOOL_WIN32_DLL
548
AC_LIBTOOL_DLOPEN
Kurt Zeilenga's avatar
Kurt Zeilenga committed
549
AC_PROG_LIBTOOL
Kurt Zeilenga's avatar
Kurt Zeilenga committed
550

551
AC_PROG_AWK
552
OL_PROG_LN_H
553
554
AC_PROG_LN_S

555
556
557
558
if test "$LN_H" = "cp" -a "$LN_S" = "ln"; then
	LN_S="$LN_H"
fi

Kurt Zeilenga's avatar
Kurt Zeilenga committed
559
560
561
562
563
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)

564
565
dnl ----------------------------------------------------------------
dnl Perl
566
567
ol_link_perl=no
if test $ol_enable_perl != no ; then
568
569
570
	AC_PATH_PROG(PERLBIN, perl, /usr/bin/perl)

	if test "no$PERLBIN" = "no" ; then
571
572
573
		if test $ol_enable_perl = yes ; then
			AC_MSG_ERROR([could not locate perl])
		fi
574

575
	else
576
		PERL_CPPFLAGS="`$PERLBIN -MExtUtils::Embed -e ccopts`"
Kurt Zeilenga's avatar
Kurt Zeilenga committed
577
		if test x"$ol_with_perl_module" = "xstatic" ; then
578
579
580
581
			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
582
583
584
		dnl should check perl version
		ol_link_perl=yes
	fi
585
586
fi

587
AC_PROG_CPP
588

589
590
dnl ----------------------------------------------------------------
dnl Cross compiling checks
591
if test $cross_compiling = yes -a $ol_enable_x_compile = yes; then
592
	AC_MSG_WARN([cross compiling....  some functionality will be removed.])
593
594

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

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

603
dnl ----------------------------------------------------------------
604
dnl Checks for UNIX Variants
Kurt Zeilenga's avatar
Kurt Zeilenga committed
605
606
607
608
AC_AIX
AC_ISC_POSIX
AC_MINIX

609
dnl ----------------------------------------------------------------
610
611
612
613
614
615
dnl Checks for system services
AC_CYGWIN
AC_MINGW32
AC_EXEEXT
AC_OBJEXT

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

618
dnl ----------------------------------------------------------------
619
620
621
dnl BeOS requires -lbe -lroot -lnet
AC_CHECK_LIB(be, be_app, [LIBS="$LIBS -lbe -lroot -lnet"], :, [-lroot -lnet])

622
dnl ----------------------------------------------------------------
623
624
625
dnl OpenLDAP requires STDC features
AM_PROG_CC_STDC
if test "X${am_cv_prog_cc_stdc}" = "Xno" ; then
626
	AC_MSG_ERROR([OpenLDAP requires compiler to support STDC constructs.])
627
628
fi

629
dnl ----------------------------------------------------------------
630
dnl Check cc depend flags
Kurt Zeilenga's avatar
Kurt Zeilenga committed
631
632
633
634
635
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
636

637
638
639
640
641
642
643
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])
])

644
dnl ----------------------------------------------------------------
645
646
647
648
649
650
651
652
653
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
654
655
	AC_CHECK_LIB(ltdl, lt_dlinit, [
	    MODULES_LIBS=-lltdl
656
	    AC_DEFINE(HAVE_LIBLTDL,1,[define if you have libtool -ltdl])
Howard Chu's avatar
Howard Chu committed
657
658
	])

659
660
661
662
663
664
	if test "$ac_cv_lib_ltdl_lt_dlinit" = no ; then
		AC_MSG_ERROR([could not locate libtool -lltdl])
	fi
	ol_link_modules=yes
else
	ol_with_bdb2_module=static
665
	ol_with_dnssrv_module=static
666
667
668
669
670
671
	ol_with_ldap_module=static
	ol_with_ldbm_module=static
	ol_with_passwd_module=static
	ol_with_perl_module=static
	ol_with_shell_module=static
	ol_with_tcl_module=static
672
	ol_with_sql_module=static
673
674
fi

675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
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
695
	conio.h			\
696
	crypt.h			\
Howard Chu's avatar
Howard Chu committed
697
	direct.h		\
698
699
700
701
702
	errno.h			\
	fcntl.h			\
	filio.h			\
	getopt.h		\
	grp.h			\
Howard Chu's avatar
Howard Chu committed
703
	io.h			\
704
705
706
707
708
709
710
711
	libutil.h		\
	limits.h		\
	locale.h		\
	netinet/tcp.h	\
	malloc.h		\
	memory.h		\
	psap.h			\
	pwd.h			\
Howard Chu's avatar
Howard Chu committed
712
	process.h		\
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
	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		\
734
	winsock.h		\
735
736
)

Howard Chu's avatar
Howard Chu committed
737

738
dnl ----------------------------------------------------------------
Kurt Zeilenga's avatar
Kurt Zeilenga committed
739
740
dnl Checks for libraries

741
742
743
dnl HP-UX requires -lV3
AC_CHECK_LIB(V3, sigset)

Howard Chu's avatar
Howard Chu committed
744
dnl Gotta check for winsock manually
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
if test $ac_cv_header_winsock_h = yes; then
	AC_CACHE_CHECK([for winsock], [ol_cv_winsock], 
    	AC_TRY_LINK([#include <winsock.h>],[
			socket(0,0,0);
			select(0,NULL,NULL,NULL,NULL);
			closesocket(0);
			gethostname(NULL,0);
    	],[ol_cv_winsock=yes],[ol_cv_winsock=no])])

	if test $ol_cv_winsock = yes ; then
		AC_DEFINE(HAVE_WINSOCK,1,[define if you have winsock])
		ac_cv_func_socket=yes
		ac_cv_func_select=yes
		ac_cv_func_closesocket=yes
		ac_cv_func_gethostname=yes
	fi
Howard Chu's avatar
Howard Chu committed
761
762
fi

Kurt Zeilenga's avatar
Kurt Zeilenga committed
763
764
765
766
767
dnl Find socket()
dnl Likely combinations:
dnl		-lsocket [ -lnsl_s | -lnsl ]
dnl		-linet

Kurt Zeilenga's avatar
Kurt Zeilenga committed
768
AC_CHECK_FUNC(socket, :, [	
Kurt Zeilenga's avatar
Kurt Zeilenga committed
769
770
771
772
773
774
775
776
777
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
778
dnl require select
779
780
AC_CHECK_FUNC(select, :, AC_MSG_ERROR([select() required.]))

Howard Chu's avatar
Howard Chu committed
781
782
783
784
785
786
if test "${ac_cv_header_winsock_h}" != yes; then
    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
fi
787

788
dnl check to see if system call automatically restart
789
dnl AC_SYS_RESTARTABLE_SYSCALLS
790

791
dnl ----------------------------------------------------------------
Kurt Zeilenga's avatar
Kurt Zeilenga committed
792
dnl require POSIX regex
793
794
795
796
797
798
799
800
801
802
803
AC_CHECK_HEADERS( regex.h )
if test "$ac_cv_header_regex_h" != yes ; then
	AC_MSG_ERROR([POSIX regex.h required.])
fi
AC_CHECK_FUNC(regfree, :, AC_MSG_ERROR([POSIX regex required.]))

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

804
dnl ----------------------------------------------------------------
805
806
807
808
809
810
dnl Check for resolver routines
AC_CHECK_FUNC(res_search,:)
if test $ac_cv_func_res_search = no ; then 
	AC_CHECK_LIB(bind, res_search)
	ac_cv_func_res_search=$ac_cv_lib_bind_res_search
fi
811

812
813
814
815
if test $ac_cv_func_res_search = no ; then 
	AC_CHECK_LIB(bind, __res_search)
	ac_cv_func_res_search=$ac_cv_lib_bind___res_search
fi
Kurt Zeilenga's avatar
Kurt Zeilenga committed
816

817
818
819
820
821
822
823
824
825
826
827
828
if test $ac_cv_func_res_search = no ; then 
	AC_CHECK_LIB(resolv, res_search)
	ac_cv_func_res_search=$ac_cv_lib_resolv_res_search
fi

if test "$ac_cv_func_res_search" = yes ; then
	AC_DEFINE(HAVE_RES_SEARCH,1,
		[define if you have res_search()])
elif test $ol_enable_dns = yes ; then
	AC_MSG_ERROR([--enable-dns requires res_search])
elif test $ol_enable_dns != no ; then
	AC_MSG_WARN([no res_search, disabling DNS support])
829
fi
830

Kurt Zeilenga's avatar
Kurt Zeilenga committed
831

832
833
dnl ----------------------------------------------------------------
dnl ISODE tests
834
ol_link_isode=no
Kurt Zeilenga's avatar
Kurt Zeilenga committed
835
if test $ol_enable_ldapd != no ; then
836
	AC_MSG_WARN([ldapd is not supported and may suffer from bit rot.])
837

Kurt Zeilenga's avatar
Kurt Zeilenga committed
838
	dnl look for ISODE libraries
839
840
	AC_CHECK_LIB(xtpp, main, [
		ol_link_isode=yes
841
		AC_DEFINE(HAVE_XTPP,1, [define if you have -lxttp])
842
843
		LDAPD_LIBS="$LDAPD_LIBS -lxtpp -lxtdsap -lxtisode -losi"
		],:,[-lxtdsap -lxtisode -losi])
Kurt Zeilenga's avatar
Kurt Zeilenga committed
844
	AC_CHECK_LIB(dsap, main, [
845
		ol_link_isode=yes
846
		AC_DEFINE(HAVE_DSAP,1, [define if you have -ldsap])
Kurt Zeilenga's avatar
Kurt Zeilenga committed
847
		LDAPD_LIBS="$LDAPD_LIBS -ldsap"
848
		],:,[-lisode])
Kurt Zeilenga's avatar
Kurt Zeilenga committed
849
	AC_CHECK_LIB(isode, main, [
850
		ol_link_isode=yes
851
		AC_DEFINE(HAVE_ISODE,1, [define if you have -lisode])
Kurt Zeilenga's avatar
Kurt Zeilenga committed
852
853
854
855
		LDAPD_LIBS="$LDAPD_LIBS -lisode"
		],:)
fi

856
857
if test $ol_link_isode != no; then
	AC_CHECK_LIB(pp, main, [
858
		AC_DEFINE(HAVE_PP,1, [define if you have -lpp])
859
860
861
862
863
		LDAPD_LIBS="-lpp $LDAPD_LIBS"
		],:)

	AC_PATH_PROG(PEPSY, pepsy)
fi
Kurt Zeilenga's avatar
Kurt Zeilenga committed
864

865
866
dnl ----------------------------------------------------------------
dnl QUIPU
867
868
869
870
871
872
873
874
875
876
877
878
if test $ol_enable_quipu != no ; then
	AC_CHECK_HEADERS(quipu/commonarg.h)

	if test $ac_cv_header_quipu_commonarg_h = yes ; then
		BUILD_QUIPU=yes
	elif test $ol_enable_quipu = auto ; then
		AC_MSG_WARN([no quipu for --enable-quipu=auto, disabling])
	else
		AC_MSG_ERROR(no quipu for --enable-quipu=$ol_enable_quipu)
	fi
fi

879
880
dnl ----------------------------------------------------------------
dnl Kerberos
881
882
ol_link_kbind=no
ol_link_kpasswd=no
883
ol_link_krb5=no
884
ol_link_krb4=no
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926

if test $ol_with_kerberos = auto -o $ol_with_kerberos = k5 \
	-o $ol_with_kerberos = k5only -o $ol_with_kerberos = k425 ; then

	AC_CHECK_HEADERS(krb5.h)

	if test $ac_cv_header_krb5_h = yes ; then
		dnl lazy check for Heimdal Kerberos
		AC_CHECK_HEADERS(heim_err.h)
		if test $ac_cv_header_heim_err_h = yes ; then
			krb5_impl=heimdal
		else
			krb5_impl=mit
		fi

		if test $krb5_impl = mit; then
			AC_CHECK_LIB(krb5, main,
				[have_krb5=yes
				KRB5_LIBS="-lkrb5 -lcrypto -lcom_err"],
				[have_krb5=no],
				[-lcrypto -lcom_err])

		elif test $krb5_impl = heimdal; then
			AC_CHECK_LIB(krb5, main,
				[have_krb5=yes
				KRB5_LIBS="-lkrb5 -ldes -lasn1 -lroken -lcom_err"],
				[have_krb5=no],
				[-ldes -lasn1 -lroken -lcom_err])

			AC_DEFINE(HAVE_HEIMDAL_KERBEROS, 1,
				[define if you have HEIMDAL Kerberos])
		else
			have_krb5=no
			AC_MSG_WARN([Unrecongized Kerberos5 Implementation])
		fi

		if test $have_krb5 = yes ; then
			ol_link_krb5=yes

			AC_DEFINE(HAVE_KRB5, 1,
				[define if you have Kerberos V])

927
928
929
930
			if test $ol_enable_kpasswd != no ; then
				ol_link_kpasswd=yes;
			fi

931
932
933
934
935
936
937
938
939
940
941
942
943
			if test $ol_with_kerberos = k5only ; then
				ol_with_kerberos=found
			fi

		elif test $ol_with_kerberos != auto ; then
			AC_MSG_ERROR([Required Kerberos 5 support not available])
		fi

	fi
fi

if test $ol_link_krb5 = yes -a \
	\( $ol_with_kerberos = auto -o $ol_with_kerberos = k425 \) ; then
Kurt Zeilenga's avatar
Kurt Zeilenga committed
944

Kurt Zeilenga's avatar
Kurt Zeilenga committed
945
946
947
	AC_CHECK_HEADERS(kerberosIV/krb.h kerberosIV/des.h)

	if test $ac_cv_header_kerberosIV_krb_h = yes ; then
948
949
950
951
		if test $krb5_impl = mit; then
			AC_CHECK_LIB(krb4, main, [have_k425=yes
				KRB4_LIBS="-lkrb4 -ldes425"], [have_k425=no],
				[-ldes425 -lkrb5 -lcrypto -lcom_err])
Kurt Zeilenga's avatar
Kurt Zeilenga committed
952

953
954
955
956
		elif test $krb5_impl = heimdal; then
			AC_CHECK_LIB(krb4, main, [have_k425=yes
				KRB4_LIBS="-lkrb4"], [have_k425=no],
				[-lkrb5 -ldes -lasn1 -lroken -lcom_err])
Kurt Zeilenga's avatar
Kurt Zeilenga committed
957

958
959
960
961
962
963
964
965
		else
			have_425=no
			AC_MSG_WARN([Unrecongized Kerberos5 Implementation])
		fi

		if test $have_k425 = yes ; then
			ol_with_kerberos=found
			ol_link_krb4=yes
966

967
968
969
970
			AC_DEFINE(HAVE_KRB425, 1,
				[define if you have Kerberos V with IV support])
			AC_DEFINE(HAVE_KRB4, 1,
				[define if you have Kerberos IV])
971
972
973
974
975

			AC_CACHE_CHECK([for des_debug in Kerberos libraries],
				[ol_cv_var_des_debug], [
				dnl save the flags
				save_LIBS="$LIBS"
976
				LIBS="$KRB4_LIBS $KRB5_LIBS $LIBS"
977
978
979
980
981
982
983
984
985
986
987
				AC_TRY_LINK([
#include <kerberosIV/krb.h>
#include <kerberosIV/des.h>
extern int des_debug;
],[
des_debug = 1;
],				ol_cv_var_des_debug=yes, ol_cv_var_des_debug=no)
				dnl restore the LIBS
				LIBS="$save_LIBS"
			])

Kurt Zeilenga's avatar
Kurt Zeilenga committed
988
			if test $ol_cv_var_des_debug = yes ; then
989
990
991
992
993
				AC_DEFINE(HAVE_DES_DEBUG,1,
					[define if you have Kerberos des_debug])
			fi

			LIBS="$save_LIBS"
Kurt Zeilenga's avatar
Kurt Zeilenga committed
994
995
996
		fi
	fi
fi
Kurt Zeilenga's avatar
Kurt Zeilenga committed
997

998
999
1000
if test $ol_link_krb5 = yes ; then
	ol_with_kerberos=found
fi
For faster browsing, not all history is shown. View entire blame