Commit 4ec3ab45 authored by Mot's avatar Mot Committed by Rahix
Browse files

fix(build): Remove GNUisms to allow building on macOS & BSD

Remove -r from ln
Quote from Unix Stack Exchange:

> Beware that -r is a GNUism, i.e. non POSIX so won't work [...] as the
> standard OS X ln command is BSD based.

Fix tr and dd for macOS

See Unix Stack Exchange question "Filling file with 0xFF gives C3BF in OSX" at

parent 84e0f76c
......@@ -6,8 +6,8 @@ BIN1="$2"
dd if=/dev/zero ibs=1k count=448 2>/dev/null | tr "\000" "\377" > "$BINOUT"
dd if=/dev/zero ibs=1k count=448 2>/dev/null | LANG=C tr "\000" "\377" > "$BINOUT"
dd if="$BIN1" of="$BINOUT" conv=notrunc 2>/dev/null
dd if="$BIN2" of="$BINOUT" conv=notrunc oflag=append 2>/dev/null
dd if="$BIN2" >> "$BINOUT" 2>/dev/null
"$PYTHON" "$(dirname "$0")/" "$BINOUT"
......@@ -12,7 +12,7 @@ shift 5
OUTPUT_DIR="$(dirname "$OUTPUT")"
mkdir -p "$OUTPUT_DIR/genhdr"
ln -sfr "$OUTPUT" "$OUTPUT_DIR/genhdr/$(basename "$OUTPUT")"
ln -sf "$(realpath --relative-to="$OUTPUT_DIR/genhdr" "$OUTPUT")" "$OUTPUT_DIR/genhdr/$(basename "$OUTPUT")"
# call gcc -E to generate qstr.i.last
gcc -E -DNO_QSTR -I"$SOURCE_DIR/micropython" -I"$PROJECT_SRC" -I"$OUTPUT_DIR" "$@" >"$OUTPUT_DIR/qstr.i.last"
......@@ -7,7 +7,7 @@ OUT="$(realpath "$3")"
OUTDIR="$(dirname "$OUT")"
mkdir -p "$OUTDIR/genhdr"
ln -sfr "$OUT" "$OUTDIR/genhdr/$(basename "$OUT")"
ln -sf "$(realpath --relative-to="$OUTDIR/genhdr" "$3")" "$OUTDIR/genhdr/$(basename "$OUT")"
cd "$2/micropython"
"$1" "$2/micropython/py/" "$OUT" >/dev/null
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment