www.pudn.com > cppcc.rar > build_win32.sh
#! /bin/bash
##############################################################################
#
# This is for cross-compiling the win32 binary. It exports the suitable CC,
# CXX, aso). I only tested with MINGW (www.mingw.org).
#
# The sequence of commands that will do the job is:
#
# $source build_win32.sh [configure-args]
# $make
#
##############################################################################
export PATH=/usr/local/cross-tools/bin:$PATH
export CC=i386-mingw32msvc-gcc
export CXX=i386-mingw32msvc-g++
./configure --target=i386-mingw32msvc $*
#stat is broken in mingw (or should i say in msvcrt ;-)
echo "#undef HAVE_STAT" >> config.h
make
DIST_DIR=cppcc_win32_0_0_6
mkdir $DIST_DIR
cp src/cppcc.exe $DIST_DIR/cppcc.exe
cp AUTHORS COPYING ChangeLog INSTALL NEWS README $DIST_DIR
cp -r tests $DIST_DIR
cp -r examples $DIST_DIR
mkdir $DIST_DIR/doc
cp doc/usr_guide.pdf $DIST_DIR/doc
# clean up these, they're of no use on win anyway
find $DIST_DIR -name "Makefile*" -exec rm {} \;
i386-mingw32msvc-strip cppcc_win32_0_0_6/cppcc.exe
zip -r cppcc_win32_0_0_6.zip cppcc_win32_0_0_6