1 dnl Copyright (c) 1994, 1995, 1996, 1997
2 dnl The Regents of the University of California. All rights reserved.
4 dnl Process this file with autoconf to produce a configure script.
10 # http://ftp.gnu.org/gnu/config/README
12 # for the URLs to use to fetch new versions of config.guess and
21 AC_LBL_C_INIT_BEFORE_CC(V_INCLS)
23 AC_LBL_C_INIT(V_CCOPT, V_INCLS)
26 if test "$ac_cv___attribute__" = "yes"; then
27 AC_C___ATTRIBUTE___UNUSED
28 AC_C___ATTRIBUTE___NORETURN_FUNCTION_POINTER
29 AC_C___ATTRIBUTE___FORMAT
30 if test "$ac_cv___attribute___format" = "yes"; then
31 AC_C___ATTRIBUTE___FORMAT_FUNCTION_POINTER
35 AC_CHECK_HEADERS(fcntl.h rpc/rpc.h rpc/rpcent.h)
36 AC_CHECK_HEADERS(net/pfvar.h, , , [#include <sys/types.h>
37 #include <sys/socket.h>
39 if test "$ac_cv_header_net_pfvar_h" = yes; then
40 AC_CHECK_HEADERS(net/if_pflog.h, , , [#include <sys/types.h>
41 #include <sys/socket.h>
43 #include <net/pfvar.h>])
44 if test "$ac_cv_header_net_if_pflog_h" = yes; then
45 LOCALSRC="print-pflog.c $LOCALSRC"
48 AC_CHECK_HEADERS(netinet/if_ether.h, , , [#include <sys/types.h>
49 #include <sys/socket.h>])
50 if test "$ac_cv_header_netinet_if_ether_h" != yes; then
52 # The simple test didn't work.
53 # Do we need to include <net/if.h> first?
54 # Unset ac_cv_header_netinet_if_ether_h so we don't
55 # treat the previous failure as a cached value and
56 # suppress the next test.
58 AC_MSG_NOTICE([Rechecking with some additional includes])
59 unset ac_cv_header_netinet_if_ether_h
60 AC_CHECK_HEADERS(netinet/if_ether.h, , , [#include <sys/types.h>
61 #include <sys/socket.h>
62 #include <netinet/in.h>
73 AC_ARG_ENABLE(universal,
74 AC_HELP_STRING([--disable-universal],[don't build universal on OS X]))
75 if test "$enable_universal" != "no"; then
80 # Leopard. Build for x86 and 32-bit PowerPC, with
81 # x86 first. (That's what Apple does.)
83 V_CCOPT="$V_CCOPT -arch i386 -arch ppc"
84 LDFLAGS="$LDFLAGS -arch i386 -arch ppc"
89 # Snow Leopard. Build for x86-64 and x86, with
90 # x86-64 first. (That's what Apple does.)
92 V_CCOPT="$V_CCOPT -arch x86_64 -arch i386"
93 LDFLAGS="$LDFLAGS -arch x86_64 -arch i386"
102 [ --with-smi link with libsmi (allows to load MIBs on the fly to decode SNMP packets. [default=yes]
103 --without-smi don't link with libsmi],,
106 if test "x$with_smi" != "xno" ; then
107 AC_CHECK_HEADER(smi.h,
110 # OK, we found smi.h. Do we have libsmi with smiInit?
112 AC_CHECK_LIB(smi, smiInit,
115 # OK, we have libsmi with smiInit. Can we use it?
117 AC_MSG_CHECKING([whether to enable libsmi])
122 /* libsmi available check */
126 int current, revision, age, n;
127 const int required = 2;
130 if (strcmp(SMI_LIBRARY_VERSION, smi_library_version))
132 n = sscanf(smi_library_version, "%d:%d:%d", ¤t, &revision, &age);
135 if (required < current - age || required > current)
142 AC_DEFINE(USE_LIBSMI, 1,
143 [Define if you enable support for libsmi])
146 dnl autoconf documentation says that
147 dnl $? contains the exit value.
148 dnl reality is that it does not.
149 dnl We leave this in just in case
150 dnl autoconf ever comes back to
151 dnl match the documentation.
153 1) AC_MSG_RESULT(no - smiInit failed) ;;
154 2) AC_MSG_RESULT(no - header/library version mismatch) ;;
155 3) AC_MSG_RESULT(no - can't determine library version) ;;
156 4) AC_MSG_RESULT(no - too old) ;;
157 *) AC_MSG_RESULT(no) ;;
162 AC_MSG_RESULT(not when cross-compiling)
170 AC_MSG_CHECKING([whether to enable the possibly-buggy SMB printer])
172 [ --enable-smb enable possibly-buggy SMB printer [default=no]
173 --disable-smb disable possibly-buggy SMB printer],,
176 yes) AC_MSG_RESULT(yes)
177 AC_DEFINE(ENABLE_SMB, 1,
178 [define if you want to build the possibly-buggy SMB printer])
179 LOCALSRC="print-smb.c smbutil.c $LOCALSRC"
185 AC_ARG_WITH(user, [ --with-user=USERNAME drop privileges by default to USERNAME])
186 AC_MSG_CHECKING([whether to drop root privileges by default])
187 if test ! -z "$with_user" ; then
188 AC_DEFINE_UNQUOTED(WITH_USER, "$withval",
189 [define if should drop privileges by default])
190 AC_MSG_RESULT(to \"$withval\")
195 AC_ARG_WITH(chroot, [ --with-chroot=DIRECTORY when dropping privileges, chroot to DIRECTORY])
196 AC_MSG_CHECKING([whether to chroot])
197 if test ! -z "$with_chroot" && test "$with_chroot" != "no" ; then
198 AC_DEFINE_UNQUOTED(WITH_CHROOT, "$withval",
199 [define if should chroot when dropping privileges])
200 AC_MSG_RESULT(to \"$withval\")
205 AC_ARG_WITH(sandbox-capsicum,
206 AS_HELP_STRING([--with-sandbox-capsicum],
207 [use Capsicum security functions @<:@default=yes, if available@:>@]))
209 # Check whether various functions are available. If any are, set
210 # ac_lbl_capsicum_function_seen to yes; if any are not, set
211 # ac_lbl_capsicum_function_not_seen to yes.
213 # We don't check cap_rights_init(), as it's a macro, wrapping another
214 # function, in at least some versions of FreeBSD, and AC_CHECK_FUNCS()
215 # doesn't handle that.
217 # All of the ones we check for must be available in order to enable
218 # capsicum sandboxing.
220 # XXX - do we need to check for all of them, or are there some that, if
221 # present, imply others are present?
223 if test ! -z "$with_sandbox-capsicum" && test "$with_sandbox-capsicum" != "no" ; then
224 AC_CHECK_FUNCS(cap_enter cap_rights_limit cap_ioctls_limit openat,
225 ac_lbl_capsicum_function_seen=yes,
226 ac_lbl_capsicum_function_not_seen=yes)
228 AC_MSG_CHECKING([whether to sandbox using capsicum])
229 if test "x$ac_lbl_capsicum_function_seen" = "xyes" -a "x$ac_lbl_capsicum_function_not_seen" != "xyes"; then
230 AC_DEFINE(HAVE_CAPSICUM, 1, [capsicum support available])
237 # We must check this before checking whether to check the OS's IPv6,
238 # support because, on some platforms (such as SunOS 5.x), the test
239 # program requires the extra networking libraries.
244 # Check whether AF_INET6 and struct in6_addr are defined.
245 # If they aren't both defined, we don't have sufficient OS
246 # support for IPv6, so we don't look for IPv6 support libraries,
247 # and we define AF_INET6 and struct in6_addr ourselves.
249 AC_MSG_CHECKING([whether the operating system supports IPv6])
254 /* AF_INET6 available check */
255 #include <sys/types.h>
256 #include <sys/socket.h>
257 #include <netinet/in.h>
260 foo(struct in6_addr *addr)
262 memset(addr, 0, sizeof (struct in6_addr));
265 #error "AF_INET6 not defined"
271 AC_DEFINE(HAVE_OS_IPV6_SUPPORT, 1,
272 [define if the OS provides AF_INET6 and struct in6_addr])
285 if test "$ipv6" = "yes"; then
286 AC_MSG_CHECKING([ipv6 stack type])
287 for i in inria kame linux-glibc linux-libinet6 toshiba v6d zeta; do
290 dnl http://www.kame.net/
292 [#include <netinet/in.h>
293 #ifdef IPV6_INRIA_VERSION
299 dnl http://www.kame.net/
301 [#include <netinet/in.h>
307 ipv6libdir=/usr/local/v6/lib;
311 dnl http://www.v6.linux.or.jp/
313 [#include <features.h>
314 #if defined(__GLIBC__) && __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1
320 dnl http://www.v6.linux.or.jp/
322 dnl This also matches Solaris 8 and Tru64 UNIX 5.1,
323 dnl and possibly other versions of those OSes
325 if test -d /usr/inet6 -o -f /usr/include/netinet/ip6.h; then
328 ipv6libdir=/usr/inet6/lib
330 CFLAGS="-I/usr/inet6/include $CFLAGS"
335 [#include <sys/param.h>
336 #ifdef _TOSHIBA_INET6
341 ipv6libdir=/usr/local/v6/lib])
345 [#include </usr/local/v6/include/sys/v6config.h>
351 ipv6libdir=/usr/local/v6/lib;
352 CFLAGS="-I/usr/local/v6/include $CFLAGS"])
356 [#include <sys/param.h>
357 #ifdef _ZETA_MINAMI_INET6
362 ipv6libdir=/usr/local/v6/lib])
365 if test "$ipv6type" != "unknown"; then
369 AC_MSG_RESULT($ipv6type)
372 if test "$ipv6" = "yes" -a "$ipv6lib" != "none"; then
373 if test -d $ipv6libdir -a -f $ipv6libdir/lib$ipv6lib.a; then
374 LIBS="-L$ipv6libdir -l$ipv6lib $LIBS"
375 echo "You have $ipv6lib library, using it"
377 if test "$ipv6trylibc" = "yes"; then
378 echo "You do not have $ipv6lib library, using libc"
380 echo 'Fatal: no $ipv6lib library found. cannot continue.'
381 echo "You need to fetch lib$ipv6lib.a from appropriate"
382 echo 'ipv6 kit and compile beforehand.'
388 AC_REPLACE_FUNCS(vfprintf strlcat strlcpy strdup strsep getopt_long)
389 AC_CHECK_FUNCS(fork vfork strftime)
390 AC_CHECK_FUNCS(setlinebuf alarm)
393 AC_CHECK_FUNCS(vsnprintf snprintf,,
395 if test $needsnprintf = yes; then
401 AC_CHECK_LIB(rpc, main) dnl It's unclear why we might need -lrpc
403 dnl Some platforms may need -lnsl for getrpcbynumber.
404 AC_SEARCH_LIBS(getrpcbynumber, nsl,
405 AC_DEFINE(HAVE_GETRPCBYNUMBER, 1, [define if you have getrpcbynumber()]))
407 AC_LBL_LIBPCAP(V_PCAPDEP, V_INCLS)
410 # Check for these after AC_LBL_LIBPCAP, so we link with the appropriate
411 # libraries (e.g., "-lsocket -lnsl" on Solaris).
413 # You are in a twisty little maze of UN*Xes, all different.
414 # Some might not have ether_ntohost().
415 # Some might have it, but not declare it in any header file.
416 # Some might have it, but declare it in <netinet/if_ether.h>.
417 # Some might have it, but declare it in <netinet/ether.h>
418 # (And some might have it but document it as something declared in
419 # <netinet/ethernet.h>, although <netinet/if_ether.h> appears to work.)
421 # Before you is a C compiler.
423 AC_CHECK_FUNCS(ether_ntohost, [
424 AC_CACHE_CHECK(for buggy ether_ntohost, ac_cv_buggy_ether_ntohost, [
427 #include <sys/types.h>
428 #include <sys/param.h>
429 #include <sys/socket.h>
432 main(int argc, char **argv)
434 u_char ea[6] = { 0xff, 0xff, 0xff, 0xff, 0xff };
435 char name[MAXHOSTNAMELEN];
437 ether_ntohost(name, (struct ether_addr *)ea);
440 ], [ac_cv_buggy_ether_ntohost=no],
441 [ac_cv_buggy_ether_ntohost=yes],
442 [ac_cv_buggy_ether_ntohost="not while cross-compiling"])])
443 if test "$ac_cv_buggy_ether_ntohost" = "no"; then
444 AC_DEFINE(USE_ETHER_NTOHOST, 1,
445 [define if you have ether_ntohost() and it works])
448 if test "$ac_cv_func_ether_ntohost" = yes -a \
449 "$ac_cv_buggy_ether_ntohost" = "no"; then
451 # OK, we have ether_ntohost(). Do we have <netinet/if_ether.h>?
453 if test "$ac_cv_header_netinet_if_ether_h" = yes; then
455 # Yes. Does it declare ether_ntohost()?
457 AC_CHECK_DECL(ether_ntohost,
459 AC_DEFINE(NETINET_IF_ETHER_H_DECLARES_ETHER_NTOHOST,,
460 [Define to 1 if netinet/if_ether.h declares `ether_ntohost'])
463 #include <sys/types.h>
464 #include <sys/socket.h>
465 #include <netinet/in.h>
466 #include <arpa/inet.h>
470 #include <netinet/if_ether.h>
476 if test "$ac_cv_have_decl_ether_ntohost" != yes; then
478 # No, how about <netinet/ether.h>, as on Linux?
480 AC_CHECK_HEADERS(netinet/ether.h)
481 if test "$ac_cv_header_netinet_ether_h" = yes; then
483 # We have it - does it declare ether_ntohost()?
484 # Unset ac_cv_have_decl_ether_ntohost so we don't
485 # treat the previous failure as a cached value and
486 # suppress the next test.
488 unset ac_cv_have_decl_ether_ntohost
489 AC_CHECK_DECL(ether_ntohost,
491 AC_DEFINE(NETINET_ETHER_H_DECLARES_ETHER_NTOHOST,,
492 [Define to 1 if netinet/ether.h declares `ether_ntohost'])
495 #include <netinet/ether.h>
500 # Is ether_ntohost() declared?
502 if test "$ac_cv_have_decl_ether_ntohost" != yes; then
504 # No, we'll have to declare it ourselves.
505 # Do we have "struct ether_addr"?
507 AC_CHECK_TYPES(struct ether_addr,,,
509 #include <sys/types.h>
510 #include <sys/socket.h>
511 #include <netinet/in.h>
512 #include <arpa/inet.h>
516 #include <netinet/if_ether.h>
518 AC_DEFINE(HAVE_DECL_ETHER_NTOHOST, 0,
519 [Define to 1 if you have the declaration of `ether_ntohost', and to 0 if you
522 AC_DEFINE(HAVE_DECL_ETHER_NTOHOST, 1,
523 [Define to 1 if you have the declaration of `ether_ntohost', and to 0 if you
528 # libdlpi is needed for Solaris 11 and later.
529 AC_CHECK_LIB(dlpi, dlpi_walk, LIBS="$LIBS -ldlpi" LDFLAGS="-L/lib $LDFLAGS", ,-L/lib)
532 dnl Check for "pcap_list_datalinks()", "pcap_set_datalink()",
533 dnl and "pcap_datalink_name_to_val()", and use substitute versions
534 dnl if they're not present.
536 AC_CHECK_FUNC(pcap_list_datalinks,
538 AC_DEFINE(HAVE_PCAP_LIST_DATALINKS, 1,
539 [define if libpcap has pcap_list_datalinks()])
540 AC_CHECK_FUNCS(pcap_free_datalinks)
545 AC_CHECK_FUNCS(pcap_set_datalink)
546 AC_CHECK_FUNC(pcap_datalink_name_to_val,
548 AC_DEFINE(HAVE_PCAP_DATALINK_NAME_TO_VAL, 1,
549 [define if libpcap has pcap_datalink_name_to_val()])
550 AC_CHECK_FUNC(pcap_datalink_val_to_description,
551 AC_DEFINE(HAVE_PCAP_DATALINK_VAL_TO_DESCRIPTION, 1,
552 [define if libpcap has pcap_datalink_val_to_description()]),
562 dnl Check for "pcap_breakloop()"; you can't substitute for it if
563 dnl it's absent (it has hooks into the live capture routines),
564 dnl so just define the HAVE_ value if it's there.
566 AC_CHECK_FUNCS(pcap_breakloop)
569 dnl Check for "pcap_dump_ftell()" and use a substitute version
570 dnl if it's not present.
572 AC_CHECK_FUNC(pcap_dump_ftell,
573 AC_DEFINE(HAVE_PCAP_DUMP_FTELL, 1,
574 [define if libpcap has pcap_dump_ftell()]),
576 AC_LIBOBJ(pcap_dump_ftell)
580 # Do we have the new open API? Check for pcap_create, and assume that,
581 # if we do, we also have pcap_activate() and the other new routines
582 # introduced in libpcap 1.0.0.
584 AC_CHECK_FUNCS(pcap_create)
585 if test $ac_cv_func_pcap_create = "yes" ; then
587 # OK, do we have pcap_set_tstamp_type? If so, assume we have
588 # pcap_list_tstamp_types and pcap_free_tstamp_types as well.
590 AC_CHECK_FUNCS(pcap_set_tstamp_type)
592 # And do we have pcap_set_tstamp_precision? If so, we assume
593 # we also have pcap_open_offline_with_tstamp_precision.
595 AC_CHECK_FUNCS(pcap_set_tstamp_precision)
599 # Check for a miscellaneous collection of functions which we use
602 AC_CHECK_FUNCS(pcap_findalldevs pcap_dump_flush pcap_lib_version pcap_setdirection pcap_set_immediate_mode)
603 if test $ac_cv_func_pcap_findalldevs = "yes" ; then
604 dnl Check for Mac OS X, which may ship pcap.h from 0.6 but libpcap may
605 dnl be 0.8; this means that lib has pcap_findalldevs but header doesn't
607 savedcppflags="$CPPFLAGS"
608 CPPFLAGS="$CPPFLAGS $V_INCLS"
609 AC_CHECK_TYPES(pcap_if_t, , , [#include <pcap.h>])
610 CPPFLAGS="$savedcppflags"
613 if test $ac_cv_func_pcap_lib_version = "no" ; then
614 AC_MSG_CHECKING(whether pcap_version is defined by libpcap)
617 extern char pcap_version[];
619 return (int)pcap_version;
621 ac_lbl_cv_pcap_version_defined=yes,
622 ac_lbl_cv_pcap_version_defined=no)
623 if test "$ac_lbl_cv_pcap_version_defined" = yes ; then
625 AC_DEFINE(HAVE_PCAP_VERSION, 1, [define if libpcap has pcap_version])
632 # Check for special debugging functions
634 AC_CHECK_FUNCS(pcap_set_parser_debug)
635 if test "$ac_cv_func_pcap_set_parser_debug" = "no" ; then
637 # OK, we don't have pcap_set_parser_debug() to set the libpcap
638 # filter expression parser debug flag; can we directly set the
640 AC_MSG_CHECKING(whether pcap_debug is defined by libpcap)
643 extern int pcap_debug;
647 ac_lbl_cv_pcap_debug_defined=yes,
648 ac_lbl_cv_pcap_debug_defined=no)
649 if test "$ac_lbl_cv_pcap_debug_defined" = yes ; then
651 AC_DEFINE(HAVE_PCAP_DEBUG, 1, [define if libpcap has pcap_debug])
655 # OK, what about "yydebug"?
657 AC_MSG_CHECKING(whether yydebug is defined by libpcap)
664 ac_lbl_cv_yydebug_defined=yes,
665 ac_lbl_cv_yydebug_defined=no)
666 if test "$ac_lbl_cv_yydebug_defined" = yes ; then
668 AC_DEFINE(HAVE_YYDEBUG, 1, [define if libpcap has yydebug])
674 AC_CHECK_FUNCS(pcap_set_optimizer_debug)
675 AC_REPLACE_FUNCS(bpf_dump) dnl moved to libpcap in 0.6
678 if test -f /etc/group -a ! -z "`grep '^wheel:' /etc/group`" ; then
682 # Assume V7/BSD convention for man pages (file formats in section 5,
683 # miscellaneous info in section 7).
690 dnl Workaround to enable certain features
691 AC_DEFINE(_SUN,1,[define on AIX to get certain functions])
696 # Use System V conventions for man pages.
706 # Use System V conventions for man pages.
716 # Use System V conventions for man pages.
726 # Use System V conventions for man pages.
733 if test -f /dev/bpf0 ; then
738 # Make sure we have definitions for all the C99 specified-width types
739 # (regardless of whether the environment is a C99 environment or not).
751 # Make sure we have a definition for C99's uintptr_t (regardless of
752 # whether the environment is a C99 environment or not).
757 # Define the old BSD specified-width types in terms of the C99 types;
758 # we may need them with libpcap include files.
760 AC_CHECK_TYPE([u_int8_t], ,
761 [AC_DEFINE([u_int8_t], [uint8_t],
762 [Define to `uint8_t' if u_int8_t not defined.])],
764 #include <sys/types.h>
766 AC_CHECK_TYPE([u_int16_t], ,
767 [AC_DEFINE([u_int16_t], [uint16_t],
768 [Define to `uint16_t' if u_int16_t not defined.])],
770 #include <sys/types.h>
772 AC_CHECK_TYPE([u_int32_t], ,
773 [AC_DEFINE([u_int32_t], [uint32_t],
774 [Define to `uint32_t' if u_int32_t not defined.])],
776 #include <sys/types.h>
778 AC_CHECK_TYPE([u_int64_t], ,
779 [AC_DEFINE([u_int64_t], [uint64_t],
780 [Define to `uint64_t' if u_int64_t not defined.])],
782 #include <sys/types.h>
786 # Check for <inttypes.h>
788 AC_CHECK_HEADERS(inttypes.h,
791 # OK, we have inttypes.h, but does it define all the PRI[doxu]64 macros?
792 # Some systems have an inttypes.h that doesn't define all of them.
794 AC_MSG_CHECKING([[whether inttypes.h defines the PRI[doxu]64 macros]])
799 #include <inttypes.h>
801 #include <sys/types.h>
805 printf("%" PRId64 "\n", (uint64_t)1);
806 printf("%" PRIo64 "\n", (uint64_t)1);
807 printf("%" PRIx64 "\n", (uint64_t)1);
808 printf("%" PRIu64 "\n", (uint64_t)1);
814 ac_lbl_inttypes_h_defines_formats=yes
818 ac_lbl_inttypes_h_defines_formats=no
823 # We don't have inttypes.h, so it obviously can't define those
826 ac_lbl_inttypes_h_defines_formats=no
828 if test "$ac_lbl_inttypes_h_defines_formats" = no; then
829 AC_LBL_CHECK_64BIT_FORMAT(l,
831 AC_LBL_CHECK_64BIT_FORMAT(ll,
833 AC_LBL_CHECK_64BIT_FORMAT(L,
835 AC_LBL_CHECK_64BIT_FORMAT(q,
837 AC_MSG_ERROR([neither %llx nor %Lx nor %qx worked on a 64-bit integer])
845 # Check for some headers introduced in later versions of libpcap
846 # and used by some printers.
848 # Those headers use the {u_}intN_t types, so we must do this after
849 # we check for what's needed to get them defined.
851 savedcppflags="$CPPFLAGS"
852 CPPFLAGS="$CPPFLAGS $V_INCLS"
853 AC_CHECK_HEADERS(pcap/bluetooth.h,,,[#include "netdissect-stdinc.h"])
854 AC_CHECK_HEADERS(pcap/nflog.h,,,[#include "netdissect-stdinc.h"])
855 AC_CHECK_HEADERS(pcap/usb.h,,,[#include "netdissect-stdinc.h"])
856 CPPFLAGS="$savedcppflags"
859 AC_CHECK_TOOL([AR], [ar])
861 AC_LBL_DEVEL(V_CCOPT)
863 AC_LBL_SOCKADDR_SA_LEN
865 AC_LBL_UNALIGNED_ACCESS
867 # Check for OpenSSL/libressl libcrypto
868 AC_MSG_CHECKING(whether to use OpenSSL/libressl libcrypto)
869 # Specify location for both includes and libraries.
870 want_libcrypto=ifavailable
872 AS_HELP_STRING([--with-crypto]@<:@=DIR@:>@,
873 [use OpenSSL/libressl libcrypto (located in directory DIR, if specified) @<:@default=yes, if available@:>@]),
875 if test $withval = no
877 # User doesn't want to link with libcrypto.
880 elif test $withval = yes
882 # User wants to link with libcrypto but hasn't specified
887 # User wants to link with libcrypto and has specified
888 # a directory, so use the provided value.
890 libcrypto_root=$withval
891 AC_MSG_RESULT([yes, using the version installed in $withval])
894 # Put the subdirectories of the libcrypto root directory
895 # at the front of the header and library search path.
897 CFLAGS="-I$withval/include $CFLAGS"
898 LIBS="-L$withval/lib $LIBS"
902 # Use libcrypto if it's present, otherwise don't; no directory
905 want_libcrypto=ifavailable
906 AC_MSG_RESULT([yes, if available])
908 if test "$want_libcrypto" != "no"; then
910 # Don't check for libcrypto unless we have its headers;
911 # Apple, bless their pointy little heads, apparently ship
912 # libcrypto as a library, but not the header files, in
913 # El Capitan, probably because they don't want you writing
914 # nasty portable code that could run on other UN*Xes, they
915 # want you writing code that uses their Shiny New Crypto
916 # Library and that only runs on OS X.
918 AC_CHECK_HEADER(openssl/crypto.h,
920 AC_CHECK_LIB(crypto, DES_cbc_encrypt)
921 if test "$ac_cv_lib_crypto_DES_cbc_encrypt" = "yes"; then
922 AC_CHECK_HEADERS(openssl/evp.h)
926 # 1) do we have EVP_CIPHER_CTX_new?
927 # If so, we use it to allocate an
928 # EVP_CIPHER_CTX, as EVP_CIPHER_CTX may be
929 # opaque; otherwise, we allocate it ourselves.
931 # 2) do we have EVP_CipherInit_ex()?
932 # If so, we use it, because we need to be
933 # able to make two "initialize the cipher"
934 # calls, one with the cipher and key, and
935 # one with the IV, and, as of OpenSSL 1.1,
936 # You Can't Do That with EVP_CipherInit(),
937 # because a call to EVP_CipherInit() will
938 # unconditionally clear the context, and
939 # if you don't supply a cipher, it'll
940 # clear the cipher, rendering the context
941 # unusable and causing a crash.
943 AC_CHECK_FUNCS(EVP_CIPHER_CTX_new EVP_CipherInit_ex)
948 # Check for libcap-ng
949 AC_MSG_CHECKING(whether to use libcap-ng)
950 # Specify location for both includes and libraries.
951 want_libcap_ng=ifavailable
953 AS_HELP_STRING([--with-cap-ng],
954 [use libcap-ng @<:@default=yes, if available@:>@]),
956 if test $withval = no
960 elif test $withval = yes
967 # Use libcap-ng if it's present, otherwise don't.
969 want_libcap_ng=ifavailable
970 AC_MSG_RESULT([yes, if available])
972 if test "$want_libcap_ng" != "no"; then
973 AC_CHECK_LIB(cap-ng, capng_change_id)
974 AC_CHECK_HEADERS(cap-ng.h)
978 dnl set additional include path if necessary
979 if test "$missing_includes" = "yes"; then
980 CPPFLAGS="$CPPFLAGS -I$srcdir/missing"
981 V_INCLS="$V_INCLS -I$srcdir/missing"
990 AC_SUBST(MAN_FILE_FORMATS)
991 AC_SUBST(MAN_MISC_INFO)
995 AC_CONFIG_HEADER(config.h)
997 AC_OUTPUT_COMMANDS([if test -f .devel; then
998 echo timestamp > stamp-h
999 cat Makefile-devel-adds >> Makefile
1002 AC_OUTPUT(Makefile tcpdump.1)