1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-06 04:31:29 +00:00

Upgrade libpcap to 1.8.1

This commit is contained in:
dmiller
2018-07-18 13:41:40 +00:00
parent 172ef58889
commit d95bc032c6
4 changed files with 331 additions and 296 deletions

View File

@@ -1,5 +1,7 @@
#Nmap Changelog ($Id$); -*-text-*-
o Upgraded included libpcap to 1.8.1 [Daniel Miller]
o [NSE] Script http-default-accounts was not able to run against more than one
target host/port. [nnposter]

View File

@@ -0,0 +1,126 @@
From f38b1fc263d65a53746108e2c9afacf1dc6a058a Mon Sep 17 00:00:00 2001
From: Daniel Miller <daniel@bonsaiviking.com>
Date: Fri, 1 May 2015 14:44:28 +0000
Subject: [PATCH 1/2] Don't autogenerate Lex/Yacc files.
---
libpcap/Makefile.in | 33 ++++++++++-----------------------
libpcap/configure.in | 20 --------------------
2 files changed, 10 insertions(+), 43 deletions(-)
diff --git a/libpcap/Makefile.in b/libpcap/Makefile.in
index f317973..577b848 100644
--- a/libpcap/Makefile.in
+++ b/libpcap/Makefile.in
@@ -69,14 +69,6 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
RANLIB = @RANLIB@
-#
-# Flex and bison allow you to specify the prefixes of the global symbols
-# used by the generated parser. This allows programs to use lex/yacc
-# and link against libpcap. If you don't have flex or bison, get them.
-#
-LEX = @V_LEX@
-YACC = @V_YACC@
-
# Explicitly define compilation rule since SunOS 4's make doesn't like gcc.
# Also, gcc does not remove the .o before forking 'as', which can be a
# problem if you don't own the file but can write to the directory.
@@ -152,7 +144,7 @@ TAGFILES = \
$(SRC) $(HDR)
CLEANFILES = $(OBJ) libpcap.* $(TESTS) \
- $(PROG)-`cat $(srcdir)/VERSION`.tar.gz $(GENSRC) $(GENHDR) \
+ $(PROG)-`cat $(srcdir)/VERSION`.tar.gz \
lex.yy.c pcap-config
MAN1 = pcap-config.1
@@ -360,6 +352,15 @@ EXTRA_DIST = \
all: libpcap.a shared pcap-config
+# Inhibit implicit rule Make seems to have for using yacc/lex to
+# recompile new scanner.c/grammar.c -- we ship ones which we want to
+# use instead.
+grammar.c:
+ echo "Not rebuilding grammar.c"
+
+scanner.c:
+ echo "Not rebuilding scanner.c"
+
libpcap.a: $(OBJ)
@rm -f $@
$(AR) rc $@ $(OBJ) $(ADDLARCHIVEOBJS)
@@ -443,25 +444,11 @@ libpcap.shareda: $(OBJ)
#
libpcap.none:
-scanner.c: $(srcdir)/scanner.l
- @rm -f $@ $@.bottom
- $(srcdir)/runlex.sh $(LEX) -o$@ $<
- mv $@ $@.bottom
- cat $@.top $@.bottom > $@
- @rm $@.bottom
-
scanner.o: scanner.c tokdefs.h
$(CC) $(FULL_CFLAGS) -c scanner.c
pcap.o: version.h
-tokdefs.h: grammar.c
-grammar.c: $(srcdir)/grammar.y
- @rm -f grammar.c tokdefs.h
- $(YACC) -d $<
- mv y.tab.c grammar.c
- mv y.tab.h tokdefs.h
-
grammar.o: grammar.c
@rm -f $@
$(CC) $(FULL_CFLAGS) -Dyylval=pcap_lval -c grammar.c
diff --git a/libpcap/configure.in b/libpcap/configure.in
index be4b29e..ec87283 100644
--- a/libpcap/configure.in
+++ b/libpcap/configure.in
@@ -1051,24 +1051,6 @@ if test "$V_PCAP" = snf -a "$ac_cv_lbl_snf_api" = no; then
AC_MSG_ERROR(Specifying the capture type as 'snf' requires the Myricom Sniffer API to be present; use --with-snf=DIR)
fi
-AC_LBL_LEX_AND_YACC(V_LEX, V_YACC, pcap_)
-if test "$V_LEX" = lex ; then
-# Some versions of lex can't handle the definitions section of scanner.l .
-# Try lexing it and complain if it can't deal.
- AC_CACHE_CHECK([for capable lex], tcpdump_cv_capable_lex,
- if lex -t scanner.l > /dev/null 2>&1; then
- tcpdump_cv_capable_lex=yes
- else
- tcpdump_cv_capable_lex=insufficient
- fi)
- if test $tcpdump_cv_capable_lex = insufficient ; then
- AC_MSG_ERROR([Your operating system's lex is insufficient to compile
- libpcap. flex is a lex replacement that has many advantages, including
- being able to compile libpcap. For more information, see
- http://www.gnu.org/software/flex/flex.html .])
- fi
-fi
-
#
# Assume, by default, no support for shared libraries and V7/BSD convention
# for man pages (file formats in section 5, miscellaneous info in section 7).
@@ -1351,13 +1333,11 @@ AC_SUBST(V_CCOPT)
AC_SUBST(V_DEFS)
AC_SUBST(V_FINDALLDEVS)
AC_SUBST(V_INCLS)
-AC_SUBST(V_LEX)
AC_SUBST(V_PCAP)
AC_SUBST(V_SHLIB_CMD)
AC_SUBST(V_SHLIB_OPT)
AC_SUBST(V_SONAME_OPT)
AC_SUBST(V_RPATH_OPT)
-AC_SUBST(V_YACC)
AC_SUBST(ADDLOBJS)
AC_SUBST(ADDLARCHIVEOBJS)
AC_SUBST(SSRC)
--
1.9.1

View File

@@ -0,0 +1,174 @@
From 7a42932439162be1f263986cdc7bbef78840a71a Mon Sep 17 00:00:00 2001
From: Daniel Miller <daniel@bonsaiviking.com>
Date: Fri, 1 May 2015 14:53:42 +0000
Subject: [PATCH 2/2] Disable unnecessary features
The following features are disabled:
* monitor-mode sniffing of wireless interfaces on Linux, via libnl
* building shared libraries
* Bluetooth support
* canusb support
* CAN support
* dbus capture support
---
libpcap/configure.ac | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/libpcap/configure.ac b/libpcap/configure.ac
index ec87283..ad2e437 100644
--- a/libpcap/configure.ac
+++ b/libpcap/configure.ac
@@ -450,10 +450,10 @@ linux)
# Do we have libnl?
#
AC_ARG_WITH(libnl,
- AC_HELP_STRING([--without-libnl],[disable libnl support @<:@default=yes, on Linux, if present@:>@]),
+ AC_HELP_STRING([--without-libnl],[disable libnl support @<:@default=disabled@:>@]),
with_libnl=$withval,,)
- if test x$with_libnl != xno ; then
+ if test x$with_libnl = xyes ; then
have_any_nl="no"
incdir=-I/usr/include/libnl3
@@ -1301,8 +1301,8 @@ solaris*)
esac
AC_ARG_ENABLE(shared,
-AC_HELP_STRING([--enable-shared],[build shared libraries @<:@default=yes, if support available@:>@]))
-test "x$enable_shared" = "xno" && DYEXT="none"
+AC_HELP_STRING([--enable-shared],[build shared libraries @<:@default=no@:>@]))
+test "x$enable_shared" != "xyes" && DYEXT="none"
AC_PROG_RANLIB
AC_CHECK_TOOL([AR], [ar])
@@ -1457,9 +1457,9 @@ AC_SUBST(PCAP_SUPPORT_NETFILTER)
AC_SUBST(NETFILTER_SRC)
AC_ARG_ENABLE([bluetooth],
-[AC_HELP_STRING([--enable-bluetooth],[enable Bluetooth support @<:@default=yes, if support available@:>@])],
+[AC_HELP_STRING([--enable-bluetooth],[enable Bluetooth support @<:@default=no@:>@])],
[],
- [enable_bluetooth=ifsupportavailable])
+ [enable_bluetooth=no])
if test "x$enable_bluetooth" != "xno" ; then
dnl check for Bluetooth sniffing support
@@ -1536,9 +1536,9 @@ if test "x$enable_bluetooth" != "xno" ; then
fi
AC_ARG_ENABLE([canusb],
-[AC_HELP_STRING([--enable-canusb],[enable canusb support @<:@default=yes, if support available@:>@])],
+[AC_HELP_STRING([--enable-canusb],[enable canusb support @<:@default=no@:>@])],
[],
- [enable_canusb=ifsupportavailable])
+ [enable_canusb=no])
if test "x$enable_canusb" != "xno" ; then
dnl check for canusb support
@@ -1582,9 +1582,9 @@ if test "x$enable_canusb" != "xno" ; then
fi
AC_ARG_ENABLE([can],
-[AC_HELP_STRING([--enable-can],[enable CAN support @<:@default=yes, if support available@:>@])],
+[AC_HELP_STRING([--enable-can],[enable CAN support @<:@default=no@:>@])],
[],
- [enable_can=ifsupportavailable])
+ [enable_can=no])
if test "x$enable_can" != "xno" ; then
dnl check for CAN sniffing support
@@ -1619,9 +1619,9 @@ if test "x$enable_can" != "xno" ; then
fi
AC_ARG_ENABLE([dbus],
-[AC_HELP_STRING([--enable-dbus],[enable D-Bus capture support @<:@default=yes, if support available@:>@])],
+[AC_HELP_STRING([--enable-dbus],[enable D-Bus capture support @<:@default=no@:>@])],
[],
- [enable_dbus=ifavailable])
+ [enable_dbus=no])
if test "x$enable_dbus" != "xno"; then
if test "x$enable_dbus" = "xyes"; then
--
1.9.1
commit e79d124eed3951184e812ea95609a0cefb855b01
Author: Daniel Miller <daniel@bonsaiviking.com>
Date: Tue Jul 17 19:36:10 2018 +0000
libpcap: Disable unnecessary features
The following features are disabled:
* monitor-mode sniffing of wireless interfaces on Linux, via libnl
* building shared libraries
* Bluetooth support
* usb support
* dbus capture support
diff --git a/libpcap/configure.ac b/libpcap/configure.ac
index 4300866..21e2b5f 100644
--- a/libpcap/configure.ac
+++ b/libpcap/configure.ac
@@ -485,10 +485,10 @@ linux)
# Do we have libnl?
#
AC_ARG_WITH(libnl,
- AC_HELP_STRING([--without-libnl],[disable libnl support @<:@default=yes, on Linux, if present@:>@]),
+ AC_HELP_STRING([--without-libnl],[disable libnl support @<:@default=disabled@:>@]),
with_libnl=$withval,,)
- if test x$with_libnl != xno ; then
+ if test x$with_libnl = xyes ; then
have_any_nl="no"
incdir=-I/usr/include/libnl3
@@ -1390,8 +1390,8 @@ solaris*)
esac
AC_ARG_ENABLE(shared,
-AC_HELP_STRING([--enable-shared],[build shared libraries @<:@default=yes, if support available@:>@]))
-test "x$enable_shared" = "xno" && DYEXT="none"
+AC_HELP_STRING([--enable-shared],[build shared libraries @<:@default=no@:>@]))
+test "x$enable_shared" != "xyes" && DYEXT="none"
AC_PROG_RANLIB
AC_CHECK_TOOL([AR], [ar])
@@ -1429,9 +1429,9 @@ AC_SUBST(MAN_FILE_FORMATS)
AC_SUBST(MAN_MISC_INFO)
AC_ARG_ENABLE([usb],
-[AC_HELP_STRING([--enable-usb],[enable nusb support @<:@default=yes, if support available@:>@])],
+[AC_HELP_STRING([--enable-usb],[enable nusb support @<:@default=no@:>@])],
[],
- [enable_usb=yes])
+ [enable_usb=no])
if test "xxx_only" = yes; then
# User requested something-else-only pcap, so they don't
@@ -1556,9 +1556,9 @@ AC_SUBST(PCAP_SUPPORT_NETFILTER)
AC_SUBST(NETFILTER_SRC)
AC_ARG_ENABLE([bluetooth],
-[AC_HELP_STRING([--enable-bluetooth],[enable Bluetooth support @<:@default=yes, if support available@:>@])],
+[AC_HELP_STRING([--enable-bluetooth],[enable Bluetooth support @<:@default=no@:>@])],
[],
- [enable_bluetooth=ifsupportavailable])
+ [enable_bluetooth=no])
if test "xxx_only" = yes; then
# User requested something-else-only pcap, so they don't
@@ -1641,9 +1641,9 @@ if test "x$enable_bluetooth" != "xno" ; then
fi
AC_ARG_ENABLE([dbus],
-[AC_HELP_STRING([--enable-dbus],[enable D-Bus capture support @<:@default=yes, if support available@:>@])],
+[AC_HELP_STRING([--enable-dbus],[enable D-Bus capture support @<:@default=no@:>@])],
[],
- [enable_dbus=ifavailable])
+ [enable_dbus=no])
if test "xxx_only" = yes; then
# User requested something-else-only pcap, so they don't

