summaryrefslogtreecommitdiff
path: root/applets/usage_compressed
diff options
context:
space:
mode:
authorDenis Vlasenko2006-10-19 22:12:47 +0000
committerDenis Vlasenko2006-10-19 22:12:47 +0000
commitb560577cb27a4a15a5e1a77d3ac720d2151d3d60 (patch)
treea87d7028bb6c8d26ece0236e8d9945f68f03a236 /applets/usage_compressed
parent52b5eba715b29ed3e52eaa95a51307cacb4d7677 (diff)
downloadbusybox-b560577cb27a4a15a5e1a77d3ac720d2151d3d60.zip
busybox-b560577cb27a4a15a5e1a77d3ac720d2151d3d60.tar.gz
move usage_compressed.h generation into applets/
Diffstat (limited to 'applets/usage_compressed')
-rwxr-xr-xapplets/usage_compressed19
1 files changed, 19 insertions, 0 deletions
diff --git a/applets/usage_compressed b/applets/usage_compressed
new file mode 100755
index 0000000..ab164aa
--- /dev/null
+++ b/applets/usage_compressed
@@ -0,0 +1,19 @@
+#!/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[] = '
+"$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`