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