rust.inc: normalize to expanded 4 space tabs
I had previously mixed using hard tabs, 8 spaces, and 4 spaces (due to editor defaulting to hard tabs and the occasional change to 4 spaces to work on python code). Try to avoid that with a vim modeline
This commit is contained in:
+80
-79
@@ -1,3 +1,4 @@
|
|||||||
|
# ex: sts=4 et sw=4 ts=8
|
||||||
inherit rust
|
inherit rust
|
||||||
inherit rust-installer
|
inherit rust-installer
|
||||||
require rust-shared-source.inc
|
require rust-shared-source.inc
|
||||||
@@ -354,106 +355,106 @@ do_configure () {
|
|||||||
mkdir -p "${B}/"
|
mkdir -p "${B}/"
|
||||||
cd "${B}"
|
cd "${B}"
|
||||||
|
|
||||||
# FIXME: target_prefix vs prefix, see cross.bbclass
|
# FIXME: target_prefix vs prefix, see cross.bbclass
|
||||||
|
|
||||||
# CFLAGS, LDFLAGS, CXXFLAGS, CPPFLAGS are used by rust's build for a
|
# CFLAGS, LDFLAGS, CXXFLAGS, CPPFLAGS are used by rust's build for a
|
||||||
# wide range of targets (not just HOST). Yocto's settings for them will
|
# wide range of targets (not just HOST). Yocto's settings for them will
|
||||||
# be inappropriate, avoid using.
|
# be inappropriate, avoid using.
|
||||||
unset CFLAGS
|
unset CFLAGS
|
||||||
unset LDFLAGS
|
unset LDFLAGS
|
||||||
unset CXXFLAGS
|
unset CXXFLAGS
|
||||||
unset CPPFLAGS
|
unset CPPFLAGS
|
||||||
|
|
||||||
# FIXME: this path to rustc (via `which rustc`) may not be quite right in the case
|
# FIXME: this path to rustc (via `which rustc`) may not be quite right in the case
|
||||||
# where we're reinstalling the compiler. May want to try for a real
|
# where we're reinstalling the compiler. May want to try for a real
|
||||||
# path based on bitbake vars
|
# path based on bitbake vars
|
||||||
# Also will be wrong when relative libdir and/or bindir aren't 'bin' and 'lib'.
|
# Also will be wrong when relative libdir and/or bindir aren't 'bin' and 'lib'.
|
||||||
local_maybe_enable=disable
|
local_maybe_enable=disable
|
||||||
local_rust_root=/not/set/do/not/use
|
local_rust_root=/not/set/do/not/use
|
||||||
if which rustc >/dev/null 2>&1; then
|
if which rustc >/dev/null 2>&1; then
|
||||||
local_rustc=$(which rustc)
|
local_rustc=$(which rustc)
|
||||||
if [ -n "$local_rustc" ]; then
|
if [ -n "$local_rustc" ]; then
|
||||||
local_rust_root=$(dirname $(dirname $local_rustc))
|
local_rust_root=$(dirname $(dirname $local_rustc))
|
||||||
if [ -e "$local_rust_root/bin/rustc" ]; then
|
if [ -e "$local_rust_root/bin/rustc" ]; then
|
||||||
local_maybe_enable=enable
|
local_maybe_enable=enable
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
# - rpath is required otherwise rustc fails to resolve symbols
|
# - rpath is required otherwise rustc fails to resolve symbols
|
||||||
# - submodule management is done by bitbake's fetching
|
# - submodule management is done by bitbake's fetching
|
||||||
${S}/configure \
|
${S}/configure \
|
||||||
"--enable-rpath" \
|
"--enable-rpath" \
|
||||||
"--disable-docs" \
|
"--disable-docs" \
|
||||||
"--disable-manage-submodules" \
|
"--disable-manage-submodules" \
|
||||||
"--disable-debug" \
|
"--disable-debug" \
|
||||||
"--enable-debuginfo" \
|
"--enable-debuginfo" \
|
||||||
"--enable-optimize" \
|
"--enable-optimize" \
|
||||||
"--enable-optimize-cxx" \
|
"--enable-optimize-cxx" \
|
||||||
"--disable-llvm-version-check" \
|
"--disable-llvm-version-check" \
|
||||||
"--llvm-root=${llvmdir}" \
|
"--llvm-root=${llvmdir}" \
|
||||||
"--enable-optimize-tests" \
|
"--enable-optimize-tests" \
|
||||||
"--prefix=${prefix}" \
|
"--prefix=${prefix}" \
|
||||||
"--target=${TARGET_SYS}" \
|
"--target=${TARGET_SYS}" \
|
||||||
"--host=${HOST_SYS}" \
|
"--host=${HOST_SYS}" \
|
||||||
"--build=${BUILD_SYS}" \
|
"--build=${BUILD_SYS}" \
|
||||||
"--localstatedir=${localstatedir}" \
|
"--localstatedir=${localstatedir}" \
|
||||||
"--sysconfdir=${sysconfdir}" \
|
"--sysconfdir=${sysconfdir}" \
|
||||||
"--datadir=${datadir}" \
|
"--datadir=${datadir}" \
|
||||||
"--infodir=${infodir}" \
|
"--infodir=${infodir}" \
|
||||||
"--mandir=${mandir}" \
|
"--mandir=${mandir}" \
|
||||||
"--libdir=${libdir}" \
|
"--libdir=${libdir}" \
|
||||||
"--bindir=${bindir}" \
|
"--bindir=${bindir}" \
|
||||||
"--platform-cfg=${WORKDIR}/mk-cfg/" \
|
"--platform-cfg=${WORKDIR}/mk-cfg/" \
|
||||||
${@bb.utils.contains('PACKAGECONFIG', 'local-rust', '--$local_maybe_enable-local-rust --local-rust-root=$local_rust_root', '--local-rust-root=/not/a/dir', d)} \
|
${@bb.utils.contains('PACKAGECONFIG', 'local-rust', '--$local_maybe_enable-local-rust --local-rust-root=$local_rust_root', '--local-rust-root=/not/a/dir', d)} \
|
||||||
${EXTRA_OECONF}
|
${EXTRA_OECONF}
|
||||||
}
|
}
|
||||||
|
|
||||||
rust_runmake () {
|
rust_runmake () {
|
||||||
echo "COMPILE ${PN}" "$@"
|
echo "COMPILE ${PN}" "$@"
|
||||||
env
|
env
|
||||||
|
|
||||||
# CFLAGS, LDFLAGS, CXXFLAGS, CPPFLAGS are used by rust's build for a
|
# CFLAGS, LDFLAGS, CXXFLAGS, CPPFLAGS are used by rust's build for a
|
||||||
# wide range of targets (not just TARGET). Yocto's settings for them will
|
# wide range of targets (not just TARGET). Yocto's settings for them will
|
||||||
# be inappropriate, avoid using.
|
# be inappropriate, avoid using.
|
||||||
unset CFLAGS
|
unset CFLAGS
|
||||||
unset LDFLAGS
|
unset LDFLAGS
|
||||||
unset CXXFLAGS
|
unset CXXFLAGS
|
||||||
unset CPPFLAGS
|
unset CPPFLAGS
|
||||||
|
|
||||||
oe_runmake "VERBOSE=1" "$@"
|
oe_runmake "VERBOSE=1" "$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
do_compile () {
|
do_compile () {
|
||||||
if ${@bb.utils.contains('PACKAGECONFIG', 'local-rust', 'false', 'true', d)}; then
|
if ${@bb.utils.contains('PACKAGECONFIG', 'local-rust', 'false', 'true', d)}; then
|
||||||
mkdir -p dl
|
mkdir -p dl
|
||||||
cp -f ${WORKDIR}/${RUST_SNAPSHOT} dl
|
cp -f ${WORKDIR}/${RUST_SNAPSHOT} dl
|
||||||
fi
|
fi
|
||||||
rust_runmake
|
rust_runmake
|
||||||
}
|
}
|
||||||
|
|
||||||
rust_do_install () {
|
rust_do_install () {
|
||||||
rust_runmake DESTDIR="${D}" install
|
rust_runmake DESTDIR="${D}" install
|
||||||
|
|
||||||
# Rust's install.sh doesn't mark executables as executable because
|
# Rust's install.sh doesn't mark executables as executable because
|
||||||
# we're using a custom bindir, do it ourselves.
|
# we're using a custom bindir, do it ourselves.
|
||||||
chmod +x "${D}/${bindir}/rustc"
|
chmod +x "${D}/${bindir}/rustc"
|
||||||
chmod +x "${D}/${bindir}/rustdoc"
|
chmod +x "${D}/${bindir}/rustdoc"
|
||||||
chmod +x "${D}/${bindir}/rust-gdb"
|
chmod +x "${D}/${bindir}/rust-gdb"
|
||||||
|
|
||||||
# Install our custom target.json files
|
# Install our custom target.json files
|
||||||
local td="${D}${libdir}/rustlib/"
|
local td="${D}${libdir}/rustlib/"
|
||||||
install -d "$td"
|
install -d "$td"
|
||||||
for tgt in "${WORKDIR}/targets/"* ; do
|
for tgt in "${WORKDIR}/targets/"* ; do
|
||||||
install -m 0644 "$tgt" "$td"
|
install -m 0644 "$tgt" "$td"
|
||||||
done
|
done
|
||||||
|
|
||||||
## rust will complain about multiple providers of the runtime libs
|
## rust will complain about multiple providers of the runtime libs
|
||||||
## (libstd, libsync, etc.) without this.
|
## (libstd, libsync, etc.) without this.
|
||||||
(cd "${D}${libdir}" && ln -sf "rustlib/${HOST_SYS}/lib/lib"*.so .)
|
(cd "${D}${libdir}" && ln -sf "rustlib/${HOST_SYS}/lib/lib"*.so .)
|
||||||
}
|
}
|
||||||
|
|
||||||
do_install () {
|
do_install () {
|
||||||
rust_do_install
|
rust_do_install
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user