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