diff options
author | he <he@pkgsrc.org> | 2020-07-06 19:09:29 +0000 |
---|---|---|
committer | he <he@pkgsrc.org> | 2020-07-06 19:09:29 +0000 |
commit | 0a6f8d8aebebe26b2770e7933e2297d8bfed2bb9 (patch) | |
tree | 0339e30082df052365d8dc5ed7052ac736ff43bb /lang/rust | |
parent | 9c664b02bd0ba4f91afe6f05d2e50db2a48b7500 (diff) | |
download | pkgsrc-0a6f8d8aebebe26b2770e7933e2297d8bfed2bb9.tar.gz |
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 (limited to 'lang/rust')
-rw-r--r-- | lang/rust/Makefile | 5 | ||||
-rw-r--r-- | lang/rust/cross.mk | 50 |
2 files changed, 54 insertions, 1 deletions
diff --git a/lang/rust/Makefile b/lang/rust/Makefile index b107b1073fe..a75b51a878f 100644 --- a/lang/rust/Makefile +++ b/lang/rust/Makefile @@ -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 @@ CONFIGURE_ARGS+= --disable-ninja #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 --git a/lang/rust/cross.mk b/lang/rust/cross.mk new file mode 100644 index 00000000000..3f2c5aaeff0 --- /dev/null +++ b/lang/rust/cross.mk @@ -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 |