]> git.ipfire.org Git - thirdparty/dhcp.git/blame - configure.ac-base
generated files update
[thirdparty/dhcp.git] / configure.ac-base
CommitLineData
c9aec7ef 1AC_INIT([DHCP],[4.4.3],[dhcp-users@isc.org])
13e5cc6c
FD
2
3@BEGIN WITH LIBTOOL
4# for libtool
5AC_CONFIG_MACRO_DIR([m4])
6@END WITH LIBTOOL
7
8# we specify "foreign" to avoid having to have the GNU mandated files,
9# like AUTHORS, COPYING, and such
bf6f8fce 10AM_INIT_AUTOMAKE([foreign])
13e5cc6c
FD
11
12# we specify AM_MAINTAINER_MODE to avoid problems with rebuilding
13# the configure and makefiles. Without it users doing things that
14# change the timestamps on the code, like checking it into a cvs
15# tree, could trigger a rebuild of the infrastructure files which
16# might fail if they don't have the correct tools.
17AM_MAINTAINER_MODE
18
19AC_CANONICAL_HOST
20
21# We want to turn on warnings if we are using gcc and the user did
22# not specify CFLAGS. The autoconf check for the C compiler sets the
23# CFLAGS if gcc is used, so we will save it before we run that check.
24SAVE_CFLAGS="$CFLAGS"
25
26# Now find our C compiler.
27AC_PROG_CC
28
29# Suppress warnings about --datarootdir
30AC_DEFUN([AC_DATAROOTDIR_CHECKED])
31
32# If we have gcc, and AC_PROG_CC changed the flags, then we know the
33# user did not specify any flags. Add warnings in this case.
34if test "$GCC" = "yes"; then
35 if test "$CFLAGS" != "$SAVE_CFLAGS"; then
36 STD_CWARNINGS="$STD_CWARNINGS -Wall -Werror -fno-strict-aliasing"
37 fi
38fi
39
40# We can have some flags to pass to bind configure
41BINDCONFIG=
42if test "$cross_compiling" = "yes"; then
43 BINDCONFIG="--host=$host"
44fi
45# Pass CFLAGS and co. $ac_configure_args looks like "'arg1' 'arg2' ..."
46# and as there can be a space inside an argument some magic is required.
47# This sets $1 ... $N to my_configure_args, arg1 ... argN
48eval "set my_configure_args $ac_configure_args"
49# remove my_configure_args, i.e., the guard against empty $ac_configure_args
50shift
51# iterate on arguments and copying 'arg' when it begins by an upper case
52for a
53do
54 case $a in
55 [[A-Z]]*) BINDCONFIG="$BINDCONFIG '$a'" ;;
56 esac
57done
58AC_SUBST(BINDCONFIG)
59
60# POSIX doesn't include the IPv6 Advanced Socket API and glibc hides
61# parts of the IPv6 Advanced Socket API as a result. This is stupid
62# as it breaks how the two halves (Basic and Advanced) of the IPv6
63# Socket API were designed to be used but we have to live with it.
64# Use this to define _GNU_SOURCE to pull in the IPv6 Advanced Socket API.
65AC_USE_SYSTEM_EXTENSIONS
66
d113bc2c 67@BEGIN WITHOUT LIBTOOL
13e5cc6c 68AC_PROG_RANLIB
d113bc2c 69@END WITHOUT LIBTOOL
13e5cc6c
FD
70
71AC_PATH_PROG(AR, ar)
72AC_SUBST(AR)
73
74if test "X$AR" = "X"; then
75 AC_MSG_ERROR([
76ar program not found. Please fix your PATH to include the directory in
77which ar resides, or set AR in the environment with the full path to ar.])
78fi
79
80AC_CONFIG_HEADERS([includes/config.h])
81
82# we sometimes need to know byte order for building packets
83AC_C_BIGENDIAN(AC_SUBST(byte_order, BIG_ENDIAN),
84 AC_SUBST(byte_order, LITTLE_ENDIAN))
85AC_DEFINE_UNQUOTED([DHCP_BYTE_ORDER], [$byte_order],
86 [Define to BIG_ENDIAN for MSB (Motorola or SPARC CPUs)
87 or LITTLE_ENDIAN for LSB (Intel CPUs).])
88
89# Optional compile-time DEBUGging.
90AC_ARG_ENABLE(debug,
91 AS_HELP_STRING([--enable-debug],[create a debug-only version of the software (default is no).]),
92 [case "${enableval}" in
93 yes) enable_debug=yes
94 AC_DEFINE([DEBUG], [1],
95 [Define to compile debug-only DHCP software.])
96 # Just override CFLAGS totally to remove optimization.
97 CFLAGS="-g";;
98 no) enable_debug=no ;;
99 *) AC_MSG_ERROR([bad value ${enableval} for --enable-debug]) ;;
100 esac],[enable_debug=no])
101
102# XXX: there are actually quite a lot more DEBUG_ features we could enable,
103# but I don't want to pollute the --help space.
104#
105#/* #define DEBUG_TOKENS */
106#/* #define DEBUG_PACKET */
107#/* #define DEBUG_EXPRESSIONS */
108#/* #define DEBUG_FIND_LEASE */
109#/* #define DEBUG_EXPRESSION_PARSE */
110#/* #define DEBUG_CLASS_MATCHING */
111#/* #define DEBUG_MEMORY_LEAKAGE */
112#/* #define DEBUG_MALLOC_POOL */
113#/* #define DEBUG_LEASE_STATE_TRANSITIONS */
114#/* #define DEBUG_RC_HISTORY */
115#/* #define DEBUG_RC_HISTORY_EXHAUSTIVELY */
116#/* #define RC_HISTORY_MAX 10240 */
117#/* #define POINTER_DEBUG */
118#/* #define DEBUG_FAILOVER_MESSAGES */
119#/* #define DEBUG_FAILOVER_TIMING */
120#/* #define DEBUG_DUMP_ALL_LEASES */
121
122# Failover optional compile-time feature.
123AC_ARG_ENABLE(failover,
124 AS_HELP_STRING([--enable-failover],[enable support for failover (default is yes)]))
125# Failover is on by default, so define if it is not explicitly disabled.
126if test "$enable_failover" != "no"; then
127 enable_failover="yes"
128 AC_DEFINE([FAILOVER_PROTOCOL], [1],
129 [Define to include Failover Protocol support.])
130fi
131
132# execute() support.
133AC_ARG_ENABLE(execute,
134 AS_HELP_STRING([--enable-execute],[enable support for execute() in config (default is yes)]))
135# execute() is on by default, so define if it is not explicitly disabled.
136if test "$enable_execute" != "no" ; then
137 enable_execute="yes"
138 AC_DEFINE([ENABLE_EXECUTE], [1],
139 [Define to include execute() config language support.])
140fi
141
142# Server tracing support.
143AC_ARG_ENABLE(tracing,
144 AS_HELP_STRING([--enable-tracing],[enable support for server activity tracing (default is yes)]))
145# tracing is on by default, so define if it is not explicitly disabled.
146if test "$enable_tracing" != "no" ; then
147 AC_DEFINE([TRACING], [1],
148 [Define to include server activity tracing support.])
149fi
150
4406f9b0 151# Delayed-ack feature support.
13e5cc6c 152AC_ARG_ENABLE(delayed_ack,
4406f9b0
TM
153 AS_HELP_STRING([--enable-delayed-ack],[queues multiple DHCPACK replies (default is yes)]))
154if test "$enable_delayed_ack" != "no"; then
155 enable_delayed_ack="yes"
13e5cc6c
FD
156 AC_DEFINE([DELAYED_ACK], [1],
157 [Define to queue multiple DHCPACK replies per fsync.])
13e5cc6c
FD
158fi
159
160# DHCPv6 optional compile-time feature.
161AC_ARG_ENABLE(dhcpv6,
162 AS_HELP_STRING([--enable-dhcpv6],[enable support for DHCPv6 (default is yes)]))
163# DHCPv6 is on by default, so define if it is not explicitly disabled.
164if test "$enable_dhcpv6" != "no"; then
165 enable_dhcpv6="yes"
166 AC_DEFINE([DHCPv6], [1],
167 [Define to 1 to include DHCPv6 support.])
168fi
169
170# DHCPv4o6 optional compile-time feature.
171AC_ARG_ENABLE(dhcpv4o6,
172 AS_HELP_STRING([--enable-dhcpv4o6],[enable support for DHCPv4-over-DHCPv6 (default is no)]))
173# DHCPv4o6 is off by default, so define if it is explicitly enabled.
174if test "$enable_dhcpv4o6" = "yes"; then
175 # DHCPv4o6 requires DHCPv6
176 if test "$enable_dhcpv6" = "no"; then
177 AC_MSG_ERROR([dhcpv4o6 requires dhcpv6])
178 fi
c9aec7ef 179 AC_DEFINE([DHCP4o6], [1],
13e5cc6c 180 [Define to 1 to include DHCPv4 over DHCPv6 support.])
4406f9b0
TM
181else
182 # so we can report below
183 enable_dhcpv4o6="no"
13e5cc6c
FD
184fi
185
563f0b8a
FD
186# Relay port (draft-ietf-dhc-relay-port-10.txt) optional compile-time feature.
187AC_ARG_ENABLE(relay-port,
188 AS_HELP_STRING([--enable-relay-port],[enable support for relay port (default is no)]))
189# Relay port is off by default (for now)
190if test "$enable_relay_port" = "yes"; then
191 AC_DEFINE([RELAY_PORT], [1],
192 [Define to 1 to include relay port support.])
2f1fd274 193else
66248390 194 # so we can report below
e985472a 195 enable_relay_port="no"
563f0b8a
FD
196fi
197
13e5cc6c
FD
198# PARANOIA is off by default (until we can test it with all features)
199AC_ARG_ENABLE(paranoia,
200 AS_HELP_STRING([--enable-paranoia],[enable support for chroot/setuid (default is no)]))
201AC_ARG_ENABLE(early_chroot,
202 AS_HELP_STRING([--enable-early-chroot],[enable chrooting prior to configuration (default is no)]))
203# If someone enables early chroot, but does not enable paranoia, do so for
204# them.
205if test "$enable_paranoia" != "yes" && \
206 test "$enable_early_chroot" = "yes" ; then
207 enable_paranoia="yes"
208fi
209
210if test "$enable_paranoia" = "yes" ; then
211 AC_DEFINE([PARANOIA], [1],
212 [Define to any value to include Ari's PARANOIA patch.])
213fi
214if test "$enable_early_chroot" = "yes" ; then
215 AC_DEFINE([EARLY_CHROOT], [1],
216 [Define to any value to chroot() prior to loading config.])
217fi
218
219AC_ARG_ENABLE(ipv4_pktinfo,
220 AS_HELP_STRING([--enable-ipv4-pktinfo],[enable use of pktinfo on IPv4 sockets (default is no)]))
221
222if test "$enable_ipv4_pktinfo" = "yes"; then
223 AC_DEFINE([USE_V4_PKTINFO], [1],
224 [Define to 1 to enable IPv4 packet info support.])
225fi
226
227AC_ARG_ENABLE(use_sockets,
228 AS_HELP_STRING([--enable-use-sockets],[use the standard BSD socket API (default is no)]))
229
230if test "$enable_use_sockets" = "yes"; then
231 AC_DEFINE([USE_SOCKETS], [1],
232 [Define to 1 to use the standard BSD socket API.])
233fi
234
13e5cc6c
FD
235# Include the PID in the log messages. This is useful when there may
236# be multiple instances of a program.
237# This is off by default
238AC_ARG_ENABLE(log_pid,
239 AS_HELP_STRING([--enable-log-pid],[Include PIDs in syslog messages (default is no).]))
240if test "$enable_log_pid" = "yes" ; then
241 AC_DEFINE([USE_LOG_PID], [1],
242 [Define to include PIDs in syslog messages.])
243fi
244
245# Allow for binary search when inserting v4 leases into queues
246AC_ARG_ENABLE(binary_leases,
247 AS_HELP_STRING([--enable-binary-leases],[enable support for binary insertion of leases (default is no)]))
248# binary_leases is off by default.
249if test "$enable_binary_leases" = "yes"; then
250 AC_DEFINE([BINARY_LEASES], [1],
251 [Define to support binary insertion of leases into queues.])
252else
253 enable_binary_leases="no"
254fi
255
256# Testing section
257
bfbe0fd6 258# Bind Makefile needs to know ATF is not included.
9a2f9db5 259AM_CONDITIONAL(BIND_ATF, test "foo" = "barr")
bfbe0fd6 260
13e5cc6c
FD
261DISTCHECK_ATF_CONFIGURE_FLAG=
262atf_path="no"
263AC_ARG_WITH([atf],
4adcee93 264 AS_HELP_STRING([--with-atf=PATH],[specify location where atf was installed]),
13e5cc6c 265 [atf_path="$withval"])
4adcee93 266if test "$atf_path" != "no" ; then
13e5cc6c
FD
267 DISTCHECK_ATF_CONFIGURE_FLAG="--with-atf=$atf_path"
268 # Config path for pkg-config
269 atf_pcp=""
270 if test "$atf_path" != "yes" ; then
271 if test -f $atf_path/lib/pkgconfig/atf-c.pc ; then
272 atf_pcp=$atf_path/lib/pkgconfig
273 elif test -f $atf_path/lib64/pkgconfig/atf-c.pc ; then
274 atf_pcp=$atf_path/lib64/pkgconfig
275 fi
276 else
277 # Not specified, try some common paths
278 atf_dirs="/usr /usr/local /usr/pkg /opt /opt/local"
279 for d in $atf_dirs
280 do
281 if test -f $d/lib/pkgconfig/atf-c.pc ; then
282 atf_pcp=$d/lib/pkgconfig
283 atf_path=$d
284 elif test -f $d/lib64/pkgconfig/atf-c.pc ; then
285 atf_pcp=$d/lib64/pkgconfig
286 atf_path=$d
287 fi
288 done
289 fi
290
291 if test "$atf_pcp" = "" ; then
292 AC_MSG_ERROR([Unable to find atf files in location specified])
293 else
294 AC_CHECK_PROG([pkgcfg_found],[pkg-config],[pkg-config],[])
295 if test "$pkgcfg_found" = ""; then
296 AC_MSG_ERROR([Could not locate ATF, pkg-config not installed])
297 fi
298 ATF_CFLAGS="`PKG_CONFIG_PATH=$atf_pcp pkg-config --cflags atf-c` -DUNIT_TEST"
299 ATF_LDFLAGS="`PKG_CONFIG_PATH=$atf_pcp pkg-config --libs atf-c`"
300 if test -f $atf_pcp/atf-sh.pc ; then
301 ATF_BIN="`PKG_CONFIG_PATH=$atf_pcp pkg-config --variable=exec_prefix atf-sh`/bin"
302 else
303 # older versions don't have atf-sh, try usual place
304 ATF_BIN=$atf_path/bin
305 fi
306
6b87c7f2 307 UNITTESTS=tests
13e5cc6c
FD
308
309 AC_SUBST(ATF_CFLAGS)
310 AC_SUBST(ATF_LDFLAGS)
311 AC_SUBST(ATF_BIN)
6b87c7f2 312 AC_SUBST(UNITTESTS)
13e5cc6c
FD
313 fi
314fi
315
316AM_CONDITIONAL(HAVE_ATF, test "$atf_pcp" != "")
317AM_COND_IF([HAVE_ATF], [AC_DEFINE([HAVE_ATF], [1], [ATF framework specified?])])
318AC_SUBST(DISTCHECK_ATF_CONFIGURE_FLAG)
319
320###
321### Path fun. Older versions of DHCP were installed in /usr/sbin, so we
322### need to look there and potentially overwrite by default (but not if
323### the user configures an alternate value). LOCALSTATEDIR is totally
324### braindead. No one uses /usr/local/var/db/ nor /usr/local/var/run, and
325### they would be insane for suggesting it. We need to look in /var/for
326### 'db' and 'state/dhcp' for db files, and /var/run for pid files by
327### default.
328###
329AC_PREFIX_PROGRAM(dhcpd)
330
331# XXX - isn't there SOME WAY to default autoconf to /var instead of
332# /usr/local/var/no/one/has/this/please/stop/trying?
333case "$localstatedir" in
334 '${prefix}/var')
335 localstatedir=/var
336 ;;
337esac
338
c8f0b32a
MS
339# Default server configuration file.
340AC_ARG_WITH(srv-conf-file,
341 AS_HELP_STRING([--with-srv-conf-file=PATH],[Default file containing dhcpd configuration
342 (default is typically /etc/dhcpd.conf)]),
343 AC_DEFINE_UNQUOTED([_PATH_DHCPD_CONF], ["$withval"],
344 [Default file containing dhcpd configuration.]))
345
13e5cc6c
FD
346# Allow specification of alternate state files
347AC_ARG_WITH(srv-lease-file,
348 AS_HELP_STRING([--with-srv-lease-file=PATH],[File for dhcpd leases
349 (default is LOCALSTATEDIR/db/dhcpd.leases)]),
350 AC_DEFINE_UNQUOTED([_PATH_DHCPD_DB], ["$withval"],
351 [File for dhcpd leases.]))
352
353AC_MSG_CHECKING([for dhcpd.leases location])
354if [[ "x$with_srv_lease_file" = "x" ]] ; then
355 if [[ -d "${localstatedir}/db" ]] ; then
356 with_srv_lease_file="${localstatedir}/db/dhcpd.leases"
357 elif [[ -d "${localstatedir}/state" ]] ; then
358 if [[ -d "${localstatedir}/state/dhcp" ]] ; then
359 with_srv_lease_file="${localstatedir}/state/dhcp/dhcpd.leases"
360 else
361 with_srv_lease_file="${localstatedir}/state/dhcpd.leases"
362 fi
363 elif [[ -d "${localstatedir}/lib" ]] ; then
364 if [[ -d "${localstatedir}/lib/dhcp" ]] ; then
365 with_srv_lease_file="${localstatedir}/lib/dhcp/dhcpd.leases"
366 else
367 with_srv_lease_file="${localstatedir}/lib/dhcpd.leases"
368 fi
369 elif [[ -d "${localstatedir}/etc" ]] ; then
370 with_srv_lease_file="${localstatedir}/etc/dhcpd.leases"
371 else
372 with_srv_lease_file="/etc/dhcpd.leases"
373 fi
374fi
375AC_MSG_RESULT($with_srv_lease_file)
376
377AC_ARG_WITH(srv6-lease-file,
378 AS_HELP_STRING([--with-srv6-lease-file=PATH],[File for dhcpd6 leases
379 (default is LOCALSTATEDIR/db/dhcpd6.leases)]),
380 AC_DEFINE_UNQUOTED([_PATH_DHCPD6_DB], ["$withval"],
381 [File for dhcpd6 leases.]))
382
383AC_MSG_CHECKING([for dhcpd6.leases location])
384if [[ "x$with_srv6_lease_file" = "x" ]] ; then
385 if [[ -d "${localstatedir}/db" ]] ; then
386 with_srv6_lease_file="${localstatedir}/db/dhcpd6.leases"
387 elif [[ -d "${localstatedir}/state" ]] ; then
388 if [[ -d "${localstatedir}/state/dhcp" ]] ; then
389 with_srv6_lease_file="${localstatedir}/state/dhcp/dhcpd6.leases"
390 else
391 with_srv6_lease_file="${localstatedir}/state/dhcpd6.leases"
392 fi
393 elif [[ -d "${localstatedir}/lib" ]] ; then
394 if [[ -d "${localstatedir}/lib/dhcp" ]] ; then
395 with_srv6_lease_file="${localstatedir}/lib/dhcp/dhcpd6.leases"
396 else
397 with_srv6_lease_file="${localstatedir}/lib/dhcpd6.leases"
398 fi
399 elif [[ -d "${localstatedir}/etc" ]] ; then
400 with_srv6_lease_file="${localstatedir}/etc/dhcpd6.leases"
401 else
402 with_srv6_lease_file="/etc/dhcpd6.leases"
403 fi
404fi
405AC_MSG_RESULT($with_srv6_lease_file)
406
407AC_ARG_WITH(cli-lease-file,
408 AS_HELP_STRING([--with-cli-lease-file=PATH],[File for dhclient leases
409 (default is LOCALSTATEDIR/db/dhclient.leases)]),
410 AC_DEFINE_UNQUOTED([_PATH_DHCLIENT_DB], ["$withval"],
411 [File for dhclient leases.]))
412
413AC_MSG_CHECKING([for dhclient.leases location])
414if [[ "x$with_cli_lease_file" = "x" ]] ; then
415 if [[ -d "${localstatedir}/db" ]] ; then
416 with_cli_lease_file="${localstatedir}/db/dhclient.leases"
417 elif [[ -d "${localstatedir}/state" ]] ; then
418 if [[ -d "${localstatedir}/state/dhcp" ]] ; then
419 with_cli_lease_file="${localstatedir}/state/dhcp/dhclient.leases"
420 else
421 with_cli_lease_file="${localstatedir}/state/dhclient.leases"
422 fi
423 elif [[ -d "${localstatedir}/lib" ]] ; then
424 if [[ -d "${localstatedir}/lib/dhcp" ]] ; then
425 with_cli_lease_file="${localstatedir}/lib/dhcp/dhclient.leases"
426 else
427 with_cli_lease_file="${localstatedir}/lib/dhclient.leases"
428 fi
429 elif [[ -d "${localstatedir}/etc" ]] ; then
430 with_cli_lease_file="${localstatedir}/etc/dhclient.leases"
431 else
432 with_cli_lease_file="/etc/dhclient.leases"
433 fi
434fi
435AC_MSG_RESULT($with_cli_lease_file)
436
437AC_ARG_WITH(cli6-lease-file,
438 AS_HELP_STRING([--with-cli6-lease-file=PATH],[File for dhclient6 leases
439 (default is LOCALSTATEDIR/db/dhclient6.leases)]),
440 AC_DEFINE_UNQUOTED([_PATH_DHCLIENT6_DB], ["$withval"],
441 [File for dhclient6 leases.]))
442
443AC_MSG_CHECKING([for dhclient6.leases location])
444if [[ "x$with_cli6_lease_file" = "x" ]] ; then
445 if [[ -d "${localstatedir}/db" ]] ; then
446 with_cli6_lease_file="${localstatedir}/db/dhclient6.leases"
447 elif [[ -d "${localstatedir}/state" ]] ; then
448 if [[ -d "${localstatedir}/state/dhcp" ]] ; then
449 with_cli6_lease_file="${localstatedir}/state/dhcp/dhclient6.leases"
450 else
451 with_cli6_lease_file="${localstatedir}/state/dhclient6.leases"
452 fi
453 elif [[ -d "${localstatedir}/lib" ]] ; then
454 if [[ -d "${localstatedir}/lib/dhcp" ]] ; then
455 with_cli6_lease_file="${localstatedir}/lib/dhcp/dhclient6.leases"
456 else
457 with_cli6_lease_file="${localstatedir}/lib/dhclient6.leases"
458 fi
459 elif [[ -d "${localstatedir}/etc" ]] ; then
460 with_cli6_lease_file="${localstatedir}/etc/dhclient6.leases"
461 else
462 with_cli6_lease_file="/etc/dhclient6.leases"
463 fi
464fi
465AC_MSG_RESULT($with_cli6_lease_file)
466
467AC_ARG_WITH(srv-pid-file,
468 AS_HELP_STRING([--with-srv-pid-file=PATH],[File for dhcpd process information
469 (default is LOCALSTATEDIR/run/dhcpd.pid)]),
470 AC_DEFINE_UNQUOTED([_PATH_DHCPD_PID], ["$withval"],
471 [File for dhcpd process information.]))
472AC_ARG_WITH(srv6-pid-file,
473 AS_HELP_STRING([--with-srv6-pid-file=PATH],[File for dhcpd6 process information
474 (default is LOCALSTATEDIR/run/dhcpd6.pid)]),
475 AC_DEFINE_UNQUOTED([_PATH_DHCPD6_PID], ["$withval"],
476 [File for dhcpd6 process information.]))
477AC_ARG_WITH(cli-pid-file,
478 AS_HELP_STRING([--with-cli-pid-file=PATH],[File for dhclient process information
479 (default is LOCALSTATEDIR/run/dhclient.pid)]),
480 AC_DEFINE_UNQUOTED([_PATH_DHCLIENT_PID], ["$withval"],
481 [File for dhclient process information.]))
482AC_ARG_WITH(cli6-pid-file,
483 AS_HELP_STRING([--with-cli6-pid-file=PATH],[File for dhclient6 process information
484 (default is LOCALSTATEDIR/run/dhclient6.pid)]),
485 AC_DEFINE_UNQUOTED([_PATH_DHCLIENT6_PID], ["$withval"],
486 [File for dhclient6 process information.]))
487AC_ARG_WITH(relay-pid-file,
488 AS_HELP_STRING([--with-relay-pid-file=PATH],[File for dhcrelay process information
489 (default is LOCALSTATEDIR/run/dhcrelay.pid)]),
490 AC_DEFINE_UNQUOTED([_PATH_DHCRELAY_PID], ["$withval"],
491 [File for dhcrelay process information.]))
492AC_ARG_WITH(relay6-pid-file,
493 AS_HELP_STRING([--with-relay6-pid-file=PATH],[File for dhcrelay6 process information
494 (default is LOCALSTATEDIR/run/dhcrelay6.pid)]),
495 AC_DEFINE_UNQUOTED([_PATH_DHCRELAY6_PID], ["$withval"],
496 [File for dhcrelay6 process information.]))
497
498# Check basic types.
499AC_TYPE_INT8_T
500AC_TYPE_INT16_T
501AC_TYPE_INT32_T
502AC_TYPE_INT64_T
503
504# Some systems need the u_intX_t types defined across.
505AC_CHECK_TYPE([u_int8_t], [], [
506 AC_TYPE_UINT8_T
507 AC_DEFINE(u_int8_t, [uint8_t], [Define a type for 8-bit unsigned
508 integers.])
509])
510AC_CHECK_TYPE([u_int16_t], [], [
511 AC_TYPE_UINT16_T
512 AC_DEFINE(u_int16_t, [uint16_t], [Define a type for 16-bit unsigned
513 integers.])
514])
515AC_CHECK_TYPE([u_int32_t], [], [
516 AC_TYPE_UINT32_T
517 AC_DEFINE(u_int32_t, [uint32_t], [Define a type for 32-bit unsigned
518 integers.])
519])
520AC_CHECK_TYPE([u_int64_t], [], [
521 AC_TYPE_UINT64_T
522 AC_DEFINE(u_int64_t, [uint64_t], [Define a type for 64-bit unsigned
523 integers.])
524])
525
526# see if ifaddrs.h is available
527AC_CHECK_HEADERS(ifaddrs.h)
528
529# figure out what IPv4 interface code to use
530AC_CHECK_HEADERS(linux/types.h) # needed for linux/filter.h on old systems
531
563f0b8a 532relay_port_supported="no"
13e5cc6c
FD
533AC_CHECK_HEADER(linux/filter.h, DO_LPF=1, ,
534[
535#ifdef HAVE_LINUX_TYPES_H
536#include <linux/types.h>
537#endif
538])
539if test -n "$DO_LPF"
540then
541 AC_DEFINE([HAVE_LPF], [1],
542 [Define to 1 to use the Linux Packet Filter interface code.])
563f0b8a 543 relay_port_supported="yes"
13e5cc6c
FD
544else
545 AC_CHECK_HEADER(sys/dlpi.h, DO_DLPI=1)
546 if test -n "$DO_DLPI"
547 then
548 AC_DEFINE([HAVE_DLPI], [1],
549 [Define to 1 to use DLPI interface code.])
550 else
551 AC_CHECK_HEADER(net/bpf.h, DO_BPF=1)
552 if test -n "$DO_BPF"
553 then
554 AC_DEFINE([HAVE_BPF], [1],
555 [Define to 1 to use the
556 Berkeley Packet Filter interface code.])
563f0b8a 557 relay_port_supported="yes"
13e5cc6c
FD
558 fi
559 fi
560fi
561
563f0b8a
FD
562if test "$enable_relay_port" = "yes"; then
563 if test "$relay_port_supported" != "yes"; then
564 AC_MSG_ERROR([--enable-relay-port requires BPF or LPF])
565 fi
566fi
567
13e5cc6c
FD
568# SIOCGLIFCONF uses some transport structures. Trick is not all platforms
569# use the same structures. We like to use 'struct lifconf' and 'struct
570# lifreq', but we'll use these other structures if they're present. HPUX
571# does not define 'struct lifnum', but does use SIOCGLIFNUM - they use an
572# int value.
573#
574AC_MSG_CHECKING([for struct lifnum])
575AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/types.h>
576 #include <sys/socket.h>
577 #include <net/if.h>
578]], [[ struct lifnum a;
579]])],[AC_MSG_RESULT(yes)
580 AC_DEFINE([ISC_PLATFORM_HAVELIFNUM], [1],
581 [Define to 1 if the system has 'struct lifnum'.])],[AC_MSG_RESULT(no)])
582
583AC_MSG_CHECKING([for struct if_laddrconf])
584AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/types.h>
585 #include <net/if6.h>
586]], [[ struct if_laddrconf a;
587]])],[AC_MSG_RESULT(yes)
588 AC_DEFINE([ISC_PLATFORM_HAVEIF_LADDRCONF], [1],
589 [Define to 1 if the system has 'struct if_laddrconf'.])],[AC_MSG_RESULT(no)])
590
591AC_MSG_CHECKING([for struct if_laddrreq])
592AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
593 #include <net/if6.h>
594]], [[ struct if_laddrreq a;
595]])],[AC_MSG_RESULT(yes)
596 AC_DEFINE([ISC_PLATFORM_HAVEIF_LADDRREQ], [1],
597 [Define to 1 if the system has 'struct if_laddrreq'.])],[AC_MSG_RESULT(no)])
598
599#
600# check for GCC noreturn attribute
601#
602AC_MSG_CHECKING(for GCC noreturn attribute)
603AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[void foo() __attribute__((noreturn));]])],[AC_MSG_RESULT(yes)
604 AC_DEFINE([ISC_DHCP_NORETURN], [__attribute__((noreturn))],
605 [Define to the string for a noreturn attribute.])],[AC_MSG_RESULT(no)
606 AC_DEFINE([ISC_DHCP_NORETURN], [],
607 [Define to the string for a noreturn attribute.])])
608
609# Look for optional headers.
610AC_CHECK_HEADERS(sys/socket.h net/if_dl.h net/if6.h regex.h)
611
612# Solaris needs some libraries for functions
613AC_SEARCH_LIBS(socket, [socket])
614AC_SEARCH_LIBS(inet_ntoa, [nsl])
615
616AC_SEARCH_LIBS(inet_aton, [socket nsl], ,
617 AC_DEFINE([NEED_INET_ATON], [1],
618 [Define to 1 if the inet_aton() function is missing.]))
619
620# Check for a standalone regex library.
621AC_SEARCH_LIBS(regcomp, [regex])
622
623AC_CHECK_FUNCS(strlcat)
624
625# For HP/UX we need -lipv6 for if_nametoindex, perhaps others.
626AC_SEARCH_LIBS(if_nametoindex, [ipv6])
627
bf0b1863
FD
628# For some Solaris nanosleep is found by BIND in librt
629have_nanosleep="no"
630AC_CHECK_FUNC(nanosleep, have_nanosleep="yes")
631if test "$have_nanosleep" = "no"; then
632 AC_CHECK_LIB(rt, nanosleep, have_nanosleep="rt")
633fi
634if test "$have_nanosleep" = "rt"; then
635 LIBS="-lrt $LIBS"
636fi
637
1cb76d2d 638# check for /dev/random (declares ISC_PATH_RANDOMDEV)
13e5cc6c
FD
639AC_MSG_CHECKING(for random device)
640AC_ARG_WITH(randomdev,
641 AS_HELP_STRING([--with-randomdev=PATH],[Path for random device
642 (default is /dev/random)]),
643 use_randomdev="$withval", use_randomdev="unspec")
644if test "$use_randomdev" = "unspec"; then
645 if test "$cross_compiling" = "yes"; then
646 AC_MSG_RESULT(unspecified)
647 AC_MSG_ERROR([ need --with-randomdev=PATH or --with-randomdev=no])
648 fi
649 use_randomdev="/dev/random"
650elif test "$use_randomdev" = "yes"; then
651 use_randomdev="/dev/random"
652fi
653if test "$use_randomdev" = "no"; then
654 AC_MSG_RESULT(disabled)
655 BINDCONFIG="$BINDCONFIG --with-randomdev=no"
656else
657 if test "$cross_compiling" = "yes"; then
658 AC_MSG_RESULT($use_randomdev (unchecked))
659 else
660 AC_MSG_RESULT($use_randomdev)
661 AC_CHECK_FILE($use_randomdev,
c9aec7ef 662 AC_DEFINE_UNQUOTED([ISC_PATH_RANDOMDEV], ["$use_randomdev"],
1cb76d2d 663 [Define if you have the /dev/random or other configured file.]),
13e5cc6c
FD
664 AC_MSG_ERROR(cannot find $use_randomdev))
665 fi
666 BINDCONFIG="$BINDCONFIG --with-randomdev=$use_randomdev"
667fi
668
669BINDIOMUX="--disable-kqueue --disable-epoll --disable-devpoll"
670# check kqueue/epoll/devpoll alternative to select
671AC_ARG_ENABLE(kqueue,
672 AS_HELP_STRING([--enable-kqueue],[use BSD kqueue (default is no)]),
673 want_kqueue="$enableval", want_kqueue="no")
674if test "$want_kqueue" = "yes"; then
675 BINDIOMUX="--enable-kqueue"
676 AC_MSG_WARN([--enable-kqueue is not supported: it may lead to issues such as server looping])
677fi
678AC_ARG_ENABLE(epoll,
679 AS_HELP_STRING([--enable-epoll],[use Linux epoll (default is no)]),
680 want_epoll="$enableval", want_epoll="no")
681if test "$want_epoll" = "yes"; then
682 BINDIOMUX="--enable-epoll"
683 AC_MSG_WARN([--enable-epoll is not supported: it may lead to issues such as server looping])
684fi
685AC_ARG_ENABLE(devpoll,
686 AS_HELP_STRING([--enable-devpoll],[use /dev/poll (default is no)]),
687 want_devpoll="$enableval", want_devpoll="no")
688if test "$want_devpoll" = "yes"; then
689 BINDIOMUX="--enable-devpoll"
690 AC_MSG_WARN([--enable-devpoll is not supported: it may lead to issues such as server looping])
691fi
692AC_SUBST(BINDIOMUX)
693
694# general extra bind configure arguments
695AC_ARG_WITH(bind-extra-config,
696 AS_HELP_STRING([--with-bind-extra-config],[configure bind librairies
697 with some extra options (default is none)]),
698 use_xbindconfig="$withval", use_xbindconfig="")
699case "$use_xbindconfig" in
700yes|no|'')
701 ;;
702*)
703 BINDCONFIG="$BINDCONFIG $use_xbindconfig"
704 AC_MSG_WARN([Most options to bind configure are not supported when used by ISC DHCP])
705 ;;
706esac
707
708# see if there is a "sa_len" field in our interface information structure
709AC_CHECK_MEMBER(struct sockaddr.sa_len,
710 AC_DEFINE([HAVE_SA_LEN], [],
711 [Define to 1 if the sockaddr structure has a length field.]),
712 ,
713 [#include <sys/socket.h>])
714
715# figure out pointer size
716SAVE_CFLAGS="$CFLAGS"
717CFLAGS="$CFLAGS -I$srcdir"
718AC_CHECK_SIZEOF(struct iaddr *, , [
719#include "includes/inet.h"
720#include <stdio.h>
721])
722CFLAGS="$SAVE_CFLAGS"
723
724# Solaris does not have the msg_control or msg_controlen members
725# in the msghdr structure unless you define:
726#
727# _XOPEN_SOURCE, _XOPEN_SOURCE_EXTENDED, and __EXTENSIONS__
728#
729# See the "standards" man page for details.
730#
731# We check for the msg_control member, and if it is not found, we check
732# again with the appropriate defines added to the CFLAGS. (In order to
733# do this we have to remove the check from the cache, which is what the
734# "unset" is for.)
735AC_CHECK_MEMBER(struct msghdr.msg_control,,
736 [CFLAGS="$CFLAGS -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
737 CFLAGS="$CFLAGS -D__EXTENSIONS__"
738 unset ac_cv_member_struct_msghdr_msg_control
739 AC_CHECK_MEMBER(struct msghdr.msg_control,,
740 [AC_MSG_ERROR([Missing msg_control member in
741 msg_control structure.])],
742 [
743#include <sys/types.h>
744#include <sys/socket.h>
745 ])
746 ],
747 [
748#include <sys/types.h>
749#include <sys/socket.h>
750 ])
751
752AC_CHECK_MEMBER(struct tpacket_auxdata.tp_vlan_tci,
753 [AC_DEFINE([VLAN_TCI_PRESENT], [1], [tpacket_auxdata.tp_vlan_tci present])]
754 ,, [#include <linux/if_packet.h>])
755
756# bind/Makefile.in is not from automake so we need 2 variables for bind dir
757BINDSUBDIR=
758BINDDIR=
759BINDSRCDIR=
760BINDLIBIRSDIR=
761BINDLIBDNSDIR=
762BINDLIBISCCFGDIR=
763BINDLIBISCDIR=
764DISTCHECK_LIBBIND_CONFIGURE_FLAG=
765AC_ARG_WITH(libbind,
766 AS_HELP_STRING([--with-libbind=PATH],[bind includes and libraries are in PATH]),
767 use_libbind="$withval", use_libbind="no")
768case "$use_libbind" in
769yes)
770 AC_MSG_ERROR([PATH is required in --with-libbind=PATH])
771 ;;
772no)
773 BINDSUBDIR="\${top_srcdir}/bind"
774 my_abs_srcdir=`cd $srcdir && pwd`
775 BINDDIR="${my_abs_srcdir}/bind"
776 if test ! -d "$srcdir/bind"; then
777 AC_MSG_ERROR([Where to find or build bind includes and libraries must be specified])
778 fi
779 if test -d "$srcdir/bind/bind9"; then
780 BINDSRCDIR="${my_abs_srcdir}/bind/bind9"
781 else
782 if test ! -f "$srcdir/bind/version.tmp"; then
783 AC_MSG_ERROR([Cannot find $srcdir/bind/version.tmp])
784 fi
785 . "$srcdir/bind/version.tmp"
786 bindversion=${MAJORVER}.${MINORVER}.${PATCHVER}${RELEASETYPE}${RELEASEVER}
787 BINDSRCDIR="${my_abs_srcdir}/bind/bind-$bindversion"
788 fi
789 AC_CONFIG_FILES([$srcdir/bind/Makefile])
790
791 BINDLIBIRSDIR="$BINDSRCDIR/lib/irs"
792 BINDLIBDNSDIR="$BINDSRCDIR/lib/dns"
793 BINDLIBISCCFGDIR="$BINDSRCDIR/lib/isccfg"
794 BINDLIBISCDIR="$BINDSRCDIR/lib/isc"
795 ;;
796*)
797 if test ! -d "$use_libbind"; then
798 AC_MSG_ERROR([Cannot find bind directory at $use_libbind])
799 fi
6d91a86b
FD
800 if test ! -d "$use_libbind/include" -o \
801 ! -f "$use_libbind/include/isc/buffer.h"
802 then
13e5cc6c
FD
803 AC_MSG_ERROR([Cannot find bind includes at $use_libbind/include])
804 fi
6d91a86b
FD
805 if test ! -d "$use_libbind/lib" -o \
806 \( ! -f "$use_libbind/lib/libisc.a" -a \
807 ! -f "$use_libbind/lib/libisc.la" \)
808 then
13e5cc6c
FD
809 AC_MSG_ERROR([Cannot find bind libraries at $use_libbind/lib])
810 fi
811 BINDDIR="$use_libbind"
812 BINDLIBIRSDIR="$BINDDIR/lib"
813 BINDLIBDNSDIR="$BINDDIR/lib"
814 BINDLIBISCCFGDIR="$BINDDIR/lib"
c9aec7ef 815 BINDLIBISCDIR="$BINDDIR/lib"
13e5cc6c
FD
816 DISTCHECK_LIBBIND_CONFIGURE_FLAG="--with-libbind=$use_libbind"
817 ;;
818esac
819AC_SUBST(BINDSUBDIR)
820AC_SUBST(BINDDIR)
821AC_SUBST(BINDSRCDIR)
822AC_SUBST(BINDLIBIRSDIR)
823AC_SUBST(BINDLIBDNSDIR)
824AC_SUBST(BINDLIBISCCFGDIR)
825AC_SUBST(BINDLIBISCDIR)
826AC_SUBST(DISTCHECK_LIBBIND_CONFIGURE_FLAG)
827AM_CONDITIONAL(HAVE_BINDDIR, test "$use_libbind" = "no")
828
13e5cc6c
FD
829#
830# GNU libtool support
831#
832case "$build_os" in
833 sunos*)
834 # Just set the maximum command line length for sunos
835 # as it otherwise takes a exceptionally long time to
836 # work it out. Required for libtool.
837
838 lt_cv_sys_max_cmd_len=4096
839 ;;
840esac
841
842want_libtool="no"
843@BEGIN WITH LIBTOOL
844LT_INIT
845want_libtool="yes"
846@END WITH LIBTOOL
847
848BINDLT=
bf6f8fce 849DISTCHECK_LIBTOOL_CONFIGURE_FLAG=
13e5cc6c 850AC_ARG_ENABLE(libtool,
6d91a86b
FD
851 AS_HELP_STRING([--enable-libtool],
852@BEGIN WITH LIBTOOL
853[use GNU libtool for dynamic shared libraries (default is yes).]),
854@END WITH LIBTOOL
855@BEGIN WITHOUT LIBTOOL
856[use GNU libtool for dynamic shared libraries (default is no).]),
857@END WITHOUT LIBTOOL
13e5cc6c 858 want_libtool="$enableval")
d113bc2c 859
6d91a86b
FD
860if test "$use_libbind" != "no"; then
861 if test "$want_libtool" = "yes" -a \
862 ! -f "$use_libbind/lib/libisc.la"
863 then
864 AC_MSG_ERROR([Cannot find dynamic libraries at $use_libbind/lib])
865 fi
866 if test "$want_libtool" = "no" -a \
867 ! -f "$use_libbind/lib/libisc.a"
868 then
869 AC_MSG_ERROR([Cannot find static libraries at $use_libbind/lib])
870 fi
871fi
872
13e5cc6c
FD
873@BEGIN WITH LIBTOOL
874if test "$want_libtool" = "no"; then
875 AC_MSG_ERROR([libtool configure is used but libtool is disabled?])
876fi
d113bc2c
FD
877
878DHLIBS=LTLIBRARIES
13e5cc6c 879A=la
bf6f8fce 880BINDLT="--with-libtool --disable-symtable"
36d4e51a 881DISTCHECK_LIBTOOL_CONFIGURE_FLAG="--enable-libtool"
13e5cc6c 882@END WITH LIBTOOL
d113bc2c 883
13e5cc6c
FD
884@BEGIN WITHOUT LIBTOOL
885if test "$want_libtool" = "yes"; then
886 AC_MSG_WARN([legacy configure is used but libtool is enabled. Trying to recover...])
6d91a86b 887 # expand $ac_configure_args
d113bc2c
FD
888 eval "set my_configure_args $ac_configure_args"
889 shift
6d91a86b 890 cd $srcdir; exec ./config+lt "$@"
13e5cc6c
FD
891 AC_MSG_ERROR([Recovering failed])
892fi
d113bc2c
FD
893
894DHLIBS=LIBRARIES
13e5cc6c
FD
895A=a
896@END WITHOUT LIBTOOL
d113bc2c
FD
897
898AC_SUBST(DHLIBS)
13e5cc6c
FD
899AC_SUBST(A)
900AC_SUBST(BINDLT)
bf6f8fce
FD
901AC_SUBST(DISTCHECK_LIBTOOL_CONFIGURE_FLAG)
902
903# quoting in Makefile.am.in
904Q=@
905AC_SUBST(Q)
906
907# install bind includes and libraries
908
909want_install_bind="no"
910@BEGIN WITH LIBTOOL
911want_install_bind="yes"
912@END WITH LIBTOOL
913if test "$want_libtool" = "yes"; then
914 want_install_bind="yes"
915fi
916if test "$use_libbind" != "no"; then
917 want_install_bind="no"
918fi
919AC_ARG_ENABLE(bind_install,
6d91a86b
FD
920 AS_HELP_STRING([--enable-bind-install],
921@BEGIN WITH LIBTOOL
922[install bind includes and libraries.]),
923@END WITH LIBTOOL
924@BEGIN WITHOUT LIBTOOL
925[install bind includes and libraries (default is no).]),
926@END WITHOUT LIBTOOL
bf6f8fce
FD
927 want_install_bind="$enableval")
928if test "$want_install_bind" = "yes"; then
929 if test "$use_libbind" != "no"; then
930 AC_MSG_WARN([--enable-bind-install does nothing when --with-libbind is set])
931 fi
932elif test "$want_libtool" = "yes" -a "$use_libbind" = "no"; then
933 AC_MSG_WARN([embedded dynamic bind libraries must be installed])
934fi
935AM_CONDITIONAL(INSTALL_BIND, test "$want_install_bind" = "yes")
13e5cc6c
FD
936
937# OpenLDAP support.
938AC_ARG_WITH(ldap,
939 AS_HELP_STRING([--with-ldap],[enable OpenLDAP support in dhcpd (default is no)]),
940 [ldap=$withval],
941 [ldap=no])
942
943# OpenLDAP with SSL support.
944AC_ARG_WITH(ldapcrypto,
945 AS_HELP_STRING([--with-ldapcrypto],[enable OpenLDAP crypto support in dhcpd (default is no)]),
946 [ldapcrypto=$withval],
947 [ldapcrypto=no])
948
949# Gssapi to allow LDAP to authenticate with a keytab
950AC_ARG_WITH(ldap-gssapi,
951 AC_HELP_STRING([--with-ldap-gssapi],
952 [enable krb5/gssapi authentication for OpenLDAP in dhcpd (default is no)]),
953 [ldap_gssapi=$withval],
954 [ldap_gssapi=no])
955
956
957# LDAP CASA auth support.
958AC_ARG_WITH(ldapcasa,
959 AC_HELP_STRING([--with-ldapcasa],
960 [enable LDAP CASA auth support in dhcpd (default is no)]),
961 [ldapcasa=$withval],
962 [ldapcasa=no])
963
964# OpenLDAP support is disabled by default, if enabled then SSL support is an
965# extra optional that is also disabled by default. Enabling LDAP SSL support
966# implies enabling LDAP support. Similarly, KRB5 support implies LDAP support,
967# but doesn't include SSL. The two are not dependant.
968if test x$ldap = xyes || test x$ldapcrypto = xyes || test x$ldap_gssapi = xyes; then
969 saved_LIBS="$LIBS"
970 LIBS=""
971 AC_SEARCH_LIBS(ldap_initialize, [ldap], ,
972 AC_MSG_FAILURE([*** Cannot find ldap_initialize with -lldap - do you need to install an OpenLDAP2 Devel package?]))
973 AC_SEARCH_LIBS(ber_pvt_opt_on, [lber], ,
974 AC_MSG_FAILURE([*** Cannot find ber_pvt_opt_on with -llber - do you need to install an OpenLDAP2 Devel package?]))
975 if test x$ldap_gssapi = xyes ; then
976 AC_SEARCH_LIBS(krb5_init_context, [krb5], ,
977 AC_MSG_FAILURE([*** Cannot find krb5_init_context with -lkrb5 - do you need to install a Kerberos Devel package?]))
978 fi
979
980 # Create LDAP_LIBS which we specify them explicitly rather than lumping them in with LIBS
981 AC_SUBST(LDAP_LIBS, [$LIBS])
982 LIBS="$saved_LIBS"
983
984
985 AC_CHECK_HEADERS([ldap.h])
986 AC_CHECK_FUNCS([inet_pton inet_ntop])
987
988
989 LDAP_CFLAGS="-DLDAP_CONFIGURATION"
990
991 if test x$ldapcasa = xyes ; then
992 AC_CHECK_HEADERS([micasa_mgmd.h],[
993 LDAP_CFLAGS="$LDAP_CFLAGS -DLDAP_CASA_AUTH"
994 ], AC_MSG_FAILURE([*** Cannot find micasa_mgmd.h for ldap casa auth support]))
995 fi
996
997 if test x$ldapcrypto = xyes ; then
998 LDAP_CFLAGS="$LDAP_CFLAGS -DLDAP_USE_SSL"
999 fi
1000
1001 if test x$ldap_gssapi = xyes; then
1002 LDAP_CFLAGS="$LDAP_CFLAGS -DLDAP_USE_GSSAPI"
1003 fi
1004
1005 AC_SUBST(LDAP_CFLAGS, [$LDAP_CFLAGS])
1006fi
1007
1008# Append selected warning levels to CFLAGS before substitution (but after
1009# AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],[],[]) & etc).
1010CFLAGS="$CFLAGS $STD_CWARNINGS"
1011
1012# Try to add the bind and dhcp include directories
1013CFLAGS="$CFLAGS -I\$(top_srcdir)/includes -I$BINDDIR/include"
1014
1015case "$host" in
1016*-darwin*)
1017 CFLAGS="$CFLAGS -D__APPLE_USE_RFC_3542";;
1018*-solaris*)
1019 # As of Solaris 11, ethernet dev files are in /dev/net
1020 AC_CHECK_FILE(/dev/net,
1021 [AC_DEFINE([USE_DEV_NET], [1],
1022 [Define to 1 if ethernet devices are in /dev/net])])
1023 ;;
1024esac
1025
1026AC_C_FLEXIBLE_ARRAY_MEMBER
1027
1028AC_CONFIG_FILES([
1029 Makefile
1030 client/Makefile
1031 client/tests/Makefile
1032 common/Makefile.am
1033 common/Makefile
1034 common/tests/Makefile
1035 dhcpctl/Makefile.am
1036 dhcpctl/Makefile
1037 includes/Makefile
0cd94b5e 1038 keama/Makefile
13e5cc6c
FD
1039 omapip/Makefile.am
1040 omapip/Makefile
1041 relay/Makefile
0a2f9a62 1042 relay/tests/Makefile
13e5cc6c
FD
1043 server/Makefile
1044 tests/Makefile.am
1045 tests/Makefile
1046 tests/unittest.sh
1047 server/tests/Makefile
1048 doc/devel/doxyfile
1049])
1050AC_OUTPUT
1051
1052@BEGIN WITH LIBTOOL
1053AC_MSG_NOTICE([postconfig: run automake in $srcdir])
1054(cd $srcdir; automake)
1055AC_MSG_NOTICE([postconfig: rerun config.status])
1056sh ./config.status
1057@END WITH LIBTOOL
1058
1059if test "$enable_dhcpv4o6" = "yes"; then
1060 DHCP_VERSIONS="DHCPv4, DHCPv6 and DHCPv4-over-DHCPv6"
1061elif test "$enable_dhcpv6" != "no"; then
1062 DHCP_VERSIONS="DHCPv4 and DHCPv6"
1063else
1064 DHCP_VERSIONS="DHCPv4"
1065fi
1066
1067cat > config.report << END
1068
1069 ISC DHCP source configure results:
1070 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
1071
1072Package:
1073 Name: $PACKAGE_NAME
1074 Version: $PACKAGE_VERSION
1075
1076C Compiler: $CC
1077
1078Flags:
1079 DEFS: $DEFS
1080 CFLAGS: $CFLAGS
1081
1082DHCP versions: $DHCP_VERSIONS
1083
1084Features:
1085 debug: $enable_debug
1086 failover: $enable_failover
1087 execute: $enable_execute
1088 binary-leases: $enable_binary_leases
1089 dhcpv6: $enable_dhcpv6
1090 delayed-ack: $enable_delayed_ack
4406f9b0 1091 dhcpv4o6: $enable_dhcpv4o6
563f0b8a 1092 relay-port: $enable_relay_port
13e5cc6c
FD
1093
1094Developer:
1095 ATF unittests : $atf_path
1096
1097END
1098# TODO: Add Perl system tests
1099
1100if test "$atf_path" != "no"
1101then
1102echo "ATF_CFLAGS : $ATF_CFLAGS" >> config.report
1103echo "ATF_LDFLAGS : $ATF_LDFLAGS" >> config.report
1104echo "ATF_BIN : $ATF_BIN" >> config.report
1105echo
1106fi
1107
1108cat config.report
1109
1110echo
1111echo Now you can type "make" to build ISC DHCP
1112echo