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