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___FALLTHROUGH
31 AC_CHECK_HEADERS(fcntl.h rpc/rpc.h rpc/rpcent.h netdnet/dnetdb.h)
32 AC_CHECK_HEADERS(net/pfvar.h, , , [#include <sys/types.h>
33 #include <sys/socket.h>
35 if test "$ac_cv_header_net_pfvar_h" = yes; then
36 AC_CHECK_HEADERS(net/if_pflog.h, , , [#include <sys/types.h>
37 #include <sys/socket.h>
39 #include <net/pfvar.h>])
40 if test "$ac_cv_header_net_if_pflog_h" = yes; then
41 LOCALSRC="print-pflog.c $LOCALSRC"
44 AC_CHECK_HEADERS(netinet/if_ether.h, , , [#include <sys/types.h>
45 #include <sys/socket.h>])
46 if test "$ac_cv_header_netinet_if_ether_h" != yes; then
48 # The simple test didn't work.
49 # Do we need to include <net/if.h> first?
50 # Unset ac_cv_header_netinet_if_ether_h so we don't
51 # treat the previous failure as a cached value and
52 # suppress the next test.
54 AC_MSG_NOTICE([Rechecking with some additional includes])
55 unset ac_cv_header_netinet_if_ether_h
56 AC_CHECK_HEADERS(netinet/if_ether.h, , , [#include <sys/types.h>
57 #include <sys/socket.h>
58 #include <netinet/in.h>
69 AC_ARG_ENABLE(universal,
70 AC_HELP_STRING([--disable-universal],[don't build universal on OS X]))
71 if test "$enable_universal" != "no"; then
76 # Leopard. Build for x86 and 32-bit PowerPC, with
77 # x86 first. (That's what Apple does.)
79 V_CCOPT="$V_CCOPT -arch i386 -arch ppc"
80 LDFLAGS="$LDFLAGS -arch i386 -arch ppc"
85 # Snow Leopard. Build for x86-64 and x86, with
86 # x86-64 first. (That's what Apple does.)
88 V_CCOPT="$V_CCOPT -arch x86_64 -arch i386"
89 LDFLAGS="$LDFLAGS -arch x86_64 -arch i386"
98 [ --with-smi link with libsmi (allows to load MIBs on the fly to decode SNMP packets. [default=yes]
99 --without-smi don't link with libsmi],,
102 if test "x$with_smi" != "xno" ; then
103 AC_CHECK_HEADER(smi.h,
106 # OK, we found smi.h. Do we have libsmi with smiInit?
108 AC_CHECK_LIB(smi, smiInit,
111 # OK, we have libsmi with smiInit. Can we use it?
113 AC_MSG_CHECKING([whether to enable libsmi])
118 /* libsmi available check */
122 int current, revision, age, n;
123 const int required = 2;
126 if (strcmp(SMI_LIBRARY_VERSION, smi_library_version))
128 n = sscanf(smi_library_version, "%d:%d:%d", ¤t, &revision, &age);
131 if (required < current - age || required > current)
138 AC_DEFINE(USE_LIBSMI, 1,
139 [Define if you enable support for libsmi])
142 dnl autoconf documentation says that
143 dnl $? contains the exit value.
144 dnl reality is that it does not.
145 dnl We leave this in just in case
146 dnl autoconf ever comes back to
147 dnl match the documentation.
149 1) AC_MSG_RESULT(no - smiInit failed) ;;
150 2) AC_MSG_RESULT(no - header/library version mismatch) ;;
151 3) AC_MSG_RESULT(no - can't determine library version) ;;
152 4) AC_MSG_RESULT(no - too old) ;;
153 *) AC_MSG_RESULT(no) ;;
158 AC_MSG_RESULT(not when cross-compiling)
166 AC_MSG_CHECKING([whether to enable the possibly-buggy SMB printer])
168 [ --enable-smb enable possibly-buggy SMB printer [default=yes]
169 --disable-smb disable possibly-buggy SMB printer],,
172 yes) AC_MSG_RESULT(yes)
173 AC_WARN([The SMB printer may have exploitable buffer overflows!!!])
174 AC_DEFINE(ENABLE_SMB, 1,
175 [define if you want to build the possibly-buggy SMB printer])
176 LOCALSRC="print-smb.c smbutil.c $LOCALSRC"
182 AC_ARG_WITH(user, [ --with-user=USERNAME drop privileges by default to USERNAME])
183 AC_MSG_CHECKING([whether to drop root privileges by default])
184 if test ! -z "$with_user" ; then
185 AC_DEFINE_UNQUOTED(WITH_USER, "$withval",
186 [define if should drop privileges by default])
187 AC_MSG_RESULT(to \"$withval\")
192 AC_ARG_WITH(chroot, [ --with-chroot=DIRECTORY when dropping privileges, chroot to DIRECTORY])
193 AC_MSG_CHECKING([whether to chroot])
194 if test ! -z "$with_chroot" && test "$with_chroot" != "no" ; then
195 AC_DEFINE_UNQUOTED(WITH_CHROOT, "$withval",
196 [define if should chroot when dropping privileges])
197 AC_MSG_RESULT(to \"$withval\")
202 AC_ARG_WITH(sandbox-capsicum,
203 AS_HELP_STRING([--with-sandbox-capsicum],
204 [use Capsicum security functions @<:@default=yes, if available@:>@]))
206 # Check whether various functions are available. If any are, set
207 # ac_lbl_capsicum_function_seen to yes; if any are not, set
208 # ac_lbl_capsicum_function_not_seen to yes.
210 # We don't check cap_rights_init(), as it's a macro, wrapping another
211 # function, in at least some versions of FreeBSD, and AC_CHECK_FUNCS()
212 # doesn't handle that.
214 # All of the ones we check for must be available in order to enable
215 # capsicum sandboxing.
217 # XXX - do we need to check for all of them, or are there some that, if
218 # present, imply others are present?
220 if test ! -z "$with_sandbox-capsicum" && test "$with_sandbox-capsicum" != "no" ; then
221 AC_CHECK_FUNCS(cap_enter cap_rights_limit cap_ioctls_limit openat,
222 ac_lbl_capsicum_function_seen=yes,
223 ac_lbl_capsicum_function_not_seen=yes)
224 AC_CHECK_LIB(casper, cap_init, LIBS="$LIBS -lcasper")
225 AC_CHECK_LIB(cap_dns, cap_gethostbyaddr, LIBS="$LIBS -lcap_dns")
227 AC_MSG_CHECKING([whether to sandbox using capsicum])
228 if test "x$ac_lbl_capsicum_function_seen" = "xyes" -a "x$ac_lbl_capsicum_function_not_seen" != "xyes"; then
229 AC_DEFINE(HAVE_CAPSICUM, 1, [capsicum support available])
234 AC_MSG_CHECKING([whether to sandbox using Casper library])
235 if test "x$ac_cv_lib_casper_cap_init" = "xyes" -a "x$ac_cv_lib_cap_dns_cap_gethostbyaddr" = "xyes"; then
236 AC_DEFINE(HAVE_CASPER, 1, [Casper support available])
243 # We must check this before checking whether to check the OS's IPv6,
244 # support because, on some platforms (such as SunOS 5.x), the test
245 # program requires the extra networking libraries.
250 # Check whether AF_INET6 and struct in6_addr are defined.
251 # If they aren't both defined, we don't have sufficient OS
252 # support for IPv6, so we don't look for IPv6 support libraries,
253 # and we define AF_INET6 and struct in6_addr ourselves.
255 AC_MSG_CHECKING([whether the operating system supports IPv6])
260 /* AF_INET6 available check */
261 #include <sys/types.h>
262 #include <sys/socket.h>
263 #include <netinet/in.h>
266 foo(struct in6_addr *addr)
268 memset(addr, 0, sizeof (struct in6_addr));
271 #error "AF_INET6 not defined"
277 AC_DEFINE(HAVE_OS_IPV6_SUPPORT, 1,
278 [define if the OS provides AF_INET6 and struct in6_addr])
291 if test "$ipv6" = "yes"; then
292 AC_MSG_CHECKING([ipv6 stack type])
293 for i in inria kame linux-glibc linux-libinet6 toshiba v6d zeta; do
296 dnl http://www.kame.net/
298 [#include <netinet/in.h>
299 #ifdef IPV6_INRIA_VERSION
305 dnl http://www.kame.net/
307 [#include <netinet/in.h>
313 ipv6libdir=/usr/local/v6/lib;
317 dnl http://www.v6.linux.or.jp/
319 [#include <features.h>
320 #if defined(__GLIBC__) && __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1
326 dnl http://www.v6.linux.or.jp/
328 dnl This also matches Solaris 8 and Tru64 UNIX 5.1,
329 dnl and possibly other versions of those OSes
331 if test -d /usr/inet6 -o -f /usr/include/netinet/ip6.h; then
334 ipv6libdir=/usr/inet6/lib
336 CFLAGS="-I/usr/inet6/include $CFLAGS"
341 [#include <sys/param.h>
342 #ifdef _TOSHIBA_INET6
347 ipv6libdir=/usr/local/v6/lib])
351 [#include </usr/local/v6/include/sys/v6config.h>
357 ipv6libdir=/usr/local/v6/lib;
358 CFLAGS="-I/usr/local/v6/include $CFLAGS"])
362 [#include <sys/param.h>
363 #ifdef _ZETA_MINAMI_INET6
368 ipv6libdir=/usr/local/v6/lib])
371 if test "$ipv6type" != "unknown"; then
375 AC_MSG_RESULT($ipv6type)
378 if test "$ipv6" = "yes" -a "$ipv6lib" != "none"; then
379 if test -d $ipv6libdir -a -f $ipv6libdir/lib$ipv6lib.a; then
380 LIBS="-L$ipv6libdir -l$ipv6lib $LIBS"
381 echo "You have $ipv6lib library, using it"
383 if test "$ipv6trylibc" = "yes"; then
384 echo "You do not have $ipv6lib library, using libc"
386 echo 'Fatal: no $ipv6lib library found. cannot continue.'
387 echo "You need to fetch lib$ipv6lib.a from appropriate"
388 echo 'ipv6 kit and compile beforehand.'
394 AC_CACHE_CHECK([for dnet_htoa declaration in netdnet/dnetdb.h],
395 [td_cv_decl_netdnet_dnetdb_h_dnet_htoa],
396 [AC_EGREP_HEADER(dnet_htoa, netdnet/dnetdb.h,
397 td_cv_decl_netdnet_dnetdb_h_dnet_htoa=yes,
398 td_cv_decl_netdnet_dnetdb_h_dnet_htoa=no)])
399 if test "$td_cv_decl_netdnet_dnetdb_h_dnet_htoa" = yes; then
400 AC_DEFINE(HAVE_NETDNET_DNETDB_H_DNET_HTOA, 1,
401 [define if you have a dnet_htoa declaration in <netdnet/dnetdb.h>])
404 AC_REPLACE_FUNCS(vfprintf strlcat strlcpy strdup strsep getopt_long)
405 AC_CHECK_FUNCS(fork vfork strftime)
406 AC_CHECK_FUNCS(setlinebuf alarm)
409 AC_CHECK_FUNCS(vsnprintf snprintf,,
411 if test $needsnprintf = yes; then
415 AC_SEARCH_LIBS(dnet_htoa, dnet,
416 AC_DEFINE(HAVE_DNET_HTOA, 1, [define if you have the dnet_htoa function]))
418 AC_CHECK_LIB(rpc, main) dnl It's unclear why we might need -lrpc
420 dnl Some platforms may need -lnsl for getrpcbynumber.
421 AC_SEARCH_LIBS(getrpcbynumber, nsl,
422 AC_DEFINE(HAVE_GETRPCBYNUMBER, 1, [define if you have getrpcbynumber()]))
424 AC_LBL_LIBPCAP(V_PCAPDEP, V_INCLS)
427 # Check for these after AC_LBL_LIBPCAP, so we link with the appropriate
428 # libraries (e.g., "-lsocket -lnsl" on Solaris).
430 # You are in a twisty little maze of UN*Xes, all different.
431 # Some might not have ether_ntohost().
432 # Some might have it, but not declare it in any header file.
433 # Some might have it, but declare it in <netinet/if_ether.h>.
434 # Some might have it, but declare it in <netinet/ether.h>
435 # (And some might have it but document it as something declared in
436 # <netinet/ethernet.h>, although <netinet/if_ether.h> appears to work.)
438 # Before you is a C compiler.
440 AC_CHECK_FUNCS(ether_ntohost, [
441 AC_CACHE_CHECK(for buggy ether_ntohost, ac_cv_buggy_ether_ntohost, [
444 #include <sys/types.h>
445 #include <sys/param.h>
446 #include <sys/socket.h>
449 main(int argc, char **argv)
451 u_char ea[6] = { 0xff, 0xff, 0xff, 0xff, 0xff };
452 char name[MAXHOSTNAMELEN];
454 ether_ntohost(name, (struct ether_addr *)ea);
457 ], [ac_cv_buggy_ether_ntohost=no],
458 [ac_cv_buggy_ether_ntohost=yes],
459 [ac_cv_buggy_ether_ntohost="not while cross-compiling"])])
460 if test "$ac_cv_buggy_ether_ntohost" = "no"; then
461 AC_DEFINE(USE_ETHER_NTOHOST, 1,
462 [define if you have ether_ntohost() and it works])
465 if test "$ac_cv_func_ether_ntohost" = yes -a \
466 "$ac_cv_buggy_ether_ntohost" = "no"; then
468 # OK, we have ether_ntohost(). Do we have <netinet/if_ether.h>?
470 if test "$ac_cv_header_netinet_if_ether_h" = yes; then
472 # Yes. Does it declare ether_ntohost()?
474 AC_CHECK_DECL(ether_ntohost,
476 AC_DEFINE(NETINET_IF_ETHER_H_DECLARES_ETHER_NTOHOST,,
477 [Define to 1 if netinet/if_ether.h declares `ether_ntohost'])
480 #include <sys/types.h>
481 #include <sys/socket.h>
482 #include <netinet/in.h>
483 #include <arpa/inet.h>
487 #include <netinet/if_ether.h>
493 if test "$ac_cv_have_decl_ether_ntohost" != yes; then
495 # No, how about <netinet/ether.h>, as on Linux?
497 AC_CHECK_HEADERS(netinet/ether.h)
498 if test "$ac_cv_header_netinet_ether_h" = yes; then
500 # We have it - does it declare ether_ntohost()?
501 # Unset ac_cv_have_decl_ether_ntohost so we don't
502 # treat the previous failure as a cached value and
503 # suppress the next test.
505 unset ac_cv_have_decl_ether_ntohost
506 AC_CHECK_DECL(ether_ntohost,
508 AC_DEFINE(NETINET_ETHER_H_DECLARES_ETHER_NTOHOST,,
509 [Define to 1 if netinet/ether.h declares `ether_ntohost'])
512 #include <netinet/ether.h>
517 # Is ether_ntohost() declared?
519 if test "$ac_cv_have_decl_ether_ntohost" != yes; then
521 # No, we'll have to declare it ourselves.
522 # Do we have "struct ether_addr"?
524 AC_CHECK_TYPES(struct ether_addr,,,
526 #include <sys/types.h>
527 #include <sys/socket.h>
528 #include <netinet/in.h>
529 #include <arpa/inet.h>
533 #include <netinet/if_ether.h>
535 AC_DEFINE(HAVE_DECL_ETHER_NTOHOST, 0,
536 [Define to 1 if you have the declaration of `ether_ntohost', and to 0 if you
539 AC_DEFINE(HAVE_DECL_ETHER_NTOHOST, 1,
540 [Define to 1 if you have the declaration of `ether_ntohost', and to 0 if you
545 # libdlpi is needed for Solaris 11 and later.
546 AC_CHECK_LIB(dlpi, dlpi_walk, LIBS="$LIBS -ldlpi" LDFLAGS="-L/lib $LDFLAGS", ,-L/lib)
549 dnl Check for "pcap_list_datalinks()", "pcap_set_datalink()",
550 dnl and "pcap_datalink_name_to_val()", and use substitute versions
551 dnl if they're not present.
553 AC_CHECK_FUNC(pcap_list_datalinks,
555 AC_DEFINE(HAVE_PCAP_LIST_DATALINKS, 1,
556 [define if libpcap has pcap_list_datalinks()])
557 AC_CHECK_FUNCS(pcap_free_datalinks)
562 AC_CHECK_FUNCS(pcap_set_datalink)
563 AC_CHECK_FUNC(pcap_datalink_name_to_val,
565 AC_DEFINE(HAVE_PCAP_DATALINK_NAME_TO_VAL, 1,
566 [define if libpcap has pcap_datalink_name_to_val()])
567 AC_CHECK_FUNC(pcap_datalink_val_to_description,
568 AC_DEFINE(HAVE_PCAP_DATALINK_VAL_TO_DESCRIPTION, 1,
569 [define if libpcap has pcap_datalink_val_to_description()]),
579 dnl Check for "pcap_breakloop()"; you can't substitute for it if
580 dnl it's absent (it has hooks into the live capture routines),
581 dnl so just define the HAVE_ value if it's there.
583 AC_CHECK_FUNCS(pcap_breakloop)
586 dnl Check for "pcap_dump_ftell()" and use a substitute version
587 dnl if it's not present.
589 AC_CHECK_FUNC(pcap_dump_ftell,
590 AC_DEFINE(HAVE_PCAP_DUMP_FTELL, 1,
591 [define if libpcap has pcap_dump_ftell()]),
593 AC_LIBOBJ(pcap_dump_ftell)
597 # Do we have the new open API? Check for pcap_create, and assume that,
598 # if we do, we also have pcap_activate() and the other new routines
599 # introduced in libpcap 1.0.0.
601 AC_CHECK_FUNCS(pcap_create)
602 if test $ac_cv_func_pcap_create = "yes" ; then
604 # OK, do we have pcap_set_tstamp_type? If so, assume we have
605 # pcap_list_tstamp_types and pcap_free_tstamp_types as well.
607 AC_CHECK_FUNCS(pcap_set_tstamp_type)
609 # And do we have pcap_set_tstamp_precision? If so, we assume
610 # we also have pcap_open_offline_with_tstamp_precision.
612 AC_CHECK_FUNCS(pcap_set_tstamp_precision)
616 # Check for a miscellaneous collection of functions which we use
619 AC_CHECK_FUNCS(pcap_findalldevs pcap_dump_flush pcap_lib_version)
620 AC_CHECK_FUNCS(pcap_setdirection pcap_set_immediate_mode pcap_dump_ftell64)
621 if test $ac_cv_func_pcap_findalldevs = "yes" ; then
622 dnl Check for Mac OS X, which may ship pcap.h from 0.6 but libpcap may
623 dnl be 0.8; this means that lib has pcap_findalldevs but header doesn't
625 savedcppflags="$CPPFLAGS"
626 CPPFLAGS="$CPPFLAGS $V_INCLS"
627 AC_CHECK_TYPES(pcap_if_t, , , [#include <pcap.h>])
628 CPPFLAGS="$savedcppflags"
631 if test $ac_cv_func_pcap_lib_version = "no" ; then
632 AC_MSG_CHECKING(whether pcap_version is defined by libpcap)
635 extern char pcap_version[];
637 return (int)pcap_version;
639 ac_lbl_cv_pcap_version_defined=yes,
640 ac_lbl_cv_pcap_version_defined=no)
641 if test "$ac_lbl_cv_pcap_version_defined" = yes ; then
643 AC_DEFINE(HAVE_PCAP_VERSION, 1, [define if libpcap has pcap_version])
650 # Check for special debugging functions
652 AC_CHECK_FUNCS(pcap_set_parser_debug)
653 if test "$ac_cv_func_pcap_set_parser_debug" = "no" ; then
655 # OK, we don't have pcap_set_parser_debug() to set the libpcap
656 # filter expression parser debug flag; can we directly set the
658 AC_MSG_CHECKING(whether pcap_debug is defined by libpcap)
661 extern int pcap_debug;
665 ac_lbl_cv_pcap_debug_defined=yes,
666 ac_lbl_cv_pcap_debug_defined=no)
667 if test "$ac_lbl_cv_pcap_debug_defined" = yes ; then
669 AC_DEFINE(HAVE_PCAP_DEBUG, 1, [define if libpcap has pcap_debug])
673 # OK, what about "yydebug"?
675 AC_MSG_CHECKING(whether yydebug is defined by libpcap)
682 ac_lbl_cv_yydebug_defined=yes,
683 ac_lbl_cv_yydebug_defined=no)
684 if test "$ac_lbl_cv_yydebug_defined" = yes ; then
686 AC_DEFINE(HAVE_YYDEBUG, 1, [define if libpcap has yydebug])
692 AC_CHECK_FUNCS(pcap_set_optimizer_debug)
693 AC_REPLACE_FUNCS(bpf_dump) dnl moved to libpcap in 0.6
696 if test -f /etc/group -a ! -z "`grep '^wheel:' /etc/group`" ; then
700 # Assume V7/BSD convention for man pages (file formats in section 5,
701 # miscellaneous info in section 7).
708 dnl Workaround to enable certain features
709 AC_DEFINE(_SUN,1,[define on AIX to get certain functions])
714 # Use System V conventions for man pages.
724 # Use System V conventions for man pages.
734 # Use System V conventions for man pages.
744 # Use System V conventions for man pages.
751 if test -f /dev/bpf0 ; then
756 # Make sure we have a definition for C99's uintptr_t (regardless of
757 # whether the environment is a C99 environment or not).
762 # Check whether we have pcap/pcap-inttypes.h.
763 # If we do, we use that to get the C99 types defined.
765 savedcppflags="$CPPFLAGS"
766 CPPFLAGS="$CPPFLAGS $V_INCLS"
767 AC_CHECK_HEADERS(pcap/pcap-inttypes.h)
768 CPPFLAGS="$savedcppflags"
771 # Define the old BSD specified-width types in terms of the C99 types;
772 # we may need them with libpcap include files.
774 AC_CHECK_TYPE([u_int8_t], ,
775 [AC_DEFINE([u_int8_t], [uint8_t],
776 [Define to `uint8_t' if u_int8_t not defined.])],
778 #include <sys/types.h>
780 AC_CHECK_TYPE([u_int16_t], ,
781 [AC_DEFINE([u_int16_t], [uint16_t],
782 [Define to `uint16_t' if u_int16_t not defined.])],
784 #include <sys/types.h>
786 AC_CHECK_TYPE([u_int32_t], ,
787 [AC_DEFINE([u_int32_t], [uint32_t],
788 [Define to `uint32_t' if u_int32_t not defined.])],
790 #include <sys/types.h>
792 AC_CHECK_TYPE([u_int64_t], ,
793 [AC_DEFINE([u_int64_t], [uint64_t],
794 [Define to `uint64_t' if u_int64_t not defined.])],
796 #include <sys/types.h>
800 # Check for some headers introduced in later versions of libpcap
801 # and used by some printers.
803 # Those headers might use the {u_}intN_t types, so we must do this
804 # after we check for what's needed to get them defined.
806 savedcppflags="$CPPFLAGS"
807 CPPFLAGS="$CPPFLAGS $V_INCLS"
808 AC_CHECK_HEADERS(pcap/bluetooth.h,,,[#include "netdissect-stdinc.h"])
809 AC_CHECK_HEADERS(pcap/nflog.h,,,[#include "netdissect-stdinc.h"])
810 AC_CHECK_HEADERS(pcap/usb.h,,,[#include "netdissect-stdinc.h"])
811 CPPFLAGS="$savedcppflags"
814 AC_CHECK_TOOL([AR], [ar])
816 AC_LBL_DEVEL(V_CCOPT)
818 # Check for OpenSSL/libressl libcrypto
819 AC_MSG_CHECKING(whether to use OpenSSL/libressl libcrypto)
820 # Specify location for both includes and libraries.
821 want_libcrypto=ifavailable
823 AS_HELP_STRING([--with-crypto]@<:@=DIR@:>@,
824 [use OpenSSL/libressl libcrypto (located in directory DIR, if specified) @<:@default=yes, if available@:>@]),
826 if test $withval = no
828 # User doesn't want to link with libcrypto.
831 elif test $withval = yes
833 # User wants to link with libcrypto but hasn't specified
838 # User wants to link with libcrypto and has specified
839 # a directory, so use the provided value.
841 libcrypto_root=$withval
842 AC_MSG_RESULT([yes, using the version installed in $withval])
845 # Put the subdirectories of the libcrypto root directory
846 # at the front of the header and library search path.
848 CFLAGS="-I$withval/include $CFLAGS"
849 LIBS="-L$withval/lib $LIBS"
853 # Use libcrypto if it's present, otherwise don't; no directory
856 want_libcrypto=ifavailable
857 AC_MSG_RESULT([yes, if available])
859 if test "$want_libcrypto" != "no"; then
861 # Don't check for libcrypto unless we have its headers;
862 # Apple, bless their pointy little heads, apparently ship
863 # libcrypto as a library, but not the header files, in
864 # El Capitan, probably because they don't want you writing
865 # nasty portable code that could run on other UN*Xes, they
866 # want you writing code that uses their Shiny New Crypto
867 # Library and that only runs on OS X.
869 AC_CHECK_HEADER(openssl/crypto.h,
871 AC_CHECK_LIB(crypto, DES_cbc_encrypt)
872 if test "$ac_cv_lib_crypto_DES_cbc_encrypt" = "yes"; then
873 AC_CHECK_HEADERS(openssl/evp.h)
877 # 1) do we have EVP_CIPHER_CTX_new?
878 # If so, we use it to allocate an
879 # EVP_CIPHER_CTX, as EVP_CIPHER_CTX may be
880 # opaque; otherwise, we allocate it ourselves.
882 # 2) do we have EVP_CipherInit_ex()?
883 # If so, we use it, because we need to be
884 # able to make two "initialize the cipher"
885 # calls, one with the cipher and key, and
886 # one with the IV, and, as of OpenSSL 1.1,
887 # You Can't Do That with EVP_CipherInit(),
888 # because a call to EVP_CipherInit() will
889 # unconditionally clear the context, and
890 # if you don't supply a cipher, it'll
891 # clear the cipher, rendering the context
892 # unusable and causing a crash.
894 AC_CHECK_FUNCS(EVP_CIPHER_CTX_new EVP_CipherInit_ex)
899 # Check for libcap-ng
900 AC_MSG_CHECKING(whether to use libcap-ng)
901 # Specify location for both includes and libraries.
902 want_libcap_ng=ifavailable
904 AS_HELP_STRING([--with-cap-ng],
905 [use libcap-ng @<:@default=yes, if available@:>@]),
907 if test $withval = no
911 elif test $withval = yes
918 # Use libcap-ng if it's present, otherwise don't.
920 want_libcap_ng=ifavailable
921 AC_MSG_RESULT([yes, if available])
923 if test "$want_libcap_ng" != "no"; then
924 AC_CHECK_LIB(cap-ng, capng_change_id)
925 AC_CHECK_HEADERS(cap-ng.h)
929 dnl set additional include path if necessary
930 if test "$missing_includes" = "yes"; then
931 CPPFLAGS="$CPPFLAGS -I$srcdir/missing"
932 V_INCLS="$V_INCLS -I$srcdir/missing"
941 AC_SUBST(MAN_FILE_FORMATS)
942 AC_SUBST(MAN_MISC_INFO)
946 AC_CONFIG_HEADER(config.h)
948 AC_OUTPUT_COMMANDS([if test -f .devel; then
949 echo timestamp > stamp-h
950 cat Makefile-devel-adds >> Makefile
953 AC_OUTPUT(Makefile tcpdump.1)