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