u-boot-configure.inc 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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. inherit uboot-config cml1
  7. DEPENDS += "kern-tools-native"
  8. CONFIGURE_FILES = "${@d.getVar('UBOOT_MACHINE') or '.config'}"
  9. do_configure () {
  10. if [ -n "${UBOOT_CONFIG}" ]; then
  11. unset i j
  12. for config in ${UBOOT_MACHINE}; do
  13. i=$(expr $i + 1);
  14. for type in ${UBOOT_CONFIG}; do
  15. j=$(expr $j + 1);
  16. if [ $j -eq $i ]; then
  17. uboot_configure_config $config $type
  18. fi
  19. done
  20. unset j
  21. done
  22. unset i
  23. else
  24. uboot_configure
  25. fi
  26. }
  27. uboot_configure_config () {
  28. config=$1
  29. type=$2
  30. builddir="${config}-${type}"
  31. unset k
  32. IFS="?"
  33. uboot_config_make_opts="${UBOOT_CONFIG_MAKE_OPTS}"
  34. for config_make_opts in $uboot_config_make_opts; do
  35. k=$(expr $k + 1);
  36. if [ $k -eq $i ]; then
  37. break
  38. fi
  39. done
  40. unset IFS
  41. unset k
  42. oe_runmake -C ${S} O=${B}/${builddir} ${config_make_opts} ${UBOOT_MAKE_OPTS} ${config}
  43. if [ -n "${@' '.join(find_cfgs(d))}" ]; then
  44. merge_config.sh -m -O ${B}/${builddir} ${B}/${builddir}/.config ${@" ".join(find_cfgs(d))}
  45. oe_runmake -C ${S} O=${B}/${builddir} oldconfig
  46. fi
  47. }
  48. uboot_configure () {
  49. if [ -n "${UBOOT_MACHINE}" ]; then
  50. oe_runmake -C ${S} O=${B} ${UBOOT_MAKE_OPTS} ${UBOOT_MACHINE}
  51. else
  52. oe_runmake -C ${S} O=${B} ${UBOOT_MAKE_OPTS} oldconfig
  53. fi
  54. merge_config.sh -m .config ${@" ".join(find_cfgs(d))}
  55. cml1_do_configure
  56. }