-
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: embed tinycc includes using tar
will be extracted in the execution tmpdir on runtime
- Loading branch information
Showing
5 changed files
with
491 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/bin/sh | ||
|
||
includes=lib/tinycc/include | ||
dst=src/embed-headers.c | ||
|
||
tmptar=`mktemp`.tar | ||
tar cf $tmptar ${includes} | ||
|
||
command -v xxd > /dev/null || { | ||
>&2 echo "Error not found: xxd binary not installed" | ||
exit 1 | ||
} | ||
|
||
echo "// ${includes}" > $dst | ||
xxd -i $tmptar >> $dst | ||
tmpvar=`echo $tmptar | sed 's/\//_/g; s/\./_/g'` | ||
>&2 echo "$tmpvar" | ||
sed -i 's/unsigned char '"$tmpvar"'/const unsigned char tinycc_headers/' $dst | ||
sed -i 's/unsigned int '"$tmpvar"'/const unsigned int tinycc_headers_len/' $dst |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.