Replace nslexer.l->nslexer.c custom rule with a -D CFLAG.

This avoids reproducing the lex logic which had dependencies set wrong
and used an intermediate file for modifying the YY_BUF_SIZE.

This has only been possible since flex 2.5.37 was imported in r250873,
which uses #ifndef YY_BUF_SIZE.

MFC after:	2 weeks
Sponsored by:	EMC / Isilon Storage Division
This commit is contained in:
Bryan Drewery 2016-01-27 01:33:23 +00:00
parent bde5c8997e
commit 545d341d77

View File

@ -12,7 +12,7 @@ SRCS+= base64.c ether_addr.c eui64.c \
getproto.c getprotoent.c getprotoname.c getservent.c \
if_indextoname.c if_nameindex.c if_nametoindex.c \
ip6opt.c linkaddr.c map_v4v6.c name6.c ntoh.c \
nsdispatch.c nslexer.c nsparser.y nss_compat.c \
nsdispatch.c nslexer.l nsparser.y nss_compat.c \
rcmd.c rcmdsh.c recv.c rthdr.c sctp_sys_calls.c send.c \
sockatmark.c sourcefilter.c vars.c
@ -34,13 +34,8 @@ CFLAGS+=-I${LIBC_SRCTOP}/resolv
YFLAGS+=-p_nsyy
LFLAGS+=-P_nsyy
CLEANFILES+=nslexer.c nslexer.c.*
nslexer.c: nslexer.l
${LEX} ${LFLAGS} -o${.TARGET}.tmp1 ${.IMPSRC}
sed -e '/YY_BUF_SIZE/s/16384/1024/' ${.TARGET}.tmp1 >${.TARGET}.tmp2
rm -f ${.TARGET}.tmp1
mv -f ${.TARGET}.tmp2 ${.TARGET}
CFLAGS.nslexer.c= -DYY_BUF_SIZE=1024
CFLAGS+= ${CFLAGS.${.IMPSRC:T}}
MAN+= byteorder.3 ethers.3 eui64.3 \
getaddrinfo.3 gai_strerror.3 gethostbyname.3 \