2022-08-07 14:31:51 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
if [ "$1" = "--version" ]; then
|
2023-02-10 02:43:05 +00:00
|
|
|
rc.exe -?
|
2022-08-07 14:31:51 +00:00
|
|
|
exit $?
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ $# -lt 2 ]; then
|
|
|
|
echo "Usage: mswindres [-I/include/path ...] [-DSOME_DEFINE ...] [-o output.o] input.rc [output.o]" >&2
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
2023-02-10 02:43:05 +00:00
|
|
|
EXTRA_OPTS="-nologo"
|
2022-08-07 14:31:51 +00:00
|
|
|
|
|
|
|
while [ $# -gt 2 ]; do
|
|
|
|
case $1 in
|
2023-02-10 02:43:05 +00:00
|
|
|
-D*) EXTRA_OPTS="$EXTRA_OPTS -d$(echo $1 | sed -e "s/^..//" -e "s/ /\\\\ /g")" ;;
|
|
|
|
-I*) EXTRA_OPTS="$EXTRA_OPTS -i$(echo $1 | sed -e "s/^..//" -e "s/ /\\\\ /g")" ;;
|
2022-08-07 14:31:51 +00:00
|
|
|
-o) OPT_OUT="$2"; shift ;;
|
|
|
|
esac
|
|
|
|
shift
|
|
|
|
done
|
|
|
|
|
|
|
|
IN="$1"
|
|
|
|
if [ -z "$OPT_OUT" ]; then
|
|
|
|
OUT="$2"
|
|
|
|
else
|
|
|
|
OUT="$OPT_OUT"
|
|
|
|
fi
|
|
|
|
|
|
|
|
eval set -- $EXTRA_OPTS
|
2023-02-10 02:43:05 +00:00
|
|
|
rc.exe "$@" -fo "$OUT" "$IN"
|