git: cd1ebf9c7ee8 - stable/13 - usr.bin: hook wg(8) up to the build

From: Kyle Evans <kevans_at_FreeBSD.org>
Date: Sun, 13 Nov 2022 05:38:03 UTC
The branch stable/13 has been updated by kevans:

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

commit cd1ebf9c7ee83efc2bcbc3e7a1fe40869698b3f9
Author:     Kyle Evans <kevans@FreeBSD.org>
AuthorDate: 2022-10-29 03:04:56 +0000
Commit:     Kyle Evans <kevans@FreeBSD.org>
CommitDate: 2022-11-13 05:37:05 +0000

    usr.bin: hook wg(8) up to the build
    
    wg(8) is used to manage WireGuard interfaces; see wg(4) and wg(8) both
    for more details and usage examples.
    
    (cherry picked from commit 0283826706706c598fff86e16c42604841c1a05a)
---
 usr.bin/Makefile    |  1 +
 usr.bin/wg/Makefile | 41 +++++++++++++++++++++++++++++++++++++++++
 2 files changed, 42 insertions(+)

diff --git a/usr.bin/Makefile b/usr.bin/Makefile
index fc6b94adf4c2..cd0e6730d568 100644
--- a/usr.bin/Makefile
+++ b/usr.bin/Makefile
@@ -177,6 +177,7 @@ SUBDIR=	alias \
 	w \
 	wall \
 	wc \
+	wg \
 	what \
 	whereis \
 	which \
diff --git a/usr.bin/wg/Makefile b/usr.bin/wg/Makefile
new file mode 100644
index 000000000000..55cf5fccf53a
--- /dev/null
+++ b/usr.bin/wg/Makefile
@@ -0,0 +1,41 @@
+
+PROG=	wg
+MAN=	wg.8
+
+LIBADD=	nv
+
+.PATH: ${SRCTOP}/contrib/wireguard-tools
+.PATH: ${SRCTOP}/contrib/wireguard-tools/man
+
+SRCS+=	wg.c
+
+SRCS+=	config.c
+SRCS+=	encoding.c
+SRCS+=	ipc.c
+SRCS+=	terminal.c
+
+SRCS+=	curve25519.c
+
+# Subcommands
+SRCS+=	show.c
+SRCS+=	showconf.c
+SRCS+=	set.c
+SRCS+=	setconf.c
+SRCS+=	genkey.c
+SRCS+=	pubkey.c
+
+# Base should pull RUNSTATEDIR from paths.h, _PATH_VARRUN
+CFLAGS+=	-include paths.h
+CFLAGS+=	-DRUNSTATEDIR="_PATH_VARRUN"
+
+# Not going to change this one.
+CWARNFLAGS.curve25519.c+=	-Wno-shadow
+
+# sockaddr{,_in} alignment
+CWARNFLAGS.config.c+=	-Wno-cast-align
+CWARNFLAGS.ipc.c+=	-Wno-cast-align
+
+# qsort comparator
+CWARNFLAGS.show.c+=	-Wno-cast-qual
+
+.include <bsd.prog.mk>