db9771eaa0
only on the given archs. Taken from gcc4.port.mk ok sthen@
48 lines
966 B
Makefile
48 lines
966 B
Makefile
# $OpenBSD: clang.port.mk,v 1.3 2012/11/26 22:16:55 landry Exp $
|
|
|
|
MODCLANG_VERSION= 3.1
|
|
|
|
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
|