git: cadd3b8fcb41 - stable/12 - bsdgrep: switch to libregex for GNU_GREP_COMPAT

Kyle Evans kevans at FreeBSD.org
Tue Dec 29 16:28:59 UTC 2020


The branch stable/12 has been updated by kevans:

URL: https://cgit.FreeBSD.org/src/commit/?id=cadd3b8fcb416b8474b91f237671b49bc7b834e6

commit cadd3b8fcb416b8474b91f237671b49bc7b834e6
Author:     Kyle Evans <kevans at FreeBSD.org>
AuthorDate: 2020-08-04 02:47:24 +0000
Commit:     Kyle Evans <kevans at FreeBSD.org>
CommitDate: 2020-12-29 15:49:42 +0000

    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 c3b07b9252c6..b51f51c8bd5e 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 a7ecc2015571..96be836601ad 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);


More information about the dev-commits-src-all mailing list