1 dnl @(#) $Header: /tcpdump/master/tcpdump/configure.in,v 1.188 2005-03-27 23:16:08 guy Exp $ (LBL)
3 dnl Copyright (c) 1994, 1995, 1996, 1997
4 dnl The Regents of the University of California. All rights reserved.
6 dnl Process this file with autoconf to produce a configure script.
9 AC_REVISION($Revision: 1.188 $)
15 AC_LBL_C_INIT(V_CCOPT, V_INCLS)
18 AC_CHECK_HEADERS(fcntl.h rpc/rpcent.h netdnet/dnetdb.h)
19 AC_CHECK_HEADERS(netinet/if_ether.h, , , [#include <sys/types.h>
20 #include <sys/socket.h>])
21 if test "$ac_cv_header_netinet_if_ether_h" != yes; then
23 # The simple test didn't work.
24 # Do we need to include <net/if.h> first?
25 # Unset ac_cv_header_netinet_if_ether_h so we don't
26 # treat the previous failure as a cached value and
27 # suppress the next test.
29 AC_MSG_NOTICE([Rechecking with some additional includes])
30 unset ac_cv_header_netinet_if_ether_h
31 AC_CHECK_HEADERS(netinet/if_ether.h, , , [#include <sys/types.h>
32 #include <sys/socket.h>
33 #include <netinet/in.h>
44 AC_MSG_CHECKING(Linux kernel version)
45 if test "$cross_compiling" = yes; then
46 AC_CACHE_VAL(ac_cv_linux_vers,
47 ac_cv_linux_vers=unknown)
49 AC_CACHE_VAL(ac_cv_linux_vers,
50 ac_cv_linux_vers=`uname -r 2>&1 | \
51 sed -n -e '$s/.* //' -e '$s/\..*//p'`)
53 AC_MSG_RESULT($ac_cv_linux_vers)
54 if test $ac_cv_linux_vers = unknown ; then
55 AC_MSG_ERROR(cannot determine linux version when cross-compiling)
57 if test $ac_cv_linux_vers -lt 2 ; then
58 AC_MSG_ERROR(version 2 or higher required; see the INSTALL doc for more info)
67 AC_CHECK_HEADERS(smi.h)
68 AC_CHECK_LIB(smi, smiInit)
69 if test "$ac_cv_header_smi_h" = yes -a "$ac_cv_lib_smi_smiInit" = yes
71 AC_MSG_CHECKING([whether to enable libsmi])
72 AC_TRY_RUN([ /* libsmi available check */
76 int current, revision, age, n;
77 const int required = 2;
80 if (strcmp(SMI_LIBRARY_VERSION, smi_library_version))
82 n = sscanf(smi_library_version, "%d:%d:%d", ¤t, &revision, &age);
85 if (required < current - age || required > current)
93 dnl autoconf documentation says that $? contains the exit value.
94 dnl reality is that it does not. We leave this in just in case
95 dnl autoconf ever comes back to match the documentation.
97 1) AC_MSG_RESULT(no - smiInit failed) ;;
98 2) AC_MSG_RESULT(no - header/library version mismatch) ;;
99 3) AC_MSG_RESULT(no - can't determine library version) ;;
100 4) AC_MSG_RESULT(no - too old) ;;
101 *) AC_MSG_RESULT(no) ;;
104 [ AC_MSG_RESULT(not when cross-compiling)
109 AC_MSG_CHECKING([whether to enable the possibly-buggy SMB printer])
111 [ --enable-smb enable possibly-buggy SMB printer [default=yes]
112 --disable-smb disable possibly-buggy SMB printer],,
115 yes) AC_MSG_RESULT(yes)
116 AC_WARN([The SMB printer may have exploitable buffer overflows!!!])
117 AC_DEFINE(TCPDUMP_DO_SMB)
118 LOCALSRC="print-smb.c smbutil.c $LOCALSRC"
124 AC_ARG_WITH(user, [ --with-user=USERNAME drop privileges by default to USERNAME])
125 AC_MSG_CHECKING([whether to drop root privileges by default])
126 if test ! -z "$with_user" ; then
127 AC_DEFINE_UNQUOTED(WITH_USER, "$withval")
128 AC_MSG_RESULT(to \"$withval\")
133 AC_ARG_WITH(chroot, [ --with-chroot=DIRECTORY when dropping privileges, chroot to DIRECTORY])
134 AC_MSG_CHECKING([whether to chroot])
135 if test ! -z "$with_chroot" ; then
136 AC_DEFINE_UNQUOTED(WITH_CHROOT, "$withval")
137 AC_MSG_RESULT(to \"$withval\")
142 AC_MSG_CHECKING([whether to enable ipv6])
144 [ --enable-ipv6 enable ipv6 (with ipv4) support
145 --disable-ipv6 disable ipv6 support],
146 [ case "$enableval" in
147 yes) AC_MSG_RESULT(yes)
148 LOCALSRC="print-ip6.c print-ip6opts.c print-mobility.c print-ripng.c print-icmp6.c print-frag6.c print-rt6.c print-ospf6.c print-dhcp6.c $LOCALSRC"
158 AC_TRY_RUN([ /* AF_INET6 available check */
159 #include <sys/types.h>
160 #include <sys/socket.h>
163 if (socket(AF_INET6, SOCK_STREAM, 0) < 0)
170 LOCALSRC="print-ip6.c print-ip6opts.c print-mobility.c print-ripng.c print-icmp6.c print-frag6.c print-rt6.c print-ospf6.c print-dhcp6.c $LOCALSRC"
183 if test "$ipv6" = "yes"; then
184 AC_MSG_CHECKING([ipv6 stack type])
185 for i in inria kame linux-glibc linux-libinet6 toshiba v6d zeta; do
188 dnl http://www.kame.net/
190 [#include <netinet/in.h>
191 #ifdef IPV6_INRIA_VERSION
195 CFLAGS="-DINET6 $CFLAGS"])
198 dnl http://www.kame.net/
200 [#include <netinet/in.h>
206 ipv6libdir=/usr/local/v6/lib;
208 CFLAGS="-DINET6 $CFLAGS"])
211 dnl http://www.v6.linux.or.jp/
213 [#include <features.h>
214 #if defined(__GLIBC__) && __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1
218 CFLAGS="-DINET6 $CFLAGS"])
221 dnl http://www.v6.linux.or.jp/
223 dnl This also matches Solaris 8 and Tru64 UNIX 5.1,
224 dnl and possibly other versions of those OSes
226 if test -d /usr/inet6 -o -f /usr/include/netinet/ip6.h; then
229 ipv6libdir=/usr/inet6/lib
231 CFLAGS="-DINET6 -I/usr/inet6/include $CFLAGS"
236 [#include <sys/param.h>
237 #ifdef _TOSHIBA_INET6
242 ipv6libdir=/usr/local/v6/lib;
243 CFLAGS="-DINET6 $CFLAGS"])
247 [#include </usr/local/v6/include/sys/v6config.h>
253 ipv6libdir=/usr/local/v6/lib;
254 CFLAGS="-I/usr/local/v6/include $CFLAGS"])
258 [#include <sys/param.h>
259 #ifdef _ZETA_MINAMI_INET6
264 ipv6libdir=/usr/local/v6/lib;
265 CFLAGS="-DINET6 $CFLAGS"])
268 if test "$ipv6type" != "unknown"; then
272 AC_MSG_RESULT($ipv6type)
275 if test "$ipv6" = "yes" -a "$ipv6lib" != "none"; then
276 if test -d $ipv6libdir -a -f $ipv6libdir/lib$ipv6lib.a; then
277 LIBS="-L$ipv6libdir -l$ipv6lib $LIBS"
278 echo "You have $ipv6lib library, using it"
280 if test "$ipv6trylibc" = "yes"; then
281 echo "You do not have $ipv6lib library, using libc"
283 echo 'Fatal: no $ipv6lib library found. cannot continue.'
284 echo "You need to fetch lib$ipv6lib.a from appropriate"
285 echo 'ipv6 kit and compile beforehand.'
292 if test "$ipv6" = "yes"; then
294 # XXX - on Tru64 UNIX 5.1, there is no "getaddrinfo()"
295 # function in libc; there are "ngetaddrinfo()" and
296 # "ogetaddrinfo()" functions, and <netdb.h> #defines
297 # "getaddrinfo" to be either "ngetaddrinfo" or
298 # "ogetaddrinfo", depending on whether _SOCKADDR_LEN
299 # or _XOPEN_SOURCE_EXTENDED are defined or not.
301 # So this test doesn't work on Tru64 5.1, and possibly
302 # on other 5.x releases. This causes the configure
303 # script to become confused, and results in libpcap
306 AC_SEARCH_LIBS(getaddrinfo, socket, [dnl
307 AC_MSG_CHECKING(getaddrinfo bug)
308 AC_CACHE_VAL(td_cv_buggygetaddrinfo, [AC_TRY_RUN([
309 #include <sys/types.h>
312 #include <sys/socket.h>
313 #include <netinet/in.h>
317 int passive, gaierr, inet4 = 0, inet6 = 0;
318 struct addrinfo hints, *ai, *aitop;
319 char straddr[INET6_ADDRSTRLEN], strport[16];
321 for (passive = 0; passive <= 1; passive++) {
322 memset(&hints, 0, sizeof(hints));
323 hints.ai_family = AF_UNSPEC;
324 hints.ai_flags = passive ? AI_PASSIVE : 0;
325 hints.ai_socktype = SOCK_STREAM;
326 hints.ai_protocol = IPPROTO_TCP;
327 if ((gaierr = getaddrinfo(NULL, "54321", &hints, &aitop)) != 0) {
328 (void)gai_strerror(gaierr);
331 for (ai = aitop; ai; ai = ai->ai_next) {
332 if (ai->ai_addr == NULL ||
333 ai->ai_addrlen == 0 ||
334 getnameinfo(ai->ai_addr, ai->ai_addrlen,
335 straddr, sizeof(straddr), strport, sizeof(strport),
336 NI_NUMERICHOST|NI_NUMERICSERV) != 0) {
339 switch (ai->ai_family) {
341 if (strcmp(strport, "54321") != 0) {
345 if (strcmp(straddr, "0.0.0.0") != 0) {
349 if (strcmp(straddr, "127.0.0.1") != 0) {
356 if (strcmp(strport, "54321") != 0) {
360 if (strcmp(straddr, "::") != 0) {
364 if (strcmp(straddr, "::1") != 0) {
381 /* another family support? */
387 /* supported family should be 2, unsupported family should be 0 */
388 if (!(inet4 == 0 || inet4 == 2))
390 if (!(inet6 == 0 || inet6 == 2))
403 td_cv_buggygetaddrinfo=no,
404 td_cv_buggygetaddrinfo=yes,
405 td_cv_buggygetaddrinfo=yes)])
406 if test "$td_cv_buggygetaddrinfo" = no; then
412 if test "$td_cv_buggygetaddrinfo" = "yes"; then
414 # XXX - it doesn't appear that "ipv6type" can ever be
415 # set to "linux". Should this be testing for
416 # "linux-glibc", or for that *or* "linux-libinet6"?
417 # If the latter, note that "linux-libinet6" is also
418 # the type given to some non-Linux OSes.
420 if test "$ipv6type" != "linux"; then
421 echo 'Fatal: You must get working getaddrinfo() function.'
422 echo ' or you can specify "--disable-ipv6"'.
425 echo 'Warning: getaddrinfo() implementation on your system seems be buggy.'
426 echo ' Better upgrade your system library to newest version'
427 echo ' of GNU C library (aka glibc).'
431 AC_REPLACE_FUNCS(getaddrinfo getnameinfo)
434 AC_CACHE_CHECK([for dnet_htoa declaration in netdnet/dnetdb.h],
435 [td_cv_decl_netdnet_dnetdb_h_dnet_htoa],
436 [AC_EGREP_HEADER(dnet_htoa, netdnet/dnetdb.h,
437 td_cv_decl_netdnet_dnetdb_h_dnet_htoa=yes,
438 td_cv_decl_netdnet_dnetdb_h_dnet_htoa=no)])
439 if test "$td_cv_decl_netdnet_dnetdb_h_dnet_htoa" = yes; then
440 AC_DEFINE(HAVE_NETDNET_DNETDB_H_DNET_HTOA)
444 dnl check sizeof basic types.
445 dnl They're very likely to be wrong for cross-compiling.
446 AC_CHECK_SIZEOF(char, 1)
447 AC_CHECK_SIZEOF(short, 2)
448 AC_CHECK_SIZEOF(int, 4)
449 AC_CHECK_SIZEOF(long, 4)
450 AC_CHECK_SIZEOF(long long, 8)
453 dnl Checks for u_intXX_t
454 dnl AC_CHECK_BITTYPES(ac_cv_bittypes)
455 dnl if test "$ac_cv_bittypes" = no; then
456 dnl missing_includes=yes
460 dnl Checks for addrinfo structure
461 AC_STRUCT_ADDRINFO(ac_cv_addrinfo)
462 if test "$ac_cv_addrinfo" = no; then
467 dnl Checks for NI_MAXSERV
468 AC_NI_MAXSERV(ac_cv_maxserv)
469 if test "$ac_cv_maxserv" = no; then
474 dnl Checks for NI_NAMEREQD
475 AC_NI_NAMEREQD(ac_cv_namereqd)
476 if test "$ac_cv_namereqd" = no; then
481 dnl Checks for sockaddr_storage structure
482 AC_STRUCT_SA_STORAGE(ac_cv_sa_storage)
483 if test "$ac_cv_sa_storage" = no; then
488 dnl Checks for IN[6]ADDRSZ
489 AC_CHECK_ADDRSZ(ac_cv_addrsz)
490 if test "$ac_cv_addrsz" = no; then
495 dnl Checks for RES_USE_INET6
496 AC_CHECK_RES_USE_INET6(ac_cv_res_inet6)
497 if test "$ac_cv_res_inet6" = no; then
502 dnl Checks for res_state_ext structure
503 AC_STRUCT_RES_STATE_EXT(ac_cv_res_state_ext)
504 if test "$ac_cv_res_state_ext" = no; then
509 dnl Checks if res_state structure has nsort member.
510 AC_STRUCT_RES_STATE(ac_cv_res_state)
513 AC_REPLACE_FUNCS(vfprintf strcasecmp strlcat strlcpy strdup strsep)
514 AC_CHECK_FUNCS(strftime)
515 AC_CHECK_FUNCS(setlinebuf alarm)
518 AC_CHECK_FUNCS(vsnprintf snprintf,,
520 if test $needsnprintf = yes; then
526 AC_SEARCH_LIBS(dnet_htoa, dnet, AC_DEFINE(HAVE_DNET_HTOA))
528 AC_CHECK_LIB(rpc, main) dnl It's unclear why we might need -lrpc
530 dnl Some platforms may need -lnsl for getrpcbynumber.
531 AC_SEARCH_LIBS(getrpcbynumber, nsl, AC_DEFINE(HAVE_GETRPCBYNUMBER))
533 dnl AC_CHECK_LIB(z, uncompress)
534 dnl AC_CHECK_HEADERS(zlib.h)
536 AC_LBL_LIBPCAP(V_PCAPDEP, V_INCLS)
539 # Check for these after AC_LBL_LIBPCAP, so we link with the appropriate
540 # libraries (e.g., "-lsocket -lnsl" on Solaris).
542 # We don't use AC_REPLACE_FUNCS because that uses AC_CHECK_FUNCS which
543 # use AC_CHECK_FUNC which doesn't let us specify the right #includes
544 # to make this work on BSD/OS 4.x. BSD/OS 4.x ships with the BIND8
545 # resolver, and the way it defines inet_{ntop,pton} is rather strange;
546 # it does not ship with a libc symbol "inet_ntop()", it ships with
547 # "_inet_ntop()", and has a #define macro in one of the system headers
550 dnl AC_TRY_COMPILE(inet_ntop inet_pton inet_aton)
551 AC_MSG_CHECKING(for inet_ntop)
552 AC_TRY_LINK([#include <sys/types.h>
553 #include <sys/socket.h>
554 #include <netinet/in.h>
555 #include <arpa/inet.h>], [char src[4], dst[128];
556 inet_ntop(AF_INET, src, dst, sizeof(dst));],
557 [AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no)
558 AC_LIBOBJ(inet_ntop)])
559 AC_MSG_CHECKING(for inet_pton)
560 AC_TRY_LINK([#include <sys/types.h>
561 #include <sys/socket.h>
562 #include <netinet/in.h>
563 #include <arpa/inet.h>], [char src[128], dst[4];
564 inet_pton(AF_INET, src, dst);],
565 [AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no)
566 AC_LIBOBJ(inet_pton)])
567 AC_MSG_CHECKING(for inet_aton)
568 AC_TRY_LINK([#include <sys/types.h>
569 #include <netinet/in.h>
570 #include <arpa/inet.h>], [char src[128];
572 inet_aton(src, &dst);],
573 [AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no)
574 AC_LIBOBJ(inet_aton)])
577 # Check for these after AC_LBL_LIBPCAP, for the same reason.
579 # You are in a twisty little maze of UN*Xes, all different.
580 # Some might not have ether_ntohost().
581 # Some might have it, but not declare it in any header file.
582 # Some might have it, but declare it in <netinet/if_ether.h>.
583 # Some might have it, but declare it in <netinet/ether.h>
584 # (And some might have it but document it as something declared in
585 # <netinet/ethernet.h>, although <netinet/if_ether.h> appears to work.)
587 # Before you is a C compiler.
589 AC_CHECK_FUNCS(ether_ntohost, [
590 AC_CACHE_CHECK(for buggy ether_ntohost, ac_cv_buggy_ether_ntohost, [
593 #include <sys/types.h>
594 #include <sys/param.h>
595 #include <sys/socket.h>
598 main(int argc, char **argv)
600 u_char ea[6] = { 0xff, 0xff, 0xff, 0xff, 0xff };
601 char name[MAXHOSTNAMELEN];
603 ether_ntohost(name, (struct ether_addr *)ea);
606 ], [ac_cv_buggy_ether_ntohost=no],
607 [ac_cv_buggy_ether_ntohost=yes],
608 [ac_cv_buggy_ether_ntohost="not while cross-compiling"])])
609 if test "$ac_cv_buggy_ether_ntohost" = "no"; then
610 AC_DEFINE(USE_ETHER_NTOHOST)
613 if test "$ac_cv_func_ether_ntohost" = yes -a \
614 "$ac_cv_buggy_ether_ntohost" = "no"; then
616 # OK, we have ether_ntohost(). Do we have <netinet/if_ether.h>?
618 if test "$ac_cv_header_netinet_if_ether_h" = yes; then
620 # Yes. Does it declare ether_ntohost()?
622 AC_CHECK_DECLS(ether_ntohost,
624 AC_DEFINE(NETINET_IF_ETHER_H_DECLARES_ETHER_NTOHOST,,
625 [Define to 1 if netinet/if_ether.h declares `ether_ntohost'])
628 #include <sys/types.h>
629 #include <sys/socket.h>
630 #include <netinet/in.h>
634 #include <netinet/if_ether.h>
640 if test "$ac_cv_have_decl_ether_ntohost" != yes; then
642 # No, how about <netinet/ether.h>, as on Linux?
644 AC_CHECK_HEADERS(netinet/ether.h)
645 if test "$ac_cv_header_netinet_ether_h" = yes; then
647 # We have it - does it declare ether_ntohost()?
648 # Unset ac_cv_have_decl_ether_ntohost so we don't
649 # treat the previous failure as a cached value and
650 # suppress the next test.
652 unset ac_cv_have_decl_ether_ntohost
653 AC_CHECK_DECLS(ether_ntohost,
655 AC_DEFINE(NETINET_ETHER_H_DECLARES_ETHER_NTOHOST,,
656 [Define to 1 if netinet/ether.h declares `ether_ntohost'])
659 #include <netinet/ether.h>
665 dnl portability macros for getaddrinfo/getnameinfo
668 AC_CHECK_SA_LEN(ac_cv_sockaddr_has_sa_len)
669 if test "$ac_cv_sockaddr_has_sa_len" = no; then
673 AC_CHECK_FUNCS(pcap_findalldevs pcap_dump_flush pcap_lib_version)
674 if test $ac_cv_func_pcap_findalldevs = "yes" ; then
675 dnl Check for Mac OS X, which may ship pcap.h from 0.6 but libpcap may
676 dnl be 0.8; this means that lib has pcap_findalldevs but header doesn't
678 savedcflags="$CFLAGS"
679 CFLAGS="$CFLAGS $V_INCLS"
680 AC_CHECK_TYPES(pcap_if_t, , , [#include <pcap.h>])
681 CFLAGS="$savedcflags"
684 if test $ac_cv_func_pcap_lib_version = "no" ; then
685 AC_MSG_CHECKING(whether pcap_version is defined by libpcap)
688 extern char pcap_version[];
690 return (int)pcap_version;
692 ac_lbl_cv_pcap_version_defined=yes,
693 ac_lbl_cv_pcap_version_defined=no)
694 if test "$ac_lbl_cv_pcap_version_defined" = yes ; then
696 AC_DEFINE(HAVE_PCAP_VERSION)
701 AC_MSG_CHECKING(whether pcap_debug is defined by libpcap)
704 extern int pcap_debug;
708 ac_lbl_cv_pcap_debug_defined=yes,
709 ac_lbl_cv_pcap_debug_defined=no)
710 if test "$ac_lbl_cv_pcap_debug_defined" = yes ; then
712 AC_DEFINE(HAVE_PCAP_DEBUG)
716 # OK, what about "yydebug"?
718 AC_MSG_CHECKING(whether yydebug is defined by libpcap)
725 ac_lbl_cv_yydebug_defined=yes,
726 ac_lbl_cv_yydebug_defined=no)
727 if test "$ac_lbl_cv_yydebug_defined" = yes ; then
729 AC_DEFINE(HAVE_YYDEBUG)
734 AC_REPLACE_FUNCS(bpf_dump) dnl moved to libpcap in 0.6
737 if test -f /etc/group -a ! -z "`grep '^wheel:' /etc/group`" ; then
743 dnl Workaround to enable certain features
760 if test -f /dev/bpf0 ; then
764 AC_LBL_CHECK_TYPE(int8_t, signed char)
765 AC_LBL_CHECK_TYPE(u_int8_t, u_char)
766 AC_LBL_CHECK_TYPE(int16_t, short)
767 AC_LBL_CHECK_TYPE(u_int16_t, u_short)
768 AC_LBL_CHECK_TYPE(int32_t, int)
769 AC_LBL_CHECK_TYPE(u_int32_t, u_int)
770 AC_LBL_CHECK_TYPE(int64_t, long long)
771 AC_LBL_CHECK_TYPE(u_int64_t, unsigned long long)
774 # We can't just check for <inttypes.h> - some systems have one that
775 # doesn't define all the PRI[doxu]64 macros.
777 AC_CHECK_HEADERS(inttypes.h,
780 # OK, we have inttypes.h, but does it define those macros?
782 AC_MSG_CHECKING([[whether inttypes.h defines the PRI[doxu]64 macros]])
787 #include <inttypes.h>
789 #include <sys/types.h>
793 printf("%" PRId64 "\n", (u_int64_t)1);
794 printf("%" PRIo64 "\n", (u_int64_t)1);
795 printf("%" PRIx64 "\n", (u_int64_t)1);
796 printf("%" PRIu64 "\n", (u_int64_t)1);
802 ac_lbl_inttypes_h_defines_formats=yes
806 ac_lbl_inttypes_h_defines_formats=no
811 # We don't have inttypes.h, so it obviously can't define those
814 ac_lbl_inttypes_h_defines_formats=no
816 if test "$ac_lbl_inttypes_h_defines_formats" = yes; then
817 AC_DEFINE(INTTYPES_H_DEFINES_FORMATS)
819 AC_LBL_CHECK_64BIT_FORMAT(ll,
821 AC_LBL_CHECK_64BIT_FORMAT(L,
823 AC_LBL_CHECK_64BIT_FORMAT(q,
825 AC_MSG_ERROR([neither %llx nor %Lx nor %qx worked on a 64-bit integer])
831 AC_LBL_DEVEL(V_CCOPT)
833 AC_LBL_SOCKADDR_SA_LEN
835 AC_LBL_UNALIGNED_ACCESS
839 AC_ARG_WITH(crypto, [ --without-crypto disable crypto support],
841 AC_MSG_CHECKING(for SSLeay)
845 Xprefix=`eval echo $prefix`
847 for dir in $Xprefix /usr/${host_alias} /usr /usr/local /usr/local/ssl /usr/pkg; do
849 # XXX - is there a better way to check if a given library is
850 # in a given directory than checking each of the possible
851 # shared library suffixes?
853 # Are there any other suffixes we need to look for? Do we have to
854 # worry about ".so.{version}"?
856 # Or should we just look for "libcrypto.*"?
858 if test -d $dir/lib -a \( -f $dir/lib/libcrypto.a -o \
859 -f $dir/lib/libcrypto.so -o \
860 -f $dir/lib/libcrypto.sl -o \
861 -f $dir/lib/libcrypto.dylib \); then
862 ac_cv_ssleay_path=$dir
864 if test -d $dir/include/openssl -a -f $dir/include/openssl/des.h; then
865 incdir="-I$dir/include"
867 if test "$ac_cv_ssleay_path" != "no" -a "$incdir" != "no"; then
874 AC_MSG_RESULT($ac_cv_ssleay_path)
875 if test "$ac_cv_ssleay_path" != no; then
876 V_INCLS="$V_INCLS $incdir"
877 LDFLAGS="-L$dir/lib $LDFLAGS"
878 if test -f $ac_cv_ssleay_path/lib/libRSAglue.a; then
879 LIBS="$LIBS -lRSAglue"
881 if test -f $ac_cv_ssleay_path/lib/librsaref.a; then
882 LIBS="$LIBS -lrsaref"
884 AC_CHECK_LIB(crypto, DES_cbc_encrypt)
886 CPPFLAGS="$CPPFLAGS $V_INCLS"
887 AC_CHECK_HEADERS(openssl/evp.h)
892 dnl set additional include path if necessary
893 if test "$missing_includes" = "yes"; then
894 CPPFLAGS="$CPPFLAGS -I\$(srcdir)/missing"
895 V_INCLS="$V_INCLS -I\$(srcdir)/missing"
907 AC_CONFIG_HEADER(config.h)
909 AC_OUTPUT_COMMANDS([if test -f .devel; then
910 echo timestamp > stamp-h
911 cat Makefile-devel-adds >> Makefile