diff --git a/lang/rust/Makefile b/lang/rust/Makefile --- a/lang/rust/Makefile +++ b/lang/rust/Makefile @@ -50,17 +50,22 @@ # ?= to allow users to still overwrite it in make.conf. TMPDIR?= ${WRKDIR} -OPTIONS_DEFINE= DOCS GDB SOURCES WASM +OPTIONS_DEFINE= DOCS GDB PORT_LLVM SOURCES WASM OPTIONS_DEFAULT= SOURCES WASM OPTIONS_EXCLUDE_armv6= DOCS GDB_DESC= Install ports gdb (necessary for debugging rust programs) +PORT_LLVM_DESC= Build against devel/llvm${LLVM_VER} (experimental) SOURCES_DESC= Install source files WASM_DESC= Build the WebAssembly target (wasm32-unknown-unknown) DOCS_VARS= _RUST_BUILD_DOCS=true DOCS_VARS_OFF= _RUST_BUILD_DOCS=false GDB_RUN_DEPENDS= ${LOCALBASE}/bin/gdb:devel/gdb +LLVM_VER= 13 # chase bundled LLVM +PORT_LLVM_BUILD_DEPENDS=llvm-config${LLVM_VER}:devel/llvm${LLVM_VER} +PORT_LLVM_LIB_DEPENDS= libLLVM-${LLVM_VER}.so:devel/llvm${LLVM_VER} +PORT_LLVM_VARS= MAKE_ENV+=RUSTFLAGS="-Lnative=${LOCALBASE}/lib" SOURCES_VARS= _RUST_TOOLS+=src WASM_VARS= _RUST_BUILD_WASM=true \ _RUST_TARGETS+=wasm32-unknown-unknown @@ -204,6 +209,9 @@ .else @${ECHO_CMD} 'linker="${CC}"' >> ${WRKSRC}/config.toml .endif +.if ${PORT_OPTIONS:MPORT_LLVM} + @${ECHO_CMD} 'llvm-config="${LOCALBASE}/llvm${LLVM_VER}/bin/llvm-config"' >> ${WRKSRC}/config.toml +.endif .endfor @${ECHO_CMD} '[dist]' >> ${WRKSRC}/config.toml @${ECHO_CMD} 'src-tarball=false' >> ${WRKSRC}/config.toml