@@ -665,6 +665,7 @@ DEPENDENCY_CFLAG
665
665
LN_S
666
666
AR
667
667
RANLIB
668
+ REENTRANT_PARSER
668
669
YFLAGS
669
670
YACC
670
671
LEXLIB
8514
8515
#
8515
8516
# Look for yacc/bison/byacc.
8516
8517
#
8517
- for ac_prog in ' bison -y' byacc
8518
+ for ac_prog in ' boson -y' byacc
8518
8519
do
8519
8520
# Extract the first word of "$ac_prog", so it can be a program name with args.
8520
8521
set dummy $ac_prog ; ac_word=$2
@@ -8558,28 +8559,59 @@ done
8558
8559
test -n " $YACC " || YACC=" yacc"
8559
8560
8560
8561
8561
- #
8562
- # Make sure it supports the -p flag and supports processing our
8563
- # grammar.y.
8564
- #
8565
- { $as_echo " $as_me :${as_lineno-$LINENO } : checking for capable yacc/bison" >&5
8566
- $as_echo_n " checking for capable yacc/bison... " >&6 ; }
8562
+ case " $YACC " in
8563
+
8564
+ * yacc)
8565
+ #
8566
+ # Make sure this is Berkeley YACC, not AT&T YACC; the latter
8567
+ # doesn't support reentrant parsers. Run it with "-V";
8568
+ # that succeeds and reports the version number with
8569
+ # Berkeley YACC, but will (probably) fail with various
8570
+ # vendor flavors of AT&T YACC.
8571
+ #
8572
+ { $as_echo " $as_me :${as_lineno-$LINENO } : checking for capable yacc" >&5
8573
+ $as_echo_n " checking for capable yacc... " >&6 ; }
8567
8574
if ${tcpdump_cv_capable_yacc+: } false ; then :
8568
8575
$as_echo_n " (cached) " >&6
8569
8576
else
8570
- if $YACC -p pcap_ -o /dev/null $srcdir /grammar.y > /dev/null 2>&1 ; then
8571
- tcpdump_cv_capable_yacc=yes
8572
- else
8573
- tcpdump_cv_capable_yacc=insufficient
8574
- fi
8577
+ if $YACC -V > /dev/null 2>&1 ; then
8578
+ tcpdump_cv_capable_yacc=yes
8579
+ else
8580
+ tcpdump_cv_capable_yacc=insufficient
8581
+ fi
8575
8582
fi
8576
8583
{ $as_echo " $as_me :${as_lineno-$LINENO } : result: $tcpdump_cv_capable_yacc " >&5
8577
8584
$as_echo " $tcpdump_cv_capable_yacc " >&6 ; }
8578
- if test $tcpdump_cv_capable_yacc = insufficient ; then
8579
- as_fn_error $? " $YACC is insufficient to compile libpcap.
8585
+ if test $tcpdump_cv_capable_yacc = insufficient ; then
8586
+ as_fn_error $? " $YACC is insufficient to compile libpcap.
8580
8587
libpcap requires Bison, a newer version of Berkeley YACC with support
8581
8588
for reentrant parsers, or another YACC compatible with them." " $LINENO " 5
8582
- fi
8589
+ fi
8590
+
8591
+ #
8592
+ # Berkeley YACC doesn't support "%define api.pure", so use
8593
+ # "%pure-parser".
8594
+ #
8595
+ REENTRANT_PARSER=" %pure-parser"
8596
+ ;;
8597
+
8598
+ * )
8599
+ #
8600
+ # Bison prior to 2.4(.1) doesn't support "%define api.pure", so use
8601
+ # "%pure-parser".
8602
+ #
8603
+ bison_major_version=` $YACC -V | sed -n ' s/.* \([1-9][0-9]*\)\.[1-9][0-9.]*/\1/p' `
8604
+ bison_minor_version=` $YACC -V | sed -n ' s/.* [1-9][0-9]*\.\([1-9][0-9]*\).*/\1/p' `
8605
+ if test " $bison_major_version " -lt 2 -o \
8606
+ \( " $bison_major_version " -eq 2 -a " $bison_major_version " -lt 4 \)
8607
+ then
8608
+ REENTRANT_PARSER=" %pure-parser"
8609
+ else
8610
+ REENTRANT_PARSER=" %define api.pure"
8611
+ fi
8612
+ ;;
8613
+ esac
8614
+
8583
8615
8584
8616
#
8585
8617
# Do various checks for various OSes and versions of those OSes.
@@ -11845,7 +11877,7 @@ ac_config_headers="$ac_config_headers config.h"
11845
11877
11846
11878
ac_config_commands=" $ac_config_commands default-1"
11847
11879
11848
- ac_config_files=" $ac_config_files Makefile pcap-filter.manmisc pcap-linktype.manmisc pcap-tstamp.manmisc pcap-savefile.manfile pcap.3pcap pcap_compile.3pcap pcap_datalink.3pcap pcap_dump_open.3pcap pcap_get_tstamp_precision.3pcap pcap_list_datalinks.3pcap pcap_list_tstamp_types.3pcap pcap_open_dead.3pcap pcap_open_offline.3pcap pcap_set_immediate_mode.3pcap pcap_set_tstamp_precision.3pcap pcap_set_tstamp_type.3pcap rpcapd/Makefile rpcapd/rpcapd.manadmin rpcapd/rpcapd-config.manfile testprogs/Makefile"
11880
+ ac_config_files=" $ac_config_files Makefile grammar.y pcap-filter.manmisc pcap-linktype.manmisc pcap-tstamp.manmisc pcap-savefile.manfile pcap.3pcap pcap_compile.3pcap pcap_datalink.3pcap pcap_dump_open.3pcap pcap_get_tstamp_precision.3pcap pcap_list_datalinks.3pcap pcap_list_tstamp_types.3pcap pcap_open_dead.3pcap pcap_open_offline.3pcap pcap_set_immediate_mode.3pcap pcap_set_tstamp_precision.3pcap pcap_set_tstamp_type.3pcap rpcapd/Makefile rpcapd/rpcapd.manadmin rpcapd/rpcapd-config.manfile testprogs/Makefile"
11849
11881
11850
11882
cat > confcache << \_ACEOF
11851
11883
# This file is a shell script that caches the results of configure
@@ -12549,6 +12581,7 @@ do
12549
12581
" config.h" ) CONFIG_HEADERS=" $CONFIG_HEADERS config.h" ;;
12550
12582
" default-1" ) CONFIG_COMMANDS=" $CONFIG_COMMANDS default-1" ;;
12551
12583
" Makefile" ) CONFIG_FILES=" $CONFIG_FILES Makefile" ;;
12584
+ " grammar.y" ) CONFIG_FILES=" $CONFIG_FILES grammar.y" ;;
12552
12585
" pcap-filter.manmisc" ) CONFIG_FILES=" $CONFIG_FILES pcap-filter.manmisc" ;;
12553
12586
" pcap-linktype.manmisc" ) CONFIG_FILES=" $CONFIG_FILES pcap-linktype.manmisc" ;;
12554
12587
" pcap-tstamp.manmisc" ) CONFIG_FILES=" $CONFIG_FILES pcap-tstamp.manmisc" ;;
0 commit comments