~ubuntu-branches/ubuntu/intrepid/tcpdump/intrepid

« back to all changes in this revision

Viewing changes to configure.in

  • Committer: Bazaar Package Importer
  • Author(s): Romain Francoise
  • Date: 2005-12-10 14:26:20 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20051210142620-t4ju0367w6j2x06i
Tags: 3.9.4-2
debian/patches/20_man_fixes.dpatch: Merge patch from A Costa
<agcosta@gis.net> fixing a few typos (closes: #342310).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
dnl @(#) $Header: /tcpdump/master/tcpdump/configure.in,v 1.169.2.3 2004/03/28 21:04:48 fenner Exp $ (LBL)
 
1
dnl @(#) $Header: /tcpdump/master/tcpdump/configure.in,v 1.188.2.7 2005/09/21 16:50:01 guy Exp $ (LBL)
2
2
dnl
3
3
dnl Copyright (c) 1994, 1995, 1996, 1997
4
4
dnl     The Regents of the University of California.  All rights reserved.
6
6
dnl Process this file with autoconf to produce a configure script.
7
7
dnl
8
8
 
9
 
AC_REVISION($Revision: 1.169.2.3 $)
 
9
AC_REVISION($Revision: 1.188.2.7 $)
10
10
AC_PREREQ(2.50)
11
11
AC_INIT(tcpdump.c)
12
12
 
15
15
AC_LBL_C_INIT(V_CCOPT, V_INCLS)
16
16
AC_LBL_C_INLINE
17
17
AC_C___ATTRIBUTE__
18
 
 
19
 
AC_CHECK_HEADERS(fcntl.h rpc/rpcent.h netdnet/dnetdb.h netinet/ether.h)
 
18
AC_CHECK_HEADERS(fcntl.h rpc/rpcent.h netdnet/dnetdb.h)
20
19
AC_CHECK_HEADERS(netinet/if_ether.h, , , [#include <sys/types.h>
21
20
#include <sys/socket.h>])
 
21
if test "$ac_cv_header_netinet_if_ether_h" != yes; then
 
22
        #
 
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.
 
28
        #
 
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>
 
34
struct mbuf;
 
35
struct rtentry;
 
36
#include <net/if.h>])
 
37
fi
 
38
 
22
39
AC_HEADER_TIME
23
40
 
24
41
case "$host_os" in
104
121
        ;;
105
122
esac
106
123
 
 
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\")
 
129
else
 
130
       AC_MSG_RESULT(no)
 
131
fi
 
132
 
 
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\")
 
138
else
 
139
       AC_MSG_RESULT(no)
 
140
fi
 
141
 
107
142
AC_MSG_CHECKING([whether to enable ipv6])
108
143
AC_ARG_ENABLE(ipv6,
109
144
[  --enable-ipv6           enable ipv6 (with ipv4) support
412
447
AC_CHECK_SIZEOF(short, 2)
413
448
AC_CHECK_SIZEOF(int, 4)
414
449
AC_CHECK_SIZEOF(long, 4)
 
450
AC_CHECK_SIZEOF(long long, 8)
415
451
 
416
452
dnl
417
453
dnl Checks for u_intXX_t
473
509
dnl Checks if res_state structure has nsort member.
474
510
AC_STRUCT_RES_STATE(ac_cv_res_state)
475
511
 
476
 
dnl
477
 
dnl set additional include path if necessary
478
 
if test "$missing_includes" = "yes"; then
479
 
        CPPFLAGS="$CPPFLAGS -I\$(srcdir)/missing"
480
 
        V_INCLS="$V_INCLS -I\$(srcdir)/missing"
481
 
fi
482
 
 
483
512
 
484
513
AC_REPLACE_FUNCS(vfprintf strcasecmp strlcat strlcpy strdup strsep)
485
514
AC_CHECK_FUNCS(strftime)
486
 
AC_CHECK_FUNCS(ether_ntohost, [
487
 
    AC_CACHE_CHECK(for buggy ether_ntohost, ac_cv_buggy_ether_ntohost, [
488
 
        AC_TRY_RUN([
489
 
                #include <netdb.h>
490
 
                #include <sys/types.h>
491
 
                #include <sys/param.h>
492
 
                #include <sys/socket.h>
493
 
 
494
 
                int
495
 
                main(int argc, char **argv)
496
 
                {
497
 
                        u_char ea[6] = { 0xff, 0xff, 0xff, 0xff, 0xff };
498
 
                        char name[MAXHOSTNAMELEN];
499
 
 
500
 
                        ether_ntohost(name, (struct ether_addr *)ea);
501
 
                        exit(0);
502
 
                }
503
 
        ], [ac_cv_buggy_ether_ntohost=no],
504
 
           [ac_cv_buggy_ether_ntohost=yes],
505
 
           [ac_cv_buggy_ether_ntohost="not while cross-compiling"])])
506
 
    if test "$ac_cv_buggy_ether_ntohost" = "no"; then
507
 
        AC_DEFINE(USE_ETHER_NTOHOST)
508
 
    fi
509
 
])
510
 
AC_CHECK_FUNCS(setlinebuf)
 
515
AC_CHECK_FUNCS(setlinebuf alarm)
511
516
 
512
517
needsnprintf=no
513
518
AC_CHECK_FUNCS(vsnprintf snprintf,,
514
519
        [needsnprintf=yes])
515
520
if test $needsnprintf = yes; then
516
 
        AC_LIBOBJ(snprintf.o)
 
521
        AC_LIBOBJ(snprintf)
517
522
fi
518
523
 
519
524
AC_LBL_TYPE_SIGNAL
522
527
 
523
528
AC_CHECK_LIB(rpc, main)         dnl It's unclear why we might need -lrpc
524
529
 
525
 
dnl HP/UX may need -lnsl for getrpcbynumber.
526
 
AC_SEARCH_LIBS(getrpcbynumber, nsl)
 
530
dnl Some platforms may need -lnsl for getrpcbynumber.
 
531
AC_SEARCH_LIBS(getrpcbynumber, nsl, AC_DEFINE(HAVE_GETRPCBYNUMBER))
527
532
 
528
533
dnl AC_CHECK_LIB(z, uncompress)
529
534
dnl AC_CHECK_HEADERS(zlib.h)
550
555
#include <arpa/inet.h>], [char src[4], dst[128];
551
556
inet_ntop(AF_INET, src, dst, sizeof(dst));],
552
557
        [AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no)
553
 
        AC_LIBOBJ(inet_ntop.o)])
 
558
        AC_LIBOBJ(inet_ntop)])
554
559
AC_MSG_CHECKING(for inet_pton)
555
560
AC_TRY_LINK([#include <sys/types.h>
556
561
#include <sys/socket.h>
558
563
#include <arpa/inet.h>], [char src[128], dst[4];
559
564
inet_pton(AF_INET, src, dst);],
560
565
        [AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no)
561
 
        AC_LIBOBJ(inet_pton.o)])
 
566
        AC_LIBOBJ(inet_pton)])
