source: git/make_release @ 64a9dc6

RELEASE/1.2debug-cidebug-ci-sanitiserswalls-data
Last change on this file since 64a9dc6 was 148c993, checked in by Olly Betts <olly@…>, 5 years ago

Don't error out on new GCC9 warnings

The wx headers currently trigger two new GCC9 warnings. The wx
developers are aware of this, but it's not yet been addressed.

  • Property mode set to 100755
File size: 3.5 KB
Line 
1#! /bin/sh
2
3# This script automates most of the process on making a new release.
4
5set -e
6
7rel=yes
8if test x"$1" = x-t ; then
9   rel=
10   shift
11fi
12
13if test x"$rel" = xyes ; then
14  cd src
15  perl -e 'while (<>) { if (m!(.*)//! && $1 !~ / \* /) {print "$ARGV:$.:// comment in C source\n"; exit 1}} continue { close ARGV if eof }' \
16      *.c \
17      cavern.h commands.h cmdline.h date.h datain.h debug.h\
18      filelist.h filename.h getopt.h hash.h img.c img.h img_hosted.h\
19      listpos.h matrix.h message.h namecmp.h netartic.h netbits.h\
20      netskel.h network.h osalloc.h osdepend.h ostypes.h out.h readval.h str.h\
21      useful.h validate.h whichos.h
22  cd ..
23
24  # Check there are no uncommitted changes.
25  if git commit -a --dry-run >/dev/null 2>/dev/null ; then
26    echo 'There are uncommitted changes - please rectify'
27    echo 'If you just want to test, run with option -t'
28    exit 1
29  fi
30
31  test ! -f Makefile || make distclean
32  cp -u /usr/share/misc/config.guess .
33  cp -u /usr/share/misc/config.sub .
34  mv INSTALL INSTALL.keep
35  autoreconf --force -i
36  mv INSTALL.keep INSTALL
37  ./configure CC=gcc CXX=g++
38  # Don't error out on new GCC8 and GCC9 warnings for now.
39  make CFLAGS='-Werror' CXXFLAGS='-Werror -Wno-error=cast-function-type -Wno-error=deprecated-copy -Wno-error=ignored-qualifiers'
40  VALGRIND=valgrind make distcheck VERBOSE=1
41else
42  make dist
43fi
44
45# Perform mingw build on a clean unpacked source tree from the release tarball
46# so that (a) we don't need to "make distclean" on the source tree and (b) we
47# ensure that any files required to build the mingw version and installer
48# package are actually shipped in the source tarball.
49tarball=`ls -1t survex-1*.tar.gz|head -n1`
50tardir=`basename "$tarball" .tar.gz`
51rm -rf "$tardir"
52tar xf "$tarball"
53cd "$tardir"
54
55test -n "$build_platform" || build_platform=`sh config.guess`
56SAVE_PATH=$PATH
57for wxc in \
58  /usr/i686-w64-mingw32/lib/wx/config/i686-w64-mingw32-msw-unicode-static-3.0 \
59  /usr/i586-mingw32msvc/lib/wx/config/i586-mingw32msvc-msw-unicode-static-3.0 \
60  "" ; do
61  if test -z "$wxc" ; then
62    echo "wx-config for mingw not found" >&2
63    exit 1
64  fi
65  if test -x "$wxc" ; then
66    CC=`$wxc --cc`
67    CXX=`$wxc --cxx`
68    break
69  fi
70done
71host=mingw
72case $CC in
73  *i686-w64-mingw32-gcc)
74    # debian mingw package
75    host=i686-w64-mingw32
76    ;;
77  *i586-mingw32msvc-gcc)
78    # debian mingw32 package
79    host=i586-mingw32msvc
80    ;;
81  *i386-mingw32msvc-gcc)
82    # debian mingw32 package
83    host=i386-mingw32msvc
84    ;;
85esac
86PATH=/usr/$host/bin:$PATH
87
88# Passing -Werror to configure causes AC_CHECK_FUNCS to fail, so pass it to
89# make instead.
90cross_pkg_config_path=`echo "$wxc"|sed 's,/lib/.*,/lib/pkgconfig,'`
91PKG_CONFIG_PATH=$cross_pkg_config_path \
92PKG_CONFIG_LIBDIR=$cross_pkg_config_path \
93  ./configure --host="$host" --build="$build_platform" WX_CONFIG="$wxc" \
94      CC="$CC" CXX="$CXX" CXXFLAGS="-g -O2 -fno-strict-aliasing -Werror" \
95      LDFLAGS='-s -static'
96make CFLAGS='-g -O2 -Werror'
97make mingw_iss
98PATH=$SAVE_PATH
99
100mv survex-win32-*.exe ..
101cd ..
102
103if test x"$rel" = xyes ; then
104  rm -rf "$tardir"
105else
106  exit 0
107fi
108
109VERSION=`sed 's/^VERSION *= *//p;d' Makefile`
110FILES="survex-$VERSION.tar.gz survex-win32-$VERSION.exe"
111echo "SHA256 checksums:"
112sha256sum $FILES
113echo
114
115for f in $FILES ; do
116    gpg --detach-sign --armour "$f"
117    FILES="$FILES $f.asc"
118done
119
120echo "To tag this release and upload it to the webserver, run:"
121echo git tag -s -m"'Survex $VERSION'" "$VERSION"
122
123HOST=thyestes.tartarus.org
124echo ssh "$HOST" mkdir /srv/www/survex.com/software/"$VERSION"
125echo scp $FILES "$HOST":/srv/www/survex.com/software/"$VERSION"
Note: See TracBrowser for help on using the repository browser.