[d7acd89] | 1 | #! /bin/sh |
---|
[ae1309f] | 2 | |
---|
[098acb1] | 3 | set -e |
---|
| 4 | |
---|
[ae1309f] | 5 | rel=yes |
---|
[e66be9a] | 6 | if test x"$1" = x-t ; then |
---|
[ae1309f] | 7 | rel= |
---|
[f30265a0] | 8 | shift |
---|
[d7acd89] | 9 | fi |
---|
[dd7674d] | 10 | |
---|
[ae1309f] | 11 | if test x"$rel" = xyes ; then |
---|
[9d5aa63] | 12 | # Check there are no uncommitted changes. |
---|
| 13 | if git commit -a --dry-run >/dev/null 2>/dev/null ; then |
---|
| 14 | echo 'There are uncommitted changes - please rectify' |
---|
[d2980d2] | 15 | echo 'If you just want to test, run with option -t' |
---|
| 16 | exit 1 |
---|
| 17 | fi |
---|
[098acb1] | 18 | |
---|
[d2980d2] | 19 | test ! -f Makefile || make distclean |
---|
| 20 | cp -u /usr/share/misc/config.guess . |
---|
| 21 | cp -u /usr/share/misc/config.sub . |
---|
[f5baa8c] | 22 | mv INSTALL INSTALL.keep |
---|
[d2980d2] | 23 | autoreconf --force -i |
---|
[f5baa8c] | 24 | mv INSTALL.keep INSTALL |
---|
[d2980d2] | 25 | ./configure CC=gcc CXX=g++ |
---|
[1a2570d] | 26 | make distcheck |
---|
[44ef5ec6] | 27 | # FIXME: setting c89 doesn't define unix and suppresses getc_unlocked(). |
---|
[d2980d2] | 28 | # Tell the preprocessor to be C89 - this makes it reject // comments |
---|
| 29 | # FIXME -Werror makes configure explode CFLAGS="-Werror -Wp,-std=c89" |
---|
| 30 | # FIXME CXXFLAGS="-Werror" |
---|
[f78ad72] | 31 | else |
---|
[d2980d2] | 32 | make dist |
---|
[e719df1] | 33 | fi |
---|
[098acb1] | 34 | |
---|
[d2980d2] | 35 | # Perform mingw build on a clean unpacked source tree from the release tarball |
---|
| 36 | # so that (a) we don't need to "make distclean" on the source tree and (b) we |
---|
| 37 | # ensure that any files required to build the mingw version and installer |
---|
| 38 | # package are actually shipped in the source tarball. |
---|
[a6bb1fa6] | 39 | tarball=`ls -1t survex-1*.tar.gz|head -n1` |
---|
[d2980d2] | 40 | tardir=`basename "$tarball" .tar.gz` |
---|
| 41 | rm -rf "$tardir" |
---|
| 42 | tar xf "$tarball" |
---|
| 43 | cd "$tardir" |
---|
[098acb1] | 44 | |
---|
[0fd6750] | 45 | test -n "$build_platform" || build_platform=`sh config.guess` |
---|
| 46 | SAVE_PATH=$PATH |
---|
[d380cd6] | 47 | for wxc in \ |
---|
[a989777] | 48 | /usr/i586-mingw32msvc/lib/wx/config/i586-mingw32msvc-msw-unicode-static-3.0 \ |
---|
[d380cd6] | 49 | /usr/lib/wx/config/i586-mingw32msvc-msw-unicode-release-static-2.8 \ |
---|
| 50 | /usr/lib/wx/config/i686-w64-mingw32-msw-unicode-release-static-2.8 \ |
---|
| 51 | "" ; do |
---|
| 52 | if test -z "$wxc" ; then |
---|
| 53 | echo "wx-config for mingw not found" >&2 |
---|
| 54 | exit 1 |
---|
| 55 | fi |
---|
| 56 | if test -x "$wxc" ; then |
---|
| 57 | CC=`$wxc --cc` |
---|
| 58 | CXX=`$wxc --cxx` |
---|
| 59 | break |
---|
| 60 | fi |
---|
| 61 | done |
---|
| 62 | case $CC in |
---|
| 63 | *i586-mingw32msvc-gcc) |
---|
| 64 | # debian mingw32 package |
---|
| 65 | PATH=/usr/i586-mingw32msvc/bin:$PATH |
---|
| 66 | ;; |
---|
| 67 | *i386-mingw32msvc-gcc) |
---|
| 68 | # debian mingw32 package |
---|
| 69 | PATH=/usr/i386-mingw32msvc/bin:$PATH |
---|
| 70 | ;; |
---|
| 71 | esac |
---|
| 72 | |
---|
[d2980d2] | 73 | # Passing -Werror to configure causes AC_CHECK_FUNCS to fail, so pass it to |
---|
| 74 | # make instead. |
---|
[db095f9] | 75 | ./configure --host=mingw32 --build="$build_platform" CC="$CC" CXX="$CXX" CXXFLAGS="-g -O2 -fno-strict-aliasing -Werror" WX_CONFIG="$wxc" LDFLAGS='-s -static' |
---|
[0fd6750] | 76 | make CFLAGS=-Werror |
---|
| 77 | make mingw_iss |
---|
| 78 | PATH=$SAVE_PATH |
---|
| 79 | |
---|
[d2980d2] | 80 | mv survex-win32-*.exe .. |
---|
| 81 | cd .. |
---|
| 82 | |
---|
| 83 | if test x"$rel" = xyes ; then |
---|
| 84 | rm -rf "$tardir" |
---|
| 85 | fi |
---|
[7b12c6d] | 86 | |
---|
[9c9fd6b] | 87 | VERSION=`sed 's/^VERSION *= *//p;d' Makefile` |
---|
[8430216] | 88 | FILES="survex-$VERSION.tar.gz survex-win32-$VERSION.exe" |
---|
| 89 | echo "SHA1 checksums:" |
---|
| 90 | sha1sum $FILES |
---|
| 91 | echo |
---|
| 92 | |
---|
[179a57b] | 93 | gpg --detach-sign --armour $FILES |
---|
| 94 | for f in $FILES ; do |
---|
| 95 | FILES="$FILES $f.asc" |
---|
| 96 | done |
---|
| 97 | |
---|
[8430216] | 98 | echo "To tag this release and upload it to the webserver, run:" |
---|
[9d5aa63] | 99 | echo git tag -m"'Tagging $VERSION'" "$VERSION" |
---|
[e11c235] | 100 | |
---|
| 101 | HOST=atreus.tartarus.org |
---|
| 102 | echo ssh "$HOST" mkdir /srv/www/survex.com/software/"$VERSION" |
---|
[8430216] | 103 | echo scp $FILES "$HOST":/srv/www/survex.com/software/"$VERSION" |
---|