]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Check for "pcap_version" in libpcap in the configure scripts; apparently
authorguy <guy>
Thu, 5 Sep 2002 01:31:41 +0000 (01:31 +0000)
committerguy <guy>
Thu, 5 Sep 2002 01:31:41 +0000 (01:31 +0000)
the libpcap that comes with some platforms doesn't define it.

Check for "pcap_debug" and "yydebug" in libpcap in the configure
scripts, so that whichever one is present (which might depend on whether
libpcap was built with standard YACC or Berkeley YACC/Bison), if any is
present, will be used by the "-Y" flag (if none is present, "-Y" won't
be supported).

acconfig.h
config.h.in
configure
configure.in
tcpdump.c

index 02b78e0e96469391cce345b0a7b4df3c3a5baf4d..2635fd1cd81322c71732a104facbcb2f69bf3ef8 100644 (file)
 /* define if you have ether_ntohost() and it works */
 #undef USE_ETHER_NTOHOST
 
+/* define if libpcap has pcap_version */
+#undef HAVE_PCAP_VERSION
+
+/* define if libpcap has pcap_debug */
+#undef HAVE_PCAP_DEBUG
+
+/* define if libpcap has yydebug */
+#undef HAVE_YYDEBUG
+
 /* define if unaligned memory accesses fail */
 #undef LBL_ALIGN
 
index bf6d4e4198d813fb857079ffca2b355c50f0ea82..d15eb7569135f0dae7fd1979a05e7554877be134 100644 (file)
 /* define if you have ether_ntohost() and it works */
 #undef USE_ETHER_NTOHOST
 
+/* define if libpcap has pcap_version */
+#undef HAVE_PCAP_VERSION
+
+/* define if libpcap has pcap_debug */
+#undef HAVE_PCAP_DEBUG
+
+/* define if libpcap has yydebug */
+#undef HAVE_YYDEBUG
+
 /* define if unaligned memory accesses fail */
 #undef LBL_ALIGN
 
index 1addf73ad594a2a799484659601f751e49e03009..47057dd8832ed94ec853d4b39d6833d12ceb9fa7 100755 (executable)
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
 #! /bin/sh
 
-# From configure.in Revision: 1.156 
+# From configure.in Revision: 1.157 
 
 
 
@@ -4001,15 +4001,129 @@ else
 fi
 done
 
