summaryrefslogtreecommitdiffstats
path: root/crypto/heimdal/configure.in
blob: 3ef2a5913a221446d3a23bb5d8c2e6b970d66616 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
dnl Process this file with autoconf to produce a configure script.
AC_REVISION($Revision: 1.325 $)
AC_PREREQ(2.53)
#test -z "$CFLAGS" && CFLAGS="-g"
AC_INIT(Heimdal, 0.4f, heimdal-bugs@pdc.kth.se)
AC_CONFIG_SRCDIR([kuser/kinit.c])
AM_CONFIG_HEADER(include/config.h)

dnl Checks for programs.
AC_PROG_CC
AC_PROG_CPP
AC_PROG_CC_STDC

AM_INIT_AUTOMAKE

AC_PREFIX_DEFAULT(/usr/heimdal)

test "$sysconfdir" = '${prefix}/etc' && sysconfdir='/etc'
test "$localstatedir" = '${prefix}/var' && localstatedir='/var/heimdal'

AC_CANONICAL_HOST
CANONICAL_HOST=$host
AC_SUBST(CANONICAL_HOST)

AC_SYS_LARGEFILE

dnl
dnl this is needed to run the configure tests against glibc
dnl
AC_DEFINE([_GNU_SOURCE], 1,
	[Define to enable extensions on glibc-based systems such as Linux.])

AC_OBJEXT
AC_EXEEXT

dnl AC_KRB_PROG_YACC
AC_PROG_YACC
AM_PROG_LEX
dnl AC_PROG_RANLIB
AC_PROG_AWK
AC_KRB_PROG_LN_S

AC_MIPS_ABI
CC="$CC $abi"
libdir="$libdir$abilibdirext"

AC_C___ATTRIBUTE__

AC_ENABLE_SHARED(no)
AC_PROG_LIBTOOL

AC_WFLAGS(-Wall -Wmissing-prototypes -Wpointer-arith -Wbad-function-cast -Wmissing-declarations -Wnested-externs)

