1# This provides the logic for creating the desired u-boot config,
2# accounting for any *.cfg files added to SRC_URI.  It's separated
3# from u-boot.inc for use by recipes that need u-boot properly
4# configured but aren't doing a full build of u-boot itself (such as
5# its companion tools).
6
7inherit uboot-config cml1
8
9DEPENDS += "kern-tools-native"
10
11CONFIGURE_FILES = "${@d.getVar('UBOOT_MACHINE') or '.config'}"
12
13do_configure () {
14    if [ -n "${UBOOT_CONFIG}" ]; then
15        unset i j
16        for config in ${UBOOT_MACHINE}; do
17            i=$(expr $i + 1);
18            for type in ${UBOOT_CONFIG}; do
19                j=$(expr $j + 1);
20                if [ $j -eq $i ]; then
21                    oe_runmake -C ${S} O=${B}/${config} ${config}
22                    if [ -n "${@' '.join(find_cfgs(d))}" ]; then
23                        merge_config.sh -m -O ${B}/${config} ${B}/${config}/.config ${@" ".join(find_cfgs(d))}
24                        oe_runmake -C ${S} O=${B}/${config} oldconfig
25                    fi
26                fi
27            done
28            unset j
29        done
30        unset i
31    else
32        if [ -n "${UBOOT_MACHINE}" ]; then
33            oe_runmake -C ${S} O=${B} ${UBOOT_MACHINE}
34        else
35            oe_runmake -C ${S} O=${B} oldconfig
36        fi
37        merge_config.sh -m .config ${@" ".join(find_cfgs(d))}
38        cml1_do_configure
39    fi
40}
41