git: 35bf4d1c97b8 - main - devel/google-perftools: Add PROFILER options

From: Yuri Victorovich <yuri_at_FreeBSD.org>
Date: Tue, 19 Jul 2022 00:46:34 UTC
The branch main has been updated by yuri:

URL: https://cgit.FreeBSD.org/ports/commit/?id=35bf4d1c97b88bec3bf690701f72113a2b60d78f

commit 35bf4d1c97b88bec3bf690701f72113a2b60d78f
Author:     Yuri Victorovich <yuri@FreeBSD.org>
AuthorDate: 2022-07-19 00:13:48 +0000
Commit:     Yuri Victorovich <yuri@FreeBSD.org>
CommitDate: 2022-07-19 00:46:30 +0000

    devel/google-perftools: Add PROFILER options
    
    Option for CPU profiler is mostly to isolate situations when
    configure fails to enable it, like on armv6, armv7.
    
    Reference: https://github.com/gperftools/gperftools/issues/1355#issuecomment-1188455253
---
 devel/google-perftools/Makefile  | 17 ++++++++++++++++-
 devel/google-perftools/pkg-plist | 18 +++++++++---------
 2 files changed, 25 insertions(+), 10 deletions(-)

diff --git a/devel/google-perftools/Makefile b/devel/google-perftools/Makefile
index 8955117cf6bd..cd21d6bcff71 100644
--- a/devel/google-perftools/Makefile
+++ b/devel/google-perftools/Makefile
@@ -3,6 +3,7 @@
 PORTNAME=	google-perftools
 DISTVERSIONPREFIX=	gperftools-
 DISTVERSION=	2.10
+PORTREVISION=	1
 CATEGORIES=	devel
 MASTER_SITES=	https://github.com/gperftools/gperftools/releases/download/gperftools-${PORTVERSION}/
 DISTNAME=	gperftools-${PORTVERSION}
@@ -25,11 +26,25 @@ LIBS+=		-lexecinfo
 
 DOCSDIR=	${PREFIX}/share/doc/gperftools
 
-OPTIONS_DEFINE=		DOCS
+OPTIONS_DEFINE=		DOCS PROFILER
 OPTIONS_SINGLE=		PAGESIZE ALIGN
 OPTIONS_SINGLE_ALIGN=	ALIGN8 ALIGN16
 OPTIONS_SINGLE_PAGESIZE=	PAGE8K PAGE32K PAGE64K
 OPTIONS_DEFAULT=	PAGE8K ALIGN16
+OPTIONS_DEFAULT_amd64=		PROFILER
+OPTIONS_DEFINE_aarch64=		PROFILER
+OPTIONS_DEFINE_amd64=		PROFILER
+OPTIONS_DEFINE_armv6=		# PROFILER is disabled: WARNING: Could not find the PC. Will not try to compile libprofiler.
+OPTIONS_DEFINE_armv7=		# PROFILER is disabled: WARNING: Could not find the PC. Will not try to compile libprofiler.
+OPTIONS_DEFINE_i386=		PROFILER
+OPTIONS_DEFINE_powerpc=		PROFILER
+OPTIONS_DEFINE_powerpc64=	PROFILER
+OPTIONS_DEFINE_powerpc64le=	PROFILER
+OPTIONS_DEFINE_riscv64=		PROFILER
+OPTIONS_SUB=		yes
+
+PROFILER_DESC=		Enable CPU profiler
+PROFILER_CONFIGURE_ENABLE=	cpu-profiler
 
 ALIGN_DESC=	The tcmalloc allocation alignment
 ALIGN8_DESC=	8 bytes allocation alignment
diff --git a/devel/google-perftools/pkg-plist b/devel/google-perftools/pkg-plist
index f7d38a336a88..b84c09f06679 100644
--- a/devel/google-perftools/pkg-plist
+++ b/devel/google-perftools/pkg-plist
@@ -16,21 +16,21 @@ include/gperftools/malloc_extension_c.h
 include/gperftools/malloc_hook.h
 include/gperftools/malloc_hook_c.h
 include/gperftools/nallocx.h
-include/gperftools/profiler.h
+%%PROFILER%%include/gperftools/profiler.h
 include/gperftools/stacktrace.h
 include/gperftools/tcmalloc.h
-lib/libprofiler.a
-lib/libprofiler.so
-lib/libprofiler.so.0
-lib/libprofiler.so.0.5.5
+%%PROFILER%%lib/libprofiler.a
+%%PROFILER%%lib/libprofiler.so
+%%PROFILER%%lib/libprofiler.so.0
+%%PROFILER%%lib/libprofiler.so.0.5.5
 lib/libtcmalloc.a
 lib/libtcmalloc.so
 lib/libtcmalloc.so.4
 lib/libtcmalloc.so.4.5.10
-lib/libtcmalloc_and_profiler.a
-lib/libtcmalloc_and_profiler.so
-lib/libtcmalloc_and_profiler.so.4
-lib/libtcmalloc_and_profiler.so.4.6.5
+%%PROFILER%%lib/libtcmalloc_and_profiler.a
+%%PROFILER%%lib/libtcmalloc_and_profiler.so
+%%PROFILER%%lib/libtcmalloc_and_profiler.so.4
+%%PROFILER%%lib/libtcmalloc_and_profiler.so.4.6.5
 lib/libtcmalloc_debug.a
 lib/libtcmalloc_debug.so
 lib/libtcmalloc_debug.so.4