3
0

usage_compressed 732 B

12345678910111213141516171819202122232425262728293031323334
  1. #!/bin/sh
  2. target="$1"
  3. loc="$2"
  4. test "$target" || exit 1
  5. test "$loc" || loc=.
  6. test -x "$loc/usage" || exit 1
  7. test "$SED" || SED=sed
  8. sz=`"$loc/usage" | wc -c` || exit 1
  9. exec >"$target"
  10. echo 'static const char packed_usage[] ALIGN1 = {'
  11. ## Breaks on big-endian systems!
  12. ## # Extra effort to avoid using "od -t x1": -t is not available
  13. ## # in non-CONFIG_DESKTOPed busybox od
  14. ##
  15. ## "$loc/usage" | bzip2 -1 | od -v -x \
  16. ## | $SED -e 's/^[^ ]*//' \
  17. ## | $SED -e 's/ //g' \
  18. ## | grep -v '^$' \
  19. ## | $SED -e 's/\(..\)\(..\)/0x\2,0x\1,/g'
  20. "$loc/usage" | bzip2 -1 | od -v -t x1 \
  21. | $SED -e 's/^[^ ]*//' \
  22. | $SED -e 's/ //g' \
  23. | grep -v '^$' \
  24. | $SED -e 's/\(..\)/0x\1,/g'
  25. echo '};'
  26. echo '#define SIZEOF_usage_messages' `expr 0 + $sz`