Switch from converting .bmp->XPM dynamically during the autogen step into building libresrc directly from the XPM buttons now that the .bmp files are gone.

Originally committed to SVN as r3241.
This commit is contained in:
Amar Takhar 2009-07-23 23:51:13 +00:00
parent 356ea76703
commit 98dad055ff
4 changed files with 2 additions and 83 deletions

View File

@ -182,25 +182,6 @@ else
DIE=1
fi
if test -z "$BIN_CONVERT"; then
BIN_CONVERT=`which convert`
fi
$ECHO_N "checking for ImageMagick 'convert' utility ... "
if test -x "$BIN_CONVERT" && $BIN_CONVERT --version |grep -c ImageMagick > /dev/null; then
echo $BIN_CONVERT
else
echo "not found"
echo
echo " You must have 'convert' installed from the"
echo " ImageMagick project. Please set BIN_CONVERT or"
echo " Add 'convert' to your PATH"
echo
DIE=1
fi
if test -z "$BIN_AWK"; then
BIN_AWK=`which awk`
fi
@ -279,24 +260,6 @@ if test -z "$ACLOCAL_FLAGS"; then
fi
fi
echo "--- Converting BMP resource files -> XPM ---"
# BMP -> XPM via src/res.rc
cat ${srcdir}/src/res.rc | ${BIN_AWK} -f ${srcdir}/scripts/unix-gen-xpm.awk BIN_CONVERT="$BIN_CONVERT" > ${srcdir}/src/bitmaps/Makefile.bitmaps
cd ${srcdir}/src/bitmaps
make -f Makefile.bitmaps
cd ${srcdir}
$BIN_AWK '/BITMAP/ { image[count] = $1; ++count} END { printf("EXTRA_DIST="); for (v in image) printf(" \\\n %s_xpm.xpm", image[v])}' \
${srcdir}/src/res.rc \
> ${srcdir}/src/bitmaps/Makefile.am
echo "--- Generating libresrc/resrc.cpp, libresrc/libresrc.h from res.rc ---"
$BIN_AWK -f scripts/unix-gen-res.awk ${srcdir}/src/res.rc \
RESRC_CPP="${srcdir}/src/libresrc/resrc.cpp" \
RESRC_H="${srcdir}/src/libresrc/libresrc.h"
rm -rf autom4te.cache
echo "--- $ACLOCAL ---"

View File

@ -1,22 +0,0 @@
# $Id$
! /CURSOR|ICON|^#|^$|^\// {
image[$1] = $1
}
END {
print("#define static") > RESRC_CPP
printf("#include \"wxicon_xpm.xpm\"\n") >> RESRC_CPP
for (v in image) {
printf("#include \"../bitmaps/%s_xpm.xpm\"\n", image[v]) >> RESRC_CPP
}
print("#ifndef _RES_H") > RESRC_H
print("#define _RES_H") >> RESRC_H
printf("extern char *wxicon_xpm[];\n") >> RESRC_H
for (v in image) {
printf("extern char *%s_xpm[];\n", image[v]) >> RESRC_H
}
print("#endif /* _RES_H */") >> RESRC_H
}

View File

@ -1,24 +0,0 @@
/BITMAP/ {
gsub(/\"bitmaps\//, "", $3)
gsub(/\"/, "", $3)
image[$1] = $3
}
END {
printf(" \
all: bmp2xpm \n \
.PHONY: all bmp2xpm \n \
CONVERT ?= %s \n \
", BIN_CONVERT)
# Yes, the 'sed' hack is annoying, if anyone wants to know why it's nessicary
# I direct them to coders/xpm.c:734 in ImageMagick 6.5.1
for (v in image) {
printf("%s_xpm.xpm: %s\n", v, image[v])
printf(" $(CONVERT) -transparent \"#c0c0c0\" %s xpm:- | sed \"2 s/^static char \\*xpm__\\[\\] =/const char \\*"v"_xpm\\[\\] =/\" > %s_xpm.xpm\n\n", image[v], v)
}
printf("bmp2xpm:")
for (v in image)
printf(" %s_xpm.xpm", v)
}

View File

@ -0,0 +1,2 @@
EXTRA_DIST= \
*.xpm