aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrooks Davis <brooks@FreeBSD.org>2021-04-07 17:26:40 +0000
committerJan Beich <jbeich@FreeBSD.org>2021-04-23 16:11:02 +0000
commit5390741fcfd802145f2cd2cdff5bceb292594f1e (patch)
tree5839a7a0d052a358a1fe2f5b07327e187d12b462
parent0854e2520786948b8ed964f8711e1889d98d881a (diff)
downloadports-5390741fcfd802145f2cd2cdff5bceb292594f1e.tar.gz
ports-5390741fcfd802145f2cd2cdff5bceb292594f1e.zip
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. (cherry picked from commit c9a3a7442f64da0f932d4e6934218c1acd684d25)
-rw-r--r--devel/llvm12/Makefile23
1 files changed, 7 insertions, 16 deletions
diff --git a/devel/llvm12/Makefile b/devel/llvm12/Makefile
index 67f4d5f2764e..7ef190aa2f48 100644
--- a/devel/llvm12/Makefile
+++ b/devel/llvm12/Makefile
@@ -90,6 +90,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
@@ -437,23 +439,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}|' \