Module Name:    src
Committed By:   rin
Date:           Fri Feb 26 02:54:21 UTC 2021

Modified Files:
        src/external/bsd/nvi/usr.bin/nvi: Makefile

Log Message:
Misc cleanups:

- built-in regex is required only when ${USE_WIDECHAR} == "yes"

- -DUSE_WIDECHAR cpp flag should be determined by ${USE_WIDECHAR},
  not ${USE_BUILTIN_REGEX}

- reduce .if -- .endif block for clarity


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/external/bsd/nvi/usr.bin/nvi/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/nvi/usr.bin/nvi/Makefile
diff -u src/external/bsd/nvi/usr.bin/nvi/Makefile:1.24 src/external/bsd/nvi/usr.bin/nvi/Makefile:1.25
--- src/external/bsd/nvi/usr.bin/nvi/Makefile:1.24	Fri Feb 26 00:41:56 2021
+++ src/external/bsd/nvi/usr.bin/nvi/Makefile	Fri Feb 26 02:54:21 2021
@@ -1,10 +1,15 @@
-#	$NetBSD: Makefile,v 1.24 2021/02/26 00:41:56 christos Exp $
+#	$NetBSD: Makefile,v 1.25 2021/02/26 02:54:21 rin Exp $
 
 .include <bsd.own.mk>
 
 USE_WIDECHAR?=yes
+
+.if ${USE_WIDECHAR} == "yes"
 USE_BUILTIN_REGEX?=yes	# Although our regex supports widechar nvi requires
 			# a non-standard API
+.else
+USE_BUILTIN_REGEX?=no
+.endif
 
 WARNS=	5
 
@@ -55,12 +60,13 @@ NOTUSED=ip_funcs.c ip_read.c ip_screen.c
 	ip_run.c ip_send.c ip_trans.c ipc_cmd.c ipc_method.c
 
 # For wide char support
-.if ${USE_BUILTIN_REGEX} == "yes"
-.if ${ACTIVE_CC} == "gcc"
-COPTS.regexec.c+=	-Wno-old-style-definition
+.if ${USE_WIDECHAR} == "yes"
+CPPFLAGS+=-DUSE_WIDECHAR
 .endif
+.if ${USE_BUILTIN_REGEX} == "yes"
 SRCS+=	regcomp.c regerror.c regexec.c regfree.c
-CPPFLAGS+=-I${DIST}/regex -D__REGEX_PRIVATE -DUSE_WIDECHAR
+CPPFLAGS+=-I${DIST}/regex -D__REGEX_PRIVATE
+COPTS.regexec.c+= ${${ACTIVE_CC} == "gcc":? -Wno-old-style-definition :}
 .endif
 
 # For db3 db1 emulation

Reply via email to