1
0
mirror of https://github.com/nmap/nmap.git synced 2026-02-02 11:39:03 +00:00

libpcap: Don't autogenerate Lex/Yacc files

This commit is contained in:
dmiller
2018-07-18 13:41:38 +00:00
parent 3fc4a6fc95
commit 87107dd6b1
2 changed files with 10 additions and 60 deletions

View File

@@ -69,9 +69,6 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
RANLIB = @RANLIB@
LEX = @LEX@
YACC = @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.
@@ -156,7 +153,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 +357,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,22 +449,11 @@ libpcap.shareda: $(OBJ)
#
libpcap.none:
scanner.c: $(srcdir)/scanner.l
$(LEX) -P pcap_ --header-file=scanner.h --nounput -o scanner.c $<
scanner.h: scanner.c
## Recover from the removal of $@
@if test -f $@; then :; else \
rm -f scanner.c; \
$(MAKE) $(MAKEFLAGS) scanner.c; \
fi
scanner.o: scanner.c grammar.h
$(CC) $(FULL_CFLAGS) -c scanner.c
pcap.o: pcap_version.h
grammar.c: $(srcdir)/grammar.y
$(YACC) -p pcap_ -o grammar.c -d $<
grammar.h: grammar.c
## Recover from the removal of $@
@if test -f $@; then :; else \

View File

@@ -1140,49 +1140,6 @@ if test "$want_turbocap" != no; then
fi
fi
#
# Look for {f}lex.
#
AC_PROG_LEX
if test "$LEX" = ":"; then
AC_MSG_ERROR([Neither flex nor lex was found.])
fi
#
# Make sure {f}lex supports the -P, --header-file, and --nounput flags
# and supports processing our scanner.l.
#
AC_CACHE_CHECK([for capable lex], tcpdump_cv_capable_lex,
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)
if test $tcpdump_cv_capable_lex = insufficient ; then
AC_MSG_ERROR([$LEX is insufficient to compile libpcap.
libpcap requires Flex 2.5.31 or later, or a compatible version of lex.])
fi
#
# Look for yacc/bison/byacc.
#
AC_PROG_YACC
#
# Make sure it supports the -p flag and supports processing our
# grammar.y.
#
AC_CACHE_CHECK([for capable yacc/bison], tcpdump_cv_capable_yacc,
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)
if test $tcpdump_cv_capable_yacc = insufficient ; then
AC_MSG_ERROR([$YACC is insufficient to compile libpcap.
libpcap requires Bison, Berkeley YACC, or another YACC compatible with them.])
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).
@@ -1459,13 +1416,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)