Skip to content

Commit

Permalink
Fix mkbundle on Mac OS X
Browse files Browse the repository at this point in the history
On Mac OS X files got trailing zeros which somehow seam to work
quite nice except for the javascript parser that did not like them.
This adds a awk that filters out empty lines from od and also
fixes some of the sed substitutions that seamed broken.

Tested manually on Linux and it seams to output correct C code.
  • Loading branch information
wader committed Mar 22, 2011
1 parent 2e668d8 commit e508333
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions support/mkbundle
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ for file in $FILES; do

echo >>${OUTPUT} "// ${SOURCE}/$file"
echo >>${OUTPUT} "static const unsigned char embedded_$name[]={"
$READER <${SOURCE}/$file | od -v -An -b | sed s/^\ */0/ | sed s/\ *$$/,/| sed s/\ /,\ 0/g|sed s/$/,/ >>${OUTPUT}
$READER <${SOURCE}/$file | od -v -An -b | awk '/[^\s]+/ { print $0 }' | sed s/^\ */0/ | sed s/\ *$/,/| sed s/\ /,\ 0/g >>${OUTPUT}
echo >>${OUTPUT} "};"
fi
done
Expand Down Expand Up @@ -138,4 +138,4 @@ static void __attribute__((constructor)) filebundle_init (void)
cnt++;
}
EOF
EOF

0 comments on commit e508333

Please sign in to comment.