]> git.ipfire.org Git - thirdparty/dhcp.git/blame - configure.ac
In Solaris 11 switch to using sockets instead of DLPI, thanks
[thirdparty/dhcp.git] / configure.ac
CommitLineData
05ae2d15 1AC_INIT([DHCP], [4.2.0], [dhcp-users@isc.org])
fe5b0fdd
DH
2
3# we specify "foreign" to avoid having to have the GNU mandated files,
4# like AUTHORS, COPYING, and such
5AM_INIT_AUTOMAKE([foreign])
6
06eb8bab
SK
7# We want to turn on warnings if we are using gcc and the user did
8# not specify CFLAGS. The autoconf check for the C compiler sets the
9# CFLAGS if gcc is used, so we will save it before we run that check.
10SAVE_CFLAGS="$CFLAGS"
11
12# Now find our C compiler.
fe5b0fdd 13AC_PROG_CC
06eb8bab 14
159c89d7
EH
15# Suppress warnings about --datarootdir
16AC_DEFUN([AC_DATAROOTDIR_CHECKED])
17
06eb8bab
SK
18# If we have gcc, and AC_PROG_CC changed the flags, then we know the
19# user did not specify any flags. Add warnings in this case.
20if test "$GCC" = "yes"; then
21 if test "$CFLAGS" != "$SAVE_CFLAGS"; then
eaf7eb17 22 STD_CWARNINGS="$STD_CWARNINGS -Wall -Werror -fno-strict-aliasing"
06eb8bab
SK
23 fi
24fi
25
ae566556
SR
26# POSIX doesn't include the IPv6 Advanced Socket API and glibc hides
27# parts of the IPv6 Advanced Socket API as a result. This is stupid
28# as it breaks how the two halves (Basic and Advanced) of the IPv6
29# Socket API were designed to be used but we have to live with it.
30# Use this to define _GNU_SOURCE to pull in the IPv6 Advanced Socket API.
31AC_USE_SYSTEM_EXTENSIONS
32
fe5b0fdd
DH
33AC_PROG_RANLIB
34AC_CONFIG_HEADERS([includes/config.h])
35
36# we sometimes need to know byte order for building packets
37AC_C_BIGENDIAN(AC_SUBST(byte_order, BIG_ENDIAN),
38 AC_SUBST(byte_order, LITTLE_ENDIAN))
39AC_DEFINE_UNQUOTED([DHCP_BYTE_ORDER], [$byte_order],
40 [Define to BIG_ENDIAN for MSB (Motorola or SPARC CPUs)
41 or LITTLE_ENDIAN for LSB (Intel CPUs).])
42
66cebfcb
DH
43# Optional compile-time DEBUGging.
44AC_ARG_ENABLE(debug,
45 AC_HELP_STRING([--enable-debug],
46 [create a debug-only version of the software (default is no).]))
47# This is very much off by default.
48if test "$enable_debug" = "yes" ; then
49 AC_DEFINE([DEBUG], [1],
50 [Define to compile debug-only DHCP software.])
51 # Just override CFLAGS to totally to remove optimization.
52 CFLAGS="-g"
53fi
54# XXX: there are actually quite a lot more DEBUG_ features we could enable,
55# but I don't want to pollute the --help space.
56#
57#/* #define DEBUG_TOKENS */
58#/* #define DEBUG_PACKET */
59#/* #define DEBUG_EXPRESSIONS */
60#/* #define DEBUG_FIND_LEASE */
61#/* #define DEBUG_EXPRESSION_PARSE */
62#/* #define DEBUG_CLASS_MATCHING */
63#/* #define DEBUG_MEMORY_LEAKAGE */
64#/* #define DEBUG_MALLOC_POOL */
65#/* #define DEBUG_LEASE_STATE_TRANSITIONS */
66#/* #define DEBUG_RC_HISTORY */
67#/* #define DEBUG_RC_HISTORY_EXHAUSTIVELY */
68#/* #define RC_HISTORY_MAX 10240 */
69#/* #define POINTER_DEBUG */
70#/* #define DEBUG_FAILOVER_MESSAGES */
71#/* #define DEBUG_FAILOVER_TIMING */
72#/* #define DEBUG_DUMP_ALL_LEASES */
73
74# Failover optional compile-time feature.
75AC_ARG_ENABLE(failover,
76 AC_HELP_STRING([--enable-failover],
77 [enable support for failover (default is yes)]))
78# Failover is on by default, so define if it is not explicitly disabled.
79if test "$enable_failover" != "no"; then
80 AC_DEFINE([FAILOVER_PROTOCOL], [1],
81 [Define to include Failover Protocol support.])
82fi
83
84# execute() support.
85AC_ARG_ENABLE(execute,
86 AC_HELP_STRING([--enable-execute],
87 [enable support for execute() in config (default is yes)]))
88# execute() is on by default, so define if it is not explicitly disabled.
89if test "$enable_execute" != "no" ; then
90 AC_DEFINE([ENABLE_EXECUTE], [1],
91 [Define to include execute() config language support.])
92fi
93
94# Server tracing support.
95AC_ARG_ENABLE(tracing,
96 AC_HELP_STRING([--enable-tracing],
97 [enable support for server activity tracing (default is yes)]))
98# tracing is on by default, so define if it is not explicitly disabled.
99if test "$enable_tracing" != "no" ; then
100 AC_DEFINE([TRACING], [1],
101 [Define to include server activity tracing support.])
102fi
103
fbcee149
DH
104# Delayed-ack feature support (experimental).
105AC_ARG_ENABLE(delayed_ack,
106 AC_HELP_STRING([--enable-delayed-ack],
107 [queues multiple DHCPACK replies (default is no)]))
108if test "$enable_delayed_ack" = "yes"; then
109 AC_DEFINE([DELAYED_ACK], [1],
110 [Define to queue multiple DHCPACK replies per fsync.])
111fi
112
66cebfcb 113# DHCPv6 optional compile-time feature.
fe5b0fdd
DH
114AC_ARG_ENABLE(dhcpv6,
115 AC_HELP_STRING([--enable-dhcpv6],
d00d373a 116 [enable support for DHCPv6 (default is yes)]))
66cebfcb 117# DHCPv6 is on by default, so define if it is not explicitly disabled.
d00d373a 118if test "$enable_dhcpv6" != "no"; then
fe5b0fdd 119 AC_DEFINE([DHCPv6], [1],
d00d373a
SK
120 [Define to 1 to include DHCPv6 support.])
121fi
fe5b0fdd 122
63971a83
DH
123# PARANOIA is off by default (until we can test it with all features)
124AC_ARG_ENABLE(paranoia,
125 AC_HELP_STRING([--enable-paranoia],
126 [enable support for chroot/setuid (default is no)]))
127AC_ARG_ENABLE(early_chroot,
26ef247f 128 AC_HELP_STRING([--enable-early-chroot],
63971a83
DH
129 [enable chrooting prior to configuration (default is no)]))
130# If someone enables early chroot, but does not enable paranoia, do so for
131# them.
132if test "$enable_paranoia" != "yes" && \
133 test "$enable_early_chroot" = "yes" ; then
134 enable_paranoia="yes"
135fi
136
137if test "$enable_paranoia" = "yes" ; then
138 AC_DEFINE([PARANOIA], [1],
139 [Define to any value to include Ari's PARANOIA patch.])
140fi
141if test "$enable_early_chroot" = "yes" ; then
142 AC_DEFINE([EARLY_CHROOT], [1],
143 [Define to any value to chroot() prior to loading config.])
144fi
145
7cfeb916
SR
146AC_ARG_ENABLE(IPv4_PKTINFO,
147 AC_HELP_STRING([--enable-ipv4-pktinfo],
148 [enable use of pktinfo on IPv4 sockets (default is no)]))
149
150if test "$enable_ipv4_pktinfo" = "yes"; then
151 AC_DEFINE([USE_V4_PKTINFO], [1],
152 [Define to 1 to enable IPv4 packet info support.])
153fi
154
155AC_ARG_ENABLE(USE_SOCKETS,
156 AC_HELP_STRING([--enable-use-sockets],
157 [use the standard BSD socket API (default is no)]))
158
159if test "$enable_use_sockets" = "yes"; then
160 AC_DEFINE([USE_SOCKETS], [1],
161 [Define to 1 to use the standard BSD socket API.])
162fi
163
f8b3c6f4
DH
164###
165### Path fun. Older versions of DHCP were installed in /usr/sbin, so we
166### need to look there and potentially overwrite by default (but not if
167### the user configures an alternate value). LOCALSTATEDIR is totally
168### braindead. No one uses /usr/local/var/db/ nor /usr/local/var/run, and
169### they would be insane for suggesting it. We need to look in /var/for
170### 'db' and 'state/dhcp' for db files, and /var/run for pid files by
171### default.
172###
173AC_PREFIX_PROGRAM(dhcpd)
174
175# XXX - isn't there SOME WAY to default autoconf to /var instead of
176# /usr/local/var/no/one/has/this/please/stop/trying?
177case "$localstatedir" in
178 '${prefix}/var')
179 localstatedir=/var
180 ;;
181esac
182
fe5b0fdd
DH
183# Allow specification of alternate state files
184AC_ARG_WITH(srv-lease-file,
185 AC_HELP_STRING([--with-srv-lease-file=PATH],
186 [File for dhcpd leases
187 (default is LOCALSTATEDIR/db/dhcpd.leases)]),
188 AC_DEFINE_UNQUOTED([_PATH_DHCPD_DB], ["$withval"],
189 [File for dhcpd leases.]))
f8b3c6f4
DH
190
191echo -n "checking for dhcpd.leases location..."
192if [[ "x$with_srv_lease_file" = "x" ]] ; then
193 if [[ -d "${localstatedir}/db" ]] ; then
194 with_srv_lease_file="${localstatedir}/db/dhcpd.leases"
195 elif [[ -d "${localstatedir}/state" ]] ; then
196 if [[ -d "${localstatedir}/state/dhcp" ]] ; then
197 with_srv_lease_file="${localstatedir}/state/dhcp/dhcpd.leases"
198 else
199 with_srv_lease_file="${localstatedir}/state/dhcpd.leases"
200 fi
201 elif [[ -d "${localstatedir}/lib" ]] ; then
202 if [[ -d "${localstatedir}/lib/dhcp" ]] ; then
203 with_srv_lease_file="${localstatedir}/lib/dhcp/dhcpd.leases"
204 else
205 with_srv_lease_file="${localstatedir}/lib/dhcpd.leases"
206 fi
207 elif [[ -d "${localstatedir}/etc" ]] ; then
208 with_srv_lease_file="${localstatedir}/etc/dhcpd.leases"
209 else
210 with_srv_lease_file="/etc/dhcpd.leases"
211 fi
212fi
213echo "$with_srv_lease_file"
214
8dea7ba7
FD
215AC_ARG_WITH(srv6-lease-file,
216 AC_HELP_STRING([--with-srv6-lease-file=PATH],
217 [File for dhcpd6 leases
218 (default is LOCALSTATEDIR/db/dhcpd6.leases)]),
219 AC_DEFINE_UNQUOTED([_PATH_DHCPD6_DB], ["$withval"],
220 [File for dhcpd6 leases.]))
221
222echo -n "checking for dhcpd6.leases location..."
223if [[ "x$with_srv6_lease_file" = "x" ]] ; then
224 if [[ -d "${localstatedir}/db" ]] ; then
225 with_srv6_lease_file="${localstatedir}/db/dhcpd6.leases"
226 elif [[ -d "${localstatedir}/state" ]] ; then
227 if [[ -d "${localstatedir}/state/dhcp" ]] ; then
228 with_srv6_lease_file="${localstatedir}/state/dhcp/dhcpd6.leases"
229 else
230 with_srv6_lease_file="${localstatedir}/state/dhcpd6.leases"
231 fi
232 elif [[ -d "${localstatedir}/lib" ]] ; then
233 if [[ -d "${localstatedir}/lib/dhcp" ]] ; then
234 with_srv6_lease_file="${localstatedir}/lib/dhcp/dhcpd6.leases"
235 else
236 with_srv6_lease_file="${localstatedir}/lib/dhcpd6.leases"
237 fi
238 elif [[ -d "${localstatedir}/etc" ]] ; then
239 with_srv6_lease_file="${localstatedir}/etc/dhcpd6.leases"
240 else
241 with_srv6_lease_file="/etc/dhcpd6.leases"
242 fi
243fi
244echo "$with_srv6_lease_file"
245
fe5b0fdd
DH
246AC_ARG_WITH(cli-lease-file,
247 AC_HELP_STRING([--with-cli-lease-file=PATH],
248 [File for dhclient leases
249 (default is LOCALSTATEDIR/db/dhclient.leases)]),
250 AC_DEFINE_UNQUOTED([_PATH_DHCLIENT_DB], ["$withval"],
251 [File for dhclient leases.]))
f8b3c6f4
DH
252
253echo -n "checking for dhclient.leases location..."
254if [[ "x$with_cli_lease_file" = "x" ]] ; then
255 if [[ -d "${localstatedir}/db" ]] ; then
256 with_cli_lease_file="${localstatedir}/db/dhclient.leases"
257 elif [[ -d "${localstatedir}/state" ]] ; then
258 if [[ -d "${localstatedir}/state/dhcp" ]] ; then
259 with_cli_lease_file="${localstatedir}/state/dhcp/dhclient.leases"
260 else
261 with_cli_lease_file="${localstatedir}/state/dhclient.leases"
262 fi
263 elif [[ -d "${localstatedir}/lib" ]] ; then
264 if [[ -d "${localstatedir}/lib/dhcp" ]] ; then
265 with_cli_lease_file="${localstatedir}/lib/dhcp/dhclient.leases"
266 else
267 with_cli_lease_file="${localstatedir}/lib/dhclient.leases"
268 fi
269 elif [[ -d "${localstatedir}/etc" ]] ; then
270 with_cli_lease_file="${localstatedir}/etc/dhclient.leases"
271 else
272 with_cli_lease_file="/etc/dhclient.leases"
273 fi
274fi
275echo "$with_cli_lease_file"
276
8dea7ba7
FD
277AC_ARG_WITH(cli6-lease-file,
278 AC_HELP_STRING([--with-cli6-lease-file=PATH],
279 [File for dhclient6 leases
280 (default is LOCALSTATEDIR/db/dhclient6.leases)]),
281 AC_DEFINE_UNQUOTED([_PATH_DHCLIENT6_DB], ["$withval"],
282 [File for dhclient6 leases.]))
283
284echo -n "checking for dhclient6.leases location..."
285if [[ "x$with_cli6_lease_file" = "x" ]] ; then
286 if [[ -d "${localstatedir}/db" ]] ; then
287 with_cli6_lease_file="${localstatedir}/db/dhclient6.leases"
288 elif [[ -d "${localstatedir}/state" ]] ; then
289 if [[ -d "${localstatedir}/state/dhcp" ]] ; then
290 with_cli6_lease_file="${localstatedir}/state/dhcp/dhclient6.leases"
291 else
292 with_cli6_lease_file="${localstatedir}/state/dhclient6.leases"
293 fi
294 elif [[ -d "${localstatedir}/lib" ]] ; then
295 if [[ -d "${localstatedir}/lib/dhcp" ]] ; then
296 with_cli6_lease_file="${localstatedir}/lib/dhcp/dhclient6.leases"
297 else
298 with_cli6_lease_file="${localstatedir}/lib/dhclient6.leases"
299 fi
300 elif [[ -d "${localstatedir}/etc" ]] ; then
301 with_cli6_lease_file="${localstatedir}/etc/dhclient6.leases"
302 else
303 with_cli6_lease_file="/etc/dhclient6.leases"
304 fi
305fi
306echo "$with_cli6_lease_file"
307
fe5b0fdd
DH
308AC_ARG_WITH(srv-pid-file,
309 AC_HELP_STRING([--with-srv-pid-file=PATH],
310 [File for dhcpd process information
311 (default is LOCALSTATEDIR/run/dhcpd.pid)]),
312 AC_DEFINE_UNQUOTED([_PATH_DHCPD_PID], ["$withval"],
313 [File for dhcpd process information.]))
8dea7ba7
FD
314AC_ARG_WITH(srv6-pid-file,
315 AC_HELP_STRING([--with-srv6-pid-file=PATH],
316 [File for dhcpd6 process information
317 (default is LOCALSTATEDIR/run/dhcpd6.pid)]),
318 AC_DEFINE_UNQUOTED([_PATH_DHCPD6_PID], ["$withval"],
319 [File for dhcpd6 process information.]))
fe5b0fdd
DH
320AC_ARG_WITH(cli-pid-file,
321 AC_HELP_STRING([--with-cli-pid-file=PATH],
322 [File for dhclient process information
323 (default is LOCALSTATEDIR/run/dhclient.pid)]),
8dea7ba7 324 AC_DEFINE_UNQUOTED([_PATH_DHCLIENT_PID], ["$withval"],
fe5b0fdd 325 [File for dhclient process information.]))
8dea7ba7
FD
326AC_ARG_WITH(cli6-pid-file,
327 AC_HELP_STRING([--with-cli6-pid-file=PATH],
328 [File for dhclient6 process information
329 (default is LOCALSTATEDIR/run/dhclient6.pid)]),
330 AC_DEFINE_UNQUOTED([_PATH_DHCLIENT6_PID], ["$withval"],
331 [File for dhclient6 process information.]))
fe5b0fdd
DH
332AC_ARG_WITH(relay-pid-file,
333 AC_HELP_STRING([--with-relay-pid-file=PATH],
334 [File for dhcrelay process information
335 (default is LOCALSTATEDIR/run/dhcrelay.pid)]),
336 AC_DEFINE_UNQUOTED([_PATH_DHCRELAY_PID], ["$withval"],
337 [File for dhcrelay process information.]))
4a5bfeac
SR
338AC_ARG_WITH(relay6-pid-file,
339 AC_HELP_STRING([--with-relay6-pid-file=PATH],
340 [File for dhcrelay6 process information
341 (default is LOCALSTATEDIR/run/dhcrelay6.pid)]),
342 AC_DEFINE_UNQUOTED([_PATH_DHCRELAY6_PID], ["$withval"],
343 [File for dhcrelay6 process information.]))
fe5b0fdd 344
cd3f0b9b
DH
345# Check basic types.
346AC_TYPE_INT8_T
347AC_TYPE_INT16_T
348AC_TYPE_INT32_T
4e0997c6 349AC_TYPE_INT64_T
cd3f0b9b
DH
350
351# Some systems need the u_intX_t types defined across.
352AC_CHECK_TYPE([u_int8_t], [], [
353 AC_TYPE_UINT8_T
354 AC_DEFINE(u_int8_t, [uint8_t], [Define a type for 8-bit unsigned
355 integers.])
356])
357AC_CHECK_TYPE([u_int16_t], [], [
358 AC_TYPE_UINT16_T
359 AC_DEFINE(u_int16_t, [uint16_t], [Define a type for 16-bit unsigned
360 integers.])
361])
362AC_CHECK_TYPE([u_int32_t], [], [
363 AC_TYPE_UINT32_T
364 AC_DEFINE(u_int32_t, [uint32_t], [Define a type for 32-bit unsigned
365 integers.])
366])
4e0997c6
SR
367AC_CHECK_TYPE([u_int64_t], [], [
368 AC_TYPE_UINT64_T
369 AC_DEFINE(u_int64_t, [uint64_t], [Define a type for 64-bit unsigned
370 integers.])
371])
cd3f0b9b 372
b8c0eda0
MA
373# see if ifaddrs.h is available
374AC_CHECK_HEADERS(ifaddrs.h)
375
fe5b0fdd 376# figure out what IPv4 interface code to use
f125dc8b
SK
377AC_CHECK_HEADERS(linux/types.h) # needed for linux/filter.h on old systems
378
379AC_CHECK_HEADER(linux/filter.h, DO_LPF=1, ,
380[
381#ifdef HAVE_LINUX_TYPES_H
382#include <linux/types.h>
383#endif
384])
385if test -n "$DO_LPF"
386then
a57df74a 387 AC_DEFINE([HAVE_LPF], [1],
f125dc8b
SK
388 [Define to 1 to use the Linux Packet Filter interface code.])
389else
390 AC_CHECK_HEADER(sys/dlpi.h, DO_DLPI=1)
391 if test -n "$DO_DLPI"
392 then
a57df74a 393 AC_DEFINE([HAVE_DLPI], [1],
f125dc8b
SK
394 [Define to 1 to use DLPI interface code.])
395 else
396 AC_CHECK_HEADER(net/bpf.h, DO_BPF=1)
397 if test -n "$DO_BPF"
398 then
a57df74a 399 AC_DEFINE([HAVE_BPF], [""],
f125dc8b
SK
400 [Define to 1 to use the
401 Berkeley Packet Filter interface code.])
402 fi
403 fi
f125dc8b 404fi
fe5b0fdd 405
8da06bb1
DH
406# SIOCGLIFCONF uses some transport structures. Trick is not all platforms
407# use the same structures. We like to use 'struct lifconf' and 'struct
408# lifreq', but we'll use these other structures if they're present. HPUX
409# does not define 'struct lifnum', but does use SIOCGLIFNUM - they use an
410# int value.
411#
412AC_MSG_CHECKING([for struct lifnum])
413AC_TRY_COMPILE(
414[ #include <sys/types.h>
cff9b78f 415 #include <sys/socket.h>
8da06bb1
DH
416 #include <net/if.h>
417],
418[ struct lifnum a;
419],
420 [AC_MSG_RESULT(yes)
421 AC_DEFINE([ISC_PLATFORM_HAVELIFNUM], [1],
422 [Define to 1 if the system has 'struct lifnum'.])],
423 [AC_MSG_RESULT(no)])
424
425AC_MSG_CHECKING([for struct if_laddrconf])
426AC_TRY_COMPILE(
427[ #include <sys/types.h>
428 #include <net/if6.h>
429],
430[ struct if_laddrconf a;
431],
432 [AC_MSG_RESULT(yes)
433 AC_DEFINE([ISC_PLATFORM_HAVEIF_LADDRCONF], [1],
434 [Define to 1 if the system has 'struct if_laddrconf'.])],
435 [AC_MSG_RESULT(no)])
436
437AC_MSG_CHECKING([for struct if_laddrreq])
438AC_TRY_LINK(
439[#include <sys/types.h>
440 #include <net/if6.h>
441],
442[ struct if_laddrreq a;
443],
444 [AC_MSG_RESULT(yes)
445 AC_DEFINE([ISC_PLATFORM_HAVEIF_LADDRREQ], [1],
446 [Define to 1 if the system has 'struct if_laddrreq'.])],
447 [AC_MSG_RESULT(no)])
448
6dd7efa2 449# Look for optional headers.
cff9b78f 450AC_CHECK_HEADERS(sys/socket.h net/if_dl.h net/if6.h regex.h)
6dd7efa2 451
fe5b0fdd
DH
452# Solaris needs some libraries for functions
453AC_SEARCH_LIBS(socket, [socket])
454AC_SEARCH_LIBS(inet_ntoa, [nsl])
455
456AC_SEARCH_LIBS(inet_aton, [socket nsl], ,
457 AC_DEFINE([NEED_INET_ATON], [1],
458 [Define to 1 if the inet_aton() function is missing.]))
459
dd328225
DH
460# Check for a standalone regex library.
461AC_SEARCH_LIBS(regcomp, [regex])
462
2394b26b
DH
463# For HP/UX we need -lipv6 for if_nametoindex, perhaps others.
464AC_SEARCH_LIBS(if_nametoindex, [ipv6])
465
fe5b0fdd
DH
466# check for /dev/random (declares HAVE_DEV_RANDOM)
467AC_CHECK_FILE(/dev/random,
468 AC_DEFINE([HAVE_DEV_RANDOM], [1],
469 [Define to 1 if you have the /dev/random file.]))
470
471# see if there is a "sa_len" field in our interface information structure
472AC_CHECK_MEMBER(struct sockaddr.sa_len,
473 AC_DEFINE([HAVE_SA_LEN], [],
474 [Define to 1 if the sockaddr structure has a length field.]),
475 ,
476 [#include <sys/socket.h>])
477
76c944da
SK
478# figure out pointer size
479AC_CHECK_SIZEOF(struct iaddr *, , [
480#include "includes/inet.h"
481#include <stdio.h>
482])
483
847e7000
SK
484# Solaris does not have the msg_control or msg_controlen members in
485# in the msghdr structure unless you define:
486#
487# _XOPEN_SOURCE, _XOPEN_SOURCE_EXTENDED, and __EXTENSIONS__
488#
489# See the "standards" man page for details.
490#
491# We check for the msg_control member, and if it is not found, we check
492# again with the appropriate defines added to the CFLAGS. (In order to
493# do this we have to remove the check from the cache, which is what the
494# "unset" is for.)
495AC_CHECK_MEMBER(struct msghdr.msg_control,,
496 [CFLAGS="$CFLAGS -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
497 CFLAGS="$CFLAGS -D__EXTENSIONS__"
498 unset ac_cv_member_struct_msghdr_msg_control
499 AC_CHECK_MEMBER(struct msghdr.msg_control,,
500 [AC_MSG_ERROR([Missing msg_control member in
501 msg_control structure.])],
06eb8bab
SK
502 [
503#include <sys/types.h>
504#include <sys/socket.h>
505 ])
506 ],
507 [
508#include <sys/types.h>
509#include <sys/socket.h>
510 ])
847e7000 511
93eda9ab 512libbind=
98bf1607
SR
513AC_ARG_WITH(libbind,
514 AC_HELP_STRING([--with-libbind=PATH],
515 [bind includes and libraries are in PATH
516 (default is ./bind)]),
517 use_libbind="$withval", use_libbind="no")
518case "$use_libbind" in
519yes)
520 libbind="\${top_srcdir}/bind"
521 ;;
522no)
523 libbind="\${top_srcdir}/bind"
524 ;;
525*)
526 libbind="$use_libbind"
527 ;;
528esac
529
33692791
DH
530# OpenLDAP support.
531AC_ARG_WITH(ldap,
532 AC_HELP_STRING([--with-ldap],
533 [enable OpenLDAP support in dhcpd (default is no)]),
534 [ldap=$withval],
535 [ldap=no])
536
537# OpenLDAP with SSL support.
538AC_ARG_WITH(ldapcrypto,
539 AC_HELP_STRING([--with-ldapcrypto],
540 [enable OpenLDAP crypto support in dhcpd (default is no)]),
541 [ldapcrypto=$withval],
542 [ldapcrypto=no])
543
544# OpenLDAP support is disabled by default, if enabled then SSL support is an
545# extra optional that is also disabled by default. Enabling LDAP SSL support
546# implies enabling LDAP support.
547if test x$ldap = xyes || test x$ldapcrypto = xyes ; then
548 AC_SEARCH_LIBS(ldap_initialize, [ldap], ,
549 AC_MSG_FAILURE([*** Cannot find ldap_initialize with -lldap - do you need to install an OpenLDAP2 Devel package?]))
8a0d9ca4
SR
550 AC_SEARCH_LIBS(ber_pvt_opt_on, [lber], ,
551 AC_MSG_FAILURE([*** Cannot find ber_pvt_opt_on with -llber - do you need to install an OpenLDAP2 Devel package?]))
33692791
DH
552
553 if test x$ldapcrypto = xyes ; then
554 AC_SUBST(LDAP_CFLAGS, ["-DLDAP_CONFIGURATION -DLDAP_USE_SSL"])
555 else
556 AC_SUBST(LDAP_CFLAGS, ["-DLDAP_CONFIGURATION"])
557 fi
558fi
559
eaf7eb17
DH
560# Append selected warning levels to CFLAGS before substitution (but after
561# AC_TRY_COMPILE & etc).
562CFLAGS="$CFLAGS $STD_CWARNINGS"
563
98bf1607
SR
564# Try to add the bind include directory
565CFLAGS="$CFLAGS -I$libbind/include"
566
a3528574
SR
567AC_C_FLEXIBLE_ARRAY_MEMBER
568
6ecda39c 569AC_OUTPUT([
fe5b0fdd
DH
570 Makefile
571 client/Makefile
572 common/Makefile
6e999c3c 573 common/tests/Makefile
fe5b0fdd
DH
574 dhcpctl/Makefile
575 dst/Makefile
576 includes/Makefile
fe5b0fdd
DH
577 omapip/Makefile
578 relay/Makefile
579 server/Makefile
6e999c3c 580 tests/Makefile
6ecda39c 581])
fe5b0fdd 582
95bba8b6 583sh util/bindvar.sh