Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 7 Apr 2021 17:26:46 GMT
From:      Brooks Davis <brooks@FreeBSD.org>
To:        ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org
Subject:   git: c9a3a7442f64 - main - llvm12: rework handling undefined options
Message-ID:  <202104071726.137HQk6J068597@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by brooks:

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

commit c9a3a7442f64da0f932d4e6934218c1acd684d25
Author:     Brooks Davis <brooks@FreeBSD.org>
AuthorDate: 2021-04-07 17:26:40 +0000
Commit:     Brooks Davis <brooks@FreeBSD.org>
CommitDate: 2021-04-07 17:26:40 +0000

    llvm12: rework handling undefined options
    
    Define a list of options and for any that aren't defined for the current
    architecture add a PLIST_SUB entry as through the option were defined and
    disabled.
---
 devel/llvm12/Makefile | 23 +++++++----------------
 1 file changed, 7 insertions(+), 16 deletions(-)

diff --git a/devel/llvm12/Makefile b/devel/llvm12/Makefile
index 54333e8ace78..fca19e1ae6d0 100644
--- a/devel/llvm12/Makefile
+++ b/devel/llvm12/Makefile
@@ -89,6 +89,8 @@ OPTIONS_DEFAULT_powerpc64le=     GOLD OPENMP
 OPTIONS_SINGLE=		BACKENDS
 OPTIONS_SINGLE_BACKENDS=BE_FREEBSD BE_NATIVE BE_STANDARD
 OPTIONS_SUB=	yes
+# All non-backend options
+_ALL_OPTIONS=	CLANG COMPILER_RT DOCS EXTRAS GOLD LIT LLD LLDB PYCLANG OPENMP
 
 BE_AMDGPU_DESC=		AMD GPU backend (required by mesa)
 BE_FREEBSD_DESC=	Backends for FreeBSD architectures
@@ -436,23 +438,12 @@ CONFIGURE_ENV+=	COMPILER_PATH=${LOCALBASE}/bin
 MAKE_ENV+=	COMPILER_PATH=${LOCALBASE}/bin
 .endif
 
-.if ! ${OPTIONS_DEFINE:MCOMPILER_RT}
-# Hack to disable COMPILER_RT in plist of unsupported architectures
-PLIST_SUB+=	COMPILER_RT="@comment "
-.else
-.endif
-
-.if ! ${OPTIONS_DEFINE:MGOLD}
-# Hack to disable GOLD in plist of unsupported architectures
-PLIST_SUB+=	GOLD="@comment "
-.else
-.endif
-
-.if ! ${OPTIONS_DEFINE:MOPENMP}
-# Hack to disable OPENMP in plist of unsupported architectures
-PLIST_SUB+=	OPENMP="@comment "
-.else
+# Comment out plist entries for unsupported options.
+.for opt in ${_ALL_OPTIONS}
+.if !${OPTIONS_DEFINE:M${opt}}
+PLIST_SUB+=     ${opt}="@comment "
 .endif
+.endfor
 
 post-patch:
 	${REINPLACE_CMD} -e 's|import lit|import lit${LLVM_SUFFIX}|' \



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202104071726.137HQk6J068597>