blob: 6b0c24dca6ff3a22cf6f931b23aa06f497e72b1c [file] [log] [blame]
Mike Frysinger169f0402012-02-13 14:35:15 -05001# 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
9inherit 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.
17board_setup_32bit_au_env()
18{
Sonny Raofa97aec2012-02-21 13:26:24 -080019 [[ $# -eq 0 ]] || die "${FUNCNAME}: takes no arguments"
Mike Frysinger169f0402012-02-13 14:35:15 -050020
Sonny Raofa97aec2012-02-21 13:26:24 -080021 __AU_OLD_ARCH=${ARCH}
22 __AU_OLD_ABI=${ABI}
23 __AU_OLD_LIBDIR_x86=${LIBDIR_x86}
Mike Frysinger169f0402012-02-13 14:35:15 -050024 export ARCH=x86 ABI=x86 LIBDIR_x86="lib"
Sonny Raofa97aec2012-02-21 13:26:24 -080025 __AU_OLD_CHOST=${CHOST}
Mike Frysinger169f0402012-02-13 14:35:15 -050026 export CHOST=i686-pc-linux-gnu
Sonny Raofa97aec2012-02-21 13:26:24 -080027 __AU_OLD_SYSROOT=${SYSROOT}
Mike Frysinger169f0402012-02-13 14:35:15 -050028 export SYSROOT=/usr/${CHOST}
Sonny Raofa97aec2012-02-21 13:26:24 -080029 append-ldflags -L"${__AU_OLD_SYSROOT}"/usr/lib
Mike Frysinger8995d9d2013-09-05 09:52:27 -040030 append-cppflags -isystem "${__AU_OLD_SYSROOT}"/usr/include
Sonny Raofa97aec2012-02-21 13:26:24 -080031}
32
33# undo what we did in the above function
34board_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 Frysinger169f0402012-02-13 14:35:15 -050047}