From cadd3b8fcb416b8474b91f237671b49bc7b834e6 Mon Sep 17 00:00:00 2001 From: Kyle Evans Date: Tue, 4 Aug 2020 02:47:24 +0000 Subject: [PATCH] bsdgrep: switch to libregex for GNU_GREP_COMPAT libregex is incomplete, but it's a bit less buggy than the in-base libgnuregex and mostly OK. While here, rename -DIWTH_GNU -> -DWITH_GNU_COMPAT; the option implies that we're compatible with the GNU counterpart, not that we're including GNU anything. (cherry picked from commit cab7d341dcd98138443bbdb51649f966093a3a84) --- usr.bin/grep/Makefile | 4 ++-- usr.bin/grep/grep.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/usr.bin/grep/Makefile b/usr.bin/grep/Makefile index c3b07b9252c..b51f51c8bd5 100644 --- a/usr.bin/grep/Makefile +++ b/usr.bin/grep/Makefile @@ -61,8 +61,8 @@ MLINKS+= grep.1 egrep.1 \ .endif .if ${MK_GNU_GREP_COMPAT} != "no" -CFLAGS+= -I${SYSROOT:U${DESTDIR}}/usr/include/gnu -DWITH_GNU -LIBADD+= gnuregex +CFLAGS+= -DWITH_GNU_COMPAT +LIBADD+= regex .endif HAS_TESTS= diff --git a/usr.bin/grep/grep.c b/usr.bin/grep/grep.c index a7ecc201557..96be836601a 100644 --- a/usr.bin/grep/grep.c +++ b/usr.bin/grep/grep.c @@ -555,7 +555,7 @@ main(int argc, char *argv[]) filebehave = FILE_MMAP; break; case 'V': -#ifdef WITH_GNU +#ifdef WITH_GNU_COMPAT printf(errstr[9], getprogname(), VERSION); #else printf(errstr[8], getprogname(), VERSION); -- 2.45.0