Rob Landley | 7e21d5f | 2006-04-27 23:34:46 +0000 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | |
| 3 | loc="$1" |
| 4 | |
| 5 | test "$loc" || loc=. |
Bernhard Reutner-Fischer | a1e130f | 2006-05-21 10:45:01 +0000 | [diff] [blame] | 6 | test -x "$loc/usage" || exit 1 |
Rob Landley | 7e21d5f | 2006-04-27 23:34:46 +0000 | [diff] [blame] | 7 | |
| 8 | echo 'static const char packed_usage[] = ' |
Rob Landley | 3252b62 | 2006-05-30 19:19:45 +0000 | [diff] [blame] | 9 | "$loc"/usage | bzip2 -1 | od -v -t x1 \ |
Bernhard Reutner-Fischer | 7fca7e3 | 2006-05-26 13:28:39 +0000 | [diff] [blame] | 10 | | $SED -e 's/^[^ ]*//' -e 's/ \(..\)/\\x\1/g' -e 's/^\(.*\)$/"\1"/' || exit 1 |
Rob Landley | 7e21d5f | 2006-04-27 23:34:46 +0000 | [diff] [blame] | 11 | echo ';' |
Bernhard Reutner-Fischer | 7fca7e3 | 2006-05-26 13:28:39 +0000 | [diff] [blame] | 12 | sz=`"$loc"/usage | wc -c` || exit 1 |
| 13 | echo '#define SIZEOF_usage_messages' `expr 0 + $sz` |