forked from FreeRADIUS/freeradius-client
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconfigure.ac
273 lines (229 loc) · 7.17 KB
/
configure.ac
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
#
# Copyright (C) 1996,1997 Lars Fenneberg
# Copyright (C) 2015 Nikos Mavrogiannopoulos
#
# See the file COPYRIGHT for the respective terms and conditions.
#
#
AC_INIT([radcli], [1.2.4], [[email protected]])
AC_CONFIG_MACRO_DIR([m4])
AC_CANONICAL_TARGET([])
AC_SUBST(MAJOR_VERSION, `echo $PACKAGE_VERSION | sed 's/\(.*\)\..*\..*/\1/g'`)
AC_SUBST(MINOR_VERSION, `echo $PACKAGE_VERSION | sed 's/.*\.\(.*\)\..*/\1/g'`)
AC_SUBST(PATCH_VERSION, [[`echo $PACKAGE_VERSION | sed 's/.*\..*\.\([0-9]*\).*/\1/g'`]])
AC_SUBST(NUMBER_VERSION, `printf "0x%02x%02x%02x" $MAJOR_VERSION $MINOR_VERSION $PATCH_VERSION`)
# Library code modified: REVISION++
# Interfaces changed/added/removed: CURRENT++ REVISION=0
# Interfaces added: AGE++
# Interfaces removed: AGE=0
V_CURRENT=5
V_REVISION=0
V_AGE=1
LIBVERSION="$V_CURRENT:$V_REVISION:$V_AGE"
LIBMAJOR=`expr $V_CURRENT - $V_AGE`
AC_SUBST(LIBVERSION)
AC_SUBST(LIBMAJOR)
AM_INIT_AUTOMAKE([1.11.3 -Wall -Wno-override])
pkgsysconfdir=${sysconfdir}/$PACKAGE
AC_SUBST(pkgsysconfdir)
PKG_PROG_PKG_CONFIG
LT_INIT([win32-dll,shared])
AC_PROG_CC
dnl Needed for normal compile
AC_PATH_PROG(AR, ar)
AC_PROG_LN_S
gl_LD_VERSION_SCRIPT
dnl HAVE_SHADOW_PASSWORDS
AC_MSG_CHECKING(whether to enable legacy library compatibility)
AC_ARG_ENABLE(legacy-compat,
[ --enable-legacy-compat Enable compatibility mode with radiusclient-ng and freeradius-client],
[
AC_MSG_RESULT(yes)
enable_compat=yes
],
[
AC_MSG_RESULT(no)
enable_compat=no
]
)
AM_CONDITIONAL(ENABLE_LEGACY_COMPAT, test "$enable_compat" = "yes")
dnl Check if we need -lsocket.
AC_CHECK_LIB(socket, socket)
dnl Checks for endianness
AC_C_BIGENDIAN
dnl Checks for header files.
AC_HEADER_DIRENT
AC_HEADER_STDC
AC_CHECK_HEADERS(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_FUNC_MEMCMP
AC_TYPE_SIGNAL
AC_FUNC_STRFTIME
AC_FUNC_ALLOCA
AC_REPLACE_FUNCS(strdup strerror strcasecmp)
AC_CHECK_FUNCS(fcntl uname gethostname sysinfo getdomainname)
AC_CHECK_FUNCS(random rand snprintf vsnprintf strlcpy)
AC_CHECK_FUNCS([pthread_mutex_lock],,)
if test "$ac_cv_func_pthread_mutex_lock" != "yes";then
AC_LIB_HAVE_LINKFLAGS(pthread,, [#include <pthread.h>], [pthread_mutex_lock (0);])
fi
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>
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
REQUIRES_PRIVATE="Requires.private: "
AC_ARG_WITH([tls], [AS_HELP_STRING([--without-tls],
[enable support for DTLS @<:@default=no@:>@])],
[with_tls=$withval],
[with_tls=yes])
default_nettle_val=yes
if test "$with_tls" != no; then
PKG_CHECK_MODULES([LIBGNUTLS], [gnutls >= 3.1.0], [use_gnutls=yes], [use_gnutls=no])
if test "$use_gnutls" = yes;then
CRYPTO_CFLAGS="$CRYPTO_CFLAGS $LIBGNUTLS_CFLAGS"
CRYPTO_LIBS="$CRYPTO_LIBS $LIBGNUTLS_LIBS"
AC_DEFINE([HAVE_GNUTLS], 1, [Define to 1 to use gnutls for TLS and DTLS.])
REQUIRES_PRIVATE="${REQUIRES_PRIVATE} gnutls,"
fi
default_nettle_val=yes
fi
AM_CONDITIONAL(ENABLE_GNUTLS, test "$use_gnutls" = "yes")
AC_ARG_WITH([nettle], [AS_HELP_STRING([--without-nettle],
[use nettle for crypto @<:@default=no@:>@])],
[with_nettle=$withval],
[with_nettle=$default_nettle_val])
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="$CRYPTO_CFLAGS $NETTLE_CFLAGS"
CRYPTO_LIBS="$CRYPTO_LIBS $NETTLE_LIBS"
AC_DEFINE([HAVE_NETTLE], 1, [Define to 1 to use nettle for MD5.])
REQUIRES_PRIVATE="${REQUIRES_PRIVATE} nettle"
fi
fi
AM_CONDITIONAL(ENABLE_NETTLE, test "$use_nettle" = "yes")
CRYPTO_LIBS="$CRYPTO_LIBS $LIBS"
AC_SUBST(CRYPTO_CFLAGS, [$CRYPTO_CFLAGS])
AC_SUBST(CRYPTO_LIBS, [$CRYPTO_LIBS])
AC_SUBST(REQUIRES_PRIVATE)
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
]
)
dnl SCP
AC_MSG_CHECKING(whether to add service type hints derived from username prefix)
AC_ARG_ENABLE(scp,
[ --enable-scp Add service type hints derived from username prefix],
[
AC_MSG_RESULT(yes)
AC_DEFINE(SCP)
],
[
AC_MSG_RESULT(no)
]
)
AC_SUBST(RC_SECURE_PATH)
AC_SUBST(RC_LOG_FACILITY)
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([RADIUS_116], [/* include code to kludge aroung Livingston RADIUS server 1.16 */
#undef RADIUS_116])
AH_OUTPUT([SCP], [/* SCP support */
#undef SCP])
AH_OUTPUT([PACKAGE], [
#undef PACKAGE])
AH_OUTPUT([VERSION], [
#undef VERSION])
AC_CONFIG_HEADERS([config.h])
dnl LTLIBOBJS=`echo "$LIB@&t@OBJS" | sed 's,\.[[^.]]* ,.lo ,g;s,\.[[^.]]*$,.lo,'`
dnl AC_SUBST(LTLIBOBJS)
AC_CONFIG_FILES([
lib/radcli.pc
lib/radcli.map
Makefile
include/Makefile lib/Makefile src/Makefile man/Makefile etc/Makefile
include/radcli/version.h
doc/Makefile
doc/Doxyfile
tests/Makefile
tests/docker/Makefile
],[chmod -w lib/radcli.map lib/radcli.pc])
AC_CONFIG_COMMANDS([default],[[test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h]],[[]])
AC_OUTPUT
AC_MSG_NOTICE([Configuration:
Nettle for MD5: $with_nettle
TLS and DTLS support: $use_gnutls
freeradius-client compat: $enable_compat
])