From b7862924902489ece6dbd028afcd26e5937e5e37 Mon Sep 17 00:00:00 2001 From: Nathan Rossi Date: Tue, 12 Apr 2016 23:18:56 +1000 Subject: device-tree.bb: Rework pre-processor and dtc flags Add 'DEVICETREE_PP_FLAGS' for handling of flags for the pre-processor step. Also merge the building of the include path args into the variables with inline python. Use BUILD_CPP instead of CPP to avoid dependence on the target toolchain. Signed-off-by: Nathan Rossi --- recipes-bsp/device-tree/device-tree.bb | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/recipes-bsp/device-tree/device-tree.bb b/recipes-bsp/device-tree/device-tree.bb index ddfa7580..95ca0f35 100644 --- a/recipes-bsp/device-tree/device-tree.bb +++ b/recipes-bsp/device-tree/device-tree.bb @@ -11,7 +11,15 @@ PACKAGE_ARCH = "${MACHINE_ARCH}" DEPENDS += "dtc-native" FILES_${PN} = "/boot/devicetree*" -DEVICETREE_FLAGS ?= "-R 8 -p 0x3000" +DEVICETREE_FLAGS ?= "-R 8 -p 0x3000 \ + -i ${WORKDIR}/devicetree \ + ${@' '.join(['-i %s' % i for i in d.getVar('KERNEL_DTS_INCLUDE', True).split()])} \ + " +DEVICETREE_PP_FLAGS ?= "-nostdinc -Ulinux \ + -I${WORKDIR}/devicetree \ + ${@' '.join(['-I%s' % i for i in d.getVar('KERNEL_DTS_INCLUDE', True).split()])} \ + -x assembler-with-cpp \ + " FILESEXTRAPATHS_prepend := "${THISDIR}/files:" SRC_URI_append_zynq = " file://common/zynq7-base.dtsi" @@ -41,7 +49,6 @@ do_compile() { mkdir -p ${WORKDIR}/devicetree for i in ${MACHINE_DEVICETREE}; do if test -e ${WORKDIR}/$i; then - echo cp ${WORKDIR}/$i ${WORKDIR}/devicetree cp ${WORKDIR}/$i ${WORKDIR}/devicetree fi done @@ -49,15 +56,8 @@ do_compile() { for DTS_FILE in ${DEVICETREE}; do DTS_NAME=`basename -s .dts ${DTS_FILE}` - for d in ${KERNEL_DTS_INCLUDE}; do - dtc_include="${dtc_include} -i $d" - cpp_include="${cpp_include} -I${d}" - done - ${CPP} -E -nostdinc -Ulinux -I${WORKDIR}/devicetree \ - ${cpp_include} -x assembler-with-cpp \ - -o ${DTS_FILE}.pp ${DTS_FILE} - dtc -I dts -O dtb ${DEVICETREE_FLAGS} -i ${WORKDIR}/devicetree \ - ${dtc_include} -o ${DTS_NAME}.dtb ${DTS_FILE}.pp + ${BUILD_CPP} ${DEVICETREE_PP_FLAGS} -o ${DTS_FILE}.pp ${DTS_FILE} + dtc -I dts -O dtb ${DEVICETREE_FLAGS} -o ${DTS_NAME}.dtb ${DTS_FILE}.pp done } -- cgit v1.2.3-54-g00ecf