]>
Commit | Line | Data |
---|---|---|
05ae2d15 | 1 | AC_INIT([DHCP], [4.2.0], [dhcp-users@isc.org]) |
fe5b0fdd DH |
2 | |
3 | # we specify "foreign" to avoid having to have the GNU mandated files, | |
4 | # like AUTHORS, COPYING, and such | |
5 | AM_INIT_AUTOMAKE([foreign]) | |
6 | ||
06eb8bab SK |
7 | # We want to turn on warnings if we are using gcc and the user did |
8 | # not specify CFLAGS. The autoconf check for the C compiler sets the | |
9 | # CFLAGS if gcc is used, so we will save it before we run that check. | |
10 | SAVE_CFLAGS="$CFLAGS" | |
11 | ||
12 | # Now find our C compiler. | |
fe5b0fdd | 13 | AC_PROG_CC |
06eb8bab | 14 | |
159c89d7 EH |
15 | # Suppress warnings about --datarootdir |
16 | AC_DEFUN([AC_DATAROOTDIR_CHECKED]) | |
17 | ||
06eb8bab SK |
18 | # If we have gcc, and AC_PROG_CC changed the flags, then we know the |
19 | # user did not specify any flags. Add warnings in this case. | |
20 | if test "$GCC" = "yes"; then | |
21 | if test "$CFLAGS" != "$SAVE_CFLAGS"; then | |
eaf7eb17 | 22 | STD_CWARNINGS="$STD_CWARNINGS -Wall -Werror -fno-strict-aliasing" |
06eb8bab SK |
23 | fi |
24 | fi | |
25 | ||
ae566556 SR |
26 | # POSIX doesn't include the IPv6 Advanced Socket API and glibc hides |
27 | # parts of the IPv6 Advanced Socket API as a result. This is stupid | |
28 | # as it breaks how the two halves (Basic and Advanced) of the IPv6 | |
29 | # Socket API were designed to be used but we have to live with it. | |
30 | # Use this to define _GNU_SOURCE to pull in the IPv6 Advanced Socket API. | |
31 | AC_USE_SYSTEM_EXTENSIONS | |
32 | ||
fe5b0fdd DH |
33 | AC_PROG_RANLIB |
34 | AC_CONFIG_HEADERS([includes/config.h]) | |
35 | ||
36 | # we sometimes need to know byte order for building packets | |
37 | AC_C_BIGENDIAN(AC_SUBST(byte_order, BIG_ENDIAN), | |
38 | AC_SUBST(byte_order, LITTLE_ENDIAN)) | |
39 | AC_DEFINE_UNQUOTED([DHCP_BYTE_ORDER], [$byte_order], | |
40 | [Define to BIG_ENDIAN for MSB (Motorola or SPARC CPUs) | |
41 | or LITTLE_ENDIAN for LSB (Intel CPUs).]) | |
42 | ||
66cebfcb DH |
43 | # Optional compile-time DEBUGging. |
44 | AC_ARG_ENABLE(debug, | |
45 | AC_HELP_STRING([--enable-debug], | |
46 | [create a debug-only version of the software (default is no).])) | |
47 | # This is very much off by default. | |
48 | if test "$enable_debug" = "yes" ; then | |
49 | AC_DEFINE([DEBUG], [1], | |
50 | [Define to compile debug-only DHCP software.]) | |
51 | # Just override CFLAGS to totally to remove optimization. | |
52 | CFLAGS="-g" | |
53 | fi | |
54 | # XXX: there are actually quite a lot more DEBUG_ features we could enable, | |
55 | # but I don't want to pollute the --help space. | |
56 | # | |
57 | #/* #define DEBUG_TOKENS */ | |
58 | #/* #define DEBUG_PACKET */ | |
59 | #/* #define DEBUG_EXPRESSIONS */ | |
60 | #/* #define DEBUG_FIND_LEASE */ | |
61 | #/* #define DEBUG_EXPRESSION_PARSE */ | |
62 | #/* #define DEBUG_CLASS_MATCHING */ | |
63 | #/* #define DEBUG_MEMORY_LEAKAGE */ | |
64 | #/* #define DEBUG_MALLOC_POOL */ | |
65 | #/* #define DEBUG_LEASE_STATE_TRANSITIONS */ | |
66 | #/* #define DEBUG_RC_HISTORY */ | |
67 | #/* #define DEBUG_RC_HISTORY_EXHAUSTIVELY */ | |
68 | #/* #define RC_HISTORY_MAX 10240 */ | |
69 | #/* #define POINTER_DEBUG */ | |
70 | #/* #define DEBUG_FAILOVER_MESSAGES */ | |
71 | #/* #define DEBUG_FAILOVER_TIMING */ | |
72 | #/* #define DEBUG_DUMP_ALL_LEASES */ | |
73 | ||
74 | # Failover optional compile-time feature. | |
75 | AC_ARG_ENABLE(failover, | |
76 | AC_HELP_STRING([--enable-failover], | |
77 | [enable support for failover (default is yes)])) | |
78 | # Failover is on by default, so define if it is not explicitly disabled. | |
79 | if test "$enable_failover" != "no"; then | |
80 | AC_DEFINE([FAILOVER_PROTOCOL], [1], | |
81 | [Define to include Failover Protocol support.]) | |
82 | fi | |
83 | ||
84 | # execute() support. | |
85 | AC_ARG_ENABLE(execute, | |
86 | AC_HELP_STRING([--enable-execute], | |
87 | [enable support for execute() in config (default is yes)])) | |
88 | # execute() is on by default, so define if it is not explicitly disabled. | |
89 | if test "$enable_execute" != "no" ; then | |
90 | AC_DEFINE([ENABLE_EXECUTE], [1], | |
91 | [Define to include execute() config language support.]) | |
92 | fi | |
93 | ||
94 | # Server tracing support. | |
95 | AC_ARG_ENABLE(tracing, | |
96 | AC_HELP_STRING([--enable-tracing], | |
97 | [enable support for server activity tracing (default is yes)])) | |
98 | # tracing is on by default, so define if it is not explicitly disabled. | |
99 | if test "$enable_tracing" != "no" ; then | |
100 | AC_DEFINE([TRACING], [1], | |
101 | [Define to include server activity tracing support.]) | |
102 | fi | |
103 | ||
fbcee149 DH |
104 | # Delayed-ack feature support (experimental). |
105 | AC_ARG_ENABLE(delayed_ack, | |
106 | AC_HELP_STRING([--enable-delayed-ack], | |
107 | [queues multiple DHCPACK replies (default is no)])) | |
108 | if test "$enable_delayed_ack" = "yes"; then | |
109 | AC_DEFINE([DELAYED_ACK], [1], | |
110 | [Define to queue multiple DHCPACK replies per fsync.]) | |
111 | fi | |
112 | ||
66cebfcb | 113 | # DHCPv6 optional compile-time feature. |
fe5b0fdd DH |
114 | AC_ARG_ENABLE(dhcpv6, |
115 | AC_HELP_STRING([--enable-dhcpv6], | |
d00d373a | 116 | [enable support for DHCPv6 (default is yes)])) |
66cebfcb | 117 | # DHCPv6 is on by default, so define if it is not explicitly disabled. |
d00d373a | 118 | if test "$enable_dhcpv6" != "no"; then |
fe5b0fdd | 119 | AC_DEFINE([DHCPv6], [1], |
d00d373a SK |
120 | [Define to 1 to include DHCPv6 support.]) |
121 | fi | |
fe5b0fdd | 122 | |
63971a83 DH |
123 | # PARANOIA is off by default (until we can test it with all features) |
124 | AC_ARG_ENABLE(paranoia, | |
125 | AC_HELP_STRING([--enable-paranoia], | |
126 | [enable support for chroot/setuid (default is no)])) | |
127 | AC_ARG_ENABLE(early_chroot, | |
26ef247f | 128 | AC_HELP_STRING([--enable-early-chroot], |
63971a83 DH |
129 | [enable chrooting prior to configuration (default is no)])) |
130 | # If someone enables early chroot, but does not enable paranoia, do so for | |
131 | # them. | |
132 | if test "$enable_paranoia" != "yes" && \ | |
133 | test "$enable_early_chroot" = "yes" ; then | |
134 | enable_paranoia="yes" | |
135 | fi | |
136 | ||
137 | if test "$enable_paranoia" = "yes" ; then | |
138 | AC_DEFINE([PARANOIA], [1], | |
139 | [Define to any value to include Ari's PARANOIA patch.]) | |
140 | fi | |
141 | if test "$enable_early_chroot" = "yes" ; then | |
142 | AC_DEFINE([EARLY_CHROOT], [1], | |
143 | [Define to any value to chroot() prior to loading config.]) | |
144 | fi | |
145 | ||
f8b3c6f4 DH |
146 | ### |
147 | ### Path fun. Older versions of DHCP were installed in /usr/sbin, so we | |
148 | ### need to look there and potentially overwrite by default (but not if | |
149 | ### the user configures an alternate value). LOCALSTATEDIR is totally | |
150 | ### braindead. No one uses /usr/local/var/db/ nor /usr/local/var/run, and | |
151 | ### they would be insane for suggesting it. We need to look in /var/for | |
152 | ### 'db' and 'state/dhcp' for db files, and /var/run for pid files by | |
153 | ### default. | |
154 | ### | |
155 | AC_PREFIX_PROGRAM(dhcpd) | |
156 | ||
157 | # XXX - isn't there SOME WAY to default autoconf to /var instead of | |
158 | # /usr/local/var/no/one/has/this/please/stop/trying? | |
159 | case "$localstatedir" in | |
160 | '${prefix}/var') | |
161 | localstatedir=/var | |
162 | ;; | |
163 | esac | |
164 | ||
fe5b0fdd DH |
165 | # Allow specification of alternate state files |
166 | AC_ARG_WITH(srv-lease-file, | |
167 | AC_HELP_STRING([--with-srv-lease-file=PATH], | |
168 | [File for dhcpd leases | |
169 | (default is LOCALSTATEDIR/db/dhcpd.leases)]), | |
170 | AC_DEFINE_UNQUOTED([_PATH_DHCPD_DB], ["$withval"], | |
171 | [File for dhcpd leases.])) | |
f8b3c6f4 DH |
172 | |
173 | echo -n "checking for dhcpd.leases location..." | |
174 | if [[ "x$with_srv_lease_file" = "x" ]] ; then | |
175 | if [[ -d "${localstatedir}/db" ]] ; then | |
176 | with_srv_lease_file="${localstatedir}/db/dhcpd.leases" | |
177 | elif [[ -d "${localstatedir}/state" ]] ; then | |
178 | if [[ -d "${localstatedir}/state/dhcp" ]] ; then | |
179 | with_srv_lease_file="${localstatedir}/state/dhcp/dhcpd.leases" | |
180 | else | |
181 | with_srv_lease_file="${localstatedir}/state/dhcpd.leases" | |
182 | fi | |
183 | elif [[ -d "${localstatedir}/lib" ]] ; then | |
184 | if [[ -d "${localstatedir}/lib/dhcp" ]] ; then | |
185 | with_srv_lease_file="${localstatedir}/lib/dhcp/dhcpd.leases" | |
186 | else | |
187 | with_srv_lease_file="${localstatedir}/lib/dhcpd.leases" | |
188 | fi | |
189 | elif [[ -d "${localstatedir}/etc" ]] ; then | |
190 | with_srv_lease_file="${localstatedir}/etc/dhcpd.leases" | |
191 | else | |
192 | with_srv_lease_file="/etc/dhcpd.leases" | |
193 | fi | |
194 | fi | |
195 | echo "$with_srv_lease_file" | |
196 | ||
8dea7ba7 FD |
197 | AC_ARG_WITH(srv6-lease-file, |
198 | AC_HELP_STRING([--with-srv6-lease-file=PATH], | |
199 | [File for dhcpd6 leases | |
200 | (default is LOCALSTATEDIR/db/dhcpd6.leases)]), | |
201 | AC_DEFINE_UNQUOTED([_PATH_DHCPD6_DB], ["$withval"], | |
202 | [File for dhcpd6 leases.])) | |
203 | ||
204 | echo -n "checking for dhcpd6.leases location..." | |
205 | if [[ "x$with_srv6_lease_file" = "x" ]] ; then | |
206 | if [[ -d "${localstatedir}/db" ]] ; then | |
207 | with_srv6_lease_file="${localstatedir}/db/dhcpd6.leases" | |
208 | elif [[ -d "${localstatedir}/state" ]] ; then | |
209 | if [[ -d "${localstatedir}/state/dhcp" ]] ; then | |
210 | with_srv6_lease_file="${localstatedir}/state/dhcp/dhcpd6.leases" | |
211 | else | |
212 | with_srv6_lease_file="${localstatedir}/state/dhcpd6.leases" | |
213 | fi | |
214 | elif [[ -d "${localstatedir}/lib" ]] ; then | |
215 | if [[ -d "${localstatedir}/lib/dhcp" ]] ; then | |
216 | with_srv6_lease_file="${localstatedir}/lib/dhcp/dhcpd6.leases" | |
217 | else | |
218 | with_srv6_lease_file="${localstatedir}/lib/dhcpd6.leases" | |
219 | fi | |
220 | elif [[ -d "${localstatedir}/etc" ]] ; then | |
221 | with_srv6_lease_file="${localstatedir}/etc/dhcpd6.leases" | |
222 | else | |
223 | with_srv6_lease_file="/etc/dhcpd6.leases" | |
224 | fi | |
225 | fi | |
226 | echo "$with_srv6_lease_file" | |
227 | ||
fe5b0fdd DH |
228 | AC_ARG_WITH(cli-lease-file, |
229 | AC_HELP_STRING([--with-cli-lease-file=PATH], | |
230 | [File for dhclient leases | |
231 | (default is LOCALSTATEDIR/db/dhclient.leases)]), | |
232 | AC_DEFINE_UNQUOTED([_PATH_DHCLIENT_DB], ["$withval"], | |
233 | [File for dhclient leases.])) | |
f8b3c6f4 DH |
234 | |
235 | echo -n "checking for dhclient.leases location..." | |
236 | if [[ "x$with_cli_lease_file" = "x" ]] ; then | |
237 | if [[ -d "${localstatedir}/db" ]] ; then | |
238 | with_cli_lease_file="${localstatedir}/db/dhclient.leases" | |
239 | elif [[ -d "${localstatedir}/state" ]] ; then | |
240 | if [[ -d "${localstatedir}/state/dhcp" ]] ; then | |
241 | with_cli_lease_file="${localstatedir}/state/dhcp/dhclient.leases" | |
242 | else | |
243 | with_cli_lease_file="${localstatedir}/state/dhclient.leases" | |
244 | fi | |
245 | elif [[ -d "${localstatedir}/lib" ]] ; then | |
246 | if [[ -d "${localstatedir}/lib/dhcp" ]] ; then | |
247 | with_cli_lease_file="${localstatedir}/lib/dhcp/dhclient.leases" | |
248 | else | |
249 | with_cli_lease_file="${localstatedir}/lib/dhclient.leases" | |
250 | fi | |
251 | elif [[ -d "${localstatedir}/etc" ]] ; then | |
252 | with_cli_lease_file="${localstatedir}/etc/dhclient.leases" | |
253 | else | |
254 | with_cli_lease_file="/etc/dhclient.leases" | |
255 | fi | |
256 | fi | |
257 | echo "$with_cli_lease_file" | |
258 | ||
8dea7ba7 FD |
259 | AC_ARG_WITH(cli6-lease-file, |
260 | AC_HELP_STRING([--with-cli6-lease-file=PATH], | |
261 | [File for dhclient6 leases | |
262 | (default is LOCALSTATEDIR/db/dhclient6.leases)]), | |
263 | AC_DEFINE_UNQUOTED([_PATH_DHCLIENT6_DB], ["$withval"], | |
264 | [File for dhclient6 leases.])) | |
265 | ||
266 | echo -n "checking for dhclient6.leases location..." | |
267 | if [[ "x$with_cli6_lease_file" = "x" ]] ; then | |
268 | if [[ -d "${localstatedir}/db" ]] ; then | |
269 | with_cli6_lease_file="${localstatedir}/db/dhclient6.leases" | |
270 | elif [[ -d "${localstatedir}/state" ]] ; then | |
271 | if [[ -d "${localstatedir}/state/dhcp" ]] ; then | |
272 | with_cli6_lease_file="${localstatedir}/state/dhcp/dhclient6.leases" | |
273 | else | |
274 | with_cli6_lease_file="${localstatedir}/state/dhclient6.leases" | |
275 | fi | |
276 | elif [[ -d "${localstatedir}/lib" ]] ; then | |
277 | if [[ -d "${localstatedir}/lib/dhcp" ]] ; then | |
278 | with_cli6_lease_file="${localstatedir}/lib/dhcp/dhclient6.leases" | |
279 | else | |
280 | with_cli6_lease_file="${localstatedir}/lib/dhclient6.leases" | |
281 | fi | |
282 | elif [[ -d "${localstatedir}/etc" ]] ; then | |
283 | with_cli6_lease_file="${localstatedir}/etc/dhclient6.leases" | |
284 | else | |
285 | with_cli6_lease_file="/etc/dhclient6.leases" | |
286 | fi | |
287 | fi | |
288 | echo "$with_cli6_lease_file" | |
289 | ||
fe5b0fdd DH |
290 | AC_ARG_WITH(srv-pid-file, |
291 | AC_HELP_STRING([--with-srv-pid-file=PATH], | |
292 | [File for dhcpd process information | |
293 | (default is LOCALSTATEDIR/run/dhcpd.pid)]), | |
294 | AC_DEFINE_UNQUOTED([_PATH_DHCPD_PID], ["$withval"], | |
295 | [File for dhcpd process information.])) | |
8dea7ba7 FD |
296 | AC_ARG_WITH(srv6-pid-file, |
297 | AC_HELP_STRING([--with-srv6-pid-file=PATH], | |
298 | [File for dhcpd6 process information | |
299 | (default is LOCALSTATEDIR/run/dhcpd6.pid)]), | |
300 | AC_DEFINE_UNQUOTED([_PATH_DHCPD6_PID], ["$withval"], | |
301 | [File for dhcpd6 process information.])) | |
fe5b0fdd DH |
302 | AC_ARG_WITH(cli-pid-file, |
303 | AC_HELP_STRING([--with-cli-pid-file=PATH], | |
304 | [File for dhclient process information | |
305 | (default is LOCALSTATEDIR/run/dhclient.pid)]), | |
8dea7ba7 | 306 | AC_DEFINE_UNQUOTED([_PATH_DHCLIENT_PID], ["$withval"], |
fe5b0fdd | 307 | [File for dhclient process information.])) |
8dea7ba7 FD |
308 | AC_ARG_WITH(cli6-pid-file, |
309 | AC_HELP_STRING([--with-cli6-pid-file=PATH], | |
310 | [File for dhclient6 process information | |
311 | (default is LOCALSTATEDIR/run/dhclient6.pid)]), | |
312 | AC_DEFINE_UNQUOTED([_PATH_DHCLIENT6_PID], ["$withval"], | |
313 | [File for dhclient6 process information.])) | |
fe5b0fdd DH |
314 | AC_ARG_WITH(relay-pid-file, |
315 | AC_HELP_STRING([--with-relay-pid-file=PATH], | |
316 | [File for dhcrelay process information | |
317 | (default is LOCALSTATEDIR/run/dhcrelay.pid)]), | |
318 | AC_DEFINE_UNQUOTED([_PATH_DHCRELAY_PID], ["$withval"], | |
319 | [File for dhcrelay process information.])) | |
4a5bfeac SR |
320 | AC_ARG_WITH(relay6-pid-file, |
321 | AC_HELP_STRING([--with-relay6-pid-file=PATH], | |
322 | [File for dhcrelay6 process information | |
323 | (default is LOCALSTATEDIR/run/dhcrelay6.pid)]), | |
324 | AC_DEFINE_UNQUOTED([_PATH_DHCRELAY6_PID], ["$withval"], | |
325 | [File for dhcrelay6 process information.])) | |
fe5b0fdd | 326 | |
cd3f0b9b DH |
327 | # Check basic types. |
328 | AC_TYPE_INT8_T | |
329 | AC_TYPE_INT16_T | |
330 | AC_TYPE_INT32_T | |
4e0997c6 | 331 | AC_TYPE_INT64_T |
cd3f0b9b DH |
332 | |
333 | # Some systems need the u_intX_t types defined across. | |
334 | AC_CHECK_TYPE([u_int8_t], [], [ | |
335 | AC_TYPE_UINT8_T | |
336 | AC_DEFINE(u_int8_t, [uint8_t], [Define a type for 8-bit unsigned | |
337 | integers.]) | |
338 | ]) | |
339 | AC_CHECK_TYPE([u_int16_t], [], [ | |
340 | AC_TYPE_UINT16_T | |
341 | AC_DEFINE(u_int16_t, [uint16_t], [Define a type for 16-bit unsigned | |
342 | integers.]) | |
343 | ]) | |
344 | AC_CHECK_TYPE([u_int32_t], [], [ | |
345 | AC_TYPE_UINT32_T | |
346 | AC_DEFINE(u_int32_t, [uint32_t], [Define a type for 32-bit unsigned | |
347 | integers.]) | |
348 | ]) | |
4e0997c6 SR |
349 | AC_CHECK_TYPE([u_int64_t], [], [ |
350 | AC_TYPE_UINT64_T | |
351 | AC_DEFINE(u_int64_t, [uint64_t], [Define a type for 64-bit unsigned | |
352 | integers.]) | |
353 | ]) | |
cd3f0b9b | 354 | |
b8c0eda0 MA |
355 | # see if ifaddrs.h is available |
356 | AC_CHECK_HEADERS(ifaddrs.h) | |
357 | ||
fe5b0fdd | 358 | # figure out what IPv4 interface code to use |
f125dc8b SK |
359 | AC_CHECK_HEADERS(linux/types.h) # needed for linux/filter.h on old systems |
360 | ||
361 | AC_CHECK_HEADER(linux/filter.h, DO_LPF=1, , | |
362 | [ | |
363 | #ifdef HAVE_LINUX_TYPES_H | |
364 | #include <linux/types.h> | |
365 | #endif | |
366 | ]) | |
367 | if test -n "$DO_LPF" | |
368 | then | |
a57df74a | 369 | AC_DEFINE([HAVE_LPF], [1], |
f125dc8b SK |
370 | [Define to 1 to use the Linux Packet Filter interface code.]) |
371 | else | |
372 | AC_CHECK_HEADER(sys/dlpi.h, DO_DLPI=1) | |
373 | if test -n "$DO_DLPI" | |
374 | then | |
a57df74a | 375 | AC_DEFINE([HAVE_DLPI], [1], |
f125dc8b SK |
376 | [Define to 1 to use DLPI interface code.]) |
377 | else | |
378 | AC_CHECK_HEADER(net/bpf.h, DO_BPF=1) | |
379 | if test -n "$DO_BPF" | |
380 | then | |
a57df74a | 381 | AC_DEFINE([HAVE_BPF], [""], |
f125dc8b SK |
382 | [Define to 1 to use the |
383 | Berkeley Packet Filter interface code.]) | |
384 | fi | |
385 | fi | |
f125dc8b | 386 | fi |
fe5b0fdd | 387 | |
8da06bb1 DH |
388 | # SIOCGLIFCONF uses some transport structures. Trick is not all platforms |
389 | # use the same structures. We like to use 'struct lifconf' and 'struct | |
390 | # lifreq', but we'll use these other structures if they're present. HPUX | |
391 | # does not define 'struct lifnum', but does use SIOCGLIFNUM - they use an | |
392 | # int value. | |
393 | # | |
394 | AC_MSG_CHECKING([for struct lifnum]) | |
395 | AC_TRY_COMPILE( | |
396 | [ #include <sys/types.h> | |
cff9b78f | 397 | #include <sys/socket.h> |
8da06bb1 DH |
398 | #include <net/if.h> |
399 | ], | |
400 | [ struct lifnum a; | |
401 | ], | |
402 | [AC_MSG_RESULT(yes) | |
403 | AC_DEFINE([ISC_PLATFORM_HAVELIFNUM], [1], | |
404 | [Define to 1 if the system has 'struct lifnum'.])], | |
405 | [AC_MSG_RESULT(no)]) | |
406 | ||
407 | AC_MSG_CHECKING([for struct if_laddrconf]) | |
408 | AC_TRY_COMPILE( | |
409 | [ #include <sys/types.h> | |
410 | #include <net/if6.h> | |
411 | ], | |
412 | [ struct if_laddrconf a; | |
413 | ], | |
414 | [AC_MSG_RESULT(yes) | |
415 | AC_DEFINE([ISC_PLATFORM_HAVEIF_LADDRCONF], [1], | |
416 | [Define to 1 if the system has 'struct if_laddrconf'.])], | |
417 | [AC_MSG_RESULT(no)]) | |
418 | ||
419 | AC_MSG_CHECKING([for struct if_laddrreq]) | |
420 | AC_TRY_LINK( | |
421 | [#include <sys/types.h> | |
422 | #include <net/if6.h> | |
423 | ], | |
424 | [ struct if_laddrreq a; | |
425 | ], | |
426 | [AC_MSG_RESULT(yes) | |
427 | AC_DEFINE([ISC_PLATFORM_HAVEIF_LADDRREQ], [1], | |
428 | [Define to 1 if the system has 'struct if_laddrreq'.])], | |
429 | [AC_MSG_RESULT(no)]) | |
430 | ||
6dd7efa2 | 431 | # Look for optional headers. |
cff9b78f | 432 | AC_CHECK_HEADERS(sys/socket.h net/if_dl.h net/if6.h regex.h) |
6dd7efa2 | 433 | |
fe5b0fdd DH |
434 | # Solaris needs some libraries for functions |
435 | AC_SEARCH_LIBS(socket, [socket]) | |
436 | AC_SEARCH_LIBS(inet_ntoa, [nsl]) | |
437 | ||
438 | AC_SEARCH_LIBS(inet_aton, [socket nsl], , | |
439 | AC_DEFINE([NEED_INET_ATON], [1], | |
440 | [Define to 1 if the inet_aton() function is missing.])) | |
441 | ||
dd328225 DH |
442 | # Check for a standalone regex library. |
443 | AC_SEARCH_LIBS(regcomp, [regex]) | |
444 | ||
2394b26b DH |
445 | # For HP/UX we need -lipv6 for if_nametoindex, perhaps others. |
446 | AC_SEARCH_LIBS(if_nametoindex, [ipv6]) | |
447 | ||
fe5b0fdd DH |
448 | # check for /dev/random (declares HAVE_DEV_RANDOM) |
449 | AC_CHECK_FILE(/dev/random, | |
450 | AC_DEFINE([HAVE_DEV_RANDOM], [1], | |
451 | [Define to 1 if you have the /dev/random file.])) | |
452 | ||
453 | # see if there is a "sa_len" field in our interface information structure | |
454 | AC_CHECK_MEMBER(struct sockaddr.sa_len, | |
455 | AC_DEFINE([HAVE_SA_LEN], [], | |
456 | [Define to 1 if the sockaddr structure has a length field.]), | |
457 | , | |
458 | [#include <sys/socket.h>]) | |
459 | ||
76c944da SK |
460 | # figure out pointer size |
461 | AC_CHECK_SIZEOF(struct iaddr *, , [ | |
462 | #include "includes/inet.h" | |
463 | #include <stdio.h> | |
464 | ]) | |
465 | ||
847e7000 SK |
466 | # Solaris does not have the msg_control or msg_controlen members in |
467 | # in the msghdr structure unless you define: | |
468 | # | |
469 | # _XOPEN_SOURCE, _XOPEN_SOURCE_EXTENDED, and __EXTENSIONS__ | |
470 | # | |
471 | # See the "standards" man page for details. | |
472 | # | |
473 | # We check for the msg_control member, and if it is not found, we check | |
474 | # again with the appropriate defines added to the CFLAGS. (In order to | |
475 | # do this we have to remove the check from the cache, which is what the | |
476 | # "unset" is for.) | |
477 | AC_CHECK_MEMBER(struct msghdr.msg_control,, | |
478 | [CFLAGS="$CFLAGS -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1" | |
479 | CFLAGS="$CFLAGS -D__EXTENSIONS__" | |
480 | unset ac_cv_member_struct_msghdr_msg_control | |
481 | AC_CHECK_MEMBER(struct msghdr.msg_control,, | |
482 | [AC_MSG_ERROR([Missing msg_control member in | |
483 | msg_control structure.])], | |
06eb8bab SK |
484 | [ |
485 | #include <sys/types.h> | |
486 | #include <sys/socket.h> | |
487 | ]) | |
488 | ], | |
489 | [ | |
490 | #include <sys/types.h> | |
491 | #include <sys/socket.h> | |
492 | ]) | |
847e7000 | 493 | |
93eda9ab | 494 | libbind= |
98bf1607 SR |
495 | AC_ARG_WITH(libbind, |
496 | AC_HELP_STRING([--with-libbind=PATH], | |
497 | [bind includes and libraries are in PATH | |
498 | (default is ./bind)]), | |
499 | use_libbind="$withval", use_libbind="no") | |
500 | case "$use_libbind" in | |
501 | yes) | |
502 | libbind="\${top_srcdir}/bind" | |
503 | ;; | |
504 | no) | |
505 | libbind="\${top_srcdir}/bind" | |
506 | ;; | |
507 | *) | |
508 | libbind="$use_libbind" | |
509 | ;; | |
510 | esac | |
511 | ||
33692791 DH |
512 | # OpenLDAP support. |
513 | AC_ARG_WITH(ldap, | |
514 | AC_HELP_STRING([--with-ldap], | |
515 | [enable OpenLDAP support in dhcpd (default is no)]), | |
516 | [ldap=$withval], | |
517 | [ldap=no]) | |
518 | ||
519 | # OpenLDAP with SSL support. | |
520 | AC_ARG_WITH(ldapcrypto, | |
521 | AC_HELP_STRING([--with-ldapcrypto], | |
522 | [enable OpenLDAP crypto support in dhcpd (default is no)]), | |
523 | [ldapcrypto=$withval], | |
524 | [ldapcrypto=no]) | |
525 | ||
526 | # OpenLDAP support is disabled by default, if enabled then SSL support is an | |
527 | # extra optional that is also disabled by default. Enabling LDAP SSL support | |
528 | # implies enabling LDAP support. | |
529 | if test x$ldap = xyes || test x$ldapcrypto = xyes ; then | |
530 | AC_SEARCH_LIBS(ldap_initialize, [ldap], , | |
531 | AC_MSG_FAILURE([*** Cannot find ldap_initialize with -lldap - do you need to install an OpenLDAP2 Devel package?])) | |
8a0d9ca4 SR |
532 | AC_SEARCH_LIBS(ber_pvt_opt_on, [lber], , |
533 | AC_MSG_FAILURE([*** Cannot find ber_pvt_opt_on with -llber - do you need to install an OpenLDAP2 Devel package?])) | |
33692791 DH |
534 | |
535 | if test x$ldapcrypto = xyes ; then | |
536 | AC_SUBST(LDAP_CFLAGS, ["-DLDAP_CONFIGURATION -DLDAP_USE_SSL"]) | |
537 | else | |
538 | AC_SUBST(LDAP_CFLAGS, ["-DLDAP_CONFIGURATION"]) | |
539 | fi | |
540 | fi | |
541 | ||
eaf7eb17 DH |
542 | # Append selected warning levels to CFLAGS before substitution (but after |
543 | # AC_TRY_COMPILE & etc). | |
544 | CFLAGS="$CFLAGS $STD_CWARNINGS" | |
545 | ||
98bf1607 SR |
546 | # Try to add the bind include directory |
547 | CFLAGS="$CFLAGS -I$libbind/include" | |
548 | ||
a3528574 SR |
549 | AC_C_FLEXIBLE_ARRAY_MEMBER |
550 | ||
6ecda39c | 551 | AC_OUTPUT([ |
fe5b0fdd DH |
552 | Makefile |
553 | client/Makefile | |
554 | common/Makefile | |
6e999c3c | 555 | common/tests/Makefile |
fe5b0fdd DH |
556 | dhcpctl/Makefile |
557 | dst/Makefile | |
558 | includes/Makefile | |
fe5b0fdd DH |
559 | omapip/Makefile |
560 | relay/Makefile | |
561 | server/Makefile | |
6e999c3c | 562 | tests/Makefile |
6ecda39c | 563 | ]) |
fe5b0fdd | 564 | |
95bba8b6 | 565 | sh util/bindvar.sh |