aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmmanuel Vadot <manu@FreeBSD.org>2021-09-14 10:08:58 +0000
committerEmmanuel Vadot <manu@FreeBSD.org>2021-09-14 10:08:58 +0000
commit4f3befc2a362bf8fb86c83a99015df1d45c28bff (patch)
treeca97663845b6b8c06abe304f8e66f75a0f08539c
parent8b546c40d03aa6f026ab51e1f26fe58f640edaba (diff)
downloadports-4f3befc2a362bf8fb86c83a99015df1d45c28bff.tar.gz
ports-4f3befc2a362bf8fb86c83a99015df1d45c28bff.zip
ports-mgmt/pkg-devel: Add an option for building with sanitizer
Sanitizers helps finding problems, add an option to pkg-devel to be able to compile with them.
-rw-r--r--ports-mgmt/pkg-devel/Makefile7
1 files changed, 6 insertions, 1 deletions
diff --git a/ports-mgmt/pkg-devel/Makefile b/ports-mgmt/pkg-devel/Makefile
index 7b9f6ddf4cf9..4094f611af20 100644
--- a/ports-mgmt/pkg-devel/Makefile
+++ b/ports-mgmt/pkg-devel/Makefile
@@ -25,7 +25,8 @@ CONFIGURE_ENV= CC_FOR_BUILD="${CC}"
# so that pkg-static is used from the wrkdir
USE_SUBMAKE= yes
-OPTIONS_DEFINE= DOCS
+OPTIONS_DEFINE= DOCS SAN
+SAN_DESC= Enable sanitizers (ASAN and UBSAN)
.if !exists(/usr/include/jail.h)
EXTRA_PATCHES= ${FILESDIR}/extra-patch-docs_pkg.8
@@ -33,6 +34,10 @@ EXTRA_PATCHES= ${FILESDIR}/extra-patch-docs_pkg.8
.include <bsd.port.pre.mk>
+.if ${PORT_OPTIONS:MSAN}
+CONFIGURE_ARGS+= --with-asan --with-ubsan
+.endif
+
# TODO: activate in april 2021
#.if ${OPSYS} == FreeBSD && ${OSVERSION} > 1400000
#CONFIGURE_ARGS+= --default-format=tzst