]> The Tcpdump Group git mirrors - tcpdump/blob - configure.ac
ae4500e9b2e9e6533c0d67ffb3b5fc114e75eb98
[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 # It became apparent at some point that using a suitable C99 compiler does not
450 # automatically mean snprintf(3) implementation in the libc supports all the
451 # modifiers and specifiers used in the project, so let's test that before the
452 # build, not after.
453 #
454 # Testing the sizeof_t length modifier takes making an snprintf() call and
455 # comparing the actual result with the expected result. If this fails, it will
456 # most likely happen at run time, not compile time.
457 #
458 # Testing the 64-bit conversion specifiers in addition to that requires the
459 # <inttypes.h> header to be present and the macros to be defined, so if this
460 # fails, it will more likely happen at compile time.
461 #
462 AC_MSG_CHECKING([whether snprintf is suitable])
463 AC_RUN_IFELSE(
464 [
465 AC_LANG_SOURCE([[
466 #include <stdio.h>
467 #include <string.h>
468 #include <inttypes.h>
469 #include <sys/types.h>
470
471 #if defined(_WIN32) && !defined(_SSIZE_T_DEFINED)
472 /*
473 * On UN*Xes, this is a signed integer type of the same size as size_t.
474 *
475 * It's not defined by Visual Studio; we assume that ptrdiff_t will
476 * be a type that is a signed integer type of the same size as size_t.
477 */
478 typedef ptrdiff_t ssize_t;
479 #endif
480
481 /*
482 * Avoid trying to cast negative values to unsigned types, or doing
483 * shifts of signed types, in order not to have the test program fail
484 * if we're building with undefined-behavior sanitizers enabled.
485 */
486 int main()
487 {
488 char buf[100];
489 unsigned int ui = sizeof(buf);
490 int i = sizeof(buf);
491 int64_t i64 = INT64_C(0x100000000);
492 uint64_t ui64 = UINT64_C(0x100000000);
493
494 snprintf(buf, sizeof(buf), "%zu", (size_t)ui);
495 if (strncmp(buf, "100", sizeof(buf)))
496 return 1;
497
498 snprintf(buf, sizeof(buf), "%zd", (ssize_t)(-i));
499 if (strncmp(buf, "-100", sizeof(buf)))
500 return 2;
501
502 snprintf(buf, sizeof(buf), "%" PRId64, -i64);
503 if (strncmp(buf, "-4294967296", sizeof(buf)))
504 return 3;
505
506 snprintf(buf, sizeof(buf), "0o%" PRIo64, ui64);
507 if (strncmp(buf, "0o40000000000", sizeof(buf)))
508 return 4;
509
510 snprintf(buf, sizeof(buf), "0x%" PRIx64, ui64);
511 if (strncmp(buf, "0x100000000", sizeof(buf)))
512 return 5;
513
514 snprintf(buf, sizeof(buf), "%" PRIu64, ui64);
515 if (strncmp(buf, "4294967296", sizeof(buf)))
516 return 6;
517
518 return 0;
519 }
520 ]])
521 ],
522 [
523 AC_MSG_RESULT(yes)
524 ],
525 [
526 AC_MSG_RESULT(no)
527 AC_MSG_ERROR(
528 [The snprintf(3) implementation in this libc is not suitable,
529 tcpdump would not work correctly even if it managed to compile.])
530 ],
531 [
532 AC_MSG_RESULT(not while cross-compiling)
533 ]
534 )
535
536 AC_CHECK_LIB(rpc, main) dnl It's unclear why we might need -lrpc
537
538 dnl Some platforms may need -lnsl for getrpcbynumber.
539 AC_SEARCH_LIBS(getrpcbynumber, nsl,
540 AC_DEFINE(HAVE_GETRPCBYNUMBER, 1, [define if you have getrpcbynumber()]))
541
542 AC_LBL_LIBPCAP(V_PCAPDEP, V_INCLS)
543
544 #
545 # Check for these after AC_LBL_LIBPCAP, so we link with the appropriate
546 # libraries (e.g., "-lsocket -lnsl" on Solaris).
547 #
548 # You are in a twisty little maze of UN*Xes, all different.
549 # Some might not have ether_ntohost().
550 # Some might have it and declare it in <net/ethernet.h>.
551 # Some might have it and declare it in <netinet/ether.h>
552 # Some might have it and declare it in <sys/ethernet.h>.
553 # Some might have it and declare it in <arpa/inet.h>.
554 # Some might have it and declare it in <netinet/if_ether.h>.
555 # Some might have it and not declare it in any header file.
556 #
557 # Before you is a C compiler.
558 #
559 AC_CHECK_FUNCS(ether_ntohost, [
560 AC_CACHE_CHECK(for buggy ether_ntohost, ac_cv_buggy_ether_ntohost, [
561 AC_RUN_IFELSE([AC_LANG_SOURCE([[
562 #include <netdb.h>
563 #include <netinet/ether.h>
564 #include <stdlib.h>
565 #include <sys/types.h>
566 #include <sys/param.h>
567 #include <sys/socket.h>
568
569 int
570 main(int argc, char **argv)
571 {
572 u_char ea[6] = { 0xff, 0xff, 0xff, 0xff, 0xff };
573 char name[MAXHOSTNAMELEN];
574
575 ether_ntohost(name, (struct ether_addr *)ea);
576 exit(0);
577 }
578 ]])
579 ], [ac_cv_buggy_ether_ntohost=no],
580 [ac_cv_buggy_ether_ntohost=yes],
581 [ac_cv_buggy_ether_ntohost="not while cross-compiling"])])
582 if test "$ac_cv_buggy_ether_ntohost" = "no"; then
583 AC_DEFINE(USE_ETHER_NTOHOST, 1,
584 [define if you have ether_ntohost() and it works])
585 fi
586 ])
587 if test "$ac_cv_func_ether_ntohost" = yes -a \
588 "$ac_cv_buggy_ether_ntohost" = "no"; then
589 #
590 # OK, we have ether_ntohost(). Is it declared in <net/ethernet.h>?
591 #
592 # This test fails if we don't have <net/ethernet.h> or if we do
593 # but it doesn't declare ether_ntohost().
594 #
595 AC_CHECK_DECL(ether_ntohost,
596 [
597 AC_DEFINE(NET_ETHERNET_H_DECLARES_ETHER_NTOHOST,,
598 [Define to 1 if net/ethernet.h declares `ether_ntohost'])
599 ],,
600 [
601 #include <net/ethernet.h>
602 ])
603 #
604 # Did that succeed?
605 #
606 if test "$ac_cv_have_decl_ether_ntohost" != yes; then
607 #
608 # No, how about <netinet/ether.h>, as on Linux?
609 #
610 # This test fails if we don't have <netinet/ether.h>
611 # or if we do but it doesn't declare ether_ntohost().
612 #
613 # Unset ac_cv_have_decl_ether_ntohost so we don't
614 # treat the previous failure as a cached value and
615 # suppress the next test.
616 #
617 unset ac_cv_have_decl_ether_ntohost
618 AC_CHECK_DECL(ether_ntohost,
619 [
620 AC_DEFINE(NETINET_ETHER_H_DECLARES_ETHER_NTOHOST,1,
621 [Define to 1 if netinet/ether.h declares `ether_ntohost'])
622 ],,
623 [
624 #include <netinet/ether.h>
625 ])
626 fi
627 #
628 # Did that succeed?
629 #
630 if test "$ac_cv_have_decl_ether_ntohost" != yes; then
631 #
632 # No, how about <sys/ethernet.h>, as on Solaris 10
633 # and later?
634 #
635 # This test fails if we don't have <sys/ethernet.h>
636 # or if we do but it doesn't declare ether_ntohost().
637 #
638 # Unset ac_cv_have_decl_ether_ntohost so we don't
639 # treat the previous failure as a cached value and
640 # suppress the next test.
641 #
642 unset ac_cv_have_decl_ether_ntohost
643 AC_CHECK_DECL(ether_ntohost,
644 [
645 AC_DEFINE(SYS_ETHERNET_H_DECLARES_ETHER_NTOHOST,,
646 [Define to 1 if sys/ethernet.h declares `ether_ntohost'])
647 ],,
648 [
649 #include <sys/ethernet.h>
650 ])
651 fi
652 #
653 # Did that succeed?
654 #
655 if test "$ac_cv_have_decl_ether_ntohost" != yes; then
656 #
657 # No, how about <arpa/inet.h>, as in AIX?
658 #
659 # This test fails if we don't have <arpa/inet.h>
660 # (if we have ether_ntohost(), we should have
661 # networking, and if we have networking, we should
662 # have <arpa/inet.h>) or if we do but it doesn't
663 # declare ether_ntohost().
664 #
665 # Unset ac_cv_have_decl_ether_ntohost so we don't
666 # treat the previous failure as a cached value and
667 # suppress the next test.
668 #
669 unset ac_cv_have_decl_ether_ntohost
670 AC_CHECK_DECL(ether_ntohost,
671 [
672 AC_DEFINE(ARPA_INET_H_DECLARES_ETHER_NTOHOST,,
673 [Define to 1 if arpa/inet.h declares `ether_ntohost'])
674 ],,
675 [
676 #include <arpa/inet.h>
677 ])
678 fi
679 #
680 # Did that succeed?
681 #
682 if test "$ac_cv_have_decl_ether_ntohost" != yes; then
683 #
684 # No, how about <netinet/if_ether.h>?
685 # On some platforms, it requires <net/if.h> and
686 # <netinet/in.h>, and we always include it with
687 # both of them, so test it with both of them.
688 #
689 # This test fails if we don't have <netinet/if_ether.h>
690 # and the headers we include before it, or if we do but
691 # <netinet/if_ether.h> doesn't declare ether_hostton().
692 #
693 # Unset ac_cv_have_decl_ether_ntohost so we don't
694 # treat the previous failure as a cached value and
695 # suppress the next test.
696 #
697 unset ac_cv_have_decl_ether_ntohost
698 AC_CHECK_DECL(ether_ntohost,
699 [
700 AC_DEFINE(NETINET_IF_ETHER_H_DECLARES_ETHER_NTOHOST,,
701 [Define to 1 if netinet/if_ether.h declares `ether_ntohost'])
702 ],,
703 [
704 #include <sys/types.h>
705 #include <sys/socket.h>
706 #include <net/if.h>
707 #include <netinet/in.h>
708 #include <netinet/if_ether.h>
709 ])
710 fi
711 #
712 # After all that, is ether_ntohost() declared?
713 #
714 if test "$ac_cv_have_decl_ether_ntohost" = yes; then
715 #
716 # Yes.
717 #
718 AC_DEFINE(HAVE_DECL_ETHER_NTOHOST, 1,
719 [Define to 1 if you have the declaration of `ether_ntohost'])
720 else
721 #
722 # No, we'll have to declare it ourselves.
723 # Do we have "struct ether_addr" if we include
724 # <netinet/if_ether.h>?
725 #
726 AC_CHECK_TYPES(struct ether_addr,,,
727 [
728 #include <sys/types.h>
729 #include <sys/socket.h>
730 #include <net/if.h>
731 #include <netinet/in.h>
732 #include <netinet/if_ether.h>
733 ])
734 fi
735 fi
736
737 dnl
738 dnl Check for "pcap_list_datalinks()" and use a substitute version if
739 dnl it's not present. If it is present, check for "pcap_free_datalinks()";
740 dnl if it's not present, we don't replace it for now. (We could do so
741 dnl on UN*X, but not on Windows, where hilarity ensues if a program
742 dnl built with one version of the MSVC support library tries to free
743 dnl something allocated by a library built with another version of
744 dnl the MSVC support library.)
745 dnl
746 AC_CHECK_FUNC(pcap_list_datalinks,
747 [
748 AC_DEFINE(HAVE_PCAP_LIST_DATALINKS, 1,
749 [define if libpcap has pcap_list_datalinks()])
750 AC_CHECK_FUNCS(pcap_free_datalinks)
751 ],
752 [
753 AC_LIBOBJ(datalinks)
754 ])
755
756 dnl
757 dnl Check for "pcap_datalink_name_to_val()", and use a substitute
758 dnl version if it's not present. If it is present, check for
759 dnl "pcap_datalink_val_to_description()", and if we don't have it,
760 dnl use a substitute version.
761 dnl
762 AC_CHECK_FUNC(pcap_datalink_name_to_val,
763 [
764 AC_DEFINE(HAVE_PCAP_DATALINK_NAME_TO_VAL, 1,
765 [define if libpcap has pcap_datalink_name_to_val()])
766 AC_CHECK_FUNC(pcap_datalink_val_to_description,
767 AC_DEFINE(HAVE_PCAP_DATALINK_VAL_TO_DESCRIPTION, 1,
768 [define if libpcap has pcap_datalink_val_to_description()]),
769 [
770 AC_LIBOBJ(dlnames)
771 ])
772 ],
773 [
774 AC_LIBOBJ(dlnames)
775 ])
776
777 dnl
778 dnl Check for "pcap_set_datalink()"; you can't substitute for it if
779 dnl it's absent (it has hooks into libpcap), so just define the
780 dnl HAVE_ value if it's there.
781 dnl
782 AC_CHECK_FUNCS(pcap_set_datalink)
783
784 dnl
785 dnl Check for "pcap_breakloop()"; you can't substitute for it if
786 dnl it's absent (it has hooks into the live capture routines),
787 dnl so just define the HAVE_ value if it's there.
788 dnl
789 AC_CHECK_FUNCS(pcap_breakloop)
790
791 #
792 # Do we have the new open API? Check for pcap_create, and assume that,
793 # if we do, we also have pcap_activate() and the other new routines
794 # introduced in libpcap 1.0.0.
795 #
796 AC_CHECK_FUNCS(pcap_create)
797 if test $ac_cv_func_pcap_create = "yes" ; then
798 #
799 # OK, do we have pcap_set_tstamp_type? If so, assume we have
800 # pcap_list_tstamp_types and pcap_free_tstamp_types as well.
801 #
802 AC_CHECK_FUNCS(pcap_set_tstamp_type)
803 #
804 # And do we have pcap_set_tstamp_precision? If so, we assume
805 # we also have pcap_open_offline_with_tstamp_precision.
806 #
807 AC_CHECK_FUNCS(pcap_set_tstamp_precision)
808 fi
809
810 #
811 # Check for a miscellaneous collection of functions which we use
812 # if we have them.
813 #
814 AC_CHECK_FUNCS(pcap_findalldevs)
815 AC_CHECK_FUNCS(pcap_dump_flush pcap_lib_version)
816 if test $ac_cv_func_pcap_lib_version = "no" ; then
817 AC_MSG_CHECKING(whether pcap_version is defined by libpcap)
818 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[
819 extern char pcap_version[];
820
821 return (int)pcap_version;
822 ]])
823 ],
824 [ac_lbl_cv_pcap_version_defined=yes],
825 [ac_lbl_cv_pcap_version_defined=no])
826 if test "$ac_lbl_cv_pcap_version_defined" = yes ; then
827 AC_MSG_RESULT(yes)
828 AC_DEFINE(HAVE_PCAP_VERSION, 1, [define if libpcap has pcap_version])
829 else
830 AC_MSG_RESULT(no)
831 fi
832 fi
833 AC_CHECK_FUNCS(pcap_setdirection pcap_set_immediate_mode pcap_dump_ftell64)
834 #
835 # See the comment in AC_LBL_LIBPCAP in aclocal.m4 for the reason
836 # why we don't check for remote-capture APIs if we're building
837 # with the system libpcap on macOS.
838 #
839 if test "$_dont_check_for_remote_apis" != "yes"; then
840 AC_CHECK_FUNCS(pcap_open pcap_findalldevs_ex)
841 fi
842 AC_REPLACE_FUNCS(pcap_dump_ftell)
843
844 #
845 # Check for special debugging functions
846 #
847 AC_CHECK_FUNCS(pcap_set_parser_debug)
848 if test "$ac_cv_func_pcap_set_parser_debug" = "no" ; then
849 #
850 # OK, we don't have pcap_set_parser_debug() to set the libpcap
851 # filter expression parser debug flag; can we directly set the
852 # flag?
853 AC_MSG_CHECKING(whether pcap_debug is defined by libpcap)
854 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[
855 extern int pcap_debug;
856
857 return pcap_debug;
858 ]])
859 ],
860 [ac_lbl_cv_pcap_debug_defined=yes],
861 [ac_lbl_cv_pcap_debug_defined=no])
862 if test "$ac_lbl_cv_pcap_debug_defined" = yes ; then
863 AC_MSG_RESULT(yes)
864 AC_DEFINE(HAVE_PCAP_DEBUG, 1, [define if libpcap has pcap_debug])
865 else
866 AC_MSG_RESULT(no)
867 #
868 # OK, what about "yydebug"?
869 #
870 AC_MSG_CHECKING(whether yydebug is defined by libpcap)
871 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[
872 extern int yydebug;
873
874 return yydebug;
875 ]])
876 ],
877 [ac_lbl_cv_yydebug_defined=yes],
878 [ac_lbl_cv_yydebug_defined=no])
879 if test "$ac_lbl_cv_yydebug_defined" = yes ; then
880 AC_MSG_RESULT(yes)
881 AC_DEFINE(HAVE_YYDEBUG, 1, [define if libpcap has yydebug])
882 else
883 AC_MSG_RESULT(no)
884 fi
885 fi
886 fi
887 AC_CHECK_FUNCS(pcap_set_optimizer_debug)
888 AC_REPLACE_FUNCS(bpf_dump) dnl moved to libpcap in 0.6
889
890 #
891 # Assume V7/BSD convention for man pages (file formats in section 5,
892 # miscellaneous info in section 7).
893 #
894 MAN_FILE_FORMATS=5
895 MAN_MISC_INFO=7
896 case "$host_os" in
897
898 aix*)
899 dnl Workaround to enable certain features
900 AC_DEFINE(_SUN,1,[define on AIX to get certain functions])
901 ;;
902
903 hpux*)
904 #
905 # Use System V conventions for man pages.
906 #
907 MAN_FILE_FORMATS=4
908 MAN_MISC_INFO=5
909 ;;
910
911 irix*)
912 V_GROUP=sys
913
914 #
915 # Use System V conventions for man pages.
916 #
917 MAN_FILE_FORMATS=4
918 MAN_MISC_INFO=5
919 ;;
920
921 osf*)
922 V_GROUP=system
923
924 #
925 # Use System V conventions for man pages.
926 #
927 MAN_FILE_FORMATS=4
928 MAN_MISC_INFO=5
929 ;;
930
931 solaris*)
932 #
933 # Use System V conventions for man pages.
934 #
935 MAN_FILE_FORMATS=4
936 MAN_MISC_INFO=5
937 ;;
938 esac
939
940 #
941 # Make sure we have a definition for C99's uintptr_t (regardless of
942 # whether the environment is a C99 environment or not).
943 #
944 AC_TYPE_UINTPTR_T
945
946 savedcppflags="$CPPFLAGS"
947 CPPFLAGS="$CPPFLAGS $V_INCLS"
948
949 #
950 # Check whether we have pcap/pcap-inttypes.h.
951 # If we do, we use that to get the C99 types defined.
952 #
953 AC_CHECK_HEADERS(pcap/pcap-inttypes.h)
954
955 #
956 # At compile time HAVE_PCAP_FINDALLDEVS depends on HAVE_PCAP_IF_T.
957 #
958 AC_CHECK_TYPES(pcap_if_t, , , [#include <pcap.h>])
959
960 CPPFLAGS="$savedcppflags"
961
962 #
963 # Define the old BSD specified-width types in terms of the C99 types;
964 # we may need them with libpcap include files.
965 #
966 AC_CHECK_TYPE([u_int8_t], ,
967 [AC_DEFINE([u_int8_t], [uint8_t],
968 [Define to `uint8_t' if u_int8_t not defined.])],
969 [AC_INCLUDES_DEFAULT
970 #include <sys/types.h>
971 ])
972 AC_CHECK_TYPE([u_int16_t], ,
973 [AC_DEFINE([u_int16_t], [uint16_t],
974 [Define to `uint16_t' if u_int16_t not defined.])],
975 [AC_INCLUDES_DEFAULT
976 #include <sys/types.h>
977 ])
978 AC_CHECK_TYPE([u_int32_t], ,
979 [AC_DEFINE([u_int32_t], [uint32_t],
980 [Define to `uint32_t' if u_int32_t not defined.])],
981 [AC_INCLUDES_DEFAULT
982 #include <sys/types.h>
983 ])
984 AC_CHECK_TYPE([u_int64_t], ,
985 [AC_DEFINE([u_int64_t], [uint64_t],
986 [Define to `uint64_t' if u_int64_t not defined.])],
987 [AC_INCLUDES_DEFAULT
988 #include <sys/types.h>
989 ])
990
991 AC_PROG_RANLIB
992 AC_CHECK_TOOL([AR], [ar])
993
994 AC_LBL_DEVEL(V_CCOPT)
995
996 # Check for OpenSSL/libressl libcrypto
997 AC_MSG_CHECKING(whether to use OpenSSL/libressl libcrypto)
998 # Specify location for both includes and libraries.
999 want_libcrypto=ifavailable
1000 AC_ARG_WITH(crypto,
1001 AS_HELP_STRING([--with-crypto]@<:@=DIR@:>@,
1002 [use OpenSSL/libressl libcrypto (located in directory DIR, if specified) @<:@default=yes, if available@:>@]),
1003 [
1004 if test $withval = no
1005 then
1006 # User doesn't want to link with libcrypto.
1007 want_libcrypto=no
1008 AC_MSG_RESULT(no)
1009 elif test $withval = yes
1010 then
1011 # User wants to link with libcrypto but hasn't specified
1012 # a directory.
1013 want_libcrypto=yes
1014 AC_MSG_RESULT(yes)
1015 else
1016 # User wants to link with libcrypto and has specified
1017 # a directory, so use the provided value.
1018 want_libcrypto=yes
1019 libcrypto_root=$withval
1020 AC_MSG_RESULT([yes, using the version installed in $withval])
1021 fi
1022 ],[
1023 #
1024 # Use libcrypto if it's present, otherwise don't; no directory
1025 # was specified.
1026 #
1027 want_libcrypto=ifavailable
1028 AC_MSG_RESULT([yes, if available])
1029 ])
1030 if test "$want_libcrypto" != "no"; then
1031 #
1032 # Were we told where to look for libcrypto?
1033 #
1034 if test -z "$libcrypto_root"; then
1035 #
1036 # No.
1037 #
1038 # First, try looking for it with pkg-config, if we have it.
1039 #
1040 # Homebrew's pkg-config does not, by default, look for
1041 # pkg-config files for packages it has installed.
1042 # Furthermore, at least for OpenSSL, they appear to be
1043 # dumped in package-specific directories whose paths are
1044 # not only package-specific but package-version-specific.
1045 #
1046 # So the only way to find openssl is to get the value of
1047 # PKG_CONFIG_PATH from "brew --env openssl" and add that
1048 # to PKG_CONFIG_PATH. (No, we can't just assume it's under
1049 # /usr/local; Homebrew have conveniently chosen to put it
1050 # under /opt/homebrew on ARM.)
1051 #
1052 # That's the nice thing about Homebrew - it makes things easier!
1053 # Thanks!
1054 #
1055 save_PKG_CONFIG_PATH="$PKG_CONFIG_PATH"
1056 if test -n "$BREW"; then
1057 openssl_pkgconfig_dir=`$BREW --env --plain openssl | sed -n 's/PKG_CONFIG_PATH: //p'`
1058 PKG_CONFIG_PATH="$openssl_pkgconfig_dir:$PKG_CONFIG_PATH"
1059 fi
1060 PKG_CHECK_MODULE(LIBCRYPTO, libcrypto,
1061 [
1062 #
1063 # We found OpenSSL/libressl libcrypto.
1064 #
1065 HAVE_LIBCRYPTO=yes
1066 ])
1067 PKG_CONFIG_PATH="$save_PKG_CONFIG_PATH"
1068
1069 #
1070 # If it wasn't found, and we have Homebrew installed, see
1071 # if it's in Homebrew.
1072 #
1073 if test "x$HAVE_LIBCRYPTO" != "xyes" -a -n "$BREW"; then
1074 AC_MSG_CHECKING(for openssl in Homebrew)
1075 #
1076 # The brew man page lies when it speaks of
1077 # $BREW --prefix --installed <formula>
1078 # outputting nothing. In Homebrew 3.3.16,
1079 # it produces output regardless of whether
1080 # the formula is installed or not, so we
1081 # send the standard output and error to
1082 # the bit bucket.
1083 #
1084 # libcrypto isn't a formula, openssl is a formula.
1085 #
1086 if $BREW --prefix --installed openssl >/dev/null 2>&1; then
1087 #
1088 # Yes. Get the include directory and library
1089 # directory. (No, we can't just assume it's
1090 # under /usr/local; Homebrew have conveniently
1091 # chosen to put it under /opt/homebrew on ARM.)
1092 #
1093 AC_MSG_RESULT(yes)
1094 HAVE_LIBCRYPTO=yes
1095 openssl_path=`$BREW --prefix openssl`
1096 LIBCRYPTO_CFLAGS="-I$openssl_path/include"
1097 LIBCRYPTO_LIBS="-L$openssl_path/lib -lcrypto"
1098 else
1099 AC_MSG_RESULT(no)
1100 fi
1101 fi
1102
1103 #
1104 # If it wasn't found, and /usr/local/include and /usr/local/lib
1105 # exist, check if it's in /usr/local. (We check whether they
1106 # exist because, if they don't exist, the compiler will warn
1107 # about that and then ignore the argument, so they test
1108 # using just the system header files and libraries.)
1109 #
1110 # We include the standard include file to 1) make sure that
1111 # it's installed (if it's just a shared library for the
1112 # benefit of existing programs, that's not useful) and 2)
1113 # because SSL_library_init() is a library routine in some
1114 # versions and a #defined wrapper around OPENSSL_init_ssl()
1115 # in others.
1116 #
1117 if test "x$HAVE_LIBCRYPTO" != "xyes" -a -d "/usr/local/include" -a -d "/usr/local/lib"; then
1118 AC_LBL_SAVE_CHECK_STATE
1119 CFLAGS="$CFLAGS -I/usr/local/include"
1120 LIBS="$LIBS -L/usr/local/lib -lcrypto"
1121 AC_MSG_CHECKING(whether we have an OpenSSL/libressl libcrypto in /usr/local that we can use)
1122 AC_LINK_IFELSE([AC_LANG_PROGRAM(
1123 [[
1124 #include <openssl/evp.h>
1125 ]],
1126 [[
1127 EVP_CIPHER_CTX_block_size((EVP_CIPHER_CTX *)0);
1128 return 0;
1129 ]])],
1130 [
1131 AC_MSG_RESULT(yes)
1132 HAVE_LIBCRYPTO=yes
1133 LIBCRYPTO_CFLAGS="-I/usr/local/include"
1134 LIBCRYPTO_LIBS="-L/usr/local/lib -lcrypto"
1135 ],
1136 AC_MSG_RESULT(no))
1137 AC_LBL_RESTORE_CHECK_STATE
1138 fi
1139
1140 #
1141 # If it wasn't found, check if it's a system library.
1142 #
1143 # We include the standard include file to 1) make sure that
1144 # it's installed (if it's just a shared library for the
1145 # benefit of existing programs, that's not useful) and 2)
1146 # make sure this isn't a newer macOS that provides libcrypto
1147 # as a shared library but doesn't provide headers - Apple,
1148 # bless their pointy little heads, apparently ship libcrypto
1149 # as a library, but not the header files, in El Capitan and
1150 # later, probably because they don't want you writing nasty
1151 # portable code that could run on other UN*Xes, they want you
1152 # writing code that uses their Shiny New Crypto Library and
1153 # that thus only runs on macOS.
1154 #
1155 if test "x$HAVE_LIBCRYPTO" != "xyes"; then
1156 AC_LBL_SAVE_CHECK_STATE
1157 LIBS="$LIBS -lcrypto"
1158 AC_MSG_CHECKING(whether we have a system OpenSSL/libressl that we can use)
1159 AC_LINK_IFELSE([AC_LANG_PROGRAM(
1160 [[
1161 #include <openssl/evp.h>
1162 ]],
1163 [[
1164 EVP_CIPHER_CTX_block_size((EVP_CIPHER_CTX *)0);
1165 return 0;
1166 ]])],
1167 [
1168 AC_MSG_RESULT(yes)
1169 HAVE_LIBCRYPTO=yes
1170 LIBCRYPTO_LIBS="-lcrypto"
1171 ],
1172 AC_MSG_RESULT(no))
1173 AC_LBL_RESTORE_CHECK_STATE
1174 fi
1175 else
1176 #
1177 # Yes.
1178 #
1179 # Look for it there.
1180 #
1181 AC_LBL_SAVE_CHECK_STATE
1182 CFLAGS="$CFLAGS -I$libcrypto_root/include"
1183 LIBS="$LIBS -L$libcrypto_root/lib -lcrypto"
1184 AC_MSG_CHECKING(whether we have a system OpenSSL/libressl that we can use)
1185 AC_LINK_IFELSE([AC_LANG_PROGRAM(
1186 [[
1187 #include <openssl/evp.h>
1188 ]],
1189 [[
1190 EVP_CIPHER_CTX_block_size((EVP_CIPHER_CTX *)0);
1191 return 0;
1192 ]])],
1193 [
1194 AC_MSG_RESULT(yes)
1195 HAVE_LIBCRYPTO=yes
1196 LIBCRYPTO_CFLAGS="-I$libcrypto_root/include"
1197 LIBCRYPTO_LIBS="-L$libcrypto_root/lib -lcrypto"
1198 ],
1199 AC_MSG_RESULT(no))
1200 AC_LBL_RESTORE_CHECK_STATE
1201 fi
1202
1203 #
1204 # OK, did we find it?
1205 #
1206 if test "x$HAVE_LIBCRYPTO" = "xyes"; then
1207 AC_DEFINE([HAVE_LIBCRYPTO], [1], [Define to 1 if you have a usable `crypto' library (-lcrypto).])
1208
1209 #
1210 # Put the subdirectories of the libcrypto root directory
1211 # at the end of the header and library search path, to
1212 # make sure they come after any -I or -L flags for
1213 # a local libpcap - those must take precedence of any
1214 # directory that might contain an installed version of
1215 # libpcap.
1216 #
1217 V_INCLS="$V_INCLS $LIBCRYPTO_CFLAGS"
1218 LIBS="$LIBS $LIBCRYPTO_LIBS"
1219
1220 #
1221 # OK, then:
1222 #
1223 # 1) do we have EVP_CIPHER_CTX_new?
1224 # If so, we use it to allocate an EVP_CIPHER_CTX, as
1225 # EVP_CIPHER_CTX may be opaque; otherwise, we allocate it
1226 # ourselves.
1227 #
1228 # 2) do we have EVP_DecryptInit_ex()?
1229 # If so, we use it, because we need to be able to make
1230 # two "initialize the cipher" calls, one with the cipher
1231 # and key, and one with the IV, and, as of OpenSSL 1.1,
1232 # You Can't Do That with EVP_DecryptInit(), because a
1233 # call to EVP_DecryptInit() will unconditionally clear
1234 # the context, and if you don't supply a cipher, it'll
1235 # clear the cipher, rendering the context unusable and
1236 # causing a crash.
1237 #
1238 AC_CHECK_FUNCS(EVP_CIPHER_CTX_new EVP_DecryptInit_ex)
1239 else
1240 AC_MSG_NOTICE(OpenSSL/libressl libcrypto not found)
1241 fi
1242 fi
1243
1244 # Check for libcap-ng
1245 AC_MSG_CHECKING(whether to use libcap-ng)
1246 # Specify location for both includes and libraries.
1247 want_libcap_ng=ifavailable
1248 AC_ARG_WITH(cap_ng,
1249 AS_HELP_STRING([--with-cap-ng],
1250 [use libcap-ng @<:@default=yes, if available@:>@]),
1251 [
1252 if test $withval = no
1253 then
1254 want_libcap_ng=no
1255 AC_MSG_RESULT(no)
1256 elif test $withval = yes
1257 then
1258 want_libcap_ng=yes
1259 AC_MSG_RESULT(yes)
1260 fi
1261 ],[
1262 #
1263 # Use libcap-ng if it's present, otherwise don't.
1264 #
1265 want_libcap_ng=ifavailable
1266 AC_MSG_RESULT([yes, if available])
1267 ])
1268 if test "$want_libcap_ng" != "no"; then
1269 AC_CHECK_LIB(cap-ng, capng_change_id)
1270 AC_CHECK_HEADERS(cap-ng.h)
1271 fi
1272
1273 dnl
1274 dnl set additional include path if necessary
1275 if test "$missing_includes" = "yes"; then
1276 CPPFLAGS="$CPPFLAGS -I$srcdir/missing"
1277 V_INCLS="$V_INCLS -I$srcdir/missing"
1278 fi
1279
1280 AC_SUBST(V_CCOPT)
1281 AC_SUBST(V_DEFS)
1282 AC_SUBST(V_INCLS)
1283 AC_SUBST(V_PCAPDEP)
1284 AC_SUBST(LOCALSRC)
1285 AC_SUBST(MAN_FILE_FORMATS)
1286 AC_SUBST(MAN_MISC_INFO)
1287
1288 AC_PROG_INSTALL
1289
1290 AC_CONFIG_HEADER(config.h)
1291
1292 AC_CONFIG_COMMANDS([.devel],[[if test -f .devel; then
1293 echo timestamp > stamp-h
1294 cat $srcdir/Makefile-devel-adds >> Makefile
1295 make depend || exit 1
1296 fi]],[[]])
1297 AC_CONFIG_FILES([Makefile tcpdump.1])
1298 AC_OUTPUT
1299 exit 0