summaryrefslogtreecommitdiffstats
path: root/meta/recipes-bsp/u-boot/u-boot-configure.inc
blob: a15511f8b2c9db3d5dc80116687bede0ede694ca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# This provides the logic for creating the desired u-boot config,
# accounting for any *.cfg files added to SRC_URI.  It's separated
# from u-boot.inc for use by recipes that need u-boot properly
# configured but aren't doing a full build of u-boot itself (such as
# its companion tools).

inherit uboot-config cml1

DEPENDS += "kern-tools-native"

CONFIGURE_FILES = "${@d.getVar('UBOOT_MACHINE') or '.config'}"

do_configure () {
    if [ -n "${UBOOT_CONFIG}" ]; then
        unset i j
        for config in ${UBOOT_MACHINE}; do
            i=$(expr $i + 1);
            for type in ${UBOOT_CONFIG}; do
                j=$(expr $j + 1);
                if [ $j -eq $i ]; then
                    uboot_configure_config $config $type
                fi
            done
            unset j
        done
        unset i
    else
        uboot_configure
    fi
}

uboot_configure_config () {
    config=$1
    type=$2

    oe_runmake -C ${S} O=${B}/${config} ${config}
    if [ -n "${@' '.join(find_cfgs(d))}" ]; then
        merge_config.sh -m -O ${B}/${config} ${B}/${config}/.config ${@" ".join(find_cfgs(d))}
        oe_runmake -C ${S} O=${B}/${config} oldconfig
    fi
}

uboot_configure () {
    if [ -n "${UBOOT_MACHINE}" ]; then
        oe_runmake -C ${S} O=${B} ${UBOOT_MACHINE}
    else
        oe_runmake -C ${S} O=${B} oldconfig
    fi
    merge_config.sh -m .config ${@" ".join(find_cfgs(d))}
    cml1_do_configure
}