make_dtb.sh: Use $CPP instead of assuming that cpp is in $PATH

This fixes building in CheriBSD with a strict tmp path since we don't
bootstrap a cpp but pass the full path to clang-cpp instead.

While touching this file also fix all shellcheck warnings in make_dtb.sh.

Reviewed By:	manu
Differential Revision: https://reviews.freebsd.org/D18376
This commit is contained in:
arichardson 2018-12-14 23:53:28 +00:00
parent 9aa3cccd72
commit 6bf9e29261
2 changed files with 12 additions and 10 deletions

View File

@ -16,12 +16,13 @@ if [ -z "${MACHINE}" ]; then
MACHINE=$(uname -m) MACHINE=$(uname -m)
fi fi
: ${DTC:=dtc} : "${DTC:=dtc}"
: ${ECHO:=echo} : "${ECHO:=echo}"
: "${CPP:=cpp}"
for d in ${dts}; do for d in ${dts}; do
dtb=${dtb_path}/`basename $d .dts`.dtb dtb="${dtb_path}/$(basename "$d" .dts).dtb"
${ECHO} "converting $d -> $dtb" ${ECHO} "converting $d -> $dtb"
cpp -P -x assembler-with-cpp -I $S/gnu/dts/include -I $S/dts/${MACHINE} -I $S/gnu/dts/${MACHINE} -I $S/gnu/dts/ -include $d /dev/null | ${CPP} -P -x assembler-with-cpp -I "$S/gnu/dts/include" -I "$S/dts/${MACHINE}" -I "$S/gnu/dts/${MACHINE}" -I "$S/gnu/dts/" -include "$d" /dev/null |
${DTC} -@ -O dtb -o $dtb -b 0 -p 1024 -i $S/dts/${MACHINE} -i $S/gnu/dts/${MACHINE} -i $S/gnu/dts/ ${DTC} -@ -O dtb -o "$dtb" -b 0 -p 1024 -i "$S/dts/${MACHINE}" -i "$S/gnu/dts/${MACHINE}" -i "$S/gnu/dts/"
done done

View File

@ -16,12 +16,13 @@ if [ -z "${MACHINE}" ]; then
MACHINE=$(uname -m) MACHINE=$(uname -m)
fi fi
: ${DTC:=dtc} : "${DTC:=dtc}"
: ${ECHO:=echo} : "${ECHO:=echo}"
: "${CPP:=cpp}"
for d in ${dtso}; do for d in ${dtso}; do
dtb=${dtbo_path}/`basename $d .dtso`.dtbo dtb="${dtbo_path}/$(basename "$d" .dtso).dtbo"
${ECHO} "converting $d -> $dtb" ${ECHO} "converting $d -> $dtb"
cpp -P -x assembler-with-cpp -I $S/gnu/dts/include -I $S/dts/${MACHINE} -I $S/gnu/dts/${MACHINE} -include $d /dev/null | ${CPP} -P -x assembler-with-cpp -I "$S/gnu/dts/include" -I "$S/dts/${MACHINE}" -I "$S/gnu/dts/${MACHINE}" -include "$d" /dev/null |
${DTC} -@ -O dtb -o $dtb -i $S/dts/${MACHINE} -i $S/gnu/dts/${MACHINE} ${DTC} -@ -O dtb -o "$dtb" -i "$S/dts/${MACHINE}" -i "$S/gnu/dts/${MACHINE}"
done done