~ubuntu-branches/ubuntu/edgy/swig1.3/edgy

« back to all changes in this revision

Viewing changes to Tools/mkwindows.sh

  • Committer: Bazaar Package Importer
  • Author(s): Adam Conrad
  • Date: 2005-12-05 01:16:04 UTC
  • mfrom: (1.2.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20051205011604-ygx904it6413k3go
Tags: 1.3.27-1ubuntu1
Resynchronise with Debian again, for the new subversion packages.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
 
 
3
# Build Windows distribution (swigwin-1.3.x.zip) -- requires running in a mingw environment.
 
4
 
 
5
# path to zip program
 
6
zip=/c/cygwin/bin/zip
 
7
 
 
8
if test x$1 != x; then
 
9
    version=$1
 
10
    if test x$2 != x; then
 
11
        zip=$2;
 
12
        echo zip: $zip;
 
13
    fi
 
14
else
 
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"
 
18
    exit 1
 
19
fi
 
20
 
 
21
swigbasename=swig-$version
 
22
swigwinbasename=swigwin-$version
 
23
tarball=$swigbasename.tar.gz
 
24
 
 
25
if test -f "$tarball"; then
 
26
    builddir=build-$version
 
27
    if test -e $builddir; then
 
28
      echo "Deleting directory $builddir..."
 
29
      rm -rf $builddir
 
30
    fi
 
31
    echo "Creating directory $builddir..."
 
32
    mkdir $builddir
 
33
    cd $builddir
 
34
    echo "Unzipping tarball..."
 
35
    tar -zxf ../$tarball
 
36
    sleep 2 # fix strange not finding newly created directory
 
37
    if test -d $swigbasename; then
 
38
      mv $swigbasename $swigwinbasename
 
39
      tar -zxf ../$tarball
 
40
      echo "Running configure..."
 
41
      cd $swigbasename
 
42
      ./configure CXXFLAGS="-O2" CFLAGS="-O2"
 
43
      echo "Compiling (quietly)..."
 
44
      make > build.log
 
45
      echo "Simple check to see if swig.exe runs..."
 
46
      ./swig.exe -version
 
47
      echo "Creating $swigwinbasename.zip..."
 
48
      cd ..
 
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
 
55
      echo "Cleaning up..."
 
56
      cd ..
 
57
      rm -rf $builddir
 
58
      echo "Finished building $swigwinbasename.zip"
 
59
    else
 
60
      echo "Expecting tarball to create directory: $swigbasename but it does not exist"
 
61
      exit 1
 
62
    fi
 
63
else
 
64
    echo tarball missing: $tarball 
 
65
    exit 1
 
66
fi
 
67
 
 
68
exit 0