]> The Tcpdump Group git mirrors - tcpdump/blob - configure.ac
autotools: use pkg-config and Homebrew when looking for libcrypto.
[tcpdump] / configure.ac
1 dnl Copyright (c) 1994, 1995, 1996, 1997
2 dnl The Regents of the University of California. All rights reserved.
3 dnl
4 dnl Process this file with autoconf to produce a configure script.
5 dnl
6
7 #
8 # See
9 #
10 # https://ftp.gnu.org/gnu/config/README
11 #
12 # for the URLs to use to fetch new versions of config.guess and
13 # config.sub.
14 #
15
16 AC_PREREQ([2.69])
17 AC_INIT([tcpdump],[m4_esyscmd_s(cat VERSION)])
18 AC_CONFIG_SRCDIR(tcpdump.c)
19
20 AC_CANONICAL_HOST
21
22 AC_LBL_C_INIT_BEFORE_CC(V_INCLS)
23 #
24 # Try to enable as many C99 features as we can.
25 # At minimum, we want C++/C99-style // comments.
26 #
27 AC_PROG_CC_C99
28 if test "$ac_cv_prog_cc_c99" = "no"; then
29 AC_MSG_WARN([The C compiler does not support C99; there may be compiler errors])
30 fi
31 AC_LBL_C_INIT(V_CCOPT, V_INCLS)
32 AC_LBL_C_INLINE
33
34 AC_CHECK_HEADERS(rpc/rpc.h rpc/rpcent.h net/if.h)
35 #
36 # Get the size of a void *, to know whether this is a 32-bit or 64-bit build.
37 #
38 AC_CHECK_SIZEOF([void *])
39
40 #
41 # Get the size of a time_t, to know whether it's 32-bit or 64-bit.
42 #
43 AC_CHECK_SIZEOF([time_t],,[#include <time.h>])
44
45 case "$host_os" in
46
47 darwin*)
48 AC_ARG_ENABLE(universal,
49 AS_HELP_STRING([--disable-universal],[don't build universal on macOS]))
50 if test "$enable_universal" != "no"; then
51 case "$host_os" in
52
53 darwin9.*)
54 #
55 # Leopard. Build for x86 and 32-bit PowerPC, with
56 # x86 first. (That's what Apple does.)
57 #
58 V_CCOPT="$V_CCOPT -arch i386 -arch ppc"
59 LDFLAGS="$LDFLAGS -arch i386 -arch ppc"
60 ;;
61
62 darwin10.*)
63 #
64 # Snow Leopard. Build for x86-64 and x86, with
65 # x86-64 first. (That's what Apple does.)
66 #
67 V_CCOPT="$V_CCOPT -arch x86_64 -arch i386"
68 LDFLAGS="$LDFLAGS -arch x86_64 -arch i386"
69 ;;
70 esac
71 fi
72 ;;
73 esac
74
75 #
76 # Do we have pkg-config?
77 #
78 PKG_PROG_PKG_CONFIG
79
80 #
81 # Do we have the brew command from Homebrew?
82 #
83 AC_PATH_PROG([BREW], [brew])
84
85 AC_ARG_WITH([smi],
86 [AS_HELP_STRING([--with-smi],
87 [link with libsmi (allows to load MIBs on the fly to decode SNMP packets) [default=yes, if available]])],
88 [],
89 [with_smi=yes])
90
91 if test "x$with_smi" != "xno" ; then
92 AC_CHECK_HEADER(smi.h,
93 [
94 #
95 # OK, we found smi.h. Do we have libsmi with smiInit?
96 #
97 AC_CHECK_LIB(smi, smiInit,
98 [
99 #
100 # OK, we have libsmi with smiInit. Can we use it?
101 #
102 AC_MSG_CHECKING([whether to enable libsmi])
103 savedlibs="$LIBS"
104 LIBS="-lsmi $LIBS"
105 AC_RUN_IFELSE([AC_LANG_SOURCE([[
106 /* libsmi available check */
107 #include <stdio.h>
108 #include <stdlib.h>
109 #include <string.h>
110 #include <smi.h>
111 int main()
112 {
113 int current, revision, age, n;
114 const int required = 2;
115 if (smiInit(""))
116 exit(1);
117 if (strcmp(SMI_LIBRARY_VERSION, smi_library_version))
118 exit(2);
119 n = sscanf(smi_library_version, "%d:%d:%d", &current, &revision, &age);
120 if (n != 3)
121 exit(3);
122 if (required < current - age || required > current)
123 exit(4);
124 exit(0);
125 }
126 ]])
127 ],
128 [
129 AC_MSG_RESULT(yes)
130 AC_DEFINE(USE_LIBSMI, 1,
131 [Define if you enable support for libsmi])
132 ],
133 [
134 dnl autoconf documentation says that
135 dnl $? contains the exit value.
136 dnl reality is that it does not.
137 dnl We leave this in just in case
138 dnl autoconf ever comes back to
139 dnl match the documentation.
140 case $? in
141 1) AC_MSG_RESULT(no - smiInit failed) ;;
142 2) AC_MSG_RESULT(no - header/library version mismatch) ;;
143 3) AC_MSG_RESULT(no - can't determine library version) ;;
144 4) AC_MSG_RESULT(no - too old) ;;
145 *) AC_MSG_RESULT(no) ;;
146 esac
147 LIBS="$savedlibs"
148 ],
149 [
150 AC_MSG_RESULT(not when cross-compiling)
151 LIBS="$savedlibs"
152 ]
153 )
154 ])
155 ])
156 fi
157
158 AC_MSG_CHECKING([whether to enable the instrument functions code])
159 AC_ARG_ENABLE([instrument-functions],
160 [AS_HELP_STRING([--enable-instrument-functions],
161 [enable instrument functions code [default=no]])],
162 [],
163 [enableval=no])
164 case "$enableval" in
165 yes) AC_MSG_RESULT(yes)
166 AC_CHECK_LIB([bfd], [bfd_init],
167 [true],
168 [AC_MSG_ERROR(
169 [--enable-instrument-functions was given, but test for library libbfd failed. Please install the 'binutils-dev' package.])],
170 [])
171 AC_DEFINE(ENABLE_INSTRUMENT_FUNCTIONS, 1,
172 [define if you want to build the instrument functions code])
173 LOCALSRC="$LOCALSRC instrument-functions.c"
174 # Add '-finstrument-functions' instrumentation option to generate
175 # instrumentation calls for entry and exit to functions.
176 # Try to avoid Address Space Layout Randomization (ALSR).
177 CFLAGS="$CFLAGS -O0 -ggdb -finstrument-functions -fno-stack-protector -fno-pic"
178 LDFLAGS="$LDFLAGS -O0 -ggdb -fno-stack-protector -no-pie"
179 LIBS="$LIBS -lbfd"
180 ;;
181 *) AC_MSG_RESULT(no)
182 ;;
183 esac
184
185 AC_MSG_CHECKING([whether to enable the possibly-buggy SMB printer])
186 AC_ARG_ENABLE([smb],
187 [AS_HELP_STRING([--enable-smb],
188 [enable possibly-buggy SMB printer [default=no]])],
189 [],
190 [enableval=no])
191 case "$enableval" in
192 yes) AC_MSG_RESULT(yes)
193 AC_DEFINE(ENABLE_SMB, 1,
194 [define if you want to build the possibly-buggy SMB printer])
195 LOCALSRC="print-smb.c smbutil.c $LOCALSRC"
196 ;;
197 *) AC_MSG_RESULT(no)
198 ;;
199 esac
200
201 AC_MSG_CHECKING([whether to drop root privileges by default])
202 AC_ARG_WITH(
203 [user],
204 [AS_HELP_STRING([--with-user=USERNAME],
205 [drop privileges by default to USERNAME]
206 )],
207 [],
208 [withval=no])
209 AS_CASE(["$withval"],
210 [no], [AC_MSG_RESULT(no)],
211 [''|yes], [AC_MSG_ERROR([--with-user requires a username])],
212 [
213 AC_DEFINE_UNQUOTED(WITH_USER, "$withval",
214 [define if should drop privileges by default])
215 AC_MSG_RESULT([yes, to user "$withval"])
216 ]
217 )
218
219 AC_MSG_CHECKING([whether to chroot])
220 AC_ARG_WITH(
221 [chroot],
222 [AS_HELP_STRING([--with-chroot=DIRECTORY],
223 [when dropping privileges, chroot to DIRECTORY]
224 )],
225 [],
226 [withval=no]
227 )
228 AS_CASE(["$withval"],
229 [no], [AC_MSG_RESULT(no)],
230 [''|yes], [AC_MSG_ERROR([--with-chroot requires a directory])],
231 [
232 AC_DEFINE_UNQUOTED(WITH_CHROOT, "$withval",
233 [define if should chroot when dropping privileges])
234 AC_MSG_RESULT([yes, to directory "$withval"])
235 ]
236 )
237
238 AC_ARG_WITH(sandbox-capsicum,
239 AS_HELP_STRING([--with-sandbox-capsicum],
240 [use Capsicum security functions @<:@default=yes, if available@:>@]))
241 #
242 # Check whether various functions are available. If any are, set
243 # ac_lbl_capsicum_function_seen to yes; if any are not, set
244 # ac_lbl_capsicum_function_not_seen to yes.
245 #
246 # We don't check cap_rights_init(), as it's a macro, wrapping another
247 # function, in at least some versions of FreeBSD, and AC_CHECK_FUNCS()
248 # doesn't handle that.
249 #
250 # All of the ones we check for must be available in order to enable
251 # capsicum sandboxing.
252 #
253 # XXX - do we need to check for all of them, or are there some that, if
254 # present, imply others are present?
255 #
256 if test -z "$with_sandbox_capsicum" || test "$with_sandbox_capsicum" != "no" ; then
257 #
258 # First, make sure we have the required header.
259 #
260 AC_CHECK_HEADER(sys/capsicum.h,
261 [
262 #
263 # We do; now make sure we have the required functions.
264 #
265 AC_CHECK_FUNCS(cap_enter cap_rights_limit cap_ioctls_limit openat,
266 ac_lbl_capsicum_function_seen=yes,
267 ac_lbl_capsicum_function_not_seen=yes)
268 ])
269 AC_CHECK_LIB(casper, cap_init, LIBS="$LIBS -lcasper")
270 AC_CHECK_LIB(cap_dns, cap_gethostbyaddr, LIBS="$LIBS -lcap_dns")
271 fi
272 AC_MSG_CHECKING([whether to sandbox using capsicum])
273 if test "x$ac_lbl_capsicum_function_seen" = "xyes" -a "x$ac_lbl_capsicum_function_not_seen" != "xyes"; then
274 AC_DEFINE(HAVE_CAPSICUM, 1, [capsicum support available])
275 AC_MSG_RESULT(yes)
276 else
277 AC_MSG_RESULT(no)
278 fi
279 AC_MSG_CHECKING([whether to sandbox using Casper library])
280 if test "x$ac_cv_lib_casper_cap_init" = "xyes" -a "x$ac_cv_lib_cap_dns_cap_gethostbyaddr" = "xyes"; then
281 AC_DEFINE(HAVE_CASPER, 1, [Casper support available])
282 AC_MSG_RESULT(yes)
283 else
284 AC_MSG_RESULT(no)
285 fi
286
287 #
288 # We must check this before checking whether to check the OS's IPv6,
289 # support because, on some platforms (such as SunOS 5.x), the test
290 # program requires the extra networking libraries.
291 #
292 AC_LBL_LIBRARY_NET
293
294 #
295 # Check whether AF_INET6 and struct in6_addr are defined.
296 # If they aren't both defined, we don't have sufficient OS
297 # support for IPv6, so we don't look for IPv6 support libraries,
298 # and we define AF_INET6 and struct in6_addr ourselves.
299 #
300 AC_MSG_CHECKING([whether the operating system supports IPv6])
301 AC_COMPILE_IFELSE(
302 [
303 AC_LANG_SOURCE(
304 [[
305 #include <string.h>
306 /* AF_INET6 available check */
307 #include <sys/types.h>
308 #ifdef _WIN32
309 #include <ws2tcpip.h>
310 #else
311 #include <sys/socket.h>
312 #include <netinet/in.h>
313 #endif
314 #ifdef AF_INET6
315 void
316 foo(struct in6_addr *addr)
317 {
318 memset(addr, 0, sizeof (struct in6_addr));
319 }
320 #else
321 #error "AF_INET6 not defined"
322 #endif
323 ]])
324 ],
325 [
326 AC_MSG_RESULT(yes)
327 AC_DEFINE(HAVE_OS_IPV6_SUPPORT, 1,
328 [define if the OS provides AF_INET6 and struct in6_addr])
329 ipv6=yes
330 ],
331 [
332 AC_MSG_RESULT(no)
333 ipv6=no
334 ]
335 )
336
337 ipv6type=unknown
338 ipv6lib=none
339 ipv6trylibc=no
340
341 if test "$ipv6" = "yes"; then
342 AC_MSG_CHECKING([ipv6 stack type])
343 for i in inria kame linux-glibc linux-libinet6 toshiba v6d zeta; do
344 case $i in
345 inria)
346 dnl http://www.kame.net/
347 AC_EGREP_CPP(yes,
348 [#include <netinet/in.h>
349 #ifdef IPV6_INRIA_VERSION
350 yes
351 #endif],
352 [ipv6type=$i])
353 ;;
354 kame)
355 dnl http://www.kame.net/
356 AC_EGREP_CPP(yes,
357 [#include <netinet/in.h>
358 #ifdef __KAME__
359 yes
360 #endif],
361 [ipv6type=$i;
362 ipv6lib=inet6;
363 ipv6libdir=/usr/local/v6/lib;
364 ipv6trylibc=yes])
365 ;;
366 linux-glibc)
367 dnl http://www.v6.linux.or.jp/
368 AC_EGREP_CPP(yes,
369 [#include <features.h>
370 #if defined(__GLIBC__) && __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1
371 yes
372 #endif],
373 [ipv6type=$i])
374 ;;
375 linux-libinet6)
376 dnl http://www.v6.linux.or.jp/
377 dnl
378 dnl This also matches Solaris 8 and Tru64 UNIX 5.1,
379 dnl and possibly other versions of those OSes
380 dnl
381 if test -d /usr/inet6 -o -f /usr/include/netinet/ip6.h; then
382 ipv6type=$i
383 ipv6lib=inet6
384 ipv6libdir=/usr/inet6/lib
385 ipv6trylibc=yes;
386 CFLAGS="-I/usr/inet6/include $CFLAGS"
387 fi
388 ;;
389 toshiba)
390 AC_EGREP_CPP(yes,
391 [#include <sys/param.h>
392 #ifdef _TOSHIBA_INET6
393 yes
394 #endif],
395 [ipv6type=$i;
396 ipv6lib=inet6;
397 ipv6libdir=/usr/local/v6/lib])
398 ;;
399 v6d)
400 AC_EGREP_CPP(yes,
401 [#include </usr/local/v6/include/sys/v6config.h>
402 #ifdef __V6D__
403 yes
404 #endif],
405 [ipv6type=$i;
406 ipv6lib=v6;
407 ipv6libdir=/usr/local/v6/lib;
408 CFLAGS="-I/usr/local/v6/include $CFLAGS"])
409 ;;
410 zeta)
411 AC_EGREP_CPP(yes,
412 [#include <sys/param.h>
413 #ifdef _ZETA_MINAMI_INET6
414 yes
415 #endif],
416 [ipv6type=$i;
417 ipv6lib=inet6;
418 ipv6libdir=/usr/local/v6/lib])
419 ;;
420 esac
421 if test "$ipv6type" != "unknown"; then
422 break
423 fi
424 done
425 AC_MSG_RESULT($ipv6type)
426 fi
427
428 if test "$ipv6" = "yes" -a "$ipv6lib" != "none"; then
429 if test -d $ipv6libdir -a -f $ipv6libdir/lib$ipv6lib.a; then
430 LIBS="-L$ipv6libdir -l$ipv6lib $LIBS"
431 echo "You have $ipv6lib library, using it"
432 else
433 if test "$ipv6trylibc" = "yes"; then
434 echo "You do not have $ipv6lib library, using libc"
435 else
436 echo 'Fatal: no $ipv6lib library found. cannot continue.'
437 echo "You need to fetch lib$ipv6lib.a from appropriate"
438 echo 'ipv6 kit and compile beforehand.'
439 exit 1
440 fi
441 fi
442 fi
443
444 AC_REPLACE_FUNCS(strlcat strlcpy strdup strsep getservent getopt_long)
445 AC_CHECK_FUNCS(fork vfork)
446 AC_CHECK_FUNCS(setlinebuf)
447
448 #
449 # Make sure we have snprintf(); we require it.
450 #
451 AC_CHECK_FUNC(snprintf,,
452 AC_MSG_ERROR([snprintf() is required but wasn't found]))
453
454 #
455 # It became apparent at some point that using a suitable C99 compiler does not
456 # automatically mean snprintf(3) implementation in the libc supports all the
457 # modifiers and specifiers used in the project, so let's test that before the
458 # build, not after.
459 #
460 # Testing the sizeof_t length modifier takes making an snprintf() call and
461 # comparing the actual result with the expected result. If this fails, it will
462 # most likely happen at run time, not compile time.
463 #
464 # Testing the 64-bit conversion specifiers in addition to that requires the
465 # <inttypes.h> header to be present and the macros to be defined, so if this
466 # fails, it will more likely happen at compile time.
467 #
468 AC_MSG_CHECKING([whether snprintf is suitable])
469 AC_RUN_IFELSE(
470 [
471 AC_LANG_SOURCE([[
472 #include <stdio.h>
473 #include <string.h>
474 #include <inttypes.h>
475 #include <sys/types.h>
476
477 int main()
478 {
479 char buf[100];
480 uint64_t t = (uint64_t)1 << 32;
481
482 snprintf(buf, sizeof(buf), "%zu", sizeof(buf));
483 if (strncmp(buf, "100", sizeof(buf)))
484 return 1;
485
486 snprintf(buf, sizeof(buf), "%zd", -sizeof(buf));
487 if (strncmp(buf, "-100", sizeof(buf)))
488 return 2;
489
490 snprintf(buf, sizeof(buf), "%" PRId64, -t);
491 if (strncmp(buf, "-4294967296", sizeof(buf)))
492 return 3;
493
494 snprintf(buf, sizeof(buf), "0o%" PRIo64, t);
495 if (strncmp(buf, "0o40000000000", sizeof(buf)))
496 return 4;
497
498 snprintf(buf, sizeof(buf), "0x%" PRIx64, t);
499 if (strncmp(buf, "0x100000000", sizeof(buf)))
500 return 5;
501
502 snprintf(buf, sizeof(buf), "%" PRIu64, t);
503 if (strncmp(buf, "4294967296", sizeof(buf)))
504 return 6;
505
506 return 0;
507 }
508 ]])
509 ],
510 [
511 AC_MSG_RESULT(yes)
512 ],
513 [
514 AC_MSG_RESULT(no)
515 AC_MSG_ERROR(
516 [The snprintf(3) implementation in this libc is not suitable,
517 tcpdump would not work correctly even if it managed to compile.])
518 ],
519 [
520 AC_MSG_RESULT(not while cross-compiling)
521 ]
522 )
523
524 AC_CHECK_LIB(rpc, main) dnl It's unclear why we might need -lrpc
525
526 dnl Some platforms may need -lnsl for getrpcbynumber.
527 AC_SEARCH_LIBS(getrpcbynumber, nsl,
528 AC_DEFINE(HAVE_GETRPCBYNUMBER, 1, [define if you have getrpcbynumber()]))
529
530 AC_LBL_LIBPCAP(V_PCAPDEP, V_INCLS)
531
532 #
533 # Check for these after AC_LBL_LIBPCAP, so we link with the appropriate
534 # libraries (e.g., "-lsocket -lnsl" on Solaris).
535 #
536 # You are in a twisty little maze of UN*Xes, all different.
537 # Some might not have ether_ntohost().
538 # Some might have it and declare it in <net/ethernet.h>.
539 # Some might have it and declare it in <netinet/ether.h>
540 # Some might have it and declare it in <sys/ethernet.h>.
541 # Some might have it and declare it in <arpa/inet.h>.
542 # Some might have it and declare it in <netinet/if_ether.h>.
543 # Some might have it and not declare it in any header file.
544 #
545 # Before you is a C compiler.
546 #
547 AC_CHECK_FUNCS(ether_ntohost, [
548 AC_CACHE_CHECK(for buggy ether_ntohost, ac_cv_buggy_ether_ntohost, [
549 AC_RUN_IFELSE([AC_LANG_SOURCE([[
550 #include <netdb.h>
551 #include <netinet/ether.h>
552 #include <stdlib.h>
553 #include <sys/types.h>
554 #include <sys/param.h>
555 #include <sys/socket.h>
556
557 int
558 main(int argc, char **argv)
559 {
560 u_char ea[6] = { 0xff, 0xff, 0xff, 0xff, 0xff };
561 char name[MAXHOSTNAMELEN];
562
563 ether_ntohost(name, (struct ether_addr *)ea);
564 exit(0);
565 }
566 ]])
567 ], [ac_cv_buggy_ether_ntohost=no],
568 [ac_cv_buggy_ether_ntohost=yes],
569 [ac_cv_buggy_ether_ntohost="not while cross-compiling"])])
570 if test "$ac_cv_buggy_ether_ntohost" = "no"; then
571 AC_DEFINE(USE_ETHER_NTOHOST, 1,
572 [define if you have ether_ntohost() and it works])
573 fi
574 ])
575 if test "$ac_cv_func_ether_ntohost" = yes -a \
576 "$ac_cv_buggy_ether_ntohost" = "no"; then
577 #
578 # OK, we have ether_ntohost(). Is it declared in <net/ethernet.h>?
579 #
580 # This test fails if we don't have <net/ethernet.h> or if we do
581 # but it doesn't declare ether_ntohost().
582 #
583 AC_CHECK_DECL(ether_ntohost,
584 [
585 AC_DEFINE(NET_ETHERNET_H_DECLARES_ETHER_NTOHOST,,
586 [Define to 1 if net/ethernet.h declares `ether_ntohost'])
587 ],,
588 [
589 #include <net/ethernet.h>
590 ])
591 #
592 # Did that succeed?
593 #
594 if test "$ac_cv_have_decl_ether_ntohost" != yes; then
595 #
596 # No, how about <netinet/ether.h>, as on Linux?
597 #
598 # This test fails if we don't have <netinet/ether.h>
599 # or if we do but it doesn't declare ether_ntohost().
600 #
601 # Unset ac_cv_have_decl_ether_ntohost so we don't
602 # treat the previous failure as a cached value and
603 # suppress the next test.
604 #
605 unset ac_cv_have_decl_ether_ntohost
606 AC_CHECK_DECL(ether_ntohost,
607 [
608 AC_DEFINE(NETINET_ETHER_H_DECLARES_ETHER_NTOHOST,1,
609 [Define to 1 if netinet/ether.h declares `ether_ntohost'])
610 ],,
611 [
612 #include <netinet/ether.h>
613 ])
614 fi
615 #
616 # Did that succeed?
617 #
618 if test "$ac_cv_have_decl_ether_ntohost" != yes; then
619 #
620 # No, how about <sys/ethernet.h>, as on Solaris 10
621 # and later?
622 #
623 # This test fails if we don't have <sys/ethernet.h>
624 # or if we do but it doesn't declare ether_ntohost().
625 #
626 # Unset ac_cv_have_decl_ether_ntohost so we don't
627 # treat the previous failure as a cached value and
628 # suppress the next test.
629 #
630 unset ac_cv_have_decl_ether_ntohost
631 AC_CHECK_DECL(ether_ntohost,
632 [
633 AC_DEFINE(SYS_ETHERNET_H_DECLARES_ETHER_NTOHOST,,
634 [Define to 1 if sys/ethernet.h declares `ether_ntohost'])
635 ],,
636 [
637 #include <sys/ethernet.h>
638 ])
639 fi
640 #
641 # Did that succeed?
642 #
643 if test "$ac_cv_have_decl_ether_ntohost" != yes; then
644 #
645 # No, how about <arpa/inet.h>, as in AIX?
646 #
647 # This test fails if we don't have <arpa/inet.h>
648 # (if we have ether_ntohost(), we should have
649 # networking, and if we have networking, we should
650 # have <arpa/inet.h>) or if we do but it doesn't
651 # declare ether_ntohost().
652 #
653 # Unset ac_cv_have_decl_ether_ntohost so we don't
654 # treat the previous failure as a cached value and
655 # suppress the next test.
656 #
657 unset ac_cv_have_decl_ether_ntohost
658 AC_CHECK_DECL(ether_ntohost,
659 [
660 AC_DEFINE(ARPA_INET_H_DECLARES_ETHER_NTOHOST,,
661 [Define to 1 if arpa/inet.h declares `ether_ntohost'])
662 ],,
663 [
664 #include <arpa/inet.h>
665 ])
666 fi
667 #
668 # Did that succeed?
669 #
670 if test "$ac_cv_have_decl_ether_ntohost" != yes; then
671 #
672 # No, how about <netinet/if_ether.h>?
673 # On some platforms, it requires <net/if.h> and
674 # <netinet/in.h>, and we always include it with
675 # both of them, so test it with both of them.
676 #
677 # This test fails if we don't have <netinet/if_ether.h>
678 # and the headers we include before it, or if we do but
679 # <netinet/if_ether.h> doesn't declare ether_hostton().
680 #
681 # Unset ac_cv_have_decl_ether_ntohost so we don't
682 # treat the previous failure as a cached value and
683 # suppress the next test.
684 #
685 unset ac_cv_have_decl_ether_ntohost
686 AC_CHECK_DECL(ether_ntohost,
687 [
688 AC_DEFINE(NETINET_IF_ETHER_H_DECLARES_ETHER_NTOHOST,,
689 [Define to 1 if netinet/if_ether.h declares `ether_ntohost'])
690 ],,
691 [
692 #include <sys/types.h>
693 #include <sys/socket.h>
694 #include <net/if.h>
695 #include <netinet/in.h>
696 #include <netinet/if_ether.h>
697 ])
698 fi
699 #
700 # After all that, is ether_ntohost() declared?
701 #
702 if test "$ac_cv_have_decl_ether_ntohost" = yes; then
703 #
704 # Yes.
705 #
706 AC_DEFINE(HAVE_DECL_ETHER_NTOHOST, 1,
707 [Define to 1 if you have the declaration of `ether_ntohost'])
708 else
709 #
710 # No, we'll have to declare it ourselves.
711 # Do we have "struct ether_addr" if we include
712 # <netinet/if_ether.h>?
713 #
714 AC_CHECK_TYPES(struct ether_addr,,,
715 [
716 #include <sys/types.h>
717 #include <sys/socket.h>
718 #include <net/if.h>
719 #include <netinet/in.h>
720 #include <netinet/if_ether.h>
721 ])
722 fi
723 fi
724
725 dnl
726 dnl Check for "pcap_list_datalinks()" and use a substitute version if
727 dnl it's not present. If it is present, check for "pcap_free_datalinks()";
728 dnl if it's not present, we don't replace it for now. (We could do so
729 dnl on UN*X, but not on Windows, where hilarity ensues if a program
730 dnl built with one version of the MSVC support library tries to free
731 dnl something allocated by a library built with another version of
732 dnl the MSVC support library.)
733 dnl
734 AC_CHECK_FUNC(pcap_list_datalinks,
735 [
736 AC_DEFINE(HAVE_PCAP_LIST_DATALINKS, 1,
737 [define if libpcap has pcap_list_datalinks()])
738 AC_CHECK_FUNCS(pcap_free_datalinks)
739 ],
740 [
741 AC_LIBOBJ(datalinks)
742 ])
743
744 dnl
745 dnl Check for "pcap_datalink_name_to_val()", and use a substitute
746 dnl version if it's not present. If it is present, check for
747 dnl "pcap_datalink_val_to_description()", and if we don't have it,
748 dnl use a substitute version.
749 dnl
750 AC_CHECK_FUNC(pcap_datalink_name_to_val,
751 [
752 AC_DEFINE(HAVE_PCAP_DATALINK_NAME_TO_VAL, 1,
753 [define if libpcap has pcap_datalink_name_to_val()])
754 AC_CHECK_FUNC(pcap_datalink_val_to_description,
755 AC_DEFINE(HAVE_PCAP_DATALINK_VAL_TO_DESCRIPTION, 1,
756 [define if libpcap has pcap_datalink_val_to_description()]),
757 [
758 AC_LIBOBJ(dlnames)
759 ])
760 ],
761 [
762 AC_LIBOBJ(dlnames)
763 ])
764
765 dnl
766 dnl Check for "pcap_set_datalink()"; you can't substitute for it if
767 dnl it's absent (it has hooks into libpcap), so just define the
768 dnl HAVE_ value if it's there.
769 dnl
770 AC_CHECK_FUNCS(pcap_set_datalink)
771
772 dnl
773 dnl Check for "pcap_breakloop()"; you can't substitute for it if
774 dnl it's absent (it has hooks into the live capture routines),
775 dnl so just define the HAVE_ value if it's there.
776 dnl
777 AC_CHECK_FUNCS(pcap_breakloop)
778
779 #
780 # Do we have the new open API? Check for pcap_create, and assume that,
781 # if we do, we also have pcap_activate() and the other new routines
782 # introduced in libpcap 1.0.0.
783 #
784 AC_CHECK_FUNCS(pcap_create)
785 if test $ac_cv_func_pcap_create = "yes" ; then
786 #
787 # OK, do we have pcap_set_tstamp_type? If so, assume we have
788 # pcap_list_tstamp_types and pcap_free_tstamp_types as well.
789 #
790 AC_CHECK_FUNCS(pcap_set_tstamp_type)
791 #
792 # And do we have pcap_set_tstamp_precision? If so, we assume
793 # we also have pcap_open_offline_with_tstamp_precision.
794 #
795 AC_CHECK_FUNCS(pcap_set_tstamp_precision)
796 fi
797
798 #
799 # Check for a miscellaneous collection of functions which we use
800 # if we have them.
801 #
802 AC_CHECK_FUNCS(pcap_findalldevs)
803 AC_CHECK_FUNCS(pcap_dump_flush pcap_lib_version)
804 if test $ac_cv_func_pcap_lib_version = "no" ; then
805 AC_MSG_CHECKING(whether pcap_version is defined by libpcap)
806 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[
807 extern char pcap_version[];
808
809 return (int)pcap_version;
810 ]])
811 ],
812 [ac_lbl_cv_pcap_version_defined=yes],
813 [ac_lbl_cv_pcap_version_defined=no])
814 if test "$ac_lbl_cv_pcap_version_defined" = yes ; then
815 AC_MSG_RESULT(yes)
816 AC_DEFINE(HAVE_PCAP_VERSION, 1, [define if libpcap has pcap_version])
817 else
818 AC_MSG_RESULT(no)
819 fi
820 fi
821 AC_CHECK_FUNCS(pcap_setdirection pcap_set_immediate_mode pcap_dump_ftell64)
822 #
823 # See the comment in AC_LBL_LIBPCAP in aclocal.m4 for the reason
824 # why we don't check for remote-capture APIs if we're building
825 # with the system libpcap on macOS.
826 #
827 if test "$_dont_check_for_remote_apis" != "yes"; then
828 AC_CHECK_FUNCS(pcap_open pcap_findalldevs_ex)
829 fi
830 AC_REPLACE_FUNCS(pcap_dump_ftell)
831
832 #
833 # Check for special debugging functions
834 #
835 AC_CHECK_FUNCS(pcap_set_parser_debug)
836 if test "$ac_cv_func_pcap_set_parser_debug" = "no" ; then
837 #
838 # OK, we don't have pcap_set_parser_debug() to set the libpcap
839 # filter expression parser debug flag; can we directly set the
840 # flag?
841 AC_MSG_CHECKING(whether pcap_debug is defined by libpcap)
842 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[
843 extern int pcap_debug;
844
845 return pcap_debug;
846 ]])
847 ],
848 [ac_lbl_cv_pcap_debug_defined=yes],
849 [ac_lbl_cv_pcap_debug_defined=no])
850 if test "$ac_lbl_cv_pcap_debug_defined" = yes ; then
851 AC_MSG_RESULT(yes)
852 AC_DEFINE(HAVE_PCAP_DEBUG, 1, [define if libpcap has pcap_debug])
853 else
854 AC_MSG_RESULT(no)
855 #
856 # OK, what about "yydebug"?
857 #
858 AC_MSG_CHECKING(whether yydebug is defined by libpcap)
859 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[
860 extern int yydebug;
861
862 return yydebug;
863 ]])
864 ],
865 [ac_lbl_cv_yydebug_defined=yes],
866 [ac_lbl_cv_yydebug_defined=no])
867 if test "$ac_lbl_cv_yydebug_defined" = yes ; then
868 AC_MSG_RESULT(yes)
869 AC_DEFINE(HAVE_YYDEBUG, 1, [define if libpcap has yydebug])
870 else
871 AC_MSG_RESULT(no)
872 fi
873 fi
874 fi
875 AC_CHECK_FUNCS(pcap_set_optimizer_debug)
876 AC_REPLACE_FUNCS(bpf_dump) dnl moved to libpcap in 0.6
877
878 V_GROUP=0
879 if test -f /etc/group -a ! -z "`grep '^wheel:' /etc/group`" ; then
880 V_GROUP=wheel
881 fi
882 #
883 # Assume V7/BSD convention for man pages (file formats in section 5,
884 # miscellaneous info in section 7).
885 #
886 MAN_FILE_FORMATS=5
887 MAN_MISC_INFO=7
888 case "$host_os" in
889
890 aix*)
891 dnl Workaround to enable certain features
892 AC_DEFINE(_SUN,1,[define on AIX to get certain functions])
893 ;;
894
895 hpux*)
896 #
897 # Use System V conventions for man pages.
898 #
899 MAN_FILE_FORMATS=4
900 MAN_MISC_INFO=5
901 ;;
902
903 irix*)
904 V_GROUP=sys
905
906 #
907 # Use System V conventions for man pages.
908 #
909 MAN_FILE_FORMATS=4
910 MAN_MISC_INFO=5
911 ;;
912
913 osf*)
914 V_GROUP=system
915
916 #
917 # Use System V conventions for man pages.
918 #
919 MAN_FILE_FORMATS=4
920 MAN_MISC_INFO=5
921 ;;
922
923 solaris*)
924 V_GROUP=sys
925
926 #
927 # Use System V conventions for man pages.
928 #
929 MAN_FILE_FORMATS=4
930 MAN_MISC_INFO=5
931 ;;
932 esac
933
934 if test -f /dev/bpf0 ; then
935 V_GROUP=bpf
936 fi
937
938 #
939 # Make sure we have a definition for C99's uintptr_t (regardless of
940 # whether the environment is a C99 environment or not).
941 #
942 AC_TYPE_UINTPTR_T
943
944 savedcppflags="$CPPFLAGS"
945 CPPFLAGS="$CPPFLAGS $V_INCLS"
946
947 #
948 # Check whether we have pcap/pcap-inttypes.h.
949 # If we do, we use that to get the C99 types defined.
950 #
951 AC_CHECK_HEADERS(pcap/pcap-inttypes.h)
952
953 #
954 # At compile time HAVE_PCAP_FINDALLDEVS depends on HAVE_PCAP_IF_T.
955 #
956 AC_CHECK_TYPES(pcap_if_t, , , [#include <pcap.h>])
957
958 CPPFLAGS="$savedcppflags"
959
960 #
961 # Define the old BSD specified-width types in terms of the C99 types;
962 # we may need them with libpcap include files.
963 #
964 AC_CHECK_TYPE([u_int8_t], ,
965 [AC_DEFINE([u_int8_t], [uint8_t],
966 [Define to `uint8_t' if u_int8_t not defined.])],
967 [AC_INCLUDES_DEFAULT
968 #include <sys/types.h>
969 ])
970 AC_CHECK_TYPE([u_int16_t], ,
971 [AC_DEFINE([u_int16_t], [uint16_t],
972 [Define to `uint16_t' if u_int16_t not defined.])],
973 [AC_INCLUDES_DEFAULT
974 #include <sys/types.h>
975 ])
976 AC_CHECK_TYPE([u_int32_t], ,
977 [AC_DEFINE([u_int32_t], [uint32_t],
978 [Define to `uint32_t' if u_int32_t not defined.])],
979 [AC_INCLUDES_DEFAULT
980 #include <sys/types.h>
981 ])
982 AC_CHECK_TYPE([u_int64_t], ,
983 [AC_DEFINE([u_int64_t], [uint64_t],
984 [Define to `uint64_t' if u_int64_t not defined.])],
985 [AC_INCLUDES_DEFAULT
986 #include <sys/types.h>
987 ])
988
989 AC_PROG_RANLIB
990 AC_CHECK_TOOL([AR], [ar])
991
992 AC_LBL_DEVEL(V_CCOPT)
993
994 # Check for OpenSSL/libressl libcrypto
995 AC_MSG_CHECKING(whether to use OpenSSL/libressl libcrypto)
996 # Specify location for both includes and libraries.
997 want_libcrypto=ifavailable
998 AC_ARG_WITH(crypto,
999 AS_HELP_STRING([--with-crypto]@<:@=DIR@:>@,
1000 [use OpenSSL/libressl libcrypto (located in directory DIR, if specified) @<:@default=yes, if available@:>@]),
1001 [
1002 if test $withval = no
1003 then
1004 # User doesn't want to link with libcrypto.
1005 want_libcrypto=no
1006 AC_MSG_RESULT(no)
1007 elif test $withval = yes
1008 then
1009 # User wants to link with libcrypto but hasn't specified
1010 # a directory.
1011 want_libcrypto=yes
1012 AC_MSG_RESULT(yes)
1013 else
1014 # User wants to link with libcrypto and has specified
1015 # a directory, so use the provided value.
1016 want_libcrypto=yes
1017 libcrypto_root=$withval
1018 AC_MSG_RESULT([yes, using the version installed in $withval])
1019 fi
1020 ],[
1021 #
1022 # Use libcrypto if it's present, otherwise don't; no directory
1023 # was specified.
1024 #
1025 want_libcrypto=ifavailable
1026 AC_MSG_RESULT([yes, if available])
1027 ])
1028 if test "$want_libcrypto" != "no"; then
1029 #
1030 # Were we told where to look for libcrypto?
1031 #
1032 if test -z "$libcrypto_root"; then
1033 #
1034 # No.
1035 #
1036 # First, try looking for it with pkg-config, if we have it.
1037 #
1038 # Homebrew's pkg-config does not, by default, look for
1039 # pkg-config files for packages it has installed.
1040 # Furthermore, at least for OpenSSL, they appear to be
1041 # dumped in package-specific directories whose paths are
1042 # not only package-specific but package-version-specific.
1043 #
1044 # So the only way to find openssl is to get the value of
1045 # PKG_CONFIG_PATH from "brew --env openssl" and add that
1046 # to PKG_CONFIG_PATH. (No, we can't just assume it's under
1047 # /usr/local; Homebrew have conveniently chosen to put it
1048 # under /opt/homebrew on ARM.)
1049 #
1050 # That's the nice thing about Homebrew - it makes things easier!
1051 # Thanks!
1052 #
1053 save_PKG_CONFIG_PATH="$PKG_CONFIG_PATH"
1054 if test -n "$BREW"; then
1055 openssl_pkgconfig_dir=`$BREW --env --plain openssl | sed -n 's/PKG_CONFIG_PATH: //p'`
1056 PKG_CONFIG_PATH="$openssl_pkgconfig_dir:$PKG_CONFIG_PATH"
1057 fi
1058 PKG_CHECK_MODULE(LIBCRYPTO, libcrypto,
1059 [
1060 #
1061 # We found OpenSSL/libressl libcrypto.
1062 #
1063 HAVE_LIBCRYPTO=yes
1064 ])
1065 PKG_CONFIG_PATH="$save_PKG_CONFIG_PATH"
1066
1067 #
1068 # If it wasn't found, and we have Homebrew installed, see
1069 # if it's in Homebrew.
1070 #
1071 if test "x$HAVE_LIBCRYPTO" != "xyes" -a -n "$BREW"; then
1072 AC_MSG_CHECKING(for openssl in Homebrew)
1073 #
1074 # The brew man page lies when it speaks of
1075 # $BREW --prefix --installed <formula>
1076 # outputting nothing. In Homebrew 3.3.16,
1077 # it produces output regardless of whether
1078 # the formula is installed or not, so we
1079 # send the standard output and error to
1080 # the bit bucket.
1081 #
1082 # libcrypto isn't a formula, openssl is a formula.
1083 #
1084 if $BREW --prefix --installed openssl >/dev/null 2>&1; then
1085 #
1086 # Yes. Get the include directory and library
1087 # directory. (No, we can't just assume it's
1088 # under /usr/local; Homebrew have conveniently
1089 # chosen to put it under /opt/homebrew on ARM.)
1090 #
1091 AC_MSG_RESULT(yes)
1092 HAVE_LIBCRYPTO=yes
1093 openssl_path=`$BREW --prefix openssl`
1094 LIBCRYPTO_CFLAGS="-I$openssl_path/include"
1095 LIBCRYPTO_LIBS="-L$openssl_path/lib -lcrypto"
1096 else
1097 AC_MSG_RESULT(no)
1098 fi
1099 fi
1100
1101 #
1102 # If it wasn't found, and /usr/local/include and /usr/local/lib
1103 # exist, check if it's in /usr/local. (We check whether they
1104 # exist because, if they don't exist, the compiler will warn
1105 # about that and then ignore the argument, so they test
1106 # using just the system header files and libraries.)
1107 #
1108 # We include the standard include file to 1) make sure that
1109 # it's installed (if it's just a shared library for the
1110 # benefit of existing programs, that's not useful) and 2)
1111 # because SSL_library_init() is a library routine in some
1112 # versions and a #defined wrapper around OPENSSL_init_ssl()
1113 # in others.
1114 #
1115 if test "x$HAVE_LIBCRYPTO" != "xyes" -a -d "/usr/local/include" -a -d "/usr/local/lib"; then
1116 AC_LBL_SAVE_CHECK_STATE
1117 CFLAGS="$CFLAGS -I/usr/local/include"
1118 LIBS="$LIBS -L/usr/local/lib -lcrypto"
1119 AC_MSG_CHECKING(whether we have an OpenSSL/libressl libcrypto in /usr/local that we can use)
1120 AC_LINK_IFELSE([AC_LANG_PROGRAM(
1121 [[
1122 #include <openssl/evp.h>
1123 ]],
1124 [[
1125 EVP_CIPHER_CTX_block_size((EVP_CIPHER_CTX *)0);
1126 return 0;
1127 ]])],
1128 [
1129 AC_MSG_RESULT(yes)
1130 HAVE_LIBCRYPTO=yes
1131 LIBCRYPTO_CFLAGS="-I/usr/local/include"
1132 LIBCRYPTO_LIBS="-L/usr/local/lib -lcrypto"
1133 ],
1134 AC_MSG_RESULT(no))
1135 AC_LBL_RESTORE_CHECK_STATE
1136 fi
1137
1138 #
1139 # If it wasn't found, check if it's a system library.
1140 #
1141 # We include the standard include file to 1) make sure that
1142 # it's installed (if it's just a shared library for the
1143 # benefit of existing programs, that's not useful) and 2)
1144 # make sure this isn't a newer macOS that provides libcrypto
1145 # as a shared library but doesn't provide headers - Apple,
1146 # bless their pointy little heads, apparently ship libcrypto
1147 # as a library, but not the header files, in El Capitan and
1148 # later, probably because they don't want you writing nasty
1149 # portable code that could run on other UN*Xes, they want you
1150 # writing code that uses their Shiny New Crypto Library and
1151 # that thus only runs on macOS.
1152 #
1153 if test "x$HAVE_LIBCRYPTO" != "xyes"; then
1154 AC_LBL_SAVE_CHECK_STATE
1155 LIBS="$LIBS -lcrypto"
1156 AC_MSG_CHECKING(whether we have a system OpenSSL/libressl that we can use)
1157 AC_LINK_IFELSE([AC_LANG_PROGRAM(
1158 [[
1159 #include <openssl/evp.h>
1160 ]],
1161 [[
1162 EVP_CIPHER_CTX_block_size((EVP_CIPHER_CTX *)0);
1163 return 0;
1164 ]])],
1165 [
1166 AC_MSG_RESULT(yes)
1167 HAVE_LIBCRYPTO=yes
1168 LIBCRYPTO_LIBS="-lcrypto"
1169 ],
1170 AC_MSG_RESULT(no))
1171 AC_LBL_RESTORE_CHECK_STATE
1172 fi
1173 else
1174 #
1175 # Yes.
1176 #
1177 # Look for it there.
1178 #
1179 AC_LBL_SAVE_CHECK_STATE
1180 CFLAGS="$CFLAGS -I$libcrypto_root/include"
1181 LIBS="$LIBS -L$libcrypto_root/lib -lcrypto"
1182 AC_MSG_CHECKING(whether we have a system OpenSSL/libressl that we can use)
1183 AC_LINK_IFELSE([AC_LANG_PROGRAM(
1184 [[
1185 #include <openssl/evp.h>
1186 ]],
1187 [[
1188 EVP_CIPHER_CTX_block_size((EVP_CIPHER_CTX *)0);
1189 return 0;
1190 ]])],
1191 [
1192 AC_MSG_RESULT(yes)
1193 HAVE_LIBCRYPTO=yes
1194 LIBCRYPTO_CFLAGS="-I$libcrypto_root/include"
1195 LIBCRYPTO_LIBS="-L$libcrypto_root/lib -lcrypto"
1196 ],
1197 AC_MSG_RESULT(no))
1198 AC_LBL_RESTORE_CHECK_STATE
1199 fi
1200
1201 #
1202 # OK, did we find it?
1203 #
1204 if test "x$HAVE_LIBCRYPTO" = "xyes"; then
1205 AC_DEFINE([HAVE_LIBCRYPTO], [1], [Define to 1 if you have a usable `crypto' library (-lcrypto).])
1206
1207 #
1208 # Put the subdirectories of the libcrypto root directory
1209 # at the end of the header and library search path, to
1210 # make sure they come after any -I or -L flags for
1211 # a local libpcap - those must take precedence of any
1212 # directory that might contain an installed version of
1213 # libpcap.
1214 #
1215 V_INCLS="$V_INCLS $LIBCRYPTO_CFLAGS"
1216 LIBS="$LIBS $LIBCRYPTO_LIBS"
1217
1218 #
1219 # OK, then:
1220 #
1221 # 1) do we have EVP_CIPHER_CTX_new?
1222 # If so, we use it to allocate an EVP_CIPHER_CTX, as
1223 # EVP_CIPHER_CTX may be opaque; otherwise, we allocate it
1224 # ourselves.
1225 #
1226 # 2) do we have EVP_DecryptInit_ex()?
1227 # If so, we use it, because we need to be able to make
1228 # two "initialize the cipher" calls, one with the cipher
1229 # and key, and one with the IV, and, as of OpenSSL 1.1,
1230 # You Can't Do That with EVP_DecryptInit(), because a
1231 # call to EVP_DecryptInit() will unconditionally clear
1232 # the context, and if you don't supply a cipher, it'll
1233 # clear the cipher, rendering the context unusable and
1234 # causing a crash.
1235 #
1236 AC_CHECK_FUNCS(EVP_CIPHER_CTX_new EVP_DecryptInit_ex)
1237 else
1238 AC_MSG_NOTICE(OpenSSL/libressl libcrypto not found)
1239 fi
1240 fi
1241
1242 # Check for libcap-ng
1243 AC_MSG_CHECKING(whether to use libcap-ng)
1244 # Specify location for both includes and libraries.
1245 want_libcap_ng=ifavailable
1246 AC_ARG_WITH(cap_ng,
1247 AS_HELP_STRING([--with-cap-ng],
1248 [use libcap-ng @<:@default=yes, if available@:>@]),
1249 [
1250 if test $withval = no
1251 then
1252 want_libcap_ng=no
1253 AC_MSG_RESULT(no)
1254 elif test $withval = yes
1255 then
1256 want_libcap_ng=yes
1257 AC_MSG_RESULT(yes)
1258 fi
1259 ],[
1260 #
1261 # Use libcap-ng if it's present, otherwise don't.
1262 #
1263 want_libcap_ng=ifavailable
1264 AC_MSG_RESULT([yes, if available])
1265 ])
1266 if test "$want_libcap_ng" != "no"; then
1267 AC_CHECK_LIB(cap-ng, capng_change_id)
1268 AC_CHECK_HEADERS(cap-ng.h)
1269 fi
1270
1271 dnl
1272 dnl set additional include path if necessary
1273 if test "$missing_includes" = "yes"; then
1274 CPPFLAGS="$CPPFLAGS -I$srcdir/missing"
1275 V_INCLS="$V_INCLS -I$srcdir/missing"
1276 fi
1277
1278 AC_SUBST(V_CCOPT)
1279 AC_SUBST(V_DEFS)
1280 AC_SUBST(V_GROUP)
1281 AC_SUBST(V_INCLS)
1282 AC_SUBST(V_PCAPDEP)
1283 AC_SUBST(LOCALSRC)
1284 AC_SUBST(MAN_FILE_FORMATS)
1285 AC_SUBST(MAN_MISC_INFO)
1286
1287 AC_PROG_INSTALL
1288
1289 AC_CONFIG_HEADER(config.h)
1290
1291 AC_CONFIG_COMMANDS([.devel],[[if test -f .devel; then
1292 echo timestamp > stamp-h
1293 cat $srcdir/Makefile-devel-adds >> Makefile
1294 make depend || exit 1
1295 fi]],[[]])
1296 AC_CONFIG_FILES([Makefile tcpdump.1])
1297 AC_OUTPUT
1298 exit 0