aboutsummaryrefslogtreecommitdiff
path: root/devel/llvm-devel
diff options
context:
space:
mode:
authorBrooks Davis <brooks@FreeBSD.org>2021-03-12 22:05:10 +0000
committerBrooks Davis <brooks@FreeBSD.org>2021-03-12 22:05:10 +0000
commit3e08f34636a5d13c11ad5c660cdb7cf62162f928 (patch)
tree8742613a2534d4b267869e715ed7551152391132 /devel/llvm-devel
parentc4307fbea506d8eb5fb0fde74431631e41eeaa91 (diff)
downloadports-3e08f34636a5d13c11ad5c660cdb7cf62162f928.tar.gz
ports-3e08f34636a5d13c11ad5c660cdb7cf62162f928.zip
llvm-devel: Handle unsupported options centrally
Use a loop over all possible options to comment out PLIST entries for options not supported on the current platform. Sponsored by: DARPA, AFRL
Notes
Notes: svn path=/head/; revision=568205
Diffstat (limited to 'devel/llvm-devel')
-rw-r--r--devel/llvm-devel/Makefile23
1 files changed, 7 insertions, 16 deletions
diff --git a/devel/llvm-devel/Makefile b/devel/llvm-devel/Makefile
index 244c63659728..285888d62d47 100644
--- a/devel/llvm-devel/Makefile
+++ b/devel/llvm-devel/Makefile
@@ -82,6 +82,8 @@ OPTIONS_DEFAULT_powerpc64= ${OPTIONS_DEFAULT_powerpc64_${OSREL:R}} OPENMP
OPTIONS_DEFAULT_powerpc64_13= GOLD
OPTIONS_DEFAULT_powerpc64_14= GOLD
OPTIONS_SUB= yes
+_ALL_OPTIONS= CLANG COMPILER_RT DOCS EXTRAS FLANG GOLD LIT LLD LLDB MLIR \
+ OPENMP
# Pre-declared for options framework
LIB_DEPENDS=
@@ -381,23 +383,12 @@ _COMPILER_RT_LIBS+= \
libclang_rt.ubsan_standalone_cxx-i386.a
.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}|' \