openbsd-ports/lang/clang/clang.port.mk

48 lines
964 B
Makefile

# $OpenBSD: clang.port.mk,v 1.4 2012/12/23 21:36:33 brad Exp $
MODCLANG_VERSION= 3.2
MODCLANG_ARCHS ?=
MODCLANG_LANGS ?=
.if !${MODCLANG_LANGS:L:Mc}
# Always include support for this
MODCLANG_LANGS += c
.endif
_MODCLANG_OKAY = c c++
.for _l in ${MODCLANG_LANGS:L}
. if !${_MODCLANG_OKAY:M${_l}}
ERRORS += "Fatal: unknown language ${_l}"
. endif
.endfor
_MODCLANG_ARCH_USES = No
.if ${MODCLANG_ARCHS:L} != ""
. for _i in ${MODCLANG_ARCHS}
. if !empty(MACHINE_ARCH:M${_i})
_MODCLANG_ARCH_USES = Yes
. endif
. endfor
.endif
_MODCLANG_LINKS =
.if ${_MODCLANG_ARCH_USES:L} == "yes"
BUILD_DEPENDS += devel/llvm>=${MODCLANG_VERSION}
_MODCLANG_LINKS = clang gcc clang cc
.if ${MODCLANG_LANGS:L:Mc++}
_MODCLANG_LINKS += clang++ g++ clang++ c++
.endif
.endif
.if !empty(_MODCLANG_LINKS)
. for _src _dest in ${_MODCLANG_LINKS}
MODCLANG_post-patch += ln -sf ${LOCALBASE}/bin/${_src} ${WRKDIR}/bin/${_dest};
. endfor
.endif
SUBST_VARS+= MODCLANG_VERSION