mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2024-12-26 09:58:20 +01:00
windres in mingw32 is broken. Add script that tests for the bug and
call from Makefile to abort if building on unpatched machine. (Bug report's been submitted.)
This commit is contained in:
parent
1fba7d7ef6
commit
b1faf6ac8a
2 changed files with 42 additions and 4 deletions
|
@ -238,17 +238,15 @@ $(OBJDIR)/%.o : ../common/%.c $(INCLUDES)
|
|||
$(CC) -c $(CFLAGS) -o $@ $<
|
||||
|
||||
$(BASE_LANG_OBJ) : $(BASE_LANG_SRC) $(INCLUDES) xwords4.ico common_rsrc.rc $(BMPS)
|
||||
scripts/test_windres.sh ${WINDRES}
|
||||
$(WINDRES) -v $(MINGW_INC_PATH) $(RESFLAGS) -DAM_BASE_LANGUAGE -o $@ $<
|
||||
|
||||
$(OBJDIR)/l10n/%.rc.o : l10n/%.rc $(WINCE_INCLUDES)
|
||||
scripts/test_windres.sh ${WINDRES}
|
||||
mkdir -p $(dir $@)
|
||||
ifeq ($(TARGET_OS),wince)
|
||||
UTF8=x$(shell file -b -n -i $< | grep 'utf-8'); \
|
||||
if [ x != $$UTF8 ]; then ENC="-c 65001"; fi; \
|
||||
$(WINDRES) $$ENC -v $(MINGW_INC_PATH) $(RESFLAGS) $< -o $@
|
||||
else
|
||||
$(WINDRES) -v $(MINGW_INC_PATH) $(RESFLAGS) $< -o $@
|
||||
endif
|
||||
|
||||
$(BUILTDIR)/%.dll: $(OBJDIR)/l10n/%.rc.o
|
||||
mkdir -p $(dir $@)
|
||||
|
|
40
xwords4/wince/scripts/test_windres.sh
Executable file
40
xwords4/wince/scripts/test_windres.sh
Executable file
|
@ -0,0 +1,40 @@
|
|||
#!/bin/sh
|
||||
|
||||
# Make sure the windres we have is correctly converting utf-8 to
|
||||
# utf-16. We'll cons up a fake .rc file, compile it, hexdump it and
|
||||
# look for a pattern. Use Polish for grins.
|
||||
|
||||
usage() {
|
||||
echo "usage: $0 path/to/windres"
|
||||
}
|
||||
|
||||
STR="Wartości i ilości klocków"
|
||||
RC_FILE=/tmp/test_$$.rc
|
||||
DOT_O_FILE=/tmp/test_$$.o
|
||||
WINDRES=$1
|
||||
which $WINDRES || usage
|
||||
|
||||
# Create the .rc file
|
||||
cat > $RC_FILE <<EOF
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
1000 "$STR"
|
||||
END
|
||||
EOF
|
||||
|
||||
# compile it
|
||||
${WINDRES} -c 65001 $RC_FILE -o $DOT_O_FILE
|
||||
|
||||
NEEDLE=$(echo -n "$STR" | iconv -t UTF-16LE | hexdump -v -e '1/1 "%02X"')
|
||||
HAYSTACK=$(hexdump -v -e '1/1 "%02X"' < $DOT_O_FILE)
|
||||
|
||||
rm -f $RC_FILE $DOT_O_FILE
|
||||
|
||||
if echo $HAYSTACK | grep -q $NEEDLE; then
|
||||
exit 0
|
||||
else
|
||||
echo "failed!!!"
|
||||
echo $NEEDLE
|
||||
echo $HAYSTACK
|
||||
exit 1
|
||||
fi
|
Loading…
Reference in a new issue