summaryrefslogtreecommitdiffstats
path: root/src/include/krb5/configure.in
blob: 0c284d0da22b08027522b726f39dcd5aaf527164 (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
AC_INIT(ext-proto.h)
WITH_CCOPTS
WITH_KRB5ROOT
AC_SET_BUILDTOP
CONFIG_RULES
AC_CONFIG_HEADER(autoconf.h)
AC_PROG_LEX
AC_PROG_INSTALL
HAVE_YYLINENO
AC_FUNC_CHECK(strdup,AC_DEFINE(HAS_STRDUP))
CHECK_DIRENT
CHECK_FCNTL
CHECK_WAIT_TYPE

dnl stuff from config.h
AC_HEADER_CHECK(termios.h,AC_FUNC_CHECK([tcsetattr],AC_DEFINE(POSIX_TERMIOS)))

KRB5_POSIX_LOCKS

dnl time_t, only used in lib/krb5/os/timeofday.c
AC_EGREP_HEADER(time_t, sys/types.h, AC_DEFINE(POSIX_TYPES))


dnl AC_RETSIGTYPE isn't quite right, but almost.
AC_MSG_CHECKING([POSIX signal handlers])
AC_CACHE_VAL(krb5_cv_has_posix_signals,
[AC_TRY_COMPILE(
[#include <sys/types.h>
#include <signal.h>
#ifdef signal
#undef signal
#endif
extern void (*signal ()) ();], [],
krb5_cv_has_posix_signals=yes, krb5_cv_has_posix_signals=no)])
AC_MSG_RESULT($krb5_cv_has_posix_signals)
if test $krb5_cv_has_posix_signals = yes; then
AC_DEFINE(krb5_sigtype, void) AC_DEFINE(POSIX_SIGTYPE)
else
AC_DEFINE(krb5_sigtype, int)
fi
dnl
dnl
AC_HEADER_CHECK(string.h,AC_DEFINE(USE_STRING_H))
AC_HEADER_CHECK(stdlib.h,AC_DEFINE(HAS_STDLIB_H),AC_DEFINE(NO_STDLIB_H))
AC_CHECK_HEADERS(sys/file.h)
AC_CHECK_HEADERS(sys/param.h)
CHECK_STDARG

AC_FUNC_CHECK([setvbuf],AC_DEFINE(HAS_SETVBUF))
dnl check for ANSI stdio, esp "b" option to fopen().  This (unfortunately)
dnl requires a run check...
AC_MSG_CHECKING([for ANSI stdio])
AC_CACHE_VAL(krb5_cv_has_ansi_stdio,
[AC_TRY_RUN(
[#include <stdio.h>
int main()
{
  FILE *conftest;
  if ((conftest = fopen("conftest.dat", "w")) == NULL) exit(1);
  if (fclose(conftest)) exit(1);
  if ((conftest = fopen("conftest.dat", "rb+")) == NULL) exit(1);
  if (fputs("testing ANSI for stdio\n", conftest) == EOF) exit(1);
  exit(0);
}],
krb5_cv_has_ansi_stdio=yes, krb5_cv_has_ansi_stdio=no,
krb5_cv_has_ansi_stdio=yes)])dnl assume ANSI in cross environment
AC_MSG_RESULT($krb5_cv_has_ansi_stdio)
if test $krb5_cv_has_ansi_stdio = yes; then
AC_DEFINE(ANSI_STDIO)
fi
dnl
AC_MSG_CHECKING([prototype support])
AC_CACHE_VAL(krb5_cv_has_prototypes,
[AC_TRY_COMPILE(
[int x(double y, int z);], [],
krb5_cv_has_prototypes=yes, krb5_cv_has_prototypes=no)])
AC_MSG_RESULT($krb5_cv_has_prototypes)
if test $krb5_cv_has_prototypes = yes; then
AC_DEFINE(KRB5_PROVIDE_PROTOTYPES)
fi
dnl *never* set NARROW_PROTOTYPES

AC_MSG_CHECKING([prototypes in structs])
AC_CACHE_VAL(krb5_cv_struct_prototypes,
[AC_TRY_COMPILE(
[typedef int i_t; typedef struct foo { int (*foofn)(i_t, i_t); } *footype;],
[],
krb5_cv_struct_prototypes=yes, krb5_cv_struct_prototypes=no)])
AC_MSG_RESULT($krb5_cv_struct_prototypes)
if test $krb5_cv_struct_prototypes = no; then
AC_DEFINE(NO_NESTED_PROTOTYPES)
fi
dnl

AC_MSG_CHECKING([void])
AC_CACHE_VAL(krb5_cv_has_void_type,
[AC_TRY_COMPILE(
[void x();], [], 
krb5_cv_has_void_type=yes, krb5_cv_has_void_type=no)])
AC_MSG_RESULT($krb5_cv_has_void_type)
if test $krb5_cv_has_void_type = yes; then
AC_DEFINE(HAS_VOID_TYPE)
fi
dnl


dnl base-defs.h tries to do the same thing anyhow.
dnl HAS_ANSI_CONST is here, but -Dconst= is better...
AC_CONST
AC_DEFINE(HAS_ANSI_CONST)

AC_MSG_CHECKING([volatile])
AC_CACHE_VAL(krb5_cv_has_ansi_volatile,
[AC_TRY_COMPILE(
[volatile int x();], [],
krb5_cv_has_ansi_volatile=yes, krb5_cv_has_ansi_volatile=no)])
AC_MSG_RESULT($krb5_cv_has_ansi_volatile)
if test $krb5_cv_has_ansi_volatile = yes; then
AC_DEFINE(HAS_ANSI_VOLATILE)
fi
dnl

dnl Word sizes...
AC_CHECK_SIZEOF(short)
AC_CHECK_SIZEOF(int)
AC_CHECK_SIZEOF(long)

dnl then from osconf.h, we have
AC_TIME_WITH_SYS_TIME
AC_CHECK_HEADERS(sys/time.h)

AC_HEADER_CHECK(netinet/in.h,AC_DEFINE(KRB5_USE_INET))
AC_HEADER_CHECK(unistd.h,AC_DEFINE(HAS_UNISTD_H))

AC_CHECK_LIB(ndbm,main)
AC_CHECK_LIB(dbm,main)
AC_FUNC_CHECK([dbm_open], , AC_DEFINE(ODBM))

AC_ARG_ENABLE([athena],
[  --enable-athena         build with MIT Project Athena configuration],
AC_DEFINE(KRB5_ATHENA_COMPAT),)

AC_ARG_WITH([krb4],
[  --with-krb4=KRB4DIR     build with Kerberos V4 backwards compatibility],
AC_DEFINE(KRB5_KRB4_COMPAT),,)

V5_AC_OUTPUT_MAKEFILE