From 7d219aab70e6951ab82c27c202cac05016696723 Mon Sep 17 00:00:00 2001 From: Denis Vlasenko Date: Thu, 5 Oct 2006 10:17:08 +0000 Subject: build system overhaul --- scripts/usage_compressed | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) mode change 100644 => 100755 scripts/usage_compressed (limited to 'scripts/usage_compressed') diff --git a/scripts/usage_compressed b/scripts/usage_compressed old mode 100644 new mode 100755 index 8e2228a..ab164aa --- a/scripts/usage_compressed +++ b/scripts/usage_compressed @@ -1,13 +1,19 @@ #!/bin/sh -loc="$1" +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"/' || exit 1 +"$loc/usage" | bzip2 -1 | od -v -t x1 \ +| $SED -e 's/^[^ ]*//' -e 's/ \(..\)/\\x\1/g' -e 's/^\(.*\)$/"\1"/' echo ';' -sz=`"$loc"/usage | wc -c` || exit 1 echo '#define SIZEOF_usage_messages' `expr 0 + $sz` -- cgit v1.1