-
Notifications
You must be signed in to change notification settings - Fork 101
/
configure.in
328 lines (289 loc) · 8.8 KB
/
configure.in
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
#
# $Id: configure.in,v 1.38 2008/03/05 18:02:55 cparker Exp $
#
# Copyright (C) 1996,1997 Lars Fenneberg
#
# See the file COPYRIGHT for the respective terms and conditions.
#
#
AC_INIT
AM_MAINTAINER_MODE
AC_CONFIG_SRCDIR([src/radlogin.c])
AC_CANONICAL_TARGET([])
case "$target" in
*)
;;
esac
AM_INIT_AUTOMAKE(radiusclient, 1.1.6)
LIBVERSION=2:0:0
AC_SUBST(LIBVERSION)
pkgsysconfdir=${sysconfdir}/$PACKAGE
AC_SUBST(pkgsysconfdir)
AC_PROG_LIBTOOL
AC_PROG_CC
dnl Needed for normal compile
AC_PATH_PROG(AR, ar)
AM_PROG_LIBTOOL
dnl HAVE_SHADOW_PASSWORDS
AC_MSG_CHECKING(whether to include shadow password support)
AC_ARG_ENABLE(shadow,
[ --enable-shadow Enable shadow password support],
[
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_SHADOW_PASSWORDS)
shadow_passwords=yes
],
[
AC_MSG_RESULT(no)
shadow_passwords=no
]
)
dnl Check if we need -lsocket.
AC_CHECK_LIB(socket, socket)
dnl Check if we need -lnsl. Usually if we want to
dnl link against -lsocket we need to include -lnsl as well.
AC_CHECK_LIB(nsl, gethostbyaddr)
dnl Check the style of gethostbyaddr, in order of preference
dnl GNU (_r eight args)
dnl SYSV (_r six args)
dnl BSD (three args, may not be thread safe)
dnl Tru64 has BSD version, but it is thread safe
dnl http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/V51B_HTML/MAN/MAN3/1739____.HTM
dnl We need #stdio.h to define NULL on FreeBSD (at least)
gethostbyaddrrstyle=""
AC_MSG_CHECKING([gethostbyaddr_r() syntax])
case "$host" in
*-freebsd*)
AC_DEFINE([GETHOSTBYADDR_R], [], [Define to 1 us gethostbyaddr_r()])
AC_DEFINE([GETHOSTBYADDRRSTYLE_BSD], [], [Define to 1 to use bsd-style gethostbyaddr_r()])
gethostbyaddrrstyle=BSD
AC_MSG_WARN([FreeBSD overridden to BSD-style])
;;
esac
if test "x$gethostbyaddrrstyle" = "x"; then
AC_TRY_LINK([
#include <stdio.h>
#include <netdb.h>
], [ gethostbyaddr_r(NULL, 0, 0, NULL, NULL, 0, NULL, NULL) ], [
AC_DEFINE(GETHOSTBYADDR_R)
AC_DEFINE([GETHOSTBYADDRRSTYLE_GNU], [], [Define to 1 to use gnu-style gethostbyaddr_r()])
gethostbyaddrrstyle=GNU
])
fi
if test "x$gethostbyaddrrstyle" = "x"; then
AC_TRY_LINK([
#include <stdio.h>
#include <netdb.h>
], [ gethostbyaddr_r(NULL, 0, 0, NULL, NULL, 0, NULL) ] , [
AC_DEFINE(GETHOSTBYADDR_R)
AC_DEFINE([GETHOSTBYADDRRSTYLE_SYSV], [], [Define to 1 to use sysv-style gethostbyaddr_r()])
gethostbyaddrrstyle=SYSV
])
fi
if test "x$gethostbyaddrrstyle" = "x"; then
AC_TRY_LINK([
#include <stdio.h>
#include <netdb.h>
], [ gethostbyaddr(NULL, 0, 0) ], [
AC_DEFINE(GETHOSTBYADDR_R)
AC_DEFINE(GETHOSTBYADDRRSTYLE_BSD)
gethostbyaddrrstyle=BSD
])
fi
if test "x$gethostbyaddrrstyle" = "x"; then
AC_MSG_RESULT([none! It must not exist, here.])
else
AC_MSG_RESULT([${gethostbyaddrrstyle}-style])
fi
if test "x$gethostbyaddrrstyle" = "xBSD"; then
AC_MSG_WARN([ ****** BSD-style gethostbyaddr might NOT be thread-safe! ****** ])
fi
dnl Check the style of gethostbyname, in order of preference
dnl GNU (_r seven args)
dnl SYSV (_r five args)
dnl BSD (two args, may not be thread safe)
dnl Tru64 has BSD version, but it _is_ thread safe
dnl http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/V51B_HTML/MAN/MAN3/1946____.HTM
dnl We need #stdio.h to define NULL on FreeBSD (at least)
gethostbynamerstyle=""
AC_MSG_CHECKING([gethostbyname_r() syntax])
AC_TRY_LINK([
#include <stdio.h>
#include <netdb.h>
], [ gethostbyname_r(NULL, NULL, NULL, 0, NULL, NULL) ], [
AC_DEFINE([GETHOSTBYNAME_R], [], [Define to 1 to use gethostbyname_r()])
AC_DEFINE([GETHOSTBYNAMERSTYLE_GNU], [], [Define to 1 to use gnu-style gethostbyname_r()])
gethostbynamerstyle=GNU
])
if test "x$gethostbynamerstyle" = "x"; then
AC_TRY_LINK([
#include <stdio.h>
#include <netdb.h>
], [ gethostbyname_r(NULL, NULL, NULL, 0, NULL) ] , [
AC_DEFINE(GETHOSTBYNAME_R)
AC_DEFINE([GETHOSTBYNAMERSTYLE_SYSV], [], [Define to 1 to use sysv-style gethostbyname_r()])
gethostbynamerstyle=SYSV
])
fi
if test "x$gethostbynamerstyle" = "x"; then
AC_TRY_LINK([
#include <stdio.h>
#include <netdb.h>
], [ gethostbyname(NULL) ], [
AC_DEFINE(GETHOSTBYNAME_R)
AC_DEFINE([GETHOSTBYNAMERSTYLE_BSD], [], [Define to 1 to use bsd-style gethostbyname_r()])
gethostbynamerstyle=BSD
])
fi
if test "x$gethostbynamerstyle" = "x"; then
AC_MSG_RESULT([none! It must not exist, here.])
else
AC_MSG_RESULT([${gethostbynamerstyle}-style])
fi
if test "x$gethostbynamerstyle" = "xBSD"; then
AC_MSG_WARN([ ****** BSD-style gethostbyname might NOT be thread-safe! ****** ])
fi
AC_CHECK_LIB(crypt, crypt)
dnl Checks for endianness
AC_C_BIGENDIAN
if test $ac_cv_c_bigendian = yes; then
AC_DEFINE(BIG_ENDIAN)
else
AC_DEFINE(LITTLE_ENDIAN)
fi
dnl Checks for header files.
AC_HEADER_DIRENT
AC_HEADER_STDC
AC_CHECK_HEADERS(crypt.h signal.h sys/signal.h sys/stat.h)
AC_CHECK_HEADERS(fcntl.h sys/fcntl.h)
AC_CHECK_HEADERS(sys/utsname.h getopt.h unistd.h)
AC_CHECK_HEADERS(sys/file.h termios.h sys/ioctl.h)
AC_CHECK_HEADERS(netdb.h syslog.h pwd.h)
AC_CHECK_HEADERS(sys/socket.h netinet/in.h arpa/inet.h)
if test "$shadow_passwords" = "yes"
then
AC_CHECK_HEADER(shadow.h)
fi
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_OFF_T
AC_TYPE_SIZE_T
AC_HEADER_TIME
AC_STRUCT_TM
dnl Checks for library functions.
AC_PROG_GCC_TRADITIONAL
AC_FUNC_MEMCMP
AC_FUNC_SETVBUF_REVERSED
AC_TYPE_SIGNAL
AC_FUNC_STRFTIME
AC_FUNC_ALLOCA
AC_REPLACE_FUNCS(strdup strerror strcasecmp)
AC_CHECK_FUNCS(flock fcntl uname gethostname sysinfo getdomainname)
AC_CHECK_FUNCS(stricmp random rand snprintf vsnprintf strlcpy)
if test "$ac_cv_func_uname" = 'yes' && test "$cross_compiling" = 'no'
then
AC_MSG_CHECKING([for field domainname in struct utsname])
AC_TRY_RUN([
#include <sys/utsname.h>
int main(int argc, char*argv[])
{
struct utsname uts;
uts.domainname[0] = '\0';
}
],
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_STRUCT_UTSNAME_DOMAINNAME),
AC_MSG_RESULT(no)
)
fi
AC_MSG_CHECKING([for getentropy])
AC_LINK_IFELSE([AC_LANG_PROGRAM([
#include <unistd.h>],[
getentropy(0, 0);
])],
[AC_MSG_RESULT(yes)
AC_DEFINE([HAVE_GETENTROPY], 1, [Enable the OpenBSD getentropy function])
enable_getrandom=getentropy],
[AC_MSG_RESULT(no)])
AC_MSG_CHECKING([for /dev/urandom])
if test -c /dev/urandom
then
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_DEV_URANDOM)
else
AC_MSG_RESULT(no)
fi
AC_ARG_WITH([nettle], [AS_HELP_STRING([--with-nettle],
[use nettle for crypto @<:@default=no@:>@])],
[with_nettle=$withval],
[with_nettle=no])
if test "$with_nettle" != no; then
PKG_CHECK_MODULES(NETTLE, [nettle >= 2.4], [use_nettle=yes], [use_nettle=no])
if test "$use_nettle" = yes;then
CRYPTO_CFLAGS="$NETTLE_CFLAGS"
CRYPTO_LIBS="$NETTLE_LIBS"
AC_DEFINE([HAVE_NETTLE], 1, [Define to 1 to use nettle for MD5.])
fi
fi
AM_CONDITIONAL(ENABLE_NETTLE, test "$use_nettle" = "yes")
AC_SUBST(CRYPTO_CFLAGS, [$CRYPTO_CFLAGS])
AC_SUBST(CRYPTO_LIBS, [$CRYPTO_LIBS])
dnl Determine PATH setting
echo $ac_n "using the following PATH setting for exec'ed programs... $ac_c" 1>&6
AC_ARG_WITH(secure-path,
[ --with-secure-path PATH setting for exec'ed programs],
[
AC_MSG_RESULT($withval)
RC_SECURE_PATH=$withval
],
[
AC_MSG_RESULT(/bin:/usr/bin:/usr/local/bin)
RC_SECURE_PATH=/bin:/usr/bin:/usr/local/bin
]
)
dnl Checking which syslog facility to use
AC_MSG_CHECKING(which syslog facility to use)
AC_ARG_WITH(facility,
[ --with-facility Syslog facility to use],
[
AC_MSG_RESULT($withval)
RC_LOG_FACILITY=$withval
],
[
AC_MSG_RESULT(LOG_DAEMON)
RC_LOG_FACILITY=LOG_DAEMON
]
)
AC_SUBST(RC_SECURE_PATH)
AC_SUBST(RC_LOG_FACILITY)
AH_OUTPUT([BIG_ENDIAN], [/* is big endian arch ? */
#undef BIG_ENDIAN])
AH_OUTPUT([LITTLE_ENDIAN], [/* is little endian arch ? */
#undef LITTLE_ENDIAN])
AH_OUTPUT([HAVE_DEV_URANDOM], [/* does /dev/urandom exist ? */
#undef HAVE_DEV_URANDOM])
AH_OUTPUT([HAVE_SHADOW_PASSWORDS], [/* shadow password support */
#undef HAVE_SHADOW_PASSWORDS])
AH_OUTPUT([HAVE_STRUCT_UTSNAME_DOMAINNAME], [/*struct utsname has domainname field */
#undef HAVE_STRUCT_UTSNAME_DOMAINNAME])
AH_OUTPUT([NEED_SIG_PROTOTYPES], [/* do you need the sig* prototypes ? */
#undef NEED_SIG_PROTOTYPES])
AH_OUTPUT([PACKAGE], [
#undef PACKAGE])
AH_OUTPUT([VERSION], [
#undef VERSION])
AM_CONFIG_HEADER(config.h)
dnl LTLIBOBJS=`echo "$LIB@&t@OBJS" | sed 's,\.[[^.]]* ,.lo ,g;s,\.[[^.]]*$,.lo,'`
dnl AC_SUBST(LTLIBOBJS)
AC_CONFIG_FILES([
Makefile
include/Makefile lib/Makefile src/Makefile man/Makefile etc/Makefile
doc/Makefile
login.radius/Makefile login.radius/migs/Makefile
tests/Makefile
tests/docker/Makefile
rpm/Makefile
debian/Makefile
])
AC_CONFIG_COMMANDS([default],[[test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h]],[[]])
AC_OUTPUT