diff options
author | Kaarle Ritvanen <kaarle.ritvanen@datakunkku.fi> | 2018-10-04 16:53:59 +0300 |
---|---|---|
committer | Kaarle Ritvanen <kaarle.ritvanen@datakunkku.fi> | 2018-10-19 15:18:13 +0300 |
commit | c24f1cb9780aa16ccab8c28a6a6b27cf2ba03092 (patch) | |
tree | aa63f19555713e85bc162b74b79e61b2f8b81a32 | |
parent | 16826ee7d60fc3b926964aff0c1a7d7339fbaeed (diff) | |
download | abuild-cross.tar.bz2 abuild-cross.tar.xz |
abuild: package cross-compilerscross
-rw-r--r-- | abuild.in | 37 |
1 files changed, 27 insertions, 10 deletions
@@ -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 } |