| 1 | #! /bin/sh | 
|---|
| 2 |  | 
|---|
| 3 | set -e | 
|---|
| 4 |  | 
|---|
| 5 | rel=yes | 
|---|
| 6 | if test x"$1" = x-t ; then | 
|---|
| 7 |    rel= | 
|---|
| 8 |    shift | 
|---|
| 9 | fi | 
|---|
| 10 |  | 
|---|
| 11 | if test x"$rel" = xyes ; then | 
|---|
| 12 |   # Check everything is checked into SVN. | 
|---|
| 13 |   if svn st | grep -v '^?' | grep . > /dev/null 2> /dev/null ; then | 
|---|
| 14 |     echo 'There are changes not checked into SVN - please rectify' | 
|---|
| 15 |     echo 'If you just want to test, run with option -t' | 
|---|
| 16 |     exit 1 | 
|---|
| 17 |   fi | 
|---|
| 18 |  | 
|---|
| 19 |   test ! -f Makefile || make distclean | 
|---|
| 20 |   cp -u /usr/share/misc/config.guess . | 
|---|
| 21 |   cp -u /usr/share/misc/config.sub . | 
|---|
| 22 |   autoreconf --force -i | 
|---|
| 23 |   ./configure CC=gcc CXX=g++ | 
|---|
| 24 |   # Tell the preprocessor to be C89 - this makes it reject // comments | 
|---|
| 25 |   make distcheck CFLAGS="-Wp,-std=c89" | 
|---|
| 26 |   # FIXME -Werror makes configure explode CFLAGS="-Werror -Wp,-std=c89" | 
|---|
| 27 |   # FIXME   CXXFLAGS="-Werror" | 
|---|
| 28 | else | 
|---|
| 29 |   make dist | 
|---|
| 30 | fi | 
|---|
| 31 |  | 
|---|
| 32 | # Perform mingw build on a clean unpacked source tree from the release tarball | 
|---|
| 33 | # so that (a) we don't need to "make distclean" on the source tree and (b) we | 
|---|
| 34 | # ensure that any files required to build the mingw version and installer | 
|---|
| 35 | # package are actually shipped in the source tarball. | 
|---|
| 36 | tarball=`ls -1t survex-*.tar.gz` | 
|---|
| 37 | tardir=`basename "$tarball" .tar.gz` | 
|---|
| 38 | rm -rf "$tardir" | 
|---|
| 39 | tar xf "$tarball" | 
|---|
| 40 | cd "$tardir" | 
|---|
| 41 |  | 
|---|
| 42 | test -n "$build_platform" || build_platform=`sh config.guess` | 
|---|
| 43 | SAVE_PATH=$PATH | 
|---|
| 44 | if test -d /usr/i586-mingw32msvc/bin ; then | 
|---|
| 45 |   # debian mingw32 package | 
|---|
| 46 |   PATH=/usr/i586-mingw32msvc/bin:$PATH | 
|---|
| 47 |   CC=/usr/bin/i586-mingw32msvc-gcc | 
|---|
| 48 |   CXX=/usr/bin/i586-mingw32msvc-g++ | 
|---|
| 49 | else | 
|---|
| 50 |   # variant of debian mingw32 package? | 
|---|
| 51 |   PATH=/usr/i386-mingw32msvc/bin:$PATH | 
|---|
| 52 |   CC=/usr/bin/i386-mingw32msvc-gcc | 
|---|
| 53 |   CXX=/usr/bin/i386-mingw32msvc-g++ | 
|---|
| 54 | fi | 
|---|
| 55 | wxc=/usr/lib/wx/config/i586-mingw32msvc-msw-unicode-release-static-2.8 | 
|---|
| 56 | # Passing -Werror to configure causes AC_CHECK_FUNCS to fail, so pass it to | 
|---|
| 57 | # make instead. | 
|---|
| 58 | ./configure --host=mingw32 --build="$build_platform" CC="$CC" CXX="$CXX" CXXFLAGS="-fno-strict-aliasing -Werror" WX_CONFIG="$wxc" LDFLAGS=-s | 
|---|
| 59 | make CFLAGS=-Werror | 
|---|
| 60 | make mingw_iss | 
|---|
| 61 | PATH=$SAVE_PATH | 
|---|
| 62 |  | 
|---|
| 63 | mv survex-win32-*.exe .. | 
|---|
| 64 | cd .. | 
|---|
| 65 |  | 
|---|
| 66 | if test x"$rel" = xyes ; then | 
|---|
| 67 |   rm -rf "$tardir" | 
|---|
| 68 | fi | 
|---|