Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/lang/rust Based on suggestion, add the "cross.mk" file...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/2e7b54c07e7c
branches:  trunk
changeset: 435365:2e7b54c07e7c
user:      he <he%pkgsrc.org@localhost>
date:      Mon Jul 06 19:09:29 2020 +0000

description:
Based on suggestion, add the "cross.mk" file which contains
settings which may be tweaked to do a cross-build of rust.
Include it from the main Makefile.

diffstat:

 lang/rust/Makefile |   5 ++++-
 lang/rust/cross.mk |  50 ++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 54 insertions(+), 1 deletions(-)

diffs (73 lines):

diff -r bfcde4bd9734 -r 2e7b54c07e7c lang/rust/Makefile
--- a/lang/rust/Makefile        Mon Jul 06 18:29:11 2020 +0000
+++ b/lang/rust/Makefile        Mon Jul 06 19:09:29 2020 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.184 2020/07/06 16:12:14 he Exp $
+# $NetBSD: Makefile,v 1.185 2020/07/06 19:09:29 he Exp $
 
 DISTNAME=      rustc-1.44.0-src
 PKGNAME=       ${DISTNAME:S/rustc/rust/:S/-src//}
@@ -48,6 +48,9 @@
 #BUILD_TARGET=         dist
 BUILD_TARGET=          build
 
+# Include (optional) settings to cross-build rust
+.include "cross.mk"
+
 # Getting RPATH with $ORIGIN into bootstrap may be troublesome, so
 # uncommenting the LD_LIBRARY_PATH setting may be required to run
 # the bootstrap
diff -r bfcde4bd9734 -r 2e7b54c07e7c lang/rust/cross.mk
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lang/rust/cross.mk        Mon Jul 06 19:09:29 2020 +0000
@@ -0,0 +1,50 @@
+# $Id: cross.mk,v 1.1 2020/07/06 19:09:29 he Exp $
+
+# These settings may be used to cross-build rust.
+#
+# They interact with the files/gcc-wrap script to pick the
+# right compiler for the different phases of the build, and
+# use the headers for the target when required.  Note that the
+# cross-root tree will need to have the required binary packages
+# installed (curl etc., see list of buildlink3.mk includes in main
+# Makefile).
+
+# The gcc-wrap / c++-wrap script takes CROSS_ROOT environment variable
+# to do a cross-build.  The wrapper script assumes dest/ and tools/
+# as a result of a cross-build of NetBSD as subdirectories of this root
+#CROSS_ROOT=           /u/evbarm-armv7hf
+#CROSS_ROOT=           /u/sparc64
+#CROSS_ROOT=           /u/macppc
+#CROSS_ROOT=           /u/9.0-macppc
+#CROSS_ROOT=           /u/evbarm64
+#CROSS_ROOT=           /u/i386
+#MAKE_ENV+=            CROSS_ROOT=${CROSS_ROOT}
+
+# The GNU cross target designation
+#GNU_CROSS_TARGET=     armv7--netbsdelf-eabihf
+#GNU_CROSS_TARGET=     sparc64--netbsd
+#GNU_CROSS_TARGET=     i486--netbsdelf
+#GNU_CROSS_TARGET=     powerpc--netbsd
+#GNU_CROSS_TARGET=     aarch64--netbsd
+#MAKE_ENV+=            GNU_CROSS_TARGET=${GNU_CROSS_TARGET}
+
+# To cross-build rust, you need to specify
+# the ultimate target to built for, as well as the
+# host the compiler is supposed to run on.
+# Rust's target designation
+#TARGET=               armv7-unknown-netbsd-eabihf
+#TARGET=               sparc64-unknown-netbsd
+#TARGET=               powerpc-unknown-netbsd
+#TARGET=               aarch64-unknown-netbsd
+#TARGET=               i686-unknown-netbsd
+#
+#SCRIPTS=              ${WRKDIR}/scripts
+#CONFIGURE_ARGS+=      --host=${TARGET}
+#CONFIGURE_ARGS+=      --target=${TARGET}
+#CONFIGURE_ARGS+=      --set=target.${TARGET}.cc=${SCRIPTS}/gcc-wrap
+#CONFIGURE_ARGS+=      --set=target.${TARGET}.cxx=${SCRIPTS}/c++-wrap
+#CONFIGURE_ARGS+=      --set=target.${TARGET}.linker=${SCRIPTS}/gcc-wrap
+#CONFIGURE_ARGS+=      --set=target.${TARGET}.ar=${CROSS_ROOT}/tools/bin/${GNU_CROSS_TARGET}-ar
+
+# May be required when cross-building on NetBSD
+#MAKE_ENV+=            OPENSSL_DIR=/usr



Home | Main Index | Thread Index | Old Index