rk_TEST_PACKAGE(openldap,
[#include <lber.h>
#include <ldap.h>],
[-lldap -llber],,,OPENLDAP)

rk_TEST_PACKAGE(krb4,[#include <krb.h>],-lkrb,-ldes,/usr/athena, KRB4, krb4-config)

LIB_kdb=
if test "$with_krb4" != "no"; then
	save_CFLAGS="$CFLAGS"
	CFLAGS="$CFLAGS $INCLUDE_krb4"
	save_LIBS="$LIBS"
	LIBS="$LIB_krb4 $LIBS"
	EXTRA_LIB45=lib45.a
	AC_SUBST(EXTRA_LIB45)
	AC_CACHE_CHECK(for four valued krb_put_int, ac_cv_func_krb_put_int_four,
		[AC_TRY_COMPILE([#include <krb.h>],[
		char tmp[4];
		krb_put_int(17, tmp, 4, sizeof(tmp));],
		ac_cv_func_krb_put_int_four=yes,
		ac_cv_func_krb_put_int_four=no)
	])
	if test "$ac_cv_func_krb_put_int_four" = yes; then
		AC_DEFINE(HAVE_FOUR_VALUED_KRB_PUT_INT, 1,
			[define if krb_put_int takes four arguments.])
	fi
	AH_BOTTOM([#if defined(HAVE_FOUR_VALUED_KRB_PUT_INT) || !defined(KRB4)
#define KRB_PUT_INT(F, T, L, S) krb_put_int((F), (T), (L), (S))
#else
#define KRB_PUT_INT(F, T, L, S) krb_put_int((F), (T), (S))
#endif
])
	AC_CACHE_CHECK(for KRB_VERIFY_SECURE, ac_cv_func_krb_verify_secure,
		[AC_TRY_COMPILE([#include <krb.h>],[
		int x = KRB_VERIFY_SECURE],
		ac_cv_func_krb_verify_secure=yes,
		ac_cv_func_krb_verify_secure=no)
	])
	if test "$ac_cv_func_krb_verify_secure" != yes; then
		AC_DEFINE(KRB_VERIFY_SECURE, 1,
			[Define to one if your krb.h doesn't])
		AC_DEFINE(KRB_VERIFY_SECURE_FAIL, 2,
			[Define to two if your krb.h doesn't])
	fi
	AC_CACHE_CHECK(for KRB_VERIFY_NOT_SECURE,
		ac_cv_func_krb_verify_not_secure,
		[AC_TRY_COMPILE([#include <krb.h>],[
		int x = KRB_VERIFY_NOT_SECURE],
		ac_cv_func_krb_verify_not_secure=yes,
		ac_cv_func_krb_verify_not_secure=no)
	])
	if test "$ac_cv_func_krb_verify_not_secure" != yes; then
		AC_DEFINE(KRB_VERIFY_NOT_SECURE, 0,
			[Define to zero if your krb.h doesn't])
	fi
	AC_FIND_FUNC(krb_enable_debug)
	AC_FIND_FUNC(krb_disable_debug)
	AC_FIND_FUNC(krb_get_our_ip_for_realm)
	AC_FIND_FUNC(krb_kdctimeofday)
	AH_BOTTOM(
	[#ifndef HAVE_KRB_KDCTIMEOFDAY
#define krb_kdctimeofday(X) gettimeofday((X), NULL)
#endif])
	AC_FIND_FUNC(krb_get_kdc_time_diff)
	AH_BOTTOM(
	[#ifndef HAVE_KRB_GET_KDC_TIME_DIFF
#define krb_get_kdc_time_diff() (0)
#endif])
	AC_CACHE_CHECK([for KRB_SENDAUTH_VERS],
		ac_cv_func_krb_sendauth_vers,
		[AC_TRY_COMPILE([#include <krb.h>
			#include <prot.h>],[
		char *x = KRB_SENDAUTH_VERS],
		ac_cv_func_krb_sendauth_vers=yes,
		ac_cv_func_krb_sendauth_vers=no)
	])
	if test "$ac_cv_func_krb_sendauth_vers" != yes; then
		AC_DEFINE(KRB_SENDAUTH_VERS, ["AUTHV0.1"],
			[This is the krb4 sendauth version.])
	fi
	AC_CACHE_CHECK(for krb_mk_req with const arguments,
		ac_cv_func_krb_mk_req_const,
		[AC_TRY_COMPILE([#include <krb.h>
		int krb_mk_req(KTEXT a, const char *s, const char *i,
			       const char *r, int32_t checksum)
		{ return 17; }], [],
		ac_cv_func_krb_mk_req_const=yes,
		ac_cv_func_krb_mk_req_const=no)
	])
	if test "$ac_cv_func_krb_mk_req_const" = "yes"; then
		AC_DEFINE(KRB_MK_REQ_CONST, 1,
			[Define if krb_mk_req takes const char *])
	fi

	LIBS="$save_LIBS"
	CFLAGS="$save_CFLAGS"
	LIB_kdb="-lkdb -lkrb"
fi
AM_CONDITIONAL(KRB4, test "$with_krb4" != "no")
AM_CONDITIONAL(KRB5, true)
AM_CONDITIONAL(do_roken_rename, true)

AC_DEFINE(KRB5, 1, [Enable Kerberos 5 support in applications.])dnl
AC_SUBST(LIB_kdb)dnl

KRB_CRYPTO

AC_ARG_ENABLE(dce, 
	AC_HELP_STRING([--enable-dce],[if you want support for DCE/DFS PAG's]))
if test "$enable_dce" = yes; then
    AC_DEFINE(DCE, 1, [Define if you want support for DCE/DFS PAG's.])
fi
AM_CONDITIONAL(DCE, test "$enable_dce" = yes)

## XXX quite horrible:
if test -f /etc/ibmcxx.cfg; then
	dpagaix_ldadd=`sed -n '/^xlc_r4/,/^$/p' /etc/ibmcxx.cfg | sed -n -e '/libraries/{;s/^[[^=]]*=\(.*\)/\1/;s/,/ /gp;}'`
	dpagaix_cflags=`sed -n '/^xlc_r4/,/^$/p' /etc/ibmcxx.cfg | sed -n -e '/options/{;s/^[[^=]]*=\(.*\)/\1/;s/-q[^,]*//;s/,/ /gp;}'`
	dpagaix_ldflags=
else
	dpagaix_cflags="-D_THREAD_SAFE -D_AIX_PTHREADS_D7 -D_AIX32_THREADS=1 -D_AES_SOURCE -D_AIX41 -I/usr/include/dce"
	dpagaix_ldadd="-L/usr/lib/threads -ldcelibc_r -ldcepthreads -lpthreads_compat lpthreads -lc_r"
	dpagaix_ldflags="-Wl,-bI:dfspag.exp"
fi
AC_SUBST(dpagaix_cflags)
AC_SUBST(dpagaix_ldadd)
AC_SUBST(dpagaix_ldflags)

rk_DB

dnl AC_ROKEN(10,[/usr/heimdal /usr/athena],[lib/roken],[$(top_builddir)/lib/roken/libroken.la],[-I$(top_builddir)/lib/roken -I$(top_srcdir)/lib/roken])

rk_ROKEN(lib/roken)
LIB_roken="\$(top_builddir)/lib/vers/libvers.la $LIB_roken"

rk_OTP

AC_CHECK_OSFC2

AC_ARG_ENABLE(mmap,
	AC_HELP_STRING([--disable-mmap],[disable use of mmap]))
if test "$enable_mmap" = "no"; then
	AC_DEFINE(NO_MMAP, 1, [Define if you don't want to use mmap.])
fi

rk_CHECK_MAN

rk_TEST_PACKAGE(readline,
[#include <stdio.h>
 #include <readline.h>],-lreadline,,, READLINE)

rk_TEST_PACKAGE(hesiod,[#include <hesiod.h>],-lhesiod,,, HESIOD)

KRB_C_BIGENDIAN
AC_C_INLINE

rk_AIX
rk_IRIX
rk_SUNOS

KRB_CHECK_X

AM_CONDITIONAL(HAVE_X, test "$no_x" != yes)

AC_CHECK_XAU

dnl AM_C_PROTOTYPES

dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_OFF_T
AC_CHECK_TYPE_EXTRA(mode_t, unsigned short, [])
AC_CHECK_TYPE_EXTRA(sig_atomic_t, int, [#include <signal.h>])
AC_HAVE_TYPE([long long])
AC_HEADER_TIME
AC_STRUCT_TM

dnl Checks for header files.
AC_HEADER_STDC

AC_CHECK_HEADERS([\
	arpa/ftp.h				\
	arpa/telnet.h				\
	bind/bitypes.h				\
	bsdsetjmp.h				\
	curses.h				\
	dlfcn.h					\
	fnmatch.h				\
	inttypes.h				\
	io.h					\
	libutil.h				\
	limits.h				\
	maillock.h				\
	netgroup.h				\
	netinet/in6_machtypes.h			\
	netinfo/ni.h				\
	pthread.h				\
	pty.h					\
	sac.h					\
	security/pam_modules.h			\
	sgtty.h					\
	siad.h					\
	signal.h				\
	stropts.h				\
	sys/bitypes.h				\
	sys/category.h				\
	sys/file.h				\
	sys/filio.h				\
	sys/ioccom.h				\
	sys/mman.h				\
	sys/pty.h				\
	sys/ptyio.h				\
	sys/ptyvar.h				\
	sys/select.h				\
	sys/str_tty.h				\
	sys/stream.h				\
	sys/stropts.h				\
	sys/strtty.h				\
	sys/syscall.h				\
	sys/termio.h				\
	sys/timeb.h				\
	sys/times.h				\
	sys/un.h				\
	term.h					\
	termcap.h				\
	termio.h				\
	time.h					\
	tmpdir.h				\
	udb.h					\
	utmp.h					\
	utmpx.h					\
])

AC_ARG_ENABLE(netinfo,
	AC_HELP_STRING([--enable-netinfo],[enable netinfo for configuration lookup]))

if test "$ac_cv_header_netinfo_ni_h" = yes -a "$enable_netinfo" = yes; then
       AC_DEFINE(HAVE_NETINFO, 1,
               [Define if you want to use Netinfo instead of krb5.conf.])
fi

dnl Checks for libraries.

AC_FIND_FUNC_NO_LIBS(logwtmp, util)
AC_FIND_FUNC_NO_LIBS(logout, util)
AC_FIND_FUNC_NO_LIBS(openpty, util)
AC_FIND_FUNC_NO_LIBS(tgetent, termcap ncurses curses)

dnl Checks for library functions.

AC_CHECK_FUNCS([				\
	_getpty					\
	_scrsize				\
	fcntl					\
	grantpt					\
	mktime					\
	ptsname					\
	rand					\
	revoke					\
	select					\
	setitimer				\
	setpcred				\
	setpgid					\
	setproctitle				\
	setregid				\
	setresgid				\
	setresuid				\
	setreuid				\
	setsid					\
	setutent				\
	sigaction				\
	strstr					\
	timegm					\
	ttyname					\
	ttyslot					\
	umask					\
	unlockpt				\
	vhangup					\
	yp_get_default_domain			\
])

AC_FUNC_MMAP

KRB_CAPABILITIES

AC_CHECK_GETPWNAM_R_POSIX

dnl Cray stuff
AC_CHECK_FUNCS(getudbnam setlim)

dnl AC_KRB_FUNC_GETCWD_BROKEN

dnl
dnl Check for fields in struct utmp
dnl

AC_HAVE_STRUCT_FIELD(struct utmp, ut_addr, [#include <utmp.h>])
AC_HAVE_STRUCT_FIELD(struct utmp, ut_host, [#include <utmp.h>])
AC_HAVE_STRUCT_FIELD(struct utmp, ut_id, [#include <utmp.h>])
AC_HAVE_STRUCT_FIELD(struct utmp, ut_pid, [#include <utmp.h>])
AC_HAVE_STRUCT_FIELD(struct utmp, ut_type, [#include <utmp.h>])
AC_HAVE_STRUCT_FIELD(struct utmp, ut_user, [#include <utmp.h>])
AC_HAVE_STRUCT_FIELD(struct utmpx, ut_exit, [#include <utmpx.h>])
AC_HAVE_STRUCT_FIELD(struct utmpx, ut_syslen, [#include <utmpx.h>])

AC_CHECK_TYPES([int8_t, int16_t, int32_t, int64_t, 
	u_int8_t, u_int16_t, u_int32_t, u_int64_t,
	uint8_t, uint16_t, uint32_t, uint64_t],,,[
#ifdef HAVE_INTTYPES_H
#include <inttypes.h>
#endif
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#ifdef HAVE_SYS_BITYPES_H
#include <sys/bitypes.h>
#endif
#ifdef HAVE_BIND_BITYPES_H
#include <bind/bitypes.h>
#endif
#ifdef HAVE_NETINET_IN6_MACHTYPES_H
#include <netinet/in6_machtypes.h>
#endif
])

KRB_READLINE

rk_TELNET

dnl Some operating systems already have com_err and compile_et
CHECK_COMPILE_ET

rk_AUTH_MODULES([sia afskauthlib])

rk_DESTDIRS

LTLIBOBJS=`echo "$LIB@&t@OBJS" |
	sed 's,\.[[^.]]* ,.lo ,g;s,\.[[^.]]*$,.lo,'`
AC_SUBST(LTLIBOBJS)

AH_BOTTOM([#ifdef ROKEN_RENAME
#include "roken_rename.h"
#endif])

AC_CONFIG_FILES(Makefile 		\
	include/Makefile		\
	include/kadm5/Makefile		\
	lib/Makefile			\
	lib/45/Makefile			\
	lib/auth/Makefile		\
	lib/auth/afskauthlib/Makefile	\
	lib/auth/pam/Makefile		\
	lib/auth/sia/Makefile		\
	lib/asn1/Makefile		\
	lib/com_err/Makefile		\
	lib/des/Makefile		\
	lib/editline/Makefile		\
	lib/gssapi/Makefile		\
	lib/hdb/Makefile		\
	lib/kadm5/Makefile		\
	lib/kafs/Makefile		\
	lib/kdfs/Makefile		\
	lib/krb5/Makefile		\
	lib/otp/Makefile		\
	lib/roken/Makefile		\
	lib/sl/Makefile			\
	lib/vers/Makefile		\
	kuser/Makefile			\
	kpasswd/Makefile		\
	kadmin/Makefile			\
	admin/Makefile			\
	kdc/Makefile			\
	appl/Makefile			\
	appl/afsutil/Makefile		\
	appl/ftp/Makefile		\
	appl/ftp/common/Makefile	\
	appl/ftp/ftp/Makefile		\
	appl/ftp/ftpd/Makefile		\
	appl/kx/Makefile		\
	appl/login/Makefile		\
	appl/otp/Makefile		\
	appl/popper/Makefile		\
	appl/push/Makefile		\
	appl/rsh/Makefile		\
	appl/rcp/Makefile		\
	appl/su/Makefile		\
	appl/xnlock/Makefile		\
	appl/telnet/Makefile		\
	appl/telnet/libtelnet/Makefile	\
	appl/telnet/telnet/Makefile	\
	appl/telnet/telnetd/Makefile	\
	appl/test/Makefile		\
	appl/kf/Makefile		\
	appl/dceutils/Makefile		\
	doc/Makefile			\
	tools/Makefile			\
)

AC_OUTPUT

dnl
dnl This is the release version name-number[beta]
dnl

cat > include/newversion.h.in <<EOF
const char *heimdal_long_version = "@([#])\$Version: $PACKAGE_STRING by @USER@ on @HOST@ ($host) @DATE@ \$";
const char *heimdal_version = "AC_PACKAGE_STRING";
EOF

if test -f include/version.h && cmp -s include/newversion.h.in include/version.h.in; then
	echo "include/version.h is unchanged"
	rm -f include/newversion.h.in
else
 	echo "creating include/version.h"
 	User=${USER-${LOGNAME}}
 	Host=`(hostname || uname -n || echo unknown) 2>/dev/null | sed 1q`
 	Date=`date`
	mv -f include/newversion.h.in include/version.h.in
	sed -e "s/@USER@/$User/" -e "s/@HOST@/$Host/" -e "s/@DATE@/$Date/" include/version.h.in > include/version.h
fi
OpenPOWER on IntegriCloud