]>
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 | ||
7cfeb916 SR |
146 | AC_ARG_ENABLE(IPv4_PKTINFO, |
147 | AC_HELP_STRING([--enable-ipv4-pktinfo], | |
148 | [enable use of pktinfo on IPv4 sockets (default is no)])) | |
149 | ||
150 | if test "$enable_ipv4_pktinfo" = "yes"; then | |
151 | AC_DEFINE([USE_V4_PKTINFO], [1], | |
152 | [Define to 1 to enable IPv4 packet info support.]) | |
153 | fi | |
154 | ||
155 | AC_ARG_ENABLE(USE_SOCKETS, | |
156 | AC_HELP_STRING([--enable-use-sockets], | |
157 | [use the standard BSD socket API (default is no)])) | |
158 | ||
159 | if test "$enable_use_sockets" = "yes"; then | |
160 | AC_DEFINE([USE_SOCKETS], [1], | |
161 | [Define to 1 to use the standard BSD socket API.]) | |
162 | fi | |
163 | ||
f8b3c6f4 DH |
164 | ### |
165 | ### Path fun. Older versions of DHCP were installed in /usr/sbin, so we | |
166 | ### need to look there and potentially overwrite by default (but not if | |
167 | ### the user configures an alternate value). LOCALSTATEDIR is totally | |
168 | ### braindead. No one uses /usr/local/var/db/ nor /usr/local/var/run, and | |
169 | ### they would be insane for suggesting it. We need to look in /var/for | |
170 | ### 'db' and 'state/dhcp' for db files, and /var/run for pid files by | |
171 | ### default. | |
172 | ### | |
173 | AC_PREFIX_PROGRAM(dhcpd) | |
174 | ||
175 | # XXX - isn't there SOME WAY to default autoconf to /var instead of | |
176 | # /usr/local/var/no/one/has/this/please/stop/trying? | |
177 | case "$localstatedir" in | |
178 | '${prefix}/var') | |
179 | localstatedir=/var | |
180 | ;; | |
181 | esac | |
182 | ||
fe5b0fdd DH |
183 | # Allow specification of alternate state files |
184 | AC_ARG_WITH(srv-lease-file, | |
185 | AC_HELP_STRING([--with-srv-lease-file=PATH], | |
186 | [File for dhcpd leases | |
187 | (default is LOCALSTATEDIR/db/dhcpd.leases)]), | |
188 | AC_DEFINE_UNQUOTED([_PATH_DHCPD_DB], ["$withval"], | |
189 | [File for dhcpd leases.])) | |
f8b3c6f4 DH |
190 | |
191 | echo -n "checking for dhcpd.leases location..." | |
192 | if [[ "x$with_srv_lease_file" = "x" ]] ; then | |
193 | if [[ -d "${localstatedir}/db" ]] ; then | |
194 | with_srv_lease_file="${localstatedir}/db/dhcpd.leases" | |
195 | elif [[ -d "${localstatedir}/state" ]] ; then | |
196 | if [[ -d "${localstatedir}/state/dhcp" ]] ; then | |
197 | with_srv_lease_file="${localstatedir}/state/dhcp/dhcpd.leases" | |
198 | else | |
199 | with_srv_lease_file="${localstatedir}/state/dhcpd.leases" | |
200 | fi | |
201 | elif [[ -d "${localstatedir}/lib" ]] ; then | |
202 | if [[ -d "${localstatedir}/lib/dhcp" ]] ; then | |
203 | with_srv_lease_file="${localstatedir}/lib/dhcp/dhcpd.leases" | |
204 | else | |
205 | with_srv_lease_file="${localstatedir}/lib/dhcpd.leases" | |
206 | fi | |
207 | elif [[ -d "${localstatedir}/etc" ]] ; then | |
208 | with_srv_lease_file="${localstatedir}/etc/dhcpd.leases" | |
209 | else | |
210 | with_srv_lease_file="/etc/dhcpd.leases" | |
211 | fi | |
212 | fi | |
213 | echo "$with_srv_lease_file" | |
214 | ||
8dea7ba7 FD |
215 | AC_ARG_WITH(srv6-lease-file, |
216 | AC_HELP_STRING([--with-srv6-lease-file=PATH], | |
217 | [File for dhcpd6 leases | |
218 | (default is LOCALSTATEDIR/db/dhcpd6.leases)]), | |
219 | AC_DEFINE_UNQUOTED([_PATH_DHCPD6_DB], ["$withval"], | |
220 | [File for dhcpd6 leases.])) | |
221 | ||
222 | echo -n "checking for dhcpd6.leases location..." | |
223 | if [[ "x$with_srv6_lease_file" = "x" ]] ; then | |
224 | if [[ -d "${localstatedir}/db" ]] ; then | |
225 | with_srv6_lease_file="${localstatedir}/db/dhcpd6.leases" | |
226 | elif [[ -d "${localstatedir}/state" ]] ; then | |
227 | if [[ -d "${localstatedir}/state/dhcp" ]] ; then | |
228 | with_srv6_lease_file="${localstatedir}/state/dhcp/dhcpd6.leases" | |
229 | else | |
230 | with_srv6_lease_file="${localstatedir}/state/dhcpd6.leases" | |
231 | fi | |
232 | elif [[ -d "${localstatedir}/lib" ]] ; then | |
233 | if [[ -d "${localstatedir}/lib/dhcp" ]] ; then | |
234 | with_srv6_lease_file="${localstatedir}/lib/dhcp/dhcpd6.leases" | |
235 | else | |
236 | with_srv6_lease_file="${localstatedir}/lib/dhcpd6.leases" | |
237 | fi | |
238 | elif [[ -d "${localstatedir}/etc" ]] ; then | |
239 | with_srv6_lease_file="${localstatedir}/etc/dhcpd6.leases" | |
240 | else | |
241 | with_srv6_lease_file="/etc/dhcpd6.leases" | |
242 | fi | |
243 | fi | |
244 | echo "$with_srv6_lease_file" | |
245 | ||
fe5b0fdd DH |
246 | AC_ARG_WITH(cli-lease-file, |
247 | AC_HELP_STRING([--with-cli-lease-file=PATH], | |
248 | [File for dhclient leases | |
249 | (default is LOCALSTATEDIR/db/dhclient.leases)]), | |
250 | AC_DEFINE_UNQUOTED([_PATH_DHCLIENT_DB], ["$withval"], | |
251 | [File for dhclient leases.])) | |
f8b3c6f4 DH |
252 | |
253 | echo -n "checking for dhclient.leases location..." | |
254 | if [[ "x$with_cli_lease_file" = "x" ]] ; then | |
255 | if [[ -d "${localstatedir}/db" ]] ; then | |
256 | with_cli_lease_file="${localstatedir}/db/dhclient.leases" | |
257 | elif [[ -d "${localstatedir}/state" ]] ; then | |
258 | if [[ -d "${localstatedir}/state/dhcp" ]] ; then | |
259 | with_cli_lease_file="${localstatedir}/state/dhcp/dhclient.leases" | |
260 | else | |
261 | with_cli_lease_file="${localstatedir}/state/dhclient.leases" | |
262 | fi | |
263 | elif [[ -d "${localstatedir}/lib" ]] ; then | |
264 | if [[ -d "${localstatedir}/lib/dhcp" ]] ; then | |
265 | with_cli_lease_file="${localstatedir}/lib/dhcp/dhclient.leases" | |
266 | else | |
267 | with_cli_lease_file="${localstatedir}/lib/dhclient.leases" | |
268 | fi | |
269 | elif [[ -d "${localstatedir}/etc" ]] ; then | |
270 | with_cli_lease_file="${localstatedir}/etc/dhclient.leases" | |
271 | else | |
272 | with_cli_lease_file="/etc/dhclient.leases" | |
273 | fi | |
274 | fi | |
275 | echo "$with_cli_lease_file" | |
276 | ||
8dea7ba7 FD |
277 | AC_ARG_WITH(cli6-lease-file, |
278 | AC_HELP_STRING([--with-cli6-lease-file=PATH], | |
279 | [File for dhclient6 leases | |
280 | (default is LOCALSTATEDIR/db/dhclient6.leases)]), | |
281 | AC_DEFINE_UNQUOTED([_PATH_DHCLIENT6_DB], ["$withval"], | |
282 | [File for dhclient6 leases.])) | |
283 | ||
284 | echo -n "checking for dhclient6.leases location..." | |
285 | if [[ "x$with_cli6_lease_file" = "x" ]] ; then | |
286 | if [[ -d "${localstatedir}/db" ]] ; then | |
287 | with_cli6_lease_file="${localstatedir}/db/dhclient6.leases" | |
288 | elif [[ -d "${localstatedir}/state" ]] ; then | |
289 | if [[ -d "${localstatedir}/state/dhcp" ]] ; then | |
290 | with_cli6_lease_file="${localstatedir}/state/dhcp/dhclient6.leases" | |
291 | else | |
292 | with_cli6_lease_file="${localstatedir}/state/dhclient6.leases" | |
293 | fi | |
294 | elif [[ -d "${localstatedir}/lib" ]] ; then | |
295 | if [[ -d "${localstatedir}/lib/dhcp" ]] ; then | |
296 | with_cli6_lease_file="${localstatedir}/lib/dhcp/dhclient6.leases" | |
297 | else | |
298 | with_cli6_lease_file="${localstatedir}/lib/dhclient6.leases" | |
299 | fi | |
300 | elif [[ -d "${localstatedir}/etc" ]] ; then | |
301 | with_cli6_lease_file="${localstatedir}/etc/dhclient6.leases" | |
302 | else | |
303 | with_cli6_lease_file="/etc/dhclient6.leases" | |
304 | fi | |
305 | fi | |
306 | echo "$with_cli6_lease_file" | |
307 | ||
fe5b0fdd DH |
308 | AC_ARG_WITH(srv-pid-file, |
309 | AC_HELP_STRING([--with-srv-pid-file=PATH], | |
310 | [File for dhcpd process information | |
311 | (default is LOCALSTATEDIR/run/dhcpd.pid)]), | |
312 | AC_DEFINE_UNQUOTED([_PATH_DHCPD_PID], ["$withval"], | |
313 | [File for dhcpd process information.])) | |
8dea7ba7 FD |
314 | AC_ARG_WITH(srv6-pid-file, |
315 | AC_HELP_STRING([--with-srv6-pid-file=PATH], | |
316 | [File for dhcpd6 process information | |
317 | (default is LOCALSTATEDIR/run/dhcpd6.pid)]), | |
318 | AC_DEFINE_UNQUOTED([_PATH_DHCPD6_PID], ["$withval"], | |
319 | [File for dhcpd6 process information.])) | |
fe5b0fdd DH |
320 | AC_ARG_WITH(cli-pid-file, |
321 | AC_HELP_STRING([--with-cli-pid-file=PATH], | |
322 | [File for dhclient process information | |
323 | (default is LOCALSTATEDIR/run/dhclient.pid)]), | |
8dea7ba7 | 324 | AC_DEFINE_UNQUOTED([_PATH_DHCLIENT_PID], ["$withval"], |
fe5b0fdd | 325 | [File for dhclient process information.])) |
8dea7ba7 FD |
326 | AC_ARG_WITH(cli6-pid-file, |
327 | AC_HELP_STRING([--with-cli6-pid-file=PATH], | |
328 | [File for dhclient6 process information | |
329 | (default is LOCALSTATEDIR/run/dhclient6.pid)]), | |
330 | AC_DEFINE_UNQUOTED([_PATH_DHCLIENT6_PID], ["$withval"], | |
331 | [File for dhclient6 process information.])) | |
fe5b0fdd DH |
332 | AC_ARG_WITH(relay-pid-file, |
333 | AC_HELP_STRING([--with-relay-pid-file=PATH], | |
334 | [File for dhcrelay process information | |
335 | (default is LOCALSTATEDIR/run/dhcrelay.pid)]), | |
336 | AC_DEFINE_UNQUOTED([_PATH_DHCRELAY_PID], ["$withval"], | |
337 | [File for dhcrelay process information.])) | |
4a5bfeac SR |
338 | AC_ARG_WITH(relay6-pid-file, |
339 | AC_HELP_STRING([--with-relay6-pid-file=PATH], | |
340 | [File for dhcrelay6 process information | |
341 | (default is LOCALSTATEDIR/run/dhcrelay6.pid)]), | |
342 | AC_DEFINE_UNQUOTED([_PATH_DHCRELAY6_PID], ["$withval"], | |
343 | [File for dhcrelay6 process information.])) | |
fe5b0fdd | 344 | |
cd3f0b9b DH |
345 | # Check basic types. |
346 | AC_TYPE_INT8_T | |
347 | AC_TYPE_INT16_T | |
348 | AC_TYPE_INT32_T | |
4e0997c6 | 349 | AC_TYPE_INT64_T |
cd3f0b9b DH |
350 | |
351 | # Some systems need the u_intX_t types defined across. | |
352 | AC_CHECK_TYPE([u_int8_t], [], [ | |
353 | AC_TYPE_UINT8_T | |
354 | AC_DEFINE(u_int8_t, [uint8_t], [Define a type for 8-bit unsigned | |
355 | integers.]) | |
356 | ]) | |
357 | AC_CHECK_TYPE([u_int16_t], [], [ | |
358 | AC_TYPE_UINT16_T | |
359 | AC_DEFINE(u_int16_t, [uint16_t], [Define a type for 16-bit unsigned | |
360 | integers.]) | |
361 | ]) | |
362 | AC_CHECK_TYPE([u_int32_t], [], [ | |
363 | AC_TYPE_UINT32_T | |
364 | AC_DEFINE(u_int32_t, [uint32_t], [Define a type for 32-bit unsigned | |
365 | integers.]) | |
366 | ]) | |
4e0997c6 SR |
367 | AC_CHECK_TYPE([u_int64_t], [], [ |
368 | AC_TYPE_UINT64_T | |
369 | AC_DEFINE(u_int64_t, [uint64_t], [Define a type for 64-bit unsigned | |
370 | integers.]) | |
371 | ]) | |
cd3f0b9b | 372 | |
b8c0eda0 MA |
373 | # see if ifaddrs.h is available |
374 | AC_CHECK_HEADERS(ifaddrs.h) | |
375 | ||
fe5b0fdd | 376 | # figure out what IPv4 interface code to use |
f125dc8b SK |
377 | AC_CHECK_HEADERS(linux/types.h) # needed for linux/filter.h on old systems |
378 | ||
379 | AC_CHECK_HEADER(linux/filter.h, DO_LPF=1, , | |
380 | [ | |
381 | #ifdef HAVE_LINUX_TYPES_H | |
382 | #include <linux/types.h> | |
383 | #endif | |
384 | ]) | |
385 | if test -n "$DO_LPF" | |
386 | then | |
a57df74a | 387 | AC_DEFINE([HAVE_LPF], [1], |
f125dc8b SK |
388 | [Define to 1 to use the Linux Packet Filter interface code.]) |
389 | else | |
390 | AC_CHECK_HEADER(sys/dlpi.h, DO_DLPI=1) | |
391 | if test -n "$DO_DLPI" | |
392 | then | |
a57df74a | 393 | AC_DEFINE([HAVE_DLPI], [1], |
f125dc8b SK |
394 | [Define to 1 to use DLPI interface code.]) |
395 | else | |
396 | AC_CHECK_HEADER(net/bpf.h, DO_BPF=1) | |
397 | if test -n "$DO_BPF" | |
398 | then | |
a57df74a | 399 | AC_DEFINE([HAVE_BPF], [""], |
f125dc8b SK |
400 | [Define to 1 to use the |
401 | Berkeley Packet Filter interface code.]) | |
402 | fi | |
403 | fi | |
f125dc8b | 404 | fi |
fe5b0fdd | 405 | |
8da06bb1 DH |
406 | # SIOCGLIFCONF uses some transport structures. Trick is not all platforms |
407 | # use the same structures. We like to use 'struct lifconf' and 'struct | |
408 | # lifreq', but we'll use these other structures if they're present. HPUX | |
409 | # does not define 'struct lifnum', but does use SIOCGLIFNUM - they use an | |
410 | # int value. | |
411 | # | |
412 | AC_MSG_CHECKING([for struct lifnum]) | |
413 | AC_TRY_COMPILE( | |
414 | [ #include <sys/types.h> | |
cff9b78f | 415 | #include <sys/socket.h> |
8da06bb1 DH |
416 | #include <net/if.h> |
417 | ], | |
418 | [ struct lifnum a; | |
419 | ], | |
420 | [AC_MSG_RESULT(yes) | |
421 | AC_DEFINE([ISC_PLATFORM_HAVELIFNUM], [1], | |
422 | [Define to 1 if the system has 'struct lifnum'.])], | |
423 | [AC_MSG_RESULT(no)]) | |
424 | ||
425 | AC_MSG_CHECKING([for struct if_laddrconf]) | |
426 | AC_TRY_COMPILE( | |
427 | [ #include <sys/types.h> | |
428 | #include <net/if6.h> | |
429 | ], | |
430 | [ struct if_laddrconf a; | |
431 | ], | |
432 | [AC_MSG_RESULT(yes) | |
433 | AC_DEFINE([ISC_PLATFORM_HAVEIF_LADDRCONF], [1], | |
434 | [Define to 1 if the system has 'struct if_laddrconf'.])], | |
435 | [AC_MSG_RESULT(no)]) | |
436 | ||
437 | AC_MSG_CHECKING([for struct if_laddrreq]) | |
438 | AC_TRY_LINK( | |
439 | [#include <sys/types.h> | |
440 | #include <net/if6.h> | |
441 | ], | |
442 | [ struct if_laddrreq a; | |
443 | ], | |
444 | [AC_MSG_RESULT(yes) | |
445 | AC_DEFINE([ISC_PLATFORM_HAVEIF_LADDRREQ], [1], | |
446 | [Define to 1 if the system has 'struct if_laddrreq'.])], | |
447 | [AC_MSG_RESULT(no)]) | |
448 | ||
6dd7efa2 | 449 | # Look for optional headers. |
cff9b78f | 450 | AC_CHECK_HEADERS(sys/socket.h net/if_dl.h net/if6.h regex.h) |
6dd7efa2 | 451 | |
fe5b0fdd DH |
452 | # Solaris needs some libraries for functions |
453 | AC_SEARCH_LIBS(socket, [socket]) | |
454 | AC_SEARCH_LIBS(inet_ntoa, [nsl]) | |
455 | ||
456 | AC_SEARCH_LIBS(inet_aton, [socket nsl], , | |
457 | AC_DEFINE([NEED_INET_ATON], [1], | |
458 | [Define to 1 if the inet_aton() function is missing.])) | |
459 | ||
dd328225 DH |
460 | # Check for a standalone regex library. |
461 | AC_SEARCH_LIBS(regcomp, [regex]) | |
462 | ||
2394b26b DH |
463 | # For HP/UX we need -lipv6 for if_nametoindex, perhaps others. |
464 | AC_SEARCH_LIBS(if_nametoindex, [ipv6]) | |
465 | ||
fe5b0fdd DH |
466 | # check for /dev/random (declares HAVE_DEV_RANDOM) |
467 | AC_CHECK_FILE(/dev/random, | |
468 | AC_DEFINE([HAVE_DEV_RANDOM], [1], | |
469 | [Define to 1 if you have the /dev/random file.])) | |
470 | ||
471 | # see if there is a "sa_len" field in our interface information structure | |
472 | AC_CHECK_MEMBER(struct sockaddr.sa_len, | |
473 | AC_DEFINE([HAVE_SA_LEN], [], | |
474 | [Define to 1 if the sockaddr structure has a length field.]), | |
475 | , | |
476 | [#include <sys/socket.h>]) | |
477 | ||
76c944da SK |
478 | # figure out pointer size |
479 | AC_CHECK_SIZEOF(struct iaddr *, , [ | |
480 | #include "includes/inet.h" | |
481 | #include <stdio.h> | |
482 | ]) | |
483 | ||
847e7000 SK |
484 | # Solaris does not have the msg_control or msg_controlen members in |
485 | # in the msghdr structure unless you define: | |
486 | # | |
487 | # _XOPEN_SOURCE, _XOPEN_SOURCE_EXTENDED, and __EXTENSIONS__ | |
488 | # | |
489 | # See the "standards" man page for details. | |
490 | # | |
491 | # We check for the msg_control member, and if it is not found, we check | |
492 | # again with the appropriate defines added to the CFLAGS. (In order to | |
493 | # do this we have to remove the check from the cache, which is what the | |
494 | # "unset" is for.) | |
495 | AC_CHECK_MEMBER(struct msghdr.msg_control,, | |
496 | [CFLAGS="$CFLAGS -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1" | |
497 | CFLAGS="$CFLAGS -D__EXTENSIONS__" | |
498 | unset ac_cv_member_struct_msghdr_msg_control | |
499 | AC_CHECK_MEMBER(struct msghdr.msg_control,, | |
500 | [AC_MSG_ERROR([Missing msg_control member in | |
501 | msg_control structure.])], | |
06eb8bab SK |
502 | [ |
503 | #include <sys/types.h> | |
504 | #include <sys/socket.h> | |
505 | ]) | |
506 | ], | |
507 | [ | |
508 | #include <sys/types.h> | |
509 | #include <sys/socket.h> | |
510 | ]) | |
847e7000 | 511 | |
93eda9ab | 512 | libbind= |
98bf1607 SR |
513 | AC_ARG_WITH(libbind, |
514 | AC_HELP_STRING([--with-libbind=PATH], | |
515 | [bind includes and libraries are in PATH | |
516 | (default is ./bind)]), | |
517 | use_libbind="$withval", use_libbind="no") | |
518 | case "$use_libbind" in | |
519 | yes) | |
520 | libbind="\${top_srcdir}/bind" | |
521 | ;; | |
522 | no) | |
523 | libbind="\${top_srcdir}/bind" | |
524 | ;; | |
525 | *) | |
526 | libbind="$use_libbind" | |
527 | ;; | |
528 | esac | |
529 | ||
33692791 DH |
530 | # OpenLDAP support. |
531 | AC_ARG_WITH(ldap, | |
532 | AC_HELP_STRING([--with-ldap], | |
533 | [enable OpenLDAP support in dhcpd (default is no)]), | |
534 | [ldap=$withval], | |
535 | [ldap=no]) | |
536 | ||
537 | # OpenLDAP with SSL support. | |
538 | AC_ARG_WITH(ldapcrypto, | |
539 | AC_HELP_STRING([--with-ldapcrypto], | |
540 | [enable OpenLDAP crypto support in dhcpd (default is no)]), | |
541 | [ldapcrypto=$withval], | |
542 | [ldapcrypto=no]) | |
543 | ||
544 | # OpenLDAP support is disabled by default, if enabled then SSL support is an | |
545 | # extra optional that is also disabled by default. Enabling LDAP SSL support | |
546 | # implies enabling LDAP support. | |
547 | if test x$ldap = xyes || test x$ldapcrypto = xyes ; then | |
548 | AC_SEARCH_LIBS(ldap_initialize, [ldap], , | |
549 | AC_MSG_FAILURE([*** Cannot find ldap_initialize with -lldap - do you need to install an OpenLDAP2 Devel package?])) | |
8a0d9ca4 SR |
550 | AC_SEARCH_LIBS(ber_pvt_opt_on, [lber], , |
551 | AC_MSG_FAILURE([*** Cannot find ber_pvt_opt_on with -llber - do you need to install an OpenLDAP2 Devel package?])) | |
33692791 DH |
552 | |
553 | if test x$ldapcrypto = xyes ; then | |
554 | AC_SUBST(LDAP_CFLAGS, ["-DLDAP_CONFIGURATION -DLDAP_USE_SSL"]) | |
555 | else | |
556 | AC_SUBST(LDAP_CFLAGS, ["-DLDAP_CONFIGURATION"]) | |
557 | fi | |
558 | fi | |
559 | ||
eaf7eb17 DH |
560 | # Append selected warning levels to CFLAGS before substitution (but after |
561 | # AC_TRY_COMPILE & etc). | |
562 | CFLAGS="$CFLAGS $STD_CWARNINGS" | |
563 | ||
98bf1607 SR |
564 | # Try to add the bind include directory |
565 | CFLAGS="$CFLAGS -I$libbind/include" | |
566 | ||
a3528574 SR |
567 | AC_C_FLEXIBLE_ARRAY_MEMBER |
568 | ||
6ecda39c | 569 | AC_OUTPUT([ |
fe5b0fdd DH |
570 | Makefile |
571 | client/Makefile | |
572 | common/Makefile | |
6e999c3c | 573 | common/tests/Makefile |
fe5b0fdd DH |
574 | dhcpctl/Makefile |
575 | dst/Makefile | |
576 | includes/Makefile | |
fe5b0fdd DH |
577 | omapip/Makefile |
578 | relay/Makefile | |
579 | server/Makefile | |
6e999c3c | 580 | tests/Makefile |
6ecda39c | 581 | ]) |
fe5b0fdd | 582 | |
95bba8b6 | 583 | sh util/bindvar.sh |