Skip to content

Commit

Permalink
llvm12: rework handling undefined options
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
brooksdavis committed Apr 7, 2021
1 parent 95d2311 commit c9a3a74
Showing 1 changed file with 7 additions and 16 deletions.
23 changes: 7 additions & 16 deletions devel/llvm12/Makefile
Expand Up @@ -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
Expand Down Expand Up @@ -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}|' \
Expand Down

0 comments on commit c9a3a74

Please sign in to comment.