git: c9a3a7442f64 - main - llvm12: rework handling undefined options
Brooks Davis
brooks at FreeBSD.org
Wed Apr 7 17:26:47 UTC 2021
The branch main has been updated by brooks:
URL: https://cgit.FreeBSD.org/ports/commit/?id=c9a3a7442f64da0f932d4e6934218c1acd684d25
commit c9a3a7442f64da0f932d4e6934218c1acd684d25
Author: Brooks Davis <brooks at FreeBSD.org>
AuthorDate: 2021-04-07 17:26:40 +0000
Commit: Brooks Davis <brooks at 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}|' \
More information about the dev-commits-ports-all
mailing list