1 dnl @(#) $Header: /tcpdump/master/tcpdump/configure.in,v 1.186 2005-03-27 22:46:21 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.186 $)
15 AC_LBL_C_INIT(V_CCOPT, V_INCLS)
18 AC_CHECK_HEADERS(fcntl.h rpc/rpcent.h netdnet/dnetdb.h netinet/ether.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)
517 # You are in a twisty little maze of UN*Xes, all different.
518 # Some might not have ether_ntohost().
519 # Some might have it, but not declare it in any header file.
520 # Some might have it, but declare it in <netinet/if_ether.h>.
521 # Some might have it, but declare it in <netinet/ether.h>
522 # (And some might have it but document it as something declared in
523 # <netinet/ethernet.h>, although <netinet/if_ether.h> appears to work.)
525 # Before you is a C compiler.
527 AC_CHECK_FUNCS(ether_ntohost, [
528 AC_CACHE_CHECK(for buggy ether_ntohost, ac_cv_buggy_ether_ntohost, [
531 #include <sys/types.h>
532 #include <sys/param.h>
533 #include <sys/socket.h>
536 main(int argc, char **argv)
538 u_char ea[6] = { 0xff, 0xff, 0xff, 0xff, 0xff };
539 char name[MAXHOSTNAMELEN];
541 ether_ntohost(name, (struct ether_addr *)ea);
544 ], [ac_cv_buggy_ether_ntohost=no],
545 [ac_cv_buggy_ether_ntohost=yes],
546 [ac_cv_buggy_ether_ntohost="not while cross-compiling"])])
547 if test "$ac_cv_buggy_ether_ntohost" = "no"; then
548 AC_DEFINE(USE_ETHER_NTOHOST)
551 if test "$ac_cv_func_ether_ntohost" = yes -a \
552 "$ac_cv_buggy_ether_ntohost" = "no"; then
554 # OK, we have ether_ntohost(). Do we have <netinet/if_ether.h>?
556 if test "$ac_cv_header_netinet_if_ether_h" = yes; then
558 # Yes. Does it declare ether_ntohost()?
560 AC_CHECK_DECLS(ether_ntohost,
562 AC_DEFINE(NETINET_IF_ETHER_H_DECLARES_ETHER_NTOHOST,,
563 [Define to 1 if netinet/if_ether.h declares `ether_ntohost'])
566 #include <sys/types.h>
567 #include <sys/socket.h>
568 #include <netinet/in.h>
572 #include <netinet/if_ether.h>
578 if test "$ac_cv_have_decl_ether_ntohost" != yes; then
580 # No, how about <netinet/ether.h>, as on Linux?
582 AC_CHECK_HEADERS(netinet/ether.h)
583 if test "$ac_cv_header_netinet_ether_h" = yes; then
585 # We have it - does it declare ether_ntohost()?
586 # Unset ac_cv_have_decl_ether_ntohost so we don't
587 # treat the previous failure as a cached value and
588 # suppress the next test.
590 unset ac_cv_have_decl_ether_ntohost
591 AC_CHECK_DECLS(ether_ntohost,
593 AC_DEFINE(NETINET_ETHER_H_DECLARES_ETHER_NTOHOST,,
594 [Define to 1 if netinet/ether.h declares `ether_ntohost'])
597 #include <netinet/ether.h>
603 AC_CHECK_FUNCS(setlinebuf alarm)
606 AC_CHECK_FUNCS(vsnprintf snprintf,,
608 if test $needsnprintf = yes; then
614 AC_SEARCH_LIBS(dnet_htoa, dnet, AC_DEFINE(HAVE_DNET_HTOA))
616 AC_CHECK_LIB(rpc, main) dnl It's unclear why we might need -lrpc
618 dnl Some platforms may need -lnsl for getrpcbynumber.
619 AC_SEARCH_LIBS(getrpcbynumber, nsl, AC_DEFINE(HAVE_GETRPCBYNUMBER))
621 dnl AC_CHECK_LIB(z, uncompress)
622 dnl AC_CHECK_HEADERS(zlib.h)
624 AC_LBL_LIBPCAP(V_PCAPDEP, V_INCLS)
627 # Check for these after AC_LBL_LIBPCAP, so we link with the appropriate
628 # libraries (e.g., "-lsocket -lnsl" on Solaris).
630 # We don't use AC_REPLACE_FUNCS because that uses AC_CHECK_FUNCS which
631 # use AC_CHECK_FUNC which doesn't let us specify the right #includes
632 # to make this work on BSD/OS 4.x. BSD/OS 4.x ships with the BIND8
633 # resolver, and the way it defines inet_{ntop,pton} is rather strange;
634 # it does not ship with a libc symbol "inet_ntop()", it ships with
635 # "_inet_ntop()", and has a #define macro in one of the system headers
638 dnl AC_TRY_COMPILE(inet_ntop inet_pton inet_aton)
639 AC_MSG_CHECKING(for inet_ntop)
640 AC_TRY_LINK([#include <sys/types.h>
641 #include <sys/socket.h>
642 #include <netinet/in.h>
643 #include <arpa/inet.h>], [char src[4], dst[128];
644 inet_ntop(AF_INET, src, dst, sizeof(dst));],
645 [AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no)
646 AC_LIBOBJ(inet_ntop)])
647 AC_MSG_CHECKING(for inet_pton)
648 AC_TRY_LINK([#include <sys/types.h>
649 #include <sys/socket.h>
650 #include <netinet/in.h>
651 #include <arpa/inet.h>], [char src[128], dst[4];
652 inet_pton(AF_INET, src, dst);],
653 [AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no)
654 AC_LIBOBJ(inet_pton)])
655 AC_MSG_CHECKING(for inet_aton)
656 AC_TRY_LINK([#include <sys/types.h>
657 #include <netinet/in.h>
658 #include <arpa/inet.h>], [char src[128];
660 inet_aton(src, &dst);],
661 [AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no)
662 AC_LIBOBJ(inet_aton)])
664 dnl portability macros for getaddrinfo/getnameinfo
667 AC_CHECK_SA_LEN(ac_cv_sockaddr_has_sa_len)
668 if test "$ac_cv_sockaddr_has_sa_len" = no; then
672 AC_CHECK_FUNCS(pcap_findalldevs pcap_dump_flush pcap_lib_version)
673 if test $ac_cv_func_pcap_findalldevs = "yes" ; then
674 dnl Check for Mac OS X, which may ship pcap.h from 0.6 but libpcap may
675 dnl be 0.8; this means that lib has pcap_findalldevs but header doesn't
677 savedcflags="$CFLAGS"
678 CFLAGS="$CFLAGS $V_INCLS"
679 AC_CHECK_TYPES(pcap_if_t, , , [#include <pcap.h>])
680 CFLAGS="$savedcflags"
683 if test $ac_cv_func_pcap_lib_version = "no" ; then
684 AC_MSG_CHECKING(whether pcap_version is defined by libpcap)
687 extern char pcap_version[];
689 return (int)pcap_version;
691 ac_lbl_cv_pcap_version_defined=yes,
692 ac_lbl_cv_pcap_version_defined=no)
693 if test "$ac_lbl_cv_pcap_version_defined" = yes ; then
695 AC_DEFINE(HAVE_PCAP_VERSION)
700 AC_MSG_CHECKING(whether pcap_debug is defined by libpcap)
703 extern int pcap_debug;
707 ac_lbl_cv_pcap_debug_defined=yes,
708 ac_lbl_cv_pcap_debug_defined=no)
709 if test "$ac_lbl_cv_pcap_debug_defined" = yes ; then
711 AC_DEFINE(HAVE_PCAP_DEBUG)
715 # OK, what about "yydebug"?
717 AC_MSG_CHECKING(whether yydebug is defined by libpcap)
724 ac_lbl_cv_yydebug_defined=yes,
725 ac_lbl_cv_yydebug_defined=no)
726 if test "$ac_lbl_cv_yydebug_defined" = yes ; then
728 AC_DEFINE(HAVE_YYDEBUG)
733 AC_REPLACE_FUNCS(bpf_dump) dnl moved to libpcap in 0.6
736 if test -f /etc/group -a ! -z "`grep '^wheel:' /etc/group`" ; then
742 dnl Workaround to enable certain features
759 if test -f /dev/bpf0 ; then
763 AC_LBL_CHECK_TYPE(int8_t, signed char)
764 AC_LBL_CHECK_TYPE(u_int8_t, u_char)
765 AC_LBL_CHECK_TYPE(int16_t, short)
766 AC_LBL_CHECK_TYPE(u_int16_t, u_short)
767 AC_LBL_CHECK_TYPE(int32_t, int)
768 AC_LBL_CHECK_TYPE(u_int32_t, u_int)
769 AC_LBL_CHECK_TYPE(int64_t, long long)
770 AC_LBL_CHECK_TYPE(u_int64_t, unsigned long long)
773 # We can't just check for <inttypes.h> - some systems have one that
774 # doesn't define all the PRI[doxu]64 macros.
776 AC_CHECK_HEADERS(inttypes.h,
779 # OK, we have inttypes.h, but does it define those macros?
781 AC_MSG_CHECKING([[whether inttypes.h defines the PRI[doxu]64 macros]])
786 #include <inttypes.h>
788 #include <sys/types.h>
792 printf("%" PRId64 "\n", (u_int64_t)1);
793 printf("%" PRIo64 "\n", (u_int64_t)1);
794 printf("%" PRIx64 "\n", (u_int64_t)1);
795 printf("%" PRIu64 "\n", (u_int64_t)1);
801 ac_lbl_inttypes_h_defines_formats=yes
805 ac_lbl_inttypes_h_defines_formats=no
810 # We don't have inttypes.h, so it obviously can't define those
813 ac_lbl_inttypes_h_defines_formats=no
815 if test "$ac_lbl_inttypes_h_defines_formats" = yes; then
816 AC_DEFINE(INTTYPES_H_DEFINES_FORMATS)
818 AC_LBL_CHECK_64BIT_FORMAT(ll,
820 AC_LBL_CHECK_64BIT_FORMAT(L,
822 AC_LBL_CHECK_64BIT_FORMAT(q,
824 AC_MSG_ERROR([neither %llx nor %Lx nor %qx worked on a 64-bit integer])
830 AC_LBL_DEVEL(V_CCOPT)
832 AC_LBL_SOCKADDR_SA_LEN
834 AC_LBL_UNALIGNED_ACCESS
838 AC_ARG_WITH(crypto, [ --without-crypto disable crypto support],
840 AC_MSG_CHECKING(for SSLeay)
844 Xprefix=`eval echo $prefix`
846 for dir in $Xprefix /usr/${host_alias} /usr /usr/local /usr/local/ssl /usr/pkg; do
848 # XXX - is there a better way to check if a given library is
849 # in a given directory than checking each of the possible
850 # shared library suffixes?
852 # Are there any other suffixes we need to look for? Do we have to
853 # worry about ".so.{version}"?
855 # Or should we just look for "libcrypto.*"?
857 if test -d $dir/lib -a \( -f $dir/lib/libcrypto.a -o \
858 -f $dir/lib/libcrypto.so -o \
859 -f $dir/lib/libcrypto.sl -o \
860 -f $dir/lib/libcrypto.dylib \); then
861 ac_cv_ssleay_path=$dir
863 if test -d $dir/include/openssl -a -f $dir/include/openssl/des.h; then
864 incdir="-I$dir/include"
866 if test "$ac_cv_ssleay_path" != "no" -a "$incdir" != "no"; then
873 AC_MSG_RESULT($ac_cv_ssleay_path)
874 if test "$ac_cv_ssleay_path" != no; then
875 V_INCLS="$V_INCLS $incdir"
876 LDFLAGS="-L$dir/lib $LDFLAGS"
877 if test -f $ac_cv_ssleay_path/lib/libRSAglue.a; then
878 LIBS="$LIBS -lRSAglue"
880 if test -f $ac_cv_ssleay_path/lib/librsaref.a; then
881 LIBS="$LIBS -lrsaref"
883 AC_CHECK_LIB(crypto, DES_cbc_encrypt)
885 CPPFLAGS="$CPPFLAGS $V_INCLS"
886 AC_CHECK_HEADERS(openssl/evp.h)
891 dnl set additional include path if necessary
892 if test "$missing_includes" = "yes"; then
893 CPPFLAGS="$CPPFLAGS -I\$(srcdir)/missing"
894 V_INCLS="$V_INCLS -I\$(srcdir)/missing"
906 AC_CONFIG_HEADER(config.h)
908 AC_OUTPUT_COMMANDS([if test -f .devel; then
909 echo timestamp > stamp-h
910 cat Makefile-devel-adds >> Makefile