3
# Build Windows distribution (swigwin-1.3.x.zip) -- requires running in a mingw environment.
10
if test x$2 != x; then
15
echo "Usage: mkwindows.sh version [zip]"
16
echo " version should be 1.3.x"
17
echo " zip is full path to zip program - default is /c/cygwin/bin/zip"
21
swigbasename=swig-$version
22
swigwinbasename=swigwin-$version
23
tarball=$swigbasename.tar.gz
25
if test -f "$tarball"; then
26
builddir=build-$version
27
if test -e $builddir; then
28
echo "Deleting directory $builddir..."
31
echo "Creating directory $builddir..."
34
echo "Unzipping tarball..."
36
sleep 2 # fix strange not finding newly created directory
37
if test -d $swigbasename; then
38
mv $swigbasename $swigwinbasename
40
echo "Running configure..."
42
./configure CXXFLAGS="-O2" CFLAGS="-O2"
43
echo "Compiling (quietly)..."
45
echo "Simple check to see if swig.exe runs..."
47
echo "Creating $swigwinbasename.zip..."
49
cp $swigbasename/swig.exe $swigwinbasename
50
sleep 2 # fix strange not finding swig.exe
51
echo "Unzip into a directory of your choice. Please read the README file as well as Doc\Manual\Windows.html for installation instructions." > swig_windows_zip_comments.txt
52
rm -f ../$swigwinbasename.zip
53
$zip -q -r -9 -z < swig_windows_zip_comments.txt ../$swigwinbasename.zip $swigwinbasename
54
rm -f swig_windows_zip_comments.txt
58
echo "Finished building $swigwinbasename.zip"
60
echo "Expecting tarball to create directory: $swigbasename but it does not exist"
64
echo tarball missing: $tarball