svn commit: r455101 - head/Mk/Uses
Tobias Kortkamp
tobik at FreeBSD.org
Wed Nov 29 11:06:13 UTC 2017
Author: tobik
Date: Wed Nov 29 11:06:11 2017
New Revision: 455101
URL: https://svnweb.freebsd.org/changeset/ports/455101
Log:
Mk/Uses/cargo.mk: Respect CPUTYPE
C and C++ code can be built targeting newer CPUs if user defined
CPUTYPE in make.conf. Let's opt-in for Rust as well.
PR: 223939
Submitted by: jbeich
Modified:
head/Mk/Uses/cargo.mk
Modified: head/Mk/Uses/cargo.mk
==============================================================================
--- head/Mk/Uses/cargo.mk Wed Nov 29 10:42:03 2017 (r455100)
+++ head/Mk/Uses/cargo.mk Wed Nov 29 11:06:11 2017 (r455101)
@@ -72,6 +72,13 @@ CARGO_ENV+= \
RUSTDOC=${LOCALBASE}/bin/rustdoc \
RUSTFLAGS="${RUSTFLAGS}"
+# Adjust -C target-cpu if -march/-mcpu is set by bsd.cpu.mk
+.if ${ARCH} == amd64 || ${ARCH} == i386
+RUSTFLAGS+= ${CFLAGS:M-march=*:S/-march=/-C target-cpu=/}
+.else
+RUSTFLAGS+= ${CFLAGS:M-mcpu=*:S/-mcpu=/-C target-cpu=/}
+.endif
+
# Helper to shorten cargo calls.
CARGO_CARGO_RUN= \
cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${CARGO_ENV} \
More information about the svn-ports-all
mailing list