summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--abuild.in37
1 files changed, 27 insertions, 10 deletions
diff --git a/abuild.in b/abuild.in
index efd3d8e..8785738 100644
--- a/abuild.in
+++ b/abuild.in
@@ -13,6 +13,7 @@ datadir=@datadir@
abuild_path=$(readlink -f $0)
git=$(command -v git) || git=true
+orig_ctarget=$CTARGET
if ! [ -f "$datadir/functions.sh" ]; then
echo "$datadir/functions.sh: not found" >&2
@@ -2388,17 +2389,33 @@ uninstalldeps() { undeps; }
index() { update_abuildrepo_index; }
all() {
- if ! [ -n "$force" ]; then
- if ! check_arch; then
- echo "Package not available for the target architecture ($CARCH). Aborting."
- return 0
- fi
- check_libc || return 0
- fi
- if up2date && [ -z "$force" ]; then
- msg "Package is up to date"
+ local host_list=$APORTSDIR/.cross-hosts
+ local target_list=$APORTSDIR/.cross-targets
+
+ if options_has toolchain && \
+ [ -z "$orig_ctarget" -a -s "$host_list" \
+ -a -s "$target_list" ] && \
+ grep -q ^$(hostspec_to_arch $CHOST)\$ "$host_list"; then
+
+ local arch
+ for arch in $(cat "$target_list"); do
+ msg "Building for target architecture $arch"
+ CTARGET=$arch BOOTSTRAP=${BOOTSTRAP:-nobase} \
+ "$abuild_path" $install_deps $recursive_opts
+ done
else
- build_abuildrepo
+ if ! [ -n "$force" ]; then
+ if ! check_arch; then
+ echo "Package not available for the target architecture ($CARCH). Aborting."
+ return 0
+ fi
+ check_libc || return 0
+ fi
+ if up2date && [ -z "$force" ]; then
+ msg "Package is up to date"
+ else
+ build_abuildrepo
+ fi
fi
}