Mike Frysinger | 169f040 | 2012-02-13 14:35:15 -0500 | [diff] [blame] | 1 | # Copyright (c) 2012 The Chromium OS Authors. All rights reserved. |
| 2 | # Distributed under the terms of the GNU General Public License v2 |
| 3 | |
| 4 | # |
| 5 | # Original Author: The Chromium OS Authors <chromium-os-dev@chromium.org> |
| 6 | # Purpose: Library for handling packages that are part of Auto Update. |
| 7 | # |
| 8 | |
| 9 | inherit flag-o-matic |
| 10 | |
| 11 | # Some boards started out 32bit (user/kernel) and then migrated to 64bit |
| 12 | # (user/kernel). Since we need to auto-update (AU) from the 32bit to |
| 13 | # 64bit, and the old 32bit kernels can't execte 64bit code, we need to |
| 14 | # always build the AU code as 32bit. |
| 15 | # |
| 16 | # Setup the build env to create 32bit objects. |
| 17 | board_setup_32bit_au_env() |
| 18 | { |
Sonny Rao | fa97aec | 2012-02-21 13:26:24 -0800 | [diff] [blame] | 19 | [[ $# -eq 0 ]] || die "${FUNCNAME}: takes no arguments" |
Mike Frysinger | 169f040 | 2012-02-13 14:35:15 -0500 | [diff] [blame] | 20 | |
Sonny Rao | fa97aec | 2012-02-21 13:26:24 -0800 | [diff] [blame] | 21 | __AU_OLD_ARCH=${ARCH} |
| 22 | __AU_OLD_ABI=${ABI} |
| 23 | __AU_OLD_LIBDIR_x86=${LIBDIR_x86} |
Mike Frysinger | 169f040 | 2012-02-13 14:35:15 -0500 | [diff] [blame] | 24 | export ARCH=x86 ABI=x86 LIBDIR_x86="lib" |
Sonny Rao | fa97aec | 2012-02-21 13:26:24 -0800 | [diff] [blame] | 25 | __AU_OLD_CHOST=${CHOST} |
Mike Frysinger | 169f040 | 2012-02-13 14:35:15 -0500 | [diff] [blame] | 26 | export CHOST=i686-pc-linux-gnu |
Sonny Rao | fa97aec | 2012-02-21 13:26:24 -0800 | [diff] [blame] | 27 | __AU_OLD_SYSROOT=${SYSROOT} |
Mike Frysinger | 169f040 | 2012-02-13 14:35:15 -0500 | [diff] [blame] | 28 | export SYSROOT=/usr/${CHOST} |
Sonny Rao | fa97aec | 2012-02-21 13:26:24 -0800 | [diff] [blame] | 29 | append-ldflags -L"${__AU_OLD_SYSROOT}"/usr/lib |
Mike Frysinger | 8995d9d | 2013-09-05 09:52:27 -0400 | [diff] [blame] | 30 | append-cppflags -isystem "${__AU_OLD_SYSROOT}"/usr/include |
Sonny Rao | fa97aec | 2012-02-21 13:26:24 -0800 | [diff] [blame] | 31 | } |
| 32 | |
| 33 | # undo what we did in the above function |
| 34 | board_teardown_32bit_au_env() |
| 35 | { |
| 36 | [[ $# -eq 0 ]] || die "${FUNCNAME}: takes no arguments" |
| 37 | [ -z "${__AU_OLD_SYSROOT}" ] && \ |
| 38 | die "board_setup_32bit_au_env must be called first" |
| 39 | |
| 40 | filter-ldflags -L"${__AU_OLD_SYSROOT}"/usr/lib |
| 41 | filter-flags -isystem "${__AU_OLD_SYSROOT}"/usr/include |
| 42 | export SYSROOT=${__AU_OLD_SYSROOT} |
| 43 | export CHOST=${__AU_OLD_CHOST} |
| 44 | export LIBDIR_x86=${__AU_OLD_LIBDIR_x86} |
| 45 | export ABI=${__AU_OLD_ABI} |
| 46 | export ARCH=${__AU_OLD_ARCH} |
Mike Frysinger | 169f040 | 2012-02-13 14:35:15 -0500 | [diff] [blame] | 47 | } |