562
567
AC_MSG_CHECKING(for inet_aton)
563
568
AC_TRY_LINK([#include <sys/types.h>
564
569
#include <netinet/in.h>
566
571
struct in_addr dst;
567
572
inet_aton(src, &dst);],
568
573
        [AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no)
569
 
        AC_LIBOBJ(inet_aton.o)])
 
574
        AC_LIBOBJ(inet_aton)])
 
575
 
 
576
#
 
577
# Check for these after AC_LBL_LIBPCAP, for the same reason.
 
578
#
 
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.)
 
586
#
 
587
# Before you is a C compiler.
 
588
#
 
589
AC_CHECK_FUNCS(ether_ntohost, [
 
590
    AC_CACHE_CHECK(for buggy ether_ntohost, ac_cv_buggy_ether_ntohost, [
 
591
        AC_TRY_RUN([
 
592
                #include <netdb.h>
 
593
                #include <sys/types.h>
 
594
                #include <sys/param.h>
 
595
                #include <sys/socket.h>
 
596
 
 
597
                int
 
598
                main(int argc, char **argv)
 
599
                {
 
600
                        u_char ea[6] = { 0xff, 0xff, 0xff, 0xff, 0xff };
 
601
                        char name[MAXHOSTNAMELEN];
 
602
 
 
603
                        ether_ntohost(name, (struct ether_addr *)ea);
 
604
                        exit(0);
 
605
                }
 
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)
 
611
    fi
 
612
])
 
613
if test "$ac_cv_func_ether_ntohost" = yes -a \
 
614
    "$ac_cv_buggy_ether_ntohost" = "no"; then
 
615
        #
 
616
        # OK, we have ether_ntohost().  Do we have <netinet/if_ether.h>?
 
617
        #
 
618
        if test "$ac_cv_header_netinet_if_ether_h" = yes; then
 
619
                #
 
620
                # Yes.  Does it declare ether_ntohost()?
 
621
                #
 
622
                AC_CHECK_DECL(ether_ntohost,
 
623
                    [
 
624
                        AC_DEFINE(NETINET_IF_ETHER_H_DECLARES_ETHER_NTOHOST,,
 
625
                            [Define to 1 if netinet/if_ether.h declares `ether_ntohost'])
 
626
                    ],,
 
627
                    [
 
628
#include <sys/types.h>
 
629
#include <sys/socket.h>
 
630
#include <netinet/in.h>
 
631
#include <arpa/inet.h>
 
632
struct mbuf;
 
633
struct rtentry;
 
634
#include <net/if.h>
 
635
#include <netinet/if_ether.h>
 
636
                    ])
 
637
        fi
 
638
        #
 
639
        # Did that succeed?
 
640
        #
 
641
        if test "$ac_cv_have_decl_ether_ntohost" != yes; then
 
642
                #
 
643
                # No, how about <netinet/ether.h>, as on Linux?
 
644
                #
 
645
                AC_CHECK_HEADERS(netinet/ether.h)
 
646
                if test "$ac_cv_header_netinet_ether_h" = yes; then
 
647
                        #
 
648
                        # We have it - does it declare ether_ntohost()?
 
649
                        # Unset ac_cv_have_decl_ether_ntohost so we don't
 
650
                        # treat the previous failure as a cached value and
 
651
                        # suppress the next test.
 
652
                        #
 
653
                        unset ac_cv_have_decl_ether_ntohost
 
654
                        AC_CHECK_DECL(ether_ntohost,
 
655
                            [
 
656
                                AC_DEFINE(NETINET_ETHER_H_DECLARES_ETHER_NTOHOST,,
 
657
                                    [Define to 1 if netinet/ether.h declares `ether_ntohost'])
 
658
                            ],,
 
659
                            [
 
660
#include <netinet/ether.h>
 
661
                            ])
 
662
                fi
 
663
        fi
 
664
        #
 
665
        # Is ether_ntohost() declared?
 
666
        #
 
667
        if test "$ac_cv_have_decl_ether_ntohost" != yes; then
 
668
                #
 
669
                # No, we'll have to declare it ourselves.
 
670
                # Do we have "struct ether_addr"?
 
671
                #
 
672
                AC_CHECK_TYPES(struct ether_addr,,,
 
673
                    [
 
674
#include <sys/types.h>
 
675
#include <sys/socket.h>
 
676
#include <netinet/in.h>
 
677
#include <arpa/inet.h>
 
678
struct mbuf;
 
679
struct rtentry;
 
680
#include <net/if.h>
 
681
#include <netinet/if_ether.h>
 
682
                    ])
 
683
                AC_DEFINE(HAVE_DECL_ETHER_NTOHOST, 0,
 
684
                    [Define to 1 if you have the declaration of `ether_ntohost', and to 0 if you
 
685
don't.])
 
686
        else
 
687
                AC_DEFINE(HAVE_DECL_ETHER_NTOHOST, 1,
 
688
                    [Define to 1 if you have the declaration of `ether_ntohost', and to 0 if you
 
689
don't.])
 
690
        fi
 
691
fi
570
692
 
571
693
dnl portability macros for getaddrinfo/getnameinfo
572
694
dnl
578
700
 
579
701
AC_CHECK_FUNCS(pcap_findalldevs pcap_dump_flush pcap_lib_version)
580
702
if test $ac_cv_func_pcap_findalldevs = "yes" ; then
581
 
dnl Check for MacOS X, which may ship pcap.h from 0.6 but libpcap may
 
703
dnl Check for Mac OS X, which may ship pcap.h from 0.6 but libpcap may
582
704
dnl be 0.8; this means that lib has pcap_findalldevs but header doesn't
583
705
dnl have pcap_if_t.
 
706
    savedcflags="$CFLAGS"
 
707
    CFLAGS="$CFLAGS $V_INCLS"
584
708
    AC_CHECK_TYPES(pcap_if_t, , , [#include <pcap.h>])
 
709
    CFLAGS="$savedcflags"
585
710
fi
 
711
 
586
712
if test $ac_cv_func_pcap_lib_version = "no" ; then
587
713
    AC_MSG_CHECKING(whether pcap_version is defined by libpcap)
588
714
    AC_TRY_LINK([],
589
715
       [
590
 
char *
591
 
return_pcap_version(void)
592
 
{
593
716
        extern char pcap_version[];
594
717
 
595
 
        return pcap_version;
596
 
}
 
718
        return (int)pcap_version;
597
719
       ],
598
720
       ac_lbl_cv_pcap_version_defined=yes,
599
721
       ac_lbl_cv_pcap_version_defined=no)
607
729
AC_MSG_CHECKING(whether pcap_debug is defined by libpcap)
608
730
AC_TRY_LINK([],
609
731
   [
610
 
int
611
 
return_pcap_debug(void)
612
 
{
613
732
        extern int pcap_debug;
614
733
 
615
734
        return pcap_debug;
616
 
}
617
735
   ],
618
736
   ac_lbl_cv_pcap_debug_defined=yes,
619
737
   ac_lbl_cv_pcap_debug_defined=no)
628
746
        AC_MSG_CHECKING(whether yydebug is defined by libpcap)
629
747
        AC_TRY_LINK([],
630
748
           [
631
 
        int
632
 
        return_yydebug(void)
633
 
        {
634
749
                extern int yydebug;
635
750
 
636
751
                return yydebug;
637
 
        }
638
752
           ],
639
753
           ac_lbl_cv_yydebug_defined=yes,
640
754
           ac_lbl_cv_yydebug_defined=no)
675
789
        V_GROUP=bpf
676
790
fi
677
791
 
678
 
AC_LBL_CHECK_TYPE(int8_t, signed char)
679
 
AC_LBL_CHECK_TYPE(u_int8_t, u_char)
680
 
AC_LBL_CHECK_TYPE(int16_t, short)
681
 
AC_LBL_CHECK_TYPE(u_int16_t, u_short)
682
 
AC_LBL_CHECK_TYPE(int32_t, int)
683
 
AC_LBL_CHECK_TYPE(u_int32_t, u_int)
 
792
AC_CHECK_HEADERS(sys/bitypes.h)
 
793
 
 
794
AC_CHECK_TYPE([int8_t], ,
 
795
        [AC_DEFINE([int8_t], [signed char],
 
796
        [Define to `signed char' if int8_t not defined.])])
 
797
AC_CHECK_TYPE([u_int8_t], ,
 
798
        [AC_DEFINE([u_int8_t], [unsigned char],
 
799
        [Define to `unsigned char' if u_int8_t not defined.])],
 
800
        [AC_INCLUDES_DEFAULT
 
801
#ifdef HAVE_SYS_BITYPES_H
 
802
#include <sys/bitypes.h>
 
803
#endif])
 
804
AC_CHECK_TYPE([int16_t], ,
 
805
        [AC_DEFINE([int16_t], [short],
 
806
        [Define to `short' if int16_t not defined.])])
 
807
AC_CHECK_TYPE([u_int16_t], ,
 
808
        [AC_DEFINE([u_int16_t], [unsigned short],
 
809
        [Define to `unsigned short' if u_int16_t not defined.])],
 
810
        [AC_INCLUDES_DEFAULT
 
811
#ifdef HAVE_SYS_BITYPES_H
 
812
#include <sys/bitypes.h>
 
813
#endif])
 
814
AC_CHECK_TYPE([int32_t], ,
 
815
        [AC_DEFINE([int32_t], [int],
 
816
        [Define to `int' if int32_t not defined.])])
 
817
AC_CHECK_TYPE([u_int32_t], ,
 
818
        [AC_DEFINE([u_int32_t], [unsigned int],
 
819
        [Define to `unsigned int' if u_int32_t not defined.])],
 
820
        [AC_INCLUDES_DEFAULT
 
821
#ifdef HAVE_SYS_BITYPES_H
 
822
#include <sys/bitypes.h>
 
823
#endif])
 
824
AC_CHECK_TYPE([int64_t], ,
 
825
        [AC_DEFINE([int64_t], [long long],
 
826
        [Define to `long long' if int64_t not defined.])])
 
827
AC_CHECK_TYPE([u_int64_t], ,
 
828
        [AC_DEFINE([u_int64_t], [unsigned long long],
 
829
        [Define to `unsigned long long' if u_int64_t not defined.])],
 
830
        [AC_INCLUDES_DEFAULT
 
831
#ifdef HAVE_SYS_BITYPES_H
 
832
#include <sys/bitypes.h>
 
833
#endif])
 
834
 
 
835
#
 
836
# We can't just check for <inttypes.h> - some systems have one that
 
837
# doesn't define all the PRI[doxu]64 macros.
 
838
#
 
839
AC_CHECK_HEADERS(inttypes.h,
 
840
  [
 
841
    #
 
842
    # OK, we have inttypes.h, but does it define those macros?
 
843
    #
 
844
    AC_MSG_CHECKING([[whether inttypes.h defines the PRI[doxu]64 macros]])
 
845
    AC_COMPILE_IFELSE(
 
846
      [
 
847
        AC_LANG_SOURCE(
 
848
          [[
 
849
            #include <inttypes.h>
 
850
            #include <stdio.h>
 
851
            #include <sys/types.h>
 
852
            #ifdef HAVE_SYS_BITYPES_H
 
853
            #include <sys/bitypes.h>
 
854
            #endif
 
855
 
 
856
            main()
 
857
            {
 
858
              printf("%" PRId64 "\n", (u_int64_t)1);
 
859
              printf("%" PRIo64 "\n", (u_int64_t)1);
 
860
              printf("%" PRIx64 "\n", (u_int64_t)1);
 
861
              printf("%" PRIu64 "\n", (u_int64_t)1);
 
862
            }
 
863
          ]])
 
864
      ],
 
865
      [
 
866
        AC_MSG_RESULT(yes)
 
867
        ac_lbl_inttypes_h_defines_formats=yes
 
868
      ],
 
869
      [
 
870
        AC_MSG_RESULT(no)
 
871
        ac_lbl_inttypes_h_defines_formats=no
 
872
      ])
 
873
  ],
 
874
  [
 
875
    #
 
876
    # We don't have inttypes.h, so it obviously can't define those
 
877
    # macros.
 
878
    #
 
879
    ac_lbl_inttypes_h_defines_formats=no
 
880
  ])
 
881
if test "$ac_lbl_inttypes_h_defines_formats" = no; then
 
882
  AC_LBL_CHECK_64BIT_FORMAT(l,
 
883
    [
 
884
      AC_LBL_CHECK_64BIT_FORMAT(ll,
 
885
        [
 
886
          AC_LBL_CHECK_64BIT_FORMAT(L,
 
887
            [
 
888
              AC_LBL_CHECK_64BIT_FORMAT(q,
 
889
                [
 
890
                  AC_MSG_ERROR([neither %llx nor %Lx nor %qx worked on a 64-bit integer])
 
891
                ])
 
892
            ])
 
893
        ])
 
894
    ])
 
895
fi
684
896
 
685
897
AC_LBL_DEVEL(V_CCOPT)
686
898
 
695
907
AC_MSG_CHECKING(for SSLeay)
696
908
ac_cv_ssleay_path=no
697
909
incdir=no
698
 
for dir in /usr/${host_alias} /usr /usr/local /usr/local/ssl /usr/pkg; do
 
910
 
 
911
#
 
912
# If Xprefix is set in the environment, use that value.
 
913
# XXX - this should arguably be done by having --with-crypto take an
 
914
# optional argument, and have that argument be used to set Xprefix
 
915
# if present.
 
916
#
 
917
if test -z "$Xprefix"; then
 
918
        Xprefix=`eval echo $prefix`
 
919
fi
 
920
 
 
921
for dir in $Xprefix /usr/${host_alias} /usr /usr/local /usr/local/ssl /usr/pkg; do
699
922
        #
700
923
        # XXX - is there a better way to check if a given library is
701
924
        # in a given directory than checking each of the possible
732
955
        if test -f $ac_cv_ssleay_path/lib/librsaref.a; then
733
956
                LIBS="$LIBS -lrsaref"
734
957
        fi
735
 
        AC_CHECK_LIB(crypto, des_cbc_encrypt)
 
958
        AC_CHECK_LIB(crypto, DES_cbc_encrypt)
736
959
 
737
960
        CPPFLAGS="$CPPFLAGS $V_INCLS"
738
961
        AC_CHECK_HEADERS(openssl/evp.h)
739
962
fi
740
963
])
741
964
 
 
965
dnl
 
966
dnl set additional include path if necessary
 
967
if test "$missing_includes" = "yes"; then
 
968
        CPPFLAGS="$CPPFLAGS -I\$(srcdir)/missing"
 
969
        V_INCLS="$V_INCLS -I\$(srcdir)/missing"
 
970
fi
 
971
 
742
972
AC_SUBST(V_CCOPT)
743
973
AC_SUBST(V_DEFS)
744
974
AC_SUBST(V_GROUP)