325
libpcap/configure vendored
View File

@@ -640,13 +640,11 @@ DYEXT
SSRC
ADDLARCHIVEOBJS
ADDLOBJS
V_YACC
V_RPATH_OPT
V_SONAME_OPT
V_SHLIB_OPT
V_SHLIB_CMD
V_PCAP
V_LEX
V_INCLS
V_FINDALLDEVS
V_DEFS
@@ -656,11 +654,6 @@ DEPENDENCY_CFLAG
LN_S
AR
RANLIB
YFLAGS
YACC
LEXLIB
LEX_OUTPUT_ROOT
LEX
HAVE_LINUX_TPACKET_AUXDATA
VALGRINDTEST
LIBOBJS
@@ -706,6 +699,7 @@ infodir
docdir
oldincludedir
includedir
runstatedir
localstatedir
sharedstatedir
sysconfdir
@@ -760,9 +754,7 @@ CFLAGS
LDFLAGS
LIBS
CPPFLAGS
CPP
YACC
YFLAGS'
CPP'
# Initialize some variables set by options.
@@ -801,6 +793,7 @@ datadir='${datarootdir}'
sysconfdir='${prefix}/etc'
sharedstatedir='${prefix}/com'
localstatedir='${prefix}/var'
runstatedir='${localstatedir}/run'
includedir='${prefix}/include'
oldincludedir='/usr/include'
docdir='${datarootdir}/doc/${PACKAGE}'
@@ -1053,6 +1046,15 @@ do
| -silent | --silent | --silen | --sile | --sil)
silent=yes ;;
-runstatedir | --runstatedir | --runstatedi | --runstated \
| --runstate | --runstat | --runsta | --runst | --runs \
| --run | --ru | --r)
ac_prev=runstatedir ;;
-runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
| --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
| --run=* | --ru=* | --r=*)
runstatedir=$ac_optarg ;;
-sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
ac_prev=sbindir ;;
-sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
@@ -1190,7 +1192,7 @@ fi
for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
datadir sysconfdir sharedstatedir localstatedir includedir \
oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
libdir localedir mandir
libdir localedir mandir runstatedir
do
eval ac_val=\$$ac_var
# Remove trailing slashes.
@@ -1343,6 +1345,7 @@ Fine tuning of the installation directories:
--sysconfdir=DIR read-only single-machine data [PREFIX/etc]
--sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
--localstatedir=DIR modifiable single-machine data [PREFIX/var]
--runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run]
--libdir=DIR object code libraries [EPREFIX/lib]
--includedir=DIR C header files [PREFIX/include]
--oldincludedir=DIR C header files for non-gcc [/usr/include]
@@ -1382,14 +1385,10 @@ Optional Features:
--enable-optimizer-dbg build optimizer debugging code
--enable-yydebug build parser debugging code
--disable-universal don't build universal on OS X
--enable-shared build shared libraries [default=yes, if support
available]
--enable-usb enable nusb support [default=yes, if support
available]
--enable-bluetooth enable Bluetooth support [default=yes, if support
available]
--enable-dbus enable D-Bus capture support [default=yes, if
support available]
--enable-shared build shared libraries [default=no]
--enable-usb enable nusb support [default=no]
--enable-bluetooth enable Bluetooth support [default=no]
--enable-dbus enable D-Bus capture support [default=no]
--enable-packet-ring enable Linux packet ring support [default=yes]
Optional Packages:
@@ -1398,8 +1397,7 @@ Optional Packages:
--without-gcc don't use gcc
--with-sita include SITA support
--with-pcap=TYPE use packet capture TYPE
--without-libnl disable libnl support [default=yes, on Linux, if
present]
--without-libnl disable libnl support [default=disabled]
--with-dag[=DIR] include Endace DAG support (located in directory
DIR, if supplied). [default=yes, if present]
--with-dag-includes=IDIR
@@ -1427,12 +1425,6 @@ Some influential environment variables:
CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
you have headers in a nonstandard directory <include dir>
CPP C preprocessor
YACC The `Yet Another Compiler Compiler' implementation to use.
Defaults to the first program found out of: `bison -y', `byacc',
`yacc'.
YFLAGS The list of arguments that will be passed by default to $YACC.
This script will default YFLAGS to the empty string to avoid a
default value of `-d' given by some make applications.
Use these variables to override the choices made by `configure' or to help
it to find libraries and programs with nonstandard names/locations.
@@ -4487,7 +4479,7 @@ else
We can't simply define LARGE_OFF_T to be 9223372036854775807,
since some C++ compilers masquerading as C compilers
incorrectly reject 9223372036854775807. */
#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
&& LARGE_OFF_T % 2147483647 == 1)
? 1 : -1];
@@ -4533,7 +4525,7 @@ else
We can't simply define LARGE_OFF_T to be 9223372036854775807,
since some C++ compilers masquerading as C compilers
incorrectly reject 9223372036854775807. */
#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
&& LARGE_OFF_T % 2147483647 == 1)
? 1 : -1];
@@ -4557,7 +4549,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
We can't simply define LARGE_OFF_T to be 9223372036854775807,
since some C++ compilers masquerading as C compilers
incorrectly reject 9223372036854775807. */
#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
&& LARGE_OFF_T % 2147483647 == 1)
? 1 : -1];
@@ -4602,7 +4594,7 @@ else
We can't simply define LARGE_OFF_T to be 9223372036854775807,
since some C++ compilers masquerading as C compilers
incorrectly reject 9223372036854775807. */
#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
&& LARGE_OFF_T % 2147483647 == 1)
? 1 : -1];
@@ -4626,7 +4618,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
We can't simply define LARGE_OFF_T to be 9223372036854775807,
since some C++ compilers masquerading as C compilers
incorrectly reject 9223372036854775807. */
#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
&& LARGE_OFF_T % 2147483647 == 1)
? 1 : -1];
@@ -5741,7 +5733,7 @@ if test "${with_libnl+set}" = set; then :
fi
if test x$with_libnl != xno ; then
if test x$with_libnl = xyes ; then
have_any_nl="no"
incdir=-I/usr/include/libnl3
@@ -6980,263 +6972,6 @@ $as_echo "no" >&6; }
fi
fi
#
# Look for {f}lex.
#
for ac_prog in flex lex
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_prog_LEX+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$LEX"; then
ac_cv_prog_LEX="$LEX" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_LEX="$ac_prog"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
fi
fi
LEX=$ac_cv_prog_LEX
if test -n "$LEX"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $LEX" >&5
$as_echo "$LEX" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
test -n "$LEX" && break
done
test -n "$LEX" || LEX=":"
if test "x$LEX" != "x:"; then
cat >conftest.l <<_ACEOF
%%
a { ECHO; }
b { REJECT; }
c { yymore (); }
d { yyless (1); }
e { /* IRIX 6.5 flex 2.5.4 underquotes its yyless argument. */
yyless ((input () != 0)); }
f { unput (yytext[0]); }
. { BEGIN INITIAL; }
%%
#ifdef YYTEXT_POINTER
extern char *yytext;
#endif
int
main (void)
{
return ! yylex () + ! yywrap ();
}
_ACEOF
{ { ac_try="$LEX conftest.l"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
$as_echo "$ac_try_echo"; } >&5
(eval "$LEX conftest.l") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking lex output file root" >&5
$as_echo_n "checking lex output file root... " >&6; }
if ${ac_cv_prog_lex_root+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -f lex.yy.c; then
ac_cv_prog_lex_root=lex.yy
elif test -f lexyy.c; then
ac_cv_prog_lex_root=lexyy
else
as_fn_error $? "cannot find output from $LEX; giving up" "$LINENO" 5
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_lex_root" >&5
$as_echo "$ac_cv_prog_lex_root" >&6; }
LEX_OUTPUT_ROOT=$ac_cv_prog_lex_root
if test -z "${LEXLIB+set}"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking lex library" >&5
$as_echo_n "checking lex library... " >&6; }
if ${ac_cv_lib_lex+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_save_LIBS=$LIBS
ac_cv_lib_lex='none needed'
for ac_lib in '' -lfl -ll; do
LIBS="$ac_lib $ac_save_LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
`cat $LEX_OUTPUT_ROOT.c`
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_lib_lex=$ac_lib
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
test "$ac_cv_lib_lex" != 'none needed' && break
done
LIBS=$ac_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_lex" >&5
$as_echo "$ac_cv_lib_lex" >&6; }
test "$ac_cv_lib_lex" != 'none needed' && LEXLIB=$ac_cv_lib_lex
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether yytext is a pointer" >&5
$as_echo_n "checking whether yytext is a pointer... " >&6; }
if ${ac_cv_prog_lex_yytext_pointer+:} false; then :
$as_echo_n "(cached) " >&6
else
# POSIX says lex can declare yytext either as a pointer or an array; the
# default is implementation-dependent. Figure out which it is, since
# not all implementations provide the %pointer and %array declarations.
ac_cv_prog_lex_yytext_pointer=no
ac_save_LIBS=$LIBS
LIBS="$LEXLIB $ac_save_LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#define YYTEXT_POINTER 1
`cat $LEX_OUTPUT_ROOT.c`
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_prog_lex_yytext_pointer=yes
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_lex_yytext_pointer" >&5
$as_echo "$ac_cv_prog_lex_yytext_pointer" >&6; }
if test $ac_cv_prog_lex_yytext_pointer = yes; then
$as_echo "#define YYTEXT_POINTER 1" >>confdefs.h
fi
rm -f conftest.l $LEX_OUTPUT_ROOT.c
fi
if test "$LEX" = ":"; then
as_fn_error $? "Neither flex nor lex was found." "$LINENO" 5
fi
#
# Make sure {f}lex supports the -P, --header-file, and --nounput flags
# and supports processing our scanner.l.
#
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for capable lex" >&5
$as_echo_n "checking for capable lex... " >&6; }
if ${tcpdump_cv_capable_lex+:} false; then :
$as_echo_n "(cached) " >&6
else
if $LEX -P pcap_ --header-file=/dev/null --nounput -t $srcdir/scanner.l > /dev/null 2>&1; then
tcpdump_cv_capable_lex=yes
else
tcpdump_cv_capable_lex=insufficient
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcpdump_cv_capable_lex" >&5
$as_echo "$tcpdump_cv_capable_lex" >&6; }
if test $tcpdump_cv_capable_lex = insufficient ; then
as_fn_error $? "$LEX is insufficient to compile libpcap.
libpcap requires Flex 2.5.31 or later, or a compatible version of lex." "$LINENO" 5
fi
#
# Look for yacc/bison/byacc.
#
for ac_prog in 'bison -y' byacc
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_prog_YACC+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$YACC"; then
ac_cv_prog_YACC="$YACC" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_YACC="$ac_prog"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
fi
fi
YACC=$ac_cv_prog_YACC
if test -n "$YACC"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $YACC" >&5
$as_echo "$YACC" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
test -n "$YACC" && break
done
test -n "$YACC" || YACC="yacc"
#
# Make sure it supports the -p flag and supports processing our
# grammar.y.
#
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for capable yacc/bison" >&5
$as_echo_n "checking for capable yacc/bison... " >&6; }
if ${tcpdump_cv_capable_yacc+:} false; then :
$as_echo_n "(cached) " >&6
else
if $YACC -p pcap_ -o /dev/null $srcdir/grammar.y >/dev/null 2>&1; then
tcpdump_cv_capable_yacc=yes
else
tcpdump_cv_capable_yacc=insufficient
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcpdump_cv_capable_yacc" >&5
$as_echo "$tcpdump_cv_capable_yacc" >&6; }
if test $tcpdump_cv_capable_yacc = insufficient ; then
as_fn_error $? "$YACC is insufficient to compile libpcap.
libpcap requires Bison, Berkeley YACC, or another YACC compatible with them." "$LINENO" 5
fi
#
# Assume, by default, no support for shared libraries and V7/BSD convention
# for man pages (file formats in section 5, miscellaneous info in section 7).
@@ -7517,7 +7252,7 @@ if test "${enable_shared+set}" = set; then :
enableval=$enable_shared;
fi
test "x$enable_shared" = "xno" && DYEXT="none"
test "x$enable_shared" != "xyes" && DYEXT="none"
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
@@ -8401,13 +8136,11 @@ ln -s ${srcdir}/bpf/net net
# Check whether --enable-usb was given.
if test "${enable_usb+set}" = set; then :
enableval=$enable_usb;
else
enable_usb=yes
enable_usb=no
fi
@@ -8623,7 +8356,7 @@ fi
if test "${enable_bluetooth+set}" = set; then :
enableval=$enable_bluetooth;
else
enable_bluetooth=ifsupportavailable
enable_bluetooth=no
fi
@@ -8758,7 +8491,7 @@ fi
if test "${enable_dbus+set}" = set; then :
enableval=$enable_dbus;
else
enable_dbus=ifavailable
enable_dbus=no
fi