mirror of
https://github.com/sheumann/hush.git
synced 2024-08-17 00:29:03 +00:00
trylink: explain how to modify link and drastically decrease amount of padding (unfortunately, needs hand editing ATM). *: add ALIGN1 / ALIGN2 to global strings and arrays of bytes and shorts size saving: 0.5k
20 lines
409 B
Bash
Executable File
20 lines
409 B
Bash
Executable File
#!/bin/sh
|
|
|
|
target="$1"
|
|
loc="$2"
|
|
|
|
test "$target" || exit 1
|
|
test "$loc" || loc=.
|
|
test -x "$loc/usage" || exit 1
|
|
test "$SED" || SED=sed
|
|
|
|
sz=`"$loc/usage" | wc -c` || exit 1
|
|
|
|
exec >"$target"
|
|
|
|
echo 'static const char packed_usage[] ALIGN1 = '
|
|
"$loc/usage" | bzip2 -1 | od -v -t x1 \
|
|
| $SED -e 's/^[^ ]*//' -e 's/ *\(..\)/\\x\1/g' -e 's/^\(.*\)$/"\1"/'
|
|
echo ';'
|
|
echo '#define SIZEOF_usage_messages' `expr 0 + $sz`
|