blob: 8e2228af2f34e924722dcdc43bd87f60f5ddd671 [file] [log] [blame]
Rob Landley7e21d5f2006-04-27 23:34:46 +00001#!/bin/sh
2
3loc="$1"
4
5test "$loc" || loc=.
Bernhard Reutner-Fischera1e130f2006-05-21 10:45:01 +00006test -x "$loc/usage" || exit 1
Rob Landley7e21d5f2006-04-27 23:34:46 +00007
8echo 'static const char packed_usage[] = '
Rob Landley3252b622006-05-30 19:19:45 +00009"$loc"/usage | bzip2 -1 | od -v -t x1 \
Bernhard Reutner-Fischer7fca7e32006-05-26 13:28:39 +000010| $SED -e 's/^[^ ]*//' -e 's/ \(..\)/\\x\1/g' -e 's/^\(.*\)$/"\1"/' || exit 1
Rob Landley7e21d5f2006-04-27 23:34:46 +000011echo ';'
Bernhard Reutner-Fischer7fca7e32006-05-26 13:28:39 +000012sz=`"$loc"/usage | wc -c` || exit 1
13echo '#define SIZEOF_usage_messages' `expr 0 + $sz`