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