1 | #! /bin/sh |
---|
2 | |
---|
3 | set -e |
---|
4 | |
---|
5 | # flags to consider: |
---|
6 | # CFLAGS="-O2 -fomit-frame-pointer" |
---|
7 | # CXXFLAGS="-O2 -fno-rtti -fomit-frame-pointer" |
---|
8 | rel=yes |
---|
9 | if test x"$1" = x-t ; then |
---|
10 | rel= |
---|
11 | shift |
---|
12 | fi |
---|
13 | |
---|
14 | if test x"$rel" = xyes ; then |
---|
15 | # Check everything is checked into SVN. |
---|
16 | if svn st | grep -v '^?' | grep . > /dev/null 2> /dev/null ; then |
---|
17 | echo There are changes not checked into SVN - please rectify |
---|
18 | exit 1 |
---|
19 | fi |
---|
20 | fi |
---|
21 | |
---|
22 | test ! -f Makefile || make distclean |
---|
23 | |
---|
24 | if test yes = "$rel" ; then |
---|
25 | cp -u /usr/share/misc/config.guess . |
---|
26 | cp -u /usr/share/misc/config.sub . |
---|
27 | fi |
---|
28 | |
---|
29 | autoreconf --force -i |
---|
30 | ./configure CC=gcc CXX=g++ |
---|
31 | if test yes = "$rel" ; then |
---|
32 | export CFLAGS |
---|
33 | export CXXFLAGS |
---|
34 | # tell the preproceesor to be C89 - this makes it reject // comments |
---|
35 | # FIXME -Werror makes configure explode CFLAGS="-Werror -Wp,-std=c89" |
---|
36 | # FIXME CXXFLAGS="-Werror" |
---|
37 | CFLAGS="-Wp,-std=c89" |
---|
38 | CXXFLAGS= |
---|
39 | make distcheck |
---|
40 | CFLAGS= |
---|
41 | CXXFLAGS= |
---|
42 | else |
---|
43 | make dist |
---|
44 | fi |
---|
45 | |
---|
46 | make distclean |
---|
47 | |
---|
48 | test -n "$build_platform" || build_platform=`sh config.guess` |
---|
49 | SAVE_PATH=$PATH |
---|
50 | if test -d /usr/i586-mingw32msvc/bin ; then |
---|
51 | # debian mingw32 package |
---|
52 | PATH=/usr/i586-mingw32msvc/bin:$PATH |
---|
53 | CC=/usr/bin/i586-mingw32msvc-gcc |
---|
54 | CXX=/usr/bin/i586-mingw32msvc-g++ |
---|
55 | else |
---|
56 | # variant of debian mingw32 package? |
---|
57 | PATH=/usr/i386-mingw32msvc/bin:$PATH |
---|
58 | CC=/usr/bin/i386-mingw32msvc-gcc |
---|
59 | CXX=/usr/bin/i386-mingw32msvc-g++ |
---|
60 | fi |
---|
61 | wxc=/usr/lib/wx/config/i586-mingw32msvc-msw-unicode-release-static-2.8 |
---|
62 | # -Werror here causes AC_CHECK_FUNCS to fail. |
---|
63 | CFLAGS= |
---|
64 | CXXFLAGS='-fno-strict-aliasing -Werror' |
---|
65 | ./configure --host=mingw32 --build="$build_platform" CC="$CC" CXX="$CXX" CFLAGS="$CFLAGS" CXXFLAGS="$CXXFLAGS" WX_CONFIG="$wxc" LDFLAGS=-s |
---|
66 | make CFLAGS=-Werror |
---|
67 | make mingw_iss |
---|
68 | PATH=$SAVE_PATH |
---|
69 | |
---|
70 | make distclean |
---|