+echo $ac_n "checking whether pcap_version is defined by libpcap""... $ac_c" 1>&6
+echo "configure:4006: checking whether pcap_version is defined by libpcap" >&5
+cat > conftest.$ac_ext <<EOF
+#line 4008 "configure"
+#include "confdefs.h"
+
+int main() {
+
+char *
+return_pcap_version(void)
+{
+       extern char pcap_version[];
+
+       return pcap_version;
+}
+   
+; return 0; }
+EOF
+if { (eval echo configure:4023: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  ac_lbl_cv_pcap_version_defined=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  ac_lbl_cv_pcap_version_defined=no
+fi
+rm -f conftest*
+if test "$ac_lbl_cv_pcap_version_defined" = yes ; then
+       echo "$ac_t""yes" 1>&6
+       cat >> confdefs.h <<\EOF
+#define HAVE_PCAP_VERSION 1
+EOF
+
+else
+       echo "$ac_t""no" 1>&6
+fi
+echo $ac_n "checking whether pcap_debug is defined by libpcap""... $ac_c" 1>&6
+echo "configure:4043: checking whether pcap_debug is defined by libpcap" >&5
+cat > conftest.$ac_ext <<EOF
+#line 4045 "configure"
+#include "confdefs.h"
+
+int main() {
+
+int
+return_pcap_debug(void)
+{
+       extern int pcap_debug;
+
+       return pcap_debug;
+}
+   
+; return 0; }
+EOF
+if { (eval echo configure:4060: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  ac_lbl_cv_pcap_debug_defined=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  ac_lbl_cv_pcap_debug_defined=no
+fi
+rm -f conftest*
+if test "$ac_lbl_cv_pcap_debug_defined" = yes ; then
+       echo "$ac_t""yes" 1>&6
+       cat >> confdefs.h <<\EOF
+#define HAVE_PCAP_DEBUG 1
+EOF
+
+else
+       echo "$ac_t""no" 1>&6
+       #
+       # OK, what about "yydebug"?
+       #
+       echo $ac_n "checking whether yydebug is defined by libpcap""... $ac_c" 1>&6
+echo "configure:4082: checking whether yydebug is defined by libpcap" >&5
+       cat > conftest.$ac_ext <<EOF
+#line 4084 "configure"
+#include "confdefs.h"
+
+int main() {
+
+       int
+       return_yydebug(void)
+       {
+               extern int yydebug;
+
+               return yydebug;
+       }
+          
+; return 0; }
+EOF
+if { (eval echo configure:4099: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  ac_lbl_cv_yydebug_defined=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  ac_lbl_cv_yydebug_defined=no
+fi
+rm -f conftest*
+       if test "$ac_lbl_cv_yydebug_defined" = yes ; then
+               echo "$ac_t""yes" 1>&6
+               cat >> confdefs.h <<\EOF
+#define HAVE_YYDEBUG 1
+EOF
+
+       else
+               echo "$ac_t""no" 1>&6
+       fi
+fi
 for ac_func in bpf_dump
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4008: checking for $ac_func" >&5
+echo "configure:4122: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4013 "configure"
+#line 4127 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -4032,7 +4146,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:4036: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4150: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -4089,12 +4203,12 @@ if test -f /dev/bpf0 ; then
 fi
 
 echo $ac_n "checking for u_int8_t using $CC""... $ac_c" 1>&6
-echo "configure:4093: checking for u_int8_t using $CC" >&5
+echo "configure:4207: checking for u_int8_t using $CC" >&5
     if eval "test \"`echo '$''{'ac_cv_lbl_have_u_int8_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4098 "configure"
+#line 4212 "configure"
 #include "confdefs.h"
 
 #      include "confdefs.h"
@@ -4107,7 +4221,7 @@ int main() {
 u_int8_t i
 ; return 0; }
 EOF
-if { (eval echo configure:4111: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4225: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_lbl_have_u_int8_t=yes
 else
@@ -4127,12 +4241,12 @@ EOF
 
     fi
 echo $ac_n "checking for int16_t using $CC""... $ac_c" 1>&6
-echo "configure:4131: checking for int16_t using $CC" >&5
+echo "configure:4245: checking for int16_t using $CC" >&5
     if eval "test \"`echo '$''{'ac_cv_lbl_have_int16_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4136 "configure"
+#line 4250 "configure"
 #include "confdefs.h"
 
 #      include "confdefs.h"
@@ -4145,7 +4259,7 @@ int main() {
 int16_t i
 ; return 0; }
 EOF
-if { (eval echo configure:4149: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4263: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_lbl_have_int16_t=yes
 else
@@ -4165,12 +4279,12 @@ EOF
 
     fi
 echo $ac_n "checking for u_int16_t using $CC""... $ac_c" 1>&6
-echo "configure:4169: checking for u_int16_t using $CC" >&5
+echo "configure:4283: checking for u_int16_t using $CC" >&5
     if eval "test \"`echo '$''{'ac_cv_lbl_have_u_int16_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4174 "configure"
+#line 4288 "configure"
 #include "confdefs.h"
 
 #      include "confdefs.h"
@@ -4183,7 +4297,7 @@ int main() {
 u_int16_t i
 ; return 0; }
 EOF
-if { (eval echo configure:4187: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4301: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_lbl_have_u_int16_t=yes
 else
@@ -4203,12 +4317,12 @@ EOF
 
     fi
 echo $ac_n "checking for int32_t using $CC""... $ac_c" 1>&6
-echo "configure:4207: checking for int32_t using $CC" >&5
+echo "configure:4321: checking for int32_t using $CC" >&5
     if eval "test \"`echo '$''{'ac_cv_lbl_have_int32_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4212 "configure"
+#line 4326 "configure"
 #include "confdefs.h"
 
 #      include "confdefs.h"
@@ -4221,7 +4335,7 @@ int main() {
 int32_t i
 ; return 0; }
 EOF
-if { (eval echo configure:4225: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4339: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_lbl_have_int32_t=yes
 else
@@ -4241,12 +4355,12 @@ EOF
 
     fi
 echo $ac_n "checking for u_int32_t using $CC""... $ac_c" 1>&6
-echo "configure:4245: checking for u_int32_t using $CC" >&5
+echo "configure:4359: checking for u_int32_t using $CC" >&5
     if eval "test \"`echo '$''{'ac_cv_lbl_have_u_int32_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4250 "configure"
+#line 4364 "configure"
 #include "confdefs.h"
 
 #      include "confdefs.h"
@@ -4259,7 +4373,7 @@ int main() {
 u_int32_t i
 ; return 0; }
 EOF
-if { (eval echo configure:4263: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4377: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_lbl_have_u_int32_t=yes
 else
@@ -4319,12 +4433,12 @@ EOF
     fi
 
 echo $ac_n "checking if sockaddr struct has sa_len member""... $ac_c" 1>&6
-echo "configure:4323: checking if sockaddr struct has sa_len member" >&5
+echo "configure:4437: checking if sockaddr struct has sa_len member" >&5
     if eval "test \"`echo '$''{'ac_cv_lbl_sockaddr_has_sa_len'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4328 "configure"
+#line 4442 "configure"
 #include "confdefs.h"
 
 #      include <sys/types.h>
@@ -4333,7 +4447,7 @@ int main() {
 u_int i = sizeof(((struct sockaddr *)0)->sa_len)
 ; return 0; }
 EOF
-if { (eval echo configure:4337: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4451: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_lbl_sockaddr_has_sa_len=yes
 else
@@ -4354,7 +4468,7 @@ EOF
     fi
 
 echo $ac_n "checking if unaligned accesses fail""... $ac_c" 1>&6
-echo "configure:4358: checking if unaligned accesses fail" >&5
+echo "configure:4472: checking if unaligned accesses fail" >&5
     if eval "test \"`echo '$''{'ac_cv_lbl_unaligned_fail'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4419,12 +4533,12 @@ EOF
 
 
        echo $ac_n "checking for h_errno""... $ac_c" 1>&6
-echo "configure:4423: checking for h_errno" >&5
+echo "configure:4537: checking for h_errno" >&5
        if eval "test \"`echo '$''{'ac_cv_var_h_errno'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4428 "configure"
+#line 4542 "configure"
 #include "confdefs.h"
 
 #              include <sys/types.h>
@@ -4433,7 +4547,7 @@ int main() {
 int foo = h_errno;
 ; return 0; }
 EOF
-if { (eval echo configure:4437: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4551: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_var_h_errno=yes
 else
@@ -4461,7 +4575,7 @@ if test "${with_crypto+set}" = set; then
 else
   
 echo $ac_n "checking for SSLeay""... $ac_c" 1>&6
-echo "configure:4465: checking for SSLeay" >&5
+echo "configure:4579: checking for SSLeay" >&5
 ac_cv_ssleay_path=no
 incdir=no
 for dir in /usr/${host_alias} /usr /usr/local /usr/local/ssl /usr/pkg; do
@@ -4489,7 +4603,7 @@ if test "$ac_cv_ssleay_path" != no; then
                LIBS="$LIBS -lrsaref"
        fi
        echo $ac_n "checking for des_cbc_encrypt in -lcrypto""... $ac_c" 1>&6
-echo "configure:4493: checking for des_cbc_encrypt in -lcrypto" >&5
+echo "configure:4607: checking for des_cbc_encrypt in -lcrypto" >&5
 ac_lib_var=`echo crypto'_'des_cbc_encrypt | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -4497,7 +4611,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lcrypto  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4501 "configure"
+#line 4615 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -4508,7 +4622,7 @@ int main() {
 des_cbc_encrypt()
 ; return 0; }
 EOF
-if { (eval echo configure:4512: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4626: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4542,17 +4656,17 @@ fi
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4546: checking for $ac_hdr" >&5
+echo "configure:4660: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4551 "configure"
+#line 4665 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4556: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4670: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -4581,7 +4695,7 @@ done
 
        if test "$ac_cv_header_openssl_cast_h" = "yes"; then
                echo $ac_n "checking for buggy CAST128""... $ac_c" 1>&6
-echo "configure:4585: checking for buggy CAST128" >&5
+echo "configure:4699: checking for buggy CAST128" >&5
                if eval "test \"`echo '$''{'td_cv_buggy_cast128'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4589,7 +4703,7 @@ else
   td_cv_buggy_cast128="cross-compiling, assume yes"
 else
   cat > conftest.$ac_ext <<EOF
-#line 4593 "configure"
+#line 4707 "configure"
 #include "confdefs.h"
 
 #include <openssl/cast.h>
@@ -4608,7 +4722,7 @@ main()
                return 1;
 }
 EOF
-if { (eval echo configure:4612: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:4726: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   td_cv_buggy_cast128=yes
 else
@@ -4642,17 +4756,17 @@ for ac_hdr in openssl/rc5.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4646: checking for $ac_hdr" >&5
+echo "configure:4760: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4651 "configure"
+#line 4765 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4656: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4770: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -4697,7 +4811,7 @@ done
 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
 # ./install, which can be erroneously created by make from ./install.sh.
 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:4701: checking for a BSD compatible install" >&5
+echo "configure:4815: checking for a BSD compatible install" >&5
 if test -z "$INSTALL"; then
 if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
index 3c74001603a04cc80e6052aa080b644e75a1db12..3d5d5e16784b082a3064bfcf1f4c9f00a99cc4a4 100644 (file)
@@ -1,4 +1,4 @@
-dnl @(#) $Header: /tcpdump/master/tcpdump/configure.in,v 1.156 2002-09-05 00:00:08 guy Exp $ (LBL)
+dnl @(#) $Header: /tcpdump/master/tcpdump/configure.in,v 1.157 2002-09-05 01:31:41 guy Exp $ (LBL)
 dnl
 dnl Copyright (c) 1994, 1995, 1996, 1997
 dnl    The Regents of the University of California.  All rights reserved.
@@ -6,7 +6,7 @@ dnl
 dnl Process this file with autoconf to produce a configure script.
 dnl
 
-AC_REVISION($Revision: 1.156 $)
+AC_REVISION($Revision: 1.157 $)
 AC_PREREQ(2.13)
 AC_INIT(tcpdump.c)
 
@@ -560,6 +560,66 @@ dnl AC_CHECK_HEADERS(zlib.h)
 AC_LBL_LIBPCAP(V_PCAPDEP, V_INCLS)
 
 AC_CHECK_FUNCS(pcap_findalldevs)
+AC_MSG_CHECKING(whether pcap_version is defined by libpcap)
+AC_TRY_LINK([],
+   [
+char *
+return_pcap_version(void)
+{
+       extern char pcap_version[];
+
+       return pcap_version;
+}
+   ],
+   ac_lbl_cv_pcap_version_defined=yes,
+   ac_lbl_cv_pcap_version_defined=no)
+if test "$ac_lbl_cv_pcap_version_defined" = yes ; then
+       AC_MSG_RESULT(yes)
+       AC_DEFINE(HAVE_PCAP_VERSION)
+else
+       AC_MSG_RESULT(no)
+fi
+AC_MSG_CHECKING(whether pcap_debug is defined by libpcap)
+AC_TRY_LINK([],
+   [
+int
+return_pcap_debug(void)
+{
+       extern int pcap_debug;
+
+       return pcap_debug;
+}
+   ],
+   ac_lbl_cv_pcap_debug_defined=yes,
+   ac_lbl_cv_pcap_debug_defined=no)
+if test "$ac_lbl_cv_pcap_debug_defined" = yes ; then
+       AC_MSG_RESULT(yes)
+       AC_DEFINE(HAVE_PCAP_DEBUG)
+else
+       AC_MSG_RESULT(no)
+       #
+       # OK, what about "yydebug"?
+       #
+       AC_MSG_CHECKING(whether yydebug is defined by libpcap)
+       AC_TRY_LINK([],
+          [
+       int
+       return_yydebug(void)
+       {
+               extern int yydebug;
+
+               return yydebug;
+       }
+          ],
+          ac_lbl_cv_yydebug_defined=yes,
+          ac_lbl_cv_yydebug_defined=no)
+       if test "$ac_lbl_cv_yydebug_defined" = yes ; then
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_YYDEBUG)
+       else
+               AC_MSG_RESULT(no)
+       fi
+fi
 AC_REPLACE_FUNCS(bpf_dump)     dnl moved to libpcap in 0.6
 
 V_GROUP=0
index 2f2710e56ef90ace91bf5e393b8673217b867834..5640078138177112cfe0d958ee6e820a1d9c1fa5 100644 (file)
--- a/tcpdump.c
+++ b/tcpdump.c
@@ -30,7 +30,7 @@ static const char copyright[] =
     "@(#) Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 2000\n\
 The Regents of the University of California.  All rights reserved.\n";
 static const char rcsid[] =
-    "@(#) $Header: /tcpdump/master/tcpdump/tcpdump.c,v 1.184 2002-08-09 13:50:15 risso Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/tcpdump/tcpdump.c,v 1.185 2002-09-05 01:31:42 guy Exp $ (LBL)";
 #endif
 
 /*
@@ -475,12 +475,17 @@ main(int argc, char **argv)
                        ++Xflag;
                        break;
 
-#ifdef YYDEBUG
+#if defined(HAVE_PCAP_DEBUG) || defined(HAVE_YYDEBUG)
                case 'Y':
                        {
                        /* Undocumented flag */
+#ifdef HAVE_PCAP_DEBUG
+                       extern int pcap_debug;
+                       pcap_debug = 1;
+#else
                        extern int yydebug;
                        yydebug = 1;
+#endif
                        }
                        break;
 #endif
@@ -784,7 +789,11 @@ static void
 usage(void)
 {
        extern char version[];
+#if defined(WIN32) || defined(HAVE_PCAP_VERSION)
        extern char pcap_version[];
+#else
+       static char pcap_version[] = "unknown";
+#endif
 
 #ifdef WIN32
        (void)fprintf(stderr, "%s version %s, based on tcpdump version %s\n", program_name, WDversion, version);