clang.port.mk 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. # $OpenBSD: clang.port.mk,v 1.22 2017/06/04 23:22:57 sthen Exp $
  2. MODCLANG_VERSION= 4.0.0
  3. MODCLANG_ARCHS ?=
  4. MODCLANG_LANGS ?=
  5. .if !${MODCLANG_LANGS:L:Mc}
  6. # Always include support for this
  7. MODCLANG_LANGS += c
  8. .endif
  9. _MODCLANG_OKAY = c c++
  10. .for _l in ${MODCLANG_LANGS:L}
  11. . if !${_MODCLANG_OKAY:M${_l}}
  12. ERRORS += "Fatal: unknown language ${_l}"
  13. . endif
  14. .endfor
  15. _MODCLANG_ARCH_USES = No
  16. .if ${MODCLANG_ARCHS:L} != ""
  17. . for _i in ${MODCLANG_ARCHS}
  18. . if !empty(MACHINE_ARCH:M${_i})
  19. _MODCLANG_ARCH_USES = Yes
  20. . endif
  21. . endfor
  22. .endif
  23. .if ${_MODCLANG_ARCH_USES:L} == "yes"
  24. BUILD_DEPENDS += devel/llvm>=${MODCLANG_VERSION}
  25. COMPILER_LINKS = gcc ${LOCALBASE}/bin/clang cc ${LOCALBASE}/bin/clang
  26. . if ${MODCLANG_LANGS:L:Mc++}
  27. COMPILER_LINKS += g++ ${LOCALBASE}/bin/clang++ c++ ${LOCALBASE}/bin/clang++
  28. # uses libestdc++
  29. MODULES += gcc4
  30. MODCLANG_CPPLIBDEP = ${MODGCC4_CPPLIBDEP}
  31. LIB_DEPENDS += ${MODCLANG_CPPLIBDEP}
  32. MODCLANG_CPPWANTLIB = ${MODGCC4_CPPWANTLIB}
  33. WANTLIB += ${MODCLANG_CPPWANTLIB}
  34. . endif
  35. .endif
  36. SUBST_VARS+= MODCLANG_VERSION