]> rtime.felk.cvut.cz Git - coffee/buildroot.git/commitdiff
uboot: fix build for older uboot source trees
authorStefan Becker <chemobejk@gmail.com>
Mon, 12 Mar 2018 12:34:09 +0000 (14:34 +0200)
committerPeter Korsgaard <peter@korsgaard.com>
Mon, 12 Mar 2018 22:50:17 +0000 (23:50 +0100)
The change in commit bf733342324b414a1142b57781504111f81c97ea only works
for newer uboot source trees. Add a check that scripts/dtc/libfdt
directory exists before making this change.

[Peter: add comment explaining why]
Signed-off-by: Stefan Becker <chemobejk@gmail.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
boot/uboot/uboot.mk

index 58dd906a274a5143d6d02a259e0709178a0ceb1b..b7032d5901a4015f8520d025bc2754a70c9ed1f0 100644 (file)
@@ -191,8 +191,12 @@ UBOOT_POST_PATCH_HOOKS += UBOOT_APPLY_LOCAL_PATCHES
 # This is equivalent to upstream commit
 # http://git.denx.de/?p=u-boot.git;a=commitdiff;h=e0d20dc1521e74b82dbd69be53a048847798a90a. It
 # fixes a build failure when libfdt-devel is installed system-wide.
+# This only works when scripts/dtc/libfdt exists (E.G. versions containing
+# http://git.denx.de/?p=u-boot.git;a=commitdiff;h=c0e032e0090d6541549b19cc47e06ccd1f302893)
 define UBOOT_FIXUP_LIBFDT_INCLUDE
-       $(SED) 's%-I$$(srctree)/lib/libfdt%-I$$(srctree)/scripts/dtc/libfdt%' $(@D)/tools/Makefile
+       if [ -d $(@D)/scripts/dtc/libfdt ]; then \
+               $(SED) 's%-I$$(srctree)/lib/libfdt%-I$$(srctree)/scripts/dtc/libfdt%' $(@D)/tools/Makefile; \
+       fi
 endef
 UBOOT_POST_PATCH_HOOKS += UBOOT_FIXUP_LIBFDT_INCLUDE